Files
claude/.claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md
T

8.3 KiB

CODE-CLEAN AUDIT — BDR-125 phases: what each phase left obsolete (2026-11-09) — r2 after challenge

Scanned: tracked files minus skills-external/, .claude/memory, .claude/tasks, .superpowers, CHANGELOG (3 read-only sweeps: phases 5+0, 4a-4d, 1+2). Importers were re-checked across the WHOLE tracked tree, .claude/tasks included (r1 missed recall-bench.ts). Norms source: ~/.claude/CLAUDE.md (foreign code: keep style) + project CLAUDE.md Health Stack (shellcheck) + make test. Iron law: zero behavior change. Agent and skill prompt text is executable: any edit to it that can change what an agent outputs or runs is NOT cleanup; it goes to DECISIONS or BUGS.

Verdict per phase: 0 clean; 1 clean; 2 clean; 4a-4d code clean (prompt residue, see D4/G5); 5 every declared artifact gone (prompt residue D3, comment residue B4a/B4b/B4c/B4e). A1 is pre-phase debt found on the way.

═══ CLEAN SCOPE (zero behavior change, executor) ═══ A1. install-plugins.sh:29-30, update-all.sh:18-19 — source lib/detect-plugins.sh with no detect_* call in either file or the libs they source (verified by all 3 lenses + confirmation; PRE-PHASE debt: git log -S last hit 50db70c 2026-04-15) — warn — delete the source lines (and their comment line if it only explains that source); update lib/detect-plugins.sh:4 "Sourced by:" header to drop install-plugins.sh and update-all.sh; in lib/tests/curated-config-guard.test.sh:9 replace the stale "install-plugins.sh:43-44" line citation with "the GUARDED_CONFIGS array in install-plugins.sh" (comment only) B4a. link.sh:57-58 — comment says gstack is exposed via flat per-skill symlinks under skills/ created by gstack's ./setup, naming autoplan (retired, lib/gstack-removed.list) — info — rewrite: gstack skills are tracked links under skills/pack-gstack-/skills/ → skills-external/gstack/ (packs, BDR-134); no skill names B4b. doctor.sh:607-610 — comment says gstack skills (health, status, …) are OFF by default and profile-managed — info — rewrite: gstack skills ship in three packs (pack-gstack-dev/-browser/-design, on by manifest default = full, off per project or conversation by a profile) and live under skills/pack-gstack-/skills/, while the check below reads $HOME/.claude/skills//SKILL.md, so they are excluded here; drop status from the examples (repo-owned skill, listed in EXPECTED_SKILLS) B4c. lib/gstack-links.sh:9 — cites "BDR-030 links gstack skills individually" — info — keep BDR-030 and add "(superseded by BDR-134: packs)" B4d. install-plugins.sh:37-38 — comment says the graphify installer "clobbers" the curated graphify section — info — keep the guard rationale, fix the facts (graphifyy 0.9.67 install.py): Step 7 runs graphify install (default platform claude: appends a # graphify block to ~/.claude/CLAUDE.md = CLAUDE.global.md, which holds the curated ## graphify section; matches the heading and appends, it does not clobber) and graphify claude install (writes CLAUDE.md and .claude/settings.json in the caller's cwd); the EXIT trap restores the four $REPO files in GUARDED_CONFIGS (fully effective when run from $REPO, e.g. make plugin); replace "clobbers" accordingly B4e. lib/doctor-skills.sh:5-6 and doctor.sh:511-512 — comments say the skill count covers <skills_dir>/*/SKILL.md only, but phase 5 (6509ab2) added the pack-*/skills/*/SKILL.md glob (lib/doctor-skills.sh:50) — info — name both globs in both comments

═══ DECISIONS FOR THE USER (visible or doctrine; not cleaned here) ═══ D1. CLAUDE.global.md:52-54 "Session start 1. Read .claude/memory/ (5 registries…)" + skills/capitalize/SKILL.md:375 — phase 4a meant to fix the "load every session" premise; the 4c digest now gives open BLK + TODO + last journal at start — doctrine D2. plugin-dev banner row: lib/detect-plugins.sh:43-47 detect_plugin_dev, hooks/session-start.sh:106,111,180,210, agents/plugin-advisor.md:59,181,199,242,250-255 — plugin-dev dropped 2026-07-02 but the banner prints "OFF : plugin-dev" — visible output D3. Packs vocabulary in the plugin advisor and USAGE (TODO P34, gstack AND context7 together): agents/plugin-advisor.md:99 PROFILE template (old profile.sh current format), :126-129 "toggle + rollback" (plugin-gate says atomic), gstack ON/OFF rules :81-85,139-149,209,216,226,259, "context7 ON" :144,233; USAGE.md:181,232,233,1090,1092,1095 — changes the PLUGIN CHECK block and the commands the advisor emits — visible output D4. skills/prune-memory/SKILL.md STEP 1.A/3 detection rules (:33-34,81-82,87-89,157-159,252,260-261) still describe per-entry frontmatter and raw status: lines; reading statuses through memory.sh index would work on v1 and v2; example IDs must stay 9xx (run-deterministic.sh RED-7) — changes which candidates the skill finds D5. rules/web-security.md vs rules/secure-by-default.md: strict duplicates at web-security.md:11, :19 and the "Login rate limiting," fragment of :20; password wording conflict "bcrypt/argon2" (web-security:17) vs "argon2id (bcrypt or scrypt otherwise)" (secure-by-default); cookie flags, upload type/size, forced HTTPS, security headers are unique to web-security and must stay — user-authored rule sets

D6. .claude/rules/graphify-vendored.md says graphify install --platform claude "touches nothing else", but graphifyy 0.9.67 install() appends a # graphify block to ~/.claude/CLAUDE.md (= CLAUDE.global.md); and graphify claude install writes into the caller's cwd, so the install-plugins.sh trap protects $REPO only when run from $REPO — user-authored rule, doctrine

═══ BUGS (behavior; logged to .claude/audits/BUGS-FOUND.md, not fixed here) ═══ G1. hooks/session-start.sh:200-217 "ALWAYS ON" row + lib/detect-plugins.sh:49-52 detect_uiux_pro_max read user-scope / cache state, not the effective profile (current --plain, BDR-134): a dev/minimal project shows ui-ux-pro-max on; pr-review-toolkit on in max/audit is not shown G2. passive-cost constants disagree: hooks/session-start.sh:177-183 (gstack 2750, ui-ux-pro-max 400, context7 200, graphify 300) and agents/plugin-advisor.md:193,197,211,226,233,263 vs doctor.sh:520-526 (gstack/context7/graphify dropped 2026-09-28, ui-ux-pro-max 670); status-reporter names doctor as source of truth G3. hooks/session-start.sh:404-408 _digest_journal greps ^- inside the HTML comment of templates/memory/journal.md:19-21: a template-born project prints "- journal: <line 3-5 max>" until its first journal write (template bullets and digest must be fixed together) G4. agents/status-reporter.md:35 + agents/plugin-probe.md:22-23,69 report installed / user-scope plugin state as active G5. agents/handover-doc-writer.md:77-84 parses registry statuses by hand (v2 false-open class, BLK-032..034); a fix must use memory.sh index on v2 and keep the Index read on v1 registries never upgraded (memory.sh index ignores a v1 Index)

═══ PARKED (TODO, next time the file is touched) ═══ P1. hooks/rtk-rewrite.sh:84 no-op [ "$CMD" = "$REWRITTEN" ] && REWRITTEN="$CMD" (predates the phases; integrity-pinned hook, live via symlink): remove with the next real rtk-hook edit, re-pin + rtk-rewrite.test.sh T13 in the same step

═══ NOT ITEMS (kept on purpose) ═══ failureLine/failureKey/isTrigger exports (recall-bench.ts imports failureKey and isTrigger; failureLine removal would need test retargeting through a private function: cost > value); .claude/agent-memory/ gitignore lines and MIGRATION.md mentions (BDR-003: live Claude Code path in downstream projects); doctor.sh:500-506 dated measurement (history, LRN-088); lib/gstack-removed.list BDR-117 citation (correct provenance); prune-memory run-deterministic.sh header and SKILL.md:283-284 wording (nits); templates/memory/journal.md, onboarder.md:126, hotfix/commit-changer "(status: resolved)", close test-prompts (nits or tied to G3); .claude/settings.json graphify hook (installed by graphify, inert without graphify-out/graph.json); red3-negation v1 fixture (exercises v1); v1-compat code in memory.sh/reconcile.sh; connector-deny mechanism (BDR-134 amendment); doctor migration checks; guard-bash.test.sh spec (BLK-022); .claude/audits/* run outputs; settings.json "theme"; untracked ignored leftovers .claude/agent-memory/analyzer/ and .claude/settings.json.graphify-bak (user rm by hand).

TOTALS: clean scope 6 items (A1 warn, B4a-e info) · 6 decisions · 5 bugs logged · 1 parked