You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(runtime): unify ArchiveRead canonical document and response-budget ownership #4452
The ArchiveRead retrieval work in #4380 fixes the immediate correctness failures (non-advancing line pagination, Unicode search coordinates, and inspect response overflow), but the review also exposed a structural issue: coordinate semantics and response-budget fitting are currently implemented by several independent branches.
The follow-up should make the invariants explicit without expanding #4380 or breaking its line-facing contract.
Proposed scope
Introduce one canonical archive-document projection for plain text, terminal pipes, PTY streams, and structured JSON.
Make internal read/search coordinates derive from that document authority.
Introduce one field-aware fitArchiveResponse() owner for the final TOOL_RESULT_ARCHIVE_MAX_RESPONSE_CHARS envelope across inspect, read, query, and search.
Optimize line reads so large windows do not repeatedly materialize and stringify the same content.
Define the coordinate/ref contract for queryable items[] subdocuments.
Add operation × payload-shape regression/property tests for the response-size invariant and continuation progress.
Non-goals
Do not change the shell capture/preservation contract or recover output already dropped before archiving.
Do not reopen archive threshold policy.
Do not remove or silently change the line-oriented API in the first iteration.
Acceptance
Every successful and failure ArchiveRead response stays within the configured response budget after final serialization.
Search offsets, snippets, and continuations are in the documented canonical coordinate space.
Line reads either return progress or an actionable bounded failure for an oversized line.
Long accepted search patterns remain representable without silent truncation.
Part of #4267. Follow-up to #4355 and #4380.
Motivation
The ArchiveRead retrieval work in #4380 fixes the immediate correctness failures (non-advancing line pagination, Unicode search coordinates, and inspect response overflow), but the review also exposed a structural issue: coordinate semantics and response-budget fitting are currently implemented by several independent branches.
The follow-up should make the invariants explicit without expanding #4380 or breaking its line-facing contract.
Proposed scope
unit: "line"/ line-offset facade from harness: ArchiveRead search / line reads / section index ergonomics (item 3 of #4267) #4355 while allowing the implementation to use character ranges internally.fitArchiveResponse()owner for the finalTOOL_RESULT_ARCHIVE_MAX_RESPONSE_CHARSenvelope across inspect, read, query, and search.items[]subdocuments.Non-goals
Acceptance
ArchiveReadrefs remain backward compatible.