diff --git a/.claude/memory/blockers.md b/.claude/memory/blockers.md index 2d0fa05..62bd5c5 100644 --- a/.claude/memory/blockers.md +++ b/.claude/memory/blockers.md @@ -347,6 +347,8 @@ rules: - **Measured**: 13 repos, 4 v1 closures without a labelled leading closed word: orbistep BLK-021 (really open), BLK-026 (prose addendum, really resolved), BLK-030 (mixed), bchanot-cv BLK-001 (strict already resolved, no effect). No lexical rule decides prose: BLK-021 and BLK-026 same shape, opposite truth. - **Solution**: /bugfix bugfix/memory-upgrade-prose-closure: repair only from a `Status`/`Statut` label whose leading word closes; else refuse file (rc 2), name ID + v1 line + remedy `memory.sh status`. Dedupe IDs. Committed repos audited clean; orbistep + zenquality redone after fix. - **Status (2026-10-31)**: resolved 2dae528: repair writes only a single closed Status word, prose/mixed refused and named, diff captured before inserts, one upgrade line per entry; orbistep + zenquality redone (144505f, b7edb9c) +- **Status (2026-11-13)**: resolved d8e62c1 (block H2): residuals closed: v1 line and Index cell print as ? on stderr, fixtures assert wrote upgrade status / dated status line kept, journal one blank line; the real-data replay oracle (scratchpad script, gone) is replaced by the fixture suite +- **Status (2026-11-13)**: resolved d8e62c1 (block H2): residuals closed: v1 line and Index cell print as ? on stderr, fixtures assert wrote upgrade status / dated status line kept, journal one blank line; the real-data replay oracle (scratchpad script, gone) is replaced by the fixture suite ## BLK-039 — Nested heredoc executed plan text: settings.json committed, user's stash popped [resolved] (2026-11-02) - **Friction**: a Bash call holding a python heredoc that itself contained `<<'EOF'` blocks: the inner `EOF` closed the outer heredoc; the rest of the plan text ran as shell commands → `git stash push settings.json` (silently failed), `git commit` of settings.json WITH the UI writes (theme, switchModelsOnFlag), auto-pushed; `git stash pop` popped the USER's own stash `wip: settings+routing dirty (user)` (conflict, entry kept). diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 3955f48..0d465eb 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -738,3 +738,5 @@ rules: - /feat skill-routing-descriptions (block E2): CLAUDE.global.md § Skill routing 311 → 306 lines, 6 lines dropped into bugfix/ship-feature descriptions (3b30153, docs 88b67ab). Feater died mid-run (API 403 Cloudflare) after the 3 edits: gates proved the diff, no re-dispatch. Verifier caught a contract ledger bug: 1b. row absorbed by gates.sh → LRN-284, row renumbered 6. BDR-149. - /bugfix cc-oom-score-adj (block G): BLK-044 root cause = sshd drop-in OOMScoreAdjust=-1000 inherited; lib/cc.sh raises oom_score_adj to 500 raise-only (6c10d3a, T7-oom, docs f5ce4ae). Gates 0 MET / 1 two rounds (80-col + redirect order) / 2 PASS, make test green. Live proof needs a fresh cc session (user). LRN-285. - /bugfix project-rules-residuals (block H1, phase 0 leftovers): emit via _rules_out_path_ok + write guard, extract keeps tmp+out on rewrite failure, physical parent check (9d5530a, T9h + T9z3-z13, docs cd90080). 3 lenses: BLOCKER silent refusal on a file parent (T9w2), MAJOR section's last copy deleted by r1; callers onboarder/scaffolder stop on rc 2 ≠ exists. LRN-286. +- /bugfix memory-sh-residuals (block H2, phase 4a + BUGS-FOUND memory.sh): one awk legacy reader (positional selector, prefix-derived end, ## Index stop, path-safe), one effective status for upgrade (strict else v1 label, written as dated line), control chars → ?, journal one blank line (d8e62c1, +30 checks, docs 5e7a267 incl. MIGRATION --body-file note). r1 (e) would have reopened resolved blockers: 3 lenses + confirmation. LRN-287; BLK-038 resolved. +- /bugfix memory-sh-residuals (block H2, phase 4a + BUGS-FOUND memory.sh): one awk legacy reader (positional selector, prefix-derived end, ## Index stop, path-safe), one effective status for upgrade (strict else v1 label, written as dated line), control chars → ?, journal one blank line (d8e62c1, +30 checks, docs 5e7a267 incl. MIGRATION --body-file note). r1 (e) would have reopened resolved blockers: 3 lenses + confirmation. LRN-287; BLK-038 resolved. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 4ada86e..ed0e6de 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -2082,3 +2082,8 @@ Rule: when editing a doctrine file under structure locks, grep the test's lock s - **Context**: lib/project-rules.sh `_rules_out_path_ok` (phase 0 leftover, block H1 2026-11-13), 3 challengers + 1 confirmation. - **Pattern**: a "stays under the project" check for a path that may not exist yet = walk `dirname` up while `[ ! -d ]` (skip file/dangling-link ancestors so `mkdir -p` keeps naming them), then `CDPATH='' cd -P -- "./$parent" && pwd -P` vs `pwd -P` (never `$PWD`: `-C` does a logical cd); prefix pattern `"${here%/}"|"${here%/}"/*`. `CDPATH= cd` trips shellcheck SC1007; `cd -P` of a relative name consults CDPATH and prints the dir. - **Apply**: a failure branch after an O_TRUNC write must keep every copy and name them (the "keep $tmp" ask alone would drop the only copy of the moved section); a caller mapping "rc 2 = exists" must learn the new rc-2 causes in the same change; a `1b.`-style test idea often duplicates an existing case: check labels before adding. + +## LRN-287 — Status predicate with several consumers: compute one effective status once; an unreadable body label is written, not kept (2026-11-13) +- **Context**: lib/memory.sh upgrade (block H2 2026-11-13); BUGS-FOUND "stale Index cell over a `**Statut** :` line" UNVERIFIED → real; 3 lenses + confirmation found the r1 fix would have reopened resolved blockers. +- **Pattern**: a predicate like "does the Index win" lives at several sites (flush, Index-stated skip list, oracle); a fix at one site forks the predicate: the others keep the old answer and the oracle, built on the same predicate, goes blind. "Keep the body line" is wrong when the strict reader cannot read that line: the entry ends with NO status (= open). The fix = compute ONE effective status (strict word, else the v1 body word) once, feed every consumer, and WRITE the v1 word as the dated status so the strict reader can see it; keep `mem_want` first so an Index `superseded`/`deprecated` still wins; a mixed/unknown label = "" everywhere except excluded from the skip list so the existing refusal fires. +- **Apply**: before changing a status rule, grep every consumer of the same predicate and a fixture per consumer (Index open + body resolved, Index resolved + body resolved, Index superseded + body accepted, mixed). Test oracles that count substrings shape the executor's code (a rename + `${!re}` indirection appeared to satisfy a count): count behaviours, not names. diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index c12cc78..d0c681f 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -53,13 +53,8 @@ Shared rules for every phase: ### BDR-125 residuals (after 3.0.0) Open children of the shipped phases (History 2026-11-12), text verbatim. - Phase 0 / 0b leftovers: done 2026-11-13 (block H1, bugfix/project-rules-residuals 9d5530a, LRN-286): emit via `_rules_out_path_ok` + mkdir/write rc, extract keeps `$tmp` and `$out` on a rewrite failure, physical parent check (`cd -P`, `pwd -P`). -- Phase 4a leftovers: - - [ ] faunosteo: NOT upgraded (V1-2 active in another session's worktree; user: no write to develop or the V1-2 worktree). Patch prepared off-repo from V1-2 587cbb2 (rc 0, 520 lines, open BLK-008/009 unchanged); at integration re-run `memory.sh -C upgrade` on the branch the user names rather than applying the stale patch. Stale clone `/home/bchanot/faunosteo` (main, 2026-07-01): left alone, user to decide. - - [ ] BLK-038 residuals (gates 2026-10-30, non-blocking): v1 line echoed on stderr unfiltered (CWE-150 LOW, terminal control chars from a foreign registry; same as existing "upgrade lost" path); no fixture asserts the "wrote upgrade status" / "dated status line kept" messages; the real-data replay oracle lives in the session scratchpad (`up4a/realdata.sh`), not re-runnable: port to a `make` target over fixture copies if the upgrade is touched again; `memory.sh journal` leaves two blank lines before a new date heading on files ending with a blank line (commit-changer note). - - [ ] MIGRATION.md:209 shows `memory.sh -C add … --body-file …` with no absolute-path note (same trap as § WRITE, parked by the docs-half challenge 2026-11-01): next doc pass. -- Phase 1 leftovers: - - [ ] Deferred (gate 2026-10-29): "Skill routing" lines → our skills' `description:` (phase 3 bullet said phase 1 cleanup). - - [ ] Design hook false positives: the pointer is almost never followed, and it fires on non-design prompts (fired on the 2026-10-30 phase 4a memory-work prompt). Decide: tighten the trigger, or drop the hook now that web-building.md loads by path. User call, nothing coded. +- Phase 4a leftovers: done 2026-11-13. faunosteo upgraded in block F (chore/memory-v2 530af1b, user merges); BLK-038 residuals closed in block H2 (bugfix/memory-sh-residuals d8e62c1: stderr `?` for control chars, fixtures for the upgrade messages, journal one blank line; the real-data replay oracle is replaced by the fixture suite, its scratchpad script is gone); MIGRATION.md `--body-file` absolute-path note added (5e7a267). Remaining raw sinks, not phase-tied: reconcile.sh:141 stdout `${st:0:80}`, `check` "heading shape" line. +- Phase 1 leftovers: done 2026-11-13 in block E (E1 design hook deleted, BDR-148; E2 Skill routing lines → descriptions, BDR-149). - Phase 5 leftovers: - [ ] Follow-ups: `lib/pack-census.sh:67` `grep -qx` → `grep -qxF`; fragment top-level key allowlist in `lib/pack-census-fragments.jq` (today only `enabledPlugins` keys are compared). Done 2026-11-02: MIGRATION step 2 `$root` re-derivation + autostash-conflict note (0463583, 9cd9591). - Phase 2 leftovers: diff --git a/.claude/tasks/contracts/2026-11-13-memory-sh-residuals-1400.md b/.claude/tasks/contracts/2026-11-13-memory-sh-residuals-1400.md new file mode 100644 index 0000000..5fc1a07 --- /dev/null +++ b/.claude/tasks/contracts/2026-11-13-memory-sh-residuals-1400.md @@ -0,0 +1,45 @@ +# CONTRACT — memory-sh-residuals (phase 4a leftovers + BUGS-FOUND memory.sh items, block H2) +- date: 2026-11-13 | flow: bugfix | branch: bugfix/memory-sh-residuals (off develop) +- status: active + +## REQUEST (verbatim — IMMUTABLE) +BLK-038 residuals (gates 2026-10-30, non-blocking): v1 line echoed on stderr unfiltered (CWE-150 LOW, terminal control chars from a foreign registry; same as existing "upgrade lost" path); no fixture asserts the "wrote upgrade status" / "dated status line kept" messages; the real-data replay oracle lives in the session scratchpad (`up4a/realdata.sh`), not re-runnable: port to a `make` target over fixture copies if the upgrade is touched again; `memory.sh journal` leaves two blank lines before a new date heading on files ending with a blank line (commit-changer note). BUGS-FOUND: 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). lib/memory.sh `memory_legacy_status` default range (`## ID` to the next `## BLK-`): a `### BLK-` entry after a `## BLK-` entry feeds its status line to the `##` entry. lib/memory.sh:657 `memory_legacy_status` reads `MEM_LEGACY_RE` from the environment: an ambient export widens upgrade's readers; fix: explicit positional argument, drop the env read. `memory_legacy_status` `` range on v1 decisions: the last BDR entry runs to EOF, so a `## Index` after it would be read. + +## CLARIFICATIONS +- [gated 2026-11-13, oracle fixes after the executor report] CHECK 1 no longer counts the live `MEM_GREP` use at reconcile.sh:139 (heading ids) nor the substring `MEM_LEGACY_RE` (the executor renamed `_MEM_LEGACY_RE` → `_MEM_LEGACY_BLK_RE` and used `${!re}` indirection to satisfy the old counts: the rename stays, the indirection is replaced by an explicit `case` in round 2). CHECK 6 runs through `make test suite=` (a direct run trips the global gitflow hooks on the fixture's `main`). CHECK 7 excludes the test file's 4 pre-existing findings. +- [gated 2026-11-13, challenge r2] the body label beats the Index by WRITING the v1 word as the dated upgrade line (a `**Statut** :` line is unreadable by the strict reader, so "keeping the body" would reopen the entry); one effective status feeds flush, Index-stated and the oracle; a mixed v1 label falls to the existing name-and-refuse path. `` derived from the ID prefix; label selector = 3rd positional. The lexical range stops at `## Index` only (not every `##`). The real-data replay oracle is replaced by the fixture cases (the scratchpad script is gone). Plan: .claude/tasks/plans/2026-11-13-memory-sh-residuals-1400.md § r2. + +## ACCEPTANCE CRITERIA +1. No env read of MEM_LEGACY_RE; the BDR selector lives in memory.sh; reconcile has no MEM_GREP prefix on the legacy calls. + CHECK: cd /home/bchanot/Documents/claude && echo $(grep -c 'MEM_LEGACY_RE:-\|\${!re' lib/memory.sh)$(grep -c '_MEM_LEGACY_BDR_RE' lib/memory.sh | grep -c '^[1-9]')$(grep -B1 'memory_legacy_status' lib/reconcile.sh | grep -c MEM_GREP) + EXPECT: 010 + EVIDENCE: MET exit=0 marker-found :: 010 +2. One lexical range reader (no sed path) stopping at `## Index`. + CHECK: cd /home/bchanot/Documents/claude && echo $(grep -c 'sed -n "/^## ${2} /' lib/memory.sh)$(grep -c '"## Index"' lib/memory.sh | grep -c '^[3-9]') + EXPECT: 01 + EVIDENCE: MET exit=0 marker-found :: 01 +3. Effective status helper present and consumed by the three sites. + CHECK: cd /home/bchanot/Documents/claude && grep -c '_mem_v1_words' lib/memory.sh | grep -c '^[4-9]' + EXPECT: 1 + EVIDENCE: MET exit=0 marker-found :: 1 +4. memory.test.sh green with the r2 (f) cases. + CHECK: cd /home/bchanot/Documents/claude && PATH=$HOME/.bun/bin:$PATH bash lib/tests/memory.test.sh 2>&1 | tail -1 + EXPECT: FAIL=0 + EVIDENCE: MET exit=0 marker-found :: PASS=298 FAIL=0 +5. New cases exist (Statut fixtures, journal endings, control chars, trailing Index). + CHECK: cd /home/bchanot/Documents/claude && grep -c 'Statut\|dropped Index\|tail -c1\|x1b\|trailing' lib/tests/memory.test.sh | grep -c '^[6-9]\|^[1-9][0-9]' + EXPECT: 1 + EVIDENCE: MET exit=0 marker-found :: 1 +6. Reconcile suites green. + CHECK: cd /home/bchanot/Documents/claude && PATH=$HOME/.bun/bin:$PATH make test suite=lib/tests/run-reconcile.sh 2>&1 | tail -1 + EXPECT: all suites green + EVIDENCE: MET exit=0 marker-found :: all suites green +7. shellcheck -x clean on lib/memory.sh lib/reconcile.sh; the test file keeps its 4 pre-existing findings (SC2016 x3, SC1090; same count at HEAD), none new. + CHECK: cd /home/bchanot/Documents/claude && shellcheck -x lib/memory.sh lib/reconcile.sh && [ "$(shellcheck -x lib/tests/memory.test.sh 2>&1 | grep -c '^In ')" = 4 ] && echo SC-OK + EXPECT: SC-OK + EVIDENCE: MET exit=0 marker-found :: SC-OK +8. make test green (manual, bun on PATH); new functions ≤ 25 logic lines / 5 locals; changed lib lines ≤ 80 cols. + (manual: run 2026-11-13 on the round-2 tree, `PATH=$HOME/.bun/bin:$PATH make test` → "SUITE: all GREEN / all suites green", rc=0) + +## FILE SCOPE +lib/memory.sh, lib/reconcile.sh, lib/tests/memory.test.sh (+ fixtures under lib/tests/fixtures/ if the suite uses files). CHANGELOG + MIGRATION.md:209 note → STEP 7 doc sync. TODO/BUGS-FOUND lines → STEP 8. diff --git a/.claude/tasks/plans/2026-11-13-memory-sh-residuals-1400.md b/.claude/tasks/plans/2026-11-13-memory-sh-residuals-1400.md new file mode 100644 index 0000000..df2a55c --- /dev/null +++ b/.claude/tasks/plans/2026-11-13-memory-sh-residuals-1400.md @@ -0,0 +1,27 @@ +# PLAN — memory-sh-residuals (phase 4a leftovers + BUGS-FOUND memory.sh items, block H2) r1 +Scope: lib/memory.sh, lib/tests/memory.test.sh, lib/reconcile.sh (:117 one call). +- (a) `memory_legacy_status [] []`: 4th positional replaces `${MEM_LEGACY_RE:-…}`; `RE="${4:-$_MEM_LEGACY_RE}"`. reconcile.sh:117 passes `"$RECONCILE_BDR_RE"` as $4 and drops the env assignment. No other setter exists (grep). Comment "callers may widen the selector" updated. +- (b) one range reader: the default (no ) path becomes the awk path with `END_RE='^##* *BLK-[0-9]'` (any heading level of another BLK ends the range; a same-ID `###` sub-heading continues it, unread, as today in the form). Both forms also stop at ANY level-2 heading that is not the entry itself (`!fence && /^## / && on && $0 !~ "^## " id " "` → on=0): a trailing `## Index` or section is never read (BUGS-FOUND :38). The sed/grep path and `MEM_GREP` use in this function go away; reconcile.sh:97 keeps calling without (behaviour: a `### BLK-` entry no longer leaks into the `##` entry above, BUGS-FOUND :22). +- (c) stderr echoes of a v1 line (`_mem_repair_one` :726-731, and any other `${v1:0:100}` site) go through `_mem_printable ` = `printf '%s' "${1//[![:print:]]/?}"` (locale-safe: run under the script's existing locale; tabs become `?` too, accepted). One helper, ≤ 5 lines. +- (d) `_mem_journal_locked`: on rc 1, prepend `\n` only when the file is non-empty and its last line is not blank: `[ -s "$1" ] && [ -n "$(tail -c1 "$1")" ] || sep=''` is wrong (a trailing newline is normal); use `tail -n1 "$1"` non-empty → `sep=$'\n'`, else `sep=''`; `printf '%s## %s\n%s\n' "$sep" "$2" "$3" >> "$1"`. +- (e) `_mem_upgrade_text` flush: when `st[cur] == ""` and the entry body holds a v1 status label line (`_mem_v1_word` of `memory_legacy_status ` gives a word), treat that word as `st` so `mem_want` keeps the body and prints "kept body , dropped Index " (BDR-129: Index never wins over a body label). Implementation: the rows file passed as ARGV[1] gains a 4th column = v1 body word per ID (computed in the caller loop over `_mem_heading_ids`), read as `v1w[r[1]] = r[4]`; flush uses `st[cur] != "" ? st[cur] : v1w[cur]`. If memory.sh's existing structure makes this > 25 logic lines, split a helper `_mem_v1_words ` printing `IDword`. +- (f) lib/tests/memory.test.sh: new cases (labels after the last existing T-label): `### BLK-` after `## BLK-` on a v1 file → the `##` entry stays open (legacy status not leaked); v1 decisions file with a trailing `## Index` after the last BDR → `memory_legacy_status … '^##* *BDR-[0-9]'` returns nothing from the Index; `MEM_LEGACY_RE=open` exported in the test env does NOT change the result; control chars (`\x1b[31m`) in a v1 line → stderr shows `?` not the raw byte; journal on a file ending with a blank line → exactly one blank line before the new heading; upgrade fixture: Index cell `resolved`, body `**Statut** : open` → body kept, stderr "kept body open, dropped Index resolved", no `(…, upgrade)` line written; upgrade fixture whose v1 line is `Status: resolved` with strict reader open → stderr "wrote upgrade status resolved" and the dated line present; fixture with a dated `- **Status (2026-…)**:` line → stderr "dated status line kept". +- Not done, justified: the real-data replay oracle (`up4a/realdata.sh`, session scratchpad) is gone; the fixture suite above replaces it (TODO line removal says so). +- Disposition: honors BDR-129 (one status parser, Index never a status source), BDR-125 phase 4a; `make test` runs memory.test.sh (bun needed for T18 only). + +## r2 (correctness FATAL(4), robustness CONCERNS(3), simplicity FATAL(3); all folded) — r2 WINS over r1 +- (a) signature `memory_legacy_status []`: `` DERIVED inside = `"^##* *${2%%-*}-[0-9]"`; 3rd positional = label selector, default `$_MEM_LEGACY_RE`; new `_MEM_LEGACY_BDR_RE="$_MEM_LEGACY_RE|statut|superseded|deprecated"` hosted in memory.sh (reconcile.sh:55 reuses it). Callers: memory.sh :669/:685/:722 drop the literal end; reconcile.sh:97 → `memory_legacy_status "$1" "$2"`, :117-118 → `memory_legacy_status "$1" "$2" "$_MEM_LEGACY_BDR_RE"`; both `MEM_GREP="$RECONCILE_GREP"` prefixes deleted (dead). No env read. +- (b) ONE awk reader (sed path gone), fence-aware (named change: a fenced `## BLK-` no longer ends a range; v1 registries on disk hold no fence, 0 diffs measured by the robustness lens). Range ends at the next `^##* *-[0-9]` heading of another ID (a same-ID `###` sub-heading continues, unread) OR at `$0 == "## Index"` (BUGS-FOUND :38) — NOT at every `##` heading (an in-entry `## Update` section must stay readable by the lexical reader so the oracle still sees its disagreement with the strict one). Rule placed after the same-ID `next` rule. +- (c) in place, no helper: `_mem_repair_one` after `word=$(_mem_v1_word "$v1")`: `v1=${v1//[![:print:]]/?}`; awk side :612-613 `gsub(/[[:cntrl:]]/, "?", col[cur])`. Accepted and stated in a comment: under a C locale UTF-8 bytes print as `?`. Remaining raw sinks (reconcile.sh:141 stdout, check "heading shape") listed in the TODO removal note, not fixed here. +- (d) `_mem_journal_locked`: `sep=$'\n'`; `[ -s "$1" ] || sep=''`; `[ -z "$(tail -c1 "$1")" ] || sep=$'\n\n'` (no final newline → terminate + blank); `[ -z "$(tail -n1 "$1")" ] && sep=''` (already blank-ended). Then `printf '%s## %s\n%s\n' "$sep" "$2" "$3" >> "$1"`. +- (e) ONE effective status, three consumers. New `_mem_v1_words ` → `IDword|mixed` for every ID with an Index cell whose strict word is "" : word = `_mem_v1_word` of `memory_legacy_status ` (re = `_MEM_LEGACY_BDR_RE` for BDR, default for BLK; LRN/EVAL: none), label accepted only anchored (`^(- )?(\*\*)?[Ss]tatu[st]` or after ` · ` / `| `), `mixed` when a label line exists but `_mem_v1_word` gives nothing. Fed as an extra ARGV input to `_mem_upgrade_text`, `_mem_index_stated` and `_mem_upgrade_oracle`: effective `st = strict != "" ? strict : v1w`. Flush: strict "" + v1w word → WRITE `- **Status (, upgrade)**: ` (the body label made readable) and, when the Index word differs, stderr "kept body , dropped Index "; `mixed` → not Index-stated, falls to the existing name-and-refuse path. Index-stated = IDs where `mem_want(p, col, effective st) != ""`. Oracle `want` = `mem_word(mem_want(p, col, effective st))`, else effective st. +- (f) tests (memory.test.sh): T15-probed gains an `openset` check (`###` leak); new v1 decisions fixture with a trailing `## Index` → nothing read from it; control chars via `refused()` fixture → `?` on stderr; T14l extended to three journal endings (none, `\n`, `\n\n` → exactly one blank line before the heading); upgrade fixtures: BLK Index `open` + body `- **Statut** : resolved` → rc 0, strict word resolved, stderr "kept body resolved, dropped Index open"; BLK Index `resolved` + body `- **Statut** : resolved` → stays resolved; BDR Index `accepted` + body `**Statut** : proposed` → rc 0, strict proposed; BLK Index `open` + mixed `- **Statut** : resolved (x), open (y)` → refused, named (as T15-mixed-statut-refused); "wrote upgrade status" / "dated status line kept" asserted by capturing stderr of T15-statut / T15-datestatus / T15-remedy-roundtrip (not new fixtures; the r1 `Status: resolved` wording is a strict candidate and cannot fire). T15-reconcile-grep repointed at `reconcile_blk_open` (its enumerator still greps). Fixtures use `- **Statut** :` / `date: … · status:` dialects. +- CHANGELOG (doc sync): Removed line for the `MEM_LEGACY_RE` env override advertised in 3.0.0; Fixed line for the rest. + +## r3 (confirmation CONCERNS(2), folded; FINAL, no further challenge) +- (e) flush ORDER kept: `s = mem_want(p, col, est)` first (est = strict != "" ? strict : v1w, where `mixed` counts as ""); non-empty s → write s (superseded/deprecated Index still wins, as today). Only when s == "" AND strict == "" AND v1w is a word → write `- **Status (, upgrade)**: ` (+ stderr "kept body , dropped Index " when the Index word differs). `mixed` = "" for flush and oracle (today's Index path); it is EXCLUDED from Index-stated only, so a BLK mixed case reaches the verdict-diff refusal and a BDR mixed case keeps the Index word with rc 0. +- `_mem_v1_words "$1" "$2"` reads the ORIGINAL file for all three consumers (build included; `$src` has rewritten `###` headings). +- `memory_legacy_status` routes `$1` through `_mem_path_safe` (awk operand-assignment class, T19). +- Every flush print of `col[cur]` applies `gsub(/[[:cntrl:]]/, "?", …)` (mawk-safe). +- Named behaviour changes of (b) for reconcile's v1 BLK path: fence-aware; a same-ID `### BLK-x UPDATE … RESOLVED` heading line is no longer itself a status candidate (0 on disk). BUGS-FOUND :38 marked PARTIALLY fixed: a trailing non-Index `##` section is still read (kept so `## Update` stays readable). +- Extra fixtures: BDR Index `superseded by BDR-004` + body `**Statut** : accepted` → rc 0, strict superseded; BDR mixed label + Index `accepted` → rc 0, strict accepted; BLK unknown word `- **Status**: closed` + Index `resolved` → strict resolved kept.