"""Capture beat driver — drive the live app through the demo beats deterministically. This does NOT record video itself. Use it alongside Cap desktop, or point scripts.record.py at an existing Chrome CDP endpoint. The script walks the UI slowly with deliberate pauses while YOU (or cap-cli) capture the screen. The UI tabs are LOAD · SLICE · PRINT · REVIEW. Selectors prefer stable IDs over visible text wherever possible, so renames are less likely to break this script than the previous text-only version. One-time setup (local; not a Space/runtime dep): uv pip install playwright && uv run playwright install chromium Run the app first in another terminal: make run # http://localhost:7860 (pre-warm one analyze!) Then walk the beats (headed browser; record it with Cap): uv run python -m scripts.capture --beat all uv run python -m scripts.capture --beat 3 # load-bearing beat uv run python -m scripts.capture --beat benchy # LOAD + Benchy quick-load uv run python -m scripts.capture --beat loop # the learning loop Options: --url Space or local URL (default: https://node.microfactory.space) --slowmo ms between Playwright actions (default 350) --pause seconds between beats (default 1.5) --headless hide the browser (no recording) """ from __future__ import annotations import argparse import sys import time def _pill(page, value): """Click an LCARS pill. CSS uppercases the text, but the DOM keeps the raw value (part types are lowercase; materials are uppercase). Match the