From a56137df9309ec3b4f58394e31e9c18f14ba6fef Mon Sep 17 00:00:00 2001 From: bchanot Date: Thu, 12 Nov 2026 18:38:47 +0100 Subject: [PATCH] =?UTF-8?q?chore(memory):=20phase=204b/4c=20proofs=20?= =?UTF-8?q?=E2=80=94=20known-error=20replay,=20redaction,=20/context=20del?= =?UTF-8?q?ta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/memory/journal.md | 1 + .claude/tasks/TODO.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index eb84d24..420a800 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -728,3 +728,4 @@ rules: - 2026-11-12: /doc 3.0.0 on chore/docs-3.0.0: ed67c52 MIGRATION 'Upgrading to 3.0.0' (7 breaking items), CHANGELOG gitflow deny 14 entries, Fixed bullet dead 2.0.0 deny forms, [2.0.0] Linux residual fixed in place, '(98 checks)' dropped. Next: /release-candidate. - 2026-11-12: /reconcile before 3.0.0: 75 SHAs + 31 merges verified, nothing blocks the cut; TODO restructured (9 stale boxes fixed, shipped BDR-125 phase blocks to History, residuals grouped, post-3.0.0 items: empty push-guard removed-ok at next bump, D3 MEDIUM /bugfix). CHANGELOG internal headings -> [internal X.Y.Z]. - 2026-11-12: /memory-feedback gate 1 (prompt 26/20): 28 records, 75 labels, 5 spot-checked (0 flip), 7 misses on 5 asks. Precision 57 % under the 64 % target, idle 44 %, tool channel empty. EVAL-058 + 4 TODO lines on chore/memory-feedback-gate1. +- 2026-11-12: phase 4b/4c proofs (chore/phase4-proofs): known-error replay `bash -c 'PATH=/nonexistent npm install'` → tool.call context `memory: known BLK-013 …` + store log record {channel: tool, ids: [BLK-013]} (4d tool channel works; 0 records = no matching error); live redaction: `API_KEY=…` + `Bearer …` in a failing echo → key/line/excerpt/command all ``, 0 raw hits in the store (Bearer swallows trailing `";`, harmless); headless /context full 27.1k (base 26.9k, +/memory-feedback skill), dev 25.2k, CLI now prints System tools (deferred) 14.1k; digest after a real compaction: no compaction in retained transcripts, waits for this run's first auto-compact. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 22ed6e4..4ee7fa1 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -7,7 +7,7 @@ Done history before 2026-10-08 removed 2026-10-23 (git keeps it: `git log -p -- Decisions at start (asked once): faunosteo memory v2 on `chore/memory-v2` off develop in a fresh worktree (split already on develop 7a75974, 11 rules); settings.json `npm -g` deny lines removed on the block E branch, classifier test = `npm install -g --dry-run cowsay`; 3.0.0 cut right after block A (/release-candidate), later blocks land under the next Unreleased; LRN-270 bisect = user-run interactive sessions, one `--settings` file per pack. Merge prompts (`gitflow finish` ask) = the human signal per block once gates are green. - [ ] A merge chore/memory-feedback-gate1 (b7505d1 + routing `confirmed` row) into develop - [ ] A' /release-candidate 3.0.0 (scope as ticked 2026-11-11) -- [ ] B chore/phase4-proofs: known-error replay (`memory: known BLK-xxx` + tool record), live redaction (fake secret → ledger REDACTED), digest after a real /compact, `/context` full+dev delta vs the 2026-11-09 base; each = command + output + journal line; a failure → /bugfix +- [x] B chore/phase4-proofs (journal 2026-11-12): known-error replay → `memory: known BLK-013` + tool record; redaction proven (0 raw hits); /context full 27.1k / dev 25.2k; digest-after-compaction waits for this run's first auto-compact (no compaction in retained transcripts) - [ ] C /feat gate 1: idle trigger tightened (≥ 8 words AND a real idle gap), recall cap 2, body indexed for BM25 with p90 before/after (> 3 s → back to title+lesson, "accepted"), 4d.4 built (/prune-memory step D: noisy rewrite + BDR-100 promotion) - [ ] D /feat D1b: digest falls back on the first unchecked items when `### Actionable` is absent; init-project + onboard templates emit the heading; local repos' TODO migrated on `chore/*` (one per repo, merge on ask); Session-start step 1 "Read TODO.md" dropped from the doctrine, citers census - [ ] E phase 1 + 2 decisions: design hook DELETED (web-building.md loads by path); "Skill routing" lines → skills' `description:`; `npm -g` deny lines out + dry-run test; rtk `cat|head|tail *.env*` forms benched, every form kept without proof of obsolescence, T42 list updated; BLK-022 buried (phase 2 covers it): guard-bash.test.sh SKIP spec deleted, BLK-022 → superseded, TODO "Blocked" block removed @@ -42,11 +42,11 @@ Shared rules for every phase: - [x] shortcut (BLK-043 gate 2 LOWs): `lib/tests/detect-plan.test.sh` unchecked `mktemp -d` (empty WORK → real `claude probe`), `bash -c "source '$LIB'"` interpolation, no `GIT_CEILING_DIRECTORIES` on hook runs; and the memory, graphify-gate, push-guard suites run the hook with no `claude` stub. Upgrade = `|| exit 1` + `command -v claude` assert, positional args, ceiling dir, shared stub helper. Same gap in `lib/tests/session-digest.test.sh` SD0 (gate MEDIUM 2026-11-06): `claude probe` runs before any check that the stub is first on PATH (stub write failure or noexec TMPDIR → real CLI), a red SD0 does not stop the suite; LOW: log path interpolated into the generated stub unquoted. Done 2026-11-06 dc5f127 + 7ca6b18 (shared `lib/tests/claude-stub.sh`, 6 suites, BLK-045). - [ ] BLK-044: trace origin of `oom_score_adj=-1000` on claude processes; set `OOMScoreAdjust` on the `cc` scope so a runaway claude dies first. - [ ] safety-residuals gate LOWs (2026-11-06, bugfix/safety-residuals): `rtk read -n server.key` / `rtk read id_rsa` at repo root pass (`.key`/`.pem`/`id_*` rtk denies all need `*/`; pre-existing, bench before adding); session-start `memory.sh check` and digest unbounded when `timeout` is absent (stock macOS); pre-commit allowlist fails open if `git diff --cached` errors (pre-existing, Gitea backstop); `lib/memory.sh` `_mem_path_safe` line > 80 chars; `claude-stub.sh` interpolates the mktemp log path into the generated stub (test-only). - - 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. + - Proof (closed 2026-11-12, block B): precision = EVAL-058 (prompt gate; the ≥10-error half folded into the tool gate, BDR-140); redaction, `/context` delta and the known-error recall proven live (journal 2026-11-12); digest after a real compaction = pending this run's first auto-compact. - Gate 1 result (2026-11-12, EVAL-058): prompt precision 57 % (n=75), under the 64 % target; fresh 78 %, idle 44 %, keyword 55 %; tool gate 0 records. - [ ] 4d gate 1 (2026-11-12, EVAL-058): idle trigger at 44 % precision: tighten (skip prompts under N words, or only after a real idle gap) or drop; decide before the next gate - [ ] 4d gate 1: cap recall at 2 entries (3rd pick 35 %) - - [ ] 4d gate 1: tool channel logged 0 records in 4 days: check the PostToolUse error match actually fires (live error in a session, then memory-feedback) + - [x] 4d gate 1: tool channel proven live 2026-11-12 (BLK-013 replay: context line + `channel: tool` record); 0 records = no matching error in the window - [ ] 4d gate 1: misses 4/7 no-overlap: BM25 over title+lesson cannot reach them; option = index body too, or accept ### BDR-125 residuals (after 3.0.0)