Skip to content

emrg: a table row that breaks the index table is measured clean #2601

Closed

Description

@pm25coder

What is observed

.emrg/memory/MEMORY.md — the memory index this agent embeds verbatim into every prompt — is a Markdown table whose header declares five cells:

| ID | Type | Title | Status | Updated |
|---|---|---|---|---|

One of its rows records a shell fact and quotes a literal pipe pair in a code span:

... 带 BOM、无 `||`/`utf8NoBOM`、GBK 控制台 ...

GitHub's table syntax splits a line on every unescaped pipe before it renders an inline span, so backticks protect nothing here: that || ends the cell early, the row carries 7 cells against the header's 5, and the remainder of the line is pushed into columns the header never declared. The row a reader sees is not the row that was written.

scripts/check-memory-index.py reads that same file and reports:

tree: C:\Users\Administrator\.emrg\evolution\emrg
.emrg\memory\MEMORY.md
  lines 15 of 100 - within
  chars 4493 of 52224 - within
  rows 10, longest 511 chars, over 512: 0
  row links 0, unresolved: 0
OK: 1 index(es) within the three numbers the rule names ...

with exit code 0. The guard measures line count, character count, per-row length and row links — it has no cell count at all — so a row that breaks the table is indistinguishable from one that does not. This is the file the prompt pays for on every round, so the breakage is paid for on every round too, in a form no reader can follow.

What the fix must satisfy

  1. The guard reads a table body row's cell count against its header's, and faults both directions: more cells than the header declares (a pipe that needed escaping) and fewer (a cell that was dropped). A reading that catches only extra pipes would call a dropped cell clean.
  2. An escaped \| is content, not a separator — otherwise the guard faults the very repair it prescribes, and correct Markdown reads as broken.
  3. A line that is not a table row (prose, a - list row, the delimiter row) is not a cell subject, and the report says when the reading had no subject rather than printing a number that reads like a pass.
  4. Each finding names the row's line number and both counts, and says which direction is wrong so the remedy follows from the finding.
  5. The guard's own subject is green when this is finished: the row that carries the defect is repaired too. That file lives under .emrg/, which this repository's .gitignore excludes, so its repair is host state rather than a tree change — it is reported with its before/after reading instead of being carried by the pull request.

Where it is measured

On this host at master a2909b4: the header at line 5 declares 5 cells, the row at line 10 carries 7, the guard exits 0 before the change — and the same probe over the session index beside it reports 0 mismatches, so this is a defect in a row, not in the reader of one file.

Activity

  1. pm25coder commented on Oct 26, 2026

    @pm25coder
    CollaboratorAuthor

    Handled by #2602

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