Session compaction parity
Session compaction has one control-plane authority: the streaming compactor’s
per-session posture snapshot. Read surfaces serialize that snapshot; they do not
re-run compaction logic. All surfaces share one vocabulary so operator-visible
state is identical across them. The read surfaces are
GET /v1/sessions/{id}/compaction/status,
get_session_compaction_status, bmo_get_session_compaction_status, the
describe_context agent tool under compaction.session, bmo session status,
the TUI Context hub, and the app read model.
Posture states
Section titled “Posture states”The bounded posture state vocabulary (from
internal/sessioncompaction/posture.go):
unavailabledisabledidlebudget_warningsummary_linkedsummary_missingstreaming_mechanicalstreaming_semanticstreaming_readystreaming_degraded
Posture resolution follows a fixed precedence so every surface reports the same state from the same snapshot:
- A broken summary link (
summary_missing/summary_link_missing) is surfaced before any streaming phase. - Then the streaming phase (
streaming_mechanical,streaming_semantic,streaming_ready,streaming_degraded). - Then linked-summary state (
summary_linked). - Then prompt-budget warn / exceeded /
provider_context_error.
Bounded reason codes
Section titled “Bounded reason codes”The fixed reason-code vocabulary (from
internal/compaction/streaming/retention.go). Reason codes are bounded
metadata: they never carry raw transcript text, prompt bodies, model
responses, or provider error bodies.
Missing load-bearing facts:
missing_active_goalmissing_user_constraintmissing_permission_boundarymissing_active_pathmissing_tool_outcomemissing_provider_pressuremissing_decision_statemissing_validation_resultsummary_link_missing
Semantic structural:
semantic_truncatedsemantic_token_count_invalidsemantic_errorsemantic_timeoutsemantic_canceled
Observation / boundary:
quality_unobservedhierarchy_required_deferredboundary_crossing
Quality-gate fields
Section titled “Quality-gate fields”Posture exposes these quality-gate fields, scoped to the mechanical compaction version so a later run cannot reuse a prior verdict:
retention_ratio— bounded numbervalidation_passed— boolvalidation_observed— boolreasons— list of the bounded codes above
Load-bearing fact classes
Section titled “Load-bearing fact classes”The retention shadow tracks nine load-bearing fact classes:
active_goaluser_constraintpermission_boundaryactive_pathtool_outcomeprovider_pressuredecision_statevalidation_resultsummary_link
Retention applies a two-tier policy: active_goal and active_path are
majority / paraphrase-tolerant (retained at >= 50%); all other classes are
fail-closed.
Continuity evidence
Section titled “Continuity evidence”Beyond posture state, the snapshot carries bounded continuity metadata:
- a continuity epoch
- the latest trigger / status / reason
- a small per-session event ring of recent compaction events
All of this is bounded metadata; none of it carries raw bodies.
Surfaces
Section titled “Surfaces”| Surface | How it reads posture |
|---|---|
GET /v1/sessions/{id}/compaction/status | Serializes the shared snapshot for HTTP clients |
get_session_compaction_status | Returns the same JSON snapshot for native agent automation |
bmo_get_session_compaction_status | Returns the same JSON snapshot for MCP clients |
describe_context | Serializes the snapshot under compaction.session |
bmo session status | Renders the snapshot for headless operator inspection |
| TUI Context hub | Shows the snapshot in the Compaction row |
| App read model | Exposes the snapshot as SessionCompactionStatus |
Related surfaces
Section titled “Related surfaces”- Session compaction — user-facing overview
- Configuration — posture and budget configuration