Doenexecutor memory research
Prompt 1
I am consinder reverting to the last commit where the application was still grounded in research, which I think was 994be149239e5f9758b5adb376addeaea4096e27. Could you have a look and see what makes sense.
Tool call: Bash
cd /Users/edobalvers/Develop/ehtb/doen; git log -1 --format='%h %ad %s' 994be149; echo; git rev-list --count 994be149..HEAD; git log --oneline 994be149..HEAD | head -80; echo; git diff --stat 994be149 HEAD | tail -3
Result
994be149 Sun Jun 28 11:47:11 2026 +0200 docs: update RESEARCH_LOG to document recent architectural changes including ...

192
b3d42135 fix: review findings on record_work
f5d3e9fd docs: measure recorded work by what people undo, not by retrieval co...
9e487b02 docs: recording work done without a spec
dc3ea5b0 feat(web): recorded work on the project page, with undo
b71b9bc7 feat: record_work — executors record work done without a spec
031d90b8 feat: executors can propose removing an item while the spec is a draft
b25c8e6c fix: review findings on iterating after draft
23d9e966 docs: iterating on a spec after draft
4cdf57a8 feat: the Advisor routes feedback while building
e01c79c2 feat: redraft a spec in a direction from the conversation
f14c5133 feat: keep drafts at the product level
18b18937 feat(web): change a spec while building, with a reason for confirmed...
0ffc040f feat: a spec changes in building and learning, through proposals and...
b43cfcc3 docs(web): state transitions now bump the spec version
d7b06378 fix: completing without learnings bumps the spec version
df338cbc fix: revert-to-draft bumps the spec version
9d6b067a fix: start-building bumps the spec version
07db609a style: reduce max container width from 1440px to 1340px across layou...
060395b2 feat(web): responsive 1440px layout instead of a widen switch
74681290 fix: review findings on the conversation rework
0d201a6a docs: research log entry for the conversation rework
f920489e perf: cheaper Advisor turns — prompt caching, shorter older history,...
59fab623 feat(web): the conversation shows the Advisor's step, time so far an...
1de89864 feat: stream the Advisor's turn — step, reply text as written, then ...
78f7b1d5 feat(web): Advisor suggestions appear on the spec items they change;...
ba279d67 feat(web): a taller, widenable conversation with a growing input and...
ee5a8180 feat: accepting an Advisor suggestion confirms it, and the Advisor c...
7fbd73d0 perf: drop the per-turn importance validation nobody saw
f03be160 docs: research log entry for draft-before-rating
41b3a43b feat(web): one Build/Research choice in the form, and drafting shows...
216f1c22 feat: show a drafted spec before its items are rated
f4205815 fix(web): new-initiative form can't double-submit and keeps the sugg...
79a4fd39 docs: research log entry for accepting corrections
417de4cc feat(web): accept or undo a correction with confirmation; details be...
ca5aae0b prompt: two-sentence correction summary that says what to check
96723978 feat: a person can accept a memory correction
d94b536e docs: why correction suggestions are advisory and gated
… (17 more lines)
Tool call: Bash
cd /Users/edobalvers/Develop/ehtb/doen; git log --oneline 994be149..HEAD | sed -n 50,192p | grep -viE '^\w+ (style|fix|test|chore)' ; echo ---; grep -nE '^#{1,3} ' RESEARCH_LOG.md | head -70; echo ---; git show 994be149:RESEARCH_LOG.md | grep -nE '^#{1,3} ' | head -25
Result
2b17f65e refactor!: remove the open-decision machinery, which nothing could r...
---
1:# Project Evolution & Research Log
7:## [Current Phase] Product Development, Precedent, and Groundedness (BD-107 →)
12:### Recording work done without a spec (2026-10-12)
38:### Iterating on a spec after draft (2026-10-12)
91:### The conversation: faster turns, one accept, and suggestions on the items they change (2026-10-09)
145:### A new initiative shows its draft before the draft is rated (2026-10-09)
174:### Memory corrections can be accepted, and lead with a two-sentence summary (2026-10-09)
196:### Memory corrections get a summary and a suggestion, and move above the initiatives (2026-10-09)
238:### Memory corrections: the executor fixes it, a person can take it back (2026-10-09)
293:### Decisions at the centre of drafting, and a lighter path for small work (2026-10-08)
331:### A cleanup pass: what nothing reads, and a contract nobody had checked (2026-10-08)
372:### Retiring a decision from precedent, and a token in front of the API (2026-10-07)
408:### Auto-confirm off by default, an opt-in lock on reshape, and words instead of enums (2026-10-07)
444:### Closing the criteria lifecycle's no-human path, and prompts that outlived their systems (2026-10-07)
501:### Removing drift reports: a human queue nobody could act on (2026-10-07)
556:### The verification card is read by a designer, so stop showing them a test transcript (2026-10-07)
628:### The left-hand gate: letting the reviewer confirm spec items (2026-10-05)
692:### BD-107: giving the "a person should decide this" half a mechanism (2026-10-05)
753:### Dropping the flywheel's schema, and the dead code the strip left behind (2026-10-05)
812:### Capture before retrieval: giving human product reasoning somewhere to go (2026-10-05)
874:### The suite was paying for live models, and nobody could see it (2026-10-04)
930:### Removing the heuristic flywheel: what a 228-rule corpus actually cost (2026-10-02)
984:### The reframe, and the three measurements behind it (2026-10-02)
1050:## [Previous Phase] Shifting to Oversight (BD-12 to BD-105)
1054:### A capability nobody used, and the number that was missing (BD-104)
1112:### Auto-approval is an authoring problem, and the guard on it was dead (BD-105)
1175:### Two correct decisions that composed into a dead pipeline (BD-102)
1231:### The tier that wasn't: closing the standalone admission door (BD-101)
1291:### Two-tier heuristic corpus: gate citability, then relax recall (BD-97)
1439:### Tightening five decision gates: two more Jev swaps, three enum collapses (BD-95)
1502:### Jev: swapping four judgment calls onto a typed-choice provider
1553:### Offline flywheel bench: iterate against frozen ground data
1608:### Cleanup pass: obsolete schema, dead code, consolidated-only heuristics
1723:### BD-89: Heuristic Flywheel Reset — keep, improve, delete
1781:### BD-87: Heuristic Check-Proposal Pathway + Gardener 2-Member Fix
1863:### BD-84: Heuristic Subsystem Efficiency & Audit Pass
1921:### BD-83: Dream-Phase Corpus Health Pass
1942:### BD-80: Deterministic Retrieval Baseline
… (58 more lines)
Tool call: Bash
cd /Users/edobalvers/Develop/ehtb/doen; git ls-tree --name-only 994be149 backend/migrations/ | tail -2; ls backend/migrations | tail -2; ls backend/migrations | wc -l; git ls-tree --name-only 994be149 backend/migrations/ | wc -l; sed -n 984,1050p RESEARCH_LOG.md
Result
backend/migrations/0035_pre_registration_stamps.sql
backend/migrations/0036_drop_pre_registration_stamps.sql
0068_memory_correction_accept.sql  744B
0069_recorded_work.sql  917B
      69
      36
