diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 9512c7b..143faed 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -748,3 +748,4 @@ rules: - /bugfix safety-lows (block H4b): code-limits private state dir (mkdir -m 700 no -p + one find test), session-start runner timeout→gtimeout→perl alarm, pre-commit fails closed on git diff and filter errors (generator lib/gitflow.sh + both copies), memory.sh rewrap, claude-stub env log path (1f107c3). 4 rounds: generator was the hook source (decision a), GATE 2 MEDIUM stat/lstat race closed, lint regressions fixed. Residual: perl alarm kills the exec'd process only (TODO). - /bugfix feedback-followups (block H5, 4d follow-ups): post-fix split + 3rd pick retired + one-slot transcript cache + strict labels/state + key-set pins (9f9412a, docs). 3 challenge lenses FATAL on r1 (midnight cutoff, validator rejecting own rows, text-block extraction losing every join); 3 executor rounds (locals, at bound, legacy closed flag). RSS 279.8 → 267.7 MB on 16 records. tsc not done (no compiler, new dep), l: kept (49.7 KB of 4 MiB), image prompts dropped (0 instances). LRN-288. - /bugfix bugs-found-prose (block H6a): 10 prose BUGS-FOUND items closed (77041e5): handover rooting + PROJECT_ROOT line + BDR status filter, plugin-gate quoting/unsafe-root/common-dir/$HOME (+ profile.sh refusal T27), advisor rules, packs vocabulary, graphify labels. 4 rounds; GATE 2 MEDIUM single-quote break-out closed by the unsafe-root rule. D1b and dead-entry items closed; 5 pre-existing findings logged. LRN-154 corrected. +- /bugfix bugs-found-scripts (block H6b): 7 BUGS-FOUND script items closed (9045a60): profile-state.jq clean + plugin id shape, digest open none/unknown (+ doctrine line), deny_lost PIPESTATUS, T63 ask/deny split, T7 lock, mktemp guard. Verifier ECARTS(1) (profile.test.sh:123 comment broke shellcheck) → r2 CONFORME, security PASS. Docs 599684c, audits 7c8726b. 3 new LOW in BUGS-FOUND (memory_index rc 0 on unreadable registry). diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index c646e39..a22cce5 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -2093,3 +2093,8 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s - **Context**: block H5 2026-11-13: the BDR-146 residual fix (post-fix precision split) went through 3 lenses + confirmation + 3 executor rounds; every round found a defect only live data showed. - **Pattern**: a time cutoff for "after the fix" = the MERGE instant of the fix (git committer time of the merge), not the fix date at midnight (36 pre-fix rows sat between midnight and the merge). A gate derived from several marks must be recomputed on read, never trusted from a stored flag an older version wrote (a legacy `"closed":true` silenced the reminder for the new gate). Sample floors are counted in the unit the gate already uses (asks, not entries). A validator added on read must accept every row kind the writer emits (round-trip test over `rowsOf`), and the writer must not accept what the reader refuses (`at` 1e21). - **Apply**: measure on the live data before planning a metrics change (labels.tsv, store, transcripts read-only); pin the reader/writer round trip; derive closed/reached flags from their inputs. + +## LRN-289 — shellcheck stops at a comment starting with 'shellcheck'; pipefail masked by grep rc 1 (2026-11-13) +- **Pattern**: (1) comment line starting `# shellcheck` (e.g. `# shellcheck + width`) parsed as malformed directive: SC1073/SC1072, shellcheck stops parsing, rest of file never linted; counting findings vs HEAD hides it (same count both sides). (2) `set -o pipefail` on `cmd | jq | grep -v` masked: grep rc 1 on empty result = legit, pipefail cannot tell it from jq failure; read `${PIPESTATUS[@]}`, fail on stage rc ≠ 0 and grep rc ≥ 2. +- **Context**: /bugfix bugs-found-scripts (H6b) 2026-11-13: lib/tests/profile.test.sh:123 unlinted since written; push-guard deny_lost (9045a60). +- **Apply**: never start a comment with `shellcheck` word; gate "shellcheck clean" = rc 0, not "count equal to HEAD". Pipe ending in grep-filter → PIPESTATUS check, not pipefail. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 8bf446e..7f72967 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -58,7 +58,7 @@ Open children of the shipped phases (History 2026-11-12), text verbatim. - Phase 1 leftovers: done 2026-11-13 in block E (E1 design hook deleted, BDR-148; E2 Skill routing lines → descriptions, BDR-149). - Phase 5 leftovers: done 2026-11-13 (block H3, bugfix/pack-census-followups 2fb9a2f): `grep -qxF`, fragment top-level key allowlist (four keys profile.sh reads). - Phase 2 leftovers: security-gate LOWs done 2026-11-13 (block H4a, bugfix/phase2-deny-lows a43ba1b: awk `system (`/`-f`/`getline`/`| "` + gawk/mawk, `.key`/`.pem`/`id_rsa`/`id_ed25519` root forms + rtk twins, doctor.sh:255 message). The "stated residuals" line (Bash write forms outside the routing guard, latch reset on reload, `.claude/worktrees/` writes, state dirs in TMPDIR, `| bash -s` / sourced `gitflow_finish` / `git -C merge` = soft_deny prose) names ACCEPTED limits of BDR-125 phase 2 (Amendment 7: interpreters and Bash write forms are classifier territory, no static rule), not tasks: removed. rtk `cat|head|tail *.env*` forms: benched 2026-11-13 (`rtk cat|head|tail --help` = coreutils pass-through on rtk 0.50.0), all six kept, T42 untouched. Remaining phase 2 items (code-limits `mkdir -m 700` + owner check, pre-commit allowlist fail-closed, session-start timeout fallback, `_mem_path_safe` wrap) → block H4b. - - [ ] push-guard T63 presence check reads ask+deny (:430): a deny row demoted to ask still passes; split the lookup per kind (GATE 2 LOW 2026-11-13, new). + - [x] push-guard T63 split per kind (9045a60, H6b): 16 ask rows checked in .permissions.ask, 37 deny rows in .permissions.deny; demotion flip red. - Context measure leftovers (2026-11-09, LRN-270): - [ ] Open: dev System tools 11.3k vs full 7.7k (interactive) comes from some pack being off, not MCP; unattributable via `/context`. Bisect by toggling one pack at a time interactively if it matters. - [ ] Follow-up candidate (accepted risk): doctor residue check covers `enabledPlugins` only; a UI write into user-scope `skillOverrides` would dirty tracked settings.json unseen. diff --git a/.claude/tasks/contracts/2026-11-13-bugs-found-scripts-1930.md b/.claude/tasks/contracts/2026-11-13-bugs-found-scripts-1930.md index db0f350..73b12df 100644 --- a/.claude/tasks/contracts/2026-11-13-bugs-found-scripts-1930.md +++ b/.claude/tasks/contracts/2026-11-13-bugs-found-scripts-1930.md @@ -18,19 +18,19 @@ Fix the BUGS-FOUND entries unfixed since 2026-11-09 that live in scripts and tes 1. Suites green: profile (or session-banner), session-digest, curated-config-guard, push-guard, prune-memory deterministic. CHECK: cd /home/bchanot/Documents/claude && PATH=$HOME/.bun/bin:$PATH make test suite=lib/tests/push-guard.test.sh 2>&1 | tail -1 EXPECT: all suites green - EVIDENCE: PENDING + EVIDENCE: MET exit=0 marker-found :: all suites green 2. session-digest green with the two new cases. CHECK: cd /home/bchanot/Documents/claude && echo $(grep -c 'open: none' hooks/session-start.sh lib/tests/session-digest.test.sh | grep -c ':[1-9]')$(PATH=$HOME/.bun/bin:$PATH make test suite=lib/tests/session-digest.test.sh 2>&1 | tail -1) EXPECT: 2all suites green - EVIDENCE: PENDING + EVIDENCE: MET exit=0 marker-found :: 2all suites green 3. curated-config-guard and prune-memory suites green. CHECK: cd /home/bchanot/Documents/claude && PATH=$HOME/.bun/bin:$PATH make test suite="lib/tests/curated-config-guard.test.sh skills/prune-memory/tests/run-deterministic.sh" 2>&1 | tail -1 EXPECT: all suites green - EVIDENCE: PENDING + EVIDENCE: MET exit=0 marker-found :: all suites green 4. Forged-line test present and green. CHECK: cd /home/bchanot/Documents/claude && grep -rlc 'evil@' lib/tests/*.sh | wc -l EXPECT: 1 - EVIDENCE: PENDING + EVIDENCE: MET exit=0 marker-found :: 1 5. shellcheck -x clean on every changed .sh (no new directive); make test green (manual, bun on PATH). ## FILE SCOPE