forked from bchanot/claude
chore(memory): LRN-087 + LRN-088 + LRN-077 corrob + BDR-026 incident + journal 2026-07-02
Audit session capitalization: presence-flag ≠ capability (rtk), token verbosity-beats-cardinality, T6c transient-state green, copies-of-secrets incident (magic key rotated). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016zA3Qh2Q1QpcGXzXxKeDHR
This commit is contained in:
co-authored by
Claude Fable 5
parent
8cade82edb
commit
85a5f4b53d
@@ -106,6 +106,8 @@ rules:
|
||||
| LRN-084 | 2026-07-01 | protection hook enforces PROD not the full branch-flow; exemption masked the rule-vs-guard divergence | a guard exempts a class / checks one predicate — verify it encodes full intent |
|
||||
| LRN-085 | 2026-07-01 | Idempotent CLI install/update: `command -v` skip-if-present guard + detect channel (`npm ls -g` vs native symlink) before choosing updater; never `npm --force` over a bin npm doesn't own | any installer/updater for a CLI with >1 install channel |
|
||||
| LRN-086 | 2026-07-02 | External-tool-generated skill: prove provenance by mtime (not repo grep), gitignore + regen via install-step; guard regen on ABSENCE when the tool co-writes a user-editable config | any untracked skill/dir a tool (ctx7, etc.) drops into the repo |
|
||||
| LRN-087 | 2026-07-02 | presence-flag ≠ capability — rtk silently dead after .bashrc wipe; emitted commands need ABSOLUTE bin paths (they run in another shell); integrity pin = live machinery, re-pin on hook edit | any PATH-dependent capability + hand-managed shell profile; hooks emitting commands for another shell |
|
||||
| LRN-088 | 2026-07-02 | token-cutting intuition inverts under measurement — verbosity beats cardinality (gstack 34 skills ≈ 592 tok vs pr-review 6 agents ≈ 2,183) | any "disable X to save tokens" — measure per-item bytes first; profiles toggle skills, not plugin payloads |
|
||||
|
||||
---
|
||||
|
||||
@@ -870,6 +872,7 @@ rules:
|
||||
- **pattern**: a baseline agent on a worktree named `wt-pre-reconcile` read "pre-reconcile" FROM THE DIR NAME and inferred staleness — reasoning for the WRONG reason (the name), not the right one (verify git). Fixtures + the GREEN test were re-frozen under NEUTRAL names so the engine reaches truth by querying git, never by reading a path hint.
|
||||
- **meta — same symptom, distinct cause as [[LRN-074]]**: 074 = a COMMAND-ASSUMPTION (ugrep parsed `-9..` → false green); 077 = a LEAKY FIXTURE (name telegraphs the answer). Different mechanisms, SAME symptom: the test passes/fails for the wrong reason. Cross-cutting lesson = verify a test passes for the RIGHT reason, not merely that it passes — whether the false signal comes from an assumed command (074) or a leaky fixture (077).
|
||||
- **future application**: name fixtures/paths neutrally; for any green, ask "did it pass because the subject did the work, or because something leaked the answer?"
|
||||
- **corroboration 2026-07-02 (T6c)**: 3rd family member — test truth borrowed from TRANSIENT env state. run-reconcile T6c asserted `$MEM/../skills/darwin-skill` = `.claude/skills/` (the [[LRN-042]] parasite dir), not canonical `skills/`; born green because the parasite still existed, red since the same-day cleanup, unnoticed until the 2026-07-02 audit re-ran the suite ([[EVAL-011]]'s "20/20" silently 19/1 for 2 days). Oracles target CANONICAL paths (never derived `X/../Y`); re-run suites after ANY env cleanup tests may have silently depended on; "green at build" ≠ "green now".
|
||||
|
||||
## LRN-078 — semver number DERIVES from the change nature; "breaking" = requires a migration
|
||||
- **Date**: 2026-06-30
|
||||
@@ -937,3 +940,19 @@ rules:
|
||||
- **Pattern**: (a) provenance of an untracked artifact — a repo-script grep is BLIND to external-binary generators. Correlate its mtime with the tool's OWN files (creds/config) + read the tool's subcommands (`ctx7 setup --claude/--cli/--mcp`, `remove`) before deciding hand-authored vs tool-owned. (b) `ctx7 setup --claude --cli` writes TWO files 0.13s apart: `~/.claude/skills/find-docs/SKILL.md` (`~/.claude/skills` = symlink to repo `skills/` → lands IN repo) AND `~/.claude/rules/context7.md` (global config, real dir, NOT in repo, user-editable). (c) login ≠ setup: `ctx7 login` = auth/rate-limits only (help = only `--no-browser`), does NOT trigger setup. Orthogonal.
|
||||
- **Rule**: tool-generated skill → gitignore it (like `skills-external/frontend-design/`) + regenerate via an install step, do NOT vendor. gitignore coherence: ignoring an artifact REQUIRES an install-step that regenerates it, else a fresh clone loses it. BUT when the same `setup` ALSO (re)writes a user-editable config, guard regen on ABSENCE (`[ ! -f .../find-docs/SKILL.md ]`) — an every-run `setup` would silently clobber that config once customized. Contrast frontend-design: unconditional re-sync is fine (its file is not user-editable).
|
||||
- **Future application**: before gitignore-vs-commit on any untracked skill/dir, PROVE provenance (mtime + tool subcommands), never trust a repo grep alone. Tool-owned → gitignore + install-step regen; gate the regen on absence iff the generator co-writes anything the user may hand-edit. Reuses [[LRN-085]] presence-guard oracle (file presence = deterministic). See [[LRN-084]] (guard scope vs full intent), install-plugins.sh Step 6, commit `01d8b8f`.
|
||||
|
||||
## LRN-087 — presence-flag ≠ capability: rtk silently dead after .bashrc wipe
|
||||
|
||||
- **Date**: 2026-07-02
|
||||
- **pattern**: binary installed + hook wired + registries say "always-on" ≠ capability LIVE. Hand-managed .bashrc restore dropped the cargo PATH line → `command -v rtk` failed in hook AND tool shell → hook warned+passed-through EVERY Bash call, input compression OFF ~9 days. Banner truthfully dropped rtk — but an ABSENT line is invisible signal, nobody noticed. Reality/registry gap held ([[BDR-006]]-era always-on belief survived).
|
||||
- **fix shape (3 teeth)**: (1) consumer self-heals — probe known install dirs (`~/.cargo/bin`, `~/.local/bin`), never trust PATH ([[LRN-036]]); (2) an emitted/rewritten command executes in ANOTHER shell whose PATH the hook cannot fix → substitute the ABSOLUTE bin path at string head; compound rewrites with residual bare bin at a command position → pass through, never emit a 127 (global substitution unsafe: quoted text, e.g. commit messages, carries the same token at line start — proven live); (3) the rtk BINARY verifies its hook against `hooks/.rtk-hook.sha256` at execution and refuses a modified hook → every legit hook edit must re-pin. Pin = live machinery, NOT vestige — audit rec "delete it" REFUTED by execution ([[LRN-037]]).
|
||||
- **future application**: any PATH-dependent capability + hand-managed shell profile → probe install dirs, absolute paths in emitted commands, verify capability END-TO-END; a status line that can silently disappear ≠ monitoring. Check for integrity pins before editing generated hooks.
|
||||
- **Reference**: `hooks/rtk-rewrite.sh` (RTK_BIN + absolute-path substitution + compound pass-through), `lib/detect-plugins.sh` detect_rtk, branch bugfix/audit-bugs (audit 2026-07-02). [[BLK-001]] context. See [[LRN-036]], [[LRN-037]].
|
||||
|
||||
## LRN-088 — token-cutting intuition inverts under measurement: verbosity beats cardinality
|
||||
|
||||
- **Date**: 2026-07-02
|
||||
- **pattern**: fixed per-session context overhead measured ~14.6k tok (audit 2026-07-02). The intuitive target (gstack, 34 skills) = only ~592 tok — terse one-liner descriptions. Real weights: CLAUDE.md 3,788 · personal skill descriptions ~3,488 (hand-written trigger lists, ~6× cost/skill vs gstack) · pr-review-toolkit agents 2,183 (6 agents, PR-only use) · superpowers session-inject 1,540 · context7 rule 493. Cutting by item-COUNT intuition misallocates effort ~4×.
|
||||
- **actions taken**: pr-review-toolkit OFF by default (−2,183; audit.profile keeps it = reactivation channel), 10 fattest personal descriptions compressed 6,416→4,243 chars (−~540), context7 rule dropped for the find-docs skill (−493; skill body loads on-demand, stable — regen keyed on find-docs absence). Total ≈ −3.2k/session ≈ −22%.
|
||||
- **future application**: before any "disable X to save tokens" → measure per-item bytes FIRST (frontmatter extraction, plugin cache); expect the fat where descriptions are hand-written rich, not where items are many. Profiles toggle SKILLS only — plugin payloads (agents/skills in cache) need `enabledPlugins`. [[LRN-080]] measure-first corroborated on a new axis (cost, not behavior).
|
||||
- **Reference**: audit 2026-07-02 measurement + branch feature/audit-tokens. See [[BDR-014]], [[LRN-043]].
|
||||
|
||||
Reference in New Issue
Block a user