fix(memory): upgrade keeps an EVAL Index action the body lacks; lib lines ≤ 80

This commit is contained in:
bchanot committed 2026-10-28 17:25:36 +01:00
1 parent 9698473f8e
commit 7806ab426b
4 files changed
+13 -5

No files matched your search

+3 -2
View File
@@ -7,8 +7,9 @@
# happens to be dirty or staged is NEVER embarked.
#
# Usage (CLI):
# memory-commit.sh commit "<message>" # surgical commit; exit 0 ok/no-op, 3 unsafe
# # state, 5 commit rejected, 6 check refused
# memory-commit.sh commit "<message>"
# # 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
+2 -1
View File
@@ -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 "" }
+3 -2
View File
@@ -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"
+5
View File
@@ -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