9fe9d27865
Consolidate next-stage docs, archive superseded narratives, and preserve frozen document inputs. Retain invalid P2 pairs, partial RootXY training, failed attempts and nonselectable checkpoints as explicit limitations. Include supervised evaluation/training, desktop GPU admission, bounded evidence and atomic-publication monitor repairs with CPU regressions. Ignore local dotenv configuration. Validation: 1403 passed, 6 skipped for contact-cycle and related contracts/CLI tests. Full-suite legacy ABI and registration tests require Python 3.12/Torch 2.10/pxr; no runtime checks relaxed. No new physical run or accepted skill.
81 lines
3.8 KiB
Python
81 lines
3.8 KiB
Python
#!/usr/bin/env python3
|
|
"""RootXY-v2 dedicated supervised adapter; no mode authorizes itself.
|
|
|
|
--check-only/--plan are read-only CPU operations. --prepare is separately granted
|
|
Kit config-only preparation (zero environments/physics). --run requires exact
|
|
preparation plus new parent grant and approved P2 decision. Neither runs by default.
|
|
"""
|
|
import argparse
|
|
import importlib
|
|
import importlib.util
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
def cpu_protocol():
|
|
# Real file-backed private CPU namespace, not fake SkillFactory registration.
|
|
# Never reuse this namespace for runtime binding or simulator construction.
|
|
name = "_rootxy_cpu_legs"
|
|
if name not in sys.modules:
|
|
spec = importlib.util.spec_from_file_location(
|
|
name, ROOT / "source/SkillFactory/SkillFactory/legs/__init__.py",
|
|
submodule_search_locations=[str(ROOT / "source/SkillFactory/SkillFactory/legs")])
|
|
module = importlib.util.module_from_spec(spec)
|
|
sys.modules[name] = module
|
|
spec.loader.exec_module(module)
|
|
return importlib.import_module(name + ".contact_cycle_sim.rootxy_training_v2")
|
|
|
|
|
|
def main(argv=None):
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
mode = parser.add_mutually_exclusive_group(required=True)
|
|
mode.add_argument("--check-only", action="store_true")
|
|
mode.add_argument("--plan", action="store_true")
|
|
mode.add_argument("--_worker-fd", type=int, help=argparse.SUPPRESS)
|
|
mode.add_argument("--prepare", action="store_true")
|
|
mode.add_argument("--run", action="store_true")
|
|
parser.add_argument("--config", type=Path, default=ROOT / "configs/contact_cycle/sim_training_rootxy_v2.json")
|
|
parser.add_argument("--output", type=Path)
|
|
parser.add_argument("--authorization", type=Path)
|
|
parser.add_argument("--trusted-authorization-sha256")
|
|
parser.add_argument("--manifest", type=Path)
|
|
parser.add_argument("--trusted-manifest-sha256")
|
|
parser.add_argument("--storage-policy", type=Path)
|
|
parser.add_argument("--trusted-storage-policy-sha256")
|
|
parser.add_argument("--p2-decision", type=Path)
|
|
args = parser.parse_args(argv)
|
|
if args._worker_fd is not None:
|
|
import rootxy_launch_v2 as adapter
|
|
return adapter.run_worker(args._worker_fd)
|
|
if args.run or args.prepare:
|
|
if args.output is None or any(getattr(args, k) is None for k in (
|
|
'authorization', 'trusted_authorization_sha256', 'manifest', 'trusted_manifest_sha256',
|
|
'storage_policy', 'trusted_storage_policy_sha256')) or args.run and args.p2_decision is None:
|
|
raise PermissionError('RootXY-v2 admission INCOMPLETE: exact new manifest/preparation/native policy/'
|
|
'parent grant and RUN P2 decision required; no launch authorized')
|
|
if args.config.resolve() != ROOT / 'configs/contact_cycle/sim_training_rootxy_v2.json':
|
|
raise ValueError('Fixed RootXY config required')
|
|
import rootxy_launch_v2 as adapter
|
|
return adapter.supervise(args)
|
|
if args.authorization is not None:
|
|
parser.error("CPU checks/preparation never accept launch authorization")
|
|
if args.output is not None:
|
|
parser.error('CPU check/plan writes no output')
|
|
protocol = cpu_protocol()
|
|
manifest = protocol.make_manifest(ROOT, args.config)
|
|
if args.plan:
|
|
print(json.dumps(manifest, sort_keys=True, separators=(',', ':'), allow_nan=False))
|
|
else:
|
|
print(json.dumps({'checked': True, 'prepared': False, 'authorized': False,
|
|
'launch_integration_complete': True, 'runtime_qualified': False,
|
|
'manifest_sha256': protocol.digest(manifest),
|
|
'task_id': protocol.TASK_ID, 'accepted_skill': False}))
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|