### The reframe, and the three measurements behind it (2026-10-02)

- **Intent:** The goal shifts from "the system learns engineering rules" to "the system records how
  comparable product calls were made, and the artifact it produces can be trusted." Three
  measurements forced it, each of which contradicted something the project believed.

- **Research thinking:**

  _The flywheel's metric was circular, which is why nothing caught it for twenty initiatives._ Its
  purpose is better specs; every number used to judge it measured activity instead. A citation is
  written when the drafting model mentions a rule id in text it generated, and the retrieval bench
  harvested "citations for relevance" as ground truth — so the eval was scored against labels the
  thing under evaluation produced. 228 rules, 5 usable. BD-89 had already stripped the subsystem
  once and it regrew into the same shape. The deciding detail is BD-101's own accepted cost: 42 of 44
  citations landed on rules the change made unusable, meaning the rules people actually used were the
  standalone ones BD-97 had argued for all along.

  _Precedent is the asset, and it was sitting underneath._ From the same history: 24 resolved
  decisions, 23 carrying both a rationale and the rejected alternatives — 96% complete, each
  authored by a human choosing between stated options. A heuristic is a lossy compression of a
  decision that discards the situation making it true; precedent keeps it. A first retrieval
  prototype (`store.get_precedent`) was built and measured in a day: it surfaces what `get_context`
  drops — `_decision_text` embeds question + chosen + rationale and omits the rejected options, which
  for precedent is most of the value.

  _Then the measurement invalidated itself, usefully._ `app/measure_precedent.py` scored 76.5% of
  decisions as having relevant prior art. Reading the 17 pairs, the real figure is ~18%: the top
  scores were artefacts of shared boilerplate prefixes ("Work Unit 1 (type-inference Jev
  migration):") rather than related questions. Two genuine signals survived — BD-97 retrieving the
  prior decision that established Jev auto-admission, and a BD-52 → BD-78 → BD-51 cluster of three
  initiatives separately deciding what cosine threshold means "substantially similar". That
  recurrence is exactly what the reframe wants surfaced.

  _And then the corpus composition invalidated the whole exercise._ The 24 decisions are almost
