From 7c8726b5a0e43b9900c7a965eb7133ce4f37a6ea Mon Sep 17 00:00:00 2001 From: bchanot Date: Fri, 13 Nov 2026 23:01:06 +0100 Subject: [PATCH] chore(audits): 7 BUGS-FOUND script items closed (H6b), 3 new low findings logged --- .claude/audits/BUGS-FOUND.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.claude/audits/BUGS-FOUND.md b/.claude/audits/BUGS-FOUND.md index 14e932a..0ad4dae 100644 --- a/.claude/audits/BUGS-FOUND.md +++ b/.claude/audits/BUGS-FOUND.md @@ -27,6 +27,7 @@ - agents/handover-doc-writer.md:83 + agents/client-handover-writer.md:1201-1202 — `ROOT=""` pastes the root into a double-quoted literal, and the printed remedy `memory.sh -C status …` leaves `` unquoted: a root with `"`, `$(…)`, a backtick or a space breaks the line or splits the path. Value is the operator's own `git rev-parse --show-toplevel`, not registry data. Severity: low. Discovered while: /bugfix G5 security gate. Not fixed. FIXED 2026-11-13 (77041e5): ROOT read through a quoted heredoc with a one-line pre-paste rule, control-char root BLOCKED, remedy single-quoted with a `'` rule. - lib/profile-state.jq (`jq -r` output read by lib/detect-plugins.sh `list_on_plugins` / `detect_gstack`) — a settings value carrying a newline can forge a `plugin:=on` line in the PROFILE_PLAIN text, so the banner or status shows a plugin ON that is not. Display-only, pre-existing for detect_gstack. Severity: low. Discovered while: /bugfix G1+G4 security gate 2026-11-10. Not fixed. + FIXED 2026-11-13 (9045a60): `clean` turns LF/CR into a space on every free-text value (profile, flag, model, mcp-off, connector, pack key); `plugin:` lines print only ids matching `\A[A-Za-z0-9._-]+@[A-Za-z0-9._-]+\z`; tests T28-forge, T28-nl-id. - agents/plugin-advisor.md embedded RULE (~:217) — the `embedded` signal can come from REQUEST keywords alone ("driver", "kernel", :58) and maps to `↻ SET : minimal`, against the gated rule "minimal reachable from project-level signals only" (only DISABLE is limited to project signals, :124-126). Gate confirmation limits it. Severity: medium (gated decision not fully enforced). Discovered while: /feat D3 verifier 2026-11-11. Not fixed. @@ -50,22 +51,28 @@ - lib/memory.sh `memory_legacy_status` `` 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. FIXED 2026-11-13 (d8e62c1), PARTIAL: the range stops at `## Index` (the on-disk case); a trailing non-Index `##` section is still read, kept so an in-entry `## Update` stays readable by the lexical reader (oracle disagreement detection). - 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. + FIXED 2026-11-13 (9045a60): `mktemp -d … || exit 1` plus an empty-value guard before the trap. - 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. FIXED 2026-11-12 (block D, feature/digest-todo-fallback 1124758, BDR-147): Actionable ##/### else the file's first items. - 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. + FIXED 2026-11-13 (9045a60): a failed or timed-out read prints `- open: unknown (memory.sh index failed)`, a successful read with no open row `- open: none`; SD9a/SD9d/SD12. Residual logged below (index rc 0 on an unreadable registry). - 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. FIXED 2026-11-13 (77041e5): .gitignore, plugins.lock.json, update-all.sh (points at make plugin), install-plugins.sh labels/comment match the trap; LRN-154 corrected by a status line. - 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. + FIXED 2026-11-13 (9045a60): T7 fixed-string lock on the subshell line. - 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. - lib/tests/push-guard.test.sh T42c — passes even if the `$WORK/s-probe.json` jq write fails (empty slurp makes every base entry look lost); weakens what T42c proves, not the lock. Severity: low. Discovered while: /feat dead-deny security gate. Not fixed. + FIXED 2026-11-13 (9045a60): T42c-probe-written asserts the probe parses (`jq -e .`). - lib/tests/push-guard.test.sh deny_lost — no pipefail: a missing list file or jq failure empties `lost` (T42 green); mitigated by T42c (red) and T40. Severity: low. Discovered while: /feat dead-deny security gate. Not fixed. + FIXED 2026-11-13 (9045a60): explicit PIPESTATUS checks (pipefail would be masked by grep rc 1 on an empty list); a failed stage prints `deny_lost: pipeline failed`; T42f. - Dead-entry premise (Write(glob) deny never blocks Write; mixed `* :*` / `* -v /:*` forms never match) rests on one live probe 2026-10-23 (journal); nothing re-proves it if Claude Code permission semantics change. Severity: low. Discovered while: /feat dead-deny security gate. Not fixed. RESOLVED 2026-11-13 by live evidence: Claude Code 2.1.323 warns that `Bash(git push * :**)` (mid-pattern `:*`) matches as a `*` wildcard; the kept deny row is live and matches remote `:ref` deletes; the removed `* :*` forms were wildcards too, so the live `:**` row is the one that holds. - lib/tests/push-guard.test.sh:421-424 T62F (pre-existing) — `mktemp` settings copy outside `$WORK`, removed only on the normal path (no trap). Severity: low. Discovered while: /feat dead-deny security gate. Not fixed. + FIXED 2026-11-13 (9045a60): copy under `$WORK`, cleaned by the suite trap. - skills/tour/SKILL.md:244,246 (run) and :249,287 (printed) — `git -C ""` double-quoted path template: a path holding `$(…)`, a backtick or `"` expands. Same class fixed in plugin-gate. Severity: medium. Discovered while: /bugfix H6a security gate 2026-11-13. Not fixed. @@ -73,3 +80,8 @@ - agents/handover-doc-writer.md:208,210,757,758 — fixed temp names /tmp/refs.txt, /tmp/ids.txt (use mktemp). Severity: low. Discovered while: /bugfix H6a security gate. Not fixed. - skills/onboard/SKILL.md:427,612 — unquoted `$HOME` in an executed probe line (:614 fixed). Severity: low. Discovered while: /bugfix H6a security gate. Not fixed. - lib/profile.sh:68-72,85 — a root ABOVE a symlinked $HOME is caught by a string compare only (is_home covers exactly $HOME). Severity: low. Discovered while: /bugfix H6a security gate. Not fixed. + + +- lib/memory.sh:594-603 `memory_index` — skips a blockers.md that is not a regular file (`[ -f ] || continue`) and does not propagate the awk rc, so `index blocker` exits 0 on a registry it could not read and the session digest prints `- open: none` (SD9b/SD9c pin it). Fix direction: non-regular registry or unparsable `| BLK-` row → non-zero rc, the digest prints `unknown`. Severity: low. Discovered while: /bugfix bugs-found-scripts gates 1+2. Not fixed. +- lib/profile-state.jq `clean` strips LF/CR only: ESC and other control chars pass (no terminal sink today); human mode (:67-75) prints values unsanitized (pre-existing). Severity: low. Discovered while: /bugfix bugs-found-scripts security gate. Not fixed. +- lib/tests/profile.test.sh:195 T28-nl-id-no-bare-on cannot fail (pre-fix tail is `=off`); the `clean` on pack keys has no biting assertion; lib/tests/session-digest.test.sh:245 comment still says "no digest". Severity: low. Discovered while: /bugfix bugs-found-scripts verifier. Not fixed.