ci: enforce schema model evidence generation
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Failing after 16s
Validators (Pushes and Pull Requests) / validate-core (push) Failing after 55s

This commit is contained in:
2026-07-12 12:13:02 +09:00
parent d833d386d0
commit 34991eca2d
3 changed files with 38 additions and 0 deletions
@@ -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())