Repository navigation
Reuse guarded immutable Overview deliveries for continuation - #132
Open
advancewhl wants to merge 4 commits into
Open
advancewhl wants to merge 4 commits into
advancewhl wants to merge 4 commits into
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.
What changes and why
Large Whole-Index continuations used to repeat full governance evaluation and rebuild the formal body. The preserved rc19 baseline took 499.447 s for six chunks, with continuations around 83 s.
This change prepares one validated immutable Overview delivery and reuses it for guarded continuation. Each continuation checks current Safe Inventory and governed raw bytes without repeating full governance or rebuilding the body. The initial request still performs the full assessment. V2 cursors are Host-bound, authenticated, replayable, and bounded by count, bytes, and lifetime. Expiry, eviction, foreign Host, or restart fails closed. Reconstructable V1 continuation remains supported. Database-enabled and unsupported snapshots retain live governance.
Affected public contracts
Compatibility: canonical cognition body and chunk receipts remain v1; only the opaque continuation cursor is versioned. V2 state is in-memory. Lost or expired V2 sessions require a fresh request; V1 reconstruction remains available. The entire MCP response envelope is not byte-identical.
Verification
Proven runtime behavior
Real local Codex MCP activation completed a 251-Entry delivery with overview_delivery.chunk_tokens=4000: 10 chunks, first chunk about 42.5 s, continuation median about 2.73 s, and maximum about 3.01 s. No continuation returned to the historical ~80 s range. Focused work-counter regressions show valid continuation avoids repeated full governance and body construction.
Not proven / still separate
Operating system impact
The MCP path was exercised on Linux. make fast also built the supported Windows target; no OS-specific behavior is intended.
Migration and recovery
No persistent delivery state is added. V2 cursor expiry, eviction, foreign Host, or restart requires a fresh delivery. V1 cursors retain their live-governance reconstruction path. No data migration is needed.
Cognition