forked from bchanot/claude
chore(memory): BDR-140 + LRN-267, LRN-268 — ship memory feedback 4d
This commit is contained in:
1 parent
b44b19fa4a
commit
f93546ded1
4 files changed
+28
-2
No files matched your search
@@ -1512,3 +1512,13 @@ Supersedes [[BDR-030]].
|
||||
- **Why**: `.claude/**` let project config read by every session (rules, settings) land on protected base unreviewed; `--name-only` printed only rename destination → `git mv .claude/rules/x .claude/tasks/x` hid deletion. Allowlist = exactly side-car paths skills commit (memory-commit, deploy-commit, /tour audits): no skill flow taxed. Develop history: 1 commit (858e7a7, `.claude/settings.json`) would now need branch.
|
||||
- **Alternatives rejected**: keep `.claude/**` (BDR-045 status quo, leak stays); also exempt `.claude/settings.json` (user picked no: config = reviewed change); size/heuristic narrowing (BDR-045 (D), fuzzy).
|
||||
- **Residual**: hook fails open if `git diff --cached` errors (pre-existing; Gitea protection backstop). Partly revises [[BDR-045]] (exemption narrowed, aiguillage unchanged). See [[LRN-084]].
|
||||
|
||||
## BDR-140 — Phase 4d memory feedback: offline reader, local labels, two gates, fixed thresholds, /memory-feedback [accepted] (2026-11-08)
|
||||
|
||||
- **Date**: 2026-11-08
|
||||
- **Status**: accepted
|
||||
- **Decision**: phase 4d feedback = offline reader, no runtime cited flag. Mod logs `cands` + `ms` on prompt records (4d.1). Bun reader `lib/memory-feedback/` (labels, metrics, thresholds, transcripts, reader CLI worksheet|apply|sample) joins `l:<root>` log to transcript attachments; redacted text only in scratchpad worksheet; `~/.claude/memory-feedback/` (0700/0600) keeps labels.tsv (append-only + .bak, repo tag `basename#sha1[0:6]`), state.json (gate verdict first-reached times, closed flag), FEEDBACK.md. Two independent gates: prompt 20 labelled asks or 35 d; tool 10 or 35 d, one 35-d extension then closed. Thresholds r1 table in `thresholds.ts` only. Skill `/memory-feedback` (reflect row), user-invoked; banner reminder `lib/memory-feedback-remind.sh` (5+ d, store changed, silent when closed / recall off). Gate verdict recorded once (NEW line) as EVAL in this repo only (-C).
|
||||
- **Why**: transcripts live 7 d (BDR-057) → weekly reminder, not raised retention; labels carry client repo names → local, never in git; log alone cannot show usefulness or misses → join + Claude labels + user spot check (LRN-168); tool channel ~3 records/14 d → own gate.
|
||||
- **Alternatives rejected**: raise cleanupPeriodDays (reverses secret hygiene); cron job (machinery, background claude); labels committed (client names on Gitea); one joint gate (prompt waits on rare tool channel); Stop-hook cited flag (BDR-125).
|
||||
- **Deviations from spec (user-gated 2026-11-07)**: reader in lib/ not mods/ (plugin validate/test scope); miss causes no-overlap|overlap only; labels.tsv without cited; noisy/promotion lines carry repo tag.
|
||||
- **Reference**: feature/memory-feedback 21483dc..b44b19f; contract .claude/tasks/contracts/2026-11-06-memory-feedback-4d-1825.md. See [[BDR-125]], [[BDR-137]], [[BDR-100]].
|
||||
@@ -702,3 +702,6 @@ rules:
|
||||
- capitalize pre-compact: 2 learnings (hook never calls claude CLI; worktree ignored symlinks + diff3); TODO BLK-043 merge checked, Part B kept. 4c digest switch committed 4a7ce37.
|
||||
- 2026-11-06: BLK-043 Part B /hotfix 2f45452: session-digest suite stubs claude CLI (SD0 control, SD15 zero calls), 53/53 under TasksMax=256, security PASS (MEDIUM stub-first-on-PATH queued in TODO shortcut). 4c merge pending user.
|
||||
- 2026-11-06: 4c merged ddb04f4. /bugfix safety-residuals (bugfix/safety-residuals): 5 items 9b3961e d93f06c dc5f127 97c6afc c5bd0f8 + gate round 7ca6b18; plan r3 after 3 lenses + confirm (0 BLOCKER, 8 MAJOR folded); GATE 0 MET, verifier ECARTS(2) → CONFORME, security PASS x2. BLK-045, BDR-139, LRN-265/266. Merge on signal; 4d next.
|
||||
|
||||
## 2026-11-08
|
||||
- 2026-11-08: 4d memory feedback built on feature/memory-feedback (8 tasks SDD; plan r1 FATAL(7) → r2 → confirm FATAL(4) → r3; final review I1 locals + I2 per-trigger n; gate 2 hardening x2: checkDir fail-closed, items.json validated, safe repo path). make test green, GATE 0 MET, security PASS 0 findings; live record zenquality cands 11 ms 1408. BDR-140, LRN-267/268. Merged on user signal before GATE 1; live run + verifier after.
|
||||
@@ -1978,3 +1978,15 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s
|
||||
- **Pattern**: before adding a guard rule for a new form, bench whether EXISTING rule already covers it. Claude Code permission `*` spans spaces: `Bash(rtk read */.env*)` already denies `rtk read -n sub/.env` (`*` = `-n sub`); only root-level target escaped → 2 rules, not 20. Bench row must test old rule on new cmd (proves need), not new rule alone (proves only match). Also gate on `sent` column = intended cmd (model may reorder args). Path allowlists over git output: `--name-only` lists rename destination only → use `--no-renames` so source path is checked.
|
||||
- **Context**: bugfix/safety-residuals 2026-11-06: plan r1 had 20 deny lines, simplicity + correctness lenses cut to 2; bench R3-R7 (results.tsv). Pre-commit allowlist c5bd0f8 T21f rename case.
|
||||
- **Future use**: every deny/ask addition (BDR-136 bench) and every path-based guard: (1) row with existing rule × new form first, (2) rename case in allowlist tests.
|
||||
|
||||
## LRN-267 — Claude Code transcript join facts: -context toolUseID, blob replays, agent-<id>.jsonl (2026-11-08)
|
||||
|
||||
- **Pattern**: Claude Code transcript facts for joins: `tool.call` hook attachment `toolUseID` = `<tool_use id>-context` (strip suffix before matching tool_use/tool_result); `api-request-blob` records replay earlier tool_result blocks → read only `assistant`/`user` records, dedupe tool_result by id; sub-agent transcript = `<session>/subagents/agent-<agentId>.jsonl` (same id mod logs in `agent`); `prompt.submit` additional context lands as `attachment.type hook_additional_context`, ~0.1-3 s after hook time; composer prompts carry `origin.kind human`.
|
||||
- **Context**: phase 4d reader (lib/memory-feedback/transcripts.ts); r1 plan matched `toolUseID` verbatim → every tool item would join empty on real data, synthetic fixture passed.
|
||||
- **Future use**: any transcript reader/bench: check these shapes on real files (field names only) before writing the join; fixture uses `-context` ids and a blob replay.
|
||||
|
||||
## LRN-268 — Assumed fixtures pass their own tests; plan constraints must copy the user's limits verbatim (2026-11-08)
|
||||
|
||||
- **Pattern**: fixture built from assumption passes its own test → BLOCKERs hide until a challenger reads real data or existing tests. 4d: `-context` toolUseID (real transcripts) and IR11 strict toEqual (existing kit test) both caught only by challenge passes, not by plan TDD. Second: plan "Global Constraints" must copy the user's global limits verbatim; 4d plan dropped "5 locals" → executors complied with the plan, final review flagged I1, extra fix round.
|
||||
- **Context**: feature/memory-feedback 2026-11-06..08: r1 FATAL(7), r2 confirm FATAL(4), final review I1/I2, gate 2 three MEDIUM + one MEDIUM on re-scan.
|
||||
- **Future use**: plan challenge brief asks correctness lens to verify fixture shapes against real data and to grep existing tests asserting changed records; writing-plans Global Constraints = paste CLAUDE.md limits line verbatim.
|
||||
Reference in new issue
Block a user