feat: add dotnet postgres json cutover gate
This commit is contained in:
@@ -57,6 +57,7 @@
|
||||
"collect:remote-evidence": "python tools/collect_remote_wbs_evidence_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:dotnet-cutover": "python tools/validate_dotnet_postgresql_json_cutover_v1.py",
|
||||
"test:e2e": "playwright test --project=chromium",
|
||||
"test:evidence": "playwright test --project=evidence"
|
||||
},
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
formula_id: DOTNET_POSTGRESQL_JSON_CUTOVER_V1
|
||||
version: 1
|
||||
authority: spec/02_data_contract.yaml
|
||||
canonical_runtime:
|
||||
collector: src/dotnet/QuantEngine.Application/Services/KisDataCollectionOrchestrator.cs
|
||||
seed_ingestion: src/dotnet/QuantEngine.Application/Services/JsonSeedIngestionService.cs
|
||||
storage: src/dotnet/QuantEngine.Infrastructure/Repositories/CollectionRepository.cs
|
||||
migration: src/dotnet/QuantEngine.Infrastructure/Migrations/V5__Add_Normalized_Learning_History.sql
|
||||
output: Temp/kis_dotnet_collection_v1.json
|
||||
legacy_policy:
|
||||
python_collector: migration_only
|
||||
sqlite_store: migration_only
|
||||
xlsx_runtime_input: forbidden
|
||||
gates:
|
||||
- dotnet_collector_registered
|
||||
- postgresql_collection_repository_registered
|
||||
- json_seed_ingestion_registered
|
||||
- dbup_v5_embedded
|
||||
- xlsx_not_runtime_dependency
|
||||
@@ -0,0 +1,35 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
def main() -> int:
|
||||
program = (ROOT / "src/dotnet/QuantEngine.Web/Program.cs").read_text(encoding="utf-8")
|
||||
csproj = (ROOT / "src/dotnet/QuantEngine.Infrastructure/QuantEngine.Infrastructure.csproj").read_text(encoding="utf-8")
|
||||
migration = ROOT / "src/dotnet/QuantEngine.Infrastructure/Migrations/V5__Add_Normalized_Learning_History.sql"
|
||||
orchestrator = ROOT / "src/dotnet/QuantEngine.Application/Services/KisDataCollectionOrchestrator.cs"
|
||||
seed_service = ROOT / "src/dotnet/QuantEngine.Application/Services/JsonSeedIngestionService.cs"
|
||||
checks = {
|
||||
"dotnet_collector_registered": "ICollectionOrchestrator, KisDataCollectionOrchestrator" in program,
|
||||
"postgres_repository_registered": "ICollectionRepository" in program,
|
||||
"json_seed_registered": "JsonSeedIngestionService" in program,
|
||||
"dbup_v5_embedded": "Migrations/**/*.sql" in csproj and migration.exists(),
|
||||
"orchestrator_present": orchestrator.exists(),
|
||||
"json_seed_ingestion_present": seed_service.exists(),
|
||||
"json_artifact_contract": "KIS_DOTNET_COLLECTION_V1" in orchestrator.read_text(encoding="utf-8"),
|
||||
"no_xlsx_in_seed_service": ".xlsx" not in seed_service.read_text(encoding="utf-8"),
|
||||
}
|
||||
gate = "PASS" if all(checks.values()) else "FAIL"
|
||||
payload = {"formula_id": "DOTNET_POSTGRESQL_JSON_CUTOVER_V1", "gate": gate, "checks": checks}
|
||||
output = ROOT / "Temp/dotnet_postgresql_json_cutover_v1.json"
|
||||
output.parent.mkdir(parents=True, exist_ok=True)
|
||||
output.write_text(json.dumps(payload, indent=2), encoding="utf-8")
|
||||
print(json.dumps(payload, indent=2))
|
||||
return 0 if gate == "PASS" else 1
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user