diff --git a/lib/memory-commit.sh b/lib/memory-commit.sh index 728a1f5..32c1845 100755 --- a/lib/memory-commit.sh +++ b/lib/memory-commit.sh @@ -7,8 +7,9 @@ # happens to be dirty or staged is NEVER embarked. # # Usage (CLI): -# memory-commit.sh commit "" # surgical commit; exit 0 ok/no-op, 3 unsafe -# # state, 5 commit rejected, 6 check refused +# memory-commit.sh commit "" +# # surgical commit; exit 0 ok/no-op, 3 unsafe state, +# # 5 commit rejected, 6 check refused # # Output contract for `commit`: diagnostics go to stderr; on a real commit the # short hash of the MEMORY commit is the ONLY thing on stdout (empty on no-op or diff --git a/lib/memory.sh b/lib/memory.sh index e97722f..3fe4058 100755 --- a/lib/memory.sh +++ b/lib/memory.sh @@ -75,7 +75,8 @@ function mem_key(line, key, c) { return c == "" || c !~ /[0-9A-Za-z]/ } function mem_want(p, c, st, w) { w = mem_word(c) - if (p == "EVAL" || w == "") return "" + if (w == "") return "" + if (p == "EVAL") return st == "" ? c : "" if (p == "LRN") return c ~ /^superseded by/ ? c : "" if (st == "" || (w ~ /^(superseded|deprecated)$/ && st != w)) return c return "" } diff --git a/lib/reconcile.sh b/lib/reconcile.sh index aeae21e..c39f3c9 100644 --- a/lib/reconcile.sh +++ b/lib/reconcile.sh @@ -63,8 +63,9 @@ reconcile_oracle_path_present() { [ -e "${1:?}" ]; } # $1 path → rc 0 if it # $1 blockers file, $2 id. A v2 registry (lib/memory.sh): the entry's own # header `[tag]` or a labelled body line, never a status word in prose or in # the title (the BLK-032..034 false-open). A v1 registry keeps the lexical -# reader (memory_legacy_status): its dialects (title suffix `— RESOLVED`, `date: … · status:`, -# `**Statut** :`) carry status where the strict parser cannot see it. +# reader (memory_legacy_status): its dialects (title suffix `— RESOLVED`, +# `date: … · status:`, `**Statut** :`) carry status where the strict parser +# cannot see it. reconcile_blk_current_status() { if memory_is_v2 "$1"; then memory_entry_status "$1" "$2"; return; fi MEM_GREP="$RECONCILE_GREP" memory_legacy_status "$1" "$2" diff --git a/lib/tests/memory.test.sh b/lib/tests/memory.test.sh index ba55950..84727f4 100755 --- a/lib/tests/memory.test.sh +++ b/lib/tests/memory.test.sh @@ -293,6 +293,11 @@ printf -- '---\ntype: evals_registry\nentry_prefix: EVAL\n---\n\n## Index\n\n| I bash "$MEM" upgrade >/dev/null 2>&1 check T9p-empty-index-upgraded "$(sed -n 2p .claude/memory/evals.md)" 'format: 2' check T9q-empty-index-heading "$(grep -c '^## EVAL-001 — empty index' .claude/memory/evals.md)" 1 +printf -- '---\ntype: evals_registry\nentry_prefix: EVAL\n---\n\n## Index\n\n| ID | Date | Output | Action |\n|----|------|--------|--------|\n| EVAL-001 | 2026-04-01 | a | correct |\n| EVAL-002 | 2026-04-02 | b | correct |\n\n## EVAL-001 — prose action\n- **Action**: fix the prompt next round\n\n## EVAL-002 — body wins\n- **Action**: keep it\n' \ + > .claude/memory/evals.md +bash "$MEM" upgrade >/dev/null 2>&1 +check T9s-eval-index-action-kept "$(sed -n '/^## EVAL-001/,/^## EVAL-002/p' .claude/memory/evals.md | grep -c 'upgrade)\*\*: correct$')" 1 +check T9t-eval-body-wins "$(sed -n '/^## EVAL-002/,$p' .claude/memory/evals.md | grep -c 'upgrade)')" 0 cd "$FIX" || exit 1 # T10 parser: header tag and labelled lines only, last wins, open ranks last