Merge feature/doctrine-rules-graphify into develop

This commit is contained in:
bchanot committed 2026-11-12 12:38:10 +01:00
commit 1226d051d2
13 files changed
+241 -29

No files matched your search

+7
View File
@@ -37,3 +37,10 @@
- lib/memory.sh:657 `memory_legacy_status` reads `MEM_LEGACY_RE` from the environment: an ambient `export MEM_LEGACY_RE` also widens `memory.sh upgrade`'s `<end>` readers (`_mem_legacy_open`, `_mem_explicit_status`, `_mem_repair_one`, the last one decides a v1 closure write). Fails closed on a bad regex. Fix: explicit 4th positional argument, drop the env read. Severity: low. Discovered while: /feat D4 security gate. Not fixed.
- lib/memory.sh `memory_legacy_status` `<end>` range on v1 decisions: the last BDR entry runs to EOF, so a `## Index` or other `##` section after it would be read by the widened selector (none on disk today). Severity: low. Discovered while: /feat D4 verifier. Not fixed.
- skills/prune-memory/tests/run-deterministic.sh:13 — `SANDBOX="$(mktemp -d …)"` unchecked under `set -uo pipefail` (no `-e`): a mktemp failure leaves SANDBOX empty and RED-9 targets `/red9a`, `/home9` (fails for a non-root user; trap `rm -rf ""` deletes nothing). Pre-existing, RED-9 extends it. Fix: `|| exit 1`. Cosmetic: skills/prune-memory/SKILL.md:34 ~96 chars unwrapped. Severity: low. Discovered while: /feat D4 security gate + verifier. Not fixed.
<!-- /feat D1+D5+D6 2026-11-12 (feature/doctrine-rules-graphify, c69ce9c): follow-ups from challenge rounds and gates, plan .claude/tasks/plans/2026-11-12-doctrine-rules-graphify-1123.md r3 -->
- hooks/session-start.sh:329-333 `_digest_todo` reads only a `### Actionable` heading (this repo only); init-project and onboard TODOs never show in the digest. Tracked as TODO D1b (user 2026-11-12). Severity: medium. Discovered while: /feat D1 challenge round 1. Not fixed.
- hooks/session-start.sh digest blocker line fails open: a failed or timed-out `memory.sh index blocker` (timeout 2, stderr dropped) prints no `- open:` line, same as zero open blockers. Fix: print `- open: none` after a successful read. Severity: low. Discovered while: /feat D1 challenge round 2. Not fixed.
- Stale graphify claims outside the D6 scope: .gitignore:54-56 ("written into the repo by `graphify claude install`"), plugins.lock.json:37 (bare `graphify install && graphify claude install` recipe), update-all.sh:310-312 (re-run `graphify claude install` MANUALLY, no trap, cwd-dependent → point at `make plugin`), install-plugins.sh:688/690/1269 labels ("dependencies", "Claude Code integration", "PreToolUse hook" for steps the trap reverts), install-plugins.sh:694-695 LRN-071 comment now gates only `graphify install`, guard comment vs rule duplication. LRN-154 (learnings.md:1381) still says `graphify install --platform claude` "touches nothing else". Severity: low. Discovered while: /feat D6 challenge + gates. Not fixed.
- lib/tests/curated-config-guard.test.sh does not lock the Step 7 `(cd "$REPO" && graphify claude install)` subshell; a later edit dropping it passes make test. Severity: low. Discovered while: /feat D6 challenge round 2. Not fixed.
- install-plugins.sh Step 7 hook window (pre-existing): `graphify claude install` hooks sit live in $REPO/.claude/settings.json until the EXIT trap; a SIGKILL skips the trap. Severity: low. Discovered while: /feat D6 security gate. Not fixed.
+6
View File
@@ -1542,3 +1542,9 @@ Supersedes [[BDR-030]].
- **Decision**: one classifier `reconcile_status_classify <file> <PREFIX>` (lib/reconcile.sh) for decisions + blockers: strict word v2, one-word status/statut label v1 (`RECONCILE_BDR_RE` widens v1 selector), never `## Index`. `reconcile_blk_classify` = BLK wrapper, output byte-identical. Unreadable status = one info-only count line per registry, outside "all", never written by skill, word from user per ID. User gated 2026-11-11.
- **Alternatives**: `memory.sh index decision` (reads no status on dialect/v1 projects); one reader per registry (duplicate parsers, BDR-129 drift class); guess word from prose (false open/close).
- **Consequences**: dialect projects (game, faunosteo) get no prune candidate until dialect migration (BUGS-FOUND follow-up). Commit 99f10b2, test RED-9.
## BDR-144 — Session start reads TODO and the digest, registries on demand [accepted] (2026-11-12)
- **Context**: CLAUDE.global.md Session start said read all 5 registries + TODO at every start; phase 4c digest (hooks/session-start.sh) already prints open BLK, Actionable TODO, last journal.
- **Decision**: read `.claude/tasks/TODO.md` + apply banner `memory digest` (open BLK, last journal); `+N` count line -> read those BLK in blockers.md; no digest (foreign repo, memory mod off) -> list open BLK by hand. Registries read when task needs; planning flows scan per `lib/analyze-before-plan.md`. capitalize closing line aligned. User gated 2026-11-12 (2 re-gates after challenge).
- **Alternatives**: digest only (rejected: `_digest_todo` reads only `### Actionable`, init-project/onboard TODOs lack it -> TODO unread in other projects); full 5-registry read each start (rejected: 78-357 KB files, cost 4a/4c removed).
- **Consequences**: D1b follow-up makes every project TODO digest-readable. Commit c69ce9c.
+1
View File
@@ -723,3 +723,4 @@ rules:
## 2026-11-12
- 2026-11-12: /feat D4 done on feature/prune-memory-status-reader: 99f10b2 one status classifier for prune-memory (v1+v2), docs bd0687d. 3 challenge rounds (r1 FATAL: memory.sh index reads no status on 4 projects). Gates: floor MET, verifier CONFORME, security PASS (4 LOW). 5 follow-ups in BUGS-FOUND. Merge awaits user.
- 2026-11-12: /feat D1+D5+D6 on feature/doctrine-rules-graphify: c69ce9c Session start TODO+digest, web-security deduped, graphify claude install from $REPO; docs a37df2f. 2 challenge rounds (r1 FATAL x2: D5 oracle clash, digest TODO only under ### Actionable -> D1 re-gated, D1b logged). Gates: floor MET, verifier CONFORME, security PASS. Merge awaits user.
+5
View File
@@ -2041,3 +2041,8 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s
- **Pattern**: before plan swaps a registry reader, probe candidate reader read-only on real registries of every project (game, config, faunosteo, faunosteo-v1-2), count readable vs empty.
- **Context**: D4 r1 assumed `memory.sh index decision` gives decision status. Probe: Status empty 107/107 game, 19/19 config, 76/80 faunosteo, 79/110 faunosteo-v1-2. Challenge correctness FATAL, plan r2-r3 needed.
- **Apply**: STEP 0.6 / plan phase of any memory-reader change: run reader on all known project registries first, put counts in plan. Fixtures alone hide dialects.
## LRN-279 — graphify install appends to CLAUDE.global.md, claude install writes the cwd (2026-11-12)
- **Pattern**: graphifyy 0.9.67 `graphify install` (default platform claude, install.py:691) copies skill into ~/.claude/skills AND appends H1 `# graphify` block at EOF of ~/.claude/CLAUDE.md = CLAUDE.global.md (exact-line marker, curated `## graphify` not matched). `graphify claude install` (install.py:1827) writes ./CLAUDE.md + ./.claude/settings.json (+ .graphify-bak) in cwd, never copies skill.
- **Context**: LRN-154 said `graphify install --platform claude` "touches nothing else": wrong. install-plugins.sh ran `graphify claude install` in caller cwd -> polluted foreign project outside trap. Fixed c69ce9c: `(cd "$REPO" && graphify claude install)`.
- **Apply**: run `graphify claude install` only from $REPO under guarded-config trap (`make plugin`). Manual recovery `graphify install --platform claude` -> delete trailing `# graphify` EOF hunk, never `git checkout` whole CLAUDE.global.md (loses uncommitted doctrine). Supersedes LRN-154 graphify specifics line.
+12 -9
View File
@@ -5,23 +5,26 @@ paths: ["skills/graphify/**", "install-plugins.sh"]
# Machine-owned: the vendored graphify skill
`skills/graphify/SKILL.md`, `skills/graphify/references/` and
`.graphify_version` are written by `graphify claude install`
(`install-plugins.sh` STEP graphify), which lands in the repo because
`~/.claude/skills` is a symlink to `skills/`. They are gitignored: a
`.graphify_version` are written by `graphify install` (default platform
claude; `install-plugins.sh` STEP graphify), which lands in the repo
because `~/.claude/skills` is a symlink to `skills/`. They are gitignored: a
`pipx upgrade graphifyy` used to dirty the tree and cost a
`chore(graphify): sync vendored skill X -> Y` commit each time.
Two graphify commands, easy to confuse, and only one restores the skill:
- `graphify install --platform claude` copies SKILL.md + `references/` +
`.graphify_version` into `skills/graphify/`. Touches nothing else.
This is the recovery command.
`.graphify_version` into `skills/graphify/`, and appends a `# graphify`
block to `~/.claude/CLAUDE.md` = `CLAUDE.global.md` (graphifyy 0.9.67).
This is the recovery command; then delete that trailing block (one EOF
hunk in `git diff`), never check out the whole file.
- `graphify claude install` writes the CLAUDE.md graphify section and the
`.claude/settings.json` PreToolUse hooks. It **rewrites both guarded
configs** (EVAL-020, verified again 2026-09-15), so revert them after. It does NOT copy
the skill.
`.claude/settings.json` PreToolUse hooks in the current directory. It
**rewrites both guarded configs** (EVAL-020, verified again 2026-09-15),
so revert them after. It does NOT copy the skill.
`make plugin` runs both (`install-plugins.sh` STEP graphify) behind the
guarded-config EXIT trap, so a fresh clone is covered.
guarded-config EXIT trap, so a fresh clone is covered; `install-plugins.sh`
runs the second from `$REPO`, whatever the caller's cwd.
Trade-off accepted: an upstream release can now change the skill's prompt
with no diff to review. `skills/graphify/test-prompts.json` is hand-written
+4 -3
View File
@@ -133,15 +133,16 @@ Shared rules for every phase:
### 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)
- [x] D1 doctrine (done c69ce9c + docs a37df2f, feature/doctrine-rules-graphify; TODO.md stays read at start, see D1b): 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)
- [ ] D1b (user 2026-11-12, after D1 challenge): every project TODO readable by the session digest. `_digest_todo` (hooks/session-start.sh:329-333) reads only a `### Actionable` heading, which only this repo has; skills/init-project seeds `# TODO\n\n## <date>`, skills/onboard STEP 9 writes `## P0 — Critique`…. Options to choose at planning: templates/init-project/onboard emit the heading + migrate existing TODOs (game, faunosteo, zenquality…), and/or digest falls back to the first unchecked `- [ ]` items. Until then D1 keeps TODO.md read at session start.
- [x] D2 visible (done 80f56ef, feature/banner-drop-plugin-dev): 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
- [x] D3 visible (done 9b12b12, BDR-142; follow-ups in BUGS-FOUND) (= 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
- [x] D4 skill behavior (done 99f10b2 + docs bd0687d, feature/prune-memory-status-reader; one classifier `reconcile_status_classify`, unreadable = info-only count; follow-ups in BUGS-FOUND): 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
- [x] D5 user rules (done c69ce9c; IDOR + RLS kept, service-key line dropped): 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
- [x] G1+G4 fixed (bugfix/banner-effective-profile, merged a655b06); G3 fixed (merged 9f9821e); G2 hand figures removed (bugfix/passive-cost-source, plan `.claude/tasks/plans/2026-11-10-passive-cost-source-1330.md` r3); G5 fixed (bugfix/handover-memory-status, 93a8e19, plan `.claude/tasks/plans/2026-11-10-handover-memory-status-1600.md` r3); follow-ups G6-G9 + 2 LOW quoting in BUGS-FOUND
- [ ] feature (G2 split, user 2026-11-10): measured passive-cost API, one source for doctor / /status / plugin-advisor (probe COSTS field). Spec input = the two challenge rounds in the G2 plan: unit = pack or ON plugin (skills + agents + commands descriptions; pr-review-toolkit ~1550t, example-skills ~2350t), doctor counts OFF packs (higgsfield, extras), `detect_plugin_dev` globs the wrong cache level and ignores enabled state, `?` for not-installed or empty units, rc-0 sentinels (`costs-unavailable`/`unknown`) for doctor's `set -euo pipefail`, profile.sh failure → unknown, `python3 -I` (probe runs in the user's project), installPath from installed_plugins.json. Doctor keeps its measured ui-ux 670 until then.
- [x] D3 add-ons (done 9b12b12) from G2 (plugin-advisor.md): plan-budget WARN :317 (unreachable: plugin-gate never sends PLAN, detect_plan gone), :42 "absolute COST ESTIMATE still reported", :105 `(budget: ~<N>t | n/a)`, :222 "passive cost estimate = highest-cost package profile", "0t passive" claims for impeccable / design-motion-principles (:226 :227 :268 :269); USAGE.md :248 "Budget Pro (~11k tokens/5h)", :494 `(~400t)`, :923 `(~200t)`; session-banner.test.sh SB10 `gone()` passes on a missing file (add an existence check)
- [ ] 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
- [x] D6 project rule (done c69ce9c; lead paragraph fixed too, follow-ups in BUGS-FOUND): .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
@@ -0,0 +1,36 @@
# CONTRACT — doctrine-rules-graphify
- date: 2026-11-12 | flow: feat | branch: feature/doctrine-rules-graphify
- status: active
## REQUEST (verbatim — IMMUTABLE)
D1+D5+D6 from .claude/tasks/TODO.md § Release 3.0.0 scope (user decisions 2026-11-11 [gated], TODO:158). D1 doctrine: CLAUDE.global.md:52-54 "Session start 1. Read `.claude/memory/`" + skills/capitalize/SKILL.md:375 still state the full read at session start, while the 4c digest (hooks/session-start.sh) delivers open BLK + TODO + last journal; decision: digest at start + on-demand registry read, capitalize:375 aligned. 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)"); decision: web-security keeps only its unique rules (cookie flags, upload type/size, forced HTTPS, security headers), points to secure-by-default, password = argon2id. 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; decision: rule text names the CLAUDE.global.md append + install-plugins.sh runs the graphify step from $REPO. Line numbers may have moved: re-locate. Grep every citer (doctrine-citers census in make test). make test needs GATES_TIMEOUT=600 + PATH=$HOME/.bun/bin:$PATH (LRN-271). Foreign-code style. In force: BDR-125, BDR-100, LRN-275 (explicit staging), LRN-276, LRN-277.
## CLARIFICATIONS
Q: plan? / A: .claude/tasks/plans/2026-11-12-doctrine-rules-graphify-1123.md, latest revision is binding (orchestrator)
Q: D1 Session start text (first answer, superseded)? / A: "digest + fallback" text: digest applied at start; no digest (foreign repo, memory mod off) → read TODO + open blockers yourself; full registry read on demand, planning flows read before planning; step "either missing → create" kept; capitalize:375 closing line "Next session: the startup digest shows open blockers, TODO and the last journal line." (user, 2026-11-12) [gated]
Q: D1 re-gate after challenge round 1 (`_digest_todo` reads only `### Actionable`, absent from init-project/onboard TODOs)? / A: TODO.md stays read at start; the digest gives open blockers + last journal line; no digest (foreign repo, memory mod off) → list open blockers yourself; registries read when the task needs it, planning flows scan them per `~/.claude/lib/analyze-before-plan.md`; capitalize:375 → "Next session: TODO.md and the startup digest (open blockers, last journal line)." Plan r2 holds the exact text (user, 2026-11-12) [gated]
Q: D1 digest `+N` count line hides upstream blockers (challenge round 2)? / A: add "a `+N` line → read those entries in `blockers.md`" to step 1 (user, 2026-11-12) [gated]
Q: TODO headings in other projects (user, 2026-11-12)? / A: follow-up run: make every project TODO readable by the digest (template/init-project/onboard heading, and existing TODOs or a digest fallback); out of this run, logged in TODO.md
Q: D5 lines partly covered by secure-by-default (service/admin key client-side, RLS on Postgres and kin, IDOR)? / A: drop the service-key line, keep IDOR and RLS generalized to Postgres and kin (user, 2026-11-12) [gated]
Q: MIGRATION.md:127 "Read `.claude/memory/`" diff? / A: historical 1.x upgrade step, left as is; the 3.0.0 MIGRATION section is a later run (orchestrator)
## ACCEPTANCE CRITERIA
1. D1: Session start reads TODO.md, names the digest (blockers + journal), the fallback and the on-demand registry scan; the full-read wording is gone from CLAUDE.global.md and capitalize.
CHECK: cd /home/bchanot/Documents/claude && G=CLAUDE.global.md && C=skills/capitalize/SKILL.md && grep -q '1. Read `.claude/tasks/TODO.md`' $G && grep -q 'memory digest' $G && grep -q 'memory mod off' $G && grep -q 'a `+N` line' $G && grep -q 'analyze-before-plan.md' $G && ! grep -q 'Read `.claude/memory/` (5 registries' $G && ! grep -q 'read .claude/memory/ at startup' $C && grep -q 'Next session: TODO.md and the startup digest' $C && [ "$(LC_ALL=C.UTF-8 awk 'length>80' $G | wc -l)" -le 3 ] && echo D1-OK
EXPECT: D1-OK
EVIDENCE: MET exit=0 marker-found :: D1-OK
2. D5: web-security keeps its unique rules plus IDOR and RLS, points to secure-by-default, drops duplicates and the bcrypt wording; body lines at most 80 chars.
CHECK: cd /home/bchanot/Documents/claude && W=rules/web-security.md && grep -q 'secure-by-default' $W && grep -q 'IDOR' $W && grep -q 'Row Level Security' $W && grep -q 'httpOnly' $W && grep -qi 'upload' $W && grep -q 'HTTPS' $W && grep -qi 'security headers' $W && ! grep -qi 'bcrypt' $W && ! grep -q 'No API key in code' $W && ! grep -q 'service/admin key' $W && ! grep -qi 'rate limit' $W && ! grep -q 'only the fields' $W && [ "$(tail -n +4 $W | awk 'length>80' | wc -l)" = 0 ] && echo D5-OK
EXPECT: D5-OK
EVIDENCE: MET exit=0 marker-found :: D5-OK
3. D6: the rule credits the skill copy to `graphify install`, names the CLAUDE.global.md append; install-plugins.sh runs `graphify claude install` only from $REPO.
CHECK: cd /home/bchanot/Documents/claude && R=.claude/rules/graphify-vendored.md && ! grep -q 'Touches nothing else' $R && ! grep -q 'written by `graphify claude install`' $R && grep -q 'written by `graphify install`' $R && grep -q 'CLAUDE.global.md' $R && grep -qF '(cd "$REPO" && graphify claude install)' install-plugins.sh && ! grep -qE '^[[:space:]]*graphify claude install' install-plugins.sh && ! grep -q 'claude install failed — run manually' install-plugins.sh && bash -n install-plugins.sh && echo D6-OK
EXPECT: D6-OK
EVIDENCE: MET exit=0 marker-found :: D6-OK
4. Full suite green, shellcheck clean, project rules valid.
CHECK: cd /home/bchanot/Documents/claude && shellcheck -S warning install-plugins.sh && bash lib/project-rules.sh check >/dev/null && GATES_TIMEOUT=600 PATH="$HOME/.bun/bin:$PATH" make test 2>&1 | tail -1 | grep -q 'all suites green' && echo GREEN
EXPECT: GREEN
EVIDENCE: MET exit=0 marker-found :: GREEN
## FILE SCOPE
CLAUDE.global.md (## Session start only), skills/capitalize/SKILL.md (the auto-persisted closing line only), rules/web-security.md, .claude/rules/graphify-vendored.md, install-plugins.sh (Step 7 `graphify claude install` line + the guard comment that says the trap is fully effective only from $REPO)
@@ -0,0 +1,147 @@
# PLAN r3 — D1+D5+D6 (doctrine, web rules, graphify rule), /feat 2026-11-12
Contract: .claude/tasks/contracts/2026-11-12-doctrine-rules-graphify-1123.md
Branch: feature/doctrine-rules-graphify (off develop 1cc89be)
Style: foreign code (keep each file's wrap, tone, list shape). Lines ≤ 80 chars.
## r2 changes (challenge round 1: correctness FATAL(2), robustness FATAL(3), simplicity CONCERNS(1))
- D5 intro = bare pointer (no summary of secure-by-default): closes the oracle clash ("rate limits"
matched `! grep -qi 'rate limit'`) and the parallel-copy drift (simplicity 3, correctness 1, robustness 1).
- D6 also rewrites the rule's lead paragraph (:7-9 credited the skill copy to `graphify claude install`;
only `install()` calls `_copy_skill_file`, install.py:713) (all three lenses).
- D6 recovery wording: delete the trailing `# graphify` block (one EOF hunk), never check out the whole
file (robustness 4). Step 7 warn for `graphify claude install` drops "run manually" (robustness 5).
- D1 re-gated by the user 2026-11-12: `_digest_todo` reads only a `### Actionable` heading, which only this
repo has, so TODO.md stays read at start; digest = blockers + journal; registries on demand, planning
flows scan per lib/analyze-before-plan.md (robustness 2, correctness 3-4).
- Contract D6 oracle also asserts the bare `graphify claude install` call is gone (robustness 6).
- Not taken: trimming the gated D1 registry list (simplicity 2, user-approved text); guard-comment dedup
(simplicity 4) → follow-up.
- Follow-ups (BUGS-FOUND at capitalize): `_digest_todo` fallback to first `- [ ]` items without an
Actionable heading (hook + session-digest test); .gitignore:55-56 and plugins.lock.json:37 same stale
claim / bare recipe; guard comment vs rule duplication; LRN-154 status line at capitalize.
## r3 changes (challenge round 2: correctness SOLID, robustness CONCERNS(2), simplicity SOLID)
- D1 step 1 gains "a `+N` line → read those entries in `blockers.md`" (upstream blockers with live
workarounds fold into the digest's count line; user re-gate 2026-11-12) (robustness 2).
- Step 7: `graphify claude install` failure no longer sets `_graphify_ok=0`, so :697 "re-run the failed
step manually" fires only for `graphify install` (the skill copy); short warn (robustness 1,
simplicity 1, correctness 2).
- D5 keeps web-security.md:13 RLS line verbatim (already "Supabase/Postgres and kin") (simplicity 2).
- D6: lead paragraph replaces lines 7-10 (correctness 1); cwd clause attached to install-plugins.sh,
not `make plugin` (simplicity 3); guard comment wording fixed (correctness 3).
- Contract D1 width check pinned to `LC_ALL=C.UTF-8` (correctness 4).
- More follow-ups: install-plugins.sh:688/690/1269 graphify labels; update-all.sh:310-312 manual
`graphify claude install` recipe → `make plugin`; digest `- open: none` so a missing line means
"reader failed"; curated-config-guard test asserting the Step 7 subshell line.
## Facts checked (read-only)
- `~/.claude/CLAUDE.md` → symlink to `$REPO/CLAUDE.global.md`; `~/.claude/rules` → `$REPO/rules`.
- graphifyy 0.9.67 install.py:691 `install(platform="claude")` (CLI default claude, :2151): copies the
skill (:713 `_copy_skill_file`), then `_register_always_on_block(~/.claude/CLAUDE.md or
$CLAUDE_CONFIG_DIR/CLAUDE.md)` → appends an H1 `# graphify` block at EOF of CLAUDE.global.md.
install.py:1827 `claude_install(project_dir=None)`: writes `./CLAUDE.md` + `_install_claude_hook(".")`
(`.claude/settings.json`) in the cwd. It never copies the skill.
- install-plugins.sh:17 `REPO=...`; :34-50 guard comment + GUARDED_CONFIGS (CLAUDE.md, CLAUDE.global.md,
.claude/settings.json, settings.json) restored from `$REPO/` by the EXIT trap; :686-699 Step 7.
- hooks/session-start.sh: digest on startup/clear/compact; none on resume, `memory.json` enabled:false,
foreign repo (`gitflow.protect false`), missing jq/timeout in a hook, nothing to show. Content: open
blockers (≤3 + upstream count), first 3 unchecked items under `### Actionable` only (:329-333), last
journal bullet.
- rules/secure-by-default.md has no `paths:` → always on (BDR-120).
- Citers: `Read \`.claude/memory/\`` CLAUDE.global.md:53 + MIGRATION.md:127 (historical 1.x diff, left);
`read .claude/memory/ at startup` skills/capitalize/SKILL.md:375 only; "written by `graphify claude
install`" graphify-vendored.md:8 + .gitignore:55-56 (follow-up); `touches nothing else`
graphify-vendored.md:16 + learnings.md:1381 (LRN-154, status line at capitalize).
## PLAN
[ ] CLAUDE.global.md:53-55 — replace the `## Session start` body with D1 text (exact, below)
[ ] skills/capitalize/SKILL.md:375 — tail `Next session: read .claude/memory/ at startup.`
→ `Next session: TODO.md and the startup digest (open blockers, last journal line).`
(only that sentence; the rest of the line verbatim)
[ ] rules/web-security.md — rewrite body (exact, below); frontmatter `paths:` line unchanged
[ ] .claude/rules/graphify-vendored.md — lead paragraph :7-9 and the two command bullets + the
`make plugin` sentence (exact, below); rest verbatim
[ ] install-plugins.sh:691 — replace the line with exactly:
` (cd "$REPO" && graphify claude install) 2>/dev/null || warn "graphify claude install failed"`
(no `_graphify_ok=0`: its writes are reverted by the trap, the LRN-071 gate tracks `graphify install`)
[ ] install-plugins.sh:38-41 — in the guard comment: ":39 `in the caller's cwd`" → "in its own cwd";
"(fully effective when run from $REPO, e.g. `make plugin`)" → "(Step 7 runs `graphify claude
install` from $REPO in a subshell, so the trap covers its CLAUDE.md and .claude/settings.json
writes whatever the caller's cwd)"; rewrap to ≤ 80 chars, rest verbatim.
## Exact texts
D1 (CLAUDE.global.md, replaces lines 53-55; heading kept):
```
1. Read `.claude/tasks/TODO.md`. The banner's `memory digest` lists open
blockers and the last journal line: apply both before touching
anything; a `+N` line → read those entries in `blockers.md`. No
digest (foreign repo, memory mod off) → list the open blockers
yourself.
2. Read a registry (`.claude/memory/`: decisions, learnings, blockers,
journal, evals) when the task needs it; planning flows scan them per
`~/.claude/lib/analyze-before-plan.md`.
3. Either missing → create it first (templates: `~/.claude/templates/memory/`).
```
D5 (rules/web-security.md body after the frontmatter):
```
# Web app security — specifics
Extends `~/.claude/rules/secure-by-default.md` (always on). If a request
breaks one of these rules, say so instead of doing it.
- Row Level Security enabled on every table (Supabase/Postgres and kin).
- No IDOR: changing an id in a URL must never expose another user's
data. Authorize object access on every request.
- Session cookies httpOnly + secure + sameSite.
- Uploads restricted by type and size.
- HTTPS forced.
- Security headers set.
```
D6 (.claude/rules/graphify-vendored.md). Lead paragraph, replaces lines 7-10:
```
`skills/graphify/SKILL.md`, `skills/graphify/references/` and
`.graphify_version` are written by `graphify install` (default platform
claude; `install-plugins.sh` STEP graphify), which lands in the repo
because `~/.claude/skills` is a symlink to `skills/`. They are gitignored: a
```
(line 11 "`pipx upgrade graphifyy` used to dirty the tree and cost a" and what follows stay verbatim.)
The two bullets and the sentence after them:
```
Two graphify commands, easy to confuse, and only one restores the skill:
- `graphify install --platform claude` copies SKILL.md + `references/` +
`.graphify_version` into `skills/graphify/`, and appends a `# graphify`
block to `~/.claude/CLAUDE.md` = `CLAUDE.global.md` (graphifyy 0.9.67).
This is the recovery command; then delete that trailing block (one EOF
hunk in `git diff`), never check out the whole file.
- `graphify claude install` writes the CLAUDE.md graphify section and the
`.claude/settings.json` PreToolUse hooks in the current directory. It
**rewrites both guarded configs** (EVAL-020, verified again 2026-09-15),
so revert them after. It does NOT copy the skill.
`make plugin` runs both (`install-plugins.sh` STEP graphify) behind the
guarded-config EXIT trap, so a fresh clone is covered; `install-plugins.sh`
runs the second from `$REPO`, whatever the caller's cwd.
```
## Edge cases
- Caller cwd ≠ $REPO: the subshell cd leaves the caller's CLAUDE.md/.claude/settings.json untouched; the
trap restores $REPO's. Subshell keeps the script's cwd for later steps.
- `cd "$REPO"` failure → `&&` short-circuits, `||` warns, `_graphify_ok=0` (same path as today).
- Digest absent or without TODO lines: TODO.md is read anyway (step 1); blockers listed by hand only
when no digest prints.
## Tests
- No new test file (5-file limit; prose + one subshell line). Contract oracles lock each change;
doctrine-citers census, project-rules check, user-rules, curated-config-guard and the full make test run
in GREEN.
## Disposition
- honors BDR-028 / LRN-039: guarded-config trap kept, now effective from any cwd.
- honors BDR-120: web-security points at the always-on secure-by-default (one source per rule).
- honors BDR-125: the 4a/4c digest premise reaches the doctrine, TODO read kept where the digest is blind.
- honors BDR-100: citers grepped; out-of-cap citers logged as follow-ups.
- LRN-275 explicit staging; LRN-277 executor brief forbids stdin readers.
+3
View File
@@ -67,6 +67,8 @@ Format follows [Keep a Changelog](https://keepachangelog.com/) and this project
- Profiles deny no claude.ai connector: the two higgsfield connectors were removed from the claude.ai account on 2026-11-09, so `deniedMcpServers` leaves `audit`, `dev`, `minimal`, `qa` and `seo`, and the pack census drops its connector rule. A project that ran `profile.sh set` with one of those five profiles before this change keeps the two entries in its `.claude/settings.local.json`, and no profile verb strips them any more: harmless while the connectors stay removed, delete them by hand before reconnecting either one. Reconnecting them for good: revert the merge of `chore/connector-deny-cleanup` into develop (`git revert -m 1 <merge>`), which restores the denies, their census rule and the docs.
- The plugin advisor speaks packs and profiles and emits tokens only; the plugin gate checks them against closed lists, shows what a profile set turns off and on, and applies at the git root only. A profile set is proposed only on a project without a profile; a hotfix request never changes the profile.
- The banner's OFF row disappears when every toggle is on; /onboard's ctx7 offer runs `npm install -g ctx7` only.
- Session start (`CLAUDE.global.md`): read `.claude/tasks/TODO.md` and apply the banner's `memory digest` (open blockers, last journal line; a `+N` line means read those entries in `blockers.md`; no digest, for a foreign repo or with the memory mod off, means list the open blockers by hand). Registries are read when the task needs them, and planning flows scan them per `lib/analyze-before-plan.md`; the full read of all five registries at every start is gone. The `/capitalize` auto-persisted closing line now points the next session at TODO.md and the startup digest.
- `rules/web-security.md` extends `~/.claude/rules/secure-by-default.md` (always on) and keeps only its own rules: RLS on every table, no IDOR, session cookie flags, upload type and size limits, forced HTTPS, security headers. Browser-side keys, server-side auth, password hashing (argon2id), minimal response fields and login rate limiting live only in secure-by-default.
### Removed
- `rules/default-language.md`: its content is `lib/architecture-defaults.md` § Default language.
@@ -91,6 +93,7 @@ Format follows [Keep a Changelog](https://keepachangelog.com/) and this project
- `lib/memory.sh` reads a path shaped like an awk assignment (`x=1.md`, `a=b`) as a file: `add --body-file`, `check` and `upgrade` prefix it with `./`, where awk took it for a `var=value` operand and read stdin. Tests: `lib/tests/memory.test.sh` T19, T19b, T19c.
- Hook-running test suites source `lib/tests/claude-stub.sh`: a logging `claude` stub goes first on PATH and the suite exits if it is not the one resolved, so a hook run can no longer start a real session that re-runs the hook (fork bomb). Suite `lib/tests/claude-stub.test.sh`.
- The session banner's ✅ row, `detect_uiux_pro_max` and `/status` `Plugins ON:` follow the effective profile of the project and conversation (`list_on_plugins` in `lib/detect-plugins.sh`). Ids that `lib/profiles` manages come from `profile.sh current --plain`; other ids come from the user-scope `settings.json`. Before, the row read the user-scope `settings.json` and the plugin cache. A `dev` project showed ui-ux-pro-max as on, an `audit` project hid pr-review-toolkit, and model-router (enabled through the profile) did not appear. `/status` no longer treats the plugin cache as active state (the cache means installed). The plugin advisor takes per-project state from PROFILE, not from `claude plugin list`.
- `install-plugins.sh` Step 7 runs `graphify claude install` from the repo in a subshell. Run from another directory, it wrote `CLAUDE.md` and `.claude/settings.json` into the caller's cwd, outside the EXIT trap that restores the repo's guarded files.
## [2.0.0] — 2026-10-06
+9 -3
View File
@@ -50,9 +50,15 @@ code" wins. Repo-specific instructions override both.
Hacky fix → rebuild clean, no over-engineering.
## Session start
1. Read `.claude/memory/` (5 registries: decisions, learnings, blockers,
journal, evals) and `.claude/tasks/TODO.md`. Apply before touching anything.
2. Either missing → create it first (templates: `~/.claude/templates/memory/`).
1. Read `.claude/tasks/TODO.md`. The banner's `memory digest` lists open
blockers and the last journal line: apply both before touching
anything; a `+N` line → read those entries in `blockers.md`. No
digest (foreign repo, memory mod off) → list the open blockers
yourself.
2. Read a registry (`.claude/memory/`: decisions, learnings, blockers,
journal, evals) when the task needs it; planning flows scan them per
`~/.claude/lib/analyze-before-plan.md`.
3. Either missing → create it first (templates: `~/.claude/templates/memory/`).
## Workflow
- Confirm the approach only when real trade-offs exist (several valid
+5 -3
View File
@@ -36,9 +36,11 @@ source "$REPO/lib/gstack-links.sh"
# `# 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
# .claude/settings.json in its own 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
# (Step 7 runs `graphify claude install` from $REPO in a subshell, so the
# trap covers its CLAUDE.md and .claude/settings.json writes whatever the
# caller's cwd). `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
@@ -688,7 +690,7 @@ if command -v graphify &>/dev/null; then
info "Running graphify install (dependencies)..."
graphify install 2>/dev/null || { warn "graphify install failed — run manually"; _graphify_ok=0; }
info "Configuring Claude Code integration..."
graphify claude install 2>/dev/null || { warn "graphify claude install failed — run manually"; _graphify_ok=0; }
(cd "$REPO" && graphify claude install) 2>/dev/null || warn "graphify claude install failed"
# Success message gated on the real outcome (LRN-071 class: an
# unconditional ok after `|| warn` lies when a step failed).
if [ "$_graphify_ok" -eq 1 ]; then
+5 -10
View File
@@ -4,18 +4,13 @@ paths: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "**/*.vue", "**/*.svelte",
# Web app security — specifics
Extends the global Security section (input validation, parameterized
queries, secrets in env vars, AuthN/AuthZ, fail closed). If a request
Extends `~/.claude/rules/secure-by-default.md` (always on). If a request
breaks one of these rules, say so instead of doing it.
- No API key in code shipped to the browser. Env vars, server-side only.
- The service/admin key never reaches the client: publishable key only.
- Row Level Security enabled on every table (Supabase/Postgres and kin).
- Authentication verified server-side, never only in the browser.
- No IDOR: changing an id in a URL must never expose another user's
data. Authorize object access on every request.
- Passwords hashed (bcrypt/argon2). Session cookies httpOnly + secure
+ sameSite.
- API responses return only the fields the client needs.
- Login rate limiting, upload restrictions (type/size), forced HTTPS,
security headers.
- Session cookies httpOnly + secure + sameSite.
- Uploads restricted by type and size.
- HTTPS forced.
- Security headers set.
+1 -1
View File
@@ -372,7 +372,7 @@ CAPITALIZE COMPLETE — <YYYY-MM-DD> (<pre-wipe flush | session-close>)
Then the closing line — pick by the STEP 5C persist result (`<mode>` = `Context
flushed` for pre-wipe, `Session closed` for ritual):
- **auto-persisted (push mode `auto`, finish rc 0 AND `ahead` = 0)** → `✅ <mode> + persisted to origin/develop (<short>). Next session: read .claude/memory/ at startup.`
- **auto-persisted (push mode `auto`, finish rc 0 AND `ahead` = 0)** → `✅ <mode> + persisted to origin/develop (<short>). Next session: TODO.md and the startup digest (open blockers, last journal line).`
On the `--no-push` path ONLY read TWO facts first, each its own Bash call: `bash "$HOME/.claude/lib/gitflow.sh" push-mode` and `git rev-list --count origin/chore/<name>..chore/<name> 2>/dev/null || echo unknown` (`branch_ahead`). `<push mode>` below is the verb's word. The WORKING-branch and rc 3 paths have no `chore/<name>` and never use the mode.