Boundary
Start with context as runtime state and the turn envelope that freezes one unit of work.
Runtime Context, Compaction, Replay
A source-pinned technical book about context as runtime state: turn envelopes, history normalization, typed injections, optional-context budgets, compaction, rollout reconstruction, rollback, fork, realtime surfaces, and token telemetry.
Start with context as runtime state and the turn envelope that freezes one unit of work.
Then read history normalization, typed fragments, and optional-context budgets as prompt-shaping owners.
Study compaction, replacement history, rollout reconstruction, rollback, and fork as recovery mechanics.
Finish with TUI, realtime, app-server, token usage, and trace as downstream views.
Context is treated as governed runtime state, not as a growing prompt string.
Compaction installs replacement history with enough evidence to resume and audit later.
All source links point to 569ff6a1c400bd514ff79f5f1050a684dc3afde3, so the book can be audited against a fixed tree.
Part 1
Context is not text around a model. It is the runtime boundary every turn must obey.
Part 2
A prompt is assembled from ledgers, fragments, policies, and optional evidence.
Part 3
A long-lived agent survives only if forgetting is explicit, auditable, and reversible enough.
Part 4
Clients may render context, but the runtime must remain the source of truth.