|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://jcodemunch.com/schemas/ranked-context-response.schema.json", |
| 4 | + "title": "jCodeMunch get_ranked_context response", |
| 5 | + "description": "JSON response contract for get_ranked_context (the tool's JSON surface; the MUNCH compact encoding is a lossless-scalar/lossy-detail projection of this shape). The _meta.verdict block additionally conforms to retrieval-verdict.schema.json.", |
| 6 | + "type": "object", |
| 7 | + "required": ["context_items", "total_tokens", "budget_tokens", "items_included", "items_considered", "_meta"], |
| 8 | + "properties": { |
| 9 | + "context_items": { |
| 10 | + "type": "array", |
| 11 | + "items": { |
| 12 | + "type": "object", |
| 13 | + "required": ["symbol_id", "relevance_score", "centrality_score", "combined_score", "tokens", "source"], |
| 14 | + "properties": { |
| 15 | + "symbol_id": {"type": "string"}, |
| 16 | + "match_channel": { |
| 17 | + "enum": ["exact_name"], |
| 18 | + "description": "Present when the item was pinned by source-shaped exact seeding rather than ranked scoring." |
| 19 | + }, |
| 20 | + "relevance_score": {"type": "number", "minimum": 0, "maximum": 1}, |
| 21 | + "centrality_score": {"type": "number", "minimum": 0, "maximum": 1}, |
| 22 | + "combined_score": {"type": "number", "minimum": 0}, |
| 23 | + "tokens": {"type": "integer", "minimum": 0}, |
| 24 | + "source": {"type": "string"}, |
| 25 | + "id": {"type": ["string", "null"]}, |
| 26 | + "name": {"type": ["string", "null"]}, |
| 27 | + "kind": {"type": ["string", "null"]}, |
| 28 | + "file": {"type": ["string", "null"]}, |
| 29 | + "line": {"type": ["integer", "null"]}, |
| 30 | + "score": {"type": "number"}, |
| 31 | + "token_cost": {"type": "integer"}, |
| 32 | + "summary": {"type": "string"}, |
| 33 | + "source_pruned": {"type": "boolean"}, |
| 34 | + "source_kept_lines": {"type": "integer"}, |
| 35 | + "source_elided_lines": {"type": "integer"}, |
| 36 | + "source_total_lines": {"type": "integer"}, |
| 37 | + "source_is_pruned_view": {"type": "boolean"} |
| 38 | + }, |
| 39 | + "additionalProperties": true |
| 40 | + } |
| 41 | + }, |
| 42 | + "total_tokens": {"type": "integer", "minimum": 0}, |
| 43 | + "budget_tokens": {"type": "integer", "minimum": 1}, |
| 44 | + "items_included": {"type": "integer", "minimum": 0}, |
| 45 | + "items_considered": {"type": "integer", "minimum": 0}, |
| 46 | + "negative_evidence": { |
| 47 | + "type": "object", |
| 48 | + "required": ["verdict", "scanned_symbols", "scanned_files", "best_match_score"], |
| 49 | + "properties": { |
| 50 | + "verdict": {"enum": ["no_implementation_found", "low_confidence_matches"]}, |
| 51 | + "scanned_symbols": {"type": "integer", "minimum": 0}, |
| 52 | + "scanned_files": {"type": "integer", "minimum": 0}, |
| 53 | + "best_match_score": {"type": "number", "minimum": 0}, |
| 54 | + "related_existing": {"type": "array", "items": {"type": "string"}} |
| 55 | + }, |
| 56 | + "additionalProperties": true |
| 57 | + }, |
| 58 | + "⚠ warning": {"type": "string"}, |
| 59 | + "_meta": { |
| 60 | + "type": "object", |
| 61 | + "required": ["timing_ms", "tokens_saved", "total_tokens_saved"], |
| 62 | + "properties": { |
| 63 | + "timing_ms": {"type": "number", "minimum": 0}, |
| 64 | + "tokens_saved": {"type": "integer", "minimum": 0}, |
| 65 | + "total_tokens_saved": {"type": "integer", "minimum": 0}, |
| 66 | + "verdict": {"type": "object", "description": "Conforms to retrieval-verdict.schema.json."}, |
| 67 | + "freshness": {"type": "object"}, |
| 68 | + "confidence": {}, |
| 69 | + "query_shape": { |
| 70 | + "type": "object", |
| 71 | + "required": ["source_shaped", "exact_seeded"], |
| 72 | + "properties": { |
| 73 | + "source_shaped": {"type": "array", "items": {"type": "string"}, "minItems": 1}, |
| 74 | + "exact_seeded": {"type": "integer", "minimum": 0} |
| 75 | + }, |
| 76 | + "additionalProperties": false |
| 77 | + } |
| 78 | + }, |
| 79 | + "additionalProperties": true |
| 80 | + } |
| 81 | + }, |
| 82 | + "additionalProperties": true |
| 83 | +} |
0 commit comments