init: document-haness 설계
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "chunk-manifest.schema.json",
|
||||
"title": "split_document chunk manifest",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "tool", "created_at", "source", "max_chars", "offset_unit", "chunks", "round_trip_sha256", "self_check"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"tool": {"const": "split_document"},
|
||||
"created_at": {"type": "string", "format": "date-time"},
|
||||
"source": {
|
||||
"type": "object",
|
||||
"required": ["path", "resolved_path", "sha256", "size_bytes", "char_count"],
|
||||
"properties": {
|
||||
"path": {"type": "string"},
|
||||
"resolved_path": {"type": "string"},
|
||||
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"size_bytes": {"type": "integer", "minimum": 0},
|
||||
"char_count": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"max_chars": {"type": "integer", "minimum": 1},
|
||||
"offset_unit": {"const": "unicode_codepoint"},
|
||||
"chunks": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["index", "input_file", "rewritten_file", "start_offset", "end_offset", "char_count", "sha256", "boundary_reason"],
|
||||
"properties": {
|
||||
"index": {"type": "integer", "minimum": 1},
|
||||
"input_file": {"type": "string"},
|
||||
"rewritten_file": {"type": "string"},
|
||||
"start_offset": {"type": "integer", "minimum": 0},
|
||||
"end_offset": {"type": "integer", "minimum": 0},
|
||||
"char_count": {"type": "integer", "minimum": 0},
|
||||
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"boundary_reason": {"enum": ["h2", "paragraph", "eof", "oversize_atomic_block"]}
|
||||
}
|
||||
}
|
||||
},
|
||||
"round_trip_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"self_check": {"const": true}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "evidence-map.schema.json",
|
||||
"title": "03_evidence_map.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "claims"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"claims": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "statement", "status", "source_ids", "source_locations", "does_not_support", "load_bearing"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"statement": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"status": {"enum": ["source_backed", "observed", "measured", "derived", "recommended", "assumption"]},
|
||||
"source_ids": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true},
|
||||
"source_locations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["source_id", "locator"],
|
||||
"properties": {
|
||||
"source_id": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"locator": {"type": "string", "minLength": 1, "pattern": "\\S"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"does_not_support": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}},
|
||||
"load_bearing": {"type": "boolean"},
|
||||
"premise_ids": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true},
|
||||
"label": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"method": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"environment": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"result": {"type": "string", "minLength": 1, "pattern": "\\S"}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {"properties": {"status": {"enum": ["source_backed", "observed", "measured"]}}},
|
||||
"then": {
|
||||
"properties": {
|
||||
"source_ids": {"minItems": 1},
|
||||
"source_locations": {"minItems": 1}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {"properties": {"status": {"const": "measured"}}},
|
||||
"then": {
|
||||
"required": ["method", "environment", "result"],
|
||||
"properties": {"does_not_support": {"minItems": 1}}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {"properties": {"status": {"const": "derived"}}},
|
||||
"then": {
|
||||
"required": ["premise_ids"],
|
||||
"properties": {"premise_ids": {"minItems": 1}}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"load_bearing": {"const": true},
|
||||
"status": {"enum": ["source_backed", "observed", "measured", "derived"]}
|
||||
}
|
||||
},
|
||||
"then": {"properties": {"does_not_support": {"minItems": 1}}}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {"enum": ["recommended", "assumption"]}
|
||||
}
|
||||
},
|
||||
"then": {"required": ["label"]}
|
||||
}
|
||||
],
|
||||
"additionalProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "final-report.schema.json",
|
||||
"title": "09_final_report.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "tool", "generated_at", "run_id", "route", "mode", "verdict", "document_verdict", "summary", "checks"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"tool": {"const": "verify_run"},
|
||||
"generated_at": {"type": "string", "format": "date-time"},
|
||||
"run_id": {"type": "string", "minLength": 1},
|
||||
"route": {"enum": ["light", "standard", "deep"]},
|
||||
"mode": {"enum": ["write", "revise", "review"]},
|
||||
"verdict": {"enum": ["pass", "fail", "input_error"]},
|
||||
"document_verdict": {"enum": ["pass", "revise", "not_evaluated"]},
|
||||
"summary": {
|
||||
"type": "object",
|
||||
"required": ["passed", "failed", "required_artifacts", "omissions", "lint", "reviews", "status"],
|
||||
"properties": {
|
||||
"passed": {"type": "integer", "minimum": 0},
|
||||
"failed": {"type": "integer", "minimum": 0},
|
||||
"required_artifacts": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||
"omissions": {"type": "array", "items": {"$ref": "#/$defs/omission"}},
|
||||
"lint": {
|
||||
"oneOf": [
|
||||
{"$ref": "#/$defs/lintSummary"},
|
||||
{"type": "null"}
|
||||
]
|
||||
},
|
||||
"reviews": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/$defs/reviewSummary"},
|
||||
"uniqueItems": true
|
||||
},
|
||||
"status": {"type": ["string", "null"]}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"checks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "status", "message"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "minLength": 1},
|
||||
"status": {"enum": ["pass", "fail", "error"]},
|
||||
"message": {"type": "string", "minLength": 1},
|
||||
"artifact": {"type": ["string", "null"]}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"omission": {
|
||||
"type": "object",
|
||||
"required": ["artifact", "reason"],
|
||||
"properties": {
|
||||
"artifact": {"type": "string", "minLength": 1},
|
||||
"reason": {"type": "string", "minLength": 1, "pattern": "\\S"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"fileHash": {
|
||||
"type": "object",
|
||||
"required": ["path", "sha256"],
|
||||
"properties": {
|
||||
"path": {"type": "string", "minLength": 1},
|
||||
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"fidelityTypeSummary": {
|
||||
"type": "object",
|
||||
"required": ["total", "preserved", "missing"],
|
||||
"properties": {
|
||||
"total": {"type": "integer", "minimum": 0},
|
||||
"preserved": {"type": "integer", "minimum": 0},
|
||||
"missing": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"lintFidelity": {
|
||||
"type": "object",
|
||||
"required": ["baseline", "draft_baseline", "protected_total", "preserved", "missing", "by_type", "finalization_change_rate", "max_finalization_change_rate"],
|
||||
"properties": {
|
||||
"baseline": {"oneOf": [{"$ref": "#/$defs/fileHash"}, {"type": "null"}]},
|
||||
"draft_baseline": {"oneOf": [{"$ref": "#/$defs/fileHash"}, {"type": "null"}]},
|
||||
"protected_total": {"type": "integer", "minimum": 0},
|
||||
"preserved": {"type": "integer", "minimum": 0},
|
||||
"missing": {"type": "integer", "minimum": 0},
|
||||
"by_type": {
|
||||
"type": "object",
|
||||
"additionalProperties": {"$ref": "#/$defs/fidelityTypeSummary"}
|
||||
},
|
||||
"finalization_change_rate": {"type": ["number", "null"], "minimum": 0, "maximum": 1},
|
||||
"max_finalization_change_rate": {"type": "number", "minimum": 0, "maximum": 1}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"lintSummary": {
|
||||
"type": "object",
|
||||
"required": ["verdict", "fail_on", "rules_version", "rules_sha256", "document_sha256", "finding_counts", "finding_rule_ids", "fidelity", "limitations"],
|
||||
"properties": {
|
||||
"verdict": {"enum": ["pass", "fail"]},
|
||||
"fail_on": {"enum": ["error", "warning"]},
|
||||
"rules_version": {"type": "string", "minLength": 1},
|
||||
"rules_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"document_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"finding_counts": {"$ref": "#/$defs/lintFindingCounts"},
|
||||
"finding_rule_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
|
||||
"fidelity": {"$ref": "#/$defs/lintFidelity"},
|
||||
"limitations": {"type": "array", "items": {"type": "string"}}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"lintFindingCounts": {
|
||||
"type": "object",
|
||||
"required": ["errors", "warnings", "info", "total"],
|
||||
"properties": {
|
||||
"errors": {"type": "integer", "minimum": 0},
|
||||
"warnings": {"type": "integer", "minimum": 0},
|
||||
"info": {"type": "integer", "minimum": 0},
|
||||
"total": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"findingCounts": {
|
||||
"type": "object",
|
||||
"required": ["critical", "high", "medium", "low", "total"],
|
||||
"properties": {
|
||||
"critical": {"type": "integer", "minimum": 0},
|
||||
"high": {"type": "integer", "minimum": 0},
|
||||
"medium": {"type": "integer", "minimum": 0},
|
||||
"low": {"type": "integer", "minimum": 0},
|
||||
"total": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"reviewSummary": {
|
||||
"type": "object",
|
||||
"required": ["artifact", "review_type", "verdict", "document_sha256", "input_sha256s", "finding_counts", "finding_ids"],
|
||||
"properties": {
|
||||
"artifact": {"enum": ["08_logic_review.json", "08_reader_review.json"]},
|
||||
"review_type": {"enum": ["logic", "reader"]},
|
||||
"verdict": {"enum": ["pass", "revise", "hold_for_review"]},
|
||||
"document_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"input_sha256s": {"$ref": "#/$defs/reviewInputs"},
|
||||
"finding_counts": {"$ref": "#/$defs/findingCounts"},
|
||||
"finding_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"reviewInputs": {
|
||||
"type": "object",
|
||||
"required": ["input_sha256", "sources_sha256", "reader_contract_sha256", "evidence_map_sha256", "logic_map_sha256", "term_ledger_sha256"],
|
||||
"properties": {
|
||||
"input_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"sources_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"reader_contract_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"evidence_map_sha256": {
|
||||
"oneOf": [
|
||||
{"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
{"type": "null"}
|
||||
]
|
||||
},
|
||||
"logic_map_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"term_ledger_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "lint-report.schema.json",
|
||||
"title": "08_lint.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "rules_version", "rules_sha256", "tool", "generated_at", "document", "fail_on", "verdict", "summary", "fidelity", "findings"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"rules_version": {"type": "string", "minLength": 1},
|
||||
"rules_sha256": {
|
||||
"oneOf": [
|
||||
{"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
{"type": "null"}
|
||||
]
|
||||
},
|
||||
"tool": {"const": "lint_document"},
|
||||
"generated_at": {"type": "string", "format": "date-time"},
|
||||
"document": {"$ref": "#/$defs/fileHash"},
|
||||
"logic_map_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"term_ledger_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"reader_contract_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"fail_on": {"enum": ["error", "warning"]},
|
||||
"verdict": {"enum": ["pass", "fail", "input_error"]},
|
||||
"summary": {
|
||||
"type": "object",
|
||||
"required": ["errors", "warnings", "info", "total"],
|
||||
"properties": {
|
||||
"errors": {"type": "integer", "minimum": 0},
|
||||
"warnings": {"type": "integer", "minimum": 0},
|
||||
"info": {"type": "integer", "minimum": 0},
|
||||
"total": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"fidelity": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"baseline": {"oneOf": [{"$ref": "#/$defs/fileHash"}, {"type": "null"}]},
|
||||
"draft_baseline": {"oneOf": [{"$ref": "#/$defs/fileHash"}, {"type": "null"}]},
|
||||
"protected_total": {"type": "integer", "minimum": 0},
|
||||
"preserved": {"type": "integer", "minimum": 0},
|
||||
"missing": {"type": "integer", "minimum": 0},
|
||||
"by_type": {
|
||||
"type": "object",
|
||||
"additionalProperties": {"$ref": "#/$defs/fidelityTypeSummary"}
|
||||
},
|
||||
"finalization_change_rate": {"type": ["number", "null"], "minimum": 0, "maximum": 1},
|
||||
"max_finalization_change_rate": {"type": "number", "minimum": 0, "maximum": 1}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"limitations": {"type": "array", "items": {"type": "string"}},
|
||||
"findings": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["rule_id", "severity", "message", "path", "line", "column"],
|
||||
"properties": {
|
||||
"rule_id": {"type": "string", "minLength": 1},
|
||||
"severity": {"enum": ["error", "warning", "info"]},
|
||||
"message": {"type": "string", "minLength": 1},
|
||||
"path": {"type": "string", "minLength": 1},
|
||||
"line": {"type": ["integer", "null"], "minimum": 1},
|
||||
"column": {"type": ["integer", "null"], "minimum": 1},
|
||||
"section_id": {"type": ["string", "null"]},
|
||||
"context": {"type": ["string", "null"]}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {"properties": {"verdict": {"enum": ["pass", "fail"]}}},
|
||||
"then": {
|
||||
"required": ["logic_map_sha256", "term_ledger_sha256", "reader_contract_sha256", "limitations"],
|
||||
"properties": {
|
||||
"rules_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"fidelity": {
|
||||
"required": ["baseline", "draft_baseline", "protected_total", "preserved", "missing", "by_type", "finalization_change_rate", "max_finalization_change_rate"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"$defs": {
|
||||
"fileHash": {
|
||||
"type": "object",
|
||||
"required": ["path", "sha256"],
|
||||
"properties": {
|
||||
"path": {"type": "string", "minLength": 1},
|
||||
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"fidelityTypeSummary": {
|
||||
"type": "object",
|
||||
"required": ["total", "preserved", "missing"],
|
||||
"properties": {
|
||||
"total": {"type": "integer", "minimum": 0},
|
||||
"preserved": {"type": "integer", "minimum": 0},
|
||||
"missing": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "logic-map.schema.json",
|
||||
"title": "04_logic_map.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "title", "document_kind", "core_claim", "sections", "closure"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"title": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"document_kind": {"enum": ["explanation", "decision", "how-to", "reference"]},
|
||||
"core_claim": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"sections": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "heading", "role", "depends_on", "reader_state_before", "question", "answer_plain", "claim_ids", "new_terms", "transition_to", "reader_state_after"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"heading": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"role": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"depends_on": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true},
|
||||
"reader_state_before": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"question": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"answer_plain": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"claim_ids": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true},
|
||||
"new_terms": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true},
|
||||
"transition_to": {"type": ["string", "null"], "pattern": "\\S"},
|
||||
"reader_state_after": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"required_markers": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}},
|
||||
"proves": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}},
|
||||
"does_not_prove": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"closure": {"type": "string", "minLength": 1, "pattern": "\\S"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "quality-rules.schema.json",
|
||||
"title": "Technical Document Flow quality rules",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "rules_version", "thresholds", "patterns", "rules"],
|
||||
"properties": {
|
||||
"$schema": {"type": "string"},
|
||||
"schema_version": {"const": "1.0"},
|
||||
"rules_version": {"type": "string", "minLength": 1},
|
||||
"thresholds": {
|
||||
"type": "object",
|
||||
"required": ["heading", "term", "paragraph", "logic", "route", "split", "finalization"],
|
||||
"properties": {
|
||||
"heading": {
|
||||
"type": "object",
|
||||
"required": ["required_h1_count", "max_level_jump"],
|
||||
"additionalProperties": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"term": {
|
||||
"type": "object",
|
||||
"required": ["max_new_terms_per_sentence", "max_new_terms_per_paragraph", "max_new_terms_per_section", "definition_window_chars", "max_assumed_known", "max_assumed_per_prerequisite"],
|
||||
"additionalProperties": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"paragraph": {
|
||||
"type": "object",
|
||||
"required": ["max_chars", "max_sentences"],
|
||||
"additionalProperties": {"type": "integer", "minimum": 1}
|
||||
},
|
||||
"logic": {
|
||||
"type": "object",
|
||||
"required": ["core_claim_max_reader_paragraphs"],
|
||||
"properties": {
|
||||
"core_claim_max_reader_paragraphs": {"type": "integer", "minimum": 1}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"route": {
|
||||
"type": "object",
|
||||
"required": ["light", "standard", "deep"],
|
||||
"properties": {
|
||||
"light": {
|
||||
"type": "object",
|
||||
"required": ["requires_existing_draft", "max_input_chars", "max_sources", "max_headings"],
|
||||
"properties": {
|
||||
"requires_existing_draft": {"type": "boolean"},
|
||||
"max_input_chars": {"type": "integer", "minimum": 1},
|
||||
"max_sources": {"type": "integer", "minimum": 0},
|
||||
"max_headings": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"standard": {
|
||||
"type": "object",
|
||||
"required": ["max_input_chars", "max_sources", "max_headings"],
|
||||
"properties": {
|
||||
"max_input_chars": {"type": "integer", "minimum": 1},
|
||||
"max_sources": {"type": "integer", "minimum": 0},
|
||||
"max_headings": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
},
|
||||
"deep": {
|
||||
"type": "object",
|
||||
"required": ["min_input_chars", "min_sources", "min_headings"],
|
||||
"properties": {
|
||||
"min_input_chars": {"type": "integer", "minimum": 1},
|
||||
"min_sources": {"type": "integer", "minimum": 0},
|
||||
"min_headings": {"type": "integer", "minimum": 0}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"split": {
|
||||
"type": "object",
|
||||
"required": ["default_max_chars", "minimum_h2_fill_ratio"],
|
||||
"properties": {
|
||||
"default_max_chars": {"type": "integer", "minimum": 1},
|
||||
"minimum_h2_fill_ratio": {"type": "number", "minimum": 0, "maximum": 1}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"finalization": {
|
||||
"type": "object",
|
||||
"required": ["max_change_rate"],
|
||||
"properties": {
|
||||
"max_change_rate": {"type": "number", "minimum": 0, "maximum": 1}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"patterns": {
|
||||
"type": "object",
|
||||
"required": ["placeholders", "evidence_markers", "technical_candidate_allowlist", "technical_lowercase_candidates"],
|
||||
"properties": {
|
||||
"placeholders": {"type": "array", "items": {"type": "string"}},
|
||||
"evidence_markers": {"type": "array", "items": {"type": "string"}},
|
||||
"technical_candidate_allowlist": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
|
||||
"technical_lowercase_candidates": {"type": "array", "items": {"type": "string", "pattern": "^[a-z][a-z0-9-]*$"}, "uniqueItems": true}
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "category", "severity", "description"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "pattern": "^(?:DOC-[A-Z][0-9]{3}|FNL-[0-9]{3}|EVD-[0-9]{3}|RUN-[0-9]{3})$"},
|
||||
"category": {"type": "string", "minLength": 1},
|
||||
"severity": {"enum": ["error", "warning", "info"]},
|
||||
"description": {"type": "string", "minLength": 1}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "reader-contract.schema.json",
|
||||
"title": "02_reader_contract.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "document_kind", "primary_audience", "purpose", "reader_question", "reader_outcome", "prerequisites", "assumed_known", "must_explain", "non_goals"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"document_kind": {"enum": ["explanation", "decision", "how-to", "reference"]},
|
||||
"primary_audience": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"purpose": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"reader_question": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"reader_outcome": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"prerequisites": {"$ref": "#/$defs/stringList"},
|
||||
"assumed_known": {"$ref": "#/$defs/stringList"},
|
||||
"must_explain": {"$ref": "#/$defs/stringList"},
|
||||
"non_goals": {"$ref": "#/$defs/stringList"}
|
||||
},
|
||||
"$defs": {
|
||||
"stringList": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "review.schema.json",
|
||||
"title": "08_*_review.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "review_type", "document", "inputs", "verdict", "findings"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"review_type": {"enum": ["logic", "reader"]},
|
||||
"document": {
|
||||
"type": "object",
|
||||
"required": ["path", "sha256"],
|
||||
"properties": {
|
||||
"path": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"inputs": {
|
||||
"type": "object",
|
||||
"required": ["input_sha256", "sources_sha256", "reader_contract_sha256", "evidence_map_sha256", "logic_map_sha256", "term_ledger_sha256"],
|
||||
"properties": {
|
||||
"input_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"sources_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"reader_contract_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"evidence_map_sha256": {
|
||||
"oneOf": [
|
||||
{"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
{"type": "null"}
|
||||
]
|
||||
},
|
||||
"logic_map_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"term_ledger_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"verdict": {"enum": ["pass", "revise", "hold_for_review"]},
|
||||
"findings": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "severity", "location", "reader_impact", "suggestion"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"severity": {"enum": ["critical", "high", "medium", "low"]},
|
||||
"location": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"reader_impact": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"suggestion": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"evidence": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"violated_rule": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"owner": {
|
||||
"enum": [
|
||||
"doc-evidence-curator",
|
||||
"doc-logic-architect",
|
||||
"doc-drafter"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "run.schema.json",
|
||||
"title": "00_run.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "run_id", "created_at", "updated_at", "mode", "document_kind", "kind_reason", "route_requested", "route_hint", "route_reason", "route_metrics", "status", "error", "contract_sha256", "rules_version", "rules_sha256", "omissions", "inputs", "history"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"run_id": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{3,4}$"},
|
||||
"created_at": {"type": "string", "format": "date-time"},
|
||||
"updated_at": {"type": "string", "format": "date-time"},
|
||||
"mode": {"enum": ["write", "revise", "review"]},
|
||||
"document_kind": {"enum": ["explanation", "decision", "how-to", "reference"]},
|
||||
"kind_reason": {"type": "string", "minLength": 1},
|
||||
"audience": {"type": ["string", "null"]},
|
||||
"route_requested": {"enum": ["auto", "light", "standard", "deep"]},
|
||||
"route_hint": {"enum": ["light", "standard", "deep"]},
|
||||
"route_reason": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"route_metrics": {
|
||||
"type": "object",
|
||||
"required": ["total_chars", "source_count", "total_headings"],
|
||||
"properties": {
|
||||
"total_chars": {"type": "integer", "minimum": 0},
|
||||
"source_count": {"type": "integer", "minimum": 0},
|
||||
"total_headings": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"status": {"enum": ["initialized", "evidence_ready", "planned", "drafted", "reviewed", "finalized", "verified", "hold_for_review", "failed", "incomplete"]},
|
||||
"error": {
|
||||
"oneOf": [
|
||||
{"$ref": "#/$defs/terminalError"},
|
||||
{"type": "null"}
|
||||
]
|
||||
},
|
||||
"contract_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"rules_version": {"type": "string", "minLength": 1},
|
||||
"rules_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"omissions": {"type": "array", "items": {"$ref": "#/$defs/omission"}},
|
||||
"inputs": {
|
||||
"type": "object",
|
||||
"required": ["brief", "draft", "source_count", "brief_sha256", "draft_sha256", "sources_manifest_sha256", "input_sha256"],
|
||||
"properties": {
|
||||
"brief": {"$ref": "#/$defs/fileInventory"},
|
||||
"draft": {"oneOf": [{"$ref": "#/$defs/fileInventory"}, {"type": "null"}]},
|
||||
"source_count": {"type": "integer", "minimum": 0},
|
||||
"brief_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"draft_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
|
||||
"sources_manifest_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"input_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
}
|
||||
},
|
||||
"history": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["at", "from", "to", "reason", "error"],
|
||||
"properties": {
|
||||
"at": {"type": "string", "format": "date-time"},
|
||||
"from": {"type": ["string", "null"]},
|
||||
"to": {"type": "string"},
|
||||
"reason": {"type": "string"},
|
||||
"error": {
|
||||
"oneOf": [
|
||||
{"$ref": "#/$defs/terminalError"},
|
||||
{"type": "null"}
|
||||
]
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"to": {"enum": ["hold_for_review", "failed", "incomplete"]}
|
||||
},
|
||||
"required": ["to"]
|
||||
},
|
||||
"then": {"properties": {"error": {"$ref": "#/$defs/terminalError"}}},
|
||||
"else": {"properties": {"error": {"type": "null"}}}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"status": {"enum": ["hold_for_review", "failed", "incomplete"]}
|
||||
},
|
||||
"required": ["status"]
|
||||
},
|
||||
"then": {"properties": {"error": {"$ref": "#/$defs/terminalError"}}},
|
||||
"else": {"properties": {"error": {"type": "null"}}}
|
||||
}
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"$defs": {
|
||||
"terminalError": {
|
||||
"type": "object",
|
||||
"required": ["stage", "code", "message", "affected_artifact", "retryable", "safe_next_action"],
|
||||
"properties": {
|
||||
"stage": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"code": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"message": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"affected_artifact": {
|
||||
"oneOf": [
|
||||
{"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
{"type": "null"}
|
||||
]
|
||||
},
|
||||
"retryable": {"type": "boolean"},
|
||||
"safe_next_action": {"type": "string", "minLength": 1, "pattern": "\\S"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"omission": {
|
||||
"type": "object",
|
||||
"required": ["artifact", "reason"],
|
||||
"properties": {
|
||||
"artifact": {
|
||||
"enum": [
|
||||
"00_run.json",
|
||||
"01_input.md",
|
||||
"01_sources.json",
|
||||
"02_reader_contract.json",
|
||||
"03_evidence_map.json",
|
||||
"04_logic_map.json",
|
||||
"05_term_ledger.json",
|
||||
"07_draft.md",
|
||||
"08_logic_review.json",
|
||||
"08_reader_review.json",
|
||||
"08_lint.json",
|
||||
"final.md",
|
||||
"09_final_report.json"
|
||||
]
|
||||
},
|
||||
"reason": {"type": "string", "minLength": 1, "pattern": "\\S"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"fileInventory": {
|
||||
"type": "object",
|
||||
"required": ["id", "role", "path", "resolved_path", "size_bytes", "sha256"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "minLength": 1},
|
||||
"role": {"type": "string"},
|
||||
"path": {"type": "string"},
|
||||
"resolved_path": {"type": "string"},
|
||||
"size_bytes": {"type": "integer", "minimum": 0},
|
||||
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "runtime-contract.schema.json",
|
||||
"title": "technical-doc-flow runtime contract",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "name", "agents", "artifacts", "supported_document_kinds", "supported_output_formats"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"name": {"const": "technical-doc-flow"},
|
||||
"agents": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
|
||||
"artifacts": {
|
||||
"type": "object",
|
||||
"required": ["always", "light", "standard", "deep", "review_mode"],
|
||||
"properties": {
|
||||
"always": {"$ref": "#/$defs/artifactList"},
|
||||
"light": {"$ref": "#/$defs/artifactList"},
|
||||
"standard": {"$ref": "#/$defs/artifactList"},
|
||||
"deep": {"$ref": "#/$defs/artifactList"},
|
||||
"review_mode": {"$ref": "#/$defs/artifactList"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"supported_document_kinds": {
|
||||
"type": "array",
|
||||
"items": {"enum": ["explanation", "decision", "how-to", "reference"]},
|
||||
"minItems": 4,
|
||||
"maxItems": 4,
|
||||
"uniqueItems": true
|
||||
},
|
||||
"supported_output_formats": {
|
||||
"type": "array",
|
||||
"items": {"const": "markdown"},
|
||||
"minItems": 1,
|
||||
"maxItems": 1,
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"$defs": {
|
||||
"artifactList": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"enum": [
|
||||
"00_run.json",
|
||||
"01_input.md",
|
||||
"01_sources.json",
|
||||
"02_reader_contract.json",
|
||||
"03_evidence_map.json",
|
||||
"04_logic_map.json",
|
||||
"05_term_ledger.json",
|
||||
"07_draft.md",
|
||||
"08_logic_review.json",
|
||||
"08_reader_review.json",
|
||||
"08_lint.json",
|
||||
"final.md",
|
||||
"09_final_report.json"
|
||||
]
|
||||
},
|
||||
"uniqueItems": true
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "sources.schema.json",
|
||||
"title": "01_sources.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "brief", "draft", "sources"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"brief": {"$ref": "#/$defs/fileInventory"},
|
||||
"draft": {"oneOf": [{"$ref": "#/$defs/fileInventory"}, {"type": "null"}]},
|
||||
"sources": {"type": "array", "items": {"$ref": "#/$defs/fileInventory"}}
|
||||
},
|
||||
"$defs": {
|
||||
"fileInventory": {
|
||||
"type": "object",
|
||||
"required": ["id", "path", "sha256"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "minLength": 1},
|
||||
"role": {"type": "string"},
|
||||
"path": {"type": "string"},
|
||||
"resolved_path": {"type": "string"},
|
||||
"size_bytes": {"type": "integer", "minimum": 0},
|
||||
"sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
|
||||
"locator": {"type": "string"},
|
||||
"version": {"type": "string"},
|
||||
"date": {"type": "string"},
|
||||
"environment": {"type": "string"},
|
||||
"retrieved_at": {"type": "string", "format": "date-time"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
},
|
||||
"additionalProperties": true
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "term-ledger.schema.json",
|
||||
"title": "05_term_ledger.json",
|
||||
"type": "object",
|
||||
"required": ["schema_version", "assumed_known", "budgets", "terms"],
|
||||
"properties": {
|
||||
"schema_version": {"const": "1.0"},
|
||||
"assumed_known": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true},
|
||||
"budgets": {
|
||||
"type": "object",
|
||||
"required": ["per_sentence", "per_paragraph", "per_section"],
|
||||
"properties": {
|
||||
"per_sentence": {"type": "integer", "minimum": 0},
|
||||
"per_paragraph": {"type": "integer", "minimum": 0},
|
||||
"per_section": {"type": "integer", "minimum": 0}
|
||||
},
|
||||
"additionalProperties": false
|
||||
},
|
||||
"terms": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"required": ["id", "canonical", "plain_definition", "why_needed", "aliases", "first_section", "first_use"],
|
||||
"properties": {
|
||||
"id": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"canonical": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"plain_definition": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"why_needed": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"aliases": {"type": "array", "items": {"type": "string", "minLength": 1, "pattern": "\\S"}, "uniqueItems": true},
|
||||
"first_section": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"first_use": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"english": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"abbreviation": {"type": "string", "minLength": 1, "pattern": "\\S"},
|
||||
"protected": {"type": "boolean"}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
Reference in New Issue
Block a user