File size: 1,657 Bytes
1d842e3 baa1d92 1d842e3 baa1d92 1d842e3 baa1d92 1d842e3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #!/usr/bin/env python3
"""Run TELEN L3 initial training only after every frozen gate passes."""
from __future__ import annotations
import argparse
import json
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(REPO_ROOT / "src"))
from telen.experiment import ( # noqa: E402
BundleValidationError,
GateAuthorizationError,
run_l3_development_pilot,
)
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(
description=(
"Train the predeclared three-seed L3 development pilot. The command "
"fails closed unless expert and base-score receipts authorize every "
"hash-frozen input; test rows are rejected."
)
)
parser.add_argument("--manifest", type=Path, required=True)
parser.add_argument("--output-dir", type=Path, required=True)
parser.add_argument("--device", default="cpu")
return parser.parse_args()
def main() -> None:
args = parse_args()
try:
result = run_l3_development_pilot(
args.manifest, args.output_dir, device=args.device
)
except (GateAuthorizationError, BundleValidationError) as exc:
print(
json.dumps(
{
"artifact_type": "telen_l3_training_refusal",
"authorized": False,
"reason": str(exc),
},
ensure_ascii=False,
indent=2,
)
)
raise SystemExit(2) from exc
print(json.dumps(result, ensure_ascii=False, indent=2))
if __name__ == "__main__":
main()
|