Repository navigation
Start lookup pages with a begin record that states their status - #108
Merged
Merged
Conversation
Agents keep a lookup's first lines far more often than its last: on both of the maintainer's machines, 39-79% of `search`, `grep`, and `show` results outside Sessidx's own development showed no `end`, mostly after `head -n`, `head -c`, or `cut`, although the skill has said not to since 2026-10-13. The status those agents never saw is known before the first data line, because every page is assembled before it is written. A `search`, `grep`, or `show` page now starts with `begin`, carrying `complete`, `stale`, and `returned` from the same values as `end`, and `more` when `end.next` is set. It has no cursor, so it stays short enough for `head -c`, and `end` stays where loops and Pi's tail-keeping truncation read it. A stderr summary was rejected because a third of `grep` and `search` calls merge stderr into stdout, often straight into `jq`, and a tenth or more of the calls that lost `end` discarded stderr. The test helper now checks every lookup's `begin` against its `end`.
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.
Agents keep the first lines of a lookup far more often than its last. Between 2026-10-08 and 2026-11-21, on both of the maintainer's machines and outside Sessidx's own development, 65–79% of
showresults and 39–48% ofgrepandsearchresults showed noendrecord. Most of those commands piped the output throughhead -n,head -c, orcut, although the skill has told agents not to since 2026-10-13. Every page is assembled before it is written, so its status is already known when the first data line goes out.A
search,grep, orshowpage now starts with{"type":"begin","complete":…,"stale":…,"more":…,"returned":N}. Its fields come from the same values asend, andmoreis true whenend.nextis set.begincarries no cursor, so it stays short enough to survivehead -c.endis unchanged, because scripted loops readend.nextfrom it and Pi keeps the last part of a long output. Errors still print onlyend. Filters that pass non-data records through, as the skill's examples do, keep working. A command that reads the first line positionally, or counts lines, now sees one more record.Fable and Oracle reviewed the design. Oracle preferred a stderr summary that leaves stdout unchanged, but the same scan showed why that would not work:
grepandsearchcalls merge stderr into stdout, and a third to a half of those pipe straight intojq, which a non-JSON line would break.endcame from commands that discarded stderr.A
jqor script filter that keeps only data records still drops bothbeginandend. Thepage_statusrow indocs/formats.mdrecords the rule, its evidence, and what it leaves uncovered.The test helper
streamnow checks every lookup'sbeginagainst itsend. A new test reads agrep,show, andsearchcut to their first line, and it fails whenbeginis removed.cargo mutants --in-diffcaught all 18 mutants.