#!/usr/bin/env python3 """Validate and describe the next authoritative Blender/WBV2 cycle. Task claiming and handoff are intentionally owned by the repository's Node scheduler. This helper never invents a successor or edits queue metadata. """ from __future__ import annotations import argparse import subprocess from wbv2_runtime import ROOT, queue_pointer, terminal_pointer def main() -> int: parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--dry-run", action="store_true", help="only print the current pointer") args = parser.parse_args() pointer = queue_pointer() task = pointer.get("task") if not task: print("WBV2 TASK CYCLE BLOCKED: queue has no current task") return 2 if terminal_pointer(pointer): print(f"WBV2 TASK CYCLE TERMINAL: task={task}; task-index has no active successor") return 0 if args.dry_run: print(f"WBV2 TASK CYCLE CURRENT: task={task}; parent={pointer.get('parentManifest')}") return 0 result = subprocess.run(["node", "tools/web/check-task-context.mjs"], cwd=ROOT, text=True, capture_output=True, check=False) output = result.stdout or result.stderr if output: print(output, end="" if output.endswith("\n") else "\n") if result.returncode != 0: return result.returncode print(f"WBV2 TASK CYCLE READY: task={task}; run tools/web/run-wbv2-scheduler.mjs to execute") return 0 if __name__ == "__main__": raise SystemExit(main())