{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://eidetic-engine/schemas/ee.error.v2.json",
"title": "ee.error.v2",
"description": "Canonical machine-readable error envelope emitted on JSON stdout for failed ee commands.",
"type": "object",
"required": ["schema", "error"],
"additionalProperties": false,
"properties": {
"schema": {
"type": "string",
"const": "ee.error.v2"
},
"error": {
"type": "object",
"required": ["code", "message", "severity", "details"],
"additionalProperties": false,
"allOf": [
{
"if": {
"properties": {
"code": {"const": "workspace_store_missing"}
},
"required": ["code"]
},
"then": {
"properties": {
"details": {
"required": [
"addressedWorkspacePath",
"addressedStorePath",
"storeDiscovery"
]
}
}
}
}
],
"properties": {
"code": {"type": "string"},
"message": {"type": "string"},
"severity": {
"type": "string",
"enum": ["info", "low", "warning", "medium", "high", "critical"]
},
"repair": {"type": "string"},
"repairKind": {
"type": "string",
"enum": ["actionable", "template", "placeholder", "unknown", "empty"]
},
"details": {
"type": "object",
"properties": {
"recovery": {
"type": "array",
"items": {"$ref": "#/$defs/recoveryAction"}
},
"attemptedPaths": {
"type": "array",
"items": {"type": "string"}
},
"addressedStorePath": {
"type": "string",
"description": "Exact absolute database path checked by a workspace_store_missing failure."
},
"addressedWorkspacePath": {
"type": "string",
"description": "Exact workspace path used by workspace_store_missing recovery commands."
},
"storeDiscovery": {
"$ref": "#/$defs/storeDiscovery"
}
},
"additionalProperties": {"$ref": "#/$defs/jsonValue"}
},
"nonRecoverable": {"type": "boolean"}
}
},
"degraded": {
"type": "array",
"items": {"$ref": "#/$defs/degradation"}
}
},
"field_presets": {
"minimal": ["code", "severity"],
"summary": ["code", "message", "severity", "repair"],
"standard": ["code", "message", "severity", "repair", "details", "nonRecoverable", "degraded"],
"full": ["*"]
},
"$defs": {
"degradation": {
"type": "object",
"required": ["code", "severity", "message"],
"additionalProperties": false,
"properties": {
"code": {"type": "string"},
"severity": {
"type": "string",
"enum": ["info", "low", "warning", "medium", "high", "critical"]
},
"message": {"type": "string"},
"repair": {"type": "string"},
"repairKind": {
"type": "string",
"enum": ["actionable", "template", "placeholder", "unknown", "empty"]
}
}
},
"recoveryAction": {
"type": "object",
"required": [
"priority",
"kind",
"rationale",
"riskClass",
"requiresHumanApproval",
"mutatesExternalState",
"mutatesTrackerState",
"privacyClass"
],
"additionalProperties": false,
"properties": {
"priority": {"type": "integer", "minimum": 0, "maximum": 255},
"kind": {
"type": "string",
"enum": [
"env",
"config",
"flag",
"install",
"rebuild",
"permission",
"migration",
"command",
"broaden",
"narrow",
"seed",
"none"
]
},
"rationale": {"type": "string"},
"riskClass": {
"type": "string",
"enum": [
"read_only_probe",
"idempotent_refresh",
"mutating_local_repair",
"mutating_external_coordination_repair",
"approval_required_repair",
"destructive_or_irreversible_repair",
"unavailable_or_manual_only"
]
},
"preflightCommand": {"type": "string"},
"requiresHumanApproval": {"type": "boolean"},
"mutatesExternalState": {"type": "boolean"},
"mutatesTrackerState": {"type": "boolean"},
"privacyClass": {"type": "string"},
"manualStep": {"type": "string"},
"evidence": {
"type": "array",
"items": {"type": "string"}
},
"preconditions": {
"type": "array",
"items": {"type": "string"}
},
"envName": {"type": "string"},
"valueHint": {"type": "string"},
"configPath": {"type": "string"},
"configKey": {"type": "string"},
"flagName": {"type": "string"},
"command": {"type": "string"},
"resultsIn": {"type": "string"},
"example": {"type": "string"}
}
},
"storeDiscovery": {
"type": "object",
"description": "Bounded read-only discovery evidence attached to workspace_store_missing errors.",
"required": ["outcome", "nearbyStores"],
"additionalProperties": false,
"properties": {
"outcome": {
"type": "string",
"enum": ["complete", "truncated", "truncated_registry_unavailable", "unavailable"],
"description": "Truthful bounded-discovery result; truncated_registry_unavailable preserves locally proved candidates while exposing the optional registry failure, and partial or unavailable outcomes never imply that no nearby store exists."
},
"nearbyStores": {
"type": "array",
"items": {"$ref": "#/$defs/nearbyStore"},
"maxItems": 5
}
}
},
"nearbyStore": {
"type": "object",
"required": ["workspaceRoot", "storeDir", "documents", "lastWrite"],
"additionalProperties": false,
"properties": {
"workspaceRoot": {"type": "string"},
"storeDir": {"type": "string"},
"documents": {
"type": "integer",
"minimum": 1,
"description": "Current non-tombstoned memory heads for this exact workspace."
},
"lastWrite": {
"oneOf": [
{"type": "string", "format": "date-time"},
{"type": "null"}
]
}
}
},
"jsonValue": {
"oneOf": [
{"type": "null"},
{"type": "boolean"},
{"type": "number"},
{"type": "string"},
{"type": "array", "items": {"$ref": "#/$defs/jsonValue"}},
{"type": "object", "additionalProperties": {"$ref": "#/$defs/jsonValue"}}
]
}
}
}