{
	"$schema": "http://json-schema.org/draft-07/schema#",
	"type": "object",
	"required": ["sessionId", "schemaVersion", "createdAt", "route", "goal", "status"],
	"properties": {
		"sessionId": { "type": "string", "format": "uuid" },
		"schemaVersion": { "type": "string", "const": "1.0.0-rc.1" },
		"createdAt": { "type": "string", "format": "date-time" },
		"updatedAt": { "type": "string", "format": "date-time" },
		"route": {
			"type": "object",
			"required": ["id", "version"],
			"properties": {
				"id": { "type": "string" },
				"version": { "type": "string" }
			}
		},
		"goal": { "type": "string", "minLength": 1 },
		"feature": { "type": "string" },
		"status": {
			"enum": ["created", "routed", "executing", "paused", "completed", "failed", "aborted"]
		},
		"currentStage": { "type": "string" },
		"completedStages": { "type": "array", "items": { "type": "string" } },
		"budget": {
			"type": "object",
			"properties": {
				"total": { "type": "integer", "minimum": 0 },
				"used": { "type": "integer", "minimum": 0 }
			}
		},
		"worktree": { "type": "string" },
		"amber_protocol_version": { "type": "string" },
		"artifact_sequence": { "type": "integer" },
		"created_at": { "type": "string", "format": "date-time" },
		"artifact_type": { "type": "string" },
		"agentId": {
			"type": "string",
			"description": "Agent identity that owns this session (set via `amber session start --agent <id>` or the MCP _agent parameter). Enables ownership-aware concurrency: a session may be managed by the agent that created it."
		},
		"agentClaimedAt": {
			"type": "string",
			"format": "date-time",
			"description": "When the owning agent claimed the session."
		},
		"journeyId": {
			"type": "string",
			"description": "The deep-journey id selected by decideRouteJourney for this session's goal (e.g. amber-delivery). Persisted so the journey half of the routing decision is not lost."
		},
		"execution_context": {
			"type": "object",
			"properties": {
				"engine": { "enum": ["claude-code", "codex", "cursor"] },
				"model": { "type": "string" },
				"reasoning_effort": { "enum": ["low", "high", "max"] },
				"pinned_at": { "type": "string", "format": "date-time" },
				"pinned_by": { "type": "string" }
			}
		}
	}
}
