Skip to the content.

Micro-context S4d: bounded multi-turn continuation

Status: observed deterministic 1,000-context contract witness, 2026-08-06; resolves #5818.

Descriptor v2 extends the process-free S4a descriptor without changing its Host/Gateway runtime. Each logical context now carries a positive turn budget and a stable continuation token. The adapter accounts one completed gateway call per turn, preserves assistant history between calls, finishes only when the output contract matches, and refuses both an unmatched final turn and any call beyond the budget. Descriptor v1 remains accepted and exactly one turn.

Between turns, DescriptorAgent.Freeze serializes only mutable continuation state: logical identity, continuation token, turns used, last result, and assistant history. HibernationStore.Wake independently re-freezes after Thaw and refuses a non-byte-identical restore. The immutable base and descriptor remain outside the parked payload.

Captured witness

go run ./cmd/microcontextdemo -multi-turn-descriptor experiments/microcontext/s4d-local-multi-turn-descriptor-1000x3-pass-2026-08-06.json -contexts 1000 -workers 16 -turns 3
go run ./cmd/microcontextdemo -verify-multi-turn-descriptor experiments/microcontext/s4d-local-multi-turn-descriptor-1000x3-pass-2026-08-06.json

The ledger reconciles exactly:

The verifier rejects a missing turn, continuation mismatch, failed context, missing restore, non-positive rate, or non-v2 descriptor provenance.

Claim boundary

This witnesses exact scheduler-level turn accounting, continuation identity through the existing Gateway context, and hibernate-safe between-turn state. The 372.44 verified completions/s value is deterministic fixture throughput. It is not model inference throughput, model quality, prefix-cache benefit, KV residency, or per-context process/RSS evidence. Tool/effect policy remains the separately shipped S4c seam.