Merge chore/bdr125-obsolescence-clean into develop
This commit is contained in:
commit
db5bbe5fd8
13 files changed
+91
-193
No files matched your search
@@ -2,3 +2,10 @@
|
||||
|
||||
- lib/toggle-external.sh:350 (pre-cleanup numbering; `usage()`, now near :370) — usage() prints header lines 3-26 only (`sed -n '3,26p'`); the managed-tool list continues to line 32, so `--help` omits 8 of the 14 tools. Severity: low (help text only). Discovered while: code-clean run 2026-10-12 (B5 audit). Not fixed (cleanup and bugfix are separate concerns).
|
||||
FIXED 2026-10-12 (inline on chore/code-clean, no /bugfix pipeline): usage() now prints lines 3 .. closing banner (`sed -n '3,/^# ====/p' | sed '$d'`), no numeric range; --help shows all 14 tools (36 lines).
|
||||
|
||||
<!-- code-clean run 2026-11-09 (BDR-125 obsolescence pass), report .claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md -->
|
||||
- hooks/session-start.sh:200-217 + lib/detect-plugins.sh:49-52 (`detect_uiux_pro_max`) — the banner "ALWAYS ON" row and the ui-ux-pro-max toggle row read user-scope settings.json / plugin cache, not the effective profile (`profile.sh current --plain`, BDR-134 single source of truth): a dev or minimal project shows ui-ux-pro-max on; pr-review-toolkit on in max/audit is not shown. Severity: low (banner only). Discovered while: code-clean 2026-11-09 (phase 5 sweep). Not fixed.
|
||||
- hooks/session-start.sh:177-183 + agents/plugin-advisor.md:193,197,211,226,233,263 vs doctor.sh:520-526 — passive-cost constants disagree (banner/advisor: gstack 2750, ui-ux-pro-max 400, context7 200, graphify 300; doctor dropped gstack/context7/graphify 2026-09-28 as double counting, ui-ux-pro-max 670); agents/status-reporter.md:26-30 names doctor as source of truth. Severity: low (estimates). Discovered while: code-clean 2026-11-09. Not fixed.
|
||||
- hooks/session-start.sh:404-408 (`_digest_journal`) — greps `^- ` without skipping HTML comments; templates/memory/journal.md:19-21 holds `- <line …>` bullets inside `<!-- -->`, so a template-born project prints "- journal: <line 3-5 max>" in the session digest until its first journal write. Fix template and digest together. Severity: low. Discovered while: code-clean 2026-11-09 (phase 4 sweep). Not fixed.
|
||||
- agents/status-reporter.md:35 + agents/plugin-probe.md:22-23,69 — report installed (cache) or user-scope `claude plugin list` state as "active"; the per-project state is the PROFILE line (`current --plain`). Severity: low. Discovered while: code-clean 2026-11-09. Not fixed.
|
||||
- agents/handover-doc-writer.md:77-84 — parses registry statuses by hand ("open vs resolved"), the class behind the BLK-032..034 false-open (BDR-129). A fix must read `memory.sh -C <project> index` on v2 registries and keep the `## Index` read on v1 registries never upgraded (`memory.sh index` ignores a v1 Index; memory.sh:21-23). Severity: medium (client deliverable). Discovered while: code-clean 2026-11-09. Not fixed.
|
||||
@@ -1,172 +1,10 @@
|
||||
# CODE-CLEAN SCOPE — approved 2026-10-12 — branch chore/code-clean
|
||||
# CODE-CLEAN SCOPE — approved 2026-11-09 (BDR-125 obsolescence pass)
|
||||
|
||||
Source plan: .claude/tasks/plans/2026-10-12-code-clean-0103.md (r3).
|
||||
APPROVED: all non-deferred items = A1, B1, B2, B3, B4, B5, B7, B9, B11, B18, B19, B20, C2, C3.
|
||||
NOT approved / untouched: B13-B17 (no change proposed), C1, C4, C5 (deferred).
|
||||
Iron law: zero behavior change. No commit. Never switch branch.
|
||||
Format below: file:line — item — severity — proposed fix (verbatim from the plan).
|
||||
Source report: .claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md (r2 + confirmation). Approved: all 6 items. Zero behavior change: comments and dead `source` lines only.
|
||||
|
||||
A1. lib/seo-data/safe_fetch.py:30 — `import gzip` unused (gzip appears only in
|
||||
comments at :137 and :153) — warn — delete the import line. The `gzip`
|
||||
token in the stdlib-only ALLOWLIST at lib/seo-data/seo-data.test.sh:143
|
||||
stays: it is a list of permitted stdlib names, not a usage assertion.
|
||||
|
||||
B1. lib/seo-data/seo-data.test.sh (27 sites, SC2015 `[ … ] && ok … || no …`;
|
||||
`ok`/`no` never fail) — warn, outside the Health Stack glob — insert on
|
||||
line 3, BEFORE `set -u` (a directive after the first command scopes to the
|
||||
next command only; r1 had it wrong):
|
||||
`# shellcheck disable=SC2015 # A && ok || no is deliberate (ok/no never fail)`
|
||||
— the convention of lib/tests/effort-routing.test.sh:8/:9. Prove:
|
||||
`shellcheck lib/seo-data/seo-data.test.sh` exits 0. Zero behavior change.
|
||||
|
||||
B2. lib/tests/url-guard.test.sh:21,22,33,34,60,61 and
|
||||
lib/tests/push-guard.test.sh:108-110 (SC2016: single-quoted `$(…)` /
|
||||
backticks are the commands under test) — warn, outside the Health Stack
|
||||
glob — file-level `# shellcheck disable=SC2016 # single-quoted forms are
|
||||
the commands under test` placed BEFORE the first command (url-guard line
|
||||
3, push-guard line 5), as lib/tests/guard-bash.test.sh:5. Prove: shellcheck
|
||||
exits 0 on both.
|
||||
|
||||
B3. lib/tests/run-review-guards.sh:14 — `cd "$REPO"` unguarded (SC2164);
|
||||
under `set -uo pipefail` a failed cd runs every guard in the wrong
|
||||
directory — warn — `cd "$REPO" || exit 1`. delta: cd-failure path only
|
||||
(silent wrong-dir run → loud exit 1).
|
||||
|
||||
B4. hooks/design-toolchain-reminder.sh:51 — one 972-char regex literal — warn
|
||||
— split into `pattern='…'` + `pattern+='|…'` lines ≤80 chars, IN THE
|
||||
CURRENT ALTERNATIVE ORDER (no regrouping: the sha256 must match). This
|
||||
hook runs live on every UserPromptSubmit of every session (settings.json
|
||||
wires ~/.claude/hooks → repo hooks/); a syntax error = exit 2 = every
|
||||
prompt blocked. Procedure: build on a scratch copy, `bash -n`, then
|
||||
`printf '%s' "$pattern" | sha256sum` old vs new must match, then the
|
||||
suite lib/tests/design-toolchain-reminder.test.sh run on the copy — the
|
||||
suite hardcodes `$H=<root>/hooks/design-toolchain-reminder.sh` (:4), so
|
||||
build a mirror tree `$T/hooks/<copy>` + `$T/lib/tests/<suite copy>` and
|
||||
run the suite from there, never edit the suite — then land it in ONE
|
||||
write. Zero behavior change.
|
||||
|
||||
B5. lib/toggle-external.sh:257 — `enable_tool()` 49 logic lines after the
|
||||
error-handling exclusion (max 25) — warn — split by case arm:
|
||||
`enable_gstack`, `enable_external_single` (the 11-name arm, darwin-skill
|
||||
src branch included), `enable_pack` (21st|higgsfield); `enable_tool`
|
||||
keeps only the dispatch `case`. Every `ok`/`warn`/`err` string and return
|
||||
code unchanged. Lines 1-32 of the file untouched (usage() prints 3-26).
|
||||
Coverage: `enable gstack` by lib/tests/gstack-removed.test.sh:43,55; the
|
||||
darwin-skill branch has NO suite → golden capture mandatory (see
|
||||
EXECUTOR CONSTRAINTS).
|
||||
|
||||
B7. lib/profile.sh:321 — `enable_skill()` 41 logic lines — warn — extract the
|
||||
three large arms: `enable_gstack_skill`, `enable_linked_skill`
|
||||
(external|personal; NOT "managed", a term of art for the MANAGED_*
|
||||
allowlists), `enable_plugin_skill` (plugin@*); the plugin / mcp / cli
|
||||
arms stay inline. Twin of toggle-external's arms (see C5), kept separate:
|
||||
merging changes messages. Golden capture mandatory: the profile suites
|
||||
discard output (`>/dev/null 2>&1`).
|
||||
|
||||
B9. lib/profile.sh:575 — `cmd_show()` 32 logic lines AND 14 distinct locals
|
||||
(max 5; outcome: logic lines ≤25 per function, locals reduced, NOT to
|
||||
≤5 — whichever helper keeps the header still holds prof/file/desc/
|
||||
skills/pl/m/c/total) — warn — extract `_show_plain "$prof"` (the `--plain` branch) and
|
||||
`_show_grouped "$prof"`; each helper takes `$prof` and iterates
|
||||
`read_profile` itself. NO `local -n` (zero namerefs in the repo, bash
|
||||
≥4.3 only). `_show_plain` MUST end with an explicit `return 0`: profile.sh
|
||||
runs `set -euo pipefail` and the loop's last `[ … ] && printf` returns 1
|
||||
whenever the last entry is not `cli` (dev/qa/seo today) — without it the
|
||||
helper's rc 1 kills the script after printing (reproduced), and
|
||||
lib/design-tool-gate.sh:202 turns that into `exit 2`. No suite runs the
|
||||
real cmd_show (design-tool-gate.test.sh fakes profile.sh) → characterization
|
||||
oracle: stdout + rc of `bash lib/profile.sh show <p>` and `show <p>
|
||||
--plain` for EVERY lib/profiles/*.profile, captured before and after,
|
||||
byte-identical. Grouped mode calls `claude plugin list` / `claude mcp
|
||||
list` live via skill_status (:270-297): run both captures with the same
|
||||
fixed `CLAUDE_BIN` stub so session state cannot drift between them.
|
||||
minimal.profile (0 entries) covers the `Total: 0` branch.
|
||||
|
||||
B11. lib/seo-data/google_seo.py:217 — `_cli()` 40 logic lines — warn —
|
||||
extract `_build_parser()` (the four sub-parsers; name already used by
|
||||
content_quality.py and schema_gen.py) and `_dispatch(args)`; the
|
||||
try/except envelope (bad_usage / degraded) stays in `_cli`. The
|
||||
`bad_usage` path has no test → golden capture of stdout + rc for one
|
||||
bad invocation and each of the 4 verbs in mock mode.
|
||||
|
||||
B18. lib/profile.sh:188 (gstack_skills) and lib/toggle-external.sh:167
|
||||
(gstack_skills) — `for d in` loops with no `local d`: `d` leaks as a
|
||||
global (norm: no global state); no reader of `$d` outside those loops,
|
||||
and every caller reads the function through `< <(gstack_skills …)`
|
||||
(profile.sh:507, toggle-external.sh:181, :222), so the leak never
|
||||
reaches a caller — warn — add `local d` in each. r2 also listed
|
||||
toggle-external.sh:70 and :98: FALSE, both already declare `local d`
|
||||
(:69, :97); dropped. Same class, same fix, added in r3:
|
||||
toggle-external.sh:263 `for entry in` (inside the gstack arm B5 moves
|
||||
into enable_gstack — declare `local entry` there) and :344 `for t in`
|
||||
(cmd_status → `local t`). Zero behavior change.
|
||||
|
||||
B19. lib/toggle-external.sh:119-121 — comment says "this script takes no extra
|
||||
`source`" but :50 sources lib/gstack-removed.sh and both fixture suites
|
||||
copy it alongside (higgsfield.test.sh:180,
|
||||
toggle-external-repo-resolution.test.sh:20) — info — reword the comment.
|
||||
|
||||
B20. lib/detect-plugins.sh:4 — header "Sourced by:" omits update-all.sh:19 —
|
||||
info — add it.
|
||||
|
||||
C2. skills/prune-memory/tests/run-deterministic.sh — hermetic deterministic
|
||||
suite (mktemp sandbox, 5 oracles, ALL GREEN today) absent from Makefile
|
||||
SUITES — info, delta: `make test` gains one suite block and one new way
|
||||
to go red — add the LITERAL tracked path
|
||||
`skills/prune-memory/tests/run-deterministic.sh` to Makefile:31 (NOT a
|
||||
`skills/*/…` glob: skills/ holds symlinks to vendored and out-of-repo
|
||||
trees, a glob would execute unreviewed third-party tests and make the
|
||||
suite set machine-dependent). Caveat for the human: the suite executes
|
||||
bash blocks extracted from prune-memory SKILL.md headings, so wiring it
|
||||
locks that doc's headings under `make test`.
|
||||
|
||||
C3. lib/deploy-commit.sh:51-57 and :62-68 — verbatim identical 7-line
|
||||
REFUSED block (`diff` empty) in the `pending` and `commit` arms — warn —
|
||||
hoist into `_refuse_outside_allowlist "$@"` (`local violations;
|
||||
mapfile -t violations …` + the `{ … } >&2; exit 4` block). Define it
|
||||
with the other `_` helpers ABOVE line 46 (the script runs `set -uo
|
||||
pipefail` without -e: a helper defined after `esac` would give rc 127
|
||||
and the arm would carry on to `git add` out-of-scope paths); call it as
|
||||
a plain statement so `exit 4` ends the script exactly as today, and
|
||||
keep the post-`shift` `"$@"` (:60). stderr text byte-identical — but
|
||||
lib/tests/deploy-commit.test.sh runs every rc-4 case with `>/dev/null
|
||||
2>&1` (:19, :22, :26, :46) and checks rc + commit count only, and the
|
||||
calling skill parses the REFUSED text (deploy-commit.sh:13-15) → golden
|
||||
capture of stdout + stderr + rc, before and after, in a mkrepo-style
|
||||
sandbox for `pending src.txt`, `commit x src.txt` and one mixed
|
||||
in-scope + out-of-scope call.
|
||||
|
||||
B17 POLICY (no change proposed; applies to how the items above are written):
|
||||
B17. Lines > 80 chars: 1273 in 78 shell files, 46 in Python (6 of them
|
||||
docstrings), 5 in TypeScript — info — ALL DEFERRED to "enforce on new
|
||||
code" (r1 proposed the Python/TS subset; dropped: no formatter tracked so
|
||||
it would not hold, 5 of google_seo's lines sit inside B11's `_cli`, and
|
||||
the register.ts lines are in a live-loaded mod with a `make test` gate
|
||||
that SKIPs when `claude plugin test` is absent). Lines MOVED by B5, B7,
|
||||
B9, B11, C3 keep their current length (toggle-external.sh:280, 285-287,
|
||||
325, 334; deploy-commit.sh:53, :55; profile.sh:349, 385, 393, 402 are
|
||||
>80 today): rewrapping a message string can change output. B17 applies
|
||||
only to lines newly written in this run (function headers, calls).
|
||||
|
||||
EXECUTOR CONSTRAINTS (apply to every approved item):
|
||||
- Golden capture BEFORE any edit, diff AFTER: stdout, stderr, rc (and the
|
||||
fixture tree where a mv/rm arm is moved) for every moved arm and CLI verb
|
||||
— the suites that "cover" B5/B7/B9/B11/C3 discard output or fake the
|
||||
script.
|
||||
- Hook-safe landing for B4 (scratch copy → bash -n → sha256 → suite → one
|
||||
write). No edit to register.ts in this run.
|
||||
- No `local -n`, no new bash ≥4 construct, no new dependency.
|
||||
- Return codes: toggle-external.sh:40 and profile.sh:49 run `set -euo
|
||||
pipefail`. Call every extracted helper (B5, B7, B9) as a PLAIN statement
|
||||
— never `helper || …`, `helper && …`, `if helper`, `! helper`: those
|
||||
switch errexit OFF inside the helper, so a failed `mv`
|
||||
(toggle-external.sh:273, profile.sh:330) that aborts with rc 1 today would
|
||||
instead continue and print `ok …` with rc 0, a path no golden capture
|
||||
exercises. A plain call keeps `return 1` (toggle-external.sh:305, :326)
|
||||
→ errexit in the caller → exit 1 through main (:359), as today. C3 uses
|
||||
`exit`, not `return`, and is covered by its own placement rule.
|
||||
- `make test` full run after; shellcheck on every touched file.
|
||||
|
||||
BUG TO LOG (executor appends to .claude/audits/BUGS-FOUND.md, never fixes):
|
||||
|
||||
BASELINE: make test = 46 suites green before this run (scratchpad make-test-baseline.txt); shellcheck *.sh hooks/*.sh lib/*.sh exit 0.
|
||||
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/<n> → skills-external/gstack/<n> (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/<n>, while the check below reads $HOME/.claude/skills/<n>/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
|
||||
@@ -710,3 +710,4 @@ rules:
|
||||
## 2026-11-09
|
||||
- 2026-11-09: BDR-125 residual measured: 30.2k→40k = Skills +6.2k (budget paid claude.ai-synced skills) + System tools (unattributable). /feat claude-ai-skills-off: global skillOverrides 19 off, 47438f4 + 07406ce; GATE 0 MET, verifier ECARTS(1)→CONFORME, security PASS. User removed claude.ai connectors. BDR-141, LRN-270/271. Merge on signal; next: dead deniedMcpServers cleanup.
|
||||
- 2026-11-09: /ship-feature connector-deny-cleanup (chore): dead higgsfield deniedMcpServers + census rule + prose citers removed, 12 files, T13 deny-set test; challenge 3x SOLID, verifier ECARTS x2 (revert hint) -> CONFORME, security PASS x3, opus review fixes. BDR-134 amended, LRN-272/273. Merge on signal.
|
||||
- 2026-11-09: /code-clean BDR-125 obsolescence pass: phases 0/1/2 clean, 4a-4d code clean, 5 all declared artifacts gone; 2 dead sources + 5 stale comments fixed; challenge FATAL x3 on r1 (A2 bench importer, B9 unique security rules, prompt edits = behavior) -> r2; bugs G1-G5 logged, D1-D6 queued in TODO.
|
||||
@@ -132,6 +132,14 @@ Shared rules for every phase:
|
||||
- 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.
|
||||
|
||||
### Actionable
|
||||
- [ ] BDR-125 obsolescence pass (2026-11-09, /code-clean on chore/bdr125-obsolescence-clean; report `.claude/tasks/plans/2026-11-09-bdr125-obsolescence-clean-1650.md`): phases 0/1/2 clean, 4a-4d code clean, 5 all declared artifacts gone; clean scope A1 + B4a-e executed; bugs G1-G5 in `.claude/audits/BUGS-FOUND.md`. User decisions queued below (D1-D6), each with evidence in the report:
|
||||
- [ ] D1 doctrine: CLAUDE.global.md:52-54 "Session start 1. Read `.claude/memory/`" + skills/capitalize/SKILL.md:375, while the 4c digest delivers open BLK + TODO + last journal at start (4a meant to fix the "load every session" premise)
|
||||
- [ ] D2 visible: banner "OFF : plugin-dev" (plugin dropped 2026-07-02): lib/detect-plugins.sh:43-47, hooks/session-start.sh:106,111,180,210, agents/plugin-advisor.md:59,181,199,242,250-255
|
||||
- [ ] D3 visible (= docs backlog P34): packs vocabulary in agents/plugin-advisor.md (:99 PROFILE template in the old `profile.sh current` format, :126-129 rollback, gstack ON/OFF rules, context7 ON) and USAGE.md:181,232,233,1090,1092,1095
|
||||
- [ ] D4 skill behavior: skills/prune-memory STEP 1.A/3 detection (per-entry frontmatter, raw `status:` lines) → read statuses via `memory.sh index` (v1 + v2); keep example IDs 9xx (RED-7)
|
||||
- [ ] D5 user rules: rules/web-security.md vs rules/secure-by-default.md: strict duplicates (web-security :11, :19, "Login rate limiting," in :20) and password wording conflict ("bcrypt/argon2" vs "argon2id (bcrypt or scrypt otherwise)"); cookie flags, upload type/size, forced HTTPS, security headers are unique to web-security
|
||||
- [ ] D6 project rule: .claude/rules/graphify-vendored.md says `graphify install --platform claude` "touches nothing else", but graphifyy 0.9.67 appends a `# graphify` block to ~/.claude/CLAUDE.md (= CLAUDE.global.md); `graphify claude install` writes into the caller's cwd, so the install-plugins.sh trap protects $REPO only when run from $REPO
|
||||
- [ ] parked (code-clean 2026-11-09): hooks/rtk-rewrite.sh:84 no-op `[ "$CMD" = "$REWRITTEN" ] && REWRITTEN="$CMD"`: remove with the next real rtk-hook edit, re-pin `hooks/.rtk-hook.sha256` + rtk-rewrite.test.sh T13 in the same step
|
||||
- [ ] deferred (BDR-123): remap inline-writing best-tier skills (design Build stack, writing-skills, deprecation-and-migration, /tour single-project, /audit-delta 3d, /harden STEP 3); stale citers skills/feat/SKILL.md:6, skills/code-clean/SKILL.md:36; + impeccable row in routing.json (design Build stack has none; frontend-design has `reflect`; census test pins the table)
|
||||
- [ ] parked (GATE 2 LOW, 5a98c2c): probe table names not checked with `IDENT.fullmatch` per table (a `/` walks a path on the approved Supabase host); `printable` lets Unicode bidi/format controls (U+202E, U+2066…) through to the tty
|
||||
- [x] profile name charset check (done by phase 5: `NAME_RE='^[a-z0-9][a-z0-9-]*$'` lib/profile.sh:63 on every profile and session name; the old `read_profile()` is gone)
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# 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/<n> → skills-external/gstack/<n> (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/<n>, while the check below reads $HOME/.claude/skills/<n>/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
|
||||
@@ -509,7 +509,8 @@ CLAUDE_MD_CHARS=$(wc -c < "$REPO/CLAUDE.global.md" 2>/dev/null || echo 0)
|
||||
CLAUDE_MD_TOKENS=$((CLAUDE_MD_CHARS / 4))
|
||||
|
||||
# Skill descriptions across the whole live catalog — every SKILL.md
|
||||
# reachable through ~/.claude/skills/*/SKILL.md, symlinks included
|
||||
# reachable through ~/.claude/skills/*/SKILL.md and
|
||||
# ~/.claude/skills/pack-*/skills/*/SKILL.md, symlinks included
|
||||
# (lib/doctor-skills.sh; catches a `|`/`>` block-scalar description that
|
||||
# the old `grep '^description:' | head -1` counted as 0 chars, and a
|
||||
# symlinked skill dir that the old `find -maxdepth 2` without `-L` missed).
|
||||
@@ -605,9 +606,10 @@ else
|
||||
fi
|
||||
|
||||
# Check expected skills are present. Repo-owned skills only: gstack skills
|
||||
# (health, status, …) are OFF by default and toggled per profile — requiring
|
||||
# them here false-warns on a default install, and "run link.sh" cannot
|
||||
# restore them (they are profile-managed, not link.sh-managed).
|
||||
# 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/<n>, while the check below reads
|
||||
# $HOME/.claude/skills/<n>/SKILL.md, so they are excluded here.
|
||||
EXPECTED_SKILLS=(
|
||||
"analyze" "doc" "init-project" "onboard" "plugin-check"
|
||||
"refactor" "ship-feature" "status"
|
||||
|
||||
+13
-10
@@ -25,22 +25,25 @@ else
|
||||
warn "Cannot write log to $REPO — continuing without log file"
|
||||
fi
|
||||
|
||||
# Load shared detection library
|
||||
# shellcheck source=lib/detect-plugins.sh disable=SC1091
|
||||
source "$REPO/lib/detect-plugins.sh"
|
||||
# Load shared libraries
|
||||
# shellcheck source=lib/gstack-playwright.sh disable=SC1091
|
||||
source "$REPO/lib/gstack-playwright.sh"
|
||||
# shellcheck source=lib/gstack-links.sh disable=SC1091
|
||||
source "$REPO/lib/gstack-links.sh"
|
||||
|
||||
# ── Guard hand-curated config against installer drift ────────
|
||||
# graphify's installer (Step 7) rewrites CLAUDE.md + .claude/settings.json
|
||||
# (clobbers the curated graphify section + injects aggressive MANDATORY
|
||||
# hooks), and `claude plugin install` (Step 5) flips enable-states in
|
||||
# settings.json. These 4 files are maintained by hand + commit, never by
|
||||
# the installer. Snapshot them now and restore on exit so a run leaves them
|
||||
# exactly as it found them. Pre-existing local edits are preserved; only the
|
||||
# installer's drift is undone. NOTE: this makes these files install-immutable
|
||||
# graphify's installer (Step 7) runs `graphify install` (appends a
|
||||
# `# graphify` block to ~/.claude/CLAUDE.md = CLAUDE.global.md, which holds
|
||||
# the curated `## graphify` section: it 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, injecting aggressive MANDATORY
|
||||
# hooks). The EXIT trap restores the 4 $REPO files in GUARDED_CONFIGS
|
||||
# (fully effective when run from $REPO, e.g. `make plugin`). `claude plugin
|
||||
# install` (Step 5) flips enable-states in settings.json. These 4 files are
|
||||
# maintained by hand + commit, never by the installer. Snapshot them now and
|
||||
# restore on exit so a run leaves them exactly as it found them. Pre-existing
|
||||
# local edits are preserved; only the installer's drift is undone. NOTE: this
|
||||
# makes these files install-immutable
|
||||
# — anything the installer should add to them must be committed by hand.
|
||||
# CLAUDE.md = project memory (graphify's rewrite target); CLAUDE.global.md
|
||||
# = user-scope global memory (deployed as ~/.claude/CLAUDE.md).
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# ============================================================
|
||||
# lib/detect-plugins.sh — Single source of truth for plugin detection
|
||||
# Sourced by: session-start.sh, doctor.sh, install-plugins.sh, update-all.sh
|
||||
# Sourced by: session-start.sh, doctor.sh
|
||||
#
|
||||
# Each function returns 0 (detected) or 1 (not detected).
|
||||
# No output — callers handle messaging.
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
# lib/doctor-skills.sh — doctor.sh's skill-catalog stats
|
||||
#
|
||||
# `skill_catalog_stats <skills_dir>` counts every skill reachable
|
||||
# through <skills_dir>/*/SKILL.md (symlinks included — Python's
|
||||
# through <skills_dir>/*/SKILL.md and <skills_dir>/pack-*/skills/*/SKILL.md
|
||||
# (symlinks included — Python's
|
||||
# glob.glob follows them, verified: a symlinked skill dir matches the
|
||||
# pattern the same as a real one) and sums their description length,
|
||||
# reusing lib/skill-routing-census.py's extract_description() (handles
|
||||
|
||||
+2
-1
@@ -6,7 +6,8 @@
|
||||
# assets (bin/, browse/dist/, design/dist/, lib/diagram-render/dist/,
|
||||
# ETHOS.md, scripts/jargon-list.json, freeze/bin/, */sections/*.md,
|
||||
# review/checklist.md + specialists/, …) that per-skill SKILL.md
|
||||
# symlinks never expose (BDR-030 links gstack skills individually).
|
||||
# symlinks never expose (BDR-030 links gstack skills individually
|
||||
# (superseded by BDR-134: packs)).
|
||||
# `link_gstack_helpers()` walks the submodule ONCE and mirrors every one
|
||||
# of those assets under <dst>, so make-pdf, diagram, the freeze hook,
|
||||
# cso/plan-*-review sections etc. actually resolve — before this, only
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
# single-occurrence + column-0 closing brace) so drift in install-plugins.sh
|
||||
# propagates into this test instead of testing a stale copy. GUARDED_CONFIGS,
|
||||
# CFG_SNAPSHOT, REPO and an info() stub are defined here — the array literal
|
||||
# at install-plugins.sh:43-44 is outside the extracted range.
|
||||
# GUARDED_CONFIGS array in install-plugins.sh is outside the extracted range.
|
||||
set -u
|
||||
INSTALL_SH="$(cd "$(dirname "$0")/../.." && pwd)/install-plugins.sh"
|
||||
pass=0; fail=0
|
||||
|
||||
@@ -54,8 +54,8 @@ for item in hooks githooks agents skills lib templates rules; do
|
||||
CHANGED=$((CHANGED + 1))
|
||||
done
|
||||
|
||||
# GStack is exposed via per-skill symlinks under skills/ (browse,
|
||||
# canary, autoplan, design-review, …) created by gstack's own `./setup`,
|
||||
# GStack skills are tracked links under skills/pack-gstack-*/skills/<n>
|
||||
# -> skills-external/gstack/<n> (packs, BDR-134),
|
||||
# PLUS a shared helper tree at skills/gstack/ mirroring every asset the
|
||||
# skills hardcode (bin/, browse/dist/, ETHOS.md, …) that a per-skill
|
||||
# symlink never exposes — see lib/gstack-links.sh. The helper tree
|
||||
|
||||
+1
-3
@@ -14,9 +14,7 @@ info() { echo -e "${BLUE}→${NC} $1"; }
|
||||
REPO="$(cd "$(dirname "$0")" && pwd)"
|
||||
VERSION=$(cat "$REPO/version.txt" 2>/dev/null || echo "unknown")
|
||||
|
||||
# Load shared detection library
|
||||
# shellcheck source=lib/detect-plugins.sh disable=SC1091
|
||||
source "$REPO/lib/detect-plugins.sh"
|
||||
# Load shared libraries
|
||||
# shellcheck source=lib/gstack-playwright.sh disable=SC1091
|
||||
source "$REPO/lib/gstack-playwright.sh"
|
||||
# shellcheck source=lib/gstack-links.sh disable=SC1091
|
||||
|
||||
Reference in new issue
Block a user