| |
| """Run one fresh HEADQUOTIENT Q25 audit, selection, and adaptation campaign.""" |
|
|
| from __future__ import annotations |
|
|
| import argparse |
| import json |
| from pathlib import Path |
| import subprocess |
| import sys |
|
|
|
|
| ROOT = Path(__file__).resolve().parents[1] |
|
|
|
|
| def parse_args() -> argparse.Namespace: |
| parser = argparse.ArgumentParser(description=__doc__) |
| parser.add_argument("--config", type=Path, required=True) |
| parser.add_argument("--device", required=True) |
| parser.add_argument( |
| "--direct-q25", |
| action="store_true", |
| help="After a fresh audit, solve and evaluate only the registered Q25 point.", |
| ) |
| return parser.parse_args() |
|
|
|
|
| def run(*parts: str) -> None: |
| command = [sys.executable, *parts] |
| print(json.dumps({"running": command}), flush=True) |
| subprocess.run(command, cwd=ROOT, check=True) |
|
|
|
|
| def main() -> None: |
| args = parse_args() |
| config = args.config.resolve() |
| run("scripts/register_strata_headquotient_v1_1.py", "--config", str(config)) |
| run("scripts/evaluate_strata_headquotient_v1_1_hq0.py", "--config", str(config), "--device", args.device) |
| run("scripts/train_strata_headquotient_v1_1_scoped.py", "--config", str(config), "--device", args.device) |
| run("scripts/audit_strata_headquotient_v1_1_interactions.py", "--config", str(config), "--device", args.device) |
| frontiers = ("Q25",) if args.direct_q25 else ("Q10", "Q20", "Q25") |
| for frontier in frontiers: |
| selection = [ |
| "scripts/select_strata_headquotient_v1_1_groups.py", frontier, |
| "--config", str(config), |
| ] |
| if args.direct_q25: |
| selection.append("--allow-direct-replication") |
| run(*selection) |
| run("scripts/run_strata_headquotient_v1_1_frontier.py", frontier, "--phase", "diagnostic", "--config", str(config), "--device", args.device) |
| run("scripts/run_strata_headquotient_v1_1_frontier.py", frontier, "--phase", "confirmation", "--config", str(config), "--device", args.device) |
|
|
|
|
| if __name__ == "__main__": |
| main() |
|
|