2026-05-24 13:21:58 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
"""Start an Owen Graphite task with WIKI routing and optional evidence scaffold."""
|
|
|
|
|
|
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
|
import subprocess
|
|
|
|
|
import sys
|
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
2026-05-25 00:15:24 +00:00
|
|
|
from route_registry import route_names
|
|
|
|
|
|
2026-05-24 13:21:58 +00:00
|
|
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
|
|
|
PYTHON = sys.executable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def run(args: list[str]) -> None:
|
|
|
|
|
subprocess.run([PYTHON, *args], cwd=ROOT, check=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def main() -> int:
|
|
|
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
2026-05-25 00:15:24 +00:00
|
|
|
parser.add_argument("--surface", required=True, choices=route_names(), help="Surface for wiki_route.py, e.g. table, chrome, plugin.")
|
2026-05-24 13:21:58 +00:00
|
|
|
parser.add_argument("--name", default="", help="Short task/evidence name.")
|
|
|
|
|
parser.add_argument("--state", default="", help="Runtime state when evidence is needed.")
|
|
|
|
|
parser.add_argument("--evidence", action="store_true", help="Create runtime evidence scaffold.")
|
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
|
|
print("== WIKI route ==")
|
|
|
|
|
run(["dev/scripts/wiki_route.py", args.surface])
|
2026-05-24 18:31:18 +00:00
|
|
|
print("\n== Surface check commands ==")
|
|
|
|
|
run(["dev/scripts/wiki_route.py", args.surface, "--commands"])
|
2026-05-24 13:21:58 +00:00
|
|
|
print("\n== Validation plan ==")
|
2026-05-25 00:15:24 +00:00
|
|
|
run(["dev/scripts/validation_plan.py", "--surface", args.surface])
|
2026-05-24 13:21:58 +00:00
|
|
|
if args.evidence:
|
|
|
|
|
if not args.name:
|
|
|
|
|
raise SystemExit("--name is required with --evidence")
|
|
|
|
|
print("\n== Runtime evidence scaffold ==")
|
|
|
|
|
command = ["dev/scripts/new_runtime_evidence.py", "--surface", args.surface, "--name", args.name]
|
|
|
|
|
if args.state:
|
|
|
|
|
command.extend(["--state", args.state])
|
|
|
|
|
run(command)
|
|
|
|
|
return 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
raise SystemExit(main())
|