Skip to content
Developer Preview

SnapshotState

The complete folded view at the snapshot cursor.

Additive-optional evolution applies exactly as everywhere else; unknown members MUST be ignored, and preserved if re-serialized.

One served site does not satisfy this type today, escalated. The genesis snapshot rung serves state: {"items": [...]} alone, while the anchored rung serves the full folded state. A schema-validating client resuming with {"history": "snapshot"} against the real fold therefore sees the other required members missing. The fix is a serving change in a follow-up change (serialize the SessionViewState the genesis path already folds, as the anchored path does) plus its own RED against the real fold; it is not a shape change here, because the protocol ratifies this shape.

  • activeTurn
  • approvalMode
  • branch
  • contextUsage
  • effectiveModel
  • goal
  • items
  • pendingApprovals
  • pendingUserInputs
  • queuedTurns
  • todoList
  • tokenUsage
  • turnCount
Source

schema/msp/experimental/msp.schema.json#/types/SnapshotState

{
"description": "The complete folded view at the snapshot cursor.\n\nAdditive-optional evolution applies exactly as everywhere else; unknown\nmembers MUST be ignored, and preserved if re-serialized.\n\n**One served site does not satisfy this type today, escalated.** The genesis snapshot rung serves\n`state: {\"items\": [...]}` alone, while the anchored rung serves the full\nfolded state. A schema-validating client resuming with\n`{\"history\": \"snapshot\"}` against the real fold therefore sees the other\nrequired members missing. The fix is a serving change in a follow-up change (serialize the `SessionViewState` the genesis path already folds, as\nthe anchored path does) plus its own RED against the real fold; it is not\na shape change here, because the protocol ratifies this shape.",
"properties": {
"activeTurn": {
"anyOf": [
{
"$ref": "#/$defs/TurnRef"
},
{
"type": "null"
}
],
"description": "The running foreground turn; `null` when none is running."
},
"approvalMode": {
"$ref": "#/$defs/EffectiveApprovalModeState",
"description": "The effective approval mode at this cursor — the same object the\n`Session` carries."
},
"branch": {
"anyOf": [
{
"$ref": "#/$defs/BranchState"
},
{
"type": "null"
}
],
"description": "Latest branch observation; `null` when no fact has landed."
},
"contextUsage": {
"$ref": "#/$defs/ContextUsage",
"description": "The latest `(windowTokens, usedTokens, pressure)` triple.\nsays \"`null`/absent\" and the protocol's worked example OMITS the member;\nthe binary omits it too, so this is the absent arm — the four\nsiblings above are present-null in the same frame. admits one\nor the other, never both; escalated."
},
"effectiveModel": {
"anyOf": [
{
"$ref": "#/$defs/EffectiveModel"
},
{
"type": "null"
}
],
"description": "Latest effective model; `null` when no fact has landed."
},
"goal": {
"anyOf": [
{
"$ref": "#/$defs/Goal"
},
{
"type": "null"
}
],
"description": "Latest goal block; `null` when no fact has landed."
},
"items": {
"description": "Every item, in first-opened order, each at its latest revision at the\nsnapshot cursor. One schema per kind, shared with the notification\nitem object — which is what makes snapshot+suffix a pure splice.",
"items": {
"$ref": "#/$defs/Item"
},
"type": "array"
},
"pendingApprovals": {
"description": "The pending-approval half of the pending set.",
"items": {
"$ref": "#/$defs/PendingApprovalPointer"
},
"type": "array"
},
"pendingUserInputs": {
"description": "The pending-user-input half of the pending set.",
"items": {
"$ref": "#/$defs/PendingUserInputPointer"
},
"type": "array"
},
"queuedTurns": {
"description": "Admitted-but-not-launched submits, in launch order.",
"items": {
"$ref": "#/$defs/TurnRef"
},
"type": "array"
},
"todoList": {
"anyOf": [
{
"$ref": "#/$defs/TodoListState"
},
{
"type": "null"
}
],
"description": "Latest todo list; `null` when no fact has landed."
},
"tokenUsage": {
"$ref": "#/$defs/CumulativeTokenUsage",
"description": "The `cumulative` block of the last `session/tokenUsage` event; zeroes\nwhen none."
},
"turnCount": {
"description": "Completed-turn count at this cursor.",
"type": "integer"
}
},
"required": [
"activeTurn",
"approvalMode",
"branch",
"effectiveModel",
"goal",
"items",
"pendingApprovals",
"pendingUserInputs",
"queuedTurns",
"todoList",
"tokenUsage",
"turnCount"
],
"type": "object"
}