… (33 more lines)
Tool call: Bash
cd /Users/edobalvers/Develop/ehtb/doen; for r in 994be149 HEAD; do echo "== $r"; git show $r:backend/app/mcp_server.py | grep -c '@mcp.tool'; git ls-tree --name-only $r backend/app/services/ | wc -l; git ls-tree -r $r --name-only | grep -E '\.(py|tsx?)$' | xargs -I{} git show $r:{} 2>/dev/null | wc -l; done; git log --format='%ad' --date=short 994be149..HEAD | sort | uniq -c | awk '{print $2}' | sed -n '1p;$p'
Result
== 994be149
16
      12
   32886
== HEAD
19
      17
   37562
2026-10-08
2026-10-12
Claude
I'd advise against a hard revert to `994be149`. What it would cost is concrete. What it would win back mostly already exists in the current tree, or can be got back more cheaply.

**What that commit is.** It sits at BD-59 (28 June), just before the heuristic flywheel (BD-60 to BD-105) was built. It's 192 commits behind HEAD: 351 files changed, about 26.7k lines added and 17.7k removed. In RESEARCH_LOG terms it's the last point before the work that the 2 October reframe later called circular ("228 rules, 5 usable", "83 of 93 initiatives spent on Doen's own internals"). So I can see why it feels like the last grounded point.

**The catch: the flywheel is already gone.** The 2 October work removed it, its schema was dropped on 5 October, and a cleanup pass on 8 October cleared out what the strip left behind. Going back to 994be149 doesn't remove the flywheel. It removes the work done after the flywheel was removed, and much of that work rests directly on research:

- **The reframe and its measurements:** precedent rather than rules, and the finding that the real bottleneck is capturing decisions, not retrieving them (agents raised 25 of 25 decisions, people raised none).
- **Decision capture:** the DecisionLog panel requires a rationale and a rejected alternative. The "past calls on this" view, and retiring a misleading decision from precedent, came with it.
- **Groundedness checks:** memory corrections via `amend_memory`, with an undo panel. The audit of verification kinds came from the BD-105 numbers.
- **Safety and operational fixes:** the API token, auto-confirm off by default, the version bump on state transitions, and the offline test suite.

**A hard blocker.** That commit has 36 migrations and HEAD has 69. Any database that has run the newer ones, including whichever instance the MCP server points at, would be ahead of the old code. There are no down-migrations, so the old code would be running against a schema it doesn't know.

**What I'd suggest instead.** Keep HEAD and cut back what isn't grounded. The candidates are the 9 to 12 October features, which were added quickly and have no measurement behind them yet:
- The Advisor conversation rework: streaming, prompt caching, suggestions shown on items.
- The memory-correction summary and keep/undo suggestion, plus the accept flow.
- Iterating after draft and `record_work` (recording work done without a spec).

Each can be reverted on its own with `git revert` on its commits, and the migrations that only add things can stay.

What made you feel the app stopped being grounded? Was it particular features, the docs drifting, or the amount of surface area? Tell me which, and I'll map exactly which commits to revert and check whether they can be undone cleanly.
Every decision is recorded with what was ruled out and why. That record is the evidence.