Add structured compiler diagnostics
This commit is contained in:
parent
0fe968c475
commit
24bd13f9d9
20 changed files with 1386 additions and 58 deletions
|
|
@ -2,6 +2,138 @@
|
|||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://docforge.local/schema/result-v1.json",
|
||||
"title": "DocForge result envelope",
|
||||
"$defs": {
|
||||
"diagnostics": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"schema_version",
|
||||
"operation",
|
||||
"outcome",
|
||||
"elapsed_ns",
|
||||
"stages",
|
||||
"counters"
|
||||
],
|
||||
"properties": {
|
||||
"schema_version": { "const": 1 },
|
||||
"operation": {
|
||||
"enum": [
|
||||
"test",
|
||||
"benchmark.m1",
|
||||
"mcp.invoke",
|
||||
"mcp.bootstrap",
|
||||
"mcp.sync",
|
||||
"mcp.project_info",
|
||||
"mcp.contract",
|
||||
"mcp.get_node",
|
||||
"mcp.get_logic",
|
||||
"mcp.search",
|
||||
"mcp.filter",
|
||||
"mcp.backlinks",
|
||||
"mcp.dependencies",
|
||||
"mcp.impact",
|
||||
"mcp.context",
|
||||
"mcp.validate_project",
|
||||
"mcp.render_status",
|
||||
"mcp.visualize",
|
||||
"mcp.visualization_status",
|
||||
"mcp.stop_visualization",
|
||||
"mcp.changeset",
|
||||
"mcp.mutation",
|
||||
"cli.onboard",
|
||||
"cli.info",
|
||||
"cli.validate",
|
||||
"cli.build",
|
||||
"cli.reindex",
|
||||
"cli.sync",
|
||||
"cli.check",
|
||||
"cli.validate-index",
|
||||
"cli.show",
|
||||
"cli.search",
|
||||
"cli.filter",
|
||||
"cli.backlinks",
|
||||
"cli.dependencies",
|
||||
"cli.impact",
|
||||
"cli.context",
|
||||
"cli.render",
|
||||
"cli.render-status",
|
||||
"cli.preview",
|
||||
"cli.apply",
|
||||
"cli.visualize",
|
||||
"cli.visualization-status",
|
||||
"cli.visualization-stop"
|
||||
]
|
||||
},
|
||||
"outcome": { "enum": ["ok", "error"] },
|
||||
"elapsed_ns": { "type": "integer", "minimum": 0 },
|
||||
"stages": {
|
||||
"type": "object",
|
||||
"maxProperties": 14,
|
||||
"propertyNames": {
|
||||
"enum": [
|
||||
"source.generation",
|
||||
"source.parse",
|
||||
"adapter.projection",
|
||||
"adapter.extract",
|
||||
"index.check",
|
||||
"index.synchronize",
|
||||
"index.build",
|
||||
"index.read",
|
||||
"render.status",
|
||||
"render.prepare",
|
||||
"render.output_hash",
|
||||
"visualization.status",
|
||||
"viewer.manager",
|
||||
"mcp.runtime_validation"
|
||||
]
|
||||
},
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"required": ["calls", "elapsed_ns"],
|
||||
"properties": {
|
||||
"calls": { "type": "integer", "minimum": 1 },
|
||||
"elapsed_ns": { "type": "integer", "minimum": 0 }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"counters": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"project_loads",
|
||||
"source_files_parsed",
|
||||
"source_bytes_parsed",
|
||||
"adapter_projection_loads",
|
||||
"adapter_source_extractions",
|
||||
"source_generation_checks",
|
||||
"index_checks",
|
||||
"index_synchronizations",
|
||||
"index_builds",
|
||||
"render_prepare_calls",
|
||||
"render_output_bytes_built",
|
||||
"render_output_bytes_hashed",
|
||||
"viewer_manager_requests"
|
||||
],
|
||||
"properties": {
|
||||
"project_loads": { "type": "integer", "minimum": 0 },
|
||||
"source_files_parsed": { "type": "integer", "minimum": 0 },
|
||||
"source_bytes_parsed": { "type": "integer", "minimum": 0 },
|
||||
"adapter_projection_loads": { "type": "integer", "minimum": 0 },
|
||||
"adapter_source_extractions": { "type": "integer", "minimum": 0 },
|
||||
"source_generation_checks": { "type": "integer", "minimum": 0 },
|
||||
"index_checks": { "type": "integer", "minimum": 0 },
|
||||
"index_synchronizations": { "type": "integer", "minimum": 0 },
|
||||
"index_builds": { "type": "integer", "minimum": 0 },
|
||||
"render_prepare_calls": { "type": "integer", "minimum": 0 },
|
||||
"render_output_bytes_built": { "type": "integer", "minimum": 0 },
|
||||
"render_output_bytes_hashed": { "type": "integer", "minimum": 0 },
|
||||
"viewer_manager_requests": { "type": "integer", "minimum": 0 }
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "object",
|
||||
|
|
@ -14,7 +146,8 @@
|
|||
"type": ["string", "null"],
|
||||
"pattern": "^[0-9a-f]{64}$"
|
||||
},
|
||||
"adapter": { "type": "string" }
|
||||
"adapter": { "type": "string" },
|
||||
"diagnostics": { "$ref": "#/$defs/diagnostics" }
|
||||
},
|
||||
"additionalProperties": true
|
||||
},
|
||||
|
|
@ -38,6 +171,7 @@
|
|||
"content_warning": { "type": "string" },
|
||||
"staleness": { "enum": ["current", "stale", "unknown"] },
|
||||
"synchronization": { "type": "object" },
|
||||
"diagnostics": { "$ref": "#/$defs/diagnostics" },
|
||||
"error": {
|
||||
"type": "object",
|
||||
"required": ["code", "message", "details"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue