Doenexecutor memory research
Prompt 5
no, let's change the model to openai/gpt-6-luna
Tool call: Bash
cd /Users/edobalvers/Develop/ehtb/doen/backend; S=/private/tmp/claude-501/-Users-edobalvers-Develop-ehtb-doen/116ce532-20d2-4e57-8d02-e6e82d949a5b/scratchpad; LLM_API_KEY=[redacted] variables -s backend --kv | grep '^LLM_API_KEY=[redacted] | cut -d= -f2-) DATABASE_URL=$(railway variables -s Postgres --kv | grep '^DATABASE_PUBLIC_URL=' | cut -d= -f2-) DOEN_LIVE_LLM=1 uv run python -m app.measure_memory_replay --model openai/gpt-6-luna --runs 3 --out $S/replay-gpt6luna.json 2>&1 | tail -4
Result
Command did not complete within its 600s timeout and was moved to the background (ID: b73jd8o4f). Output is being written to: /private/tmp/claude-501/-Users-edobalvers-Develop-ehtb-doen/116ce532-20d2-4e57-8d02-e6e82d949a5b/tasks/b73jd8o4f.output. You will be notified when it completes. It is running now: do not start a second copy while it runs. If it is no longer needed, stop it with TaskStop. No output had been read from it when it was moved. A program that buffers its output, or a pipe into one such as tail, can keep the output file empty until the command finishes. To check interim output, use Read on that file path.
Session cwd remains /Users/edobalvers/Develop/ehtb/doen/backend; directory changes made by the backgrounded command do not apply to subsequent commands.
Claude
The baseline is running on `openai/gpt-6-luna`: 3 seeds, 54 decisions each, against production. It took longer than 10 minutes, so it now runs in the background. I'll report the numbers once it finishes.
Tool call: Bash
S=/private/tmp/claude-501/-Users-edobalvers-Develop-ehtb-doen/116ce532-20d2-4e57-8d02-e6e82d949a5b; cat $S/tasks/b73jd8o4f.output; python3 -c "
import json;r=json.load(open('$S/scratchpad/replay-gpt6luna.json'))
for x in r['runs']:
  for p,s in x['by_project'].items(): print(x['seed'],p,{k:s[k] for k in ['n','stateless','memory','memory_only_right','stateless_only_right','memory_minus_stateless_second_half','errors']})
print(r['runs'][0]['final_memory']['resume-builder'][:1500])"
Result
{"seed": 0, "n": 54, "random": 0.335, "first": 0.333, "stateless": 0.556, "memory": 0.648, "memory_only_right": 6, "stateless_only_right": 1, "memory_minus_stateless_first_half": 0.074, "memory_minus_stateless_second_half": 0.111, "errors": 0}
{"seed": 1, "n": 54, "random": 0.335, "first": 0.37, "stateless": 0.556, "memory": 0.648, "memory_only_right": 7, "stateless_only_right": 2, "memory_minus_stateless_first_half": 0.111, "memory_minus_stateless_second_half": 0.074, "errors": 0}
{"seed": 2, "n": 54, "random": 0.335, "first": 0.444, "stateless": 0.648, "memory": 0.648, "memory_only_right": 5, "stateless_only_right": 5, "memory_minus_stateless_first_half": 0.037, "memory_minus_stateless_second_half": -0.037, "errors": 0}

