7.3 KiB
7.3 KiB
PLAN — recall-gate1-fixes (r2, after 3 lenses: correctness FATAL(7), robustness FATAL(4), simplicity CONCERNS(3))
Contract: .claude/tasks/contracts/2026-11-12-recall-gate1-fixes-1830.md
Changes from r1 (named)
- R1 BLOCKER (all 3 lenses):
promotedis not in_MEM_WORDS(lib/memory.sh:56-57) → status text =implemented, promoted to <mechanism>(leading word accepted, memory.sh untouched, classifier unchanged); RED-10e runs it throughmemory.sh statusin the sandbox. - R2 idle fixtures: NOTES (5 words) loses idle → new
NOTES8constant with 8+ content words and no rule word drives LO2, IR2/IR3, SP2; :2729 SUITE (5 words) flips to false; 7-word false / 8-word true pair; one 5-7-word end-to-end case after 31 min asks nothing; idle+DESIGN_RULE → keyword pinned. - R3 MAX_PICKS 2: SP1 (:2795-2813) updated to the 2-pick block size (it is the "3-ID answer → 2 injected" test; add a third live entry so 3 candidates really exist); TE9 (:3004-3021) rebuilt so the turn spends > budget − known-line before the checked line (pre-spend through a second known line refused, then a new prompt lets it through); no hardcoded "2" in the prompt template.
- R4 AC2 CHECK amended:
grep -c 'MAX_PICKS = 2' register.ts+ the test literal. - R5 D block prints header lines
tag\t<tag>anddate\t<FEEDBACK date>first, then rows; tag =basename#+{ sha1sum 2>/dev/null || shasum -a 1; }; items split on,, matched on prefixtag + " ", ID = last field (spaces/commas in basenames survive);no-git-rootwhengit rev-parsefails;no-feedback-runwhen the file is absent; unmatched tags present listed asother\t<tag>(visibility). - R6 idempotence:
promoterows dropped when the entry already has animplemented, promoted tostatus line;noisyrows dropped whengit log --since=<date> --grep="noisy-rewrite <ID>"finds a curation commit (STEP 3 namesnoisy-rewrite <ID>in the commit message). - R7 lesson field named: the rerank line is
id | title | lesson, lesson = first sentence (≤ 280 chars) of the first labelled field in order BDR Decision; LRN Apply → Future application → Pattern; BLK Solution → Real cause (register.ts LESSON_LABELS). Noisy rewrite narrows the title and THAT sentence only; a title or sentence under the NEGATION GUARD → skipped, reported as manual; prompt-channel noise only (tool matcher reads body backtick spans: limit stated). - R8 thresholds cited, never restated:
lib/memory-feedback/thresholds.tsT.noisyHits / T.promoteHits / T.promoteSessions. - R9 STEP 2: D is one run-level block after the per-registry blocks, fictional LRN-905/LRN-906, approve line keeps the
Approve per category?prefix and gainsd; no live ID, nostatus:, nofrontmatterin the new prose (RED-7/RED-9 guards); rows filtered to registries in$ARGUMENTS. Stale "STEP 3.4 NEGATION GUARD" citation (SKILL.md:236) fixed to 3.3. - R10 extract:
extract_block's heading regex"^## " h→"^#+ " h(no new helper); bun =command -v bunonly; root resolved once withgit -C "$S10" rev-parse --show-toplevelfor fixture and tagOf. - R11 docs: README.md:165 and USAGE.md:217 (5 words → idle needs 8, "at most 3" → 2) and USAGE.md:163 (/prune-memory: + feedback rewrite/promotion) go to STEP 6 doc sync (doc-syncer), BDR-140 status line in STEP 7 records the fix date and "later gate reads count rows after 2026-11-12 only".
- Deferred (TODO line, out of scope, lib/memory-feedback outside FILE SCOPE): retire the
thirdPickmetric/action and split pre-fix rows by date in metricsOf.
Files
mods/memory/hooks/register.ts- beside
MIN_CONTENT_WORDS(:1641):export const IDLE_MIN_WORDS = 8(comment: gate 1 2026-11-12, idle 44 % on short follow-ups). triggerKind:const words = tokensOf(text).length;< MIN_CONTENT_WORDS→ undefined; fresh → 'fresh';idleMs >= IDLE_MS && words >= IDLE_MIN_WORDS→ 'idle'; keyword branch unchanged.- :707
const MAX_PICKS = 2. Nothing else.
- beside
mods/memory/hooks/register.test.ts: import IDLE_MIN_WORDS; R2 + R3 edits (NOTES8, :2729 flip + 7/8 pair +IDLE_MIN_WORDS8 + idle+design → keyword expect, 5-7-word idle e2e case, SP1, TE9, :1991 text "at most 2").skills/prune-memory/SKILL.md: STEP 1### D. Feedback — noisy and promotion (phase 4d.4)(prose per R6-R8 + one bash block per R5/R6, ≤ 80 cols, mirrors thefor k in a:bidiom of STEP 1), STEP 2 run-level D block (R9), STEP 3 item 4 (noisy = narrow title + lesson sentence per R7, commit message carriesnoisy-rewrite <ID>; promotion =memory.sh status <ID> "implemented, promoted to <mechanism>"only, the mechanism = separate /feat named in the report), 3.4 → 3.3 citation fix.skills/prune-memory/tests/run-deterministic.sh: extract regex (R10); RED-10 a (match → rows + tag/date header), b (other tag only → no row,otherline), c (no file →no-feedback-run), d (bun present: fixture written withtagOf(<physical root>), the block emits its row; absent:RED-10d: SKIP), e (memory.sh statuson a sandbox LRN with the promotion text → rc 0, then the block drops that promote row), f (outside a git repo →no-git-root). Header comment updated.
Disposition
honors BDR-140 (4d.4 built because gate 1 reported noisy + promotion), BDR-100 (promotion = mechanism, thresholds in one file), BDR-129 (writes through memory.sh, single status vocabulary untouched), registry append-only via the curation exception already granted to C; BDR-125 (no per-turn nag) untouched.
r3 (confirmation CONCERNS(3), no BLOCKER; folded, no further challenge)
- C1/C2 noisy idempotence: no
--sincewindow. The D block drops a noisy row whengit log -E --format=%s --grep="noisy-rewrite ${id}([^0-9]|$)" -- .claude/memoryfinds a commit (whole history). The skill writes the token itself: STEP 4's final report prints the exact commit subjectchore(memory): noisy-rewrite <ID>[, <ID>…]and says /commit-change keeps it verbatim. RED-10g: a sandbox commit with that subject made today → the noisy row is dropped. - C3 promotion status word: the leading word = the entry's CURRENT word (from
memory.sh index <kind>):memory.sh status <ID> "<current word>, promoted to <mechanism>"(e.g.resolved, promoted to …,accepted, promoted to …); an entry with no readable word (LRN, v1) →implemented, promoted to …. A closed entry stays closed; RED-10e asserts the classifier word is unchanged after the status line on a resolved BLK. The D drop rule for promote = an existing status line containingpromoted to. - C4 SP1: three entries already exist; raise the KNOWN-1 claim cost to 800 (> 1500 − 778) and fix its comment.
- C5 tests import
triggerKind(assert 'idle' / 'keyword' values); NOTES8 keeps the wordnotes(shares a token with LRN-002) and holds no DESIGN/ANALYSIS rule word. - C6 AC4 amended (contract): header lines (
tag,date) plusotherlines may print; "no row" means nonoisy/promoterow. - C7 parse anchored, case-sensitive, on
^Noisy:and^Promotion candidates:; the literalnoneskipped; the Actions section never parsed; "commas survive" claim dropped (a,in a basename is an accepted limit, stated in the prose); RED-10 fixture includesNoisy: none. - C8 STEP 3 item 4: only the title TEXT changes;
## <ID> —, the[status]tag and the(date)stay verbatim; the lesson sentence is the only body change.