Skip to content

Reuse guarded immutable Overview deliveries for continuation - #132

Open
advancewhl wants to merge 4 commits into
aoci-spec:mainfrom
advancewhl:whloong/p0-overview-continuation-main-port-pr
Open

advancewhl wants to merge 4 commits into
aoci-spec:mainfrom
advancewhl:whloong/p0-overview-continuation-main-port-pr

Conversation

@advancewhl

Copy link
Copy Markdown

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

  • No public contract changes
  • MCP tool name, input schema, or response structure
  • CLI command, flag, exit code, or --json shape
  • spec/public contract text or machine dictionary (internal/machinecontract)
  • Index format, Baseline, receipt, or transaction identity derivation

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

  • make fast (Go 1.26.9)
  • make full
  • python3 scripts/blackbox/mcp_conformance.py — 53 checks
  • python3 scripts/blackbox/mcp_scenarios.py — 75 scenarios
  • python3 scripts/blackbox/mcp_lifecycle.py
  • Other: go test ./internal/mcptools -count=1; git diff --check; Verify, aggregate Check, and Guide (aligned; next_action=none)

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

  • Cold start remains expensive; this change does not optimize it.
  • Semantic Attestation was partial (4/10); strict cognition verification did not pass.
  • The Host-safe 4000-token setting is a deployment observation and does not establish that every Host limit is solved.
  • The frozen performance fixture is not production-state acceptance.

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

  • Managed objects changed; the AOCI governance cycle is complete (Maintain → update_entry → Verify/Check/Guide), with code and index changes in this branch
  • No managed objects changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant