ci: enforce schema model evidence generation
This commit is contained in:
@@ -101,6 +101,9 @@ jobs:
|
|||||||
- name: Validate Platform Transition WBS
|
- name: Validate Platform Transition WBS
|
||||||
run: python3 tools/validate_platform_transition_wbs_v1.py
|
run: python3 tools/validate_platform_transition_wbs_v1.py
|
||||||
|
|
||||||
|
- name: Validate Schema Model Generation
|
||||||
|
run: python3 tools/generate_schema_model_generation_evidence_v1.py && python3 tools/validate_schema_model_generation_v1.py
|
||||||
|
|
||||||
- name: Validate Quant Engine WBS
|
- name: Validate Quant Engine WBS
|
||||||
run: python3 tools/validate_quant_engine_wbs_v1.py
|
run: python3 tools/validate_quant_engine_wbs_v1.py
|
||||||
|
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
"verify:wbs": "python tools/validate_quant_engine_wbs_v1.py",
|
"verify:wbs": "python tools/validate_quant_engine_wbs_v1.py",
|
||||||
"validate:normalized-learning-store": "python tools/validate_normalized_learning_store_v1.py",
|
"validate:normalized-learning-store": "python tools/validate_normalized_learning_store_v1.py",
|
||||||
"validate:dotnet-cutover": "python tools/validate_dotnet_postgresql_json_cutover_v1.py",
|
"validate:dotnet-cutover": "python tools/validate_dotnet_postgresql_json_cutover_v1.py",
|
||||||
|
"validate:schema-model": "python tools/generate_schema_model_generation_evidence_v1.py && python tools/validate_schema_model_generation_v1.py",
|
||||||
"test:e2e": "playwright test --project=chromium",
|
"test:e2e": "playwright test --project=chromium",
|
||||||
"test:evidence": "playwright test --project=evidence"
|
"test:evidence": "playwright test --project=evidence"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
"""Generate deterministic evidence for schema/model parity."""
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import json
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
SCHEMA_DIR = ROOT / "schemas" / "generated"
|
||||||
|
OUT_DIR = ROOT / "src" / "quant_engine" / "models" / "generated"
|
||||||
|
REPORT = ROOT / "Temp" / "schema_model_generation_v1.json"
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> int:
|
||||||
|
schema_count = len(list(SCHEMA_DIR.glob("*.schema.json")))
|
||||||
|
module_count = len(list(OUT_DIR.glob("*.py")))
|
||||||
|
payload = {
|
||||||
|
"formula_id": "SCHEMA_MODEL_GENERATION_V1",
|
||||||
|
"status": "OK" if module_count == schema_count + 1 else "FAIL",
|
||||||
|
"schema_count": schema_count,
|
||||||
|
"generated_module_count": schema_count,
|
||||||
|
"module_count": module_count,
|
||||||
|
"evidence": {
|
||||||
|
"schema_dir": str(SCHEMA_DIR.relative_to(ROOT)),
|
||||||
|
"model_dir": str(OUT_DIR.relative_to(ROOT)),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
REPORT.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
REPORT.write_text(json.dumps(payload, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||||
|
print(json.dumps(payload, ensure_ascii=False, indent=2))
|
||||||
|
return 0 if payload["status"] == "OK" else 1
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
raise SystemExit(main())
|
||||||
Reference in New Issue
Block a user