feat(lab): publish M4.8 assisted regression evidence
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Freeze the source-scoped RAVNOVES00 M4.8 independent-review pack."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
from k1link.laboratory.m48_ravnoves00_pack import prepare_m48_ravnoves00_pack
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--m47-lab-root", type=Path, required=True)
|
||||
parser.add_argument("--graph-result-root", type=Path, required=True)
|
||||
parser.add_argument("--threat-result-root", type=Path, required=True)
|
||||
parser.add_argument("--geometry-result-root", type=Path, required=True)
|
||||
parser.add_argument("--camera-index", type=Path, required=True)
|
||||
parser.add_argument("--selection", type=Path, required=True)
|
||||
parser.add_argument("--frozen-at-utc", required=True)
|
||||
parser.add_argument("--output-root", type=Path, required=True)
|
||||
args = parser.parse_args()
|
||||
result = prepare_m48_ravnoves00_pack(
|
||||
m47_lab_root=args.m47_lab_root,
|
||||
graph_result_root=args.graph_result_root,
|
||||
threat_result_root=args.threat_result_root,
|
||||
geometry_result_root=args.geometry_result_root,
|
||||
camera_index_path=args.camera_index,
|
||||
selection_path=args.selection,
|
||||
frozen_at_utc=args.frozen_at_utc,
|
||||
output_root=args.output_root,
|
||||
)
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"result_id": result.result_id,
|
||||
"result_root": str(result.result_root),
|
||||
"status": result.report["status"],
|
||||
"clip_count": result.report["metrics"]["clip_count"],
|
||||
"frame_count": result.report["metrics"]["frame_count"],
|
||||
"truth_labels_available": False,
|
||||
},
|
||||
ensure_ascii=False,
|
||||
sort_keys=True,
|
||||
separators=(",", ":"),
|
||||
)
|
||||
)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
@@ -0,0 +1,79 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Publish one canonical append-only M4.8 small-static regression run."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import socket
|
||||
from pathlib import Path
|
||||
|
||||
from k1link.compute.pipeline_telemetry import JsonlPipelineTelemetrySink
|
||||
from k1link.laboratory import (
|
||||
LaboratoryEvidenceRegistry,
|
||||
LaboratoryExecutionRegistry,
|
||||
LaboratoryRunner,
|
||||
LaboratoryRunRequest,
|
||||
)
|
||||
|
||||
|
||||
def _parser() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--pack-root", type=Path, required=True)
|
||||
parser.add_argument("--correction-session", type=Path, required=True)
|
||||
parser.add_argument("--profile", type=Path, required=True)
|
||||
parser.add_argument("--output-root", type=Path, required=True)
|
||||
parser.add_argument("--receipt-root", type=Path, required=True)
|
||||
parser.add_argument("--telemetry-path", type=Path, required=True)
|
||||
parser.add_argument("--run-id", required=True)
|
||||
parser.add_argument("--request-id", required=True)
|
||||
return parser
|
||||
|
||||
|
||||
def main() -> int:
|
||||
args = _parser().parse_args()
|
||||
repository_root = Path(__file__).resolve().parents[1]
|
||||
evidence = LaboratoryEvidenceRegistry.from_directory(
|
||||
repository_root / "config" / "laboratories"
|
||||
)
|
||||
execution = LaboratoryExecutionRegistry.from_file(
|
||||
repository_root / "config" / "laboratory-execution.json",
|
||||
evidence,
|
||||
)
|
||||
runner = LaboratoryRunner(
|
||||
registry=execution,
|
||||
evidence_registry=evidence,
|
||||
sink=JsonlPipelineTelemetrySink(args.telemetry_path),
|
||||
)
|
||||
pack_id = args.pack_root.name
|
||||
result = runner.run(
|
||||
LaboratoryRunRequest(
|
||||
work_id="m48-small-static-passage-regression",
|
||||
run_id=args.run_id,
|
||||
request_id=args.request_id,
|
||||
contour_id="mission-core-laboratory",
|
||||
agent_id="local-control-plane",
|
||||
node_id=socket.gethostname(),
|
||||
source_id="RAVNOVES00",
|
||||
source_package_id=pack_id,
|
||||
method_id="m48-small-static-passage-regression/v1",
|
||||
inputs={
|
||||
"pack_root": args.pack_root,
|
||||
"correction_session_path": args.correction_session,
|
||||
"profile_path": args.profile,
|
||||
},
|
||||
output_root=args.output_root,
|
||||
receipt_root=args.receipt_root,
|
||||
)
|
||||
)
|
||||
print(json.dumps({
|
||||
"result_id": result.result_id,
|
||||
"result_root": str(result.result_root),
|
||||
"receipt_id": result.receipt_id,
|
||||
"receipt_root": str(result.receipt_root),
|
||||
}, ensure_ascii=False, sort_keys=True))
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user