From d310f0224defe08fcdb741e7cdbe996f2afc1b61 Mon Sep 17 00:00:00 2001 From: bchanot Date: Fri, 13 Nov 2026 14:49:39 +0100 Subject: [PATCH] chore(audits): 4 memory.sh BUGS-FOUND items fixed in H2 (d8e62c1) --- .claude/audits/BUGS-FOUND.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.claude/audits/BUGS-FOUND.md b/.claude/audits/BUGS-FOUND.md index 745c996..8c685e1 100644 --- a/.claude/audits/BUGS-FOUND.md +++ b/.claude/audits/BUGS-FOUND.md @@ -18,8 +18,10 @@ - agents/handover-doc-writer.md §6.1 — vulgarizes BDRs with no status filter: a superseded or deprecated decision can read as current in the client deliverable. Severity: medium (client deliverable). Discovered while: /bugfix G5 challenge round 1. Not fixed. - lib/memory.sh `upgrade` (`mem_want`, `_mem_verdict_diff` skips Index-stated IDs) — may take a stale v1 `## Index` cell over a `**Statut** :` body line. UNVERIFIED: check before recommending `upgrade` on v1 repos (faunosteo). Severity: medium if real (wrong status written into the body). Discovered while: /bugfix G5 challenge round 1. Not fixed. + FIXED 2026-11-13 (/bugfix, bugfix/memory-sh-residuals d8e62c1): VERIFIED real (a `**Statut** :` label is unreadable by the strict reader, so the Index cell was written); one effective status (strict word, else the v1 body word) feeds flush, Index-stated and the oracle; the body word is written as the dated upgrade line; Index `superseded`/`deprecated` still wins; fixtures ix1-ix7. - agents/handover-doc-writer.md STEP 10 and other paths — `git log` and file reads are cwd-relative, not rooted on the PACKAGE root; the PACKAGE `PROJECT:` line is space-separated, so a root containing a space mis-parses (the G5 orchestrator check only catches it when blockers.md exists). Severity: low. Discovered while: /bugfix G5 challenge round 1. Not fixed. - lib/memory.sh `memory_legacy_status` default range (`## ID` to the next `## BLK-`) — on a v1 registry a `### BLK-` entry after a `## BLK-` entry feeds its status line to the `##` entry: a resolved `###` entry can close the open `##` entry above it, which then leaves the handover §5 (the `###` ID itself is flagged unreadable). Severity: low (rare dialect, flagged indirectly). Discovered while: /bugfix G5 verifier. Not fixed. + FIXED 2026-11-13 (d8e62c1): one awk reader, the range ends at the next heading of another entry of the prefix at any level; T15-probed-openset. - 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. - 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. @@ -35,7 +37,9 @@ - Registry dialects the classifier cannot read: game is `format: 2` but written in the `date: … · status:` dialect (decision statuses unreadable), faunosteo uses `closed` / `active` words, v1 date dialects give no 90-day `proposed` candidate. /prune-memory shows them on the info-only `[Status unreadable]` line; a dialect migration (memory.sh upgrade or a one-shot rewrite per project) is not designed. Severity: medium (prune finds no candidate on those projects). Discovered while: /feat D4 challenge round 1. Not fixed. - skills/prune-memory STEP 4 — status drift check (Index vs body, title word vs status word) dropped from D4 as an ungated new gate. Severity: low. Discovered while: /feat D4 challenge round 2. Not fixed. - 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 `` 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. + FIXED 2026-11-13 (d8e62c1): selector = 3rd positional, env read gone, `_MEM_LEGACY_BDR_RE` in memory.sh; T15-env-selector-ignored. - 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.