Skip to content

emrg: the index guard's failure line names faults the run did not find #2947

Closed

Description

@pm25coder

scripts/check-memory-index.py ends a failing run with one fixed sentence that names all four fault families. When a run finds only one of them, the sentence still asserts the other three — and the per-index lines printed directly above it say the opposite.

What was observed

scripts/check-memory-index.py asks four questions of an index: is it within the line/character/row-length caps, do its table rows' cells match the header, does every row link resolve, and is every active detail file named by a row.

With an index holding one row that names one of four active detail files, the run printed:

  rows 1, longest 56 chars, over 512: 0
  no table row, so the cell reading had no subject here - a `- ` list index carries no header to count a row against
  row links 1, unresolved: 0
  detail files 4, named nowhere: 3
  detail file entry-2.md is named by no row - write its row, or set its status to merged/superseded if it is retired
  detail file entry-3.md is named by no row - write its row, or set its status to merged/superseded if it is retired
  detail file entry-4.md is named by no row - write its row, or set its status to merged/superseded if it is retired
1 of 1 index(es) over a number the rule names, carrying a row whose cells do not match its header's, carrying a row link that resolves nowhere, or naming no row for an active detail file beside it; the rule is compacted in place, by the agent itself, and a stale row is rewritten or dropped when the detail file is gone

Exit code 1 — correctly, because three active detail files are named by no row.

Three of the summary's four clauses are faults this run did not find, and each is contradicted by the line above it:

  • "over a number the rule names" — the reading says rows 1, longest 56 chars, over 512: 0. Nothing is over any of the three numbers.
  • "carrying a row whose cells do not match its header's" — the reading says no table row, so the cell reading had no subject here. There is no header, so no cell can mismatch one.
  • "carrying a row link that resolves nowhere" — the reading says row links 1, unresolved: 0.

Only the fourth clause describes what happened.

Why it matters

The summary is the line a reader who pipes the report through tail sees, and the file's own pass path is written for exactly that reason — its OK: sentence appends a coverage clause for every reading it did not take ("the cell reading had no subject - no index read carries a table row, so this is not a statement that any row's cells match its header's"). The failing path is the other half of the same contract and does not do it: it asserts four faults regardless of which were found.

The cost is a misdirected reader. Someone reading only the last line is sent to check the line cap, the cell header and the link table — all three of which this run measured and found clean — rather than to the missing rows, which are the fault that exists. scripts/check-memory-index.py is also the instrument the memory-index rule tells each evolution cycle to run before trusting an index, so its last line is what a cycle acts on.

The damage this matters against is real: an index can lose rows when a write goes wrong, while the detail files remain on disk. That state produces exactly one finding, and it currently reports as four.

What the fix must satisfy

  1. The failure summary names only the fault families the run actually found.
  2. A fault family with no subject in this run (no table row at all, no row links at all, no active detail files) is not named as a fault.
  3. Each named family still carries its count, so the four remain distinguishable and a reader knows how much of each was found.
  4. Exit codes do not move: 1 when there is a finding, 0 when there is none, 2 when nothing could be measured.
  5. A test pins it: a fixture whose only fault is an unnamed active detail file must not see the line cap, the cell header, or link resolution named as faults in the summary.

Acceptance

Run scripts/check-memory-index.py against an index that holds one row naming one of four active detail files beside it. The summary names the unnamed detail files and their count, and does not name the line cap, the cell header, or unresolved row links. A run whose fault is a table row's cell count still names the cell fault; a run whose fault is an over-long row still names the number it passed. Both directions, on the same summary line.

Activity

  1. pm25coder commented on Nov 17, 2026

    @pm25coder
    CollaboratorAuthor

    Handled by #2948

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions