📝 docs(wire-schema): schema.v1 + error.v1 JSON Schema (fb-27)
schema.v1: full introspection report shape with required fields for wire / capabilities / models / stats. capabilities object enumerates all 10 flag names (current 6 true + future 4 false) as required keys. error.v1: 7-code enum + permissive details object. Real emitted details shapes documented in description (per-code context varies and some fields are interim until IoFailure / OpTimeout typed signals land in follow-up). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
35
docs/wire-schema/v1/error.schema.json
Normal file
35
docs/wire-schema/v1/error.schema.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://kebab.local/wire-schema/v1/error.schema.json",
|
||||
"title": "error.v1",
|
||||
"description": "Structured fatal error emitted on stderr in --json mode. The `details` shape varies per `code`; consumers should branch on `code` and treat `details` as best-effort context.",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "code", "message", "details"],
|
||||
"properties": {
|
||||
"schema_version": { "const": "error.v1" },
|
||||
"code": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"config_invalid",
|
||||
"not_indexed",
|
||||
"model_unreachable",
|
||||
"model_not_pulled",
|
||||
"timeout",
|
||||
"io_error",
|
||||
"generic"
|
||||
]
|
||||
},
|
||||
"message": { "type": "string" },
|
||||
"details": {
|
||||
"type": "object",
|
||||
"additionalProperties": true,
|
||||
"description": "Per-code free-form context. config_invalid: { path, cause }. not_indexed: { expected, found }. model_unreachable: { endpoint, source }. model_not_pulled: { model }. timeout: { source }. io_error: { kind }. generic: { chain (when --verbose) }."
|
||||
},
|
||||
"hint": {
|
||||
"anyOf": [
|
||||
{ "type": "string" },
|
||||
{ "type": "null" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
61
docs/wire-schema/v1/schema.schema.json
Normal file
61
docs/wire-schema/v1/schema.schema.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://kebab.local/wire-schema/v1/schema.schema.json",
|
||||
"title": "schema.v1",
|
||||
"description": "kebab introspection report — wire schemas, capabilities, model versions, and index stats.",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "kebab_version", "wire", "capabilities", "models", "stats"],
|
||||
"properties": {
|
||||
"schema_version": { "const": "schema.v1" },
|
||||
"kebab_version": { "type": "string" },
|
||||
"wire": {
|
||||
"type": "object",
|
||||
"required": ["schemas"],
|
||||
"properties": {
|
||||
"schemas": {
|
||||
"type": "array",
|
||||
"items": { "type": "string", "pattern": "^[a-z_]+\\.v[0-9]+$" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"capabilities": {
|
||||
"type": "object",
|
||||
"additionalProperties": { "type": "boolean" },
|
||||
"required": [
|
||||
"json_mode", "ingest_progress", "ingest_cancellation",
|
||||
"rag_multi_turn", "search_cache", "incremental_ingest",
|
||||
"streaming_ask", "http_daemon", "mcp_server", "single_file_ingest"
|
||||
]
|
||||
},
|
||||
"models": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"parser_version", "chunker_version", "embedding_version",
|
||||
"prompt_template_version", "index_version", "corpus_revision"
|
||||
],
|
||||
"properties": {
|
||||
"parser_version": { "type": "string" },
|
||||
"chunker_version": { "type": "string" },
|
||||
"embedding_version": { "type": "string" },
|
||||
"prompt_template_version": { "type": "string" },
|
||||
"index_version": { "type": "string" },
|
||||
"corpus_revision": { "type": "integer", "minimum": 0 }
|
||||
}
|
||||
},
|
||||
"stats": {
|
||||
"type": "object",
|
||||
"required": ["doc_count", "chunk_count", "asset_count", "last_ingest_at"],
|
||||
"properties": {
|
||||
"doc_count": { "type": "integer", "minimum": 0 },
|
||||
"chunk_count": { "type": "integer", "minimum": 0 },
|
||||
"asset_count": { "type": "integer", "minimum": 0 },
|
||||
"last_ingest_at": {
|
||||
"anyOf": [
|
||||
{ "type": "string", "format": "date-time" },
|
||||
{ "type": "null" }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user