|
| 1 | +{ |
| 2 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 3 | + "$id": "https://knowcode.dev/schemas/prose/golden_v0.schema.json", |
| 4 | + "title": "Prose GoldenLabel", |
| 5 | + "description": "Final committed record for the SDLC document-collateral retrieval golden set. Extends the code GoldenLabel (tests/eval/golden/golden_v1.0.json): query_type replaces task_type; expected_doc_spans replace expected_entities/expected_files; traceability and synthesis add expected_trace_path / expected_doc_types. See docs/research/document_collateral_retrieval_2026.md section 6.", |
| 6 | + "type": "object", |
| 7 | + "additionalProperties": false, |
| 8 | + "required": [ |
| 9 | + "query_id", |
| 10 | + "query_text", |
| 11 | + "query_type", |
| 12 | + "difficulty", |
| 13 | + "expected_doc_spans", |
| 14 | + "must_mention_facts", |
| 15 | + "must_not_mention_facts", |
| 16 | + "validation", |
| 17 | + "schema_version" |
| 18 | + ], |
| 19 | + "properties": { |
| 20 | + "query_id": { |
| 21 | + "type": "string", |
| 22 | + "pattern": "^pq[0-9]{3,}$|^pq_[a-z0-9_]+$", |
| 23 | + "description": "e.g. 'pq001' or 'pq_example_trace'." |
| 24 | + }, |
| 25 | + "query_text": { "type": "string", "minLength": 8 }, |
| 26 | + "query_type": { "enum": ["fact_lookup", "traceability", "synthesis"] }, |
| 27 | + "difficulty": { "enum": ["easy", "medium", "hard"] }, |
| 28 | + "expected_doc_spans": { |
| 29 | + "type": "array", |
| 30 | + "minItems": 1, |
| 31 | + "items": { "$ref": "#/$defs/docSpan" }, |
| 32 | + "description": "Prose analogue of expected_entities + expected_files: the passages a correct retrieval must surface." |
| 33 | + }, |
| 34 | + "expected_trace_path": { |
| 35 | + "type": "array", |
| 36 | + "default": [], |
| 37 | + "items": { |
| 38 | + "type": "string", |
| 39 | + "pattern": "^(feature|requirement|persona|component|release|decision|client):[a-z0-9._/-]+$|^[a-z0-9._/-]+\\.md$", |
| 40 | + "description": "Ordered graph nodes for a traceability walk: typed entity refs (e.g. 'feature:atlas-rate-limiting') or document ids ('prd/atlas-rate-limiting.md')." |
| 41 | + } |
| 42 | + }, |
| 43 | + "expected_doc_types": { |
| 44 | + "type": "array", |
| 45 | + "default": [], |
| 46 | + "items": { "$ref": "#/$defs/docType" }, |
| 47 | + "description": "For synthesis: the collection(s) in scope (e.g. ['case_study'])." |
| 48 | + }, |
| 49 | + "must_mention_facts": { "type": "array", "items": { "type": "string" } }, |
| 50 | + "must_not_mention_facts": { "type": "array", "items": { "type": "string" } }, |
| 51 | + "correct": { "type": "boolean" }, |
| 52 | + "validation": { "$ref": "#/$defs/validation" }, |
| 53 | + "provenance": { "$ref": "#/$defs/provenance" }, |
| 54 | + "schema_version": { "const": "0.1.0" } |
| 55 | + }, |
| 56 | + "allOf": [ |
| 57 | + { |
| 58 | + "if": { "properties": { "query_type": { "const": "traceability" } } }, |
| 59 | + "then": { |
| 60 | + "required": ["expected_trace_path"], |
| 61 | + "properties": { |
| 62 | + "expected_trace_path": { "minItems": 2 }, |
| 63 | + "expected_doc_spans": { "minItems": 2 } |
| 64 | + } |
| 65 | + } |
| 66 | + }, |
| 67 | + { |
| 68 | + "if": { "properties": { "query_type": { "const": "synthesis" } } }, |
| 69 | + "then": { |
| 70 | + "required": ["expected_doc_types"], |
| 71 | + "properties": { |
| 72 | + "expected_doc_spans": { "minItems": 3 }, |
| 73 | + "expected_doc_types": { "minItems": 1 } |
| 74 | + } |
| 75 | + } |
| 76 | + } |
| 77 | + ], |
| 78 | + "$defs": { |
| 79 | + "docType": { |
| 80 | + "enum": [ |
| 81 | + "problem_statement", "prd", "architecture", "hld", "lld", |
| 82 | + "release_notes", "user_guide", "install_guide", "support_manual", |
| 83 | + "brochure", "feature_catalog", "case_study", "whitepaper" |
| 84 | + ] |
| 85 | + }, |
| 86 | + "docSpan": { |
| 87 | + "type": "object", |
| 88 | + "additionalProperties": false, |
| 89 | + "required": ["doc_id", "doc_type", "heading_path", "line_range"], |
| 90 | + "properties": { |
| 91 | + "doc_id": { "type": "string", "description": "Repo-relative path of the document." }, |
| 92 | + "doc_type": { "$ref": "#/$defs/docType" }, |
| 93 | + "heading_path": { |
| 94 | + "type": "string", |
| 95 | + "description": "Breadcrumb of the section, e.g. 'PRD > Requirements > Rate Limiting'." |
| 96 | + }, |
| 97 | + "line_range": { |
| 98 | + "type": "array", |
| 99 | + "items": { "type": "integer", "minimum": 1 }, |
| 100 | + "minItems": 2, |
| 101 | + "maxItems": 2, |
| 102 | + "description": "[start, end], 1-indexed, start <= end (cross-field check enforced by the mechanical gate)." |
| 103 | + }, |
| 104 | + "role": { "enum": ["primary", "supporting", "contextual"] } |
| 105 | + } |
| 106 | + }, |
| 107 | + "validation": { |
| 108 | + "type": "object", |
| 109 | + "additionalProperties": false, |
| 110 | + "required": ["source_verified", "human_reviewed", "method"], |
| 111 | + "properties": { |
| 112 | + "source_verified": { "type": "boolean" }, |
| 113 | + "human_reviewed": { "type": "boolean" }, |
| 114 | + "method": { "type": "string" } |
| 115 | + } |
| 116 | + }, |
| 117 | + "provenance": { |
| 118 | + "type": "object", |
| 119 | + "properties": { |
| 120 | + "query_author": { "type": "string" }, |
| 121 | + "oracle": { "type": "string" }, |
| 122 | + "adversary": { "type": "string" }, |
| 123 | + "human_reviewer": { "type": ["string", "null"] }, |
| 124 | + "reviewed_at": { "type": ["string", "null"] } |
| 125 | + } |
| 126 | + } |
| 127 | + } |
| 128 | +} |
0 commit comments