chore(audits): log staged next-ID residuals

This commit is contained in:
bchanot committed 2026-11-15 21:59:21 +01:00
1 parent e0311f4d4f
commit 074cdde409
1 file changed
+5
+5
View File
@@ -89,6 +89,11 @@
<!-- /bugfix index-fail-closed 2026-11-15 (87aecc1): residuals of the fix, not BDR-125 -->
- lib/memory.sh `memory_index` and the digest — what still reads as not-open or absent: an empty or unknown status word on a BLK row counts as not open (game holds 14 such v1 rows, config 3, so flagging them would fire every session); an unclosed ``` fence hides every later entry with no banner line; `index` reads without the lock while `status`/`_mem_restore` truncate then write in place (memory.sh:262,319), so a racing digest can read an empty file; `[ -e ] || [ -L ] || return 0` (:609) reads a stat failure (I/O, LSM denial) as absent. Severity: low. Discovered while: /bugfix index-fail-closed plan challenge and security gate. Not fixed.
- hooks/session-start.sh:358-377 `_digest_todo` / `_digest_journal` run awk on TODO.md and journal.md with no regular-file check and no timeout: a FIFO there hangs session start. agents/handover-doc-writer.md:105 reports a non-regular blockers.md as `no-file`. `_memory_digest` (:420) prints no digest at all when `.claude/memory` is not a directory. Severity: low. Discovered while: /bugfix index-fail-closed security gate and verifier. Not fixed.
<!-- /feat staged-next-id 2026-11-15 (e0311f4): residuals, not BDR-125 -->
- lib/memory-commit.sh:99 runs `check --staged` on the index, then :118 `git commit -- <paths>` re-reads the working tree, and the memory lock is not held across the two: a registry write landing between them is committed unchecked. Fix direction: commit the checked index (no pathspec once scoped) or hold the lock across check and commit. Severity: low. Discovered while: /feat staged-next-id plan challenge (robustness r2). Not fixed.
- lib/memory.sh `_mem_removed_lines` refuses a `memory.sh upgrade` commit of a v1 file where a dialect heading (`### BLK-n`) sits below the first `## ` entry: its rewrite to `## ` counts as a removed line inside an entry, so mixed-dialect v1 registries cannot be upgraded through memory-commit. Same for /prune-memory's `heading level` fix on a v2 file. Severity: low. Discovered while: /feat staged-next-id executor (T8m fixture). Not fixed.
- lib/memory.sh `_mem_check_next_ids` assumes line order is chronological: a hand-inserted ID line above a new entry, or an ID line removed above the first entry, can refuse an entry `add` wrote correctly (named in the `_mem_next_id` comment). IDs at or above 2^53 lose precision in awk (same limit as `_mem_next_id`). Severity: low. Discovered while: /feat staged-next-id plan challenge. 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.