chore(contract): phase 4b criterion 9 proven live (/clear half), 4c follow-up noted

This commit is contained in:
bchanot committed 2026-11-04 18:13:59 +01:00
1 parent ffa12998c8
commit b5e1644a84
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -116,6 +116,7 @@ Shared rules for every phase:
- Built 2026-11-04 on feature/memory-capture (f1d4f9d..HEAD): mod `mods/memory`, kit 100+ cases, consumers wired, noise measured (NOISE.md); merge pending (gates, review, user go)
- shortcut: `mods/memory/hooks/register.ts` `isSuperseded` is a lexical reader, not memory.sh's status parser; upgrade = share that parser when 4c needs it (final review M11)
- **4c read side (next).** Two channels only: intent recall at `prompt.submit` for classifier labels design/analysis or the first coding prompt after idle (BM25 top-30 over title + lesson + body → haiku keeps ≤3, bounded 3 s, fail open) and tool-error 4-gram match (PostToolUse; a classic hook is acceptable if the mod ledger is not needed). Session digest (open BLK via the status parser, actionable TODO, last journal line) in `hooks/session-start.sh` on `source: startup|compact|clear` (native matchers; the mod's `session.compact` only skips); a SubagentStart twin if sub-agents need it. Injection = ID + title + lesson line; superseded never injected; budget ~1.5k chars per turn; once per context. Deferred: Read path triggers, Bash command triggers, "critical → deny once", Tier 1, cross-repo scope=global index, `memory_search` tool.
- 4c follow-up from the 4b live proof (2026-11-04): `memory_pending` lists milestones of the current session only, so a `/capitalize` run right after `/clear` misses the previous session's `fix:`/finish milestones (they stay in the store). Option: list earlier-session milestones marked `(earlier session)`. Doctrine (capitalize before /clear) covers the normal path.
- **4d feedback and promotion.** DEFERRED until a plain injection log (ID, trigger kind, turn, cited or not) shows misses or noise; then /prune-memory reads it and promotion to a mechanism follows BDR-100.
- Proof: recall precision on ≥20 real prompts and ≥10 real errors, target ≥ the 14/22 baseline; digest after a real compaction; redaction test on the ledger; `/context` delta; captured-failure demo: an error from session N recalled in session N+1.
@@ -77,5 +77,5 @@ STEP 3 gate `[gated 2026-11-04]` (user: "oui aux deux, lance"): plan r3 (`docs/s
## PROOF (Task 9)
- Step 0 (2026-11-04, user go): `~/.claude/memory.json` moved to `$CLAUDE_JOB_DIR/tmp/memory.json.off`; capture is on from the next session.
- Step 1 headless (2026-11-04 12:08, `claude -p --model haiku`, live user settings, mod `memory@skills-dir`, scratch repo `$CLAUDE_JOB_DIR/tmp/proof9/repo.gYdo` on `feature/probe`, `GITFLOW_NO_PUSH=1`, fixture `.claude/memory/blockers.md` with one unrelated BLK): four tool calls as scripted (ToolSearch select, `ls /nonexistent-dir-xyz`, `git commit --allow-empty -m "fix: probe"`, `mcp__memory__memory_pending {}`), rc 0, cost $0.011. Answer: `memory_pending (project repo.gYdo, 1 session(s))` / `index: read blockers.md; skipped learnings.md (missing)` / `milestones (this session): - commit fix: probe (12:08)` (UTC at the time; local time after final review M5) / `failures: - NEW ×1 ls: cannot access '/nonexistent-dir-xyz': No such file or directory — command: ls /nonexistent-dir-xyz` + excerpt. Log: `$CLAUDE_JOB_DIR/tmp/proof9/out.jsonl`. The run leaves a `p:<tmp path>` key (one session, ~1 KiB) in the real store; the 1 MiB sweep drops it only when the store is over the cap (final review M10 corrected R3 conf 12), harmless.
- Step 3 interactive (user + model, R3 conf 5), 2026-11-04 18:09, fresh session in a `mktemp -d` repo on `feature/probe`, mod on (switch moved): the model ran `git commit --allow-empty -m "fix: probe"` (c942932); the user sent `bonjour` twice. Transcript `~/.claude/projects/-tmp-tmp-p4b4S2nmmV/5ee2ac74-….jsonl`: line 69, one `UserPromptSubmit` attachment parented to the first `bonjour` (uuid c70ef271) carrying `memory: commit fix: probe — 0 new failure mode(s) this session; /capitalize when ready.`, mirrored in that turn's API request (line 70); the second `bonjour` (line 79) carries none. Note half PASS. /clear half: pending (user: `/clear` then a `memory_pending` call lists the probe session `(earlier session)`).
- Step 3 interactive (user + model, R3 conf 5), 2026-11-04 18:09, fresh session in a `mktemp -d` repo on `feature/probe`, mod on (switch moved): the model ran `git commit --allow-empty -m "fix: probe"` (c942932); the user sent `bonjour` twice. Transcript `~/.claude/projects/-tmp-tmp-p4b4S2nmmV/5ee2ac74-….jsonl`: line 69, one `UserPromptSubmit` attachment parented to the first `bonjour` (uuid c70ef271) carrying `memory: commit fix: probe — 0 new failure mode(s) this session; /capitalize when ready.`, mirrored in that turn's API request (line 70); the second `bonjour` (line 79) carries none. Note half PASS. /clear half, first try: `memory_pending: nothing captured` after /clear — by design (spec Unit 5, criterion 4: milestones shown for the current session only; earlier sessions contribute failures; the probe session had none; its record with the milestone was in the store). Second try, same session, 18:13: `ls /nonexistent-dir-probe` failed, then /clear, then the tool answered `memory_pending (project tmp.p4b4S2nmmV, 2 session(s))` / `index: skipped blockers.md (missing), learnings.md (missing)` / `- NEW ×1 (earlier session) ls: cannot access '/nonexistent-dir-probe': No such file or directory — command: ls /nonexistent-dir-probe` + excerpt. /clear half PASS: criterion 9 proven live.