chore(memory): router ask-tier — BDR-135, LRN-254/255, EVAL-055, journal; contract + plan r3

This commit is contained in:
bchanot committed 2026-11-02 16:30:56 +01:00
1 parent 789fd00b23
commit 19dc1da424
6 files changed
+478

No files matched your search

+10
View File
@@ -1911,3 +1911,13 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s
- **Pattern**: commit a change to a tracked file whose working copy carries uncommitted writes you must keep (settings.json UI writes): `git show HEAD:f | jq '<edit>' > tmp && git update-index --cacheinfo 100644,"$(git hash-object -w tmp)",f && git commit`, then patch the working copy with jq into a temp file and `cp` it back. Never `git checkout -- f`, never `git stash` (pop can take someone else's stash), never `git add -p` (interactive, unavailable), never `jq … > f` (truncates on failure).
- **Context**: phase 5 Task 13 listing budget; BLK-039.
- **Apply**: any commit to settings.json or another file the harness writes to.
## LRN-254 — A route-event dialog stamps every slot the event armed; trace slot lifecycle before storing a choice (2026-11-02)
- **Pattern**: a dialog answered at a route event must stamp EVERY slot the event armed, not the one in hand. `armTypedSkill` → `routeMainBySkill` derives `runMain = { ...turn }` BEFORE `confirmSkill` runs; a choice written on `turnMain` after dies at `endMainTurn` (turnMain nulled), run falls back to the choice-less runMain → "Opus instead" lasted one turn. Three blind lenses (correctness, robustness, simplicity) hit the same BLOCKER on plan r1.
- **Context**: feat router-ask-tier plan r1 → r2, `mods/model-router/hooks/register.ts` (`routeMainBySkill` ~3485, `confirmSkill` ~2984, `endMainTurn` ~4042).
- **Apply**: before storing state on a slot, trace its lifecycle: who writes it, who copies it (spread = snapshot, not link), who nulls it, who outranks it (`mainModelSlot` precedence). Stamp the asked slot + the derived one; inherit only same-tier, non-typed. Read the real decision (`snapshot`/`decideMain`) instead of rebuilding it from parts.
## LRN-255 — gates.sh run rewrites contract evidence; re-audit of merged contracts: attribute drift by git log -S, then restore (2026-11-02)
- **Pattern**: `bash lib/gates.sh run <contract>` REWRITES the `EVIDENCE:` lines of the contract file. Re-running a merged contract's gates for an audit: (1) oracles frozen on a base SHA (`c1-*.sh` vs develop 017a28b) read NOT-MET on later GATED changes (phase 5 added a pack-extras line to `rules/web-building.md`; 3330f0b restored "(dispatcher applies)" → 209/205 chars; 7899670 dropped `memory:`), (2) a CHECK string pinned to a test name goes stale after a review rename (`T10h-no-jq-rc0` → `T10h-empty-path-rc0`, 0b59687). Neither is a repo defect.
- **Context**: 2026-11-02 BDR-125 re-verification, 5 contracts re-gated: phase 5 / memory v2 write / minors MET, phase 0 UNMET(1), phase 1 UNMET(2), all explained by `git log -S`.
- **Apply**: on a re-audit, run gates, attribute each NOT-MET with `git log -S'<text>' -- <file>` to a gated commit, then `git checkout -- <contract>` to keep the ship-time evidence (historical record). Never commit re-run evidence over a merged contract.