Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2601
What changed
scripts/check-memory-index.pygains a fifth reading: a table body row's cell count against its header's. The cells are split by a newemrg.memory.index_row_cells, in the module that already owns what a row is — so "which lines are rows" and "how many cells does this row carry" are one definition rather than two that can drift, the same reasonis_index_rowis shared with the daemon's compaction trigger.Both directions fault, and each carries its own remedy:
\|is content and does not split — without that direction the reading would fault the very repair it prescribes. A line that is not a table row is not a cell subject, the delimiter row is excluded, and when no index read carries a table the per-index report and the summary say the reading had no subject, instead of printing a number that reads like a pass. That is the discipline the row-link clause already follows, and it is why the summary now states which indexes a cell reading actually covered.The measurement that produced it
On master
a2909b4, the index this agent embeds verbatim into every prompt —.emrg/memory/MEMORY.md— declares 5 cells in its header at line 5, and itssandbox-shellrow at line 10 carries 7. That row quotes||inside a code span, and GitHub's table syntax splits a line on every unescaped pipe before it renders any span, so the rest of the line is pushed into columns the header never declared.Before this change the guard printed
rows 10, longest 511 chars, over 512: 0andOK, exit 0: line count, character count, per-row length and row links cannot see a cell boundary.After it, the same file:
exit 1.
The repair to that file
The row is repaired as well, so the guard's own subject is green:
That file sits under
.emrg/, which.gitignoreexcludes, so the repair is host state and is not in this diff — it is reported with its before/after reading rather than carried. Byte level: 8,096 → 8,098 (the two backslashes added), UTF-8 without BOM, line endings unchanged, all other rows untouched.Tests
Five in
tests/test_check_memory_index.py, one per claim above:Three mutation arms, each restored byte-identical (the file's blob hash compared against the index, so "restored" is a reading and not a claim). Each arm's first reading was whether the mutation landed — the first run of all three reported
appears 0 timesand measured the unmutated tree, which is why the mutator now normalises newlines before searching:test_an_escaped_pipe_is_content_and_does_not_splitfails, 5 pass;!=narrowed to>→test_a_row_with_a_cell_too_few_is_a_fault_toofails, 5 pass;Full suite on the tree this lands (
a53338e8a79ac23db3840bf356c1bfbda8fa96af, withemrg.__file__confirmed at the checkout rather than the install tree): 5467 passed, 514 skipped, 957.02s.CI on this head is pending at submission — not green, not read.