[exited with code 0]
0 build-doen {'n': 15, 'stateless': 0.4, 'memory': 0.467, 'memory_only_right': 2, 'stateless_only_right': 1, 'memory_minus_stateless_second_half': 0.125, 'errors': 0}
0 resume-builder {'n': 39, 'stateless': 0.615, 'memory': 0.718, 'memory_only_right': 4, 'stateless_only_right': 0, 'memory_minus_stateless_second_half': 0.1, 'errors': 0}
1 build-doen {'n': 15, 'stateless': 0.4, 'memory': 0.533, 'memory_only_right': 2, 'stateless_only_right': 0, 'memory_minus_stateless_second_half': 0.25, 'errors': 0}
1 resume-builder {'n': 39, 'stateless': 0.615, 'memory': 0.692, 'memory_only_right': 5, 'stateless_only_right': 2, 'memory_minus_stateless_second_half': 0.05, 'errors': 0}
2 build-doen {'n': 15, 'stateless': 0.6, 'memory': 0.6, 'memory_only_right': 2, 'stateless_only_right': 2, 'memory_minus_stateless_second_half': -0.125, 'errors': 0}
2 resume-builder {'n': 39, 'stateless': 0.667, 'memory': 0.667, 'memory_only_right': 3, 'stateless_only_right': 3, 'memory_minus_stateless_second_half': -0.1, 'errors': 0}
Product: User-driven, AI-supported resume workflows. Users own/edit career history; AI reviews, enhances, and localizes on demand, never blocks. Keep career library distinct from editable application docs. Localization adapts structure, length, formatting, and culture. Verify shipped behavior/intent if specs stale; amend retired/unsatisfiable requirements, don't resurrect. Follow explicit updated prototypes; Tailwind/shadcn. Data/API: Preserve public/imported names and exact behavior in shared-code consolidation; existing tests unchanged. 401 unauthenticated; 404 nonexistent and cross-user resources (scope by user_id); test separately. `resumes.content` is one free-form Markdown document (e.g. `{"markdown":"..."}`), one Tiptap editor; no schema/headings/boundaries/inferred structure. GenAI handles downstream understanding. Renderer supports explicitly defined Markdown and ATS-safe output (RB-10 authority). Existing structured rows need conversion; JSONB alone doesn't migrate. Keep `profile_id NOT NULL`, seed from first resume; write back only by explicit promotion. Overview: title, dates, actions, archived date; no score (RB-9 removed scoring). Compliance persists only through targeted generation; reads don't recompute/persist. Duplicate only implemented fields: title, content, presentation, compliance, profile_version, job_target_id. Guidance: Queue is derived. Anchors `{quote, occurrence}`; validate exact substring/occurrence against current Markdown on read/accept; drop st
Tool call: Bash
python3 -c "
from math import comb;n=26;k=8;print(2*sum(comb(n,i) for i in range(k+1))/2**n)"
Result
0.07551869750022888
Tool call: Bash
cd /Users/edobalvers/Develop/ehtb/doen; python3 - <<'EOF'
p='RESEARCH_LOG.md'; s=open(p).read()
a=s.index('  _The model baseline could not be run._'); b=s.index('  _Hypotheses queued')
s=s[:a]+'''  _The baseline (`openai/gpt-6-luna`, temperature 0, 3 seeds, 400-word cap, 2026-11-26)._ Both
  the local and the production `LLM_API_KEY` were dead at first (OpenRouter 401), which had also
  taken production's LLM features down; the production key was re-enabled before this run. The
  harness had failed silently (54 errors per run), so it now stops as soon as every call fails.

  | seed | first | stateless | memory | memory-only right | stateless-only right |
  |---|---|---|---|---|---|
  | 0 | 0.333 | 0.556 | 0.648 | 6 | 1 |
  | 1 | 0.370 | 0.556 | 0.648 | 7 | 2 |
  | 2 | 0.444 | 0.648 | 0.648 | 5 | 5 |

  Stateless already beats chance by about 25 points: much of a person's choice can be read off the
  question. Memory adds about 6 points on average (0.648 against 0.587). Pooled over seeds the
  paired split is 18 against 8, and a two-sided sign test gives p = 0.076. That is suggestive, not
  established; the seeds are not independent samples of people, and seed 2 shows no gain at all.
  The gain does not grow in the second half of each project, which a learning loop should produce.

  _What the memory actually holds is the more important finding._ The final resume-builder file
  is a dense fact sheet of the project's settled design ("`resumes.content` is one free-form
  Markdown document", "keep `profile_id NOT NULL`", status-code rules), not heuristics about how
  the person decides. With no instruction about what kind of note to write, the model wrote down
  decisions, not reasons. So the six points may come from remembering earlier answers that later
  questions depend on, rather than from anything abstract. That is useful memory, but it is not
  the thing this phase is about, and the harness cannot yet tell the two apart.

'''+s[b:]
s=s.replace('''(1) a capped memory beats
… (7 more lines)
Result
74:  _Hypotheses queued, in order, none to be built before the baseline:_ (0) separate fact recall from
Claude
Memory helps a little in the baseline, and what the memory holds matters more than the gain. Run on `openai/gpt-6-luna`: 3 seeds, 54 decisions each, against production.

| seed | always first option | no memory | with memory | only memory right | only no-memory right |
|---|---|---|---|---|---|
| 0 | 0.333 | 0.556 | 0.648 | 6 | 1 |
| 1 | 0.370 | 0.556 | 0.648 | 7 | 2 |
| 2 | 0.444 | 0.648 | 0.648 | 5 | 5 |

- **Without memory the model already beats chance by about 25 points** (chance is 0.335). Much of a person's choice can be read off the question itself.
- **Memory adds about 6 points** (0.648 against 0.587). Pooled over the three seeds, memory was right on 18 questions the no-memory run got wrong, against 8 the other way. That gives p = 0.076, so it's suggestive but not established. Seed 2 shows no gain at all.
- **The gain doesn't grow in the second half of each project.** A real learning loop should show that.
- **The memory file isn't heuristics.** The final resume-builder file is a dense list of the project's settled design facts, for example "`resumes.content` is one free-form Markdown document" and "keep `profile_id NOT NULL`". It records what the person decided, not how they decide. So the 6 points may come from remembering earlier answers that later questions depend on, and nothing abstract. The eval can't yet tell those two apart.

That changes the plan. The next step is to make the eval separate remembered facts from abstract heuristics: score only questions whose answer doesn't follow from an earlier decision, or test whether one project's memory helps on the other project. Only after that does testing the "how it is known" note format make sense. I've written the numbers, the finding and the reordered hypotheses into the RESEARCH_LOG entry.

- **Local key:** `backend/.env` still has the dead key, so I ran with production's.
- **Not committed yet:** the docs, the eval, the prompts and the tests are all still uncommitted. Shall I commit them, then build the fact-versus-heuristic split?
Every decision is recorded with what was ruled out and why. That record is the evidence.