diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index b38e7c9..69213fd 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -1155,6 +1155,7 @@ Branch feature/user-writing-web-rules, UNMERGED (human gate). - **Alternatives rejected**: path-scope Design work / Web sections into `rules/` (BDR-031 principle; the design hook needs the section in context regardless of file type); caveman doctrine (BDR-031: instructions-to-follow must stay prose); raise the 320 guard again (BDR-062 already moved it once; a guard that follows the file is not a guard). - **Status**: accepted, on chore/claude-global-density, UNMERGED (human gate). make test unchanged (2 pre-existing T16a), banner density warning gone, doctor 0 errors. - **Reference**: `CLAUDE.global.md`, `hooks/session-start.sh` (320 guard), `hooks/design-toolchain-reminder.sh` (heading match). Links [[BDR-031]], [[BDR-062]], [[BDR-085]]. +- **Status (2026-10-29)**: accepted, amended by BDR-130 (2026-10-29): Design work path-scoped in rules/web-building.md, hook = Read pointer ## BDR-099 — C2 coherence: 30 doctrine/skill tensions resolved, doctrine wins, BDR-068 kept as the written exception - **Date**: 2026-09-24 @@ -1337,6 +1338,7 @@ Branch feature/user-writing-web-rules, UNMERGED (human gate). - **Hooks**: interviewer FAILURE MODES row (language not stated → propose Rust), init-project founding-BDR table, project CLAUDE.md exception list. - **Alternatives rejected**: section in CLAUDE.global.md (busts 320 budget); `paths:`-scoped rule (brainstorm is chat, never fires). - **Refs**: commit ee76723, branch chore/rust-default. Links [[BDR-085]]. +- **Status (2026-10-29)**: accepted, amended by BDR-130 (2026-10-29): Rust default moved to lib/architecture-defaults.md, chat covered by the always-on line ## BDR-119 — impeccable = Build path for all UI, frontend-design out of the gate [accepted] (2026-10-16) - **Decision**: Build UI routes to impeccable (init, shape, new-work, craft floor, `impeccable detect`, fresh finish reviewer). `design.profile` GATE-BLOCK: impeccable in, frontend-design out. frontend-design stays installed + profile-listed: light path for a one-off visual w/o project context, never beside impeccable on same task. @@ -1351,6 +1353,7 @@ Branch feature/user-writing-web-rules, UNMERGED (human gate). - **Why**: user ask. Dashboard-only items (spend cap, WAF, budget stop) stay MANUAL, never claimed done. Scanner proves absence of protection, never presence of security; clean scan = "no static finding". Calibrated on 8 real projects, each FP class fixed + locked by benign test. - **Alternatives rejected**: Rust scanner (interpreted skill script, no build step, default-language contraindication, same rank as explain-diff checker); section in CLAUDE.global.md (budget); `paths:`-scoped rule (never fires in chat/brainstorm); semgrep rules only (blind to migrations, policies, consent flow). - **Refs**: branch feature/secure-by-default, suite `lib/tests/guardrails-scan.test.sh` (89 checks). Links [[BDR-085]] [[BDR-118]]. +- **Status (2026-10-29)**: accepted, amended by BDR-130 (2026-10-29): Supabase/cloud-functions bodies → path rules, one always-on line each ## BDR-121 — Guardrails fix loop reuses the bugfix circuit, scanner = oracle [accepted] (2026-10-18) - **Decision**: after report, proposals (route plan) -> prose approval gate -> bugfixer + verify-secure gates -> re-pass. Each accepted fix = contract criterion, CHECK = `scan.py --assert-absent RULE:path` (marker GUARDRAILS-CLEAR, positive control: fails before fix). Re-pass = `--baseline` vs pre-fix scan (GUARDRAILS-NO-NEW). 2 rounds max, residuals open. `--report-only` keeps audit alone. @@ -1397,6 +1400,7 @@ Branch feature/user-writing-web-rules, UNMERGED (human gate). - **Amendment 6 (2026-10-25, shell deny probe)**: bench `.claude/tasks/plans/2026-10-25-bash-deny-probe/`. Native Bash deny matcher sees through compound ops, subshell, `env`/`command`/`timeout`/`nohup`/`xargs`, quoted command word, simple assignments: no per-rule shell duplication. Misses `sh -c`, bare shell + heredoc, `$(…)` command, absolute path, interpreters, quoted literal arg. Under `defaultMode: auto` classifier approved every miss. rtk-rewrite hook runs before permission eval, deny evaluated on rewritten cmd: `git push origin :feature` → `rtk git push …` bypasses `git push * :**` (ac23cc6) and ask `git push *`; `cat */*.pem` likewise. Redirects into Edit-denied path denied. `ask` beats `allow`. User: stay auto, fixes go in phase 2 (rtk rc=3 passthrough + rtk read twins, targeted ask/deny rules, limits written down, routing guard covers Bash writes). Interim risk accepted with the phase order. - **Amendment 7 (2026-10-25, Fable re-challenge of the whole queue)**: 4 lenses + native-features guide (CLI 2.1.308), synthesis `.claude/tasks/plans/2026-10-25-context-mod-queue-challenge.md` § RE-CHALLENGE. BLOCKER closed: hard_deny names off switches only, never mod paths/sources (classifier would refuse mod maintenance). Merge gate = native `ask` rules (`Bash(bash */gitflow.sh finish*)`, `Bash(gitflow_finish*)`, `Bash(git merge *)`), bench r3 G1-G7 all denied, `start` free; `$.ui.ask` mod dropped; BDR-068 /close auto-finish costs one click (user accepted). Routing guard hosted in model-router: `runMain` wrong signal (BEST tier only, never ends), mod state plugin-private; free when `turnMain.source ∈ {skill, model}` or `/route` sticky; Edit/Write/NotebookEdit only, Bash write forms deferred (no measured evasion). Interpreters (`python3 -c` 211, `node -e` 450 calls / 14 days) → soft_deny prose, not static ask; `Bash(/*)` dropped (kills rtk abs twins). Commit-msg hook deferred (4/78 overrun, hooks miss 6/7 repos on core.hooksPath). 4a shrunk: memory.sh add/status/journal/check/index + flock, own-header `[tag]` first then last status line wins (reconcile.sh:60-67 dropped own header = BLK-032..034 false-open), Index blocks removed via /prune-memory, no Meta backfill, no English validator (1/1,290), per-file v2 marker. Phase 1: design section appended to rules/web-building.md (hook one-liner, 2,131 fires), one lib/architecture-defaults.md, Supabase/functions keep always-on line (path rules fail open at scaffold), agent description diet at source, origin line already shipped. Phase 5: lib/profiles/.json source of truth (no generator), detection via /plugin-check (no fingerprint), cleanup += toggle-external.sh + old-layout writers, migrate auto memories before autoMemoryEnabled:false, enable scope = --settings copy else settings.local, never user scope mid-skill. Phase 3 CONDITIONAL on the measured residual after 0/4a/1/5/2: listing filter, contexts field, hint classifier, agent rewrite, higgsfield deltas dropped. 4c = intent rerank + error 4-gram only, digest in session-start.sh on compact/clear; 4b redacts at capture, bounded ring; 4d deferred. Proof budget: static glob check + InstructionsLoaded log for path rules, model canaries for hook/mod levers only. - **Amendment 8 (2026-10-25, model per project and per conversation)**: user ask (one Claude Code conversation per project, often concurrent: Fable on one, opus on another). Measured headless (scratchpad modeltest): project `.claude/settings.local.json` `"model"` wins over user settings, `--settings '{"model":…}'` wins over both; same scopes as packs. `/model` writes the TRACKED user settings.json (fable landed there 2026-10-25): never the per-project route. Applied: tracked default `opus`, this repo local `claude-fable-5-1[1m]`. Phase 5 profile = `enabledPlugins` + `model`; doctor warns when tracked `model` ≠ `opus`. Residuals accepted by the user: interpreters (`python3 -c`, `node -e`) rest on prose + classifier (491/661 calls from sub-agents, an ask rule would fail executors); Bash write forms out of the routing guard until a measured evasion. +- **Status (2026-10-29)**: accepted, phase 1 shipped 2026-10-29 (BDR-130): next phase 5 ## BDR-126 — model-router `/model ` scope dialog: project / conversation / everywhere [accepted] (2026-10-25) @@ -1426,3 +1430,16 @@ Branch feature/user-writing-web-rules, UNMERGED (human gate). - **Why**: Index drifted (16 rows missing), status in 3 places, BLK-032..034 false-open (prose words), no single writer (ad hoc Edit/python on 357k files). Phase 4a of [[BDR-125]]. - **Alternatives rejected**: `flock(1)` (absent on macOS, [[BDR-110]]); `mkdir` lock (uutils 0.10 not atomic, [[LRN-236]]); generated Index kept (drift by construction, [[LRN-055]]); upgrade via /prune-memory curation (no oracle); strict parser on v1 (regressed 4 of 13 repos: title-suffix, `date: · status:`, `**Statut** :`). - **Refs**: contract `.claude/tasks/contracts/2026-10-27-memory-v2-write-2030.md`, plan + spec `docs/superpowers/{plans,specs}/2026-10-27-memory-v2-write*`, commits a423594..aab9e4d, upgrade 9698473. [[LRN-237]], [[EVAL-052]]. + +## BDR-130 — Phase 1 context diet: native carriers per section, one always-on line where chat needs it [accepted] (2026-10-29) +- **Context**: BDR-125 phase 1, feature/context-diet (4bbb3c5..789a2b2), contract `.claude/tasks/contracts/2026-10-28-context-diet-1944.md`. +- **Decision**: each always-on section → native carrier matching its trigger, no mod. Design work → `rules/web-building.md` (hook one-liner says Read it); graphify usage → `hooks/session-start.sh` block only when `graphify-out/graph.json` exists (threshold + one reminder clause stay, sub-agents never see the banner); never SPA + Rust default → `lib/architecture-defaults.md` Read by init-project/interviewer/scaffolder/ship-feature STEP 1/onboard/audit-delta, one always-on line under `# Architecture decisions`; Web APIs → `rules/rest-api.md` § Versioning; Supabase/cloud-functions bodies → `rules/supabase.md` / `rules/cloud-functions.md`, one always-on line each saying Read before writing a new file; `"autoMemoryEnabled": false`; 13 agent descriptions ≤ 200 chars. +- **Measured**: `/context` 30.5k → 26.2k; own gain ≈ −2.8k (Memory files 9.6k → 8.0k, System prompt 4.4k → 3.7k, Custom agents 2.6k → 2.1k); MCP instr 2.4k → 0.9k external. +- **Accepted costs**: analyzer `memory: project` dropped with auto memory (dirs empty, user pick); `**/functions/**` fires in non-cloud dirs; Supabase owner-policy detail not always-on. +- **Amends**: BDR-118, BDR-120 (moved out of always-on; chat covered by always-on line), BDR-098 (Design work path-scoped, hook = pointer). +- **Deferred**: Skill-routing lines → skill descriptions (TODO phase 3 bullet). + +## BDR-131 — settings.json is a base file: /model never committed, UI writes stashed [accepted] (2026-10-29) +- **Decision**: tracked `settings.json` = base file. `/model` writes never committed (model per project lives in `.claude/settings.local.json`); tracked default `"model": "opus"`, `"switchModelsOnFlag": true` stays. UI-written keys (`"theme"`) stay uncommitted, stashed around `gitflow finish` (`git stash push -- settings.json`, finish, pop); re-pushed only for a major change. +- **Why**: user 2026-10-29: "il ne faut jamais suivre le model… le model par defaut est opus… push un fichier de base, ensuite toute modifs auto on les stash". Never `git checkout`/`restore` the live file (symlink of ~/.claude/settings.json). +- **Rejected**: commit `/model` + theme as is (doctor warns tracked ≠ opus). diff --git a/.claude/memory/evals.md b/.claude/memory/evals.md index a376fa6..5cc726a 100644 --- a/.claude/memory/evals.md +++ b/.claude/memory/evals.md @@ -413,3 +413,9 @@ Dogfood: 3 blind lenses attacked the v1 plan for the plan-challenge feature itse - **Method**: 2 plan-challenge rounds (3 lenses each, reference lib run before the plan), 8 task reviews, 4 fix rounds on Task 8, verifier ×2, security gate, controller proof on 14 repo copies, opus xhigh final review + scoped re-review. - **Anomalies**: each layer caught what earlier green layers missed. Challenge: two classifiers, BLK-019/020 false-open, uutils mkdir lock. Task reviews: G4 guard dodged by string split (rejected), `###` verdict flip ×4 shapes. Verifier: 3 EVAL Index actions lost. Controller proof: template path after `-C` (relative call only). Opus final, after all gates green: lock spin on unwritable `.git` (no rc), bare-prefix `status BLK` writing BLK-001, bullet-list Index facts dropped (trucks_at_work), 59+106 duplicate Date lines (`**Date** :` spacing). One implementer tried `--no-verify` in a temp repo (denied). - **Action**: keep the full stack for libs that rewrite user data; add a real-data copy proof with the user's own invocation before the final review. [[BDR-129]], [[LRN-237]]. + +## EVAL-053 — ship-feature phase 1 context diet: challenge, final review and gates (2026-10-29) +- **Checked**: ship-feature phase 1 run quality (8 tasks, sonnet executors + reviewers, one haiku transcription). +- **Method**: 3-lens plan challenge + confirmation pass, per-task reviews, final opus/xhigh whole-branch review, GATE 0 oracles (10 runnable, c1-*.sh positive-controlled before work), fresh verifier, security gate. +- **Anomalies**: challenge found 4 MAJOR (c1-readers red mid-Task 3, worktree vs in place, finish blocked by user settings hunks, contract out of sync with r2); final review found the new-file Write gap (I1) everybody missed; verifier 1st run died on Fable credits (429), retry pinned opus; 2nd run ECARTS(5) all human micro-gate items (approved text not on disk, transient docs out of scope, 2 SC2016 waivers); every per-task review clean first pass. +- **Action**: keep oracles + positive control before dispatch; brief reviewers on new-file Write semantics for path rules; record gate texts on disk (contract) so the verifier can match them. diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index f134d5e..c0fbe0a 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -668,3 +668,6 @@ rules: ## 2026-10-28 - Phase 4a memory v2 shipped on feature/memory-v2-write: lib/memory.sh single writer, registries v2 (9698473), shared parser fixes BLK-032..034, upgrade migrates 12/14 repos on copies (game, trucks_at_work refused). 2 challenge rounds + 8 task reviews + 4 Task 8 fix rounds + verifier x2 + opus final (lock spin, bare-prefix status, bullet Index). BDR-129, LRN-236, LRN-237, EVAL-052. Merge on user go. + +## 2026-10-29 +- Phase 1 context diet (feature/context-diet): 8 tasks SDD + final opus review (I1 Write gap fixed 789a2b2), GATE 0 MET, verifier CONFORME 21/21 after 2 micro-gates, security PASS. /context 30.5k → 26.2k (own −2.8k). Load proof: faunosteo supabase.md + web-building.md, game cloud-functions.md + supabase.md path_glob_match. robin_petier BDR-075 (auto memory migrated, chore/memory-lan-server). BDR-130/131, LRN-238..241, EVAL-053. Faunosteo/game: nothing lost. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index acc804e..c6084ec 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -1833,3 +1833,19 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s ## LRN-237 — A migration oracle sharing the transform reader proves nothing: own range per reader, assert on the entry, prove with the user invocation (2026-10-28) - **Context**: memory v2 `upgrade` verdict oracle, 2026-10-28. Oracle compared each blocker's open/closed verdict, legacy reader before vs strict reader after. Four review rounds each found a range leak the oracle shared: `###` entry invisible to v1 reader counted closed → `resolved` written on an open blocker; `## BLK-003` range swallowed a following `### BLK-001`; a `### ` heading quoted in a fence ended the range; status lines inside a fence read. Tests stayed green because they checked the reconcile enumerator, blind to `###`. Separately: template path derived after `-C` cd → upgrade rc 2 only when the lib is called by relative path; implementers always used absolute paths. - **Apply**: an oracle sharing the transform's reader proves nothing: give each reader its own entry range (end at next heading of any level, fence-aware, skip fenced status). Assert on the entry itself, not via an enumerator. Prove a CLI on real data copies with the invocation users type (relative path + `-C`). Resolve a lib's own dir at source time (`cd -P` before any `cd`). [[BDR-129]], [[LRN-096]]. + +## LRN-238 — Path rules match gitignore-style and load on Read only: pointers say Read before writing (2026-10-29) +- **Pattern**: engine path-rule match = gitignore-style. InstructionsLoaded logs globs normalized (`**/supabase/**` → `**/supabase`, `rules/**` → `rules`), match at any depth, hidden dirs included. Load on Read only, never Write of new file. +- **Application**: an always-on pointer to a path rule must say "Read it before writing a new ", not "loads on X files". Plan, spec and user approval all missed it; final opus review caught it (I1, fixed 789a2b2). Static compgen check proves parsing only; load proof = logged headless session naming the Read tool. + +## LRN-239 — Live Claude Code rewrites settings.json from memory on its next settings write (2026-10-29) +- **Pattern**: running Claude Code re-serializes its in-memory settings into user `settings.json` on any later settings write: a `/model` "Everywhere" value + key order came back after a manual restore (seen 2026-10-29, twice). +- **Application**: after `/model` in a live session, restore the tracked file, then re-check before any commit or finish; stash UI writes (BDR-131). Restart ends it. + +## LRN-240 — autoMemoryEnabled false also drops sub-agent memory: project (2026-10-29) +- **Pattern**: `"autoMemoryEnabled": false` also removes a sub-agent's `memory: project` section. Proof 2026-10-29: analyzer asked for its agent-memory section → NO; same probe with `claude -p --settings '{"autoMemoryEnabled": true}'` → YES "# Persistent Agent Memory". +- **Application**: before toggling auto memory, check `memory:` frontmatter users and `.claude/agent-memory/*` contents (here 4 dirs, all empty: no loss). Dead field `memory: project` in agents/analyzer.md → TODO. + +## LRN-241 — Classify a usage log by source before trusting its counts (2026-10-29) +- **Pattern**: design-toolchain fire log 2026-10-28: 2,779 fires = 1,770 suite prompts (tests ran with the real HOME) + 857 `