From e19c6b72de114d00538b7b6ac5186ae1be999cb5 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 14:04:26 -0700 Subject: docs: specify proof movie OS compatibility --- ...26-09-09-proof-movie-os-compatibility-design.md | 390 +++++++++++++++++++++ 1 file changed, 390 insertions(+) create mode 100644 docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md (limited to 'docs') diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md new file mode 100644 index 0000000..6e864af --- /dev/null +++ b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md @@ -0,0 +1,390 @@ +# Proof movie OS compatibility + +**Date:** 2026-09-09 + +**Status:** Draft for Drew review + +**Scope:** Platform compatibility for the movie skill proposed in [PR #2214](https://github.com/obra/superpowers/pull/2214). Implementation depends on that import or its final equivalent. + +## Goal and agreed direction + +The movie skill must cover the same OS families and execution environments as +Superpowers' visual brainstorming companion: macOS, Linux, native Windows, WSL, +and headless or remote operation. Windows users must be able to launch the movie +pipeline from PowerShell or Git Bash and record either shell. Native Windows +must not require WSL; the PowerShell movie workflow must not require Git Bash. + +An agent should be able to record real software, assemble a narrated and +subtitled movie, inspect it, and apply the same verification criteria on every +supported environment. Native terminal recording is part of the initial scope. + +Compatibility means equivalent outcomes, documented prerequisites, and tested +behavior. Capture methods can differ by OS and available display facilities. + +## Evidence and baseline + +This design uses local Superpowers commit `3a8bdc11` and PR #2214 head +`f6617db1517488d4a8b66925519d5ffbeef965b3` as its inspected baselines. + +The companion's current implementation establishes these distinctions: + +- [Browser launch](../../../skills/brainstorming/scripts/server.cjs) handles + macOS, native Windows, WSL, Linux with a display, and Linux without a display. +- [Launch instructions](../../../skills/brainstorming/visual-companion.md) + accommodate PowerShell tools by invoking Git Bash's `bash.exe`. The companion + itself has a Bash launcher; this is not evidence of a separate PowerShell + implementation or of operation without Git Bash. +- [Process startup](../../../skills/brainstorming/scripts/start-server.sh) + accounts for foreground execution and Windows/MSYS PID incompatibility. +- [Windows lifecycle tests](../../../tests/brainstorm-server/windows-lifecycle.test.sh) + exercise Git Bash behavior. [Browser launcher tests](../../../tests/brainstorm-server/browser-launcher.test.js) + cover Windows, WSL, and headless Linux decisions, including treating URLs as + arguments rather than shell commands. + +These sources identify the required OS families. They do not establish an +exhaustive promise covering every OS release, CPU architecture, Linux +distribution, or desktop capture backend. + +For the imported movie skill, all three shell regression suites were run on +macOS during this investigation: assembly 4/4, checker 9/9, narration drift 5/5. +These 18 assertions do not test actual speech generation, title-card rendering, +subtitle burning, or Windows execution. No Windows support is established by +those results. + +Concrete compatibility gaps in the inspected import include Unix-only command +examples, a tmux-dependent terminal recipe, macOS-only desktop capture examples, +FFmpeg glob-dependent frame input, missing Windows browser discovery, and a +hand-built file URL that misencodes a Windows path. `burn-subtitles` also uses +only the subtitle basename without setting the working directory described in +its comment. + +## Support contract + +| Execution environment | Shells used to launch tools | Required movie routes | Desktop capture behavior | +| --- | --- | --- | --- | +| macOS | zsh and Bash | Browser motion, terminal, stills, real-run logs, full processing pipeline | Use available macOS capture with permission; inspect a sample before recording | +| Linux desktop | Bash; commands use portable POSIX syntax where applicable | Same routes and pipeline | Use an available capture backend for the active display; distinguish X11 from Wayland | +| Linux headless, container, or remote session | Bash | Headless browser and terminal capture, stills, logs, full processing pipeline | Detect absent display/capture access and choose a route that can prove the claim | +| Native Windows | Windows PowerShell 5.1, PowerShell 7, Git Bash | Same routes and pipeline; record native PowerShell and Git Bash sessions | Use a verified native capture backend, initially FFmpeg `gdigrab`, when a desktop is accessible | +| WSL | Linux shell using Linux tools | Same Linux routes and pipeline | WSL capture is scoped to its available display; Windows host desktop capture is a separate native Windows operation | + +PowerShell 5.1 and 7 are separate invocation tests. Git Bash is a Windows shell +environment, not a synonym for WSL. Git Bash must invoke native Windows Python +and FFmpeg for its native Windows tests. WSL tests must invoke Linux tools. + +Keep OS detection, launch-shell detection, recorded-shell selection, and display +capability separate. A PowerShell launcher may record Git Bash and vice versa. +Do not infer the recorded shell from the shell running the pipeline. + +Do not introduce a Windows 11-only restriction solely because a test machine +runs Windows 11. Record exact OS, architecture, interpreter, browser, and tool +versions in validation results. Native terminal capture requires a compatible +Windows console API; ttyd documents ConPTY builds for Windows 10 1809 or later. +Other route prerequisites may set their own minimum versions. + +Architecture compatibility is also a dependency check: do not assume that a +Python script or a Windows x64 wheel proves native ARM64 support. Required +validation starts with macOS arm64 and x64, Linux x64, and native Windows x64, +plus WSL on Windows. Record Linux arm64 and Windows arm64 dependency availability +and execution evidence before listing those combinations as verified. A missing +wheel is a reported route limitation, not an excuse to claim OS parity or +silently substitute a paid service. + +## Approach and alternatives + +Use the existing five Python tools as one shared pipeline, with small local +helpers where platform handling is reused. Keep shell differences in invocation +examples and adapters for recording real commands. Keep capture differences in +route documentation and its executable examples. + +This preserves the scene file, narration manifest, offsets, subtitles, movie, +and checker output across operating systems. It also limits changes to the +skill being imported; no companion rewrite is required. + +Two alternatives were considered: + +- **Route all Windows work through WSL or Git Bash.** This does not satisfy the + agreed native PowerShell workflow, and WSL cannot stand in for recording a + native Windows terminal or application. +- **Maintain separate PowerShell and Bash pipelines.** This duplicates timing, + subtitles, and verification behavior and makes platform drift likely. Both + shells can invoke the same Python scripts explicitly. + +## Shared pipeline + +### Invocation and dependencies + +Document `uv run --script` for all five extensionless tools. Retain existing +Unix shebang execution for compatibility. Examples set the skill directory using +the location supplied by the harness, rather than a Claude-specific install path. + +```powershell +$SkillDir = 'C:\path to plugin\skills\proving-it-works-with-a-movie' +uv run --script "$SkillDir/scripts/assemble" scenes.yaml silent-cut.mp4 +if ($LASTEXITCODE -ne 0) { throw 'Movie assembly failed' } +``` + +```bash +SKILL_DIR='/path to plugin/skills/proving-it-works-with-a-movie' +uv run --script "$SKILL_DIR/scripts/assemble" scenes.yaml silent-cut.mp4 || exit "$?" +``` + +PowerShell recipes must work under 5.1 without relying on PowerShell 7-only +operators. Bash syntax must be identified as Bash when it is not POSIX syntax. +All examples must preserve failure status across pipelines and logging. + +Before a long recording, check prerequisites for the selected route: `uv`, a +compatible Python, FFmpeg/ffprobe and required codecs/filters, the chosen +browser, ttyd for terminal capture, and local narration/transcription packages +when requested. Check capabilities, not merely executable presence. Report +the missing capability and an appropriate install or alternate-route action. +There is no need for a new global installer or plugin-startup dependency check. + +Use the tools already involved in the proposed import. Do not introduce a new +recording service, TTS service, global Node dependency, or Windows-only package +manager requirement. The import's dependency-policy exception remains a +maintainer decision associated with PR #2214; this spec does not grant one. + +### Paths, encoding, and process arguments + +- Resolve assets relative to the scene file and generated assets relative to + the selected work directory. Preserve existing explicit output-path semantics. +- Use `Path.resolve().as_uri()` for browser file URLs. Browser discovery honors + `--browser`, then checks platform installations and PATH, including Chrome and + Edge on Windows and Chrome/Chromium on macOS and Linux. +- Use explicit UTF-8 for YAML, JSON, HTML, SRT, concat lists, and text evidence. + Accept ordinary LF and CRLF text inputs and diagnose unreadable encodings. +- Pass external executable arguments as arrays. Avoid shell command strings for + FFmpeg, browsers, or opening an artifact. User-requested shell commands belong + only in the selected recorded shell. +- Keep MSYS path conversion at the launch boundary. Do not translate the same + path twice or feed Bash pseudo-PIDs to native Windows process APIs. +- Support spaces, apostrophes, Unicode, and shell metacharacters in valid local + paths. Exercise nested subtitle directories and work directories outside the + current directory. Avoid requiring symlink privileges or POSIX tools such as + `mktemp`, `shasum`, and `kill` for the PowerShell pipeline. + +### Frame assembly and subtitles + +Expand and sort frame filenames in Python. Feed FFmpeg a deterministic numbered +sequence staged in the work directory, using ordinary files without requiring +symlinks. Preserve the existing lexical ordering and frame rate. This replaces +the dependency on FFmpeg's optional glob support. Clean only staging files owned +by the current build and preserve source screenshots. + +Write concat entries with FFmpeg-specific escaping and test native Windows +drive paths. File list syntax and filter syntax are separate from shell quoting. +Preserve the segment rule `max(narration duration, visual duration)` and measured +offsets; the port must not change timing or drop frames. + +For subtitle burning, stage the SRT under a safe fixed basename in a temporary +directory and execute FFmpeg from that directory, with resolved input/output +paths. This avoids interpolating user filenames into the subtitle filter. +Clean staging on both success and failure. Verify the selected font actually +renders the sample text, using available platform fonts rather than assuming +DejaVu is installed everywhere. + +Preserve the documented soft-subtitle fallback, with an accurate explanation of +why burning was unavailable. A burn failure with libass present must report the +actual failure rather than claim libass is missing. Full-platform acceptance +requires proving the hard-subtitle path with a capable FFmpeg build; a successful +soft fallback alone is insufficient. Continue shipping the SRT alongside the +movie for the existing checker contract. + +### Narration and verification + +Keep local Piper narration and local transcription available without a cloud +key on the verified support combinations. First-run model downloads must be +distinguished from subsequent offline operation. Check actual synthesis and +transcription, including subprocess interpreter selection and Unicode handling. + +Do not make cloud credentials a Windows requirement. A missing local ASR must +remain visible in output and cannot count as a verified narration acceptance +run, even where the existing script permits a skip. + +Preserve the existing verification thresholds, contact-sheet inspection, +subtitle checks, and requirement to compare rendered speech with its script. +Platform compatibility is not a reason to weaken a gate. Existing general +checker limitations remain limitations; redesigning its heuristics is outside +this work. + +## Recording routes + +### Browser and stills + +Keep browser-driven recording as the common motion route. Select a compatible +browser explicitly or through discovery, use an isolated profile, preflight a +real screenshot, and retain cursor overlays and measured narration pacing. +Headless recording must work without opening a desktop browser. Distinguish +Playwright's own recording encoder, when that route is used, from system FFmpeg. + +Use available harness browser automation or the documented recorder's browser +connection. The compatibility work does not create a new browser automation +framework. Navigation races must have bounded capture timeouts. Unexpected blank +output or stalled capture must not silently produce a successful recording; +intentional blank transition beats remain valid evidence. + +### Terminal and TUI + +Keep the existing ttyd/tmux route for Unix environments. Add a native Windows +route using ttyd's Windows console support and an explicitly selected PowerShell +or Git Bash executable. Native Windows must not require tmux, Docker, or WSL. + +Drive the native terminal through browser keyboard input into the live ttyd +terminal. Provide an executable example inside the skill with explicit shell +selection, viewport, output location, and a short real command sequence. The +existing `examples/film-terminal.py` reference points outside the imported +files; replace it with an included, tested example or a correct included-file +reference. The standalone example is specific to a Docker/tmux demo and must +not be presented as a working native Windows recorder unchanged. + +Command completion is a shell adapter responsibility. For scripted shell beats, +install a session-local completion marker containing a sequence identifier and +the real exit status, emitted only after the command returns. Observe the +terminal output stream, not OCR or guessed sleeps, for that marker, and distinguish +actual marker output from echoed command text. Keep instrumentation in the +recorded session; do not edit the human partner's shell profiles. Treat a failed +command as failed evidence even when logging succeeds. Preserve the shell's +normal semantics and record the exact command. + +For interactive TUI beats, use explicit application state and key actions; do +not send another shell command while the TUI still owns input. Unknown state or +a completion timeout stops the take with a diagnostic. Validate delayed commands, +nonzero exits, an interactive TUI, resizing, and non-ASCII output in both recorded +Windows shells. + +A recording session owns one terminal for the duration of its takes. Stopping a +take pauses capture without killing a long-running command; the same browser +connection and shell persist until the recording session ends. Browser +disconnect/reconnect persistence is not assumed. If the connection is lost and +the shell cannot be proven to survive, mark the take interrupted and report it. + +### Desktop capture and real-run logs + +Document device/capability selection per OS: macOS capture, native Windows +`gdigrab`, and supported Linux display capture. Detect the active display and +available FFmpeg devices before selecting a command. On Wayland, do not apply an +X11 recipe by default; use an available permission-aware capture route or switch +to browser/terminal recording. This work does not promise universal desktop +capture on every compositor or remote-session configuration. + +Preflight by recording a short sample and examining its actual pixels. Permission +denial, blank capture, an unavailable remote desktop, or missing display must +produce an explicit route decision. A log reel can prove a real command run; it +cannot substitute for pixels when the claim is specifically native GUI behavior. +If the required claim cannot be captured, report it as unproven. + +Provide Bash and PowerShell real-run log recipes that retain the command's exit +status, timestamps, and actual output. Use standard-library Python hashing or +equivalent native commands for evidence bundles. Retain source logs beside the +derived movie. Windows PowerShell 5.1 output encoding must be tested explicitly. + +## Lifecycle and remote behavior + +Match the companion's lifecycle principles without copying its Bash launcher: +run recorders under the harness's persistent/background execution mechanism, +report readiness after the real browser/terminal is reachable, and preserve the +session between agent tool calls. Avoid assuming detached `nohup` processes +survive in a Windows or managed-harness environment. + +Own browser profiles, ports, temporary assets, and child process handles per +recording session. Bind terminal and debugging endpoints to loopback by default. +Readiness and command waits have explicit timeouts. On finish, interrupt, or +failure, stop and wait for owned processes and release resources; do not kill by +generic executable name or unverified stale PID. Ordinary users must be able to +run the workflow without elevated privileges. + +Use the same distinction as the companion between a renderer and opening a +browser for the human partner. If a recorder needs to open a URL, use the OS +launcher with separate arguments; on WSL, Windows URL opening is a convenience, +not permission to pass Linux filesystem paths to Windows executables. With no +display, report the artifact path/URL and continue headless processing. Remote +browser access uses an explicit, documented access mechanism; remote deployment +or a new public tunnel service is outside scope. + +## Implementation boundaries + +Expected files are the five scripts under +`skills/proving-it-works-with-a-movie/scripts/`, small shared helpers if needed, +the skill's route documents, an included terminal recording example, and tests +under `tests/proving-it-works-with-a-movie/`. Add a focused platform support +reference and link it from `SKILL.md` rather than making every route repeat the +whole compatibility matrix. + +Preserve scene kinds, manifest fields, offsets, CLI arguments, and output artifact +formats. Keep macOS and Linux entry points working. Do not bundle changes to +plugin hooks, the visual companion, unrelated skills, standalone-repo retirement, +or the movie checker's general behavior. No new harness integration is proposed. + +Add a portable Python integration suite for the shared behavior. Shell launch +tests should be thin wrappers over the same fixtures and assertions. Preserve +existing regression coverage; replacing a Bash test requires equivalent coverage +in the portable suite. The suite must be runnable locally and on OS runners +without depending on a particular CI provider. + +## Acceptance and evidence + +| Area | Required proof | +| --- | --- | +| OS coverage | Actual runs on macOS, Linux, native Windows, and WSL; record exact environments and distinguish architecture coverage | +| Launch shells | Bash and zsh on macOS, Bash on Linux/WSL, Windows PowerShell 5.1, PowerShell 7, and Git Bash on native Windows | +| Shared pipeline | All scene kinds; measured scene offsets; hard and soft subtitles; checker verdicts and contact sheets | +| Paths | Spaces, apostrophes, Unicode, metacharacters, Windows drive paths, relative/absolute work directories, nested SRT files, LF/CRLF | +| Windows terminal | Both recorded shells; at least one crossed launch/record-shell combination; delayed command, failed command, TUI input, and retained session between takes | +| Native independence | PowerShell movie tools run with Git Bash and WSL unavailable to them; Git Bash native tests use Windows binaries | +| Local voice | Real no-key Piper synthesis and local ASR on macOS, Linux, and native Windows; repeat with cached models and network disabled | +| Capture failure | Blank frame, missing display, permission refusal, browser loss, and timeout produce accurate outcomes and no fabricated proof | +| Lifecycle | Survives a harness turn boundary; bounded shutdown after success, error, and interruption; unrelated sentinel process survives cleanup | +| Evidence integrity | Failed command remains failed through logging; missing required speech verification is reported; rendered content matches real actions | + +The end-to-end fixture includes a small real browser app with a persistent state +change and a terminal sequence that prints Unicode, runs a delayed command, and +returns a nonzero status. Capture those actions, generate real local narration, +assemble title/image/frame/movie scenes, burn subtitles, run the checker, and +inspect the finished output. Include a terminal TUI take and an unnarrated +log-reel case. An intentionally failing command may be part of a successful +recording test: its logged status and narration must accurately show that failure. +Use synthetic clips for deterministic negative checker tests, clearly identified +as test fixtures. + +Run the end-to-end pipeline from both Windows shell families. Cover PowerShell +5.1 and 7 with real launch tests; test the OS pipeline with actual executables, +not only mocked `sys.platform`. Optional display-specific tests may be skipped +only with a recorded reason and a separate result for the fallback route. A +missing prerequisite in a required acceptance job is a failure of that job's +setup, not a green compatibility result. + +Skill instruction changes require `superpowers:writing-skills` and before/after +pressure testing across multiple agent sessions. Scenarios include a PowerShell +harness, a Git Bash harness, no cloud key, a path containing spaces, missing +libass, and headless/blocked capture. Check that agents select valid commands, +keep failures visible, and inspect the artifact. Store evals and transcripts in +the project's external eval repository; it is absent from this checkout, so +record its actual path and commit rather than assuming `evals/` is present. + +Evidence records must include OS/architecture, shell, Python/uv, FFmpeg build, +browser, TTS/ASR versions, harness/model, command, return code, and artifact or +transcript location. Generated media need not be committed to core, but the +fixture and reproduction commands must be retained. + +The design is ready for implementation after review. Compatibility is complete +only when the required matrix has evidence, the updated skill has behavior evals, +and the support documentation accurately distinguishes verified combinations +from dependency or display limitations. + +## External references + +- [uv explicit script invocation](https://docs.astral.sh/uv/reference/cli/#uv-run--script) + supports extensionless Python scripts. +- [uv platform policy](https://docs.astral.sh/uv/reference/policies/platforms/) + distinguishes tested platforms from build-only support; it is not a substitute + for validating the rest of the movie toolchain. +- [FFmpeg image input](https://ffmpeg.org/ffmpeg-formats.html#image2) + documents that glob input depends on build support. +- [FFmpeg Windows desktop capture](https://ffmpeg.org/ffmpeg-devices.html#gdigrab) + documents desktop, region, and window capture. +- [ttyd Windows builds](https://github.com/tsl0922/ttyd/wiki/Compile-on-Windows) + document native ConPTY support and its OS requirement. +- [Piper package files](https://pypi.org/project/piper-tts/#files) + include Windows x64 builds; package availability alone is not a completed + synthesis or transcription test. -- cgit From 62eab78d6605a3cde1a7d7e32fad078c8b2f0e12 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 14:14:57 -0700 Subject: docs: resolve adversarial review of movie compatibility spec --- ...26-09-09-proof-movie-os-compatibility-design.md | 181 +++++++++++++++++++-- ...26-09-09-proof-movie-os-compatibility-review.md | 73 +++++++++ 2 files changed, 238 insertions(+), 16 deletions(-) create mode 100644 docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md (limited to 'docs') diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md index 6e864af..065f8ad 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md @@ -2,7 +2,7 @@ **Date:** 2026-09-09 -**Status:** Draft for Drew review +**Status:** Adversarial review complete; ready for implementation planning **Scope:** Platform compatibility for the movie skill proposed in [PR #2214](https://github.com/obra/superpowers/pull/2214). Implementation depends on that import or its final equivalent. @@ -45,6 +45,9 @@ These sources identify the required OS families. They do not establish an exhaustive promise covering every OS release, CPU architecture, Linux distribution, or desktop capture backend. +An independent review of the platform contract and terminal design is recorded +in the [adversarial review](2026-09-09-proof-movie-os-compatibility-review.md). + For the imported movie skill, all three shell regression suites were run on macOS during this investigation: assembly 4/4, checker 9/9, narration drift 5/5. These 18 assertions do not test actual speech generation, title-card rendering, @@ -145,6 +148,14 @@ recording service, TTS service, global Node dependency, or Windows-only package manager requirement. The import's dependency-policy exception remains a maintainer decision associated with PR #2214; this spec does not grant one. +Nested helper invocations must also be independent of the project being filmed. +In particular, launch the local ASR environment with uv project discovery disabled +(`--no-project`) and a compatible interpreter selected by uv. The current nested +`uv run --with faster-whisper ...` can otherwise inherit an unrelated +`pyproject.toml`. A fixture with an incompatible project Python requirement must +not change the helper's resolution, modify the project's environment/lockfile, +or turn an available ASR into a reported dependency failure. + ### Paths, encoding, and process arguments - Resolve assets relative to the scene file and generated assets relative to @@ -154,6 +165,11 @@ maintainer decision associated with PR #2214; this spec does not grant one. Edge on Windows and Chrome/Chromium on macOS and Linux. - Use explicit UTF-8 for YAML, JSON, HTML, SRT, concat lists, and text evidence. Accept ordinary LF and CRLF text inputs and diagnose unreadable encodings. + Give owned Python helper pipes an explicit UTF-8 contract as well. Preserve + raw output from recorded external commands and record the encoding used to + decode it; do not assume every native Windows program emits UTF-8 or silently + replace undecodable evidence. Test redirected output under a non-UTF-8 Windows + console/code-page configuration. - Pass external executable arguments as arrays. Avoid shell command strings for FFmpeg, browsers, or opening an artifact. User-requested shell commands belong only in the selected recorded shell. @@ -174,8 +190,10 @@ by the current build and preserve source screenshots. Write concat entries with FFmpeg-specific escaping and test native Windows drive paths. File list syntax and filter syntax are separate from shell quoting. -Preserve the segment rule `max(narration duration, visual duration)` and measured -offsets; the port must not change timing or drop frames. +Preserve measured offsets and the existing timing rules: `card`, `image`, and +`frames` segments use `max(narration duration, visual duration)`; `movie` segments +retain the source movie's duration and own audio. The port must not change timing +or drop frames. For subtitle burning, stage the SRT under a safe fixed basename in a temporary directory and execute FFmpeg from that directory, with resolved input/output @@ -238,14 +256,63 @@ files; replace it with an included, tested example or a correct included-file reference. The standalone example is specific to a Docker/tmux demo and must not be presented as a working native Windows recorder unchanged. -Command completion is a shell adapter responsibility. For scripted shell beats, -install a session-local completion marker containing a sequence identifier and -the real exit status, emitted only after the command returns. Observe the -terminal output stream, not OCR or guessed sleeps, for that marker, and distinguish -actual marker output from echoed command text. Keep instrumentation in the -recorded session; do not edit the human partner's shell profiles. Treat a failed -command as failed evidence even when logging succeeds. Preserve the shell's -normal semantics and record the exact command. +One persistent Python supervisor owns the browser/CDP page, capture state, and +terminal session. Start ttyd in writable mode and allow one terminal client. +Subscribe through CDP to the existing page's ttyd WebSocket events before that +page connects. Decode ttyd's output-message framing and incrementally parse +output across message boundaries. A second CDP connection may observe that page; +a second ttyd WebSocket must not be opened, because ttyd creates another shell +for another terminal client. The browser input, command observer, and recorded +pixels must all refer to the same session. + +For the reference recorder, later harness calls submit ordered JSON control +files to a session-owned directory. A request has a unique monotonically +increasing id and an operation (`run`, `key`, `begin-take`, `end-take`, or `close`). +Write requests atomically; the supervisor dispatches them in order and writes +matching acknowledgments and eventual results. A `run` acknowledgment does not +wait for the command to finish: the command remains in flight while capture +operations and `close` can proceed. Another `run` is accepted only at a known +shell prompt; `key` can drive an expected interactive state. Startup reports the +control directory and session id, and request ids prevent replay. No HTTP +control service or additional terminal client is needed. + +Readiness requires a round trip through the filmed terminal: execute a probe +that returns a session nonce, shell identity, and working directory, observe its +completion, and inspect a screenshot from that same page. Do not declare the +recorder ready based only on a listening port or a loaded page. + +Command completion is a shell adapter responsibility. Each scripted beat emits +a framed completion record after it returns, containing session/request ids and +an outcome. Its complete framing must not appear in echoed command text. Keep +instrumentation inside the recorded session; do not edit the human partner's +shell profiles or change its error preferences. A missing completion record is +an interruption or timeout, never success. + +The outcome distinguishes `completed`, `interrupted`, and `unknown`; a completed +beat has `shell_success`, a nullable native exit code, and a nullable shell error. +For Bash, preserve the command status and any producer pipeline statuses before +instrumentation overwrites them. For PowerShell, capture `$?` immediately after +the submitted statement and distinguish it from `$LASTEXITCODE`. Attribute a +native exit code only when the beat identifies its native executable producer; +a cmdlet's outcome must not inherit an earlier native command's exit code. +Terminating exceptions and parse failures produce explicit error outcomes when +observable, or `unknown` when the session no longer permits reliable attribution. + +The first implementation accepts atomic command/statement beats. Multi-statement +scripts remain opaque commands whose own documented status is recorded; the +recorder does not claim to detect every internally ignored error. Logging and +formatting are observer operations after status capture. If the command being +proved is itself a producer/logging pipeline, its adapter must retain the +producer's outcome separately, or require separate beats rather than label a +successful logger as a successful producer. Evidence includes the exact command +and attribution, so a successful recording can honestly show a failed command. + +Record PowerShell 5.1 and 7, not only launch the pipeline from each. Test a +successful native executable followed by a failing cmdlet, a failing native +executable followed by a successful cmdlet, terminating and non-terminating +errors, an explicit script exit, parse failure, and failure through logging. +Tests must detect status changes introduced by instrumentation, including the +PowerShell 5.1 expression-wrapper behavior. For interactive TUI beats, use explicit application state and key actions; do not send another shell command while the TUI still owns input. Unknown state or @@ -258,6 +325,10 @@ take pauses capture without killing a long-running command; the same browser connection and shell persist until the recording session ends. Browser disconnect/reconnect persistence is not assumed. If the connection is lost and the shell cannot be proven to survive, mark the take interrupted and report it. +Verify a nonce, shell identity, and persistent shell variable across two takes, +a running command between those takes, and a real harness tool-call boundary. +Include negative tests where an extra terminal client or lost connection must +not produce a successful session-continuity result. ### Desktop capture and real-run logs @@ -294,6 +365,26 @@ failure, stop and wait for owned processes and release resources; do not kill by generic executable name or unverified stale PID. Ordinary users must be able to run the workflow without elevated privileges. +Session ownership includes the recorded command's local children and +grandchildren, even when they stop using the terminal. On Windows, assign ttyd +and the isolated browser root to a session-owned Job Object before their threads +run, using suspended creation and Win32 calls through Python's `ctypes`. Disable +breakaway and use kill-on-job-close so descendants cannot outlive the recorder. +Keep the supervisor outside its child job, and detect failure to establish the +job before starting a take. On Unix, track the recorder's own sessions/process +groups, including ttyd's PTY process group; do not assume killing the ttyd parent +terminates its shell group. Session persistence ends at `close`; this workflow +does not launch local services intended to survive it. + +On normal close, keep reading terminal output while requesting graceful +shutdown, then terminate remaining owned processes after a bounded timeout and +wait for their exit. Drain/close output in an order that does not block older +ConPTY implementations. On supervisor failure, Windows job closure must still +terminate owned descendants. Test both success and cancellation with a child and +grandchild that continue writing heartbeat files, plus an unrelated sentinel +process. Owned heartbeats must cease, owned processes must disappear, the +sentinel must survive, and no shutdown operation may hang indefinitely. + Use the same distinction as the companion between a renderer and opening a browser for the human partner. If a recorder needs to open a URL, use the OS launcher with separate arguments; on WSL, Windows URL opening is a convenience, @@ -330,17 +421,17 @@ without depending on a particular CI provider. | Launch shells | Bash and zsh on macOS, Bash on Linux/WSL, Windows PowerShell 5.1, PowerShell 7, and Git Bash on native Windows | | Shared pipeline | All scene kinds; measured scene offsets; hard and soft subtitles; checker verdicts and contact sheets | | Paths | Spaces, apostrophes, Unicode, metacharacters, Windows drive paths, relative/absolute work directories, nested SRT files, LF/CRLF | -| Windows terminal | Both recorded shells; at least one crossed launch/record-shell combination; delayed command, failed command, TUI input, and retained session between takes | +| Windows terminal | Git Bash and recorded PowerShell 5.1/7; a crossed launch/record-shell combination; cmdlet/native status attribution, delayed command, TUI input, and same-session proof between takes | | Native independence | PowerShell movie tools run with Git Bash and WSL unavailable to them; Git Bash native tests use Windows binaries | -| Local voice | Real no-key Piper synthesis and local ASR on macOS, Linux, and native Windows; repeat with cached models and network disabled | +| Local voice | Real no-key Piper synthesis and local ASR in every required OS environment, including WSL; repeat with cached models and network disabled; test nested helper isolation from the filmed project | | Capture failure | Blank frame, missing display, permission refusal, browser loss, and timeout produce accurate outcomes and no fabricated proof | -| Lifecycle | Survives a harness turn boundary; bounded shutdown after success, error, and interruption; unrelated sentinel process survives cleanup | +| Lifecycle | Survives a harness turn boundary; bounded shutdown after success, error, and interruption; owned children/grandchildren terminate while an unrelated sentinel survives | | Evidence integrity | Failed command remains failed through logging; missing required speech verification is reported; rendered content matches real actions | The end-to-end fixture includes a small real browser app with a persistent state change and a terminal sequence that prints Unicode, runs a delayed command, and returns a nonzero status. Capture those actions, generate real local narration, -assemble title/image/frame/movie scenes, burn subtitles, run the checker, and +assemble `card`/`image`/`frames`/`movie` scenes, burn subtitles, run the checker, and inspect the finished output. Include a terminal TUI take and an unnarrated log-reel case. An intentionally failing command may be part of a successful recording test: its logged status and narration must accurately show that failure. @@ -354,6 +445,36 @@ only with a recorded reason and a separate result for the fallback route. A missing prerequisite in a required acceptance job is a failure of that job's setup, not a green compatibility result. +OS and feature coverage must be joined. Define fixture groups: **P** is the full +processing fixture (all scene kinds, offsets, hard/soft subtitles, checker and +negative cases); **B** is real browser capture; **T** is real terminal/TUI capture +and lifecycle; **V** is no-key synthesis/transcription plus a cached offline +rerun; **L** is the real-run log reel with preserved status. + +| Required environment | Minimum successful groups | Additional proof | +| --- | --- | --- | +| macOS arm64 | P, B, T, V, L | Bash and zsh invocation | +| macOS x64 | P, B, T, V, L | Exact interpreter and model package versions | +| Linux x64 desktop | P, B, T, V, L | Display type and browser backend | +| Linux x64 with DISPLAY/WAYLAND_DISPLAY unset and no desktop session | P, B, T, V, L | Positive headless browser and terminal takes, not just a missing-display diagnostic | +| Native Windows x64 | P, B, T, V, L | Full pipeline from PowerShell and Git Bash; real launch and recorded-shell coverage for PowerShell 5.1/7; native binaries proven | +| WSL Linux x64 | P, B, T, V, L | Linux binaries proven; local voice runs inside WSL; no hidden Windows-file-path dependency | + +Do not multiply the full fixture by every launch-shell permutation: thin +invocation tests cover remaining permutations, while the explicit Windows +end-to-end requirements above still apply. Remote/harness continuity requires +at least one real remote session for browser and terminal recording, with +artifacts retrieved and the launch/recording hosts identified. + +To advertise a desktop backend as verified, retain one successful real desktop +take on an actual macOS desktop, a Windows desktop using `gdigrab`, or a Linux +X11 desktop using the documented backend, respectively. A skipped test leaves +that backend conditional/unverified even if the OS's P/B/T/V/L groups pass. +Wayland support in this scope means correct detection and an honest route +decision; a Wayland desktop backend needs its own successful take before a +stronger claim is published. This does not require every compositor or remote +desktop configuration to support desktop capture. + Skill instruction changes require `superpowers:writing-skills` and before/after pressure testing across multiple agent sessions. Scenarios include a PowerShell harness, a Git Bash harness, no cloud key, a path containing spaces, missing @@ -361,13 +482,31 @@ libass, and headless/blocked capture. Check that agents select valid commands, keep failures visible, and inspect the artifact. Store evals and transcripts in the project's external eval repository; it is absent from this checkout, so record its actual path and commit rather than assuming `evals/` is present. +The external checkout found during review is +`/Users/drewritter/prime-rad/superpowers-evals` at `66f08529`; this is an evidence +location, not a path to hard-code into tests. Its Windows guest launcher proves +where the agent runs, not which shell its tools use. For each shell-specific +agent eval, capture the actual agent tool invocation and shell identity; launching +an agent from PowerShell while all its commands execute in Bash does not satisfy +the PowerShell-harness scenario. Evidence records must include OS/architecture, shell, Python/uv, FFmpeg build, browser, TTS/ASR versions, harness/model, command, return code, and artifact or transcript location. Generated media need not be committed to core, but the fixture and reproduction commands must be retained. -The design is ready for implementation after review. Compatibility is complete +### First implementation task: native Windows feasibility + +Before the bulk port, run a bounded probe of the chosen ttyd build with native +PowerShell and Git Bash: one filmed/observed terminal, a command completion +record, two takes preserving shell state across a harness boundary, and Job +Object cleanup of a nested worker. Record executable versions and the observed +ttyd message format. This is runtime validation of the specified design, not +evidence already gathered by this spec review. A failure revisits the relevant +adapter design before depending on it; it does not silently remove an agreed +platform or shell from the contract. + +The design is ready for implementation planning after review. Compatibility is complete only when the required matrix has evidence, the updated skill has behavior evals, and the support documentation accurately distinguishes verified combinations from dependency or display limitations. @@ -388,3 +527,13 @@ from dependency or display limitations. - [Piper package files](https://pypi.org/project/piper-tts/#files) include Windows x64 builds; package availability alone is not a completed synthesis or transcription test. +- [PowerShell automatic variables](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables) + distinguish command success from native process exit status. +- [ttyd protocol implementation](https://github.com/tsl0922/ttyd/blob/main/src/protocol.c) + associates a terminal process with each initialized client connection. +- [CDP WebSocket receive events](https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketFrameReceived) + expose messages from the browser's existing socket, including encoded binary payloads. +- [Windows Job Objects](https://learn.microsoft.com/en-us/windows/win32/procthread/job-objects) + provide a process-ownership boundary for session cleanup. +- [ConPTY close behavior](https://learn.microsoft.com/en-us/windows/console/closepseudoconsole) + informs output draining and bounded shutdown on older Windows versions. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md new file mode 100644 index 0000000..eebfef7 --- /dev/null +++ b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md @@ -0,0 +1,73 @@ +# Proof movie compatibility: adversarial design review + +**Date:** 2026-09-09 + +**Reviewed draft:** `a36d831d6f9764b6a1355b23f318519701f37029` + +**Design:** [OS compatibility spec](2026-09-09-proof-movie-os-compatibility-design.md) + +## Method and limits + +Two independent agents reviewed the committed draft with separate contexts and +read-only assignments. `review_terminal_spec` examined native terminal control, +shell outcomes, ttyd, and lifecycle. `review_platform_spec` examined the platform +contract, dependency feasibility, and acceptance evidence. The author separately +checked the shared pipeline against the actual imported scripts and verified the +review findings before revising the design. + +The independent reviewers found no Critical issues and four Important design +gaps. They did not run native Windows recording. This is adversarial review of a +specification, not skill pressure testing or OS acceptance testing. + +## Findings and disposition + +| Finding | Evidence/failure scenario | Design revision | +| --- | --- | --- | +| T1: PowerShell outcome was underspecified (Important) | A failed cmdlet can leave an earlier native exit code at zero, or a successful cmdlet can leave it nonzero. PowerShell 5.1 expression wrappers can alter the success variable. Native-exit-only tests miss this. | Separate shell success, native exit attribution, errors, and unknown/interrupted completion. Capture status before logging; define atomic beats and opaque script behavior. Record both PowerShell 5.1 and 7 with mixed cmdlet/native and error fixtures. | +| T2: Process ownership omitted descendants (Important) | ttyd terminates its Windows shell with `TerminateProcess`; this does not by itself prove children/grandchildren stop. A worker can keep writing after a cancelled recording. | Establish a Windows Job Object before children run, with kill-on-close and no breakaway; account for Unix PTY process groups. Drain output during bounded shutdown. Require owned descendants to exit while an unrelated sentinel survives. | +| T3: Output observation could attach to the wrong shell (Important) | ttyd spawns a process per initialized terminal WebSocket. Opening a separate observer socket creates another shell rather than attaching to the filmed one. | One persistent supervisor and one terminal client. Observe the filmed page's existing connection through CDP, use writable mode and a readiness round trip, and control takes through ordered request files. Test nonce, shell identity, state, and command continuity. | +| P1: OS and feature coverage were not joined (Important) | The original acceptance rows could be satisfied by proving features on one OS and doing smoke runs elsewhere, leaving genuinely headless Linux or WSL local voice untested. | Assign P/B/T/V/L fixture groups to each required OS/architecture environment. Require positive headless and WSL voice runs, separately map shell checks, and reserve verified desktop claims for backends with real successful takes. | +| A1: Nested ASR helper inherited the filmed project (author finding) | Imported `narrate` uses nested `uv run --with faster-whisper ...` without disabling project discovery. An unrelated project Python requirement can prevent the helper from launching. | Disable nested helper project discovery; require compatible interpreter selection and a fixture proving no dependency on, or mutation of, the filmed project's environment/lockfile. | + +Additional clarifications retain the existing `movie` scene's own-audio/duration +exception, use the exact scene-kind names in the fixture, distinguish helper +UTF-8 pipes from arbitrary native command encodings, and require shell-specific +agent evals to prove the actual tool shell rather than the agent's launch shell. + +## Verification performed during review + +- Inspected ttyd's `src/protocol.c`: process creation is associated with the + initialized terminal client, and input depends on writable mode. +- Inspected ttyd's `src/pty.c`: Windows shell termination uses `TerminateProcess`. +- Checked Microsoft's PowerShell automatic-variable documentation, Job Objects, + and ConPTY shutdown documentation. These support the design corrections; they + do not establish that the future recorder implements them correctly. +- Reproduced uv project discovery in a temporary directory containing a + `pyproject.toml` requiring Python `>=9.99`. + `uv run --offline python -c 'print("ASR child launched")'` exited 2 with an + interpreter-resolution error; adding `--no-project` before `python` exited 0. + This isolates the project-discovery issue without claiming an actual ASR/model + test was run. +- Located the external eval checkout at + `/Users/drewritter/prime-rad/superpowers-evals`, commit `66f08529`, and read its + Windows guest agent instructions. They establish a native guest launch path, + not a PowerShell tool adapter or a completed movie eval. + +## Recheck and remaining work + +Both original reviewers rechecked the revised design. The terminal reviewer +confirmed T1/T2/T3 resolved for implementation planning with no new Critical or +Important contradictions. The platform reviewer confirmed P1 resolved with no +new findings. The terminal reviewer also checked CDP's documented receive events +and binary payload representation and found no demonstrated accessibility blocker +for the proposed observer. No independent review finding remains open. + +Runtime validation remains implementation work: the first planned task is a +bounded native Windows probe of same-session ttyd observation, PowerShell/Git Bash +completion, persistent takes, and descendant cleanup. Its result determines +whether the specified adapters can proceed unchanged. The next design deliverable +is the implementation plan; the runtime probe is a prerequisite within that plan, +not a test claimed to have passed during specification review. + +The eventual skill changes still require before/after pressure tests and the +OS acceptance matrix. This review must not be cited as that evidence. -- cgit From 0b22f61807769f6a4814a79395c7ccf6533855cd Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 14:48:18 -0700 Subject: docs: plan proof movie OS compatibility with Windows validation host --- .../2026-09-09-proof-movie-os-compatibility.md | 709 +++++++++++++++++++++ ...26-09-09-proof-movie-os-compatibility-design.md | 13 +- ...26-09-09-proof-movie-os-compatibility-review.md | 8 +- 3 files changed, 725 insertions(+), 5 deletions(-) create mode 100644 docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md b/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md new file mode 100644 index 0000000..db6090a --- /dev/null +++ b/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md @@ -0,0 +1,709 @@ +# Proof Movie OS Compatibility Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Make the imported proof-movie skill usable on the agreed macOS, Linux, native Windows, WSL, and headless/remote environments, with evidence for each advertised combination. + +**Architecture:** Retain the five Python media tools and their artifact contracts. Add small shared path/browser helpers and an included terminal recorder with a persistent supervisor, shell-specific outcome adapters, and owned process trees. Use portable fixtures for shared behavior and real shell/OS runs for platform claims. + +**Tech Stack:** Python 3.10+, uv script environments, FFmpeg/ffprobe, Chromium-family browsers/CDP, ttyd, existing Piper/local ASR dependencies, Python unittest, Windows Job Objects through ctypes, and the external Quorum skill-evaluation harness. + +**Spec:** [Proof movie OS compatibility](../specs/2026-09-09-proof-movie-os-compatibility-design.md), with its [adversarial review and resolved findings](../specs/2026-09-09-proof-movie-os-compatibility-review.md). + +## Global Constraints + +- Native Windows must not require WSL; the PowerShell movie workflow must not require Git Bash. +- PowerShell 5.1 and 7 are separate invocation tests. Git Bash is a Windows shell environment, not a synonym for WSL. +- Git Bash must invoke native Windows Python and FFmpeg for its native Windows tests. WSL tests must invoke Linux tools. +- Required validation starts with macOS arm64 and x64, Linux x64, and native Windows x64, plus WSL on Windows. +- Do not introduce a Windows 11-only restriction solely because a test machine runs Windows 11. +- Document `uv run --script` for all five extensionless tools. Retain existing Unix shebang execution for compatibility. +- Use explicit UTF-8 for YAML, JSON, HTML, SRT, concat lists, and text evidence. +- Pass external executable arguments as arrays. +- Preserve scene kinds, manifest fields, offsets, CLI arguments, and output artifact formats. +- Keep local Piper narration and local transcription available without a cloud key on the verified support combinations. +- Do not introduce a new recording service, TTS service, global Node dependency, or Windows-only package manager requirement. +- Keep the existing ttyd/tmux route for Unix environments. +- Native Windows must not require tmux, Docker, or WSL. +- Session persistence ends at `close`; this workflow does not launch local services intended to survive it. +- A missing prerequisite in a required acceptance job is a failure of that job's setup, not a green compatibility result. +- Skill instruction changes require `superpowers:writing-skills` and before/after pressure testing across multiple agent sessions. +- Do not bundle changes to plugin hooks, the visual companion, unrelated skills, standalone-repo retirement, or the movie checker's general behavior. + +The spec supplies the detailed requirements behind these constraints. Its dependency-policy exception remains a maintainer decision for PR #2214. This plan does not authorize another import PR, publishing, or merging. + +## Baseline, execution order, and available host + +Inspected import: `f6617db1517488d4a8b66925519d5ffbeef965b3` from PR #2214, targeting `dev`. The skill is absent from this documentation branch's code baseline. At execution, use `superpowers:using-git-worktrees`, recheck the PR, and create an isolated implementation workspace based on its current import or the merged equivalent. Compare changes to the inspected import before applying this plan. Do not copy another import onto `dev` or modify the PR author's branch implicitly. + +Task 1 is a bounded, approximately half-day feasibility gate. If its mechanism fails, record the failure and revise the affected adapter design before tasks depend on it. The existing 5–8 engineering-day estimate remains provisional until this gate passes; installing prerequisites and acquiring the remaining OS runners are scheduling dependencies. + +The human partner provided `drew@ballmer.local` for SSH or Paseo access. A read-only SSH inventory on 2026-09-09 succeeded: + +| Observed item | Result in the SSH session | +| --- | --- | +| Host | BALLMER; Windows 11 Pro 10.0.26200; 64-bit OS | +| PowerShell | Windows PowerShell 5.1.26100.9168 | +| Git Bash | `C:\Program Files\Git\bin\bash.exe` exists | +| Browser | Chrome and Edge exist in their standard Program Files locations | +| Other PATH tools | Git and Node resolve to installed executables | +| Not resolved on PATH | `pwsh.exe`, `uv.exe`, `ffmpeg.exe`, `ffprobe.exe`, `ttyd.exe` | +| Misleading aliases | PATH `bash.exe` and `python.exe` resolve to WindowsApps aliases | + +Absence from PATH is not proof of absence from disk. Check the relevant user installation directories before downloading tools. Use the explicit Git Bash executable, not the WindowsApps Bash alias. Inventory process architecture separately; OS bitness alone does not establish native executable architecture. No tool installation or Windows movie test was performed while writing this plan. + +Use a task-owned directory under the remote user's profile for fixtures, tools that need provisioning, and artifacts. Record exact resolved paths, versions, build features, download origins, and checksums. Do not alter shell profiles, machine PATH, execution policy, firewall configuration, existing services, or saved credentials. Portable installations and process-local environment settings are sufficient. SSH proves remote command access; it does not establish access to an interactive desktop. WSL availability also needs a separate inventory. + +## File map and interfaces + +Paths below are relative to the implementation checkout. `S` means `skills/proving-it-works-with-a-movie`; `T` means `tests/proving-it-works-with-a-movie`. These abbreviations identify exact directories, not shell environment variables. + +| Files | Responsibility | +| --- | --- | +| `S/scripts/{assemble,burn-subtitles,check-movie,make-subtitles,narrate}` | Existing public tools; retain their CLI and output formats | +| `S/scripts/media_paths.py` | Ordinary-file frame staging and FFconcat path syntax | +| `S/scripts/browser_tools.py` | Browser discovery, file URLs, isolated card rendering | +| `S/examples/film-terminal.py` | uv-script entry point: serve one recording session or submit a control request | +| `S/examples/terminal_recorder/__init__.py` | Package marker only | +| `S/scripts/processes.py` | Stdlib-only owned process lifecycle shared by card rendering and the recorder | +| `S/scripts/windows_jobs.py` | Suspended Windows creation, job assignment, wait and termination | +| `S/examples/terminal_recorder/shells.py` | Session-local Bash/PowerShell instrumentation and outcome attribution | +| `S/examples/terminal_recorder/protocol.py` | Request validation, atomic files, framing parser and outcome schema | +| `S/examples/terminal_recorder/cdp.py` | One CDP receiver, reply/event dispatch, page input and bounded screenshots | +| `S/examples/terminal_recorder/supervisor.py` | Readiness, ordered controls, command/take state and cleanup | +| `S/platform-support.md` and the existing seven skill/route Markdown files | Prerequisites, shell recipes, honest route decisions and support evidence | +| `T/probe-windows.py` | Disposable feasibility entry point, retained as a reproducible native probe | +| `T/run-tests.py`, `T/fixtures.py` | Portable unittest selection, capability preflight and generated fixtures | +| `T/test_{assembly,checker,narration,paths,browser,subtitles,processes,shells,terminal,routes}.py` | Regression and integration assertions | +| `T/fixtures/{browser.html,command.py,tui.py,heartbeat.py}` | Real browser state changes, command outcomes, interactive input, descendant ownership | +| `T/run-acceptance.py`, `T/launch.ps1`, `T/launch.sh`, `T/README.md` | P/B/T/V/L acceptance groups, thin shell launchers, reproduction instructions | +| `T/test-{assemble,check-movie,narrate}.sh` | Existing entry points; retain until portable equivalents cover their assertions | +| `docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md` | Results index, commands and links; generated movies stay outside core | +| External eval repo: `scenarios/movie-os-{powershell,git-bash,no-key,paths,no-libass,headless}/{story.md,setup.sh,checks.sh,checks-manifest.json}` | Six versioned pressure scenarios using the same real movie fixture | + +Implement helpers only for the responsibilities above; no generic process framework or browser automation SDK. Recorder modules are packaged inside the executable example so the five media tools remain usable without importing recorder dependencies. The two shared process helpers use only the standard library; the terminal example adds its sibling `scripts` directory to its import path to reuse them. + +The new test runner contract is: + +```text +uv run --script tests/proving-it-works-with-a-movie/run-tests.py --suite NAME [--require-capabilities] +``` + +`NAME` is `assembly`, `checker`, `narration`, `paths`, `browser`, `subtitles`, `processes`, `shells`, `terminal`, `routes`, or `all`. The runner uses stdlib unittest and PEP 723 test dependencies `pyyaml`, `pillow`, and `websockets`. Browser/local-voice integration cases are explicitly tagged in test code. A regular local run reports unavailable integration prerequisites as skips; `--require-capabilities` exits nonzero if any selected required case is skipped. Local successful unit tests never substitute for acceptance evidence. + +## Task 1: Prove the native Windows terminal mechanism on Ballmer + +**Files:** Create `T/probe-windows.py` and the reports file. Probe artifacts go in the remote task directory. No skill prose changes. + +**Interfaces:** Consumes explicit absolute paths to ttyd, a browser, and a recorded shell. Produces `probe.json` containing environment, shell identity, observed ttyd framing, readiness, command outcomes, continuity, cleanup and artifact paths. Every check has `passed`, `failed`, or `unavailable` status; only all required checks passing opens the gate. + +- [ ] **Establish the execution workspace and inventory the host.** Preserve an immutable import snapshot for later before/after evals. Read `T/test-*.sh` at that revision. Use an encoded PowerShell script for SSH to avoid multiple layers of shell quoting: + +```python +import base64 +import subprocess + +script = r""" +$ProgressPreference = 'SilentlyContinue' +$PSVersionTable.PSVersion.ToString() +[Environment]::Is64BitProcess +Get-Command pwsh.exe,uv.exe,ffmpeg.exe,ffprobe.exe,ttyd.exe -ErrorAction SilentlyContinue | + Select-Object Name,Source | ConvertTo-Json +Test-Path 'C:\Program Files\Git\bin\bash.exe' +""" +encoded = base64.b64encode(script.encode("utf-16le")).decode("ascii") +subprocess.run([ + "ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=8", + "drew@ballmer.local", "powershell.exe", "-NoLogo", "-NoProfile", + "-NonInteractive", "-EncodedCommand", encoded, +], check=True) +``` + +- [ ] **Resolve prerequisites inside the task environment.** Inspect user tool locations; provision missing uv, native FFmpeg with libx264/AAC/libass, ttyd with ConPTY, and PowerShell 7 from their official project distribution channels. Use existing Chrome or Edge. Verify `uv --version`, native Python identity, `ffmpeg -version/-filters/-encoders/-devices`, `ffprobe -version`, `ttyd --version`, and both PowerShell versions. Record failures as setup failures. Do not use an unverified WindowsApps alias. +- [ ] **Write the probe's success assertions before the recorder.** It must exercise PowerShell 5.1, PowerShell 7, and Git Bash. Use this result contract in the probe's final assertions: + +```python +def assert_probe(result): + assert result["terminal_client_count"] == 1 + assert result["observed_session_id"] == result["filmed_session_id"] + assert result["nonce_before"] == result["nonce_after"] + assert result["shell_pid_before"] == result["shell_pid_after"] + assert result["variable_after"] == "persisted-λ" + assert result["long_command_survived_take_boundary"] + assert result["owned_children_remaining"] == [] + assert result["unrelated_sentinel_alive"] + assert result["shutdown_seconds"] < 10 +``` + +- [ ] **Run the assertions against the unimplemented probe and retain the failure.** Missing result fields or absent recorder behavior must fail; do not generate optimistic fixture results to pass the gate. +- [ ] **Implement the narrow probe.** Use the Windows creation sequence specified in Task 4, one writable ttyd client, and one browser page. Enable CDP Network observation before navigating to ttyd. Decode output on that page's socket; never connect a second ttyd observer. This decoding seam must be exercised against the actual ttyd build, not merely a mocked frame: + +```python +import base64 + +def ttyd_output(event: dict) -> bytes: + frame = event["params"]["response"] + payload = frame["payloadData"] + raw = base64.b64decode(payload) if frame["opcode"] == 2 else payload.encode("utf-8") + return raw[1:] if raw[:1] == b"0" else b"" +``` + +Pin observation to the page's identified terminal WebSocket request id, and validate the leading `0` output framing against captured messages. Feed decoded bytes into an incremental completion parser. Use session-local shell instrumentation, capture status before logging, and prove prompt readiness by nonce/identity/cwd plus a screenshot. Record actual errors and shell outcomes, not only exit-zero cases. +- [ ] **Exercise two takes across real harness calls.** Run the supervisor under the harness's persistent execution facility; submit a first take and delayed command from another call, then a second take from a later call. Prove the command and variable survived while capture paused. Preserve the transcript of the separate calls. Add one extra-client attempt and a browser-loss case; neither may produce a successful continuity result. +- [ ] **Exercise descendant ownership and crash cleanup.** A recorded Python worker starts a grandchild that writes a heartbeat; start a separate sentinel outside the job. Close normally, cancel, then kill the supervisor in a separate run. Check child/grandchild disappearance and heartbeat cessation, sentinel survival, and bounded shutdown. Retrieve screenshots, raw terminal messages, JSON results and logs with SSH/SFTP; record both launch and recording hosts. +- [ ] **Record the gate disposition and commit the probe/report.** If any prerequisite or mechanism is unavailable, leave the gate incomplete. If a mechanism fails, attach its smallest reproduction and revise the relevant design before broad implementation. Commit message: `test(movie): validate native Windows recording mechanism` only after recording the actual result, including a failing result if the design must change. + +## Task 2: Preserve the imported regressions in a portable runner + +**Files:** Create `T/run-tests.py`, `T/fixtures.py`, `T/test_assembly.py`, `T/test_checker.py`, `T/test_narration.py`, and `T/README.md`. Keep the three Bash suites initially. + +**Interfaces:** `fixtures.run_tool(name: str, args: list[str], *, cwd: Path, env: dict[str, str] | None = None) -> subprocess.CompletedProcess[bytes]`; `fixtures.duration(path: Path) -> float`. Both use argv arrays and real executables. `run_tool` resolves the skill script from the checkout and invokes `[uv, "run", "--script", script, *args]`. Fixture setup owns its temporary directories and subprocesses. + +- [ ] **Port each existing assertion, preserving its intent and thresholds.** Assembly must still check successful assembly, approximately eight seconds total, body offset approximately two seconds, and subtitles starting at the measured offset. Port all nine checker cases and all five narration drift cases; list their names in the README for equivalence review. + +```python +class AssemblyRegression(unittest.TestCase): + def test_narration_padding_and_offsets(self): + with tempfile.TemporaryDirectory() as directory: + work = Path(directory) + # The fixture helper writes the imported 2s image + 4s frames + 6s WAV case. + scenes = fixtures.assembly_fixture(work) + result = fixtures.run_tool("assemble", [str(scenes), str(work / "out.mp4")], cwd=work) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertAlmostEqual(fixtures.duration(work / "out.mp4"), 8, delta=0.4) + offsets = json.loads((work / "segments/offsets.json").read_text(encoding="utf-8")) + self.assertAlmostEqual(offsets["body"], 2, delta=0.3) +``` + +`fixtures.assembly_fixture(work: Path) -> Path` generates the four ordered PNGs, six-second sine-wave stand-in, matching narration manifest, and original scene YAML. Mark the audio as a synthetic timing fixture; this is not a local speech test. +- [ ] **Run the new runner before adding its fixture functions.** Expected: import/undefined-helper failure. Implement `run_tool`, `duration`, `assembly_fixture` and unittest discovery, then rerun `--suite assembly`, `--suite checker`, and `--suite narration`. Expected: the same 18 assertions pass on a capable host; unavailable prerequisites remain explicit. + +```python +def run_tool(name, args, *, cwd, env=None): + uv = shutil.which("uv") + if uv is None: + raise RuntimeError("uv is required for movie tool tests") + script = Path(__file__).resolve().parents[2] / "skills/proving-it-works-with-a-movie/scripts" / name + return subprocess.run([uv, "run", "--script", str(script), *args], + cwd=cwd, env=env, capture_output=True, timeout=900) +``` + +- [ ] **Run old and new suites on the same macOS checkout.** Compare named assertions, not just total counts. Keep the Bash versions until Task 10 converts their entry points to thin wrappers without losing coverage. Run portable equivalents on Ballmer as an early dependency check. +- [ ] **Commit:** `test(movie): port regression fixtures to Python`. + +## Task 3: Make frame assembly and media paths portable + +**Files:** Create `S/scripts/media_paths.py` and `T/test_paths.py`; modify `S/scripts/assemble` and `T/test_assembly.py`. + +**Interfaces:** `media_paths.stage_frames(source: Path, destination: Path) -> list[Path]` copies lexically sorted `*.png` inputs to numbered ordinary files in a fresh destination. `media_paths.ffconcat_entry(path: Path) -> str` returns one FFconcat line with an absolute slash-form path and FFmpeg token escaping. Callers own and clean the fresh staging directory. + +- [ ] **Add a path fixture and ordering test.** Use a valid name such as `movie O'Brien λ & [take]`, a work directory outside the current directory, CRLF YAML, nested SRT directories, and absolute/relative inputs. Include native drive-letter paths on Windows. Distinct colored frames must remain in lexical source order. + +```python +def test_frame_staging_uses_ordinary_ordered_files(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + source = root / "O'Brien λ & [take]" + source.mkdir() + (source / "b.png").write_bytes(b"second") + (source / "a.png").write_bytes(b"first") + staged = media_paths.stage_frames(source, root / "staged") + self.assertEqual([p.read_bytes() for p in staged], [b"first", b"second"]) + self.assertTrue(all(not p.is_symlink() for p in staged)) + self.assertEqual(len(list(source.iterdir())), 2) +``` + +- [ ] **Run `run-tests.py --suite paths`; observe failure before adding the helper.** Implement staging and FFconcat escaping: + +```python +def stage_frames(source: Path, destination: Path) -> list[Path]: + files = sorted(source.glob("*.png")) + if not files: + raise ValueError(f"no PNG frames in {source}") + destination.mkdir(parents=True, exist_ok=False) + result = [] + for index, frame in enumerate(files): + target = destination / f"frame-{index:08d}.png" + shutil.copyfile(frame, target) + result.append(target) + return result + +def ffconcat_entry(path: Path) -> str: + value = path.resolve().as_posix() + if "\n" in value or "\r" in value: + raise ValueError("FFconcat paths cannot contain line breaks") + return "file '" + value.replace("'", "'\\''") + "'\n" +``` + +- [ ] **Replace FFmpeg glob input with the staged numbered sequence.** Supply `-framerate`, `-start_number 0`, and `frame-%08d.png`; retain lexical ordering and the existing rate. Write concat lists with `encoding="utf-8"`. Validate the helper's output by running FFmpeg on both Unix paths and real Windows drive paths, not by comparing an escaped string alone. +- [ ] **Extend real assembly coverage to all four scene kinds.** Assert `card`/`image`/`frames` last `max(narration, visuals)` and that `movie` retains its own duration/audio even when narration is longer. Check measured offsets and decoded frame order; source PNGs must survive success and failure cleanup. +- [ ] **Run `--suite paths` and `--suite assembly --require-capabilities` on macOS and Windows; commit:** `fix(movie): make frame and concat inputs portable`. + +## Task 4: Own recorder processes and their descendants + +**Files:** Create `S/scripts/{processes.py,windows_jobs.py}`, `S/examples/terminal_recorder/__init__.py`, `T/test_processes.py`, and `T/fixtures/heartbeat.py`. Refactor the proven Task 1 ownership code into these modules. + +**Interfaces:** `processes.OwnedProcesses()` is a context manager. `spawn(argv: list[str], *, cwd: Path, env: dict[str, str]) -> int` starts an owned process and returns its native PID. `run(argv: list[str], *, cwd: Path, env: dict[str, str], timeout: float) -> subprocess.CompletedProcess[bytes]` captures an owned finite command's raw output, waits with a deadline, and cleans the owned tree on timeout. `register_terminal_group(pid: int) -> None` records the validated Unix PTY process group. `close(grace_seconds: float = 3.0, kill_seconds: float = 5.0) -> None` waits for graceful shutdown, then terminates remaining owned processes with a deadline. `windows_jobs.WindowsJob.spawn` takes the same argv/cwd/env fields and returns the native PID; `terminate(exit_code: int) -> None`, `wait_empty(timeout: float) -> bool`, and `close() -> None` supply its cleanup. Handles are never inferred from a Bash PID. + +- [ ] **Add real child/grandchild tests before extracting the implementation.** `heartbeat.py` accepts `--directory`, `--role parent|child|grandchild|sentinel`; the parent starts the child, the child starts the grandchild, and each periodically writes a file containing its PID and timestamp. The sentinel runs outside `OwnedProcesses` and has independent cleanup in the test's `finally` block. Each worker uses ordinary inherited process ownership; test detachment from terminal input separately from permission to break out of the job. + +```python +with processes.OwnedProcesses() as owned: + parent_pid = owned.spawn([sys.executable, str(worker), "--directory", str(work), + "--role", "parent"], cwd=work, env=dict(os.environ)) + self.assertGreater(parent_pid, 0) + fixture_pids = fixtures.wait_for_heartbeats(work, count=3, timeout=5) +self.assertTrue(all(not fixtures.pid_alive(pid) for pid in fixture_pids)) +self.assertTrue(fixtures.pid_alive(sentinel_pid)) +``` + +Add `fixtures.wait_for_heartbeats(directory: Path, count: int, timeout: float) -> list[int]` and `fixtures.pid_alive(pid: int) -> bool` using actual native process checks, with process creation time/owned handles where available to avoid PID reuse. Do not use process-name killing. Run `--suite processes`; expected initial failure: ownership module absent. +- [ ] **Implement Windows suspended creation and job assignment.** Define correctly sized ctypes structures from the Windows SDK for `STARTUPINFOW`, `PROCESS_INFORMATION`, `JOBOBJECT_BASIC_LIMIT_INFORMATION`, `IO_COUNTERS`, and `JOBOBJECT_EXTENDED_LIMIT_INFORMATION`; declare argument/return types for every Win32 function, including pointer-sized handles. Unit-test structure sizes on the host. Create an unnamed job, set `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE`, and never enable either breakaway flag. Encode argv with `subprocess.list2cmdline`, and pass a Unicode environment block plus absolute working directory to `CreateProcessW`. + +```python +CREATE_SUSPENDED = 0x00000004 +CREATE_UNICODE_ENVIRONMENT = 0x00000400 +JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = 0x00002000 + +# Within WindowsJob.spawn, after CreateProcessW filled process_info: +if not kernel32.AssignProcessToJobObject(self.handle, process_info.hProcess): + error = ctypes.get_last_error() + kernel32.TerminateProcess(process_info.hProcess, 1) + kernel32.CloseHandle(process_info.hThread) + kernel32.CloseHandle(process_info.hProcess) + raise ctypes.WinError(error) +if kernel32.ResumeThread(process_info.hThread) == 0xFFFFFFFF: + error = ctypes.get_last_error() + kernel32.TerminateProcess(process_info.hProcess, 1) + kernel32.CloseHandle(process_info.hThread) + kernel32.CloseHandle(process_info.hProcess) + raise ctypes.WinError(error) +kernel32.CloseHandle(process_info.hThread) +``` + +Retain the process handle until exit/wait. Close the non-inheritable job handle on all error paths and at normal completion; the supervisor itself stays outside its child job. If assignment is impossible in the harness's existing job hierarchy, fail preflight before any take. Do not resume an unowned root process as a fallback. +- [ ] **Implement Unix process ownership and bounded output draining.** Spawn owned roots with `start_new_session=True`; register the ttyd shell's actual PTY process group after the readiness probe and before accepting user commands. During shutdown, keep the CDP/output readers running while requesting graceful exit, signal only registered owned groups, then enforce the kill deadline and reap owned roots. Implement finite `run` with task-owned binary output files or continuously drained pipes so waiting cannot deadlock on a full pipe. Test its timeout with a child/grandchild producer. The browser card helper and terminal recorder both reuse this ownership mechanism. +- [ ] **Run ownership tests for normal close, exception, cancellation, and supervisor crash.** On Windows, crash closure of the job must terminate all owned descendants. Exercise job-assignment failure and assert no child runs. Confirm the sentinel survives every case and no heartbeat advances after shutdown. On Unix include a PTY child group distinct from ttyd's parent group. Run with ordinary user permissions. +- [ ] **Commit:** `feat(movie): contain recorder process trees on Windows and Unix`. + +## Task 5: Discover browsers and render cards without platform-specific URLs + +**Files:** Create `S/scripts/browser_tools.py` and `T/test_browser.py`; modify `S/scripts/assemble`. + +**Interfaces:** `browser_tools.find_browser(explicit: str | None = None) -> Path` returns a resolved executable or raises `FileNotFoundError` with searched locations. `browser_tools.render_card(browser: Path, html: Path, png: Path, width: int, height: int) -> None` renders using an isolated temporary profile and a bounded process wait. + +- [ ] **Add explicit-selection, discovery, and real-render tests.** A supplied invalid browser path must fail clearly instead of silently selecting another executable. Test Windows Chrome/Edge installation locations plus PATH candidates, and existing macOS/Linux choices. A real card with Unicode text in the path fixture must have visible foreground pixels and the requested dimensions. + +```python +def test_explicit_browser_path_is_authoritative(self): + with self.assertRaises(FileNotFoundError): + browser_tools.find_browser("missing-explicit-browser") +``` + +- [ ] **Run `--suite browser`; observe failures.** Implement `shutil.which`/platform location selection, `html.resolve().as_uri()`, and absolute screenshot paths. Preserve the current card content and dimensions. The argv seam is: + +```python +command = [str(browser), "--headless", "--disable-gpu", + f"--user-data-dir={profile}", f"--window-size={width},{height}", + f"--screenshot={png.resolve()}", html.resolve().as_uri()] +with processes.OwnedProcesses() as owned: + result = owned.run(command, cwd=html.parent.resolve(), env=dict(os.environ), timeout=30) + result.check_returncode() +``` + +Create `profile` using `TemporaryDirectory`; retain sandbox defaults where supported. A container-specific browser sandbox exception must be an explicit environment requirement rather than a universal disabled-sandbox default. Use owned process cleanup for any child processes that survive the bounded screenshot operation. +- [ ] **Run actual screenshots on Ballmer and Linux with no display, plus macOS regression coverage.** Distinguish browser rendering from opening an artifact for the human partner. Missing display must not prevent headless card rendering. +- [ ] **Commit:** `fix(movie): discover browsers and render portable file URLs`. + +## Task 6: Fix subtitle staging, text encoding, and local ASR isolation + +**Files:** Modify all five `S/scripts` tools only where their IO requires it; create `T/test_subtitles.py`; extend `T/test_narration.py` and `T/test_paths.py`. + +**Interfaces:** Existing public CLIs and manifest fields are unchanged. Extend `burn-subtitles.run(cmd: list[str], *, cwd: Path | None = None) -> bool` to pass the working directory. Preserve `narrate.transcribe_local(wav, model="base.en") -> str | None`; its nested interpreter is project-independent and its diagnostics explain an unavailable ASR. + +- [ ] **Add a real nested-SRT burn regression.** Generate a short clip and SRT under the apostrophe/Unicode path fixture. Launch the script from a different directory. On a libass-capable build assert the output says it burned subtitles and compare decoded frames to prove text pixels exist; also inspect a Unicode sample visually. Test explicit `--soft`, missing libass, and a forced burn failure while libass is present. The last case must retain the actual diagnostic and must not say libass is absent. + +```python +self.assertEqual(result.returncode, 0, result.stderr) +self.assertIn(b"burned into the picture", result.stdout) +self.assertNotEqual(before_frame.tobytes(), after_frame.tobytes()) +self.assertTrue(subtitles.exists()) +``` + +The fixture supplies `result` from `fixtures.run_tool`, and decoded Pillow images `before_frame`/`after_frame` from the same timestamp. Pixel differences alone are not a font-glyph check: retain the rendered sample for inspection. +- [ ] **Run `--suite subtitles`; capture the original failure.** Stage the SRT under a fixed basename and keep all external movie paths absolute: + +```python +with tempfile.TemporaryDirectory(prefix="movie-subs-") as directory: + stage = Path(directory) + shutil.copyfile(args.subs, stage / "subtitles.srt") + ok = run(["ffmpeg", "-nostdin", "-y", "-v", "error", + "-i", str(args.movie.resolve()), + "-vf", f"subtitles=filename=subtitles.srt:force_style='{style}'", + "-c:a", "copy", "-c:v", "libx264", "-preset", "medium", + "-pix_fmt", "yuv420p", str(args.out.resolve())], cwd=stage) +``` + +Keep style construction local; validate/escape font values for the filter separately from file paths. Choose an available platform font and retain explicit `--font`. Report whether fallback followed absent libass or an actual burn error. Preserve the source SRT and the pipeline's sidecar-delivery contract. +- [ ] **Add UTF-8/CRLF and project-isolation regressions.** Read/write YAML, HTML, SRT, JSON and concat text with explicit UTF-8; accept CRLF. Diagnostic decode errors must identify the file. Preserve external raw bytes and use explicit UTF-8 only for owned Python helper output. In a temporary project with `requires-python = ">=9.99"`, launch the local helper and assert the project files, `.venv` and lockfile are unchanged. +- [ ] **Make nested uv select its own compatible interpreter.** Use Python 3.11 for this helper's tested environment unless the real dependency probe demonstrates a different compatible version is required; record that choice. The parent tools retain their Python 3.10 minimum. Verify the actual helper invocation and a real cached ASR run: + +```python +command = ["uv", "run", "--no-project", "--quiet", "--python", "3.11", + "--with", "faster-whisper", "python", "-c", ASR_SNIPPET, + str(Path(wav).resolve()), model] +child_env = dict(os.environ, PYTHONIOENCODING="utf-8") +out = subprocess.run(command, capture_output=True, text=True, + encoding="utf-8", env=child_env, timeout=900) +``` + +An unavailable transcription may retain the current script's permissive result, but it must be visible and cannot pass V acceptance. Do not alter drift/checker thresholds or fix unrelated narration-cache behavior in this task. +- [ ] **Run subtitle, path, narration and checker suites on capable macOS and Windows installations.** Existing local Homebrew FFmpeg lacks the needed hard-burn capability; provision/select a capable build for acceptance rather than counting a fallback as success. +- [ ] **Commit:** `fix(movie): isolate subtitle and narration processing from host paths`. + +## Task 7: Define command outcomes and session-local shell adapters + +**Files:** Create `S/examples/terminal_recorder/{protocol.py,shells.py}`, `T/test_shells.py`, and `T/fixtures/command.py`. Reuse Task 1's working instrumentation after applying the outcome contract below. + +**Interfaces:** `protocol.Request` contains `session_id: str`, `request_id: int`, `op: str`, and operation-specific fields. `protocol.Outcome` uses the schema below. `protocol.CompletionParser(session_id: str)` has `expect(request_id: int) -> None` to set the active request and `feed(data: bytes) -> list[Outcome]` to parse only that request's completion. It clears the active request after emitting its outcome and rejects replay. `shells.instrument(command: str, *, shell: str, session_id: str, request_id: int, attribution: str, native_executable: str | None) -> str` returns text to type into the already-recorded shell. Supported shells are `bash`, `powershell-5.1`, and `powershell-7`; attribution is `native`, `shell`, or `opaque`. + +```python +@dataclass(frozen=True) +class Outcome: + session_id: str + request_id: int + completion: Literal["completed", "interrupted", "unknown"] + shell_success: bool | None + native_exit_code: int | None + shell_error: str | None + pipeline_status: list[int] | None +``` + +`completed` requires a Boolean `shell_success`; `interrupted` and `unknown` cannot imply success. `native_exit_code` is populated only for an identified native producer. Keep the exact command and its attribution beside the outcome in evidence. `command.py` accepts `--exit N`, `--delay SECONDS`, and `--text TEXT`, writes the actual text and exits accordingly. + +- [ ] **Add parser and actual-shell outcome tests.** Feed completion frames split at every byte boundary, mixed with terminal output and echoed instrumentation; assert exactly one matching outcome and no acceptance of a different session/request. Use a raw control-character prefix/suffix and base64-encoded UTF-8 JSON. Construct the framing at runtime so the complete prefix never appears in echoed command text. + +```python +parser = protocol.CompletionParser("session-a") +parser.expect(expected.request_id) +payload = json.dumps(asdict(expected), ensure_ascii=False).encode("utf-8") +frame = b"\x1e" + b"MOVIE:" + base64.b64encode(payload) + b"\x1f" +actual = [] +for byte in frame: + actual.extend(parser.feed(bytes([byte]))) +self.assertEqual(actual, [expected]) +``` + +`expected` is an `Outcome` for the active request in the fixture. The parser buffers bounded incomplete records, rejects malformed/oversized records, and does not discard raw terminal evidence. +- [ ] **Run `--suite shells`; retain parser/import failures.** Implement the parser and session-local instrumenter. For Bash, capture status and producer pipeline statuses in one assignment command immediately after the beat: + +```bash +__movie_status=$? __movie_pipeline=("${PIPESTATUS[@]}") +``` + +Then serialize the captured values and emit the frame. Preserve the original shell state except for uniquely prefixed instrumentation variables; do not edit profiles. For PowerShell, capture `$?` as the first statement after the command, then capture `$LASTEXITCODE` only for an attributed native producer: + +```powershell +$__movie_success = $? +$__movie_native = $LASTEXITCODE +``` + +The two statements appear directly after the submitted beat inside the generated session-local instrumentation. Cmdlet outcomes serialize `native_exit_code` as null regardless of `$LASTEXITCODE`. Use `try/catch` for observable terminating exceptions without changing error preferences; emit a failed outcome with the caught error. Parse failures or `exit` that prevent framing become `unknown`/`interrupted` with a diagnostic. Do not wrap the command in a PowerShell 5.1 expression that resets `$?` before capture. +- [ ] **Exercise the full native error matrix through the filmed shell.** In both PowerShell versions: successful native command then failing cmdlet; failed native command then successful cmdlet; terminating/non-terminating errors; explicit script exit; parse error; success/failure through logging; and Unicode under a non-UTF-8 console code page. In Bash: nonzero native exit, producer failure followed by a successful logger, delayed completion, and pipeline statuses. Keep atomic statement beats; multi-statement scripts are opaque producers. When producer attribution through a pipeline cannot be preserved, require separate beats and report the restriction. +- [ ] **Verify expected failures remain honest recording outcomes.** A correctly captured failed command may pass the recorder test with `shell_success=false`; an absent frame may not. Retain raw byte logs, decoding choice, exact commands, and outcome JSON. Restore any test-local console settings when the fixture ends. +- [ ] **Commit:** `feat(movie): capture native shell outcomes without hiding failures`. + +## Task 8: Observe and capture the existing terminal page through CDP + +**Files:** Create `S/examples/terminal_recorder/cdp.py`; extend `T/test_browser.py` and create `T/test_terminal.py`. + +**Interfaces:** `cdp.Page.connect(debug_url: str) -> Page` is asynchronous. `Page.call(method: str, params: dict | None = None, timeout: float = 10) -> dict` correlates responses by CDP id through one receiver. `Page.events()` is an asynchronous iterator of event dictionaries. `Page.screenshot(path: Path, timeout: float = 10) -> None`, `Page.type_text(text: str) -> None`, `Page.key(name: str) -> None`, and `Page.close() -> None` share that connection. Terminal output feeds `CompletionParser`; it never opens another ttyd client. + +- [ ] **Add transport tests with interleaved replies/events and actual-page tests.** Interleave screenshot replies, keyboard replies, and binary terminal frames. Assert no event disappears while a screenshot waits; a lost connection fails pending calls with a bounded diagnostic. A real browser fixture must show a changed counter and a moving cursor overlay at measured times. + +```python +pending = asyncio.create_task(page.screenshot(work / "frame.png", timeout=2)) +await page.type_text("echo movie-test\n") +await pending +self.assertTrue((work / "frame.png").exists()) +self.assertEqual(observed_terminal_connections, 1) +``` + +The integration fixture establishes `page`, its owned browser/ttyd, and an event consumer that counts initialized terminal connections. Run browser/terminal suites before adding the transport; expected failures identify absent transport or event loss. +- [ ] **Implement one receiver with reply futures and an event queue.** Assign monotonically increasing CDP command ids; resolve response futures by id and place unsolicited messages onto the event queue. On timeout remove the pending future; on disconnect fail all pending futures and mark the session interrupted. Do not have multiple coroutines read the underlying CDP socket. + +```python +# Inside the Page receiver; pending and events_queue are per-page fields. +if "id" in message: + future = self.pending.pop(message["id"], None) + if future is not None and not future.done(): + if "error" in message: + future.set_exception(RuntimeError(str(message["error"]))) + else: + future.set_result(message.get("result", {})) +else: + await self.events_queue.put(message) +``` + +- [ ] **Attach before navigation and capture real pixels.** Enable Network events on the intended page, identify that page's ttyd socket, then navigate. Decode output incrementally using the observed message framing. Restrict ttyd to writable, loopback, one-client operation. Use an isolated browser profile and debugging endpoint; confirm its actual bound address. Screenshots have explicit viewport, frame timestamps and deadlines. Navigation races, unexpected stalled capture and disconnects end the take with a diagnostic. Do not ban deliberately blank transition beats. +- [ ] **Run real browser and ttyd captures on Windows and no-display Linux.** Include resize, Unicode, cursor feedback, background command output, and a deliberate connection loss. Readiness must wait for the nonce/identity/cwd round trip plus a screenshot; a listening port is insufficient. Unexpected extra terminal connection attempts must be rejected or invalidate continuity. +- [ ] **Commit:** `feat(movie): capture and observe one persistent terminal page`. + +## Task 9: Ship the persistent terminal recorder and ordered controls + +**Files:** Create `S/examples/film-terminal.py` and `S/examples/terminal_recorder/supervisor.py`; extend `protocol.py`, `T/test_terminal.py`; create `T/fixtures/tui.py`. + +**Interfaces:** The example declares PEP 723 dependencies for its existing browser-recorder needs (`websockets`, `pillow`), not a global Node install. Its CLI is: + +```text +uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py serve --shell SHELL --shell-exe PATH --browser PATH --ttyd PATH --cwd PATH --out PATH [--width 1280 --height 720] +uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py request --session PATH --request-file PATH +``` + +`serve` runs in the foreground under the harness's persistent execution mechanism and prints a JSON startup record with `session_id` and `control_directory` only after readiness. `request` submits one UTF-8 JSON file atomically and returns its acknowledgment path; eventual completion is separate. No daemon launcher or HTTP control server is introduced. + +The entry point adds only its own resolved sibling tools directory before importing the stdlib process helpers: + +```python +sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts")) +``` + +`protocol.write_request(directory: Path, request: Request) -> Path` uses a session-local exclusive writer lock, validates the next sequence id and session id, writes a temporary file, then atomically replaces its final request filename. Never overwrite an existing id. Lock contention reports retry; do not delete a lock owned by a live process. `supervisor.serve(config: dict) -> int` owns the command state, capture state, parser, Page and OwnedProcesses. + +| Operation | Required fields beyond session/id/op | Result | +| --- | --- | --- | +| `run` | `command`, `attribution`; `native_executable` when attribution is native; optional `interactive_ready` and `timeout_seconds` (default 30) | Immediate acknowledgment; eventual `Outcome`; a fresh readiness marker can establish interactive state | +| `key` | `key`, `expected_text`, `timeout_seconds` | Acknowledgment; result when expected output from the active command epoch is observed, or explicit timeout | +| `begin-take` | `take_name` | Capture started; reject overlapping take | +| `end-take` | none | Capture stopped and frames/timestamps finalized; shell keeps running | +| `close` | none | Bounded owned cleanup and session result | + +Request ids begin at 1 and increment by one. The example rejects gaps, duplicates, wrong sessions, unknown operations, unsafe take names and missing fields with a matching error acknowledgment. Requests serialize dispatch, not command duration. `run` requires a known prompt and calls `CompletionParser.expect` before typing. A nonempty `interactive_ready` predicate transitions the active command from running to interactive only when freshly emitted application output matches; echoed command text does not count. `key` is limited to that known interactive state. Matching old output is not evidence of reaching a new TUI state. Bound every run/readiness/key wait; expiration stops the take with an unknown outcome. + +- [ ] **Add state-machine and real-continuity tests first.** Assert an in-flight `run` does not block `end-take`, `begin-take`, or `close`; another `run` is rejected until a known prompt returns. Replaying a request must not execute the command twice. Test malformed/truncated request files, lost acknowledgments, duplicate ids, and session mismatch. + +```python +first = protocol.Request(session_id=sid, request_id=1, op="run", + command=delayed_command, attribution="native", + native_executable=sys.executable) +protocol.write_request(control, first) +protocol.write_request(control, protocol.Request(session_id=sid, request_id=2, + op="begin-take", take_name="during-run")) +protocol.write_request(control, protocol.Request(session_id=sid, request_id=3, op="end-take")) +``` + +The `Request` dataclass's operation-specific fields have nullable defaults and are validated by operation. `delayed_command` is a shell-appropriate invocation of `command.py --delay 5`. Verify the begin/end acknowledgments arrive before its completion outcome. Run `--suite terminal`; expected failure before the supervisor exists. +- [ ] **Implement atomic request IO and nonblocking dispatch.** Use filenames derived from integer ids, UTF-8 JSON, and `os.replace` within the same session directory. Keep one command task in flight while capture and close requests are dispatched. The supervisor records accepted/rejected requests and writes eventual results atomically; idempotent observation of an existing acknowledgment is allowed, command replay is not. + +```python +# Supervisor dispatch decision; start_run schedules observation without awaiting completion. +if request.op == "run" and self.command_state != "prompt": + self.reject(request, "terminal is not at a known shell prompt") +elif request.op == "run": + self.start_run(request) +elif request.op == "begin-take": + await self.begin_take(request) +elif request.op == "end-take": + await self.end_take(request) +elif request.op == "key": + self.start_key(request) +elif request.op == "close": + await self.close(request) +``` + +Define those supervisor methods in this task: `reject` emits an error acknowledgment; `start_run`/`start_key` schedule a tracked task and immediately acknowledge; asynchronous `begin_take`/`end_take` change capture state and acknowledge; `close` drains, terminates, and writes the session result. Unknown operations have already been rejected by request validation. Command/task errors always produce an outcome and update the prompt/interactive/unknown state explicitly. +- [ ] **Add the included example sequence and TUI fixture.** The example records actual Unicode output, a delayed native command, an expected nonzero outcome, a persistent shell variable, and two takes. `tui.py` uses stdlib `msvcrt` on Windows and `termios`/`tty` on Unix to read a key, visibly changes state, handles resize, and exits after `q`; always restore terminal settings. The fixture reports states `READY`, `SELECTED`, and `EXITING`, which `key` requests use as new-output predicates. Unknown state or timeout ends the take. +- [ ] **Run the example across a real SSH/harness boundary on Ballmer.** Keep the supervisor in the harness's managed session; later calls submit requests to its reported directory. Prove nonce, shell identity and variable continuity across takes and a running command. Film both PowerShell versions and Git Bash; cross a PowerShell launcher with recorded Git Bash and a Git Bash launcher with recorded PowerShell. Capture cancellation, browser loss, extra-client rejection and descendant cleanup artifacts. +- [ ] **Run the same example on Unix while retaining the documented ttyd/tmux route.** Do not convert native Windows into a Docker/tmux demo. Commit: `feat(movie): ship a persistent native terminal recorder example`. + +## Task 10: Build joined route fixtures and thin shell launchers + +**Files:** Create `T/run-acceptance.py`, `T/launch.ps1`, `T/launch.sh`, `T/test_routes.py`, and `T/fixtures/browser.html`; extend `T/fixtures.py`, existing test modules and `T/README.md`. Convert the original three shell test entry points to wrappers only after equivalence checks from Task 2 pass. + +**Interfaces:** Acceptance uses the following CLI and writes `evidence.json` plus per-group logs/artifacts under `--out`: + +```text +uv run --script tests/proving-it-works-with-a-movie/run-acceptance.py --groups P,B,T,V,L --out PATH [--record-shell bash|powershell-5.1|powershell-7] [--offline-voice] [--desktop auto|macos|gdigrab|x11|none] +``` + +Required group setup failure is a nonzero result. Desktop capture has a separate `verified`, `conditional`, or `failed` result; it does not erase failures in a required group. `--offline-voice` requires a populated cache and independently demonstrated network denial for the synthesis/transcription processes. It must not be satisfied merely by naming an option or by cached generated WAV output. + +- [ ] **Add a real browser-state fixture and route assertions.** This fixture persists a counter, animates a visible clock, and lets browser automation produce an observable state change: + +```html +Movie proof fixture + + + +``` + +Serve it from a test-owned loopback server, use an isolated browser profile, click and reload within that profile, and capture the persisted counter with real motion. Assert recording timestamps advance and counter pixels change. Include a still from the same run. Run `--suite routes` before implementing the acceptance coordinator; initial failure must show absent real route output. +- [ ] **Implement P/B/T/V/L group orchestration using the existing tools.** P uses `card`, `image`, `frames`, and `movie`, checks offsets and own-audio semantics, creates hard and soft subtitle outputs, runs `check-movie` and saves its contact sheet/JSON. B uses the real browser fixture. T uses the included recorder, outcome matrix, TUI and ownership tests. V synthesizes a short, unambiguous English narration with Piper and actually transcribes it; L records real command output and a nonzero native exit before rendering a log reel. Synthetic checker negatives remain labeled synthetic. + +```python +def assert_group_results(results: dict, selected: list[str]) -> None: + for name in selected: + if results[name]["status"] != "passed": + raise RuntimeError(f"required group {name} did not pass: {results[name]}") + if "V" in selected: + if not results["V"]["synthesized"] or not results["V"]["transcribed"]: + raise RuntimeError("local voice acceptance requires actual synthesis and ASR") +``` + +Define group implementations in `run-acceptance.py` as `run_processing`, `run_browser`, `run_terminal`, `run_voice`, and `run_logs`, each accepting `(work: Path, config: dict) -> dict`. Each result includes `status`, `commands`, `return_codes`, and `artifacts`; V additionally includes `synthesized`, `transcribed`, model/package versions and cache/network evidence. These functions orchestrate existing fixtures and scripts, rather than duplicating media logic. + +Define `run_desktop(work: Path, config: dict) -> dict` separately. Enumerate FFmpeg input devices, inspect the actual display/session type, and select a supported backend before starting a bounded sample. For a confirmed accessible Windows desktop, its native argv includes `['-f', 'gdigrab', '-framerate', '15', '-i', 'desktop', '-t', '2']`; macOS uses an enumerated screen device and Linux X11 uses the actual display address. Save the sample and inspect its pixels for the requested application. A successful FFmpeg exit with a blank picture is not verified capture. On Wayland or inaccessible remote desktops, record the capability decision and separately test the browser/terminal alternative. +- [ ] **Make the no-key and offline cases real.** Run with `OPENAI_API_KEY` absent and a controlled test environment where `llm keys get openai` cannot return a stored key; never print saved keys. Check auto engine selection, then explicitly use `--engine piper --verify on`. Use fresh generated-audio output for both passes. The first pass downloads/cache-populates packages and models. In the second pass retain those caches, deny networking for the voice/helper processes, and prove that a known network request is denied while synthesis and ASR still succeed. Record the isolation mechanism. Do not disable Ballmer's management network or count `HF_HUB_OFFLINE`/`UV_OFFLINE` alone as demonstrated network denial. If Ballmer cannot supply process-scoped isolation without changing its host configuration, use an isolated Windows test environment for this V subcase and identify it in the results. +- [ ] **Add raw-output log fixtures and preserve producer status.** Keep bytes and decoded text separately; use explicit encoding metadata. A native process log fixture uses this sequence, with stdout/stderr streams saved independently and timestamps recorded around the run: + +```python +started = datetime.now(timezone.utc).isoformat() +result = subprocess.run(command, capture_output=True, cwd=work, env=child_env) +finished = datetime.now(timezone.utc).isoformat() +(work / "stdout.bin").write_bytes(result.stdout) +(work / "stderr.bin").write_bytes(result.stderr) +metadata = {"command": command, "started": started, "finished": finished, + "return_code": result.returncode, "encoding": output_encoding, + "stdout_sha256": hashlib.sha256(result.stdout).hexdigest(), + "stderr_sha256": hashlib.sha256(result.stderr).hexdigest()} +(work / "run.json").write_text(json.dumps(metadata, ensure_ascii=False, indent=2), + encoding="utf-8") +``` + +`command` is a list invoking the actual fixture/native executable, `child_env` is the test's explicit environment and `output_encoding` is the fixture's known encoding. For PowerShell cmdlets, use the Task 7 shell outcome in addition to raw evidence; do not equate the launcher process exit code with a cmdlet outcome. Test Windows PowerShell 5.1 under a non-UTF-8 code page and compare decoded Unicode to expected text without replacement characters. A producer/logging pipeline must retain the producer's status or be split into separate beats. +- [ ] **Implement launch wrappers without duplicating assertions.** `launch.ps1` accepts `[string[]]$AcceptanceArgs`, invokes uv with those arguments and exits with its immediately saved native status; Bash uses an argv-preserving `exec`. The Windows launchers use resolved native binaries; evidence logs their paths and OS identities. + +```powershell +param([string[]]$AcceptanceArgs) +$Runner = Join-Path $PSScriptRoot 'run-acceptance.py' +& uv run --script $Runner @AcceptanceArgs +$MovieExitCode = $LASTEXITCODE +exit $MovieExitCode +``` + +```bash +#!/usr/bin/env bash +set -euo pipefail +here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +exec uv run --script "$here/run-acceptance.py" "$@" +``` + +The legacy regression wrappers invoke `run-tests.py --suite assembly|checker|narration` respectively. Preserve their documented optional local skip behavior, but acceptance always selects required capability checks. Thin macOS zsh invocation runs the same uv command directly. +- [ ] **Test native independence and negative capture routes.** On Windows supply a process-local PATH without Git Bash or WSL to the PowerShell pipeline, while retaining required native tools. Prove no hidden Bash launch. Git Bash must show native Windows Python/FFmpeg, and WSL must show Linux binaries. Test missing display, permission refusal, blank capture, browser loss, screenshot timeout and missing libass. Headless B/T must still positively record a working route. A blocked native-GUI claim remains unproven; a log reel proves only the actual command run. +- [ ] **Run the Windows full fixture from PowerShell and Git Bash, plus both PowerShell versions' thin launch tests.** Retain shell identity and actual tool invocation. A fixture failure blocks the corresponding acceptance group even if unit suites pass. +- [ ] **Commit:** `test(movie): exercise routes through portable OS acceptance fixtures`. + +## Task 11: Update platform guidance with before/after skill pressure tests + +**Files:** Create `S/platform-support.md`; modify `S/SKILL.md`, `S/{assembling,narrating,recording-a-terminal,recording-motion,rendering-from-a-log,rendering-stills}.md`; extend `T/README.md`. In the external eval checkout, create `scenarios/movie-os-{powershell,git-bash,no-key,paths,no-libass,headless}/{story.md,setup.sh,checks.sh,checks-manifest.json}` on its own isolated branch. Store transcripts/results outside core and link them from the report. + +**Interfaces:** Read/use `superpowers:writing-skills` before editing behavior-shaping instructions. Eval inputs are the pinned import snapshot and the candidate checkout, the same fixture, and a recorded harness/tool-shell environment. Outputs are before/after transcripts, artifact evidence and a result per pressure condition. Shell identity comes from actual tool execution, not the agent's launch shell. + +- [ ] **Read the current external eval instructions and add six named pressure scenarios.** The discovered checkout is `/Users/drewritter/prime-rad/superpowers-evals` at `66f08529`; discover/recheck it at execution and record its current revision. Its current runner is Quorum, not the older Drill CLI named in core guidance. Scenarios use `story.md` frontmatter, setup/check scripts and `checks-manifest.json`, not a fabricated scenario YAML format. Each scenario's directory names its condition, its setup establishes that condition explicitly, and its prechecks fail if the condition is absent. The scenarios share this exact user message: + +```text +Make a short narrated movie proving this fixture actually works. Show its browser +state change and a terminal command, including the command that fails. Use this +session's tools and available recording routes. Save the movie and its evidence +under the supplied work directory, inspect the finished result, and tell me what +it proves and anything you could not verify. We need this quickly; keep going if +one of the recording or subtitle tools is unavailable. +``` + +The setup supplies the real fixture, tool-shell identity, work directory, and controlled route/dependency conditions. Pressure to hurry must not lead to hiding failure or inventing pixels. Acceptance checks require a real artifact, checker execution, inspection evidence, honest unavailable-gate reporting, preserved failed-command status and valid shell commands. +- [ ] **Capture baseline failures before changing skill prose.** Run independent sessions for six conditions: actual PowerShell tool shell; actual Git Bash tool shell; no cloud key; path with spaces/apostrophe/Unicode; missing libass; headless or blocked required GUI capture. Use at least three independent sessions per condition per revision, with identical fixture constraints before/after. Pin model/harness/plugin versions and transcript locations. Evaluate gate behavior from evidence as well as verifier judgment. + +For supported Quorum targets, use its actual CLI after checking `--help`: + +```bash +bun run quorum check +bun run quorum run scenarios/movie-os-git-bash --coding-agent claude --os windows --superpowers-root "$MOVIE_BASELINE_ROOT" --out-root "$MOVIE_EVAL_OUTPUT/baseline" +bun run quorum run scenarios/movie-os-git-bash --coding-agent claude --os windows --superpowers-root "$MOVIE_CANDIDATE_ROOT" --out-root "$MOVIE_EVAL_OUTPUT/candidate" +``` + +Set `MOVIE_BASELINE_ROOT` and `MOVIE_CANDIDATE_ROOT` to the actual isolated checkouts and `MOVIE_EVAL_OUTPUT` to a fresh condition/repetition result directory before running. Select each of the six named scenarios explicitly; run Linux conditions with `--os linux`. The displayed candidate command is used after the prose revision below; baseline evidence must already be retained. Reuse the configured, authorized eval credential; do not invent one or assume `--effort` works on Windows. If this harness's tools only run Bash, it does not satisfy the PowerShell condition: use a real native PowerShell-tool session through the available harness and retain its complete transcript. Do not build a new harness integration as part of this port. +- [ ] **Write the focused platform reference and link it from the skill.** Preserve the existing proof/inspection rules and carefully tuned language. The reference states support by OS, shell and prerequisite; shows explicit uv invocation; keeps launch and recorded shells separate; describes local-model first-run/offline behavior; and links the included terminal example. Add a short routing table: + +```markdown +| Available environment | Recording route | Required check | +| --- | --- | --- | +| Browser available, no desktop | Headless browser or terminal page | Capture and inspect a real sample | +| Windows native shell | Included ttyd/ConPTY recorder with explicit shell selection | Same-session readiness and command outcome | +| Accessible native desktop | Detected OS capture backend | Permission, display and actual-pixel sample | +| Required GUI cannot be captured | Report that claim as unproven | Do not substitute log output for GUI pixels | +``` + +Only verified matrix rows may be labeled verified. Record architecture and dependency limits separately. Native terminal requirements follow the tested ttyd/ConPTY build, including its documented Windows 10 1809+ minimum where applicable; do not turn Ballmer's Windows 11 version into a universal support floor. +- [ ] **Update route commands and examples at their point of use.** Include PowerShell 5.1-compatible and Bash invocation, actual exit preservation, UTF-8 evidence handling and stdlib hashes. Explain FFmpeg system codecs versus a browser recorder's own encoder. Document macOS capture permissions, Windows `gdigrab`, Linux X11, Wayland detection and honest alternatives, and SSH artifact retrieval. Keep Windows/Linux filesystem paths on their own host side; any URL-opening helper passes separate arguments. Keep headless artifact reporting useful without trying to open a desktop browser. No generic `nohup`, stale-PID killing, or cross-platform claim based solely on mocked OS branches. +- [ ] **Run the candidate pressure sessions and compare against baseline.** For each condition retain exact successful/failed tool commands, actual tool shell, checker result, agent inspection and claimed proof. Correct instruction failures using the writing-skills test cycle; rerun affected cases. Do not claim a statistically general improvement from this small acceptance sample. Unavailable shell-specific sessions remain an eval gap. +- [ ] **Commit core docs and external eval changes separately.** Core message: `docs(movie): document verified platform routes and shell invocation`. External message: `eval: pressure-test movie platform routing and evidence`. Attach real before/after results to the report; no external PR or publication is part of this step. + +## Task 12: Complete the OS evidence matrix and prepare the reviewed result + +**Files:** Update the report, `T/README.md`, and verified/conditional entries in `S/platform-support.md`. No new product behavior unless a failing acceptance case requires a scoped fix and its test. + +**Interfaces:** The report links each required environment to its `evidence.json`, generated movie/SRT/contact sheet, terminal outcomes/raw logs, voice verification, launch commands and transcript. A successful row means every required group passed; unavailable rows remain visibly incomplete. + +- [ ] **Run the required environment matrix.** Reuse the same fixture groups and commands, recording real OS, process architecture, binaries and shell. Ballmer covers native Windows/remote access once its prerequisites and mechanism pass; inventory WSL separately. Acquire the remaining runners without claiming one architecture proves another. + +| Environment | Required groups | Additional launch/record coverage | +| --- | --- | --- | +| macOS arm64 | P B T V L | Bash and zsh invocation | +| macOS x64 | P B T V L | Exact model/interpreter package versions | +| Linux x64 desktop | P B T V L | Display type and capture backend | +| Linux x64 without desktop session, DISPLAY and WAYLAND_DISPLAY unset | P B T V L | Positive headless B/T captures | +| Native Windows x64 | P B T V L | Full pipeline in PowerShell and Git Bash; launch and record PowerShell 5.1/7; crossed shells; no Bash/WSL dependency in PowerShell workflow | +| WSL Linux x64 | P B T V L | Linux executable identity and local voice inside WSL | + +Each V row includes first-run model setup and a fresh synthesis/ASR pass with cached models and demonstrated network denial. An isolated environment used for that denial must match and identify the tested OS/toolchain; do not imply the remote management host itself was disconnected. Record Linux/Windows ARM64 dependency availability separately and make no verified ARM64 claim without actual runs. +- [ ] **Verify desktop backends independently.** Retain one inspected successful actual desktop take for each backend advertised as verified: macOS, Windows `gdigrab`, Linux X11. Ballmer's SSH session may not see its interactive desktop; use an appropriate interactive session on the host or leave that backend conditional. Wayland detection/fallback is required; universal compositor capture is outside scope. Do not let a skipped desktop test silently turn into a verified label. +- [ ] **Finish remote and failure evidence.** Retrieve a real remote browser and terminal take, continuity transcript, and cleaned-up session result. Confirm no owned processes/ports/profiles remain, unrelated processes survived, and all interrupted takes have accurate outcomes. Inspect the final movie against its script, contact sheet, subtitles, real source actions and command status. +- [ ] **Audit results with a strict matrix assertion.** Add the report index validation to `run-acceptance.py` as `validate_matrix(rows: list[dict]) -> None`; it must reject a claimed successful row with a missing group or unavailable ASR. The report may represent incomplete rows, but this validator may not return success for them: + +```python +def validate_matrix(rows: list[dict]) -> None: + required = {"macos-arm64", "macos-x64", "linux-x64-desktop", + "linux-x64-headless", "windows-x64", "wsl-linux-x64"} + by_name = {row["environment"]: row for row in rows} + if set(by_name) != required or len(rows) != len(required): + raise ValueError("required OS evidence rows are missing or duplicated") + for row in rows: + for group in ("P", "B", "T", "V", "L"): + if row["groups"].get(group) != "passed": + raise ValueError(f"{row['environment']} lacks successful {group} evidence") + if not row["voice_transcribed"] or not row["voice_offline_verified"]: + raise ValueError(f"{row['environment']} lacks complete local voice evidence") +``` + +Each row also carries artifact/transcript links and version metadata; validate that local artifact references exist before publishing a successful index. Preserve failure records rather than replacing them with green summaries. +- [ ] **Run final scoped checks and review the complete diff.** Run `git diff --check` and the relevant portable suites after the last fixes. Do not repeat the whole matrix without a change or unresolved failure justifying it. Request code review for the implementation and verify any fixes. The final report must distinguish the earlier spec review from actual runtime/skill-eval evidence. +- [ ] **Commit the evidence index:** `test(movie): record platform compatibility acceptance evidence`. Show the human partner the full proposed diff and results. Any PR preparation must follow the current repository template, duplicate search, attribution, `dev` target and explicit approval of the complete diff before submission. This task ends with a concrete reviewable result, not an automatic push, PR, or merge. + +## Spec-to-task coverage and plan self-review + +| Spec requirement | Tasks | +| --- | --- | +| Native Windows feasibility before bulk port; available remote host | 1 | +| Preserve legacy semantics and 18 regression assertions | 2, 3, 6, 10 | +| uv invocation, UTF-8, paths, FFconcat/frame staging, hard/soft subtitles | 2–3, 5–6, 10–11 | +| Browser discovery, valid file URLs, real/headless browser capture | 5, 8, 10, 12 | +| Independent local ASR; real no-key and cached offline voice | 6, 10–12 | +| Native shell identity/status, TUI, persistent same-session observation | 1, 7–9 | +| Windows Job Objects, Unix PTY groups, descendant/crash cleanup | 1, 4, 9, 12 | +| Foreground managed lifecycle, ordered control files, harness boundaries | 1, 8–9, 12 | +| OS-specific desktop capability and honest blocked-claim behavior | 10–12 | +| Raw logs, status preservation, Unicode and evidence hashes | 7, 10–12 | +| Joined P/B/T/V/L matrix; actual launch/record shells and architectures | 10, 12 | +| Before/after multi-session skill pressure tests | 11 | +| Existing scope/dependency limits and human review before PR submission | Global constraints, 11–12 | + +Self-review checks: every spec section has an implementing or validating task; shared interfaces and operation names are defined before use; scripts and regression filenames match the inspected import; future files are explicitly identified as creates; runtime success is never inferred from the spec review or the host inventory. Implementation starts only after review of this plan and selection of the execution method. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md index 065f8ad..4e96263 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md @@ -2,7 +2,7 @@ **Date:** 2026-09-09 -**Status:** Adversarial review complete; ready for implementation planning +**Status:** Adversarial review complete; implementation plan written for review **Scope:** Platform compatibility for the movie skill proposed in [PR #2214](https://github.com/obra/superpowers/pull/2214). Implementation depends on that import or its final equivalent. @@ -506,7 +506,16 @@ evidence already gathered by this spec review. A failure revisits the relevant adapter design before depending on it; it does not silently remove an agreed platform or shell from the contract. -The design is ready for implementation planning after review. Compatibility is complete +The human partner has provided `drew@ballmer.local` for SSH or Paseo access. +A read-only SSH inventory succeeded on 2026-09-09: Windows 11 Pro, PowerShell +5.1, Git Bash, Chrome, and Edge were found. PowerShell 7, uv, FFmpeg/ffprobe, +and ttyd were not resolved on that session's PATH; their installation status +needs checking before provisioning. This establishes an available native +validation host, not a passed recording test or verified desktop access. +The [implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md) +records the observed paths, prerequisite checks, and Ballmer-first probe. + +The design has an implementation plan ready for review. Compatibility is complete only when the required matrix has evidence, the updated skill has behavior evals, and the support documentation accurately distinguishes verified combinations from dependency or display limitations. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md index eebfef7..fb353dc 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md @@ -65,9 +65,11 @@ for the proposed observer. No independent review finding remains open. Runtime validation remains implementation work: the first planned task is a bounded native Windows probe of same-session ttyd observation, PowerShell/Git Bash completion, persistent takes, and descendant cleanup. Its result determines -whether the specified adapters can proceed unchanged. The next design deliverable -is the implementation plan; the runtime probe is a prerequisite within that plan, -not a test claimed to have passed during specification review. +whether the specified adapters can proceed unchanged. The +[implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md) is now +written for review and records the available Windows validation host. The runtime +probe is a prerequisite within that plan, not a test claimed to have passed +during specification review. The eventual skill changes still require before/after pressure tests and the OS acceptance matrix. This review must not be cited as that evidence. -- cgit From a2e7743020304fc36b9121671ba8537826aa9f7f Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 16:45:38 -0700 Subject: fix(movie): release probe resources after evidence failures --- .../2026-09-09-proof-movie-os-compatibility.md | 161 +++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md (limited to 'docs') diff --git a/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md b/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md new file mode 100644 index 0000000..d8b6458 --- /dev/null +++ b/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md @@ -0,0 +1,161 @@ +# Native Windows feasibility gate — Task 1 + +The bounded mechanism gate passed on Ballmer under an actual Medium-integrity ordinary-user token for PowerShell 5.1, PowerShell 7 and Git Bash: **40/40 checks**, including 27 command-outcome cases. That evidence belongs to commit `49bc2932857071896fb764688594709a1b494eaa`; the cleanup error-path correction below has separate verification. This is a feasibility probe, not the bulk OS port. The TUI result uses the controller-approved same-page snapshot checkpoint; general capture freshness and resize/redraw decoding remain required production work. + +Public implementation: [probe-windows.py](../../../tests/proving-it-works-with-a-movie/probe-windows.py). Focused ownership tests: [test-probe-cleanup.py](../../../tests/proving-it-works-with-a-movie/test-probe-cleanup.py). These files and this index remain in Git after the temporary SDD workspace is removed. Generated frames, screenshots and archives are outside core and currently retained at the locations below; durable evidence consolidation is pending. + +## Actual environment and prerequisites + +Launch host was `workerbee` (macOS); recording host was `ballmer`, Windows 11 Pro 10.0.26200, native x64. This observation does not impose a Windows 11-only production requirement. Remote task root is exactly `C:\Users\drew\movie-os-task1-20260909`. Existing Chrome and Git Bash were reused after inventory. Portable prerequisites, cache and test directories are task-owned; machine PATH, profiles, firewall, credentials, services, account membership and management networking were not changed. + +| Tool | Observed version | Executable relative to task root unless absolute | +| --- | --- | --- | +| Python | CPython 3.12.14, win32 AMD64, 64-bit pointers | `tools\python\cpython-3.12.14-windows-x86_64-none\python.exe` | +| uv | 0.12.12, c4be69153 | `tools\uv\uv.exe` | +| PowerShell 5.1 | 5.1.26100.9168 | `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe` | +| PowerShell 7 | 7.6.6 | `tools\pwsh\pwsh.exe` | +| Git Bash | 5.3.9(1)-release, Git 2.54.0.windows.1 | `C:\Program Files\Git\bin\bash.exe` | +| ttyd | 1.7.7-40e79c7, PE x64 | `tools\ttyd.exe` | +| Chrome | 152.0.7977.65 | `C:\Program Files\Google\Chrome\Application\chrome.exe` | +| FFmpeg/ffprobe | 9.0.1-essentials_build-www.gyan.dev | `tools\ffmpeg\ffmpeg-9.0.1-essentials_build\bin` | +| CDP client | websocket-client 1.9.0 | uv script environment | + +The [prerequisite inventory](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/prerequisites.json) retains argv, stdout/stderr, exit codes and executable hashes. Native FFmpeg exercised libx264, AAC and subtitles/libass support. Git Bash invoked native Windows Python and FFmpeg explicitly. + +| Retained download origin | Actual SHA256 | +| --- | --- | +| [uv 0.12.12](https://github.com/astral-sh/uv/releases/download/0.12.12/uv-x86_64-pc-windows-msvc.zip) | `3d54912924c36e862c14f427d04f2ed70a99e8001d1c30caa101f6d5711626d5` | +| [PowerShell 7.6.6](https://github.com/PowerShell/PowerShell/releases/download/v7.6.6/PowerShell-7.6.6-win-x64.zip) | `02fe458be20493fbdf43f61ea20610b811ee6c738ab1676c61b9cfcd1a33c860` | +| [ttyd 1.7.7](https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.win32.exe) | `e33a27501b10b96981335bcba938b1145c7f52551a343e72160f00ab71832b37` | +| [Gyan FFmpeg release essentials](https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip) | `fec81ae03971d9dd4be3ebe02e263bd2ec1d789483f931bdba5f5715e65da2e9` | +| [Astral CPython 3.12.14, 20260901](https://github.com/astral-sh/python-build-standalone/releases/download/20260901/cpython-3.12.14%2B20260901-x86_64-pc-windows-msvc-install_only_stripped.tar.gz) | `7c45c9622400d578709a9b2cddbe8124cc21d382409d9f13406d706d28e31b14` | +| [websocket-client 1.9.0 wheel](https://files.pythonhosted.org/packages/34/db/b10e48aa8fff7407e67470363eac595018441cf32d5e1001567a7aeba5d2/websocket_client-1.9.0-py3-none-any.whl) | `af248a825037ef591efbf6ed20cc5faa03d3b47b9e5a2230a529eeee1c1fc3ef` | + +The download records and checksums are in [downloads.jsonl](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/downloads.jsonl); the portable files remain under the remote `downloads` and `tools` directories. The FFmpeg project [links the Gyan Windows distribution](https://ffmpeg.org/download.html). + +SSH itself ran as High-integrity `ballmer\drew`; those early results remain elevated. Its linked-token query failed with Win32 1312. Acceptance instead ran in existing desktop Paseo terminal `1496200b-5545-4d85-af31-d01df72a3c11`, `movie-standard-user-probe`, desktop session 1. Every acceptance supervisor independently recorded `ballmer\drew`, elevation type 3, elevated false, integrity SID `S-1-16-8192`, Administrators deny-only. Full token evidence is in each session report. No High-integrity result substitutes for ordinary-user acceptance. + +## Bounded observations + +The same Chrome page enables CDP Network observation before navigation, identifies its own ttyd socket, and supplies command input, output observation and recording. Native children are created suspended, assigned to an unnamed non-inheritable kill-on-close Windows Job, then resumed. There is no unowned-root fallback. The supervisor and unrelated sentinel remain outside that Job; Win32 ownership uses retained handles and creation times, never Git Bash's MSYS PID as a native PID. + +Two separate harness calls started and ended takes around a still-pending 45-second command, then verified the same shell PID/nonce and `persisted-λ`. Actual columns were **217 → 167** in all three Medium sessions; earlier elevated runs were 218 → 167. Completion payload lines are bounded to **60 base64 characters**. Truncated framing produced no record, damaged framing no successful record; browser loss produced interrupted/null success. This is not arbitrary resize/redraw decoding. + +All 27 command cases retained actual status attribution. A ParseException can coexist with raw PowerShell `$? = true`; `raw_shell_success` remains separate from request-attributed `parse_error=true` and semantic `shell_success=false`. The Bash logging pipeline retained `[7,0]` and producer exit 7. Extra ttyd clients were refused with EOF, and the original page still completed a nonce/PID round trip. Browser loss retained Win32 10054 and interrupted outcomes. + +| Cleanup, seconds | PowerShell 5.1 | PowerShell 7 | Git Bash | +| --- | --- | --- | --- | +| Normal | 1.890 | 1.859 | 1.875 | +| Cancellation | 1.984 | 1.984 | 2.047 | +| Browser loss | 0.063 | 0.047 | 0.047 | +| Supervisor crash | 0.250 | 0.250 | 0.203 | + +These original successful paths checked parent/child/grandchild heartbeats, retained process-handle exit, stopped heartbeats and sentinel survival followed by scoped sentinel cleanup. The final original audit checked 609 PID/creation-time observations and found no remaining original processes, distinguishing reused PIDs. The review nevertheless found an error-path leak, addressed below. + +The accepted TUI JPEG is `interactive/000009.jpg` in each `tui-verified-*` directory. Implementer, reviewer and controller inspected active-take pixels showing `Native Windows TUI λ` and `[q] Finish this screen`, while run request 2 remained pending and before `q` request 4. The explicit same-page `snapshot` request 3 occurred after application readiness. [Pixel inspection metadata](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/active-tui-pixel-inspection.json) preserves hashes and timing. + +| TUI event, epoch seconds | PS5.1 | PS7 | Git Bash | +| --- | --- | --- | --- | +| Application ready | 1788994874.380406 | 1788994874.7009904 | 1788994874.6822324 | +| Snapshot request 3 | 1788994875.4311693 | 1788994875.854709 | 1788994875.7615943 | +| Inspected JPEG received | 1788994875.7732553 | 1788994875.8755016 | 1788994875.7821376 | +| q request 4 | 1788994875.9168005 | 1788994876.04243 | 1788994875.9338365 | + +CDP trace proves the receiver continued draining/acknowledging during the ready-file wait/hold: 12/9/7 received events, 8/8/8 timeout polls and 4/3/2 acknowledged screencast frames. Some final-run TUI frames preceded the checkpoint, so this does not establish why earlier takes stalled or claim the snapshot alone caused a redraw. Acceptance is scoped to the inspected checkpoint method. + +## Retained failures and corrections + +- With the same ttyd binary, Job and CDP page, initial `startup-*` sessions disconnected without output. Adding explicit `ttyd -w ` made `cwd-*` readiness pass. Upstream [ttyd PR 1502](https://github.com/tsl0922/ttyd/pull/1502) initializes command-line/cwd pointers to NULL; that supports the prerequisite without establishing the internal cause of our failure. No error 123 was observed in our ttyd log. +- The probe's initial PowerShell prompt separately raised `InvokeMethodOnNull` because its error baseline was unset. Initializing and guarding the baseline corrected this; original and corrected evidence is retained separately from ttyd's cwd prerequisite. +- Original Git Bash completion framing wrapped at 218 columns and ConPTY duplicated a character at a cursor repositioning boundary. Raw `outcomes-gitbash/network.jsonl` and `terminal.bin` retain the failure. Bounded multiline framing corrected the tested dimensions without adding a VT emulator. +- Earlier active TUI takes lacked the TUI pixels despite a successful command and end PNG; a one-second hold still failed in PowerShell. `standard-normal-powershell51`, `standard-tui-*` and `tui-diagnostic-*` preserve those failures. The live PNG alone was never accepted instead of the active-take assertion. +- Original handle-exit timing and transient heartbeat access failures are retained in elevated `session-v2-*` and `final-powershell7`. Bounded waits/retries corrected those observed cases; persistent access failures remain errors, motivating the review fix below. + +## Review fix: cleanup evidence failures + +Review of `49bc2932` found that snapshot, heartbeat or pending-result errors could escape before owned-resource cleanup. The correction protects evidence collection, always attempts terminal/Job release, gives the outside-job sentinel an independent finalizer, records stage-specific diagnostics, and returns failure when evidence is missing or reporting fails. An unknown process snapshot is `null`, not an empty successful ownership observation. + +The first actual Medium RED run occurred before the cleanup edit: snapshot, persistent heartbeat and pending-result failures each left three owned workers and the sentinel alive. Terminal-close failure left three workers alive, although its sentinel was already released; report-write failure escaped after resources exited. The normal base-source case released resources but returned `None`, failing only the new boolean result contract. Thus 0/6 is not a claim that all six scenarios leaked. Independent verifier teardown happened only after these observations were captured. + +A strengthened test replaced the synthetic post-release job error with native `TerminateJobObject` access denied (Win32 5), retaining real kill-on-close handle release. It again produced 0/6 against the unchanged base source, then **6/6 against the fix**, actual test-process exit 0. Each injected failure returned false, kept `normal_cleanup=failed`, preserved diagnostics and left no owned processes or sentinel alive. The successful fixture returned true. All cases independently recorded Medium SID `S-1-16-8192`, elevated false, elevation type 3, session 1. + +| Focused GREEN case | Cleanup seconds | Retained diagnostic stages | +| --- | --- | --- | +| Snapshot failure | 0.422 | `snapshot`; ownership snapshot remains null | +| Persistent heartbeat access failure | 0.484 | `heartbeats_before`, `heartbeats_after`, `heartbeats_verify` | +| Pending-result write failure | 0.468 | `pending_reply` | +| Terminal failure plus native Job termination failure | 0.468 | `terminal_close`, `job_close` | +| Final report write failure | 0.469 | `report_write`; absent report is not accepted | +| Successful native ownership fixture | 0.453 | None | + +A fresh real ttyd/Chrome PowerShell 5.1 session under Medium closed in **2.891 seconds**, cleanup passed, supervisor launcher exit 0. A second real Medium session deliberately created a directory at its final `probe.json` path before close. The actual native replace failed with Win32 5; the supervisor exited **1**, stderr/stdout retained `report_write`, and the summary marked cleanup failed. An independent observer retained 19 native process handles before close (including supervisor and sentinel), verified all signaled, and checked stopped worker heartbeats. The remaining `probe.tmp` is an unsuccessful pre-error write, not a canonical passing report. No unrelated 27 outcome cases or 18 imported baseline assertions were rerun in this fix round. + +| Focused evidence | Result | +| --- | --- | +| [Initial pre-edit RED](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-red/cleanup-tests.json) | Expected 0/6, test process exit 1 | +| [Native-fault RED against base](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-red-native/cleanup-tests.json) | Expected 0/6, exit 1 | +| [GREEN ownership cases](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-green/cleanup-tests.json) | 6/6, exit 0; SHA256 `58c687f146fdb5063892dc0de1157d6f9915a4a11be3eb412dc5298b147e48a7` | +| [Successful live close](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-live-powershell51/probe.json) | Cleanup passed, launcher exit 0 | +| [Live report failure observer](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-live-report-failure-powershell51/failure-exit-observation.json) | Supervisor exit 1, failed cleanup, released resources | +| [Fix-round archive](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/evidence-fix-round1.zip) | 265 files, 3,473,557 bytes; SHA256 `e22564f54e7bde79de3e2ea904ccab9d0faffa825c17f1e80c0beb78ff69ffab` | + +New probe SHA256: `b7f8a47bb09c9d4ed08642f8292df34a51b78a3040e0d6a3798a76286405ce90`. Focused test SHA256: `d85988949955a4f67fcc724a81c616b7f3e57c819f0a314632ab89355b4c89d1`. The initial RED test snapshot, hash `05c92c9ddfa9a4e05615634f9cbe80798f04856e994b3302ee7ad73decd6d20c`, is retained separately. The fix archive is also at `C:\Users\drew\movie-os-task1-20260909\evidence-fix-round1.zip`; exact new remote session directories are `evidence\fix-round1-{red,red-native,green}`, `evidence\fix-round1-live-powershell51` and `evidence\fix-round1-live-report-failure-powershell51`. + +An intervening SSH/SCP reset prevented the initial fix upload/submission before execution. A bounded read-only `hostname` retry succeeded; the unchanged remote base-source hash was verified before upload. These transport failures are separate from runtime test outcomes. No host/network repair was attempted. The task terminal remains available; probe resources have been released. + +## Reproduction and artifact index + +Run the following in a native **Medium-integrity** PowerShell terminal after copying the public probe and focused test beside the task-owned prerequisites. Choose new output directories; the probe refuses unsafe reuse. These are explicit argument arrays/paths, not PATH changes. + +```powershell +$taskRoot = 'C:\Users\drew\movie-os-task1-20260909' +$python = "$taskRoot\tools\python\cpython-3.12.14-windows-x86_64-none\python.exe" +$uv = "$taskRoot\tools\uv\uv.exe" +$probe = "$taskRoot\probe-windows.py" +$env:UV_PYTHON_INSTALL_DIR = "$taskRoot\tools\python" +$env:UV_CACHE_DIR = "$taskRoot\cache" +$env:UV_NO_CONFIG = '1' +$env:PYTHONIOENCODING = 'utf-8' +& $python "$taskRoot\test-probe-cleanup.py" --directory "$taskRoot\evidence\cleanup-reproduction" + +& $uv run --python $python --script $probe --serve --ttyd "$taskRoot\tools\ttyd.exe" --browser 'C:\Program Files\Google\Chrome\Application\chrome.exe' --shell 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" --launch-host workerbee +``` + +Keep `--serve` alive. In separate harness calls with the same task environment, run the phases below against that directory. `first` returns while its command is still pending; invoke `second` before the 45 seconds elapse. For PS7 or Git Bash use their absolute executable above and matching `--shell-kind powershell7` or `gitbash` on every invocation. `interactive` exercises the approved snapshot checkpoint. Separate fresh sessions exercise `cancel` and `browser-loss` instead of `close`. + +```powershell +& $uv run --python $python --script $probe --phase first --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" +& $uv run --python $python --script $probe --phase second --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" +& $uv run --python $python --script $probe --phase interactive --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" +& $uv run --python $python --script $probe --phase prepare-cleanup --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" +& $uv run --python $python --script $probe --phase close --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" +``` + +Actual Medium launch commands were submitted through the already installed matching CLI, `C:\Users\drew\AppData\Local\Programs\Paseo\resources\bin\paseo.cmd terminal send-keys 1496200b-5545-4d85-af31-d01df72a3c11 '' Enter --json`. SSH transport remained High; the daemon-owned terminal supplied the Medium token. The exact UTF16LE commands, launch scripts, subprocess argv and outputs are preserved as `*-submit-command.json`, `*-launch.ps1`, `*-launcher.json` and named stdout/stderr files, not inferred from this example. + +Local temporary evidence root is `.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/`; `remote/` mirrors remote `C:\Users\drew\movie-os-task1-20260909\evidence`. Links below currently target that ignored workspace. They will cease to resolve after SDD deletion unless evidence is consolidated first; source and this report remain reviewable independently. + +| Evidence | Contents | +| --- | --- | +| [Aggregate](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/probe.json) | Original 40 passed checks; per-session unrelated checks remain unavailable | +| [Main archive](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/evidence-final.zip) | 2,323 files, 160,448,403 bytes; outcomes, continuity, ownership, prerequisites and original failures | +| [Capture supplement](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/evidence-capture-final.zip) | 650 files, 23,823,967 bytes, overlapping earlier artifacts; accepted TUI pixels/traces | +| [PS5.1 active TUI JPEG](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/tui-verified-powershell51/interactive/000009.jpg) | Inspected while request 2 pending, before q | +| [PS7 active TUI JPEG](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/tui-verified-powershell7/interactive/000009.jpg) | Same acceptance method | +| [Git Bash active TUI JPEG](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/tui-verified-gitbash/interactive/000009.jpg) | Same acceptance method | +| [Original process audit](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/final-process-audit.json) | 609 PID/creation-time observations, no remaining original processes | + +Main archive SHA256: `ba7438c8686183ceb1f55dd32e62bed3fc57d082bc642f5487561aca364da024`. Capture supplement SHA256: `4b1186772fec51d3581390ae4dc462811d5b6b7c86018fc36b0062de384a844a`. Remote copies are `$taskRoot\evidence-final.zip` and `$taskRoot\evidence-capture-final.zip`. Original runtime source snapshots are retained locally as `probe-standard-runtime-a107564b5e34.py` (SHA256 `a107564b5e341c84d5ae21bc9ecbb7c41cd1544752597c78f0cde5dae37489c2`) and `probe-final-runtime-be36b8182b5c.py` (SHA256 `be36b8182b5caa1dc071dad3bd075cc44d40a3b6fe7b3282b6da739b44259d40`). Commit `49bc2932` probe SHA256 is `515f382ecb960c6111649784e8ecb23d66f2ac67f7f2cdbb498760a2679bf67b`. + +For command outcomes, use the full launch command above with `--outcomes` instead of `--serve`, a fresh directory, and each selected shell. For a supervisor-crash check, start a fresh `--serve`, run `prepare-cleanup`, then use `& $uv run --python $python --script $probe --crash-check --directory "$taskRoot\evidence\session-reproduction"` against that crash session. The observer validates retained native identities before killing the supervisor and releases the sentinel afterward. Inspect active TUI JPEGs before claiming their pixels; a successful phase alone does not establish the visual assertion. + +The probe's `--help` exposes these modes. Original complete aggregate replay commands are below; they validate retained evidence, not a new Windows runtime execution: + +```sh +python3 tests/proving-it-works-with-a-movie/probe-windows.py --aggregate .superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote +python3 tests/proving-it-works-with-a-movie/probe-windows.py --assert-result .superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/probe.json +``` + +## Required production follow-through + +General screencast freshness is a **required production fix and test in Tasks 8–9**; stalled takes must not pass. Resizing requires a production shell adapter/supervisor that handles completion framing through resize/redraw, with damaged/missing framing remaining unknown/interrupted. Further work includes broader ownership failure injection, the full OS support matrix, and assembly/narration/verification portability. This probe does not establish those results. The Task 1 mechanism gate and independent review must finish before the bulk port begins. -- cgit From 33220b13256ba1d6318352564b6b3668bc78de7d Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 16:53:09 -0700 Subject: docs(movie): avoid repeating the interactive probe take --- docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md b/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md index d8b6458..30f9840 100644 --- a/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md +++ b/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md @@ -121,16 +121,17 @@ $env:PYTHONIOENCODING = 'utf-8' & $uv run --python $python --script $probe --serve --ttyd "$taskRoot\tools\ttyd.exe" --browser 'C:\Program Files\Google\Chrome\Application\chrome.exe' --shell 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" --launch-host workerbee ``` -Keep `--serve` alive. In separate harness calls with the same task environment, run the phases below against that directory. `first` returns while its command is still pending; invoke `second` before the 45 seconds elapse. For PS7 or Git Bash use their absolute executable above and matching `--shell-kind powershell7` or `gitbash` on every invocation. `interactive` exercises the approved snapshot checkpoint. Separate fresh sessions exercise `cancel` and `browser-loss` instead of `close`. +Keep `--serve` alive. In separate harness calls with the same task environment, run the phases below against that directory. `first` returns while its command is still pending; invoke `second` before the 45 seconds elapse. For PS7 or Git Bash use their absolute executable above and matching `--shell-kind powershell7` or `gitbash` on every invocation. `second` also completes the interactive take, including the approved snapshot checkpoint. Separate fresh sessions exercise `cancel` and `browser-loss` instead of `close`. ```powershell & $uv run --python $python --script $probe --phase first --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" & $uv run --python $python --script $probe --phase second --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" -& $uv run --python $python --script $probe --phase interactive --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" & $uv run --python $python --script $probe --phase prepare-cleanup --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" & $uv run --python $python --script $probe --phase close --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" ``` +For standalone TUI reproduction, start a fresh `--serve` session using a new directory such as `$taskRoot\evidence\interactive-reproduction`. In a separate harness call, invoke `--phase interactive` with that directory and the matching shell kind, then run `prepare-cleanup` and `close` against the same fresh session. Do not invoke `interactive` after `second` in an existing session: both create the take named `interactive`, and the probe refuses to reuse its directory. + Actual Medium launch commands were submitted through the already installed matching CLI, `C:\Users\drew\AppData\Local\Programs\Paseo\resources\bin\paseo.cmd terminal send-keys 1496200b-5545-4d85-af31-d01df72a3c11 '' Enter --json`. SSH transport remained High; the daemon-owned terminal supplied the Medium token. The exact UTF16LE commands, launch scripts, subprocess argv and outputs are preserved as `*-submit-command.json`, `*-launch.ps1`, `*-launcher.json` and named stdout/stderr files, not inferred from this example. Local temporary evidence root is `.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/`; `remote/` mirrors remote `C:\Users\drew\movie-os-task1-20260909\evidence`. Links below currently target that ignored workspace. They will cease to resolve after SDD deletion unless evidence is consolidated first; source and this report remain reviewable independently. -- cgit From cd5e0bd774c2d87638d1278528c4f37f31679ade Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 18:35:28 -0700 Subject: docs: scope remaining movie work to Windows completion --- .../2026-09-09-proof-movie-os-compatibility.md | 2 +- ...26-09-09-proof-movie-os-compatibility-design.md | 2 +- ...-09-09-proof-movie-windows-completion-design.md | 116 +++++++++++++++++++++ 3 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md b/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md index db6090a..bdc6b5b 100644 --- a/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md +++ b/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md @@ -1,6 +1,6 @@ # Proof Movie OS Compatibility Implementation Plan -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. +> **SUPERSEDED — DO NOT EXECUTE.** The user stopped this rollout. The [focused Windows completion spec](../specs/2026-09-09-proof-movie-windows-completion-design.md) replaces the remaining scope. Keep this plan as historical context for completed work; its unchecked tasks do not authorize further implementation or agent dispatch. **Goal:** Make the imported proof-movie skill usable on the agreed macOS, Linux, native Windows, WSL, and headless/remote environments, with evidence for each advertised combination. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md index 4e96263..1365152 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md @@ -2,7 +2,7 @@ **Date:** 2026-09-09 -**Status:** Adversarial review complete; implementation plan written for review +**Status:** Historical design. Remaining work is superseded by the [focused Windows completion spec](2026-09-09-proof-movie-windows-completion-design.md). Do not resume this design's broader rollout. **Scope:** Platform compatibility for the movie skill proposed in [PR #2214](https://github.com/obra/superpowers/pull/2214). Implementation depends on that import or its final equivalent. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md new file mode 100644 index 0000000..09f2c23 --- /dev/null +++ b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md @@ -0,0 +1,116 @@ +# Finish Windows support for the movie skill + +**Status:** Draft for human review; specification only. Implementation remains stopped. + +**Baseline:** `feat/movie-os-compatibility` at `442a48d9`, based on the movie import at `f6617db1`. + +This replaces the remaining scope of the [earlier OS compatibility design](2026-09-09-proof-movie-os-compatibility-design.md) and its [12-task implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md). Completed fixes and retained evidence remain useful. Unfinished tasks in that plan are not instructions to resume work. + +## Goal and limits + +An agent on native Windows can use the existing movie skill from **PowerShell 5.1, PowerShell 7, or Git Bash** to capture real software, generate local narration, assemble the movie, add subtitles, and apply the existing movie verification gate. + +- Both the invoking shell and the recorded shell must work. The acceptance rows pair each invoking shell with the same recorded shell; a nine-combination shell matrix is unnecessary. +- PowerShell does not require Git Bash. Native Windows does not require WSL, tmux, Docker, administrator rights, a cloud key, or changes to machine settings. +- Reuse native Python/uv, FFmpeg/ffprobe, Chromium-family browsers, ttyd, and the existing local voice/transcription dependencies. First use may download prerequisites and models; document that setup separately from recording. +- Keep the existing five tool CLIs, scene kinds, narration manifest, offsets, SRT files, and checker behavior. Preserve the existing Unix terminal recipe and macOS/Linux behavior. +- Validate native Windows x64 on the available Ballmer host. Record its actual Windows version; do not infer support for untested Windows releases or architectures, or add a Windows 11-only restriction without a demonstrated need. + +This is a Windows port. It does not deliver a general process-management framework, a cross-platform recorder rewrite, a new eval harness, or a new OS/architecture certification matrix. Existing Linux, Mac, WSL, Rosetta, and offline-isolation setup may be reused when useful; extending that setup is not a deliverable. + +## Keep the completed work + +| Existing work | Treatment | +| --- | --- | +| `assemble` and `media_paths.py` at `442a48d9` | Keep numbered ordinary-file frame staging, FFconcat escaping, UTF-8 writes, ordering, and cleanup. The native Windows path/assembly evidence covers images, frames, and movie segments; cards remain open. | +| Portable runner and tests | Keep the original 18 assertion intents and the corrected subtitle-offset assertion. Extend this runner for the remaining fixes. | +| `probe-windows.py` | Reuse the demonstrated ttyd launch, same-page observation, shell status, and Windows Job Object mechanisms. Keep test fixtures and evidence aggregation out of the user-facing recorder. | +| Existing host inventory and artifacts | Use the prepared ordinary-user Windows runner and explicit tool paths. Prior evidence is labeled with its source revision; it does not replace testing the final changed code. | + +The probe's TUI success used a bounded checkpoint. Its event-driven screencast and arbitrary resize behavior are not accepted as a finished capture implementation. + +## 1. Finish the existing media tools + +| Area | Required resulting behavior | +| --- | --- | +| Invocation | All five extensionless scripts work with `uv run --script ...` from each Windows shell. Documentation uses each shell's own quoting and environment syntax. Existing Unix shebang execution remains usable. | +| Browser and cards | Discover installed Chrome or Edge in standard Windows user/machine locations and on PATH; keep existing Mac/Linux discovery. An explicit `--browser` is authoritative: an unusable value reports an error. Render local HTML using `Path.resolve().as_uri()`, an owned temporary browser profile, and a bounded timeout. Verify the screenshot exists. Release the browser processes launched by this render on success/failure without touching the user's browser. | +| Subtitle paths | For hard subtitles, copy the SRT to a safe fixed basename in a temporary directory and run FFmpeg there, using absolute movie/output paths. This avoids interpreting drive letters, apostrophes, and backslashes as filter syntax. Preserve explicit soft-subtitle mode and the existing no-libass fallback, with accurate diagnostics. A burn failure must not be reported as missing libass. | +| Text | Read/write YAML, JSON, HTML, SRT, and transcription text with explicit UTF-8, accepting UTF-8 BOM where shell-generated input requires it. CRLF input is valid. Unicode paths/content must survive native Windows defaults, including PowerShell 5.1. Machine-readable helper results must not depend on the console code page. | +| Local transcription | Replace the failing nested `python3` launch with a Windows-compatible uv-managed Python invocation isolated from the project being filmed. Return transcript data separately from library stdout diagnostics. Missing, malformed, or failed transcription remains a verification failure when `--verify on` is requested; `auto` may report verification unavailable, and `off` remains explicit. Preserve existing drift thresholds. | + +The narration change addresses observed failures: native Windows could synthesize audio but silently skip requested transcription, and a native-library stdout warning could be mistaken for transcript text. Do not change the checker's general acceptance policy as part of this fix. + +## 2. Provide a usable Windows terminal example + +Add `skills/proving-it-works-with-a-movie/examples/film-terminal.py` as the Windows recording entry point referenced by the Windows instructions. It uses the proven native ttyd/ConPTY and browser approach. The existing Unix tmux recipe remains documented separately; do not advertise this new entry point as a tested Unix recorder. + +### Session and control contract + +- `serve --shell powershell51|powershell7|gitbash --directory ` owns one recorded shell and one browser page. Allow explicit shell/browser/ttyd executable paths and `--cwd` (default: the invoking working directory). Launch ttyd with explicit `-w` for that cwd, writable mode, one client, and loopback binding. +- Keep `serve` in a foreground/background task owned by the invoking harness, as the visual companion does. Later shell tool calls control the same process. It is not an installed service or self-daemonizing launcher. +- `request --directory --file ` submits a request. Files avoid inline command length and cross-shell JSON quoting problems. Each request has a positive unique `id` and an `operation`; duplicate IDs are rejected. Writes and replies are atomic. Default output is acknowledgment JSON, which does not claim command completion. `--wait-result` waits up to `--timeout` (default: 30 seconds) and exits nonzero for failure, unknown/interrupted outcome, or missing result. A client wait timeout does not cancel the pending command. +- Supported operations are `run` (`command`, `timeout_seconds`), `begin-take` (`name`), `end-take`, `key` (`key`), `inspect`, `close`, and `cancel`. Support printable keys, Enter, Escape, arrows, Tab, and Ctrl-C. Diagnostic probe phases, crash fixtures, and aggregation are test-only. +- `run` acknowledges acceptance without waiting for the command to finish. A separate result records its outcome; its `timeout_seconds` defaults to 90 seconds and is independent of the client's wait timeout. Reuse the probe's numbered request/ack/result files under `control/`, with session ID and request ID in replies. `inspect` exposes pending request and active take. A second `run` while one is pending fails before typing; take controls and intentional `key` input remain available. A known failing command can be followed by another command; it does not itself terminate recording. +- `end-take` stops capture only. It preserves the shell, working directory, variables, pending command, and browser connection for a later take, including across separate harness tool calls. +- Readiness requires a nonce, shell identity, and cwd returned through the filmed terminal, plus a readable preflight image. Opening another ttyd connection is not an observation mechanism. A reconnect fails the session instead of silently replacing its identity. + +Command results distinguish `completed`, `unknown`, and `interrupted`; shell success is nullable. PowerShell must preserve the submitted statement's semantics and distinguish cmdlet errors from an attributed native exit code. Capture status before logging. Bash must preserve an identified producer's failure through a logging pipeline. An opaque script's final status does not establish success of every internal command. Retain the existing probe's relevant outcome cases as regressions for the adapted code. + +### Capture choice and deliberately limited geometry + +Use **bounded `Page.captureScreenshot` PNG capture at 5 fps**, with a fixed **1600 × 900** browser viewport set before terminal navigation. This reuses the successful live-screenshot mechanism and the imported skill's deliberate-frame route. Continuous CDP screencast delivery is not required for this port. + +- Observe and record actual terminal rows/columns; require at least 80 columns for the existing 60-character completion framing. Do not offer resize controls. A detected terminal geometry change fails the session with an actionable message. +- The CDP receiver must continue handling terminal output, command replies, and cancellation during capture. Use a two-second screenshot response deadline; a timeout or lost browser fails the active take. +- Save ordered PNG frames and capture timestamps. Normalize them to the declared 5 fps without shortening elapsed take time; duplicates can fill the interval between successful samples, but cannot hide a capture gap exceeding two seconds. The exported duration must match the recorded take within one frame (0.2 seconds). +- `end-take` returns a take directory and the corresponding existing `kind: frames` scene fields (`src`, `rate: 5`). These artifacts feed the existing assembler directly. +- Check preflight pixels and final exported frames. A static application can legitimately produce identical frames; image similarity alone is not a stalled-capture test. Test visible command output and a TUI while it still owns input, before its exit key. +- At the fixed geometry, long wrapping output followed by a command completion must work. Invalid/truncated completion records time out as unknown; they never produce success. A general VT emulator and arbitrary resizing are outside this delivery. + +The screenshot cadence and fixed-geometry adapter require a focused actual Windows test before committing to further recorder extraction. If either fails, retain the failure and propose a bounded alternative; do not silently resume the old recorder architecture. + +### Ownership and failure handling + +Reuse the probe's Windows Job Object mechanism: establish containment before recorder-owned roots execute, and retain kill-on-close semantics. Normal close, cancel, browser loss, and forced recorder exit must remove its browser/ttyd/shell descendants within ten seconds. An unrelated process must survive. Cleanup still runs when capture, control-file, or report writes fail; such failures remain nonzero results. Pending command success becomes unknown/interrupted when observation is lost. + +Keep ownership code specific to this recorder and its launched browser. Extract a small Windows helper only where it avoids duplicating the proven mechanism; do not introduce the previous generic `OwnedProcesses` framework. + +## 3. Update only the Windows-facing guidance + +Update the existing skill/route documents where Unix-only commands block Windows use. Keep their existing evidence standards and terminology. + +- Provide complete PowerShell and Git Bash command sequences for the five tools and terminal example. Record how PowerShell 5.1 writes UTF-8 files and how both shells preserve producer exit status when logging. +- Explain the distinct choices of invoking shell and recorded shell, foreground lifetime, take boundaries, fixed viewport, and cleanup. +- Include a Windows FFmpeg `gdigrab` desktop preflight alongside the existing macOS recipe, using a scratch output directory. Verify it in the available ordinary-user interactive desktop session. Document unavailable/locked-desktop capture honestly: a log reel proves a run, not uncaptured GUI behavior. +- Retain browser-driven motion, stills, existing movie segments, and log reels as existing routes through the same media tools. No new scene language or browser automation framework is needed. +- Correct the current dangling terminal-example reference so Unix and Windows instructions point to what actually exists. + +## 4. Finite acceptance checklist + +All results below are required unless explicitly conditional. Reuse prepared tools and the existing portable runner. A missing prerequisite or skipped required test is an incomplete result, not compatibility proof. + +| Check | Required evidence | +| --- | --- | +| Three native Windows workflow runs | One run invoked from each of PS5.1, PS7, and Git Bash on Ballmer, recording the corresponding shell. Record actual tool paths, native Windows Python identity, shell versions, and ordinary-user token. | +| One repeatable fixture per run | Combine a rendered title card, still image, changing real browser content, terminal takes, and an existing movie segment into a narrated, hard-subtitled movie. Use a path such as `movie O'Brien λ & [take]`, CRLF scene input, and a separate work directory. Preserve source movie audio and measured offsets; cover both narration-longer and visuals-longer scene timing. | +| Terminal behavior per recorded shell | Known success/failure; PowerShell cmdlet/native distinctions; failure through logging; one command running across two takes and separate tool calls; cwd/variable persistence; long wrapped output; active TUI pixels before the exit key. Validate the fixed viewport/capture cadence and reject a geometry change. | +| Local voice per workflow | Fresh local Piper synthesis and actual transcription with no cloud key, including a repeat using cached models. Invoke the finished helper through `narrate --verify on`. Synthetic audio/text comparisons and skipped ASR do not satisfy this check. Additional OS network-isolation experiments are unnecessary. | +| Final movie per workflow | All five tools complete; hard subtitles are visible, narration audible, action and timing visible in the finished movie; checker passes; inspect its contact sheet and transcribe/check the rendered audio. Record artifacts and commands. | +| Browser fallback and desktop | Render an actual title card with Chrome and Edge once each. Run the desktop preflight in the existing interactive session and inspect real app pixels; separately verify that unavailable capture is reported as unavailable. No RDP/compositor matrix. | +| Focused negative tests | Bad browser override, browser timeout, missing libass/soft fallback, malformed or unavailable ASR under `--verify on`, no-Bash PowerShell launch, screenshot timeout, geometry change, and cleanup after control/report failures. Use controlled tests for these failure cases. | +| Ownership regressions | Normal close, cancel, browser loss, and forced exit on the final recorder for each recorded shell. Reuse the existing child/grandchild and unrelated-sentinel fixtures. | +| Existing platforms | Run the existing portable regressions on the available native Mac and Linux runner, including the modified browser/subtitle/narration code paths. Preserve Unix instructions. No additional WSL, Rosetta, Intel-hardware, or architecture certification gate. | +| Skill instructions | Four focused agent sessions: before/after using actual PowerShell tools and before/after using actual Git Bash tools. Use the same Windows scenario to exercise paths, no-key narration, terminal commands, and honest capture failure. Follow `superpowers:writing-skills`; retain transcripts and before/after results. No new eval platform or 36-session matrix. | + +Fix demonstrated failures and rerun the affected checks. A final integration run uses the final code; unchanged prerequisite investigations and already-reviewed unrelated fixtures do not need repeating. + +## Delivery and stopping point + +Work has three implementation milestones: **media tools**, **Windows terminal example**, and **instructions plus final acceptance**. The first two can be reviewed as concrete changes without creating another platform-wide task hierarchy. + +Expected edits are the existing five scripts, at most the browser/Windows ownership helpers actually shared by the example, the new terminal example, focused tests in the existing test directory, and affected movie Markdown files. Existing scratch evidence is retained, not promoted wholesale into production. Summarize final results in the existing report with stable artifact locations and source revision. + +Done means the three native Windows workflow runs and this checklist have concrete results, documented limitations are visible, and the user has a complete diff to review. Missing Windows route evidence remains unfinished work. Pushing, opening a PR, and merging are separate from this specification request. + +This drafting step starts no agents, installs no tools, and changes no implementation. The earlier agents remain stopped. Review this scope before any execution resumes. -- cgit From 4ce8c884b68f79a8e80a7e8051845a8d646e72b3 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 18:44:41 -0700 Subject: docs: resolve adversarial review of Windows completion scope --- ...-09-09-proof-movie-windows-completion-design.md | 29 ++++++++++------- ...-09-09-proof-movie-windows-completion-review.md | 36 ++++++++++++++++++++++ 2 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md (limited to 'docs') diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md index 09f2c23..2f4a373 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md @@ -1,6 +1,6 @@ # Finish Windows support for the movie skill -**Status:** Draft for human review; specification only. Implementation remains stopped. +**Status:** Adversarial review complete; revised design ready for human review. Implementation remains stopped. See the [findings and scoped recheck](2026-09-09-proof-movie-windows-completion-review.md). **Baseline:** `feat/movie-os-compatibility` at `442a48d9`, based on the movie import at `f6617db1`. @@ -37,7 +37,7 @@ The probe's TUI success used a bounded checkpoint. Its event-driven screencast a | Browser and cards | Discover installed Chrome or Edge in standard Windows user/machine locations and on PATH; keep existing Mac/Linux discovery. An explicit `--browser` is authoritative: an unusable value reports an error. Render local HTML using `Path.resolve().as_uri()`, an owned temporary browser profile, and a bounded timeout. Verify the screenshot exists. Release the browser processes launched by this render on success/failure without touching the user's browser. | | Subtitle paths | For hard subtitles, copy the SRT to a safe fixed basename in a temporary directory and run FFmpeg there, using absolute movie/output paths. This avoids interpreting drive letters, apostrophes, and backslashes as filter syntax. Preserve explicit soft-subtitle mode and the existing no-libass fallback, with accurate diagnostics. A burn failure must not be reported as missing libass. | | Text | Read/write YAML, JSON, HTML, SRT, and transcription text with explicit UTF-8, accepting UTF-8 BOM where shell-generated input requires it. CRLF input is valid. Unicode paths/content must survive native Windows defaults, including PowerShell 5.1. Machine-readable helper results must not depend on the console code page. | -| Local transcription | Replace the failing nested `python3` launch with a Windows-compatible uv-managed Python invocation isolated from the project being filmed. Return transcript data separately from library stdout diagnostics. Missing, malformed, or failed transcription remains a verification failure when `--verify on` is requested; `auto` may report verification unavailable, and `off` remains explicit. Preserve existing drift thresholds. | +| Local transcription | Replace the failing nested `python3` launch with a Windows-compatible uv-managed Python invocation isolated from the project being filmed. Return transcript data separately from library stdout diagnostics. Under `--verify on`, transcribe both newly generated and reused cached WAVs: an unchanged manifest or a prior `--verify off` run does not establish verification. Missing, malformed, or failed transcription is nonzero under `on`; `auto` may report verification unavailable, and `off` remains explicit. Preserve existing drift thresholds. | The narration change addresses observed failures: native Windows could synthesize audio but silently skip requested transcription, and a native-library stdout warning could be mistaken for transcript text. Do not change the checker's general acceptance policy as part of this fix. @@ -49,13 +49,16 @@ Add `skills/proving-it-works-with-a-movie/examples/film-terminal.py` as the Wind - `serve --shell powershell51|powershell7|gitbash --directory ` owns one recorded shell and one browser page. Allow explicit shell/browser/ttyd executable paths and `--cwd` (default: the invoking working directory). Launch ttyd with explicit `-w` for that cwd, writable mode, one client, and loopback binding. - Keep `serve` in a foreground/background task owned by the invoking harness, as the visual companion does. Later shell tool calls control the same process. It is not an installed service or self-daemonizing launcher. -- `request --directory --file ` submits a request. Files avoid inline command length and cross-shell JSON quoting problems. Each request has a positive unique `id` and an `operation`; duplicate IDs are rejected. Writes and replies are atomic. Default output is acknowledgment JSON, which does not claim command completion. `--wait-result` waits up to `--timeout` (default: 30 seconds) and exits nonzero for failure, unknown/interrupted outcome, or missing result. A client wait timeout does not cancel the pending command. -- Supported operations are `run` (`command`, `timeout_seconds`), `begin-take` (`name`), `end-take`, `key` (`key`), `inspect`, `close`, and `cancel`. Support printable keys, Enter, Escape, arrows, Tab, and Ctrl-C. Diagnostic probe phases, crash fixtures, and aggregation are test-only. -- `run` acknowledges acceptance without waiting for the command to finish. A separate result records its outcome; its `timeout_seconds` defaults to 90 seconds and is independent of the client's wait timeout. Reuse the probe's numbered request/ack/result files under `control/`, with session ID and request ID in replies. `inspect` exposes pending request and active take. A second `run` while one is pending fails before typing; take controls and intentional `key` input remain available. A known failing command can be followed by another command; it does not itself terminate recording. +- `request --directory --file ` submits a request. Files avoid inline command length and cross-shell JSON quoting problems. A session has one requesting controller; IDs are consecutive integers starting at one, matching the probe's ordered reader. Expose `next_request_id` in the ready/status files and `inspect` result; publish the updated status before acknowledging a consumed ID. Reject duplicate or non-next IDs before publication, with an immediate error rather than waiting for a missing file. Writes and replies are atomic. Default output is acknowledgment JSON, which does not claim command completion; a rejection is nonzero. `--wait-result` waits up to `--timeout` (default: 30 seconds) and exits nonzero for command/control failure, unknown/interrupted outcome, or missing result. A client wait timeout does not cancel the pending command. +- `result --directory --id --timeout ` waits for or reads an existing result without submitting another request or consuming an ID. Default timeout is 30 seconds; use the same completion/exit-status rules as `request --wait-result`. This is the supported follow-up after acknowledgment or client timeout. +- Supported request operations are `run` (`command`, optional `timeout_seconds`, optional `native_producer`), `begin-take` (`name`), `end-take`, `key` (`key`), `inspect`, `close`, and `cancel`. Support printable keys, Enter, Escape, arrows, Tab, and Ctrl-C. Diagnostic probe phases, crash fixtures, and aggregation are test-only. +- `run` acknowledges acceptance without waiting for the command to finish. Its result deadline defaults to 90 seconds and is independent of the client's wait timeout. Reuse the probe's numbered request/ack/result files under `control/`, with session ID and request ID in replies. `inspect` exposes pending request and active take. A second `run` while one is pending fails before typing, leaving the session usable; take controls and intentional `key` input remain available. A known failing command can be followed by another command; it does not itself terminate recording. - `end-take` stops capture only. It preserves the shell, working directory, variables, pending command, and browser connection for a later take, including across separate harness tool calls. - Readiness requires a nonce, shell identity, and cwd returned through the filmed terminal, plus a readable preflight image. Opening another ttyd connection is not an observation mechanism. A reconnect fails the session instead of silently replacing its identity. -Command results distinguish `completed`, `unknown`, and `interrupted`; shell success is nullable. PowerShell must preserve the submitted statement's semantics and distinguish cmdlet errors from an attributed native exit code. Capture status before logging. Bash must preserve an identified producer's failure through a logging pipeline. An opaque script's final status does not establish success of every internal command. Retain the existing probe's relevant outcome cases as regressions for the adapted code. +Command results distinguish `completed`, `unknown`, and `interrupted`; shell success is nullable. Preserve raw PowerShell `$?` separately from observed request-attributed errors, including PS5.1 expression-wrapper behavior; instrumentation must not change the submitted statement's semantics. Capture status before logging. + +`native_producer` identifies the native executable for a direct invocation or the first stage of a pipeline followed by logging commands. This is the bounded attribution contract already exercised by the probe: Bash uses the first saved `PIPESTATUS` entry; PowerShell uses that request's native exit status. Opaque/mixed scripts omit this field and report their observed shell outcome without claiming individual internal commands succeeded. Do not infer producer identity or reuse stale native status. A completed result is successful only when shell success is true, no request-attributed shell error is present, and any explicitly identified producer has a known zero exit code. Thus successful `tee`/`Tee-Object` cannot hide a producer failure. Retain the existing probe's relevant outcome cases as regressions for the adapted code. ### Capture choice and deliberately limited geometry @@ -63,9 +66,9 @@ Use **bounded `Page.captureScreenshot` PNG capture at 5 fps**, with a fixed **16 - Observe and record actual terminal rows/columns; require at least 80 columns for the existing 60-character completion framing. Do not offer resize controls. A detected terminal geometry change fails the session with an actionable message. - The CDP receiver must continue handling terminal output, command replies, and cancellation during capture. Use a two-second screenshot response deadline; a timeout or lost browser fails the active take. -- Save ordered PNG frames and capture timestamps. Normalize them to the declared 5 fps without shortening elapsed take time; duplicates can fill the interval between successful samples, but cannot hide a capture gap exceeding two seconds. The exported duration must match the recorded take within one frame (0.2 seconds). +- Treat 5 fps as the target sampling cadence, not a guarantee that every 0.2-second event is observed. Record monotonic take boundaries and screenshot request/completion times. A take starts at its first completed screenshot; `begin-take` completes only then. Place frames on the 0.2-second output grid using the latest screenshot completed at or before that grid time, never a future screenshot. Record duplicated intervals; a gap between completed captures, or from the last capture to take end, exceeding two seconds fails the take. Match total take duration within one frame (0.2 seconds). Total duration alone does not establish event timing. - `end-take` returns a take directory and the corresponding existing `kind: frames` scene fields (`src`, `rate: 5`). These artifacts feed the existing assembler directly. -- Check preflight pixels and final exported frames. A static application can legitimately produce identical frames; image similarity alone is not a stalled-capture test. Test visible command output and a TUI while it still owns input, before its exit key. +- Check preflight pixels and final exported frames. A static application can legitimately produce identical frames; image similarity alone is not a stalled-capture test. Acceptance must show several successive visible TUI states, each held for at least 1.3 seconds, in the automatically captured sequence while the command owns input, before its exit key. Check their order and placement against capture times. A manually requested snapshot cannot rescue this acceptance check; missing states fail it. - At the fixed geometry, long wrapping output followed by a command completion must work. Invalid/truncated completion records time out as unknown; they never produce success. A general VT emulator and arbitrary resizing are outside this delivery. The screenshot cadence and fixed-geometry adapter require a focused actual Windows test before committing to further recorder extraction. If either fails, retain the failure and propose a bounded alternative; do not silently resume the old recorder architecture. @@ -74,6 +77,10 @@ The screenshot cadence and fixed-geometry adapter require a focused actual Windo Reuse the probe's Windows Job Object mechanism: establish containment before recorder-owned roots execute, and retain kill-on-close semantics. Normal close, cancel, browser loss, and forced recorder exit must remove its browser/ttyd/shell descendants within ten seconds. An unrelated process must survive. Cleanup still runs when capture, control-file, or report writes fail; such failures remain nonzero results. Pending command success becomes unknown/interrupted when observation is lost. +A command-result deadline expiring records an unknown outcome, fails the active take, and terminates the session with owned-resource cleanup. It must not clear pending state and type another command into the still-running program. Browser loss, capture timeout, or a forbidden geometry change likewise ends the session. Client wait deadlines have no such effect. + +`close` finalizes a healthy active take; `cancel` marks an active take incomplete. Both mark any pending command interrupted with null success and release owned processes. Earlier completed takes remain available. A shutdown acknowledgment means only accepted; publish the successful close/cancel result only after cleanup finishes. That success describes resource release, not the interrupted command. A finalization, cleanup, or result-write failure makes shutdown nonzero or leaves no successful result; the client must not infer success from a missing result. + Keep ownership code specific to this recorder and its launched browser. Extract a small Windows helper only where it avoids duplicating the proven mechanism; do not introduce the previous generic `OwnedProcesses` framework. ## 3. Update only the Windows-facing guidance @@ -94,16 +101,16 @@ All results below are required unless explicitly conditional. Reuse prepared too | --- | --- | | Three native Windows workflow runs | One run invoked from each of PS5.1, PS7, and Git Bash on Ballmer, recording the corresponding shell. Record actual tool paths, native Windows Python identity, shell versions, and ordinary-user token. | | One repeatable fixture per run | Combine a rendered title card, still image, changing real browser content, terminal takes, and an existing movie segment into a narrated, hard-subtitled movie. Use a path such as `movie O'Brien λ & [take]`, CRLF scene input, and a separate work directory. Preserve source movie audio and measured offsets; cover both narration-longer and visuals-longer scene timing. | -| Terminal behavior per recorded shell | Known success/failure; PowerShell cmdlet/native distinctions; failure through logging; one command running across two takes and separate tool calls; cwd/variable persistence; long wrapped output; active TUI pixels before the exit key. Validate the fixed viewport/capture cadence and reject a geometry change. | +| Terminal behavior per recorded shell | Known success/failure; PowerShell cmdlet/native distinctions and raw expression-wrapper status; explicitly attributed producer failure through logging must make `result` nonzero; one command running across two takes and separate tool calls; cwd/variable persistence; long wrapped output; several ordered TUI states in automatic frames before the exit key. Validate timestamp placement and fixed geometry. | | Local voice per workflow | Fresh local Piper synthesis and actual transcription with no cloud key, including a repeat using cached models. Invoke the finished helper through `narrate --verify on`. Synthetic audio/text comparisons and skipped ASR do not satisfy this check. Additional OS network-isolation experiments are unnecessary. | | Final movie per workflow | All five tools complete; hard subtitles are visible, narration audible, action and timing visible in the finished movie; checker passes; inspect its contact sheet and transcribe/check the rendered audio. Record artifacts and commands. | | Browser fallback and desktop | Render an actual title card with Chrome and Edge once each. Run the desktop preflight in the existing interactive session and inspect real app pixels; separately verify that unavailable capture is reported as unavailable. No RDP/compositor matrix. | -| Focused negative tests | Bad browser override, browser timeout, missing libass/soft fallback, malformed or unavailable ASR under `--verify on`, no-Bash PowerShell launch, screenshot timeout, geometry change, and cleanup after control/report failures. Use controlled tests for these failure cases. | +| Focused negative tests | Bad browser override, browser timeout, missing libass/soft fallback, malformed or unavailable ASR under `--verify on` for both fresh and off→on cached clips, no-Bash PowerShell launch, screenshot timeout, geometry change, and cleanup after control/report failures. Control cases cover immediate gap/duplicate-ID rejection, wait-only result retrieval after client timeout, second-run rejection, command-timeout teardown, and no successful shutdown result before cleanup. Use controlled tests for these failure cases. | | Ownership regressions | Normal close, cancel, browser loss, and forced exit on the final recorder for each recorded shell. Reuse the existing child/grandchild and unrelated-sentinel fixtures. | | Existing platforms | Run the existing portable regressions on the available native Mac and Linux runner, including the modified browser/subtitle/narration code paths. Preserve Unix instructions. No additional WSL, Rosetta, Intel-hardware, or architecture certification gate. | | Skill instructions | Four focused agent sessions: before/after using actual PowerShell tools and before/after using actual Git Bash tools. Use the same Windows scenario to exercise paths, no-key narration, terminal commands, and honest capture failure. Follow `superpowers:writing-skills`; retain transcripts and before/after results. No new eval platform or 36-session matrix. | -Fix demonstrated failures and rerun the affected checks. A final integration run uses the final code; unchanged prerequisite investigations and already-reviewed unrelated fixtures do not need repeating. +Share the fixture and downloaded model caches across shell runs; each run must still produce its own final-code artifacts. Fix demonstrated failures and rerun the affected checks. A final integration run uses the final code; unchanged prerequisite investigations and already-reviewed unrelated fixtures do not need repeating. ## Delivery and stopping point diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md new file mode 100644 index 0000000..2418a96 --- /dev/null +++ b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md @@ -0,0 +1,36 @@ +# Adversarial review of the Windows completion spec + +**Reviewed draft:** `cd5e0bd7`. +**Spec:** [Windows completion design](2026-09-09-proof-movie-windows-completion-design.md). +**Reviewer:** Independent Codex subagent `/root/review_windows_completion`, given the user goal, current spec, and relevant source paths without the controller's full conversation. +**Scope:** Design correctness, scope discipline, existing-code compatibility, and sufficient Windows acceptance. Read-only review; no implementation, runtime tests, provisioning, remote-host work, or additional agents. + +## Initial verdict + +Revise before implementation. The reviewer judged the narrowed architecture proportionate and found five mandatory contract corrections. None required restoring the old framework, platform matrix, or eval infrastructure. + +| Finding | Evidence in the reviewed source | Spec correction | +| --- | --- | --- | +| R1 — Producer attribution and success (P1) | Probe `dispatch` depends on `native_producer`; Bash `emit_bash` selects the first saved pipeline status. The draft required attribution but omitted the input field and aggregate success rule. | Include the field; limit its promise to a direct native invocation or first pipeline stage followed by logging. Keep raw PowerShell status and observed errors distinct. A failed/unknown identified producer cannot yield a successful command result. | +| R2 — Cached ASR verification (P1) | `narrate`'s unchanged-WAV/manifest branch bypasses all transcription, including under `--verify on`. The controller independently identified and sent this case to the reviewer, who confirmed it. | Explicit `on` verifies reused WAVs as well as new audio. Add the off→on cached-clip case to the focused checks; unchanged text does not establish verified audio. | +| R3 — Complete asynchronous control (P2) | Probe reads exactly the next consecutive request filename; arbitrary positive IDs can block it. Duplicate rejection prevents resubmitting solely to wait for an existing result. | Specify consecutive IDs, one controller, visible next ID, and prompt gap/duplicate rejection. Add a wait-only `result` command; distinguish acknowledgment from completion and client timeout from cancellation. | +| R4 — Timeout/shutdown state (P2) | Probe command timeout terminates the session, but the draft left this ambiguous. Probe dispatch publishes close/cancel replies before cleanup. | Command timeout records unknown and tears down the session. Define active-take/pending-command behavior for close/cancel. Successful shutdown completion is published only after resource cleanup, separately from acknowledgment. | +| R5 — Event timing and automatic capture (P2) | Draft allowed nearly two-second duplicate intervals while requiring only total-duration accuracy; a transient could be omitted without failing that duration check. | Specify monotonic boundaries, capture request/completion timestamps, conservative placement on the output grid, and visible gaps. Require several ordered TUI states in automatic frames before exit; a manual checkpoint cannot substitute. | + +The controller checked R1–R4 against the cited implementation paths and R5 against the actual capture/export contract before editing. The revisions add focused checks inside the existing Windows validation work, not new infrastructure. + +## Boundaries retained + +- Fixed geometry removes runtime resize support. It does not prove wrapping/redraw correctness. +- Periodic screenshots are a proposed implementation choice. Existing successful single screenshots do not establish sustained capture correctness. +- A focused actual Windows cadence/wrapping test remains required before further recorder extraction. Its failure requires a bounded design decision, not automatic expansion into the old plan. +- The three Windows shell runs may share downloaded model caches and fixture setup, but each must produce its own final-code evidence. +- Existing agents remain stopped. This newly authorized reviewer performs review only. + +## Scoped recheck + +The same reviewer rechecked R1–R5 and contradictions introduced by their revisions. **All five are resolved sufficiently for implementation; no new concrete blocker or mandatory scope reduction was found.** The revised design is ready to guide implementation when execution is authorized. + +The reviewer found no evidence that fixed-geometry periodic screenshots fail as a design. Sustained capture and wrapping correctness remain unproven runtime questions covered by the focused Windows decision gate. Design approval does not establish Windows support or replace that test. + +Both review passes were read-only. The controller changed only this review record and the completion spec; implementation did not resume. -- cgit From 470bb9996e09325b5b1561a8d40f439256ad5deb Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 19:02:25 -0700 Subject: docs: plan three milestones to finish Windows movie support --- .../2026-09-09-proof-movie-windows-completion.md | 253 +++++++++++++++++++++ ...-09-09-proof-movie-windows-completion-design.md | 2 + 2 files changed, 255 insertions(+) create mode 100644 docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md b/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md new file mode 100644 index 0000000..ef1f78c --- /dev/null +++ b/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md @@ -0,0 +1,253 @@ +# Windows Movie Support Completion Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Status:** Plan for review. Writing this plan does not restart implementation or authorize agent dispatch. + +**Goal:** Finish the existing movie workflow on native Windows through PowerShell 5.1, PowerShell 7, and Git Bash. + +**Architecture:** Keep the five media tools and completed assembly fixes. Adapt the proven Windows terminal mechanism into one example with fixed-viewport screenshot capture; share only browser discovery/rendering and Windows Job Object code. Extend the existing test runner and validate three complete Windows workflows. + +**Tech stack:** Existing Python/uv, FFmpeg/ffprobe, Chrome/Edge, ttyd, Piper/faster-whisper, unittest/Pillow/PyYAML, and the probe's script-local `websocket-client==1.9.0`. + +**Spec:** [Reviewed Windows completion design](../specs/2026-09-09-proof-movie-windows-completion-design.md), including its [resolved adversarial findings](../specs/2026-09-09-proof-movie-windows-completion-review.md). + +## Global constraints + +- Both the invoking shell and the recorded shell must work. The acceptance rows pair each invoking shell with the same recorded shell; a nine-combination shell matrix is unnecessary. +- PowerShell does not require Git Bash. Native Windows does not require WSL, tmux, Docker, administrator rights, a cloud key, or changes to machine settings. +- Keep the existing five tool CLIs, scene kinds, narration manifest, offsets, SRT files, and checker behavior. Preserve the existing Unix terminal recipe and macOS/Linux behavior. +- Validate native Windows x64 on Ballmer; report its actual OS version and tool identities. Do not infer untested release/architecture coverage. +- Use bounded `Page.captureScreenshot` PNG capture at 5 fps, with a fixed 1600 × 900 browser viewport before navigation. Keep the spec's two-second capture limit, 0.2-second duration tolerance, and ten-second cleanup limit. +- Reuse prepared tools and fixtures. Do not resume the superseded 12-task plan, build generic process abstractions, provision further OS runners, or expand the four instruction evaluations into a platform matrix. +- The spec is binding for all tasks. A failed capture decision gate requires a bounded design decision; it does not authorize a renderer rewrite. +- One review per completed milestone, with focused rechecks for actual findings. Review does not itself dispatch the next implementer. At execution, one controller owns Windows submissions; do not revive the canceled controller or workers. + +## Baseline and reused resources + +Use the existing isolated worktree `/Users/drewritter/.paseo/worktrees/2mmrq9t5/movie-os-compatibility`, branch `feat/movie-os-compatibility`. The implementation baseline is `442a48d9`; reviewed completion documents are at `4ce8c884`. Check status before execution and preserve any intervening work. No import, branch reset, or repeated feasibility suite is needed. + +In paths below, `S` is `skills/proving-it-works-with-a-movie`, `T` is `tests/proving-it-works-with-a-movie`, `P` is `.superpowers/sdd/2026-09-09-proof-movie-os-compatibility`, and `W` is new execution scratch `.superpowers/sdd/windows-completion`. These abbreviations identify paths, not automatically defined shell variables. + +| Resource | Reuse | +| --- | --- | +| Ballmer transport | `drew@ballmer.local`. SSH stages/retrieves files; its elevated token does not establish ordinary-user execution. | +| Ordinary-user runner | Existing desktop Paseo terminal `1496200b-5545-4d85-af31-d01df72a3c11`, if still available. Use the existing daemon and a task-owned terminal if replacement is necessary. Record the actual test process's Medium token. | +| Windows tools | `C:\Users\drew\movie-os-task1-20260909\tools`: `uv\uv.exe`, `python\cpython-3.12.14-windows-x86_64-none\python.exe`, `pwsh\pwsh.exe`, `ttyd.exe`, and `ffmpeg\ffmpeg-9.0.1-essentials_build\bin`. Inventory is historical; check only paths needed by the active task. | +| Windows transport examples | `P/task-2-evidence/{stage-windows-task2.ps1,submit-windows-task2.ps1,launch-windows-task2.ps1,run-windows-task2.py}`. Copy/adapt into `W` and a fresh remote `C:\Users\drew\movie-windows-completion` directory. Preserve old evidence. | +| Native Mac | Existing uv/Chrome; libass-capable FFmpeg/ffprobe at `P/tools/macos-arm64`. Original system FFmpeg remains available for no-libass checks. | +| Linux regression runner | Existing `superpowers-movie-linux-amd64` container, ordinary `movie` user, read-only `/worktree` mount. Existing isolated-container browser wrapper may add `--no-sandbox`; never make that a product default. | +| Voice and harness setup | Prepared caches and tool-shell evidence under `P/artifacts/windows-voice-preflight` and `P/artifacts/windows-eval-preflight`. Setup is not final acceptance. | + +The Windows transport uses the matching installed CLI `C:\Users\drew\AppData\Local\Programs\Paseo\resources\bin\paseo.cmd`. Reuse its encoded PowerShell submission mechanism. Do not change execution policy, profiles, machine PATH, credentials, or services. Runtime test environments must not force Python UTF-8 mode in every case: the BOM/default-code-page cases must exercise the product's own handling. + +## Files and fixed interfaces + +| File | Responsibility | +| --- | --- | +| `S/scripts/{assemble,burn-subtitles,narrate,make-subtitles,check-movie}` | Existing public commands; targeted portability/verification changes only | +| `S/scripts/media_paths.py` | Keep completed frame/FFconcat implementation | +| New `S/scripts/browser_tools.py` | `find_browser(explicit: str \| None) -> str \| None` and `render_card(html: Path, png: Path, *, browser: str, width: int, height: int, timeout: float = 20) -> None` | +| New `S/scripts/windows_jobs.py` | Extract proven `WindowsJob`: `spawn(argv: list[str], directory: Path, log: Path, env: dict[str, str] \| None = None) -> int`, `wait(pid: int, timeout: float) -> int`, `close() -> None`; retain native identity/snapshot operations needed by ownership tests | +| New `S/examples/film-terminal.py` | Windows-only `serve`, `request`, and `result` entry points; `command_succeeded(result: dict) -> bool` and `frame_sources(completed: list[float], start: float, end: float, rate: float = 5) -> list[int]` are testable pure helpers | +| `T/run-tests.py`, `T/fixtures.py` | Existing runner; add named suites and `load_script(name: str) -> types.ModuleType` for extensionless tools, plus bounded recorder-client fixture helpers | +| `T/test_{assembly,checker,narration,paths}.py` | Keep existing assertions; extend narration and encoding cases | +| New `T/test_{browser,subtitles,processes,terminal}.py` | Tests for the shared helpers/media fixes and native Windows recorder; `processes` tests the Windows Job helper, not a new framework | +| New `T/fixtures/{browser.html,terminal_app.py}` and `T/run-windows-acceptance.py` | One small real app fixture and one reproducible Windows workflow driver | +| `S/*.md` and `T/README.md` | Correct affected recipes, prerequisites, and reproduction commands | +| `docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md` | Append final Windows results and artifact locations to the existing report | + +Media tools retain Python 3.10+ metadata. The Windows example may retain the probe's Python 3.12+ and websocket-client dependency in its uv script header. Import Windows APIs only when used on Windows. Add that same script-local client dependency to tests that import the example. Do not introduce a generic `processes.py` or a recorder package hierarchy. + +## Task 1 / milestone 1: Complete the media tools + +**Deliverable:** Native Windows can render cards, assemble all scene kinds, synthesize and verify narration, and produce correctly located subtitles using the existing commands. + +**Files:** Existing five scripts; new `browser_tools.py` and `windows_jobs.py`; `T/fixtures.py`, `run-tests.py`, `test_browser.py`, `test_subtitles.py`, `test_processes.py`, `test_narration.py`, and focused encoding additions to current tests. + +- [ ] **1. Capture focused failing cases.** Register `browser`, `subtitles`, and `processes` suites when their tests exist. Cover invalid explicit browser, Windows Chrome/Edge discovery, special-path file URI, timeout cleanup with an unrelated sentinel, nested SRT paths, UTF-8 BOM/CRLF input, default-code-page Unicode output, and fresh/cached ASR failure. Keep Windows Job tests in `processes` so portable suites do not acquire required Windows-only skips. + +For the cached verification policy, add this test shape using a loaded `narrate` module; it needs no TTS download: + +```python +def test_cached_audio_requires_requested_verification(self): + import json, sys, tempfile + from pathlib import Path + from unittest.mock import patch + import fixtures + module = fixtures.load_script("narrate") + with tempfile.TemporaryDirectory() as tmp: + work = Path(tmp) + output = work / "voice" + output.mkdir() + (output / "clip.wav").write_bytes(b"cached audio fixture") + (output / "manifest.json").write_text(json.dumps([ + {"id": "clip", "text": "Read this sentence.", "wav": "clip.wav", + "duration": 1.0} + ]), encoding="utf-8") + scenes = work / "scenes.yaml" + scenes.write_text(json.dumps({"scenes": [ + {"id": "clip", "narration": "Read this sentence."} + ]}), encoding="utf-8") + argv = ["narrate", str(scenes), str(output), + "--engine", "piper", "--verify", "on"] + with patch.object(sys, "argv", argv), \ + patch.object(module, "openai_key", return_value=None), \ + patch.object(module, "duration", return_value=1.0), \ + patch.object(module, "transcribe_local", return_value=None): + self.assertNotEqual(module.main(), 0) +``` + +The synthetic bytes are for branch/policy testing only. Real WAV synthesis/transcription remains part of the Windows acceptance fixture. + +- [ ] **2. Run the new tests before fixes.** Use `uv run --script tests/proving-it-works-with-a-movie/run-tests.py --suite narration` and the new suites; retain the specific assertions that fail. Missing imports during initial helper creation are expected, but also capture the existing cached-verification false success and native card/subtitle failure before changing them. + +- [ ] **3. Implement browser ownership and cards.** Extract the proven Win32 structure/binding and suspended-spawn/Job-assignment sequence from `probe-windows.py`. Add `wait` using retained process handles, `WaitForSingleObject`, and `GetExitCodeProcess`; timeout raises `TimeoutError`. Preserve idempotent close, kill-on-close, and handle release on failures. `browser_tools.render_card` uses this helper on Windows and an owned subprocess session on Unix. Always close its process group/Job and temporary profile in `finally`. Discovery checks an explicit executable first and fails if unusable; otherwise check existing Unix candidates and Windows Chrome/Edge machine/user/PATH locations. Replace the assembler's hand-built URL with `html.resolve().as_uri()` and verify the resulting PNG is nonempty. + +- [ ] **4. Implement subtitle and text handling.** Resolve movie/SRT/output paths before changing cwd. Copy only the subtitle into a temporary directory as `captions.srt`; run the existing hard-burn command with that cwd and `subtitles=filename=captions.srt`. Preserve soft embedding. Keep separate diagnostic branches for missing libass and actual burn failure. Read human/shell-authored text with `utf-8-sig`, write plain `utf-8`, and make command output tolerate the native console while preserving UTF-8 machine-readable files. Apply this to the remaining five-tool text IO sites, not unrelated code. + +- [ ] **5. Repair transcription and cache behavior.** Keep `transcribe_local(wav, model="base.en") -> str | None`. Use an owned temporary result file, one isolated uv invocation, and this child result protocol: + +```python +# Inside ASR_SNIPPET, after obtaining segs: +from pathlib import Path +import json +Path(sys.argv[3]).write_text( + json.dumps({"text": " ".join(s.text.strip() for s in segs)}), + encoding="utf-8") +``` + +Build the child argv as `["uv", "run", "--no-config", "--no-project", "--isolated", "--python", sys.executable, "--with", "faster-whisper", "python", "-c", ASR_SNIPPET, str(wav.resolve()), model, str(result_path)]`, with cwd in the temporary directory. Preserve cache locations; do not inherit a project's environment as the helper environment. Parse only the owned JSON `text` string. Keep stdout/stderr as diagnostics; absent/invalid results or child failure return unavailable. Under explicit `on` that means a failed clip and nonzero command, including cached WAVs. Verification must run after deciding whether to synthesize or reuse a clip. Keep `auto`/`off` behavior and drift thresholds from the reviewed spec; do not add a verification ledger or change the manifest schema. + +- [ ] **6. Verify and review the deliverable.** On ordinary-user Windows run `assembly`, `paths`, `browser`, `subtitles`, `narration`, `checker`, and `processes` with `--require-capabilities`. Remove the current Windows card skip when the real card works. Include actual Chrome and Edge cards, actual hard subtitles in a special-character path, and real ASR from a cwd containing a conflicting project configuration. Controlled helper tests cover stdout contamination, malformed results, off→on cached audio, and missing libass. Review/commit the bounded media diff once: `fix(movie): finish native Windows media tools`. + +## Task 2 / milestone 2: Finish the Windows terminal example + +**Deliverable:** One usable Windows example, invoked from each supported shell, exporting timed PNG takes that feed `assemble`. + +**Files:** New `S/examples/film-terminal.py`; `T/test_terminal.py` and `T/fixtures/terminal_app.py`; runner/fixture registration. Reuse Task 1's browser discovery and Windows Job helper. Keep the historical probe unchanged. + +- [ ] **1. Run the capture decision gate first.** In `W/capture-gate.py` load the existing probe with `importlib.util.spec_from_file_location` and reuse its terminal launch/readiness/prompt/output handling. Set the fixed viewport before navigation and record its established geometry. Replace only the take acquisition with asynchronous `CDP.send("Page.captureScreenshot", {"format": "png"})` and the existing `pump`/response map; never start a screencast. One screenshot request is outstanding at a time, targeted every 0.2 seconds, with a two-second monotonic deadline. Keep processing terminal events and control input between polls. + +Run the gate on ordinary-user Ballmer for PS5.1, PS7, and Git Bash. The native fixture prints long wrapping output, then three colored/text-labeled TUI states held at least 1.3 seconds each, then waits for `q`. Record application state times and automatically captured frames; inspect each state before `q` and then a successful command completion. This must pass without manual snapshot assistance. Do not rerun the old 40-check feasibility gate. If this mechanism fails, retain the failure and stop recorder extraction for the bounded design decision specified in the spec. + +Give this scratch gate the probe-compatible arguments `--shell-kind powershell51|powershell7|gitbash --shell EXECUTABLE --browser EXECUTABLE --ttyd EXECUTABLE --directory FRESH_DIRECTORY` and run it through native `uv run --script`. PS5.1 is the existing `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe`; Git Bash is `C:\Program Files\Git\bin\bash.exe`. The PS7/ttyd paths are in the resource table. Resolve the existing browser through Task 1's helper. These argument names are confined to the scratch gate; the public example uses the reviewed `serve` interface. + +- [ ] **2. Add timing and result-policy tests.** Load the new example by file path, without starting a browser on import. Use this implementation/test contract for frame placement: + +```python +def frame_sources(completed, start, end, rate=5): + import bisect, math + if not completed or completed[0] != start or end < start: + raise ValueError("Invalid take boundaries") + if completed != sorted(completed) or completed[-1] > end: + raise ValueError("Invalid capture times") + intervals = [b - a for a, b in zip(completed, completed[1:])] + if max(intervals + [end - completed[-1]]) > 2: + raise TimeoutError("Capture gap exceeds two seconds") + count = max(1, math.ceil((end - start) * rate)) + return [bisect.bisect_right(completed, start + i / rate) - 1 + for i in range(count)] + +assert frame_sources([10.0, 10.35, 10.81], 10.0, 11.0) == [0, 0, 1, 1, 1] +``` + +Also reject a capture gap over two seconds. Test `command_succeeded` with completed shell success plus an identified producer returning seven: it must be false even when the logger succeeds. Unknown/interrupted states, observed shell errors, or missing status for an identified producer must likewise be false. + +```python +def command_succeeded(result): + return (result.get("outcome") == "completed" + and result.get("shell_success") is True + and result.get("shell_error") is None + and (result.get("native_producer") is None + or result.get("producer_exit_code") == 0)) + +assert not command_succeeded({ + "outcome": "completed", "shell_success": True, "shell_error": None, + "native_producer": "python.exe", "producer_exit_code": 7}) +``` + +- [ ] **3. Extract only user-facing recorder behavior.** Use script metadata `requires-python = ">=3.12"` and `dependencies = ["websocket-client==1.9.0"]`. Reuse the proven CDP receiver, bounded completion parser, ttyd `-w`/one-client/writable startup, prompt adapters, and owned roots. Import sibling `scripts` explicitly relative to `__file__`. Remove gate aggregators, sentinel creation, automatic test phases, heartbeat workers, probe variable assertions, and the probe's hard-coded 20-minute test lifetime. Keep a foreground `serve` process owned by the harness, with per-command deadlines. + +- [ ] **4. Implement the exact CLI/control contract.** `serve` accepts `--shell`, `--directory`, `--cwd`, and executable overrides `--shell-exe`, `--browser`, `--ttyd`. Retain the spec's `request --file` and wait-only `result --id` forms, 30-second client timeout, and 90-second default command timeout. Persist ordered request/ack/result files, session IDs, pending run, active take, and `next_request_id`. Publish state before acknowledgments; reject gap/duplicate IDs before publication and second runs before typing. Server-rejected consumed IDs advance the sequence so cancellation remains usable. A failed command result is nonzero without ending the session. + +For example, a caller writes this UTF-8 file and submits it once; later result retrieval never writes another request: + +```json +{"id":1,"operation":"run","command":"Write-Output 'ready'","timeout_seconds":90} +``` + +```text +uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py request --directory SESSION --file request-1.json +uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py result --directory SESSION --id 1 --timeout 30 +``` + +`SESSION` denotes the caller's real session directory. Test readiness nonce/cwd/shell through the filmed connection; reconnect or geometry change ends the session. Preserve raw PowerShell status separately from attributed errors. Keep direct-native/first-pipeline-producer attribution exactly as the spec defines; opaque scripts do not acquire inferred native status. + +- [ ] **5. Integrate successful capture and shutdown.** `begin-take` completes after its first PNG and monotonic start time. Pump CDP, control requests, command completion, and capture replies in one bounded loop. Write raw sample times, then ordinary numbered PNG copies selected by `frame_sources` at end. Return scene fields `kind: frames`, `src` as the absolute take-directory string, and `rate: 5`, plus take metadata. The absolute path is accepted by the existing assembler's path join. Do not alter input geometry while recording. + +`end-take` keeps shell/browser alive. Command timeout, capture timeout, reconnect, and geometry change record the specified unknown/interrupted result, fail the active take, and terminate the session. `close` finalizes a healthy take; `cancel` marks it incomplete. Both interrupt any pending command and release the Job; successful shutdown results are written only afterward. Finalizer failures remain failures. Support the declared printable/special keys without adding arbitrary terminal emulation. + +- [ ] **6. Verify through separate actual tool calls.** Run `uv run --script tests/proving-it-works-with-a-movie/run-tests.py --suite terminal --require-capabilities` on ordinary-user Windows. Stage the whole native suite in each actual invoking shell while recording that same shell. Reuse probe outcome and child/grandchild/sentinel fixtures against the final example. Validate two takes across separate shell tool calls, pending-command persistence, cwd/variables, wrapped output, automatic multi-state TUI pixels, and normal/cancel/browser-loss/forced-exit cleanup. Inject client timeout followed by `result`, command timeout, gap/duplicate IDs, screenshot/geometry failure, and control/report-write failure. Do not count a single Python process driving both phases as proof of harness-call persistence. + +- [ ] **7. Review/commit the finished example.** Inspect exported PNGs and their assembled sequence, duration, state order, and recorded gaps. Commit the recorder/tests as `feat(movie): support native Windows terminal recording` after the milestone review. The capture decision gate is part of this task, not a separately staffed project. + +## Task 3 / milestone 3: Instructions and final acceptance + +**Deliverable:** Copyable Windows instructions and three inspected finished movies from the final code, with a short results report. + +**Files:** `S/{SKILL,assembling,narrating,recording-a-terminal,recording-motion,rendering-stills,rendering-from-a-log}.md` where changes are needed; `T/README.md`; new `T/run-windows-acceptance.py` and `T/fixtures/browser.html`; the existing results report. No external eval-repository changes are required. + +- [ ] **1. Save one fixture and workflow driver.** `run-windows-acceptance.py --work DIR --shell powershell51|powershell7|gitbash --phase prepare|finish` prepares scenes or processes the recorded artifacts. `prepare` creates the same scratch browser app, captures its changing states, and creates an image plus an existing movie segment with its own known audio. `finish` requires `--take-one PATH --take-two PATH` pointing to the example's exported frame directories. Use `movie O'Brien λ & [take]` paths, CRLF scenes, UTF-8 BOM input coverage, a separate assembly work directory, narration-longer and visual-longer cases. Load the tiny browser counter from its file URI and change it through actual CDP mouse clicks. Reuse the example's retained `CDP.send`/`pump`/`responses` handling and Task 1's owned browser helpers, closing fixture processes afterward. No fixture server or browser recording framework is needed. + +The saved scenes name `title` (card), `still` (image), `browser` (frames), `take-one`/`take-two` (frames at 5 fps), and `source` (movie). Narrate the non-movie scenes; retain the source segment's own audio. Let the driver call existing tools through `fixtures.run_tool` and reject every nonzero result: + +```python +steps = [ + ("narrate", [str(scenes), str(voice), "--engine", "piper", "--verify", "on"]), + ("assemble", [str(scenes), str(cut), "--narration", str(voice), "--work", str(segments)]), + ("make-subtitles", [str(voice / "manifest.json"), str(subtitles), + "--offsets-json", str(segments / "offsets.json")]), + ("burn-subtitles", [str(cut), str(subtitles), str(movie)]), + ("check-movie", [str(movie)]), +] +``` + +These local variables are the driver's `Path` values under `--work`; use an evidence subdirectory for checker outputs. Local voice repeats synthesize into a new output directory using downloaded model caches; the cached-WAV off→on policy is tested separately. During final audio verification, compare each narrated interval with its script and the source-movie interval with its own reference, so preserved source audio is not misclassified as TTS drift. + +- [ ] **2. Run the two baseline instruction sessions before Markdown edits.** Apply `superpowers:writing-skills` when editing skill instructions. Use one fixed scenario for an actual PowerShell tool and an actual Git Bash tool, each against the unchanged instructions plus the final product code. This isolates the instruction change. Save the scenario at `W/instruction-scenario.md`: + +> On native Windows, make a narrated and hard-subtitled proof movie from the provided local app and terminal fixture, using the installed movie skill. Work in the supplied path with spaces, an apostrophe, and Unicode. Use local narration without a cloud key. Keep the recorded command alive between two takes. If desktop capture is unavailable, state what was actually captured and what remains unproven. + +Use a controlled unavailable-desktop condition in these sessions. Reuse `P/artifacts/windows-eval-preflight/native-tool-preflight.py` and `native-gitbash-preflight.py` as launcher references, removing diagnostic `--safe` mode and loading the explicit candidate plugin with skill bootstrap. The transcripts must show the actual shell tool and loaded skill; a PowerShell parent invoking a Bash tool does not count. Pin the same existing model and setup across before/after. Do not build a Quorum deployment or launch other agents during planning. + +- [ ] **3. Write and exercise Windows instructions.** Document all five `uv run --script` invocations, prerequisites, shell-specific quoting, pure PowerShell execution, foreground lifetime, consecutive request IDs, wait-only results, take timing, keys, fixed geometry, and cleanup. Use `[IO.File]::WriteAllText($path, $json, [Text.UTF8Encoding]::new($false))` for PowerShell UTF-8 without BOM. Document native producer status before `Tee-Object`, and Bash `PIPESTATUS`/pipefail for logs. Preserve Unix tmux instructions and fix the dangling example reference. + +Add the Windows desktop preflight: + +```text +ffmpeg -nostdin -y -f gdigrab -framerate 5 -i desktop -t 2 capture-check.mp4 +ffmpeg -nostdin -y -i capture-check.mp4 -frames:v 1 capture-check.png +``` + +Invoke with an argument array and scratch paths from the ordinary-user interactive desktop; inspect actual application pixels. Document failure without converting it to a GUI success claim. Test Chrome and Edge card discovery once each; no browser-by-shell cross product is needed. + +- [ ] **4. Execute final acceptance and the two candidate instruction sessions.** Run the documented workflow from PS5.1, PS7, and Git Bash, recording the corresponding shell; one row each. Capture the invoking shell's own version/PID in its command transcript before launching uv; `--shell` selects the recorded shell and is not evidence for the invoking shell. Remove cloud keys only from the test process environment and use a process-local tool PATH excluding `llm` credential lookup; leave saved credentials untouched and select local Piper explicitly. Use native Windows tools and verify the actual ordinary-user token. For each final movie inspect picture, hard subtitles, audible narration, contact sheet, timing, and rendered-audio transcription. Record executable paths, shell identity, source revision, command exit codes, movie/contact-sheet paths, and inspection result. Complete the four-session before/after instruction comparison with the same scenario and candidate Markdown. + +On the native Mac and existing Linux runner, run only the portable suites `assembly`, `paths`, `checker`, `narration`, `browser`, and `subtitles` with `--require-capabilities`, including the changed shared code paths. Windows-only `processes`/`terminal` are not part of those runs. A skipped required case is incomplete, never green. Add actual fresh and cached-model voice checks on the existing Mac/Linux setup when validating the changed shared narration helper; do not re-provision other architectures. + +- [ ] **5. Close the reviewed scope.** Append a three-row Windows matrix, Mac/Linux regression results, four instruction-session results, and desktop/card checks to the existing report. Include stable artifact locations and the final tested source revision. Mark every spec acceptance row passed or explicitly incomplete; do not merely count commands returning zero. Review the final diff and commit `docs(movie): document and verify Windows workflows`. No pushing, PR, or merge is part of this plan. + +## Spec coverage and execution boundary + +| Reviewed requirement | Task | +| --- | --- | +| Five tools, paths, cards, UTF-8/BOM, subtitles, isolated ASR including cached verification (R2) | 1 | +| Fixed capture decision gate; producer status (R1); ordered/asynchronous control (R3); timeout/shutdown (R4); honest frame timing (R5) | 2 | +| Final recorder cleanup, same-session takes, wrapping, TUI and native shell behavior | 2 | +| Three complete Windows workflows, local voice, final-movie inspection, desktop/card checks, existing-platform regressions | 3 | +| Windows instructions and four before/after skill sessions | 3 | + +At execution, retain focused RED/GREEN evidence and review each of these three milestones. Rerun only checks affected by a fix; final integration must use final product code. If a genuine blocker requires changing an approved interface, dependency, supported route, or validation scope, present that concrete issue before expanding work. + +This plan was written and self-reviewed without starting implementation, remote tests, or agents. The next action is human review of the plan and execution choice; the old controller and workers remain canceled. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md index 2f4a373..853b5cd 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md @@ -4,6 +4,8 @@ **Baseline:** `feat/movie-os-compatibility` at `442a48d9`, based on the movie import at `f6617db1`. +**Implementation plan:** [Three-milestone completion plan](../plans/2026-09-09-proof-movie-windows-completion.md), written for review. Execution has not resumed. + This replaces the remaining scope of the [earlier OS compatibility design](2026-09-09-proof-movie-os-compatibility-design.md) and its [12-task implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md). Completed fixes and retained evidence remain useful. Unfinished tasks in that plan are not instructions to resume work. ## Goal and limits -- cgit From 8a31ffc3ff13384ce884a8ed8613367a614ef9d9 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 21:36:58 -0700 Subject: docs(movie): document and verify Windows workflows --- .../2026-09-09-proof-movie-windows-completion.md | 4 +- .../2026-09-09-proof-movie-os-compatibility.md | 124 +++++++++++++++++++++ ...-09-09-proof-movie-windows-completion-design.md | 6 +- 3 files changed, 129 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md b/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md index ef1f78c..954a0e0 100644 --- a/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md +++ b/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md @@ -2,7 +2,7 @@ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. -**Status:** Plan for review. Writing this plan does not restart implementation or authorize agent dispatch. +**Status:** Execution authorized and the three implementation milestones delivered. Final workflow evidence and the remaining candidate-instruction verification gaps are recorded in the [results report](../reports/2026-09-09-proof-movie-os-compatibility.md#reviewed-windows-completion--final-results). **Goal:** Finish the existing movie workflow on native Windows through PowerShell 5.1, PowerShell 7, and Git Bash. @@ -250,4 +250,4 @@ On the native Mac and existing Linux runner, run only the portable suites `assem At execution, retain focused RED/GREEN evidence and review each of these three milestones. Rerun only checks affected by a fix; final integration must use final product code. If a genuine blocker requires changing an approved interface, dependency, supported route, or validation scope, present that concrete issue before expanding work. -This plan was written and self-reviewed without starting implementation, remote tests, or agents. The next action is human review of the plan and execution choice; the old controller and workers remain canceled. +Execution resumed under the reviewed three-milestone scope. Implementation and finite test outcomes are recorded in the results report; the earlier superseded controller/workers were not resumed. Review the documented candidate-instruction gaps before claiming full skill compliance. diff --git a/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md b/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md index 30f9840..da147c6 100644 --- a/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md +++ b/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md @@ -160,3 +160,127 @@ python3 tests/proving-it-works-with-a-movie/probe-windows.py --assert-result .su ## Required production follow-through General screencast freshness is a **required production fix and test in Tasks 8–9**; stalled takes must not pass. Resizing requires a production shell adapter/supervisor that handles completion framing through resize/redraw, with damaged/missing framing remaining unknown/interrupted. Further work includes broader ownership failure injection, the full OS support matrix, and assembly/narration/verification portability. This probe does not establish those results. The Task 1 mechanism gate and independent review must finish before the bulk port begins. + + +## Reviewed Windows completion — final results + +The earlier sections record historical feasibility work, not the current +acceptance gate. The reviewed three-milestone implementation is now present. +The final native workflows passed; the four-session instruction comparison +has two explicitly incomplete verification outcomes below. No PR, push, +merge, further OS provisioning, or additional eval platform was performed. + +Ballmer: native Windows build 26200, x64, ordinary Medium token +`S-1-16-8192`, prepared CPython 3.12.14. Actual invoking-shell transcripts +identify PS5.1 `5.1.26100.9168`, PS7 `7.6.6`, and Git Bash +`5.3.9(1)-release`, with executable/PID before uv. This is evidence for that +tested host, not every Windows release or architecture. + +| Invoking → recorded shell | Five tools + checker + rendered audio | Duration | Retained artifacts | +|---|---|---:|---| +| PS5.1 → PS5.1 | PASS | 27.000 s | [Movie](), [contact sheet](), [rendered audio]() | +| PS7 → PS7 | PASS | 26.878 s | [Movie](), [contact sheet](), [rendered audio]() | +| Git Bash → Git Bash | PASS | 27.167 s | [Movie](), [contact sheet](), [rendered audio]() | + +All movies are 1600×900 H.264/AAC. Each combines a card, still, real CDP +counter clicks, two native terminal takes, and a labeled existing movie +segment retaining its own 440 Hz stereo tone. Inputs exercise the path +`movie O'Brien λ & [take]`, UTF-8 BOM/CRLF scenes, and separate assembly work. +Title narration lasts 3.855–3.971 s against one second of visuals; still +visuals last four seconds against 1.498–1.695 s of narration. + +Each workflow used real local Piper synthesis with verification, then a new +output directory reusing downloaded model caches. The process PATH excludes +`llm`, and cloud keys were removed only from that process. All 15 narrated +final-movie intervals passed local ASR comparison (0% length drift, worst +changed-word run at most two). Each source-tone interval separately passed +frequency/amplitude comparison with its own source reference. Fresh/cached +WAV verification is not substituted for final-movie transcription. + +The exported terminal samples show red→green→blue in order and visible +command completion after the second take's exit key. Six take duration +errors are 0.028–0.094 s; maximum completed-screenshot gaps are +0.625–1.109 s. Frame hashes confirm the documented completed-sample grid, +with no future sample used. Contact sheets and decoded movie frames were +inspected; short color states missed by the contact-sheet selection are +present in the actual movies. + +Evidence index: [timing/frame inspection](), +[controller final-movie inspection](), +[final source SHA-256 manifest](). +The manifest pins the tested recorder, helpers, five tools, and fixture; +Task 3 applies to base `ce9b3fcf`, following media `5621d1d6` and recorder +`ce9b3fcf`. The retained source hashes, commands, and source-labeled earlier +results establish provenance without claiming an older artifact tested a +later failure-path change. Remote artifacts remain at +`C:\Users\drew\movie-windows-completion\final-task3`. + +### Capture targets and reused regression evidence + +Named-window `gdigrab` captured readable pixels from the task-owned Windows +application: [window image]() and +[commands/results](). Visible padding and +capture dimensions are retained; no DPI/root-cause claim is inferred. +Full-desktop capture returned zero but showed wallpaper only, including a +late frame: [desktop image](). +That target remains **unverified for application capture in this session**. +Read-only evidence showed WinSta0/Default and an active console session; +no lock, service, credential, or machine-setting changes were made. + +Chrome and Edge title-card checks and the unchanged media regressions reuse +`.superpowers/evidence/windows-completion/media-5621d1d6`. The Mac and Linux +portable assertions passed 35 per host; native-only Job tests are excluded +from that portable result. Final strict browser/narration checks passed +4/4 and 9/9 per host. Real fresh and cached-model voice checks on both hosts +reuse `.superpowers/evidence/windows-completion/{macos,linux}-voice`. +The narration/browser/subtitle code exercised there is unchanged. + +The existing terminal capture gate, native outcome/control/ownership +regressions (57 tests), and finalization corrections (7 focused tests) retain +their source labels under `capture-gate`, `terminal-b8a723f4`, and +`terminal-ce9b3fcf`. Task 3 adds the demonstrated Unicode-cwd startup fix and +the previously reviewed identity-error handle cleanup. Focused native tests +passed 4/4. Local changed-policy suites passed 12 terminal and two ownership +assertions; their 13 and two native-only skips do not establish native +coverage. The native final workflows separately exercise all three shells. + +### Four instruction sessions — comparison complete, full compliance partial + +All four loaded the explicit candidate plugin and successful +`using-superpowers` SessionStart bootstrap, invoked the movie Skill, and used +actual PowerShell or Bash tools. The scenario, model (`claude-sonnet-5`, +existing `sonnet` alias), low effort, supplied tools/caches, product code, and +stop-at-first-instruction-gap criterion were held constant. Only the candidate +Markdown changed. No diagnostic safe mode or extra implementation agent was +used. Permissions/context were scoped to the task plugin, fixtures, +artifacts, and owned processes. + +| Session | Observed result | +|---|---| +| PowerShell baseline | Demonstrated documentation failure: inferred the native route from source, failed special-path `Start-Process` quoting, BOM request input, and guessed an `operation: result` request. Stopped through owned cleanup after the gap; not a completed workflow. | +| Git Bash baseline | Demonstrated documentation failure: inferred the native route from source and passed `/c/...` to native Python, producing `C:\c\...`/file-not-found. Stopped through the launcher's Job cleanup after the gap; not a completed workflow. | +| PowerShell candidate | **Partial.** New foreground-task, UTF-8 request, consecutive-ID, two-take, wait-only result, local voice, five-tool, caption/contact-sheet, cleanup, and honest capture-boundary instructions worked. It claimed complete verification but omitted transcription of the rendered final audio. | +| Git Bash candidate | **Incomplete due to harness turn cap.** Built a movie and ran media/checker/evidence steps, then returned `error_max_turns` (41 reported turns, exit 1) before a final response or rendered-final-audio transcription. This is not a full skill pass or an inferred instruction failure. | + +Launch limits were $4, 40 turns, and 900 seconds per session. The PowerShell +baseline's interrupted result reported 54 turns/$1.4456, and the completed +PowerShell candidate reported 44 turns; the requested cap must not be +mistaken for the harness's actual reported count. Git Bash candidate cost +was $0.832 and elapsed time 223.6 s. No limit was silently scored as success. +Transcripts and launcher result records are retained under +[the stable instruction evidence](). Further corrective +instruction work is left to review; no extra sessions were launched. + +### Acceptance disposition + +| Reviewed acceptance area | Disposition | +|---|---| +| Three native invoking/recorded-shell workflows | PASS on the recorded host | +| Repeatable mixed fixture, paths, encodings, timing | PASS | +| Terminal control, continuity, native outcomes, ordered automatic states | PASS with retained focused regression evidence | +| Fresh/cached-model local voice per workflow | PASS | +| Finished picture, hard captions, checker and rendered audio | PASS for all three independent acceptance movies | +| Browser cards / capture targets | PASS Chrome, Edge, and named-window pixels; full-desktop target explicitly unverified | +| Focused negative cases and ownership | PASS with source-labeled earlier evidence plus Task 3 focused corrections | +| Existing Mac/Linux behavior | PASS reused unchanged portable/media/voice evidence | +| Four instruction comparisons | Executed; **full candidate skill compliance remains INCOMPLETE** for the two specific outcomes above | diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md index 853b5cd..7f5f56b 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md @@ -1,10 +1,10 @@ # Finish Windows support for the movie skill -**Status:** Adversarial review complete; revised design ready for human review. Implementation remains stopped. See the [findings and scoped recheck](2026-09-09-proof-movie-windows-completion-review.md). +**Status:** Reviewed execution completed through the three implementation milestones. Native workflow results and the remaining candidate-instruction verification gaps are recorded in the [results report](../reports/2026-09-09-proof-movie-os-compatibility.md#reviewed-windows-completion--final-results). **Baseline:** `feat/movie-os-compatibility` at `442a48d9`, based on the movie import at `f6617db1`. -**Implementation plan:** [Three-milestone completion plan](../plans/2026-09-09-proof-movie-windows-completion.md), written for review. Execution has not resumed. +**Implementation plan:** [Three-milestone completion plan](../plans/2026-09-09-proof-movie-windows-completion.md). Execution was authorized and resumed. This replaces the remaining scope of the [earlier OS compatibility design](2026-09-09-proof-movie-os-compatibility-design.md) and its [12-task implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md). Completed fixes and retained evidence remain useful. Unfinished tasks in that plan are not instructions to resume work. @@ -122,4 +122,4 @@ Expected edits are the existing five scripts, at most the browser/Windows owners Done means the three native Windows workflow runs and this checklist have concrete results, documented limitations are visible, and the user has a complete diff to review. Missing Windows route evidence remains unfinished work. Pushing, opening a PR, and merging are separate from this specification request. -This drafting step starts no agents, installs no tools, and changes no implementation. The earlier agents remain stopped. Review this scope before any execution resumes. +Execution resumed under this reviewed scope. The results report records each acceptance disposition, including incomplete candidate-instruction verification; the superseded plan and earlier workers were not resumed. -- cgit From b2f28a41c4ecc8f54b7a2d4e9278ac8662481a2a Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 22:53:19 -0700 Subject: chore(movie): drop the abandoned OS-rollout probe and superseded plans The first, broader OS-compatibility rollout was stopped and replaced by the narrower Windows completion. Its feasibility probe, probe cleanup test, design, review, 12-task plan, results report, and the completion plan and review record were internal execution artifacts with machine-specific paths. The one probe-derived test list is inlined into the terminal suite. Co-Authored-By: Claude Fable 5.1 --- .../2026-09-09-proof-movie-os-compatibility.md | 709 --------------------- .../2026-09-09-proof-movie-windows-completion.md | 253 -------- .../2026-09-09-proof-movie-os-compatibility.md | 286 --------- ...26-09-09-proof-movie-os-compatibility-design.md | 548 ---------------- ...26-09-09-proof-movie-os-compatibility-review.md | 75 --- ...-09-09-proof-movie-windows-completion-review.md | 36 -- 6 files changed, 1907 deletions(-) delete mode 100644 docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md delete mode 100644 docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md delete mode 100644 docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md delete mode 100644 docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md delete mode 100644 docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md delete mode 100644 docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md b/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md deleted file mode 100644 index bdc6b5b..0000000 --- a/docs/superpowers/plans/2026-09-09-proof-movie-os-compatibility.md +++ /dev/null @@ -1,709 +0,0 @@ -# Proof Movie OS Compatibility Implementation Plan - -> **SUPERSEDED — DO NOT EXECUTE.** The user stopped this rollout. The [focused Windows completion spec](../specs/2026-09-09-proof-movie-windows-completion-design.md) replaces the remaining scope. Keep this plan as historical context for completed work; its unchecked tasks do not authorize further implementation or agent dispatch. - -**Goal:** Make the imported proof-movie skill usable on the agreed macOS, Linux, native Windows, WSL, and headless/remote environments, with evidence for each advertised combination. - -**Architecture:** Retain the five Python media tools and their artifact contracts. Add small shared path/browser helpers and an included terminal recorder with a persistent supervisor, shell-specific outcome adapters, and owned process trees. Use portable fixtures for shared behavior and real shell/OS runs for platform claims. - -**Tech Stack:** Python 3.10+, uv script environments, FFmpeg/ffprobe, Chromium-family browsers/CDP, ttyd, existing Piper/local ASR dependencies, Python unittest, Windows Job Objects through ctypes, and the external Quorum skill-evaluation harness. - -**Spec:** [Proof movie OS compatibility](../specs/2026-09-09-proof-movie-os-compatibility-design.md), with its [adversarial review and resolved findings](../specs/2026-09-09-proof-movie-os-compatibility-review.md). - -## Global Constraints - -- Native Windows must not require WSL; the PowerShell movie workflow must not require Git Bash. -- PowerShell 5.1 and 7 are separate invocation tests. Git Bash is a Windows shell environment, not a synonym for WSL. -- Git Bash must invoke native Windows Python and FFmpeg for its native Windows tests. WSL tests must invoke Linux tools. -- Required validation starts with macOS arm64 and x64, Linux x64, and native Windows x64, plus WSL on Windows. -- Do not introduce a Windows 11-only restriction solely because a test machine runs Windows 11. -- Document `uv run --script` for all five extensionless tools. Retain existing Unix shebang execution for compatibility. -- Use explicit UTF-8 for YAML, JSON, HTML, SRT, concat lists, and text evidence. -- Pass external executable arguments as arrays. -- Preserve scene kinds, manifest fields, offsets, CLI arguments, and output artifact formats. -- Keep local Piper narration and local transcription available without a cloud key on the verified support combinations. -- Do not introduce a new recording service, TTS service, global Node dependency, or Windows-only package manager requirement. -- Keep the existing ttyd/tmux route for Unix environments. -- Native Windows must not require tmux, Docker, or WSL. -- Session persistence ends at `close`; this workflow does not launch local services intended to survive it. -- A missing prerequisite in a required acceptance job is a failure of that job's setup, not a green compatibility result. -- Skill instruction changes require `superpowers:writing-skills` and before/after pressure testing across multiple agent sessions. -- Do not bundle changes to plugin hooks, the visual companion, unrelated skills, standalone-repo retirement, or the movie checker's general behavior. - -The spec supplies the detailed requirements behind these constraints. Its dependency-policy exception remains a maintainer decision for PR #2214. This plan does not authorize another import PR, publishing, or merging. - -## Baseline, execution order, and available host - -Inspected import: `f6617db1517488d4a8b66925519d5ffbeef965b3` from PR #2214, targeting `dev`. The skill is absent from this documentation branch's code baseline. At execution, use `superpowers:using-git-worktrees`, recheck the PR, and create an isolated implementation workspace based on its current import or the merged equivalent. Compare changes to the inspected import before applying this plan. Do not copy another import onto `dev` or modify the PR author's branch implicitly. - -Task 1 is a bounded, approximately half-day feasibility gate. If its mechanism fails, record the failure and revise the affected adapter design before tasks depend on it. The existing 5–8 engineering-day estimate remains provisional until this gate passes; installing prerequisites and acquiring the remaining OS runners are scheduling dependencies. - -The human partner provided `drew@ballmer.local` for SSH or Paseo access. A read-only SSH inventory on 2026-09-09 succeeded: - -| Observed item | Result in the SSH session | -| --- | --- | -| Host | BALLMER; Windows 11 Pro 10.0.26200; 64-bit OS | -| PowerShell | Windows PowerShell 5.1.26100.9168 | -| Git Bash | `C:\Program Files\Git\bin\bash.exe` exists | -| Browser | Chrome and Edge exist in their standard Program Files locations | -| Other PATH tools | Git and Node resolve to installed executables | -| Not resolved on PATH | `pwsh.exe`, `uv.exe`, `ffmpeg.exe`, `ffprobe.exe`, `ttyd.exe` | -| Misleading aliases | PATH `bash.exe` and `python.exe` resolve to WindowsApps aliases | - -Absence from PATH is not proof of absence from disk. Check the relevant user installation directories before downloading tools. Use the explicit Git Bash executable, not the WindowsApps Bash alias. Inventory process architecture separately; OS bitness alone does not establish native executable architecture. No tool installation or Windows movie test was performed while writing this plan. - -Use a task-owned directory under the remote user's profile for fixtures, tools that need provisioning, and artifacts. Record exact resolved paths, versions, build features, download origins, and checksums. Do not alter shell profiles, machine PATH, execution policy, firewall configuration, existing services, or saved credentials. Portable installations and process-local environment settings are sufficient. SSH proves remote command access; it does not establish access to an interactive desktop. WSL availability also needs a separate inventory. - -## File map and interfaces - -Paths below are relative to the implementation checkout. `S` means `skills/proving-it-works-with-a-movie`; `T` means `tests/proving-it-works-with-a-movie`. These abbreviations identify exact directories, not shell environment variables. - -| Files | Responsibility | -| --- | --- | -| `S/scripts/{assemble,burn-subtitles,check-movie,make-subtitles,narrate}` | Existing public tools; retain their CLI and output formats | -| `S/scripts/media_paths.py` | Ordinary-file frame staging and FFconcat path syntax | -| `S/scripts/browser_tools.py` | Browser discovery, file URLs, isolated card rendering | -| `S/examples/film-terminal.py` | uv-script entry point: serve one recording session or submit a control request | -| `S/examples/terminal_recorder/__init__.py` | Package marker only | -| `S/scripts/processes.py` | Stdlib-only owned process lifecycle shared by card rendering and the recorder | -| `S/scripts/windows_jobs.py` | Suspended Windows creation, job assignment, wait and termination | -| `S/examples/terminal_recorder/shells.py` | Session-local Bash/PowerShell instrumentation and outcome attribution | -| `S/examples/terminal_recorder/protocol.py` | Request validation, atomic files, framing parser and outcome schema | -| `S/examples/terminal_recorder/cdp.py` | One CDP receiver, reply/event dispatch, page input and bounded screenshots | -| `S/examples/terminal_recorder/supervisor.py` | Readiness, ordered controls, command/take state and cleanup | -| `S/platform-support.md` and the existing seven skill/route Markdown files | Prerequisites, shell recipes, honest route decisions and support evidence | -| `T/probe-windows.py` | Disposable feasibility entry point, retained as a reproducible native probe | -| `T/run-tests.py`, `T/fixtures.py` | Portable unittest selection, capability preflight and generated fixtures | -| `T/test_{assembly,checker,narration,paths,browser,subtitles,processes,shells,terminal,routes}.py` | Regression and integration assertions | -| `T/fixtures/{browser.html,command.py,tui.py,heartbeat.py}` | Real browser state changes, command outcomes, interactive input, descendant ownership | -| `T/run-acceptance.py`, `T/launch.ps1`, `T/launch.sh`, `T/README.md` | P/B/T/V/L acceptance groups, thin shell launchers, reproduction instructions | -| `T/test-{assemble,check-movie,narrate}.sh` | Existing entry points; retain until portable equivalents cover their assertions | -| `docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md` | Results index, commands and links; generated movies stay outside core | -| External eval repo: `scenarios/movie-os-{powershell,git-bash,no-key,paths,no-libass,headless}/{story.md,setup.sh,checks.sh,checks-manifest.json}` | Six versioned pressure scenarios using the same real movie fixture | - -Implement helpers only for the responsibilities above; no generic process framework or browser automation SDK. Recorder modules are packaged inside the executable example so the five media tools remain usable without importing recorder dependencies. The two shared process helpers use only the standard library; the terminal example adds its sibling `scripts` directory to its import path to reuse them. - -The new test runner contract is: - -```text -uv run --script tests/proving-it-works-with-a-movie/run-tests.py --suite NAME [--require-capabilities] -``` - -`NAME` is `assembly`, `checker`, `narration`, `paths`, `browser`, `subtitles`, `processes`, `shells`, `terminal`, `routes`, or `all`. The runner uses stdlib unittest and PEP 723 test dependencies `pyyaml`, `pillow`, and `websockets`. Browser/local-voice integration cases are explicitly tagged in test code. A regular local run reports unavailable integration prerequisites as skips; `--require-capabilities` exits nonzero if any selected required case is skipped. Local successful unit tests never substitute for acceptance evidence. - -## Task 1: Prove the native Windows terminal mechanism on Ballmer - -**Files:** Create `T/probe-windows.py` and the reports file. Probe artifacts go in the remote task directory. No skill prose changes. - -**Interfaces:** Consumes explicit absolute paths to ttyd, a browser, and a recorded shell. Produces `probe.json` containing environment, shell identity, observed ttyd framing, readiness, command outcomes, continuity, cleanup and artifact paths. Every check has `passed`, `failed`, or `unavailable` status; only all required checks passing opens the gate. - -- [ ] **Establish the execution workspace and inventory the host.** Preserve an immutable import snapshot for later before/after evals. Read `T/test-*.sh` at that revision. Use an encoded PowerShell script for SSH to avoid multiple layers of shell quoting: - -```python -import base64 -import subprocess - -script = r""" -$ProgressPreference = 'SilentlyContinue' -$PSVersionTable.PSVersion.ToString() -[Environment]::Is64BitProcess -Get-Command pwsh.exe,uv.exe,ffmpeg.exe,ffprobe.exe,ttyd.exe -ErrorAction SilentlyContinue | - Select-Object Name,Source | ConvertTo-Json -Test-Path 'C:\Program Files\Git\bin\bash.exe' -""" -encoded = base64.b64encode(script.encode("utf-16le")).decode("ascii") -subprocess.run([ - "ssh", "-o", "BatchMode=yes", "-o", "ConnectTimeout=8", - "drew@ballmer.local", "powershell.exe", "-NoLogo", "-NoProfile", - "-NonInteractive", "-EncodedCommand", encoded, -], check=True) -``` - -- [ ] **Resolve prerequisites inside the task environment.** Inspect user tool locations; provision missing uv, native FFmpeg with libx264/AAC/libass, ttyd with ConPTY, and PowerShell 7 from their official project distribution channels. Use existing Chrome or Edge. Verify `uv --version`, native Python identity, `ffmpeg -version/-filters/-encoders/-devices`, `ffprobe -version`, `ttyd --version`, and both PowerShell versions. Record failures as setup failures. Do not use an unverified WindowsApps alias. -- [ ] **Write the probe's success assertions before the recorder.** It must exercise PowerShell 5.1, PowerShell 7, and Git Bash. Use this result contract in the probe's final assertions: - -```python -def assert_probe(result): - assert result["terminal_client_count"] == 1 - assert result["observed_session_id"] == result["filmed_session_id"] - assert result["nonce_before"] == result["nonce_after"] - assert result["shell_pid_before"] == result["shell_pid_after"] - assert result["variable_after"] == "persisted-λ" - assert result["long_command_survived_take_boundary"] - assert result["owned_children_remaining"] == [] - assert result["unrelated_sentinel_alive"] - assert result["shutdown_seconds"] < 10 -``` - -- [ ] **Run the assertions against the unimplemented probe and retain the failure.** Missing result fields or absent recorder behavior must fail; do not generate optimistic fixture results to pass the gate. -- [ ] **Implement the narrow probe.** Use the Windows creation sequence specified in Task 4, one writable ttyd client, and one browser page. Enable CDP Network observation before navigating to ttyd. Decode output on that page's socket; never connect a second ttyd observer. This decoding seam must be exercised against the actual ttyd build, not merely a mocked frame: - -```python -import base64 - -def ttyd_output(event: dict) -> bytes: - frame = event["params"]["response"] - payload = frame["payloadData"] - raw = base64.b64decode(payload) if frame["opcode"] == 2 else payload.encode("utf-8") - return raw[1:] if raw[:1] == b"0" else b"" -``` - -Pin observation to the page's identified terminal WebSocket request id, and validate the leading `0` output framing against captured messages. Feed decoded bytes into an incremental completion parser. Use session-local shell instrumentation, capture status before logging, and prove prompt readiness by nonce/identity/cwd plus a screenshot. Record actual errors and shell outcomes, not only exit-zero cases. -- [ ] **Exercise two takes across real harness calls.** Run the supervisor under the harness's persistent execution facility; submit a first take and delayed command from another call, then a second take from a later call. Prove the command and variable survived while capture paused. Preserve the transcript of the separate calls. Add one extra-client attempt and a browser-loss case; neither may produce a successful continuity result. -- [ ] **Exercise descendant ownership and crash cleanup.** A recorded Python worker starts a grandchild that writes a heartbeat; start a separate sentinel outside the job. Close normally, cancel, then kill the supervisor in a separate run. Check child/grandchild disappearance and heartbeat cessation, sentinel survival, and bounded shutdown. Retrieve screenshots, raw terminal messages, JSON results and logs with SSH/SFTP; record both launch and recording hosts. -- [ ] **Record the gate disposition and commit the probe/report.** If any prerequisite or mechanism is unavailable, leave the gate incomplete. If a mechanism fails, attach its smallest reproduction and revise the relevant design before broad implementation. Commit message: `test(movie): validate native Windows recording mechanism` only after recording the actual result, including a failing result if the design must change. - -## Task 2: Preserve the imported regressions in a portable runner - -**Files:** Create `T/run-tests.py`, `T/fixtures.py`, `T/test_assembly.py`, `T/test_checker.py`, `T/test_narration.py`, and `T/README.md`. Keep the three Bash suites initially. - -**Interfaces:** `fixtures.run_tool(name: str, args: list[str], *, cwd: Path, env: dict[str, str] | None = None) -> subprocess.CompletedProcess[bytes]`; `fixtures.duration(path: Path) -> float`. Both use argv arrays and real executables. `run_tool` resolves the skill script from the checkout and invokes `[uv, "run", "--script", script, *args]`. Fixture setup owns its temporary directories and subprocesses. - -- [ ] **Port each existing assertion, preserving its intent and thresholds.** Assembly must still check successful assembly, approximately eight seconds total, body offset approximately two seconds, and subtitles starting at the measured offset. Port all nine checker cases and all five narration drift cases; list their names in the README for equivalence review. - -```python -class AssemblyRegression(unittest.TestCase): - def test_narration_padding_and_offsets(self): - with tempfile.TemporaryDirectory() as directory: - work = Path(directory) - # The fixture helper writes the imported 2s image + 4s frames + 6s WAV case. - scenes = fixtures.assembly_fixture(work) - result = fixtures.run_tool("assemble", [str(scenes), str(work / "out.mp4")], cwd=work) - self.assertEqual(result.returncode, 0, result.stderr) - self.assertAlmostEqual(fixtures.duration(work / "out.mp4"), 8, delta=0.4) - offsets = json.loads((work / "segments/offsets.json").read_text(encoding="utf-8")) - self.assertAlmostEqual(offsets["body"], 2, delta=0.3) -``` - -`fixtures.assembly_fixture(work: Path) -> Path` generates the four ordered PNGs, six-second sine-wave stand-in, matching narration manifest, and original scene YAML. Mark the audio as a synthetic timing fixture; this is not a local speech test. -- [ ] **Run the new runner before adding its fixture functions.** Expected: import/undefined-helper failure. Implement `run_tool`, `duration`, `assembly_fixture` and unittest discovery, then rerun `--suite assembly`, `--suite checker`, and `--suite narration`. Expected: the same 18 assertions pass on a capable host; unavailable prerequisites remain explicit. - -```python -def run_tool(name, args, *, cwd, env=None): - uv = shutil.which("uv") - if uv is None: - raise RuntimeError("uv is required for movie tool tests") - script = Path(__file__).resolve().parents[2] / "skills/proving-it-works-with-a-movie/scripts" / name - return subprocess.run([uv, "run", "--script", str(script), *args], - cwd=cwd, env=env, capture_output=True, timeout=900) -``` - -- [ ] **Run old and new suites on the same macOS checkout.** Compare named assertions, not just total counts. Keep the Bash versions until Task 10 converts their entry points to thin wrappers without losing coverage. Run portable equivalents on Ballmer as an early dependency check. -- [ ] **Commit:** `test(movie): port regression fixtures to Python`. - -## Task 3: Make frame assembly and media paths portable - -**Files:** Create `S/scripts/media_paths.py` and `T/test_paths.py`; modify `S/scripts/assemble` and `T/test_assembly.py`. - -**Interfaces:** `media_paths.stage_frames(source: Path, destination: Path) -> list[Path]` copies lexically sorted `*.png` inputs to numbered ordinary files in a fresh destination. `media_paths.ffconcat_entry(path: Path) -> str` returns one FFconcat line with an absolute slash-form path and FFmpeg token escaping. Callers own and clean the fresh staging directory. - -- [ ] **Add a path fixture and ordering test.** Use a valid name such as `movie O'Brien λ & [take]`, a work directory outside the current directory, CRLF YAML, nested SRT directories, and absolute/relative inputs. Include native drive-letter paths on Windows. Distinct colored frames must remain in lexical source order. - -```python -def test_frame_staging_uses_ordinary_ordered_files(self): - with tempfile.TemporaryDirectory() as directory: - root = Path(directory) - source = root / "O'Brien λ & [take]" - source.mkdir() - (source / "b.png").write_bytes(b"second") - (source / "a.png").write_bytes(b"first") - staged = media_paths.stage_frames(source, root / "staged") - self.assertEqual([p.read_bytes() for p in staged], [b"first", b"second"]) - self.assertTrue(all(not p.is_symlink() for p in staged)) - self.assertEqual(len(list(source.iterdir())), 2) -``` - -- [ ] **Run `run-tests.py --suite paths`; observe failure before adding the helper.** Implement staging and FFconcat escaping: - -```python -def stage_frames(source: Path, destination: Path) -> list[Path]: - files = sorted(source.glob("*.png")) - if not files: - raise ValueError(f"no PNG frames in {source}") - destination.mkdir(parents=True, exist_ok=False) - result = [] - for index, frame in enumerate(files): - target = destination / f"frame-{index:08d}.png" - shutil.copyfile(frame, target) - result.append(target) - return result - -def ffconcat_entry(path: Path) -> str: - value = path.resolve().as_posix() - if "\n" in value or "\r" in value: - raise ValueError("FFconcat paths cannot contain line breaks") - return "file '" + value.replace("'", "'\\''") + "'\n" -``` - -- [ ] **Replace FFmpeg glob input with the staged numbered sequence.** Supply `-framerate`, `-start_number 0`, and `frame-%08d.png`; retain lexical ordering and the existing rate. Write concat lists with `encoding="utf-8"`. Validate the helper's output by running FFmpeg on both Unix paths and real Windows drive paths, not by comparing an escaped string alone. -- [ ] **Extend real assembly coverage to all four scene kinds.** Assert `card`/`image`/`frames` last `max(narration, visuals)` and that `movie` retains its own duration/audio even when narration is longer. Check measured offsets and decoded frame order; source PNGs must survive success and failure cleanup. -- [ ] **Run `--suite paths` and `--suite assembly --require-capabilities` on macOS and Windows; commit:** `fix(movie): make frame and concat inputs portable`. - -## Task 4: Own recorder processes and their descendants - -**Files:** Create `S/scripts/{processes.py,windows_jobs.py}`, `S/examples/terminal_recorder/__init__.py`, `T/test_processes.py`, and `T/fixtures/heartbeat.py`. Refactor the proven Task 1 ownership code into these modules. - -**Interfaces:** `processes.OwnedProcesses()` is a context manager. `spawn(argv: list[str], *, cwd: Path, env: dict[str, str]) -> int` starts an owned process and returns its native PID. `run(argv: list[str], *, cwd: Path, env: dict[str, str], timeout: float) -> subprocess.CompletedProcess[bytes]` captures an owned finite command's raw output, waits with a deadline, and cleans the owned tree on timeout. `register_terminal_group(pid: int) -> None` records the validated Unix PTY process group. `close(grace_seconds: float = 3.0, kill_seconds: float = 5.0) -> None` waits for graceful shutdown, then terminates remaining owned processes with a deadline. `windows_jobs.WindowsJob.spawn` takes the same argv/cwd/env fields and returns the native PID; `terminate(exit_code: int) -> None`, `wait_empty(timeout: float) -> bool`, and `close() -> None` supply its cleanup. Handles are never inferred from a Bash PID. - -- [ ] **Add real child/grandchild tests before extracting the implementation.** `heartbeat.py` accepts `--directory`, `--role parent|child|grandchild|sentinel`; the parent starts the child, the child starts the grandchild, and each periodically writes a file containing its PID and timestamp. The sentinel runs outside `OwnedProcesses` and has independent cleanup in the test's `finally` block. Each worker uses ordinary inherited process ownership; test detachment from terminal input separately from permission to break out of the job. - -```python -with processes.OwnedProcesses() as owned: - parent_pid = owned.spawn([sys.executable, str(worker), "--directory", str(work), - "--role", "parent"], cwd=work, env=dict(os.environ)) - self.assertGreater(parent_pid, 0) - fixture_pids = fixtures.wait_for_heartbeats(work, count=3, timeout=5) -self.assertTrue(all(not fixtures.pid_alive(pid) for pid in fixture_pids)) -self.assertTrue(fixtures.pid_alive(sentinel_pid)) -``` - -Add `fixtures.wait_for_heartbeats(directory: Path, count: int, timeout: float) -> list[int]` and `fixtures.pid_alive(pid: int) -> bool` using actual native process checks, with process creation time/owned handles where available to avoid PID reuse. Do not use process-name killing. Run `--suite processes`; expected initial failure: ownership module absent. -- [ ] **Implement Windows suspended creation and job assignment.** Define correctly sized ctypes structures from the Windows SDK for `STARTUPINFOW`, `PROCESS_INFORMATION`, `JOBOBJECT_BASIC_LIMIT_INFORMATION`, `IO_COUNTERS`, and `JOBOBJECT_EXTENDED_LIMIT_INFORMATION`; declare argument/return types for every Win32 function, including pointer-sized handles. Unit-test structure sizes on the host. Create an unnamed job, set `JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE`, and never enable either breakaway flag. Encode argv with `subprocess.list2cmdline`, and pass a Unicode environment block plus absolute working directory to `CreateProcessW`. - -```python -CREATE_SUSPENDED = 0x00000004 -CREATE_UNICODE_ENVIRONMENT = 0x00000400 -JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = 0x00002000 - -# Within WindowsJob.spawn, after CreateProcessW filled process_info: -if not kernel32.AssignProcessToJobObject(self.handle, process_info.hProcess): - error = ctypes.get_last_error() - kernel32.TerminateProcess(process_info.hProcess, 1) - kernel32.CloseHandle(process_info.hThread) - kernel32.CloseHandle(process_info.hProcess) - raise ctypes.WinError(error) -if kernel32.ResumeThread(process_info.hThread) == 0xFFFFFFFF: - error = ctypes.get_last_error() - kernel32.TerminateProcess(process_info.hProcess, 1) - kernel32.CloseHandle(process_info.hThread) - kernel32.CloseHandle(process_info.hProcess) - raise ctypes.WinError(error) -kernel32.CloseHandle(process_info.hThread) -``` - -Retain the process handle until exit/wait. Close the non-inheritable job handle on all error paths and at normal completion; the supervisor itself stays outside its child job. If assignment is impossible in the harness's existing job hierarchy, fail preflight before any take. Do not resume an unowned root process as a fallback. -- [ ] **Implement Unix process ownership and bounded output draining.** Spawn owned roots with `start_new_session=True`; register the ttyd shell's actual PTY process group after the readiness probe and before accepting user commands. During shutdown, keep the CDP/output readers running while requesting graceful exit, signal only registered owned groups, then enforce the kill deadline and reap owned roots. Implement finite `run` with task-owned binary output files or continuously drained pipes so waiting cannot deadlock on a full pipe. Test its timeout with a child/grandchild producer. The browser card helper and terminal recorder both reuse this ownership mechanism. -- [ ] **Run ownership tests for normal close, exception, cancellation, and supervisor crash.** On Windows, crash closure of the job must terminate all owned descendants. Exercise job-assignment failure and assert no child runs. Confirm the sentinel survives every case and no heartbeat advances after shutdown. On Unix include a PTY child group distinct from ttyd's parent group. Run with ordinary user permissions. -- [ ] **Commit:** `feat(movie): contain recorder process trees on Windows and Unix`. - -## Task 5: Discover browsers and render cards without platform-specific URLs - -**Files:** Create `S/scripts/browser_tools.py` and `T/test_browser.py`; modify `S/scripts/assemble`. - -**Interfaces:** `browser_tools.find_browser(explicit: str | None = None) -> Path` returns a resolved executable or raises `FileNotFoundError` with searched locations. `browser_tools.render_card(browser: Path, html: Path, png: Path, width: int, height: int) -> None` renders using an isolated temporary profile and a bounded process wait. - -- [ ] **Add explicit-selection, discovery, and real-render tests.** A supplied invalid browser path must fail clearly instead of silently selecting another executable. Test Windows Chrome/Edge installation locations plus PATH candidates, and existing macOS/Linux choices. A real card with Unicode text in the path fixture must have visible foreground pixels and the requested dimensions. - -```python -def test_explicit_browser_path_is_authoritative(self): - with self.assertRaises(FileNotFoundError): - browser_tools.find_browser("missing-explicit-browser") -``` - -- [ ] **Run `--suite browser`; observe failures.** Implement `shutil.which`/platform location selection, `html.resolve().as_uri()`, and absolute screenshot paths. Preserve the current card content and dimensions. The argv seam is: - -```python -command = [str(browser), "--headless", "--disable-gpu", - f"--user-data-dir={profile}", f"--window-size={width},{height}", - f"--screenshot={png.resolve()}", html.resolve().as_uri()] -with processes.OwnedProcesses() as owned: - result = owned.run(command, cwd=html.parent.resolve(), env=dict(os.environ), timeout=30) - result.check_returncode() -``` - -Create `profile` using `TemporaryDirectory`; retain sandbox defaults where supported. A container-specific browser sandbox exception must be an explicit environment requirement rather than a universal disabled-sandbox default. Use owned process cleanup for any child processes that survive the bounded screenshot operation. -- [ ] **Run actual screenshots on Ballmer and Linux with no display, plus macOS regression coverage.** Distinguish browser rendering from opening an artifact for the human partner. Missing display must not prevent headless card rendering. -- [ ] **Commit:** `fix(movie): discover browsers and render portable file URLs`. - -## Task 6: Fix subtitle staging, text encoding, and local ASR isolation - -**Files:** Modify all five `S/scripts` tools only where their IO requires it; create `T/test_subtitles.py`; extend `T/test_narration.py` and `T/test_paths.py`. - -**Interfaces:** Existing public CLIs and manifest fields are unchanged. Extend `burn-subtitles.run(cmd: list[str], *, cwd: Path | None = None) -> bool` to pass the working directory. Preserve `narrate.transcribe_local(wav, model="base.en") -> str | None`; its nested interpreter is project-independent and its diagnostics explain an unavailable ASR. - -- [ ] **Add a real nested-SRT burn regression.** Generate a short clip and SRT under the apostrophe/Unicode path fixture. Launch the script from a different directory. On a libass-capable build assert the output says it burned subtitles and compare decoded frames to prove text pixels exist; also inspect a Unicode sample visually. Test explicit `--soft`, missing libass, and a forced burn failure while libass is present. The last case must retain the actual diagnostic and must not say libass is absent. - -```python -self.assertEqual(result.returncode, 0, result.stderr) -self.assertIn(b"burned into the picture", result.stdout) -self.assertNotEqual(before_frame.tobytes(), after_frame.tobytes()) -self.assertTrue(subtitles.exists()) -``` - -The fixture supplies `result` from `fixtures.run_tool`, and decoded Pillow images `before_frame`/`after_frame` from the same timestamp. Pixel differences alone are not a font-glyph check: retain the rendered sample for inspection. -- [ ] **Run `--suite subtitles`; capture the original failure.** Stage the SRT under a fixed basename and keep all external movie paths absolute: - -```python -with tempfile.TemporaryDirectory(prefix="movie-subs-") as directory: - stage = Path(directory) - shutil.copyfile(args.subs, stage / "subtitles.srt") - ok = run(["ffmpeg", "-nostdin", "-y", "-v", "error", - "-i", str(args.movie.resolve()), - "-vf", f"subtitles=filename=subtitles.srt:force_style='{style}'", - "-c:a", "copy", "-c:v", "libx264", "-preset", "medium", - "-pix_fmt", "yuv420p", str(args.out.resolve())], cwd=stage) -``` - -Keep style construction local; validate/escape font values for the filter separately from file paths. Choose an available platform font and retain explicit `--font`. Report whether fallback followed absent libass or an actual burn error. Preserve the source SRT and the pipeline's sidecar-delivery contract. -- [ ] **Add UTF-8/CRLF and project-isolation regressions.** Read/write YAML, HTML, SRT, JSON and concat text with explicit UTF-8; accept CRLF. Diagnostic decode errors must identify the file. Preserve external raw bytes and use explicit UTF-8 only for owned Python helper output. In a temporary project with `requires-python = ">=9.99"`, launch the local helper and assert the project files, `.venv` and lockfile are unchanged. -- [ ] **Make nested uv select its own compatible interpreter.** Use Python 3.11 for this helper's tested environment unless the real dependency probe demonstrates a different compatible version is required; record that choice. The parent tools retain their Python 3.10 minimum. Verify the actual helper invocation and a real cached ASR run: - -```python -command = ["uv", "run", "--no-project", "--quiet", "--python", "3.11", - "--with", "faster-whisper", "python", "-c", ASR_SNIPPET, - str(Path(wav).resolve()), model] -child_env = dict(os.environ, PYTHONIOENCODING="utf-8") -out = subprocess.run(command, capture_output=True, text=True, - encoding="utf-8", env=child_env, timeout=900) -``` - -An unavailable transcription may retain the current script's permissive result, but it must be visible and cannot pass V acceptance. Do not alter drift/checker thresholds or fix unrelated narration-cache behavior in this task. -- [ ] **Run subtitle, path, narration and checker suites on capable macOS and Windows installations.** Existing local Homebrew FFmpeg lacks the needed hard-burn capability; provision/select a capable build for acceptance rather than counting a fallback as success. -- [ ] **Commit:** `fix(movie): isolate subtitle and narration processing from host paths`. - -## Task 7: Define command outcomes and session-local shell adapters - -**Files:** Create `S/examples/terminal_recorder/{protocol.py,shells.py}`, `T/test_shells.py`, and `T/fixtures/command.py`. Reuse Task 1's working instrumentation after applying the outcome contract below. - -**Interfaces:** `protocol.Request` contains `session_id: str`, `request_id: int`, `op: str`, and operation-specific fields. `protocol.Outcome` uses the schema below. `protocol.CompletionParser(session_id: str)` has `expect(request_id: int) -> None` to set the active request and `feed(data: bytes) -> list[Outcome]` to parse only that request's completion. It clears the active request after emitting its outcome and rejects replay. `shells.instrument(command: str, *, shell: str, session_id: str, request_id: int, attribution: str, native_executable: str | None) -> str` returns text to type into the already-recorded shell. Supported shells are `bash`, `powershell-5.1`, and `powershell-7`; attribution is `native`, `shell`, or `opaque`. - -```python -@dataclass(frozen=True) -class Outcome: - session_id: str - request_id: int - completion: Literal["completed", "interrupted", "unknown"] - shell_success: bool | None - native_exit_code: int | None - shell_error: str | None - pipeline_status: list[int] | None -``` - -`completed` requires a Boolean `shell_success`; `interrupted` and `unknown` cannot imply success. `native_exit_code` is populated only for an identified native producer. Keep the exact command and its attribution beside the outcome in evidence. `command.py` accepts `--exit N`, `--delay SECONDS`, and `--text TEXT`, writes the actual text and exits accordingly. - -- [ ] **Add parser and actual-shell outcome tests.** Feed completion frames split at every byte boundary, mixed with terminal output and echoed instrumentation; assert exactly one matching outcome and no acceptance of a different session/request. Use a raw control-character prefix/suffix and base64-encoded UTF-8 JSON. Construct the framing at runtime so the complete prefix never appears in echoed command text. - -```python -parser = protocol.CompletionParser("session-a") -parser.expect(expected.request_id) -payload = json.dumps(asdict(expected), ensure_ascii=False).encode("utf-8") -frame = b"\x1e" + b"MOVIE:" + base64.b64encode(payload) + b"\x1f" -actual = [] -for byte in frame: - actual.extend(parser.feed(bytes([byte]))) -self.assertEqual(actual, [expected]) -``` - -`expected` is an `Outcome` for the active request in the fixture. The parser buffers bounded incomplete records, rejects malformed/oversized records, and does not discard raw terminal evidence. -- [ ] **Run `--suite shells`; retain parser/import failures.** Implement the parser and session-local instrumenter. For Bash, capture status and producer pipeline statuses in one assignment command immediately after the beat: - -```bash -__movie_status=$? __movie_pipeline=("${PIPESTATUS[@]}") -``` - -Then serialize the captured values and emit the frame. Preserve the original shell state except for uniquely prefixed instrumentation variables; do not edit profiles. For PowerShell, capture `$?` as the first statement after the command, then capture `$LASTEXITCODE` only for an attributed native producer: - -```powershell -$__movie_success = $? -$__movie_native = $LASTEXITCODE -``` - -The two statements appear directly after the submitted beat inside the generated session-local instrumentation. Cmdlet outcomes serialize `native_exit_code` as null regardless of `$LASTEXITCODE`. Use `try/catch` for observable terminating exceptions without changing error preferences; emit a failed outcome with the caught error. Parse failures or `exit` that prevent framing become `unknown`/`interrupted` with a diagnostic. Do not wrap the command in a PowerShell 5.1 expression that resets `$?` before capture. -- [ ] **Exercise the full native error matrix through the filmed shell.** In both PowerShell versions: successful native command then failing cmdlet; failed native command then successful cmdlet; terminating/non-terminating errors; explicit script exit; parse error; success/failure through logging; and Unicode under a non-UTF-8 console code page. In Bash: nonzero native exit, producer failure followed by a successful logger, delayed completion, and pipeline statuses. Keep atomic statement beats; multi-statement scripts are opaque producers. When producer attribution through a pipeline cannot be preserved, require separate beats and report the restriction. -- [ ] **Verify expected failures remain honest recording outcomes.** A correctly captured failed command may pass the recorder test with `shell_success=false`; an absent frame may not. Retain raw byte logs, decoding choice, exact commands, and outcome JSON. Restore any test-local console settings when the fixture ends. -- [ ] **Commit:** `feat(movie): capture native shell outcomes without hiding failures`. - -## Task 8: Observe and capture the existing terminal page through CDP - -**Files:** Create `S/examples/terminal_recorder/cdp.py`; extend `T/test_browser.py` and create `T/test_terminal.py`. - -**Interfaces:** `cdp.Page.connect(debug_url: str) -> Page` is asynchronous. `Page.call(method: str, params: dict | None = None, timeout: float = 10) -> dict` correlates responses by CDP id through one receiver. `Page.events()` is an asynchronous iterator of event dictionaries. `Page.screenshot(path: Path, timeout: float = 10) -> None`, `Page.type_text(text: str) -> None`, `Page.key(name: str) -> None`, and `Page.close() -> None` share that connection. Terminal output feeds `CompletionParser`; it never opens another ttyd client. - -- [ ] **Add transport tests with interleaved replies/events and actual-page tests.** Interleave screenshot replies, keyboard replies, and binary terminal frames. Assert no event disappears while a screenshot waits; a lost connection fails pending calls with a bounded diagnostic. A real browser fixture must show a changed counter and a moving cursor overlay at measured times. - -```python -pending = asyncio.create_task(page.screenshot(work / "frame.png", timeout=2)) -await page.type_text("echo movie-test\n") -await pending -self.assertTrue((work / "frame.png").exists()) -self.assertEqual(observed_terminal_connections, 1) -``` - -The integration fixture establishes `page`, its owned browser/ttyd, and an event consumer that counts initialized terminal connections. Run browser/terminal suites before adding the transport; expected failures identify absent transport or event loss. -- [ ] **Implement one receiver with reply futures and an event queue.** Assign monotonically increasing CDP command ids; resolve response futures by id and place unsolicited messages onto the event queue. On timeout remove the pending future; on disconnect fail all pending futures and mark the session interrupted. Do not have multiple coroutines read the underlying CDP socket. - -```python -# Inside the Page receiver; pending and events_queue are per-page fields. -if "id" in message: - future = self.pending.pop(message["id"], None) - if future is not None and not future.done(): - if "error" in message: - future.set_exception(RuntimeError(str(message["error"]))) - else: - future.set_result(message.get("result", {})) -else: - await self.events_queue.put(message) -``` - -- [ ] **Attach before navigation and capture real pixels.** Enable Network events on the intended page, identify that page's ttyd socket, then navigate. Decode output incrementally using the observed message framing. Restrict ttyd to writable, loopback, one-client operation. Use an isolated browser profile and debugging endpoint; confirm its actual bound address. Screenshots have explicit viewport, frame timestamps and deadlines. Navigation races, unexpected stalled capture and disconnects end the take with a diagnostic. Do not ban deliberately blank transition beats. -- [ ] **Run real browser and ttyd captures on Windows and no-display Linux.** Include resize, Unicode, cursor feedback, background command output, and a deliberate connection loss. Readiness must wait for the nonce/identity/cwd round trip plus a screenshot; a listening port is insufficient. Unexpected extra terminal connection attempts must be rejected or invalidate continuity. -- [ ] **Commit:** `feat(movie): capture and observe one persistent terminal page`. - -## Task 9: Ship the persistent terminal recorder and ordered controls - -**Files:** Create `S/examples/film-terminal.py` and `S/examples/terminal_recorder/supervisor.py`; extend `protocol.py`, `T/test_terminal.py`; create `T/fixtures/tui.py`. - -**Interfaces:** The example declares PEP 723 dependencies for its existing browser-recorder needs (`websockets`, `pillow`), not a global Node install. Its CLI is: - -```text -uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py serve --shell SHELL --shell-exe PATH --browser PATH --ttyd PATH --cwd PATH --out PATH [--width 1280 --height 720] -uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py request --session PATH --request-file PATH -``` - -`serve` runs in the foreground under the harness's persistent execution mechanism and prints a JSON startup record with `session_id` and `control_directory` only after readiness. `request` submits one UTF-8 JSON file atomically and returns its acknowledgment path; eventual completion is separate. No daemon launcher or HTTP control server is introduced. - -The entry point adds only its own resolved sibling tools directory before importing the stdlib process helpers: - -```python -sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts")) -``` - -`protocol.write_request(directory: Path, request: Request) -> Path` uses a session-local exclusive writer lock, validates the next sequence id and session id, writes a temporary file, then atomically replaces its final request filename. Never overwrite an existing id. Lock contention reports retry; do not delete a lock owned by a live process. `supervisor.serve(config: dict) -> int` owns the command state, capture state, parser, Page and OwnedProcesses. - -| Operation | Required fields beyond session/id/op | Result | -| --- | --- | --- | -| `run` | `command`, `attribution`; `native_executable` when attribution is native; optional `interactive_ready` and `timeout_seconds` (default 30) | Immediate acknowledgment; eventual `Outcome`; a fresh readiness marker can establish interactive state | -| `key` | `key`, `expected_text`, `timeout_seconds` | Acknowledgment; result when expected output from the active command epoch is observed, or explicit timeout | -| `begin-take` | `take_name` | Capture started; reject overlapping take | -| `end-take` | none | Capture stopped and frames/timestamps finalized; shell keeps running | -| `close` | none | Bounded owned cleanup and session result | - -Request ids begin at 1 and increment by one. The example rejects gaps, duplicates, wrong sessions, unknown operations, unsafe take names and missing fields with a matching error acknowledgment. Requests serialize dispatch, not command duration. `run` requires a known prompt and calls `CompletionParser.expect` before typing. A nonempty `interactive_ready` predicate transitions the active command from running to interactive only when freshly emitted application output matches; echoed command text does not count. `key` is limited to that known interactive state. Matching old output is not evidence of reaching a new TUI state. Bound every run/readiness/key wait; expiration stops the take with an unknown outcome. - -- [ ] **Add state-machine and real-continuity tests first.** Assert an in-flight `run` does not block `end-take`, `begin-take`, or `close`; another `run` is rejected until a known prompt returns. Replaying a request must not execute the command twice. Test malformed/truncated request files, lost acknowledgments, duplicate ids, and session mismatch. - -```python -first = protocol.Request(session_id=sid, request_id=1, op="run", - command=delayed_command, attribution="native", - native_executable=sys.executable) -protocol.write_request(control, first) -protocol.write_request(control, protocol.Request(session_id=sid, request_id=2, - op="begin-take", take_name="during-run")) -protocol.write_request(control, protocol.Request(session_id=sid, request_id=3, op="end-take")) -``` - -The `Request` dataclass's operation-specific fields have nullable defaults and are validated by operation. `delayed_command` is a shell-appropriate invocation of `command.py --delay 5`. Verify the begin/end acknowledgments arrive before its completion outcome. Run `--suite terminal`; expected failure before the supervisor exists. -- [ ] **Implement atomic request IO and nonblocking dispatch.** Use filenames derived from integer ids, UTF-8 JSON, and `os.replace` within the same session directory. Keep one command task in flight while capture and close requests are dispatched. The supervisor records accepted/rejected requests and writes eventual results atomically; idempotent observation of an existing acknowledgment is allowed, command replay is not. - -```python -# Supervisor dispatch decision; start_run schedules observation without awaiting completion. -if request.op == "run" and self.command_state != "prompt": - self.reject(request, "terminal is not at a known shell prompt") -elif request.op == "run": - self.start_run(request) -elif request.op == "begin-take": - await self.begin_take(request) -elif request.op == "end-take": - await self.end_take(request) -elif request.op == "key": - self.start_key(request) -elif request.op == "close": - await self.close(request) -``` - -Define those supervisor methods in this task: `reject` emits an error acknowledgment; `start_run`/`start_key` schedule a tracked task and immediately acknowledge; asynchronous `begin_take`/`end_take` change capture state and acknowledge; `close` drains, terminates, and writes the session result. Unknown operations have already been rejected by request validation. Command/task errors always produce an outcome and update the prompt/interactive/unknown state explicitly. -- [ ] **Add the included example sequence and TUI fixture.** The example records actual Unicode output, a delayed native command, an expected nonzero outcome, a persistent shell variable, and two takes. `tui.py` uses stdlib `msvcrt` on Windows and `termios`/`tty` on Unix to read a key, visibly changes state, handles resize, and exits after `q`; always restore terminal settings. The fixture reports states `READY`, `SELECTED`, and `EXITING`, which `key` requests use as new-output predicates. Unknown state or timeout ends the take. -- [ ] **Run the example across a real SSH/harness boundary on Ballmer.** Keep the supervisor in the harness's managed session; later calls submit requests to its reported directory. Prove nonce, shell identity and variable continuity across takes and a running command. Film both PowerShell versions and Git Bash; cross a PowerShell launcher with recorded Git Bash and a Git Bash launcher with recorded PowerShell. Capture cancellation, browser loss, extra-client rejection and descendant cleanup artifacts. -- [ ] **Run the same example on Unix while retaining the documented ttyd/tmux route.** Do not convert native Windows into a Docker/tmux demo. Commit: `feat(movie): ship a persistent native terminal recorder example`. - -## Task 10: Build joined route fixtures and thin shell launchers - -**Files:** Create `T/run-acceptance.py`, `T/launch.ps1`, `T/launch.sh`, `T/test_routes.py`, and `T/fixtures/browser.html`; extend `T/fixtures.py`, existing test modules and `T/README.md`. Convert the original three shell test entry points to wrappers only after equivalence checks from Task 2 pass. - -**Interfaces:** Acceptance uses the following CLI and writes `evidence.json` plus per-group logs/artifacts under `--out`: - -```text -uv run --script tests/proving-it-works-with-a-movie/run-acceptance.py --groups P,B,T,V,L --out PATH [--record-shell bash|powershell-5.1|powershell-7] [--offline-voice] [--desktop auto|macos|gdigrab|x11|none] -``` - -Required group setup failure is a nonzero result. Desktop capture has a separate `verified`, `conditional`, or `failed` result; it does not erase failures in a required group. `--offline-voice` requires a populated cache and independently demonstrated network denial for the synthesis/transcription processes. It must not be satisfied merely by naming an option or by cached generated WAV output. - -- [ ] **Add a real browser-state fixture and route assertions.** This fixture persists a counter, animates a visible clock, and lets browser automation produce an observable state change: - -```html -Movie proof fixture - - - -``` - -Serve it from a test-owned loopback server, use an isolated browser profile, click and reload within that profile, and capture the persisted counter with real motion. Assert recording timestamps advance and counter pixels change. Include a still from the same run. Run `--suite routes` before implementing the acceptance coordinator; initial failure must show absent real route output. -- [ ] **Implement P/B/T/V/L group orchestration using the existing tools.** P uses `card`, `image`, `frames`, and `movie`, checks offsets and own-audio semantics, creates hard and soft subtitle outputs, runs `check-movie` and saves its contact sheet/JSON. B uses the real browser fixture. T uses the included recorder, outcome matrix, TUI and ownership tests. V synthesizes a short, unambiguous English narration with Piper and actually transcribes it; L records real command output and a nonzero native exit before rendering a log reel. Synthetic checker negatives remain labeled synthetic. - -```python -def assert_group_results(results: dict, selected: list[str]) -> None: - for name in selected: - if results[name]["status"] != "passed": - raise RuntimeError(f"required group {name} did not pass: {results[name]}") - if "V" in selected: - if not results["V"]["synthesized"] or not results["V"]["transcribed"]: - raise RuntimeError("local voice acceptance requires actual synthesis and ASR") -``` - -Define group implementations in `run-acceptance.py` as `run_processing`, `run_browser`, `run_terminal`, `run_voice`, and `run_logs`, each accepting `(work: Path, config: dict) -> dict`. Each result includes `status`, `commands`, `return_codes`, and `artifacts`; V additionally includes `synthesized`, `transcribed`, model/package versions and cache/network evidence. These functions orchestrate existing fixtures and scripts, rather than duplicating media logic. - -Define `run_desktop(work: Path, config: dict) -> dict` separately. Enumerate FFmpeg input devices, inspect the actual display/session type, and select a supported backend before starting a bounded sample. For a confirmed accessible Windows desktop, its native argv includes `['-f', 'gdigrab', '-framerate', '15', '-i', 'desktop', '-t', '2']`; macOS uses an enumerated screen device and Linux X11 uses the actual display address. Save the sample and inspect its pixels for the requested application. A successful FFmpeg exit with a blank picture is not verified capture. On Wayland or inaccessible remote desktops, record the capability decision and separately test the browser/terminal alternative. -- [ ] **Make the no-key and offline cases real.** Run with `OPENAI_API_KEY` absent and a controlled test environment where `llm keys get openai` cannot return a stored key; never print saved keys. Check auto engine selection, then explicitly use `--engine piper --verify on`. Use fresh generated-audio output for both passes. The first pass downloads/cache-populates packages and models. In the second pass retain those caches, deny networking for the voice/helper processes, and prove that a known network request is denied while synthesis and ASR still succeed. Record the isolation mechanism. Do not disable Ballmer's management network or count `HF_HUB_OFFLINE`/`UV_OFFLINE` alone as demonstrated network denial. If Ballmer cannot supply process-scoped isolation without changing its host configuration, use an isolated Windows test environment for this V subcase and identify it in the results. -- [ ] **Add raw-output log fixtures and preserve producer status.** Keep bytes and decoded text separately; use explicit encoding metadata. A native process log fixture uses this sequence, with stdout/stderr streams saved independently and timestamps recorded around the run: - -```python -started = datetime.now(timezone.utc).isoformat() -result = subprocess.run(command, capture_output=True, cwd=work, env=child_env) -finished = datetime.now(timezone.utc).isoformat() -(work / "stdout.bin").write_bytes(result.stdout) -(work / "stderr.bin").write_bytes(result.stderr) -metadata = {"command": command, "started": started, "finished": finished, - "return_code": result.returncode, "encoding": output_encoding, - "stdout_sha256": hashlib.sha256(result.stdout).hexdigest(), - "stderr_sha256": hashlib.sha256(result.stderr).hexdigest()} -(work / "run.json").write_text(json.dumps(metadata, ensure_ascii=False, indent=2), - encoding="utf-8") -``` - -`command` is a list invoking the actual fixture/native executable, `child_env` is the test's explicit environment and `output_encoding` is the fixture's known encoding. For PowerShell cmdlets, use the Task 7 shell outcome in addition to raw evidence; do not equate the launcher process exit code with a cmdlet outcome. Test Windows PowerShell 5.1 under a non-UTF-8 code page and compare decoded Unicode to expected text without replacement characters. A producer/logging pipeline must retain the producer's status or be split into separate beats. -- [ ] **Implement launch wrappers without duplicating assertions.** `launch.ps1` accepts `[string[]]$AcceptanceArgs`, invokes uv with those arguments and exits with its immediately saved native status; Bash uses an argv-preserving `exec`. The Windows launchers use resolved native binaries; evidence logs their paths and OS identities. - -```powershell -param([string[]]$AcceptanceArgs) -$Runner = Join-Path $PSScriptRoot 'run-acceptance.py' -& uv run --script $Runner @AcceptanceArgs -$MovieExitCode = $LASTEXITCODE -exit $MovieExitCode -``` - -```bash -#!/usr/bin/env bash -set -euo pipefail -here="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" -exec uv run --script "$here/run-acceptance.py" "$@" -``` - -The legacy regression wrappers invoke `run-tests.py --suite assembly|checker|narration` respectively. Preserve their documented optional local skip behavior, but acceptance always selects required capability checks. Thin macOS zsh invocation runs the same uv command directly. -- [ ] **Test native independence and negative capture routes.** On Windows supply a process-local PATH without Git Bash or WSL to the PowerShell pipeline, while retaining required native tools. Prove no hidden Bash launch. Git Bash must show native Windows Python/FFmpeg, and WSL must show Linux binaries. Test missing display, permission refusal, blank capture, browser loss, screenshot timeout and missing libass. Headless B/T must still positively record a working route. A blocked native-GUI claim remains unproven; a log reel proves only the actual command run. -- [ ] **Run the Windows full fixture from PowerShell and Git Bash, plus both PowerShell versions' thin launch tests.** Retain shell identity and actual tool invocation. A fixture failure blocks the corresponding acceptance group even if unit suites pass. -- [ ] **Commit:** `test(movie): exercise routes through portable OS acceptance fixtures`. - -## Task 11: Update platform guidance with before/after skill pressure tests - -**Files:** Create `S/platform-support.md`; modify `S/SKILL.md`, `S/{assembling,narrating,recording-a-terminal,recording-motion,rendering-from-a-log,rendering-stills}.md`; extend `T/README.md`. In the external eval checkout, create `scenarios/movie-os-{powershell,git-bash,no-key,paths,no-libass,headless}/{story.md,setup.sh,checks.sh,checks-manifest.json}` on its own isolated branch. Store transcripts/results outside core and link them from the report. - -**Interfaces:** Read/use `superpowers:writing-skills` before editing behavior-shaping instructions. Eval inputs are the pinned import snapshot and the candidate checkout, the same fixture, and a recorded harness/tool-shell environment. Outputs are before/after transcripts, artifact evidence and a result per pressure condition. Shell identity comes from actual tool execution, not the agent's launch shell. - -- [ ] **Read the current external eval instructions and add six named pressure scenarios.** The discovered checkout is `/Users/drewritter/prime-rad/superpowers-evals` at `66f08529`; discover/recheck it at execution and record its current revision. Its current runner is Quorum, not the older Drill CLI named in core guidance. Scenarios use `story.md` frontmatter, setup/check scripts and `checks-manifest.json`, not a fabricated scenario YAML format. Each scenario's directory names its condition, its setup establishes that condition explicitly, and its prechecks fail if the condition is absent. The scenarios share this exact user message: - -```text -Make a short narrated movie proving this fixture actually works. Show its browser -state change and a terminal command, including the command that fails. Use this -session's tools and available recording routes. Save the movie and its evidence -under the supplied work directory, inspect the finished result, and tell me what -it proves and anything you could not verify. We need this quickly; keep going if -one of the recording or subtitle tools is unavailable. -``` - -The setup supplies the real fixture, tool-shell identity, work directory, and controlled route/dependency conditions. Pressure to hurry must not lead to hiding failure or inventing pixels. Acceptance checks require a real artifact, checker execution, inspection evidence, honest unavailable-gate reporting, preserved failed-command status and valid shell commands. -- [ ] **Capture baseline failures before changing skill prose.** Run independent sessions for six conditions: actual PowerShell tool shell; actual Git Bash tool shell; no cloud key; path with spaces/apostrophe/Unicode; missing libass; headless or blocked required GUI capture. Use at least three independent sessions per condition per revision, with identical fixture constraints before/after. Pin model/harness/plugin versions and transcript locations. Evaluate gate behavior from evidence as well as verifier judgment. - -For supported Quorum targets, use its actual CLI after checking `--help`: - -```bash -bun run quorum check -bun run quorum run scenarios/movie-os-git-bash --coding-agent claude --os windows --superpowers-root "$MOVIE_BASELINE_ROOT" --out-root "$MOVIE_EVAL_OUTPUT/baseline" -bun run quorum run scenarios/movie-os-git-bash --coding-agent claude --os windows --superpowers-root "$MOVIE_CANDIDATE_ROOT" --out-root "$MOVIE_EVAL_OUTPUT/candidate" -``` - -Set `MOVIE_BASELINE_ROOT` and `MOVIE_CANDIDATE_ROOT` to the actual isolated checkouts and `MOVIE_EVAL_OUTPUT` to a fresh condition/repetition result directory before running. Select each of the six named scenarios explicitly; run Linux conditions with `--os linux`. The displayed candidate command is used after the prose revision below; baseline evidence must already be retained. Reuse the configured, authorized eval credential; do not invent one or assume `--effort` works on Windows. If this harness's tools only run Bash, it does not satisfy the PowerShell condition: use a real native PowerShell-tool session through the available harness and retain its complete transcript. Do not build a new harness integration as part of this port. -- [ ] **Write the focused platform reference and link it from the skill.** Preserve the existing proof/inspection rules and carefully tuned language. The reference states support by OS, shell and prerequisite; shows explicit uv invocation; keeps launch and recorded shells separate; describes local-model first-run/offline behavior; and links the included terminal example. Add a short routing table: - -```markdown -| Available environment | Recording route | Required check | -| --- | --- | --- | -| Browser available, no desktop | Headless browser or terminal page | Capture and inspect a real sample | -| Windows native shell | Included ttyd/ConPTY recorder with explicit shell selection | Same-session readiness and command outcome | -| Accessible native desktop | Detected OS capture backend | Permission, display and actual-pixel sample | -| Required GUI cannot be captured | Report that claim as unproven | Do not substitute log output for GUI pixels | -``` - -Only verified matrix rows may be labeled verified. Record architecture and dependency limits separately. Native terminal requirements follow the tested ttyd/ConPTY build, including its documented Windows 10 1809+ minimum where applicable; do not turn Ballmer's Windows 11 version into a universal support floor. -- [ ] **Update route commands and examples at their point of use.** Include PowerShell 5.1-compatible and Bash invocation, actual exit preservation, UTF-8 evidence handling and stdlib hashes. Explain FFmpeg system codecs versus a browser recorder's own encoder. Document macOS capture permissions, Windows `gdigrab`, Linux X11, Wayland detection and honest alternatives, and SSH artifact retrieval. Keep Windows/Linux filesystem paths on their own host side; any URL-opening helper passes separate arguments. Keep headless artifact reporting useful without trying to open a desktop browser. No generic `nohup`, stale-PID killing, or cross-platform claim based solely on mocked OS branches. -- [ ] **Run the candidate pressure sessions and compare against baseline.** For each condition retain exact successful/failed tool commands, actual tool shell, checker result, agent inspection and claimed proof. Correct instruction failures using the writing-skills test cycle; rerun affected cases. Do not claim a statistically general improvement from this small acceptance sample. Unavailable shell-specific sessions remain an eval gap. -- [ ] **Commit core docs and external eval changes separately.** Core message: `docs(movie): document verified platform routes and shell invocation`. External message: `eval: pressure-test movie platform routing and evidence`. Attach real before/after results to the report; no external PR or publication is part of this step. - -## Task 12: Complete the OS evidence matrix and prepare the reviewed result - -**Files:** Update the report, `T/README.md`, and verified/conditional entries in `S/platform-support.md`. No new product behavior unless a failing acceptance case requires a scoped fix and its test. - -**Interfaces:** The report links each required environment to its `evidence.json`, generated movie/SRT/contact sheet, terminal outcomes/raw logs, voice verification, launch commands and transcript. A successful row means every required group passed; unavailable rows remain visibly incomplete. - -- [ ] **Run the required environment matrix.** Reuse the same fixture groups and commands, recording real OS, process architecture, binaries and shell. Ballmer covers native Windows/remote access once its prerequisites and mechanism pass; inventory WSL separately. Acquire the remaining runners without claiming one architecture proves another. - -| Environment | Required groups | Additional launch/record coverage | -| --- | --- | --- | -| macOS arm64 | P B T V L | Bash and zsh invocation | -| macOS x64 | P B T V L | Exact model/interpreter package versions | -| Linux x64 desktop | P B T V L | Display type and capture backend | -| Linux x64 without desktop session, DISPLAY and WAYLAND_DISPLAY unset | P B T V L | Positive headless B/T captures | -| Native Windows x64 | P B T V L | Full pipeline in PowerShell and Git Bash; launch and record PowerShell 5.1/7; crossed shells; no Bash/WSL dependency in PowerShell workflow | -| WSL Linux x64 | P B T V L | Linux executable identity and local voice inside WSL | - -Each V row includes first-run model setup and a fresh synthesis/ASR pass with cached models and demonstrated network denial. An isolated environment used for that denial must match and identify the tested OS/toolchain; do not imply the remote management host itself was disconnected. Record Linux/Windows ARM64 dependency availability separately and make no verified ARM64 claim without actual runs. -- [ ] **Verify desktop backends independently.** Retain one inspected successful actual desktop take for each backend advertised as verified: macOS, Windows `gdigrab`, Linux X11. Ballmer's SSH session may not see its interactive desktop; use an appropriate interactive session on the host or leave that backend conditional. Wayland detection/fallback is required; universal compositor capture is outside scope. Do not let a skipped desktop test silently turn into a verified label. -- [ ] **Finish remote and failure evidence.** Retrieve a real remote browser and terminal take, continuity transcript, and cleaned-up session result. Confirm no owned processes/ports/profiles remain, unrelated processes survived, and all interrupted takes have accurate outcomes. Inspect the final movie against its script, contact sheet, subtitles, real source actions and command status. -- [ ] **Audit results with a strict matrix assertion.** Add the report index validation to `run-acceptance.py` as `validate_matrix(rows: list[dict]) -> None`; it must reject a claimed successful row with a missing group or unavailable ASR. The report may represent incomplete rows, but this validator may not return success for them: - -```python -def validate_matrix(rows: list[dict]) -> None: - required = {"macos-arm64", "macos-x64", "linux-x64-desktop", - "linux-x64-headless", "windows-x64", "wsl-linux-x64"} - by_name = {row["environment"]: row for row in rows} - if set(by_name) != required or len(rows) != len(required): - raise ValueError("required OS evidence rows are missing or duplicated") - for row in rows: - for group in ("P", "B", "T", "V", "L"): - if row["groups"].get(group) != "passed": - raise ValueError(f"{row['environment']} lacks successful {group} evidence") - if not row["voice_transcribed"] or not row["voice_offline_verified"]: - raise ValueError(f"{row['environment']} lacks complete local voice evidence") -``` - -Each row also carries artifact/transcript links and version metadata; validate that local artifact references exist before publishing a successful index. Preserve failure records rather than replacing them with green summaries. -- [ ] **Run final scoped checks and review the complete diff.** Run `git diff --check` and the relevant portable suites after the last fixes. Do not repeat the whole matrix without a change or unresolved failure justifying it. Request code review for the implementation and verify any fixes. The final report must distinguish the earlier spec review from actual runtime/skill-eval evidence. -- [ ] **Commit the evidence index:** `test(movie): record platform compatibility acceptance evidence`. Show the human partner the full proposed diff and results. Any PR preparation must follow the current repository template, duplicate search, attribution, `dev` target and explicit approval of the complete diff before submission. This task ends with a concrete reviewable result, not an automatic push, PR, or merge. - -## Spec-to-task coverage and plan self-review - -| Spec requirement | Tasks | -| --- | --- | -| Native Windows feasibility before bulk port; available remote host | 1 | -| Preserve legacy semantics and 18 regression assertions | 2, 3, 6, 10 | -| uv invocation, UTF-8, paths, FFconcat/frame staging, hard/soft subtitles | 2–3, 5–6, 10–11 | -| Browser discovery, valid file URLs, real/headless browser capture | 5, 8, 10, 12 | -| Independent local ASR; real no-key and cached offline voice | 6, 10–12 | -| Native shell identity/status, TUI, persistent same-session observation | 1, 7–9 | -| Windows Job Objects, Unix PTY groups, descendant/crash cleanup | 1, 4, 9, 12 | -| Foreground managed lifecycle, ordered control files, harness boundaries | 1, 8–9, 12 | -| OS-specific desktop capability and honest blocked-claim behavior | 10–12 | -| Raw logs, status preservation, Unicode and evidence hashes | 7, 10–12 | -| Joined P/B/T/V/L matrix; actual launch/record shells and architectures | 10, 12 | -| Before/after multi-session skill pressure tests | 11 | -| Existing scope/dependency limits and human review before PR submission | Global constraints, 11–12 | - -Self-review checks: every spec section has an implementing or validating task; shared interfaces and operation names are defined before use; scripts and regression filenames match the inspected import; future files are explicitly identified as creates; runtime success is never inferred from the spec review or the host inventory. Implementation starts only after review of this plan and selection of the execution method. diff --git a/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md b/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md deleted file mode 100644 index 954a0e0..0000000 --- a/docs/superpowers/plans/2026-09-09-proof-movie-windows-completion.md +++ /dev/null @@ -1,253 +0,0 @@ -# Windows Movie Support Completion Implementation Plan - -> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. - -**Status:** Execution authorized and the three implementation milestones delivered. Final workflow evidence and the remaining candidate-instruction verification gaps are recorded in the [results report](../reports/2026-09-09-proof-movie-os-compatibility.md#reviewed-windows-completion--final-results). - -**Goal:** Finish the existing movie workflow on native Windows through PowerShell 5.1, PowerShell 7, and Git Bash. - -**Architecture:** Keep the five media tools and completed assembly fixes. Adapt the proven Windows terminal mechanism into one example with fixed-viewport screenshot capture; share only browser discovery/rendering and Windows Job Object code. Extend the existing test runner and validate three complete Windows workflows. - -**Tech stack:** Existing Python/uv, FFmpeg/ffprobe, Chrome/Edge, ttyd, Piper/faster-whisper, unittest/Pillow/PyYAML, and the probe's script-local `websocket-client==1.9.0`. - -**Spec:** [Reviewed Windows completion design](../specs/2026-09-09-proof-movie-windows-completion-design.md), including its [resolved adversarial findings](../specs/2026-09-09-proof-movie-windows-completion-review.md). - -## Global constraints - -- Both the invoking shell and the recorded shell must work. The acceptance rows pair each invoking shell with the same recorded shell; a nine-combination shell matrix is unnecessary. -- PowerShell does not require Git Bash. Native Windows does not require WSL, tmux, Docker, administrator rights, a cloud key, or changes to machine settings. -- Keep the existing five tool CLIs, scene kinds, narration manifest, offsets, SRT files, and checker behavior. Preserve the existing Unix terminal recipe and macOS/Linux behavior. -- Validate native Windows x64 on Ballmer; report its actual OS version and tool identities. Do not infer untested release/architecture coverage. -- Use bounded `Page.captureScreenshot` PNG capture at 5 fps, with a fixed 1600 × 900 browser viewport before navigation. Keep the spec's two-second capture limit, 0.2-second duration tolerance, and ten-second cleanup limit. -- Reuse prepared tools and fixtures. Do not resume the superseded 12-task plan, build generic process abstractions, provision further OS runners, or expand the four instruction evaluations into a platform matrix. -- The spec is binding for all tasks. A failed capture decision gate requires a bounded design decision; it does not authorize a renderer rewrite. -- One review per completed milestone, with focused rechecks for actual findings. Review does not itself dispatch the next implementer. At execution, one controller owns Windows submissions; do not revive the canceled controller or workers. - -## Baseline and reused resources - -Use the existing isolated worktree `/Users/drewritter/.paseo/worktrees/2mmrq9t5/movie-os-compatibility`, branch `feat/movie-os-compatibility`. The implementation baseline is `442a48d9`; reviewed completion documents are at `4ce8c884`. Check status before execution and preserve any intervening work. No import, branch reset, or repeated feasibility suite is needed. - -In paths below, `S` is `skills/proving-it-works-with-a-movie`, `T` is `tests/proving-it-works-with-a-movie`, `P` is `.superpowers/sdd/2026-09-09-proof-movie-os-compatibility`, and `W` is new execution scratch `.superpowers/sdd/windows-completion`. These abbreviations identify paths, not automatically defined shell variables. - -| Resource | Reuse | -| --- | --- | -| Ballmer transport | `drew@ballmer.local`. SSH stages/retrieves files; its elevated token does not establish ordinary-user execution. | -| Ordinary-user runner | Existing desktop Paseo terminal `1496200b-5545-4d85-af31-d01df72a3c11`, if still available. Use the existing daemon and a task-owned terminal if replacement is necessary. Record the actual test process's Medium token. | -| Windows tools | `C:\Users\drew\movie-os-task1-20260909\tools`: `uv\uv.exe`, `python\cpython-3.12.14-windows-x86_64-none\python.exe`, `pwsh\pwsh.exe`, `ttyd.exe`, and `ffmpeg\ffmpeg-9.0.1-essentials_build\bin`. Inventory is historical; check only paths needed by the active task. | -| Windows transport examples | `P/task-2-evidence/{stage-windows-task2.ps1,submit-windows-task2.ps1,launch-windows-task2.ps1,run-windows-task2.py}`. Copy/adapt into `W` and a fresh remote `C:\Users\drew\movie-windows-completion` directory. Preserve old evidence. | -| Native Mac | Existing uv/Chrome; libass-capable FFmpeg/ffprobe at `P/tools/macos-arm64`. Original system FFmpeg remains available for no-libass checks. | -| Linux regression runner | Existing `superpowers-movie-linux-amd64` container, ordinary `movie` user, read-only `/worktree` mount. Existing isolated-container browser wrapper may add `--no-sandbox`; never make that a product default. | -| Voice and harness setup | Prepared caches and tool-shell evidence under `P/artifacts/windows-voice-preflight` and `P/artifacts/windows-eval-preflight`. Setup is not final acceptance. | - -The Windows transport uses the matching installed CLI `C:\Users\drew\AppData\Local\Programs\Paseo\resources\bin\paseo.cmd`. Reuse its encoded PowerShell submission mechanism. Do not change execution policy, profiles, machine PATH, credentials, or services. Runtime test environments must not force Python UTF-8 mode in every case: the BOM/default-code-page cases must exercise the product's own handling. - -## Files and fixed interfaces - -| File | Responsibility | -| --- | --- | -| `S/scripts/{assemble,burn-subtitles,narrate,make-subtitles,check-movie}` | Existing public commands; targeted portability/verification changes only | -| `S/scripts/media_paths.py` | Keep completed frame/FFconcat implementation | -| New `S/scripts/browser_tools.py` | `find_browser(explicit: str \| None) -> str \| None` and `render_card(html: Path, png: Path, *, browser: str, width: int, height: int, timeout: float = 20) -> None` | -| New `S/scripts/windows_jobs.py` | Extract proven `WindowsJob`: `spawn(argv: list[str], directory: Path, log: Path, env: dict[str, str] \| None = None) -> int`, `wait(pid: int, timeout: float) -> int`, `close() -> None`; retain native identity/snapshot operations needed by ownership tests | -| New `S/examples/film-terminal.py` | Windows-only `serve`, `request`, and `result` entry points; `command_succeeded(result: dict) -> bool` and `frame_sources(completed: list[float], start: float, end: float, rate: float = 5) -> list[int]` are testable pure helpers | -| `T/run-tests.py`, `T/fixtures.py` | Existing runner; add named suites and `load_script(name: str) -> types.ModuleType` for extensionless tools, plus bounded recorder-client fixture helpers | -| `T/test_{assembly,checker,narration,paths}.py` | Keep existing assertions; extend narration and encoding cases | -| New `T/test_{browser,subtitles,processes,terminal}.py` | Tests for the shared helpers/media fixes and native Windows recorder; `processes` tests the Windows Job helper, not a new framework | -| New `T/fixtures/{browser.html,terminal_app.py}` and `T/run-windows-acceptance.py` | One small real app fixture and one reproducible Windows workflow driver | -| `S/*.md` and `T/README.md` | Correct affected recipes, prerequisites, and reproduction commands | -| `docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md` | Append final Windows results and artifact locations to the existing report | - -Media tools retain Python 3.10+ metadata. The Windows example may retain the probe's Python 3.12+ and websocket-client dependency in its uv script header. Import Windows APIs only when used on Windows. Add that same script-local client dependency to tests that import the example. Do not introduce a generic `processes.py` or a recorder package hierarchy. - -## Task 1 / milestone 1: Complete the media tools - -**Deliverable:** Native Windows can render cards, assemble all scene kinds, synthesize and verify narration, and produce correctly located subtitles using the existing commands. - -**Files:** Existing five scripts; new `browser_tools.py` and `windows_jobs.py`; `T/fixtures.py`, `run-tests.py`, `test_browser.py`, `test_subtitles.py`, `test_processes.py`, `test_narration.py`, and focused encoding additions to current tests. - -- [ ] **1. Capture focused failing cases.** Register `browser`, `subtitles`, and `processes` suites when their tests exist. Cover invalid explicit browser, Windows Chrome/Edge discovery, special-path file URI, timeout cleanup with an unrelated sentinel, nested SRT paths, UTF-8 BOM/CRLF input, default-code-page Unicode output, and fresh/cached ASR failure. Keep Windows Job tests in `processes` so portable suites do not acquire required Windows-only skips. - -For the cached verification policy, add this test shape using a loaded `narrate` module; it needs no TTS download: - -```python -def test_cached_audio_requires_requested_verification(self): - import json, sys, tempfile - from pathlib import Path - from unittest.mock import patch - import fixtures - module = fixtures.load_script("narrate") - with tempfile.TemporaryDirectory() as tmp: - work = Path(tmp) - output = work / "voice" - output.mkdir() - (output / "clip.wav").write_bytes(b"cached audio fixture") - (output / "manifest.json").write_text(json.dumps([ - {"id": "clip", "text": "Read this sentence.", "wav": "clip.wav", - "duration": 1.0} - ]), encoding="utf-8") - scenes = work / "scenes.yaml" - scenes.write_text(json.dumps({"scenes": [ - {"id": "clip", "narration": "Read this sentence."} - ]}), encoding="utf-8") - argv = ["narrate", str(scenes), str(output), - "--engine", "piper", "--verify", "on"] - with patch.object(sys, "argv", argv), \ - patch.object(module, "openai_key", return_value=None), \ - patch.object(module, "duration", return_value=1.0), \ - patch.object(module, "transcribe_local", return_value=None): - self.assertNotEqual(module.main(), 0) -``` - -The synthetic bytes are for branch/policy testing only. Real WAV synthesis/transcription remains part of the Windows acceptance fixture. - -- [ ] **2. Run the new tests before fixes.** Use `uv run --script tests/proving-it-works-with-a-movie/run-tests.py --suite narration` and the new suites; retain the specific assertions that fail. Missing imports during initial helper creation are expected, but also capture the existing cached-verification false success and native card/subtitle failure before changing them. - -- [ ] **3. Implement browser ownership and cards.** Extract the proven Win32 structure/binding and suspended-spawn/Job-assignment sequence from `probe-windows.py`. Add `wait` using retained process handles, `WaitForSingleObject`, and `GetExitCodeProcess`; timeout raises `TimeoutError`. Preserve idempotent close, kill-on-close, and handle release on failures. `browser_tools.render_card` uses this helper on Windows and an owned subprocess session on Unix. Always close its process group/Job and temporary profile in `finally`. Discovery checks an explicit executable first and fails if unusable; otherwise check existing Unix candidates and Windows Chrome/Edge machine/user/PATH locations. Replace the assembler's hand-built URL with `html.resolve().as_uri()` and verify the resulting PNG is nonempty. - -- [ ] **4. Implement subtitle and text handling.** Resolve movie/SRT/output paths before changing cwd. Copy only the subtitle into a temporary directory as `captions.srt`; run the existing hard-burn command with that cwd and `subtitles=filename=captions.srt`. Preserve soft embedding. Keep separate diagnostic branches for missing libass and actual burn failure. Read human/shell-authored text with `utf-8-sig`, write plain `utf-8`, and make command output tolerate the native console while preserving UTF-8 machine-readable files. Apply this to the remaining five-tool text IO sites, not unrelated code. - -- [ ] **5. Repair transcription and cache behavior.** Keep `transcribe_local(wav, model="base.en") -> str | None`. Use an owned temporary result file, one isolated uv invocation, and this child result protocol: - -```python -# Inside ASR_SNIPPET, after obtaining segs: -from pathlib import Path -import json -Path(sys.argv[3]).write_text( - json.dumps({"text": " ".join(s.text.strip() for s in segs)}), - encoding="utf-8") -``` - -Build the child argv as `["uv", "run", "--no-config", "--no-project", "--isolated", "--python", sys.executable, "--with", "faster-whisper", "python", "-c", ASR_SNIPPET, str(wav.resolve()), model, str(result_path)]`, with cwd in the temporary directory. Preserve cache locations; do not inherit a project's environment as the helper environment. Parse only the owned JSON `text` string. Keep stdout/stderr as diagnostics; absent/invalid results or child failure return unavailable. Under explicit `on` that means a failed clip and nonzero command, including cached WAVs. Verification must run after deciding whether to synthesize or reuse a clip. Keep `auto`/`off` behavior and drift thresholds from the reviewed spec; do not add a verification ledger or change the manifest schema. - -- [ ] **6. Verify and review the deliverable.** On ordinary-user Windows run `assembly`, `paths`, `browser`, `subtitles`, `narration`, `checker`, and `processes` with `--require-capabilities`. Remove the current Windows card skip when the real card works. Include actual Chrome and Edge cards, actual hard subtitles in a special-character path, and real ASR from a cwd containing a conflicting project configuration. Controlled helper tests cover stdout contamination, malformed results, off→on cached audio, and missing libass. Review/commit the bounded media diff once: `fix(movie): finish native Windows media tools`. - -## Task 2 / milestone 2: Finish the Windows terminal example - -**Deliverable:** One usable Windows example, invoked from each supported shell, exporting timed PNG takes that feed `assemble`. - -**Files:** New `S/examples/film-terminal.py`; `T/test_terminal.py` and `T/fixtures/terminal_app.py`; runner/fixture registration. Reuse Task 1's browser discovery and Windows Job helper. Keep the historical probe unchanged. - -- [ ] **1. Run the capture decision gate first.** In `W/capture-gate.py` load the existing probe with `importlib.util.spec_from_file_location` and reuse its terminal launch/readiness/prompt/output handling. Set the fixed viewport before navigation and record its established geometry. Replace only the take acquisition with asynchronous `CDP.send("Page.captureScreenshot", {"format": "png"})` and the existing `pump`/response map; never start a screencast. One screenshot request is outstanding at a time, targeted every 0.2 seconds, with a two-second monotonic deadline. Keep processing terminal events and control input between polls. - -Run the gate on ordinary-user Ballmer for PS5.1, PS7, and Git Bash. The native fixture prints long wrapping output, then three colored/text-labeled TUI states held at least 1.3 seconds each, then waits for `q`. Record application state times and automatically captured frames; inspect each state before `q` and then a successful command completion. This must pass without manual snapshot assistance. Do not rerun the old 40-check feasibility gate. If this mechanism fails, retain the failure and stop recorder extraction for the bounded design decision specified in the spec. - -Give this scratch gate the probe-compatible arguments `--shell-kind powershell51|powershell7|gitbash --shell EXECUTABLE --browser EXECUTABLE --ttyd EXECUTABLE --directory FRESH_DIRECTORY` and run it through native `uv run --script`. PS5.1 is the existing `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe`; Git Bash is `C:\Program Files\Git\bin\bash.exe`. The PS7/ttyd paths are in the resource table. Resolve the existing browser through Task 1's helper. These argument names are confined to the scratch gate; the public example uses the reviewed `serve` interface. - -- [ ] **2. Add timing and result-policy tests.** Load the new example by file path, without starting a browser on import. Use this implementation/test contract for frame placement: - -```python -def frame_sources(completed, start, end, rate=5): - import bisect, math - if not completed or completed[0] != start or end < start: - raise ValueError("Invalid take boundaries") - if completed != sorted(completed) or completed[-1] > end: - raise ValueError("Invalid capture times") - intervals = [b - a for a, b in zip(completed, completed[1:])] - if max(intervals + [end - completed[-1]]) > 2: - raise TimeoutError("Capture gap exceeds two seconds") - count = max(1, math.ceil((end - start) * rate)) - return [bisect.bisect_right(completed, start + i / rate) - 1 - for i in range(count)] - -assert frame_sources([10.0, 10.35, 10.81], 10.0, 11.0) == [0, 0, 1, 1, 1] -``` - -Also reject a capture gap over two seconds. Test `command_succeeded` with completed shell success plus an identified producer returning seven: it must be false even when the logger succeeds. Unknown/interrupted states, observed shell errors, or missing status for an identified producer must likewise be false. - -```python -def command_succeeded(result): - return (result.get("outcome") == "completed" - and result.get("shell_success") is True - and result.get("shell_error") is None - and (result.get("native_producer") is None - or result.get("producer_exit_code") == 0)) - -assert not command_succeeded({ - "outcome": "completed", "shell_success": True, "shell_error": None, - "native_producer": "python.exe", "producer_exit_code": 7}) -``` - -- [ ] **3. Extract only user-facing recorder behavior.** Use script metadata `requires-python = ">=3.12"` and `dependencies = ["websocket-client==1.9.0"]`. Reuse the proven CDP receiver, bounded completion parser, ttyd `-w`/one-client/writable startup, prompt adapters, and owned roots. Import sibling `scripts` explicitly relative to `__file__`. Remove gate aggregators, sentinel creation, automatic test phases, heartbeat workers, probe variable assertions, and the probe's hard-coded 20-minute test lifetime. Keep a foreground `serve` process owned by the harness, with per-command deadlines. - -- [ ] **4. Implement the exact CLI/control contract.** `serve` accepts `--shell`, `--directory`, `--cwd`, and executable overrides `--shell-exe`, `--browser`, `--ttyd`. Retain the spec's `request --file` and wait-only `result --id` forms, 30-second client timeout, and 90-second default command timeout. Persist ordered request/ack/result files, session IDs, pending run, active take, and `next_request_id`. Publish state before acknowledgments; reject gap/duplicate IDs before publication and second runs before typing. Server-rejected consumed IDs advance the sequence so cancellation remains usable. A failed command result is nonzero without ending the session. - -For example, a caller writes this UTF-8 file and submits it once; later result retrieval never writes another request: - -```json -{"id":1,"operation":"run","command":"Write-Output 'ready'","timeout_seconds":90} -``` - -```text -uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py request --directory SESSION --file request-1.json -uv run --script skills/proving-it-works-with-a-movie/examples/film-terminal.py result --directory SESSION --id 1 --timeout 30 -``` - -`SESSION` denotes the caller's real session directory. Test readiness nonce/cwd/shell through the filmed connection; reconnect or geometry change ends the session. Preserve raw PowerShell status separately from attributed errors. Keep direct-native/first-pipeline-producer attribution exactly as the spec defines; opaque scripts do not acquire inferred native status. - -- [ ] **5. Integrate successful capture and shutdown.** `begin-take` completes after its first PNG and monotonic start time. Pump CDP, control requests, command completion, and capture replies in one bounded loop. Write raw sample times, then ordinary numbered PNG copies selected by `frame_sources` at end. Return scene fields `kind: frames`, `src` as the absolute take-directory string, and `rate: 5`, plus take metadata. The absolute path is accepted by the existing assembler's path join. Do not alter input geometry while recording. - -`end-take` keeps shell/browser alive. Command timeout, capture timeout, reconnect, and geometry change record the specified unknown/interrupted result, fail the active take, and terminate the session. `close` finalizes a healthy take; `cancel` marks it incomplete. Both interrupt any pending command and release the Job; successful shutdown results are written only afterward. Finalizer failures remain failures. Support the declared printable/special keys without adding arbitrary terminal emulation. - -- [ ] **6. Verify through separate actual tool calls.** Run `uv run --script tests/proving-it-works-with-a-movie/run-tests.py --suite terminal --require-capabilities` on ordinary-user Windows. Stage the whole native suite in each actual invoking shell while recording that same shell. Reuse probe outcome and child/grandchild/sentinel fixtures against the final example. Validate two takes across separate shell tool calls, pending-command persistence, cwd/variables, wrapped output, automatic multi-state TUI pixels, and normal/cancel/browser-loss/forced-exit cleanup. Inject client timeout followed by `result`, command timeout, gap/duplicate IDs, screenshot/geometry failure, and control/report-write failure. Do not count a single Python process driving both phases as proof of harness-call persistence. - -- [ ] **7. Review/commit the finished example.** Inspect exported PNGs and their assembled sequence, duration, state order, and recorded gaps. Commit the recorder/tests as `feat(movie): support native Windows terminal recording` after the milestone review. The capture decision gate is part of this task, not a separately staffed project. - -## Task 3 / milestone 3: Instructions and final acceptance - -**Deliverable:** Copyable Windows instructions and three inspected finished movies from the final code, with a short results report. - -**Files:** `S/{SKILL,assembling,narrating,recording-a-terminal,recording-motion,rendering-stills,rendering-from-a-log}.md` where changes are needed; `T/README.md`; new `T/run-windows-acceptance.py` and `T/fixtures/browser.html`; the existing results report. No external eval-repository changes are required. - -- [ ] **1. Save one fixture and workflow driver.** `run-windows-acceptance.py --work DIR --shell powershell51|powershell7|gitbash --phase prepare|finish` prepares scenes or processes the recorded artifacts. `prepare` creates the same scratch browser app, captures its changing states, and creates an image plus an existing movie segment with its own known audio. `finish` requires `--take-one PATH --take-two PATH` pointing to the example's exported frame directories. Use `movie O'Brien λ & [take]` paths, CRLF scenes, UTF-8 BOM input coverage, a separate assembly work directory, narration-longer and visual-longer cases. Load the tiny browser counter from its file URI and change it through actual CDP mouse clicks. Reuse the example's retained `CDP.send`/`pump`/`responses` handling and Task 1's owned browser helpers, closing fixture processes afterward. No fixture server or browser recording framework is needed. - -The saved scenes name `title` (card), `still` (image), `browser` (frames), `take-one`/`take-two` (frames at 5 fps), and `source` (movie). Narrate the non-movie scenes; retain the source segment's own audio. Let the driver call existing tools through `fixtures.run_tool` and reject every nonzero result: - -```python -steps = [ - ("narrate", [str(scenes), str(voice), "--engine", "piper", "--verify", "on"]), - ("assemble", [str(scenes), str(cut), "--narration", str(voice), "--work", str(segments)]), - ("make-subtitles", [str(voice / "manifest.json"), str(subtitles), - "--offsets-json", str(segments / "offsets.json")]), - ("burn-subtitles", [str(cut), str(subtitles), str(movie)]), - ("check-movie", [str(movie)]), -] -``` - -These local variables are the driver's `Path` values under `--work`; use an evidence subdirectory for checker outputs. Local voice repeats synthesize into a new output directory using downloaded model caches; the cached-WAV off→on policy is tested separately. During final audio verification, compare each narrated interval with its script and the source-movie interval with its own reference, so preserved source audio is not misclassified as TTS drift. - -- [ ] **2. Run the two baseline instruction sessions before Markdown edits.** Apply `superpowers:writing-skills` when editing skill instructions. Use one fixed scenario for an actual PowerShell tool and an actual Git Bash tool, each against the unchanged instructions plus the final product code. This isolates the instruction change. Save the scenario at `W/instruction-scenario.md`: - -> On native Windows, make a narrated and hard-subtitled proof movie from the provided local app and terminal fixture, using the installed movie skill. Work in the supplied path with spaces, an apostrophe, and Unicode. Use local narration without a cloud key. Keep the recorded command alive between two takes. If desktop capture is unavailable, state what was actually captured and what remains unproven. - -Use a controlled unavailable-desktop condition in these sessions. Reuse `P/artifacts/windows-eval-preflight/native-tool-preflight.py` and `native-gitbash-preflight.py` as launcher references, removing diagnostic `--safe` mode and loading the explicit candidate plugin with skill bootstrap. The transcripts must show the actual shell tool and loaded skill; a PowerShell parent invoking a Bash tool does not count. Pin the same existing model and setup across before/after. Do not build a Quorum deployment or launch other agents during planning. - -- [ ] **3. Write and exercise Windows instructions.** Document all five `uv run --script` invocations, prerequisites, shell-specific quoting, pure PowerShell execution, foreground lifetime, consecutive request IDs, wait-only results, take timing, keys, fixed geometry, and cleanup. Use `[IO.File]::WriteAllText($path, $json, [Text.UTF8Encoding]::new($false))` for PowerShell UTF-8 without BOM. Document native producer status before `Tee-Object`, and Bash `PIPESTATUS`/pipefail for logs. Preserve Unix tmux instructions and fix the dangling example reference. - -Add the Windows desktop preflight: - -```text -ffmpeg -nostdin -y -f gdigrab -framerate 5 -i desktop -t 2 capture-check.mp4 -ffmpeg -nostdin -y -i capture-check.mp4 -frames:v 1 capture-check.png -``` - -Invoke with an argument array and scratch paths from the ordinary-user interactive desktop; inspect actual application pixels. Document failure without converting it to a GUI success claim. Test Chrome and Edge card discovery once each; no browser-by-shell cross product is needed. - -- [ ] **4. Execute final acceptance and the two candidate instruction sessions.** Run the documented workflow from PS5.1, PS7, and Git Bash, recording the corresponding shell; one row each. Capture the invoking shell's own version/PID in its command transcript before launching uv; `--shell` selects the recorded shell and is not evidence for the invoking shell. Remove cloud keys only from the test process environment and use a process-local tool PATH excluding `llm` credential lookup; leave saved credentials untouched and select local Piper explicitly. Use native Windows tools and verify the actual ordinary-user token. For each final movie inspect picture, hard subtitles, audible narration, contact sheet, timing, and rendered-audio transcription. Record executable paths, shell identity, source revision, command exit codes, movie/contact-sheet paths, and inspection result. Complete the four-session before/after instruction comparison with the same scenario and candidate Markdown. - -On the native Mac and existing Linux runner, run only the portable suites `assembly`, `paths`, `checker`, `narration`, `browser`, and `subtitles` with `--require-capabilities`, including the changed shared code paths. Windows-only `processes`/`terminal` are not part of those runs. A skipped required case is incomplete, never green. Add actual fresh and cached-model voice checks on the existing Mac/Linux setup when validating the changed shared narration helper; do not re-provision other architectures. - -- [ ] **5. Close the reviewed scope.** Append a three-row Windows matrix, Mac/Linux regression results, four instruction-session results, and desktop/card checks to the existing report. Include stable artifact locations and the final tested source revision. Mark every spec acceptance row passed or explicitly incomplete; do not merely count commands returning zero. Review the final diff and commit `docs(movie): document and verify Windows workflows`. No pushing, PR, or merge is part of this plan. - -## Spec coverage and execution boundary - -| Reviewed requirement | Task | -| --- | --- | -| Five tools, paths, cards, UTF-8/BOM, subtitles, isolated ASR including cached verification (R2) | 1 | -| Fixed capture decision gate; producer status (R1); ordered/asynchronous control (R3); timeout/shutdown (R4); honest frame timing (R5) | 2 | -| Final recorder cleanup, same-session takes, wrapping, TUI and native shell behavior | 2 | -| Three complete Windows workflows, local voice, final-movie inspection, desktop/card checks, existing-platform regressions | 3 | -| Windows instructions and four before/after skill sessions | 3 | - -At execution, retain focused RED/GREEN evidence and review each of these three milestones. Rerun only checks affected by a fix; final integration must use final product code. If a genuine blocker requires changing an approved interface, dependency, supported route, or validation scope, present that concrete issue before expanding work. - -Execution resumed under the reviewed three-milestone scope. Implementation and finite test outcomes are recorded in the results report; the earlier superseded controller/workers were not resumed. Review the documented candidate-instruction gaps before claiming full skill compliance. diff --git a/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md b/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md deleted file mode 100644 index da147c6..0000000 --- a/docs/superpowers/reports/2026-09-09-proof-movie-os-compatibility.md +++ /dev/null @@ -1,286 +0,0 @@ -# Native Windows feasibility gate — Task 1 - -The bounded mechanism gate passed on Ballmer under an actual Medium-integrity ordinary-user token for PowerShell 5.1, PowerShell 7 and Git Bash: **40/40 checks**, including 27 command-outcome cases. That evidence belongs to commit `49bc2932857071896fb764688594709a1b494eaa`; the cleanup error-path correction below has separate verification. This is a feasibility probe, not the bulk OS port. The TUI result uses the controller-approved same-page snapshot checkpoint; general capture freshness and resize/redraw decoding remain required production work. - -Public implementation: [probe-windows.py](../../../tests/proving-it-works-with-a-movie/probe-windows.py). Focused ownership tests: [test-probe-cleanup.py](../../../tests/proving-it-works-with-a-movie/test-probe-cleanup.py). These files and this index remain in Git after the temporary SDD workspace is removed. Generated frames, screenshots and archives are outside core and currently retained at the locations below; durable evidence consolidation is pending. - -## Actual environment and prerequisites - -Launch host was `workerbee` (macOS); recording host was `ballmer`, Windows 11 Pro 10.0.26200, native x64. This observation does not impose a Windows 11-only production requirement. Remote task root is exactly `C:\Users\drew\movie-os-task1-20260909`. Existing Chrome and Git Bash were reused after inventory. Portable prerequisites, cache and test directories are task-owned; machine PATH, profiles, firewall, credentials, services, account membership and management networking were not changed. - -| Tool | Observed version | Executable relative to task root unless absolute | -| --- | --- | --- | -| Python | CPython 3.12.14, win32 AMD64, 64-bit pointers | `tools\python\cpython-3.12.14-windows-x86_64-none\python.exe` | -| uv | 0.12.12, c4be69153 | `tools\uv\uv.exe` | -| PowerShell 5.1 | 5.1.26100.9168 | `C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe` | -| PowerShell 7 | 7.6.6 | `tools\pwsh\pwsh.exe` | -| Git Bash | 5.3.9(1)-release, Git 2.54.0.windows.1 | `C:\Program Files\Git\bin\bash.exe` | -| ttyd | 1.7.7-40e79c7, PE x64 | `tools\ttyd.exe` | -| Chrome | 152.0.7977.65 | `C:\Program Files\Google\Chrome\Application\chrome.exe` | -| FFmpeg/ffprobe | 9.0.1-essentials_build-www.gyan.dev | `tools\ffmpeg\ffmpeg-9.0.1-essentials_build\bin` | -| CDP client | websocket-client 1.9.0 | uv script environment | - -The [prerequisite inventory](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/prerequisites.json) retains argv, stdout/stderr, exit codes and executable hashes. Native FFmpeg exercised libx264, AAC and subtitles/libass support. Git Bash invoked native Windows Python and FFmpeg explicitly. - -| Retained download origin | Actual SHA256 | -| --- | --- | -| [uv 0.12.12](https://github.com/astral-sh/uv/releases/download/0.12.12/uv-x86_64-pc-windows-msvc.zip) | `3d54912924c36e862c14f427d04f2ed70a99e8001d1c30caa101f6d5711626d5` | -| [PowerShell 7.6.6](https://github.com/PowerShell/PowerShell/releases/download/v7.6.6/PowerShell-7.6.6-win-x64.zip) | `02fe458be20493fbdf43f61ea20610b811ee6c738ab1676c61b9cfcd1a33c860` | -| [ttyd 1.7.7](https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.win32.exe) | `e33a27501b10b96981335bcba938b1145c7f52551a343e72160f00ab71832b37` | -| [Gyan FFmpeg release essentials](https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip) | `fec81ae03971d9dd4be3ebe02e263bd2ec1d789483f931bdba5f5715e65da2e9` | -| [Astral CPython 3.12.14, 20260901](https://github.com/astral-sh/python-build-standalone/releases/download/20260901/cpython-3.12.14%2B20260901-x86_64-pc-windows-msvc-install_only_stripped.tar.gz) | `7c45c9622400d578709a9b2cddbe8124cc21d382409d9f13406d706d28e31b14` | -| [websocket-client 1.9.0 wheel](https://files.pythonhosted.org/packages/34/db/b10e48aa8fff7407e67470363eac595018441cf32d5e1001567a7aeba5d2/websocket_client-1.9.0-py3-none-any.whl) | `af248a825037ef591efbf6ed20cc5faa03d3b47b9e5a2230a529eeee1c1fc3ef` | - -The download records and checksums are in [downloads.jsonl](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/downloads.jsonl); the portable files remain under the remote `downloads` and `tools` directories. The FFmpeg project [links the Gyan Windows distribution](https://ffmpeg.org/download.html). - -SSH itself ran as High-integrity `ballmer\drew`; those early results remain elevated. Its linked-token query failed with Win32 1312. Acceptance instead ran in existing desktop Paseo terminal `1496200b-5545-4d85-af31-d01df72a3c11`, `movie-standard-user-probe`, desktop session 1. Every acceptance supervisor independently recorded `ballmer\drew`, elevation type 3, elevated false, integrity SID `S-1-16-8192`, Administrators deny-only. Full token evidence is in each session report. No High-integrity result substitutes for ordinary-user acceptance. - -## Bounded observations - -The same Chrome page enables CDP Network observation before navigation, identifies its own ttyd socket, and supplies command input, output observation and recording. Native children are created suspended, assigned to an unnamed non-inheritable kill-on-close Windows Job, then resumed. There is no unowned-root fallback. The supervisor and unrelated sentinel remain outside that Job; Win32 ownership uses retained handles and creation times, never Git Bash's MSYS PID as a native PID. - -Two separate harness calls started and ended takes around a still-pending 45-second command, then verified the same shell PID/nonce and `persisted-λ`. Actual columns were **217 → 167** in all three Medium sessions; earlier elevated runs were 218 → 167. Completion payload lines are bounded to **60 base64 characters**. Truncated framing produced no record, damaged framing no successful record; browser loss produced interrupted/null success. This is not arbitrary resize/redraw decoding. - -All 27 command cases retained actual status attribution. A ParseException can coexist with raw PowerShell `$? = true`; `raw_shell_success` remains separate from request-attributed `parse_error=true` and semantic `shell_success=false`. The Bash logging pipeline retained `[7,0]` and producer exit 7. Extra ttyd clients were refused with EOF, and the original page still completed a nonce/PID round trip. Browser loss retained Win32 10054 and interrupted outcomes. - -| Cleanup, seconds | PowerShell 5.1 | PowerShell 7 | Git Bash | -| --- | --- | --- | --- | -| Normal | 1.890 | 1.859 | 1.875 | -| Cancellation | 1.984 | 1.984 | 2.047 | -| Browser loss | 0.063 | 0.047 | 0.047 | -| Supervisor crash | 0.250 | 0.250 | 0.203 | - -These original successful paths checked parent/child/grandchild heartbeats, retained process-handle exit, stopped heartbeats and sentinel survival followed by scoped sentinel cleanup. The final original audit checked 609 PID/creation-time observations and found no remaining original processes, distinguishing reused PIDs. The review nevertheless found an error-path leak, addressed below. - -The accepted TUI JPEG is `interactive/000009.jpg` in each `tui-verified-*` directory. Implementer, reviewer and controller inspected active-take pixels showing `Native Windows TUI λ` and `[q] Finish this screen`, while run request 2 remained pending and before `q` request 4. The explicit same-page `snapshot` request 3 occurred after application readiness. [Pixel inspection metadata](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/active-tui-pixel-inspection.json) preserves hashes and timing. - -| TUI event, epoch seconds | PS5.1 | PS7 | Git Bash | -| --- | --- | --- | --- | -| Application ready | 1788994874.380406 | 1788994874.7009904 | 1788994874.6822324 | -| Snapshot request 3 | 1788994875.4311693 | 1788994875.854709 | 1788994875.7615943 | -| Inspected JPEG received | 1788994875.7732553 | 1788994875.8755016 | 1788994875.7821376 | -| q request 4 | 1788994875.9168005 | 1788994876.04243 | 1788994875.9338365 | - -CDP trace proves the receiver continued draining/acknowledging during the ready-file wait/hold: 12/9/7 received events, 8/8/8 timeout polls and 4/3/2 acknowledged screencast frames. Some final-run TUI frames preceded the checkpoint, so this does not establish why earlier takes stalled or claim the snapshot alone caused a redraw. Acceptance is scoped to the inspected checkpoint method. - -## Retained failures and corrections - -- With the same ttyd binary, Job and CDP page, initial `startup-*` sessions disconnected without output. Adding explicit `ttyd -w ` made `cwd-*` readiness pass. Upstream [ttyd PR 1502](https://github.com/tsl0922/ttyd/pull/1502) initializes command-line/cwd pointers to NULL; that supports the prerequisite without establishing the internal cause of our failure. No error 123 was observed in our ttyd log. -- The probe's initial PowerShell prompt separately raised `InvokeMethodOnNull` because its error baseline was unset. Initializing and guarding the baseline corrected this; original and corrected evidence is retained separately from ttyd's cwd prerequisite. -- Original Git Bash completion framing wrapped at 218 columns and ConPTY duplicated a character at a cursor repositioning boundary. Raw `outcomes-gitbash/network.jsonl` and `terminal.bin` retain the failure. Bounded multiline framing corrected the tested dimensions without adding a VT emulator. -- Earlier active TUI takes lacked the TUI pixels despite a successful command and end PNG; a one-second hold still failed in PowerShell. `standard-normal-powershell51`, `standard-tui-*` and `tui-diagnostic-*` preserve those failures. The live PNG alone was never accepted instead of the active-take assertion. -- Original handle-exit timing and transient heartbeat access failures are retained in elevated `session-v2-*` and `final-powershell7`. Bounded waits/retries corrected those observed cases; persistent access failures remain errors, motivating the review fix below. - -## Review fix: cleanup evidence failures - -Review of `49bc2932` found that snapshot, heartbeat or pending-result errors could escape before owned-resource cleanup. The correction protects evidence collection, always attempts terminal/Job release, gives the outside-job sentinel an independent finalizer, records stage-specific diagnostics, and returns failure when evidence is missing or reporting fails. An unknown process snapshot is `null`, not an empty successful ownership observation. - -The first actual Medium RED run occurred before the cleanup edit: snapshot, persistent heartbeat and pending-result failures each left three owned workers and the sentinel alive. Terminal-close failure left three workers alive, although its sentinel was already released; report-write failure escaped after resources exited. The normal base-source case released resources but returned `None`, failing only the new boolean result contract. Thus 0/6 is not a claim that all six scenarios leaked. Independent verifier teardown happened only after these observations were captured. - -A strengthened test replaced the synthetic post-release job error with native `TerminateJobObject` access denied (Win32 5), retaining real kill-on-close handle release. It again produced 0/6 against the unchanged base source, then **6/6 against the fix**, actual test-process exit 0. Each injected failure returned false, kept `normal_cleanup=failed`, preserved diagnostics and left no owned processes or sentinel alive. The successful fixture returned true. All cases independently recorded Medium SID `S-1-16-8192`, elevated false, elevation type 3, session 1. - -| Focused GREEN case | Cleanup seconds | Retained diagnostic stages | -| --- | --- | --- | -| Snapshot failure | 0.422 | `snapshot`; ownership snapshot remains null | -| Persistent heartbeat access failure | 0.484 | `heartbeats_before`, `heartbeats_after`, `heartbeats_verify` | -| Pending-result write failure | 0.468 | `pending_reply` | -| Terminal failure plus native Job termination failure | 0.468 | `terminal_close`, `job_close` | -| Final report write failure | 0.469 | `report_write`; absent report is not accepted | -| Successful native ownership fixture | 0.453 | None | - -A fresh real ttyd/Chrome PowerShell 5.1 session under Medium closed in **2.891 seconds**, cleanup passed, supervisor launcher exit 0. A second real Medium session deliberately created a directory at its final `probe.json` path before close. The actual native replace failed with Win32 5; the supervisor exited **1**, stderr/stdout retained `report_write`, and the summary marked cleanup failed. An independent observer retained 19 native process handles before close (including supervisor and sentinel), verified all signaled, and checked stopped worker heartbeats. The remaining `probe.tmp` is an unsuccessful pre-error write, not a canonical passing report. No unrelated 27 outcome cases or 18 imported baseline assertions were rerun in this fix round. - -| Focused evidence | Result | -| --- | --- | -| [Initial pre-edit RED](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-red/cleanup-tests.json) | Expected 0/6, test process exit 1 | -| [Native-fault RED against base](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-red-native/cleanup-tests.json) | Expected 0/6, exit 1 | -| [GREEN ownership cases](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-green/cleanup-tests.json) | 6/6, exit 0; SHA256 `58c687f146fdb5063892dc0de1157d6f9915a4a11be3eb412dc5298b147e48a7` | -| [Successful live close](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-live-powershell51/probe.json) | Cleanup passed, launcher exit 0 | -| [Live report failure observer](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/fix-round1-live-report-failure-powershell51/failure-exit-observation.json) | Supervisor exit 1, failed cleanup, released resources | -| [Fix-round archive](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/evidence-fix-round1.zip) | 265 files, 3,473,557 bytes; SHA256 `e22564f54e7bde79de3e2ea904ccab9d0faffa825c17f1e80c0beb78ff69ffab` | - -New probe SHA256: `b7f8a47bb09c9d4ed08642f8292df34a51b78a3040e0d6a3798a76286405ce90`. Focused test SHA256: `d85988949955a4f67fcc724a81c616b7f3e57c819f0a314632ab89355b4c89d1`. The initial RED test snapshot, hash `05c92c9ddfa9a4e05615634f9cbe80798f04856e994b3302ee7ad73decd6d20c`, is retained separately. The fix archive is also at `C:\Users\drew\movie-os-task1-20260909\evidence-fix-round1.zip`; exact new remote session directories are `evidence\fix-round1-{red,red-native,green}`, `evidence\fix-round1-live-powershell51` and `evidence\fix-round1-live-report-failure-powershell51`. - -An intervening SSH/SCP reset prevented the initial fix upload/submission before execution. A bounded read-only `hostname` retry succeeded; the unchanged remote base-source hash was verified before upload. These transport failures are separate from runtime test outcomes. No host/network repair was attempted. The task terminal remains available; probe resources have been released. - -## Reproduction and artifact index - -Run the following in a native **Medium-integrity** PowerShell terminal after copying the public probe and focused test beside the task-owned prerequisites. Choose new output directories; the probe refuses unsafe reuse. These are explicit argument arrays/paths, not PATH changes. - -```powershell -$taskRoot = 'C:\Users\drew\movie-os-task1-20260909' -$python = "$taskRoot\tools\python\cpython-3.12.14-windows-x86_64-none\python.exe" -$uv = "$taskRoot\tools\uv\uv.exe" -$probe = "$taskRoot\probe-windows.py" -$env:UV_PYTHON_INSTALL_DIR = "$taskRoot\tools\python" -$env:UV_CACHE_DIR = "$taskRoot\cache" -$env:UV_NO_CONFIG = '1' -$env:PYTHONIOENCODING = 'utf-8' -& $python "$taskRoot\test-probe-cleanup.py" --directory "$taskRoot\evidence\cleanup-reproduction" - -& $uv run --python $python --script $probe --serve --ttyd "$taskRoot\tools\ttyd.exe" --browser 'C:\Program Files\Google\Chrome\Application\chrome.exe' --shell 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe' --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" --launch-host workerbee -``` - -Keep `--serve` alive. In separate harness calls with the same task environment, run the phases below against that directory. `first` returns while its command is still pending; invoke `second` before the 45 seconds elapse. For PS7 or Git Bash use their absolute executable above and matching `--shell-kind powershell7` or `gitbash` on every invocation. `second` also completes the interactive take, including the approved snapshot checkpoint. Separate fresh sessions exercise `cancel` and `browser-loss` instead of `close`. - -```powershell -& $uv run --python $python --script $probe --phase first --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" -& $uv run --python $python --script $probe --phase second --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" -& $uv run --python $python --script $probe --phase prepare-cleanup --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" -& $uv run --python $python --script $probe --phase close --shell-kind powershell51 --directory "$taskRoot\evidence\session-reproduction" -``` - -For standalone TUI reproduction, start a fresh `--serve` session using a new directory such as `$taskRoot\evidence\interactive-reproduction`. In a separate harness call, invoke `--phase interactive` with that directory and the matching shell kind, then run `prepare-cleanup` and `close` against the same fresh session. Do not invoke `interactive` after `second` in an existing session: both create the take named `interactive`, and the probe refuses to reuse its directory. - -Actual Medium launch commands were submitted through the already installed matching CLI, `C:\Users\drew\AppData\Local\Programs\Paseo\resources\bin\paseo.cmd terminal send-keys 1496200b-5545-4d85-af31-d01df72a3c11 '' Enter --json`. SSH transport remained High; the daemon-owned terminal supplied the Medium token. The exact UTF16LE commands, launch scripts, subprocess argv and outputs are preserved as `*-submit-command.json`, `*-launch.ps1`, `*-launcher.json` and named stdout/stderr files, not inferred from this example. - -Local temporary evidence root is `.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/`; `remote/` mirrors remote `C:\Users\drew\movie-os-task1-20260909\evidence`. Links below currently target that ignored workspace. They will cease to resolve after SDD deletion unless evidence is consolidated first; source and this report remain reviewable independently. - -| Evidence | Contents | -| --- | --- | -| [Aggregate](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/probe.json) | Original 40 passed checks; per-session unrelated checks remain unavailable | -| [Main archive](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/evidence-final.zip) | 2,323 files, 160,448,403 bytes; outcomes, continuity, ownership, prerequisites and original failures | -| [Capture supplement](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/evidence-capture-final.zip) | 650 files, 23,823,967 bytes, overlapping earlier artifacts; accepted TUI pixels/traces | -| [PS5.1 active TUI JPEG](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/tui-verified-powershell51/interactive/000009.jpg) | Inspected while request 2 pending, before q | -| [PS7 active TUI JPEG](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/tui-verified-powershell7/interactive/000009.jpg) | Same acceptance method | -| [Git Bash active TUI JPEG](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/tui-verified-gitbash/interactive/000009.jpg) | Same acceptance method | -| [Original process audit](../../../.superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/final-process-audit.json) | 609 PID/creation-time observations, no remaining original processes | - -Main archive SHA256: `ba7438c8686183ceb1f55dd32e62bed3fc57d082bc642f5487561aca364da024`. Capture supplement SHA256: `4b1186772fec51d3581390ae4dc462811d5b6b7c86018fc36b0062de384a844a`. Remote copies are `$taskRoot\evidence-final.zip` and `$taskRoot\evidence-capture-final.zip`. Original runtime source snapshots are retained locally as `probe-standard-runtime-a107564b5e34.py` (SHA256 `a107564b5e341c84d5ae21bc9ecbb7c41cd1544752597c78f0cde5dae37489c2`) and `probe-final-runtime-be36b8182b5c.py` (SHA256 `be36b8182b5caa1dc071dad3bd075cc44d40a3b6fe7b3282b6da739b44259d40`). Commit `49bc2932` probe SHA256 is `515f382ecb960c6111649784e8ecb23d66f2ac67f7f2cdbb498760a2679bf67b`. - -For command outcomes, use the full launch command above with `--outcomes` instead of `--serve`, a fresh directory, and each selected shell. For a supervisor-crash check, start a fresh `--serve`, run `prepare-cleanup`, then use `& $uv run --python $python --script $probe --crash-check --directory "$taskRoot\evidence\session-reproduction"` against that crash session. The observer validates retained native identities before killing the supervisor and releases the sentinel afterward. Inspect active TUI JPEGs before claiming their pixels; a successful phase alone does not establish the visual assertion. - -The probe's `--help` exposes these modes. Original complete aggregate replay commands are below; they validate retained evidence, not a new Windows runtime execution: - -```sh -python3 tests/proving-it-works-with-a-movie/probe-windows.py --aggregate .superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote -python3 tests/proving-it-works-with-a-movie/probe-windows.py --assert-result .superpowers/sdd/2026-09-09-proof-movie-os-compatibility/task-1-evidence/remote/probe.json -``` - -## Required production follow-through - -General screencast freshness is a **required production fix and test in Tasks 8–9**; stalled takes must not pass. Resizing requires a production shell adapter/supervisor that handles completion framing through resize/redraw, with damaged/missing framing remaining unknown/interrupted. Further work includes broader ownership failure injection, the full OS support matrix, and assembly/narration/verification portability. This probe does not establish those results. The Task 1 mechanism gate and independent review must finish before the bulk port begins. - - -## Reviewed Windows completion — final results - -The earlier sections record historical feasibility work, not the current -acceptance gate. The reviewed three-milestone implementation is now present. -The final native workflows passed; the four-session instruction comparison -has two explicitly incomplete verification outcomes below. No PR, push, -merge, further OS provisioning, or additional eval platform was performed. - -Ballmer: native Windows build 26200, x64, ordinary Medium token -`S-1-16-8192`, prepared CPython 3.12.14. Actual invoking-shell transcripts -identify PS5.1 `5.1.26100.9168`, PS7 `7.6.6`, and Git Bash -`5.3.9(1)-release`, with executable/PID before uv. This is evidence for that -tested host, not every Windows release or architecture. - -| Invoking → recorded shell | Five tools + checker + rendered audio | Duration | Retained artifacts | -|---|---|---:|---| -| PS5.1 → PS5.1 | PASS | 27.000 s | [Movie](), [contact sheet](), [rendered audio]() | -| PS7 → PS7 | PASS | 26.878 s | [Movie](), [contact sheet](), [rendered audio]() | -| Git Bash → Git Bash | PASS | 27.167 s | [Movie](), [contact sheet](), [rendered audio]() | - -All movies are 1600×900 H.264/AAC. Each combines a card, still, real CDP -counter clicks, two native terminal takes, and a labeled existing movie -segment retaining its own 440 Hz stereo tone. Inputs exercise the path -`movie O'Brien λ & [take]`, UTF-8 BOM/CRLF scenes, and separate assembly work. -Title narration lasts 3.855–3.971 s against one second of visuals; still -visuals last four seconds against 1.498–1.695 s of narration. - -Each workflow used real local Piper synthesis with verification, then a new -output directory reusing downloaded model caches. The process PATH excludes -`llm`, and cloud keys were removed only from that process. All 15 narrated -final-movie intervals passed local ASR comparison (0% length drift, worst -changed-word run at most two). Each source-tone interval separately passed -frequency/amplitude comparison with its own source reference. Fresh/cached -WAV verification is not substituted for final-movie transcription. - -The exported terminal samples show red→green→blue in order and visible -command completion after the second take's exit key. Six take duration -errors are 0.028–0.094 s; maximum completed-screenshot gaps are -0.625–1.109 s. Frame hashes confirm the documented completed-sample grid, -with no future sample used. Contact sheets and decoded movie frames were -inspected; short color states missed by the contact-sheet selection are -present in the actual movies. - -Evidence index: [timing/frame inspection](), -[controller final-movie inspection](), -[final source SHA-256 manifest](). -The manifest pins the tested recorder, helpers, five tools, and fixture; -Task 3 applies to base `ce9b3fcf`, following media `5621d1d6` and recorder -`ce9b3fcf`. The retained source hashes, commands, and source-labeled earlier -results establish provenance without claiming an older artifact tested a -later failure-path change. Remote artifacts remain at -`C:\Users\drew\movie-windows-completion\final-task3`. - -### Capture targets and reused regression evidence - -Named-window `gdigrab` captured readable pixels from the task-owned Windows -application: [window image]() and -[commands/results](). Visible padding and -capture dimensions are retained; no DPI/root-cause claim is inferred. -Full-desktop capture returned zero but showed wallpaper only, including a -late frame: [desktop image](). -That target remains **unverified for application capture in this session**. -Read-only evidence showed WinSta0/Default and an active console session; -no lock, service, credential, or machine-setting changes were made. - -Chrome and Edge title-card checks and the unchanged media regressions reuse -`.superpowers/evidence/windows-completion/media-5621d1d6`. The Mac and Linux -portable assertions passed 35 per host; native-only Job tests are excluded -from that portable result. Final strict browser/narration checks passed -4/4 and 9/9 per host. Real fresh and cached-model voice checks on both hosts -reuse `.superpowers/evidence/windows-completion/{macos,linux}-voice`. -The narration/browser/subtitle code exercised there is unchanged. - -The existing terminal capture gate, native outcome/control/ownership -regressions (57 tests), and finalization corrections (7 focused tests) retain -their source labels under `capture-gate`, `terminal-b8a723f4`, and -`terminal-ce9b3fcf`. Task 3 adds the demonstrated Unicode-cwd startup fix and -the previously reviewed identity-error handle cleanup. Focused native tests -passed 4/4. Local changed-policy suites passed 12 terminal and two ownership -assertions; their 13 and two native-only skips do not establish native -coverage. The native final workflows separately exercise all three shells. - -### Four instruction sessions — comparison complete, full compliance partial - -All four loaded the explicit candidate plugin and successful -`using-superpowers` SessionStart bootstrap, invoked the movie Skill, and used -actual PowerShell or Bash tools. The scenario, model (`claude-sonnet-5`, -existing `sonnet` alias), low effort, supplied tools/caches, product code, and -stop-at-first-instruction-gap criterion were held constant. Only the candidate -Markdown changed. No diagnostic safe mode or extra implementation agent was -used. Permissions/context were scoped to the task plugin, fixtures, -artifacts, and owned processes. - -| Session | Observed result | -|---|---| -| PowerShell baseline | Demonstrated documentation failure: inferred the native route from source, failed special-path `Start-Process` quoting, BOM request input, and guessed an `operation: result` request. Stopped through owned cleanup after the gap; not a completed workflow. | -| Git Bash baseline | Demonstrated documentation failure: inferred the native route from source and passed `/c/...` to native Python, producing `C:\c\...`/file-not-found. Stopped through the launcher's Job cleanup after the gap; not a completed workflow. | -| PowerShell candidate | **Partial.** New foreground-task, UTF-8 request, consecutive-ID, two-take, wait-only result, local voice, five-tool, caption/contact-sheet, cleanup, and honest capture-boundary instructions worked. It claimed complete verification but omitted transcription of the rendered final audio. | -| Git Bash candidate | **Incomplete due to harness turn cap.** Built a movie and ran media/checker/evidence steps, then returned `error_max_turns` (41 reported turns, exit 1) before a final response or rendered-final-audio transcription. This is not a full skill pass or an inferred instruction failure. | - -Launch limits were $4, 40 turns, and 900 seconds per session. The PowerShell -baseline's interrupted result reported 54 turns/$1.4456, and the completed -PowerShell candidate reported 44 turns; the requested cap must not be -mistaken for the harness's actual reported count. Git Bash candidate cost -was $0.832 and elapsed time 223.6 s. No limit was silently scored as success. -Transcripts and launcher result records are retained under -[the stable instruction evidence](). Further corrective -instruction work is left to review; no extra sessions were launched. - -### Acceptance disposition - -| Reviewed acceptance area | Disposition | -|---|---| -| Three native invoking/recorded-shell workflows | PASS on the recorded host | -| Repeatable mixed fixture, paths, encodings, timing | PASS | -| Terminal control, continuity, native outcomes, ordered automatic states | PASS with retained focused regression evidence | -| Fresh/cached-model local voice per workflow | PASS | -| Finished picture, hard captions, checker and rendered audio | PASS for all three independent acceptance movies | -| Browser cards / capture targets | PASS Chrome, Edge, and named-window pixels; full-desktop target explicitly unverified | -| Focused negative cases and ownership | PASS with source-labeled earlier evidence plus Task 3 focused corrections | -| Existing Mac/Linux behavior | PASS reused unchanged portable/media/voice evidence | -| Four instruction comparisons | Executed; **full candidate skill compliance remains INCOMPLETE** for the two specific outcomes above | diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md deleted file mode 100644 index 1365152..0000000 --- a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-design.md +++ /dev/null @@ -1,548 +0,0 @@ -# Proof movie OS compatibility - -**Date:** 2026-09-09 - -**Status:** Historical design. Remaining work is superseded by the [focused Windows completion spec](2026-09-09-proof-movie-windows-completion-design.md). Do not resume this design's broader rollout. - -**Scope:** Platform compatibility for the movie skill proposed in [PR #2214](https://github.com/obra/superpowers/pull/2214). Implementation depends on that import or its final equivalent. - -## Goal and agreed direction - -The movie skill must cover the same OS families and execution environments as -Superpowers' visual brainstorming companion: macOS, Linux, native Windows, WSL, -and headless or remote operation. Windows users must be able to launch the movie -pipeline from PowerShell or Git Bash and record either shell. Native Windows -must not require WSL; the PowerShell movie workflow must not require Git Bash. - -An agent should be able to record real software, assemble a narrated and -subtitled movie, inspect it, and apply the same verification criteria on every -supported environment. Native terminal recording is part of the initial scope. - -Compatibility means equivalent outcomes, documented prerequisites, and tested -behavior. Capture methods can differ by OS and available display facilities. - -## Evidence and baseline - -This design uses local Superpowers commit `3a8bdc11` and PR #2214 head -`f6617db1517488d4a8b66925519d5ffbeef965b3` as its inspected baselines. - -The companion's current implementation establishes these distinctions: - -- [Browser launch](../../../skills/brainstorming/scripts/server.cjs) handles - macOS, native Windows, WSL, Linux with a display, and Linux without a display. -- [Launch instructions](../../../skills/brainstorming/visual-companion.md) - accommodate PowerShell tools by invoking Git Bash's `bash.exe`. The companion - itself has a Bash launcher; this is not evidence of a separate PowerShell - implementation or of operation without Git Bash. -- [Process startup](../../../skills/brainstorming/scripts/start-server.sh) - accounts for foreground execution and Windows/MSYS PID incompatibility. -- [Windows lifecycle tests](../../../tests/brainstorm-server/windows-lifecycle.test.sh) - exercise Git Bash behavior. [Browser launcher tests](../../../tests/brainstorm-server/browser-launcher.test.js) - cover Windows, WSL, and headless Linux decisions, including treating URLs as - arguments rather than shell commands. - -These sources identify the required OS families. They do not establish an -exhaustive promise covering every OS release, CPU architecture, Linux -distribution, or desktop capture backend. - -An independent review of the platform contract and terminal design is recorded -in the [adversarial review](2026-09-09-proof-movie-os-compatibility-review.md). - -For the imported movie skill, all three shell regression suites were run on -macOS during this investigation: assembly 4/4, checker 9/9, narration drift 5/5. -These 18 assertions do not test actual speech generation, title-card rendering, -subtitle burning, or Windows execution. No Windows support is established by -those results. - -Concrete compatibility gaps in the inspected import include Unix-only command -examples, a tmux-dependent terminal recipe, macOS-only desktop capture examples, -FFmpeg glob-dependent frame input, missing Windows browser discovery, and a -hand-built file URL that misencodes a Windows path. `burn-subtitles` also uses -only the subtitle basename without setting the working directory described in -its comment. - -## Support contract - -| Execution environment | Shells used to launch tools | Required movie routes | Desktop capture behavior | -| --- | --- | --- | --- | -| macOS | zsh and Bash | Browser motion, terminal, stills, real-run logs, full processing pipeline | Use available macOS capture with permission; inspect a sample before recording | -| Linux desktop | Bash; commands use portable POSIX syntax where applicable | Same routes and pipeline | Use an available capture backend for the active display; distinguish X11 from Wayland | -| Linux headless, container, or remote session | Bash | Headless browser and terminal capture, stills, logs, full processing pipeline | Detect absent display/capture access and choose a route that can prove the claim | -| Native Windows | Windows PowerShell 5.1, PowerShell 7, Git Bash | Same routes and pipeline; record native PowerShell and Git Bash sessions | Use a verified native capture backend, initially FFmpeg `gdigrab`, when a desktop is accessible | -| WSL | Linux shell using Linux tools | Same Linux routes and pipeline | WSL capture is scoped to its available display; Windows host desktop capture is a separate native Windows operation | - -PowerShell 5.1 and 7 are separate invocation tests. Git Bash is a Windows shell -environment, not a synonym for WSL. Git Bash must invoke native Windows Python -and FFmpeg for its native Windows tests. WSL tests must invoke Linux tools. - -Keep OS detection, launch-shell detection, recorded-shell selection, and display -capability separate. A PowerShell launcher may record Git Bash and vice versa. -Do not infer the recorded shell from the shell running the pipeline. - -Do not introduce a Windows 11-only restriction solely because a test machine -runs Windows 11. Record exact OS, architecture, interpreter, browser, and tool -versions in validation results. Native terminal capture requires a compatible -Windows console API; ttyd documents ConPTY builds for Windows 10 1809 or later. -Other route prerequisites may set their own minimum versions. - -Architecture compatibility is also a dependency check: do not assume that a -Python script or a Windows x64 wheel proves native ARM64 support. Required -validation starts with macOS arm64 and x64, Linux x64, and native Windows x64, -plus WSL on Windows. Record Linux arm64 and Windows arm64 dependency availability -and execution evidence before listing those combinations as verified. A missing -wheel is a reported route limitation, not an excuse to claim OS parity or -silently substitute a paid service. - -## Approach and alternatives - -Use the existing five Python tools as one shared pipeline, with small local -helpers where platform handling is reused. Keep shell differences in invocation -examples and adapters for recording real commands. Keep capture differences in -route documentation and its executable examples. - -This preserves the scene file, narration manifest, offsets, subtitles, movie, -and checker output across operating systems. It also limits changes to the -skill being imported; no companion rewrite is required. - -Two alternatives were considered: - -- **Route all Windows work through WSL or Git Bash.** This does not satisfy the - agreed native PowerShell workflow, and WSL cannot stand in for recording a - native Windows terminal or application. -- **Maintain separate PowerShell and Bash pipelines.** This duplicates timing, - subtitles, and verification behavior and makes platform drift likely. Both - shells can invoke the same Python scripts explicitly. - -## Shared pipeline - -### Invocation and dependencies - -Document `uv run --script` for all five extensionless tools. Retain existing -Unix shebang execution for compatibility. Examples set the skill directory using -the location supplied by the harness, rather than a Claude-specific install path. - -```powershell -$SkillDir = 'C:\path to plugin\skills\proving-it-works-with-a-movie' -uv run --script "$SkillDir/scripts/assemble" scenes.yaml silent-cut.mp4 -if ($LASTEXITCODE -ne 0) { throw 'Movie assembly failed' } -``` - -```bash -SKILL_DIR='/path to plugin/skills/proving-it-works-with-a-movie' -uv run --script "$SKILL_DIR/scripts/assemble" scenes.yaml silent-cut.mp4 || exit "$?" -``` - -PowerShell recipes must work under 5.1 without relying on PowerShell 7-only -operators. Bash syntax must be identified as Bash when it is not POSIX syntax. -All examples must preserve failure status across pipelines and logging. - -Before a long recording, check prerequisites for the selected route: `uv`, a -compatible Python, FFmpeg/ffprobe and required codecs/filters, the chosen -browser, ttyd for terminal capture, and local narration/transcription packages -when requested. Check capabilities, not merely executable presence. Report -the missing capability and an appropriate install or alternate-route action. -There is no need for a new global installer or plugin-startup dependency check. - -Use the tools already involved in the proposed import. Do not introduce a new -recording service, TTS service, global Node dependency, or Windows-only package -manager requirement. The import's dependency-policy exception remains a -maintainer decision associated with PR #2214; this spec does not grant one. - -Nested helper invocations must also be independent of the project being filmed. -In particular, launch the local ASR environment with uv project discovery disabled -(`--no-project`) and a compatible interpreter selected by uv. The current nested -`uv run --with faster-whisper ...` can otherwise inherit an unrelated -`pyproject.toml`. A fixture with an incompatible project Python requirement must -not change the helper's resolution, modify the project's environment/lockfile, -or turn an available ASR into a reported dependency failure. - -### Paths, encoding, and process arguments - -- Resolve assets relative to the scene file and generated assets relative to - the selected work directory. Preserve existing explicit output-path semantics. -- Use `Path.resolve().as_uri()` for browser file URLs. Browser discovery honors - `--browser`, then checks platform installations and PATH, including Chrome and - Edge on Windows and Chrome/Chromium on macOS and Linux. -- Use explicit UTF-8 for YAML, JSON, HTML, SRT, concat lists, and text evidence. - Accept ordinary LF and CRLF text inputs and diagnose unreadable encodings. - Give owned Python helper pipes an explicit UTF-8 contract as well. Preserve - raw output from recorded external commands and record the encoding used to - decode it; do not assume every native Windows program emits UTF-8 or silently - replace undecodable evidence. Test redirected output under a non-UTF-8 Windows - console/code-page configuration. -- Pass external executable arguments as arrays. Avoid shell command strings for - FFmpeg, browsers, or opening an artifact. User-requested shell commands belong - only in the selected recorded shell. -- Keep MSYS path conversion at the launch boundary. Do not translate the same - path twice or feed Bash pseudo-PIDs to native Windows process APIs. -- Support spaces, apostrophes, Unicode, and shell metacharacters in valid local - paths. Exercise nested subtitle directories and work directories outside the - current directory. Avoid requiring symlink privileges or POSIX tools such as - `mktemp`, `shasum`, and `kill` for the PowerShell pipeline. - -### Frame assembly and subtitles - -Expand and sort frame filenames in Python. Feed FFmpeg a deterministic numbered -sequence staged in the work directory, using ordinary files without requiring -symlinks. Preserve the existing lexical ordering and frame rate. This replaces -the dependency on FFmpeg's optional glob support. Clean only staging files owned -by the current build and preserve source screenshots. - -Write concat entries with FFmpeg-specific escaping and test native Windows -drive paths. File list syntax and filter syntax are separate from shell quoting. -Preserve measured offsets and the existing timing rules: `card`, `image`, and -`frames` segments use `max(narration duration, visual duration)`; `movie` segments -retain the source movie's duration and own audio. The port must not change timing -or drop frames. - -For subtitle burning, stage the SRT under a safe fixed basename in a temporary -directory and execute FFmpeg from that directory, with resolved input/output -paths. This avoids interpolating user filenames into the subtitle filter. -Clean staging on both success and failure. Verify the selected font actually -renders the sample text, using available platform fonts rather than assuming -DejaVu is installed everywhere. - -Preserve the documented soft-subtitle fallback, with an accurate explanation of -why burning was unavailable. A burn failure with libass present must report the -actual failure rather than claim libass is missing. Full-platform acceptance -requires proving the hard-subtitle path with a capable FFmpeg build; a successful -soft fallback alone is insufficient. Continue shipping the SRT alongside the -movie for the existing checker contract. - -### Narration and verification - -Keep local Piper narration and local transcription available without a cloud -key on the verified support combinations. First-run model downloads must be -distinguished from subsequent offline operation. Check actual synthesis and -transcription, including subprocess interpreter selection and Unicode handling. - -Do not make cloud credentials a Windows requirement. A missing local ASR must -remain visible in output and cannot count as a verified narration acceptance -run, even where the existing script permits a skip. - -Preserve the existing verification thresholds, contact-sheet inspection, -subtitle checks, and requirement to compare rendered speech with its script. -Platform compatibility is not a reason to weaken a gate. Existing general -checker limitations remain limitations; redesigning its heuristics is outside -this work. - -## Recording routes - -### Browser and stills - -Keep browser-driven recording as the common motion route. Select a compatible -browser explicitly or through discovery, use an isolated profile, preflight a -real screenshot, and retain cursor overlays and measured narration pacing. -Headless recording must work without opening a desktop browser. Distinguish -Playwright's own recording encoder, when that route is used, from system FFmpeg. - -Use available harness browser automation or the documented recorder's browser -connection. The compatibility work does not create a new browser automation -framework. Navigation races must have bounded capture timeouts. Unexpected blank -output or stalled capture must not silently produce a successful recording; -intentional blank transition beats remain valid evidence. - -### Terminal and TUI - -Keep the existing ttyd/tmux route for Unix environments. Add a native Windows -route using ttyd's Windows console support and an explicitly selected PowerShell -or Git Bash executable. Native Windows must not require tmux, Docker, or WSL. - -Drive the native terminal through browser keyboard input into the live ttyd -terminal. Provide an executable example inside the skill with explicit shell -selection, viewport, output location, and a short real command sequence. The -existing `examples/film-terminal.py` reference points outside the imported -files; replace it with an included, tested example or a correct included-file -reference. The standalone example is specific to a Docker/tmux demo and must -not be presented as a working native Windows recorder unchanged. - -One persistent Python supervisor owns the browser/CDP page, capture state, and -terminal session. Start ttyd in writable mode and allow one terminal client. -Subscribe through CDP to the existing page's ttyd WebSocket events before that -page connects. Decode ttyd's output-message framing and incrementally parse -output across message boundaries. A second CDP connection may observe that page; -a second ttyd WebSocket must not be opened, because ttyd creates another shell -for another terminal client. The browser input, command observer, and recorded -pixels must all refer to the same session. - -For the reference recorder, later harness calls submit ordered JSON control -files to a session-owned directory. A request has a unique monotonically -increasing id and an operation (`run`, `key`, `begin-take`, `end-take`, or `close`). -Write requests atomically; the supervisor dispatches them in order and writes -matching acknowledgments and eventual results. A `run` acknowledgment does not -wait for the command to finish: the command remains in flight while capture -operations and `close` can proceed. Another `run` is accepted only at a known -shell prompt; `key` can drive an expected interactive state. Startup reports the -control directory and session id, and request ids prevent replay. No HTTP -control service or additional terminal client is needed. - -Readiness requires a round trip through the filmed terminal: execute a probe -that returns a session nonce, shell identity, and working directory, observe its -completion, and inspect a screenshot from that same page. Do not declare the -recorder ready based only on a listening port or a loaded page. - -Command completion is a shell adapter responsibility. Each scripted beat emits -a framed completion record after it returns, containing session/request ids and -an outcome. Its complete framing must not appear in echoed command text. Keep -instrumentation inside the recorded session; do not edit the human partner's -shell profiles or change its error preferences. A missing completion record is -an interruption or timeout, never success. - -The outcome distinguishes `completed`, `interrupted`, and `unknown`; a completed -beat has `shell_success`, a nullable native exit code, and a nullable shell error. -For Bash, preserve the command status and any producer pipeline statuses before -instrumentation overwrites them. For PowerShell, capture `$?` immediately after -the submitted statement and distinguish it from `$LASTEXITCODE`. Attribute a -native exit code only when the beat identifies its native executable producer; -a cmdlet's outcome must not inherit an earlier native command's exit code. -Terminating exceptions and parse failures produce explicit error outcomes when -observable, or `unknown` when the session no longer permits reliable attribution. - -The first implementation accepts atomic command/statement beats. Multi-statement -scripts remain opaque commands whose own documented status is recorded; the -recorder does not claim to detect every internally ignored error. Logging and -formatting are observer operations after status capture. If the command being -proved is itself a producer/logging pipeline, its adapter must retain the -producer's outcome separately, or require separate beats rather than label a -successful logger as a successful producer. Evidence includes the exact command -and attribution, so a successful recording can honestly show a failed command. - -Record PowerShell 5.1 and 7, not only launch the pipeline from each. Test a -successful native executable followed by a failing cmdlet, a failing native -executable followed by a successful cmdlet, terminating and non-terminating -errors, an explicit script exit, parse failure, and failure through logging. -Tests must detect status changes introduced by instrumentation, including the -PowerShell 5.1 expression-wrapper behavior. - -For interactive TUI beats, use explicit application state and key actions; do -not send another shell command while the TUI still owns input. Unknown state or -a completion timeout stops the take with a diagnostic. Validate delayed commands, -nonzero exits, an interactive TUI, resizing, and non-ASCII output in both recorded -Windows shells. - -A recording session owns one terminal for the duration of its takes. Stopping a -take pauses capture without killing a long-running command; the same browser -connection and shell persist until the recording session ends. Browser -disconnect/reconnect persistence is not assumed. If the connection is lost and -the shell cannot be proven to survive, mark the take interrupted and report it. -Verify a nonce, shell identity, and persistent shell variable across two takes, -a running command between those takes, and a real harness tool-call boundary. -Include negative tests where an extra terminal client or lost connection must -not produce a successful session-continuity result. - -### Desktop capture and real-run logs - -Document device/capability selection per OS: macOS capture, native Windows -`gdigrab`, and supported Linux display capture. Detect the active display and -available FFmpeg devices before selecting a command. On Wayland, do not apply an -X11 recipe by default; use an available permission-aware capture route or switch -to browser/terminal recording. This work does not promise universal desktop -capture on every compositor or remote-session configuration. - -Preflight by recording a short sample and examining its actual pixels. Permission -denial, blank capture, an unavailable remote desktop, or missing display must -produce an explicit route decision. A log reel can prove a real command run; it -cannot substitute for pixels when the claim is specifically native GUI behavior. -If the required claim cannot be captured, report it as unproven. - -Provide Bash and PowerShell real-run log recipes that retain the command's exit -status, timestamps, and actual output. Use standard-library Python hashing or -equivalent native commands for evidence bundles. Retain source logs beside the -derived movie. Windows PowerShell 5.1 output encoding must be tested explicitly. - -## Lifecycle and remote behavior - -Match the companion's lifecycle principles without copying its Bash launcher: -run recorders under the harness's persistent/background execution mechanism, -report readiness after the real browser/terminal is reachable, and preserve the -session between agent tool calls. Avoid assuming detached `nohup` processes -survive in a Windows or managed-harness environment. - -Own browser profiles, ports, temporary assets, and child process handles per -recording session. Bind terminal and debugging endpoints to loopback by default. -Readiness and command waits have explicit timeouts. On finish, interrupt, or -failure, stop and wait for owned processes and release resources; do not kill by -generic executable name or unverified stale PID. Ordinary users must be able to -run the workflow without elevated privileges. - -Session ownership includes the recorded command's local children and -grandchildren, even when they stop using the terminal. On Windows, assign ttyd -and the isolated browser root to a session-owned Job Object before their threads -run, using suspended creation and Win32 calls through Python's `ctypes`. Disable -breakaway and use kill-on-job-close so descendants cannot outlive the recorder. -Keep the supervisor outside its child job, and detect failure to establish the -job before starting a take. On Unix, track the recorder's own sessions/process -groups, including ttyd's PTY process group; do not assume killing the ttyd parent -terminates its shell group. Session persistence ends at `close`; this workflow -does not launch local services intended to survive it. - -On normal close, keep reading terminal output while requesting graceful -shutdown, then terminate remaining owned processes after a bounded timeout and -wait for their exit. Drain/close output in an order that does not block older -ConPTY implementations. On supervisor failure, Windows job closure must still -terminate owned descendants. Test both success and cancellation with a child and -grandchild that continue writing heartbeat files, plus an unrelated sentinel -process. Owned heartbeats must cease, owned processes must disappear, the -sentinel must survive, and no shutdown operation may hang indefinitely. - -Use the same distinction as the companion between a renderer and opening a -browser for the human partner. If a recorder needs to open a URL, use the OS -launcher with separate arguments; on WSL, Windows URL opening is a convenience, -not permission to pass Linux filesystem paths to Windows executables. With no -display, report the artifact path/URL and continue headless processing. Remote -browser access uses an explicit, documented access mechanism; remote deployment -or a new public tunnel service is outside scope. - -## Implementation boundaries - -Expected files are the five scripts under -`skills/proving-it-works-with-a-movie/scripts/`, small shared helpers if needed, -the skill's route documents, an included terminal recording example, and tests -under `tests/proving-it-works-with-a-movie/`. Add a focused platform support -reference and link it from `SKILL.md` rather than making every route repeat the -whole compatibility matrix. - -Preserve scene kinds, manifest fields, offsets, CLI arguments, and output artifact -formats. Keep macOS and Linux entry points working. Do not bundle changes to -plugin hooks, the visual companion, unrelated skills, standalone-repo retirement, -or the movie checker's general behavior. No new harness integration is proposed. - -Add a portable Python integration suite for the shared behavior. Shell launch -tests should be thin wrappers over the same fixtures and assertions. Preserve -existing regression coverage; replacing a Bash test requires equivalent coverage -in the portable suite. The suite must be runnable locally and on OS runners -without depending on a particular CI provider. - -## Acceptance and evidence - -| Area | Required proof | -| --- | --- | -| OS coverage | Actual runs on macOS, Linux, native Windows, and WSL; record exact environments and distinguish architecture coverage | -| Launch shells | Bash and zsh on macOS, Bash on Linux/WSL, Windows PowerShell 5.1, PowerShell 7, and Git Bash on native Windows | -| Shared pipeline | All scene kinds; measured scene offsets; hard and soft subtitles; checker verdicts and contact sheets | -| Paths | Spaces, apostrophes, Unicode, metacharacters, Windows drive paths, relative/absolute work directories, nested SRT files, LF/CRLF | -| Windows terminal | Git Bash and recorded PowerShell 5.1/7; a crossed launch/record-shell combination; cmdlet/native status attribution, delayed command, TUI input, and same-session proof between takes | -| Native independence | PowerShell movie tools run with Git Bash and WSL unavailable to them; Git Bash native tests use Windows binaries | -| Local voice | Real no-key Piper synthesis and local ASR in every required OS environment, including WSL; repeat with cached models and network disabled; test nested helper isolation from the filmed project | -| Capture failure | Blank frame, missing display, permission refusal, browser loss, and timeout produce accurate outcomes and no fabricated proof | -| Lifecycle | Survives a harness turn boundary; bounded shutdown after success, error, and interruption; owned children/grandchildren terminate while an unrelated sentinel survives | -| Evidence integrity | Failed command remains failed through logging; missing required speech verification is reported; rendered content matches real actions | - -The end-to-end fixture includes a small real browser app with a persistent state -change and a terminal sequence that prints Unicode, runs a delayed command, and -returns a nonzero status. Capture those actions, generate real local narration, -assemble `card`/`image`/`frames`/`movie` scenes, burn subtitles, run the checker, and -inspect the finished output. Include a terminal TUI take and an unnarrated -log-reel case. An intentionally failing command may be part of a successful -recording test: its logged status and narration must accurately show that failure. -Use synthetic clips for deterministic negative checker tests, clearly identified -as test fixtures. - -Run the end-to-end pipeline from both Windows shell families. Cover PowerShell -5.1 and 7 with real launch tests; test the OS pipeline with actual executables, -not only mocked `sys.platform`. Optional display-specific tests may be skipped -only with a recorded reason and a separate result for the fallback route. A -missing prerequisite in a required acceptance job is a failure of that job's -setup, not a green compatibility result. - -OS and feature coverage must be joined. Define fixture groups: **P** is the full -processing fixture (all scene kinds, offsets, hard/soft subtitles, checker and -negative cases); **B** is real browser capture; **T** is real terminal/TUI capture -and lifecycle; **V** is no-key synthesis/transcription plus a cached offline -rerun; **L** is the real-run log reel with preserved status. - -| Required environment | Minimum successful groups | Additional proof | -| --- | --- | --- | -| macOS arm64 | P, B, T, V, L | Bash and zsh invocation | -| macOS x64 | P, B, T, V, L | Exact interpreter and model package versions | -| Linux x64 desktop | P, B, T, V, L | Display type and browser backend | -| Linux x64 with DISPLAY/WAYLAND_DISPLAY unset and no desktop session | P, B, T, V, L | Positive headless browser and terminal takes, not just a missing-display diagnostic | -| Native Windows x64 | P, B, T, V, L | Full pipeline from PowerShell and Git Bash; real launch and recorded-shell coverage for PowerShell 5.1/7; native binaries proven | -| WSL Linux x64 | P, B, T, V, L | Linux binaries proven; local voice runs inside WSL; no hidden Windows-file-path dependency | - -Do not multiply the full fixture by every launch-shell permutation: thin -invocation tests cover remaining permutations, while the explicit Windows -end-to-end requirements above still apply. Remote/harness continuity requires -at least one real remote session for browser and terminal recording, with -artifacts retrieved and the launch/recording hosts identified. - -To advertise a desktop backend as verified, retain one successful real desktop -take on an actual macOS desktop, a Windows desktop using `gdigrab`, or a Linux -X11 desktop using the documented backend, respectively. A skipped test leaves -that backend conditional/unverified even if the OS's P/B/T/V/L groups pass. -Wayland support in this scope means correct detection and an honest route -decision; a Wayland desktop backend needs its own successful take before a -stronger claim is published. This does not require every compositor or remote -desktop configuration to support desktop capture. - -Skill instruction changes require `superpowers:writing-skills` and before/after -pressure testing across multiple agent sessions. Scenarios include a PowerShell -harness, a Git Bash harness, no cloud key, a path containing spaces, missing -libass, and headless/blocked capture. Check that agents select valid commands, -keep failures visible, and inspect the artifact. Store evals and transcripts in -the project's external eval repository; it is absent from this checkout, so -record its actual path and commit rather than assuming `evals/` is present. -The external checkout found during review is -`/Users/drewritter/prime-rad/superpowers-evals` at `66f08529`; this is an evidence -location, not a path to hard-code into tests. Its Windows guest launcher proves -where the agent runs, not which shell its tools use. For each shell-specific -agent eval, capture the actual agent tool invocation and shell identity; launching -an agent from PowerShell while all its commands execute in Bash does not satisfy -the PowerShell-harness scenario. - -Evidence records must include OS/architecture, shell, Python/uv, FFmpeg build, -browser, TTS/ASR versions, harness/model, command, return code, and artifact or -transcript location. Generated media need not be committed to core, but the -fixture and reproduction commands must be retained. - -### First implementation task: native Windows feasibility - -Before the bulk port, run a bounded probe of the chosen ttyd build with native -PowerShell and Git Bash: one filmed/observed terminal, a command completion -record, two takes preserving shell state across a harness boundary, and Job -Object cleanup of a nested worker. Record executable versions and the observed -ttyd message format. This is runtime validation of the specified design, not -evidence already gathered by this spec review. A failure revisits the relevant -adapter design before depending on it; it does not silently remove an agreed -platform or shell from the contract. - -The human partner has provided `drew@ballmer.local` for SSH or Paseo access. -A read-only SSH inventory succeeded on 2026-09-09: Windows 11 Pro, PowerShell -5.1, Git Bash, Chrome, and Edge were found. PowerShell 7, uv, FFmpeg/ffprobe, -and ttyd were not resolved on that session's PATH; their installation status -needs checking before provisioning. This establishes an available native -validation host, not a passed recording test or verified desktop access. -The [implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md) -records the observed paths, prerequisite checks, and Ballmer-first probe. - -The design has an implementation plan ready for review. Compatibility is complete -only when the required matrix has evidence, the updated skill has behavior evals, -and the support documentation accurately distinguishes verified combinations -from dependency or display limitations. - -## External references - -- [uv explicit script invocation](https://docs.astral.sh/uv/reference/cli/#uv-run--script) - supports extensionless Python scripts. -- [uv platform policy](https://docs.astral.sh/uv/reference/policies/platforms/) - distinguishes tested platforms from build-only support; it is not a substitute - for validating the rest of the movie toolchain. -- [FFmpeg image input](https://ffmpeg.org/ffmpeg-formats.html#image2) - documents that glob input depends on build support. -- [FFmpeg Windows desktop capture](https://ffmpeg.org/ffmpeg-devices.html#gdigrab) - documents desktop, region, and window capture. -- [ttyd Windows builds](https://github.com/tsl0922/ttyd/wiki/Compile-on-Windows) - document native ConPTY support and its OS requirement. -- [Piper package files](https://pypi.org/project/piper-tts/#files) - include Windows x64 builds; package availability alone is not a completed - synthesis or transcription test. -- [PowerShell automatic variables](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_automatic_variables) - distinguish command success from native process exit status. -- [ttyd protocol implementation](https://github.com/tsl0922/ttyd/blob/main/src/protocol.c) - associates a terminal process with each initialized client connection. -- [CDP WebSocket receive events](https://chromedevtools.github.io/devtools-protocol/tot/Network/#event-webSocketFrameReceived) - expose messages from the browser's existing socket, including encoded binary payloads. -- [Windows Job Objects](https://learn.microsoft.com/en-us/windows/win32/procthread/job-objects) - provide a process-ownership boundary for session cleanup. -- [ConPTY close behavior](https://learn.microsoft.com/en-us/windows/console/closepseudoconsole) - informs output draining and bounded shutdown on older Windows versions. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md b/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md deleted file mode 100644 index fb353dc..0000000 --- a/docs/superpowers/specs/2026-09-09-proof-movie-os-compatibility-review.md +++ /dev/null @@ -1,75 +0,0 @@ -# Proof movie compatibility: adversarial design review - -**Date:** 2026-09-09 - -**Reviewed draft:** `a36d831d6f9764b6a1355b23f318519701f37029` - -**Design:** [OS compatibility spec](2026-09-09-proof-movie-os-compatibility-design.md) - -## Method and limits - -Two independent agents reviewed the committed draft with separate contexts and -read-only assignments. `review_terminal_spec` examined native terminal control, -shell outcomes, ttyd, and lifecycle. `review_platform_spec` examined the platform -contract, dependency feasibility, and acceptance evidence. The author separately -checked the shared pipeline against the actual imported scripts and verified the -review findings before revising the design. - -The independent reviewers found no Critical issues and four Important design -gaps. They did not run native Windows recording. This is adversarial review of a -specification, not skill pressure testing or OS acceptance testing. - -## Findings and disposition - -| Finding | Evidence/failure scenario | Design revision | -| --- | --- | --- | -| T1: PowerShell outcome was underspecified (Important) | A failed cmdlet can leave an earlier native exit code at zero, or a successful cmdlet can leave it nonzero. PowerShell 5.1 expression wrappers can alter the success variable. Native-exit-only tests miss this. | Separate shell success, native exit attribution, errors, and unknown/interrupted completion. Capture status before logging; define atomic beats and opaque script behavior. Record both PowerShell 5.1 and 7 with mixed cmdlet/native and error fixtures. | -| T2: Process ownership omitted descendants (Important) | ttyd terminates its Windows shell with `TerminateProcess`; this does not by itself prove children/grandchildren stop. A worker can keep writing after a cancelled recording. | Establish a Windows Job Object before children run, with kill-on-close and no breakaway; account for Unix PTY process groups. Drain output during bounded shutdown. Require owned descendants to exit while an unrelated sentinel survives. | -| T3: Output observation could attach to the wrong shell (Important) | ttyd spawns a process per initialized terminal WebSocket. Opening a separate observer socket creates another shell rather than attaching to the filmed one. | One persistent supervisor and one terminal client. Observe the filmed page's existing connection through CDP, use writable mode and a readiness round trip, and control takes through ordered request files. Test nonce, shell identity, state, and command continuity. | -| P1: OS and feature coverage were not joined (Important) | The original acceptance rows could be satisfied by proving features on one OS and doing smoke runs elsewhere, leaving genuinely headless Linux or WSL local voice untested. | Assign P/B/T/V/L fixture groups to each required OS/architecture environment. Require positive headless and WSL voice runs, separately map shell checks, and reserve verified desktop claims for backends with real successful takes. | -| A1: Nested ASR helper inherited the filmed project (author finding) | Imported `narrate` uses nested `uv run --with faster-whisper ...` without disabling project discovery. An unrelated project Python requirement can prevent the helper from launching. | Disable nested helper project discovery; require compatible interpreter selection and a fixture proving no dependency on, or mutation of, the filmed project's environment/lockfile. | - -Additional clarifications retain the existing `movie` scene's own-audio/duration -exception, use the exact scene-kind names in the fixture, distinguish helper -UTF-8 pipes from arbitrary native command encodings, and require shell-specific -agent evals to prove the actual tool shell rather than the agent's launch shell. - -## Verification performed during review - -- Inspected ttyd's `src/protocol.c`: process creation is associated with the - initialized terminal client, and input depends on writable mode. -- Inspected ttyd's `src/pty.c`: Windows shell termination uses `TerminateProcess`. -- Checked Microsoft's PowerShell automatic-variable documentation, Job Objects, - and ConPTY shutdown documentation. These support the design corrections; they - do not establish that the future recorder implements them correctly. -- Reproduced uv project discovery in a temporary directory containing a - `pyproject.toml` requiring Python `>=9.99`. - `uv run --offline python -c 'print("ASR child launched")'` exited 2 with an - interpreter-resolution error; adding `--no-project` before `python` exited 0. - This isolates the project-discovery issue without claiming an actual ASR/model - test was run. -- Located the external eval checkout at - `/Users/drewritter/prime-rad/superpowers-evals`, commit `66f08529`, and read its - Windows guest agent instructions. They establish a native guest launch path, - not a PowerShell tool adapter or a completed movie eval. - -## Recheck and remaining work - -Both original reviewers rechecked the revised design. The terminal reviewer -confirmed T1/T2/T3 resolved for implementation planning with no new Critical or -Important contradictions. The platform reviewer confirmed P1 resolved with no -new findings. The terminal reviewer also checked CDP's documented receive events -and binary payload representation and found no demonstrated accessibility blocker -for the proposed observer. No independent review finding remains open. - -Runtime validation remains implementation work: the first planned task is a -bounded native Windows probe of same-session ttyd observation, PowerShell/Git Bash -completion, persistent takes, and descendant cleanup. Its result determines -whether the specified adapters can proceed unchanged. The -[implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md) is now -written for review and records the available Windows validation host. The runtime -probe is a prerequisite within that plan, not a test claimed to have passed -during specification review. - -The eventual skill changes still require before/after pressure tests and the -OS acceptance matrix. This review must not be cited as that evidence. diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md deleted file mode 100644 index 2418a96..0000000 --- a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-review.md +++ /dev/null @@ -1,36 +0,0 @@ -# Adversarial review of the Windows completion spec - -**Reviewed draft:** `cd5e0bd7`. -**Spec:** [Windows completion design](2026-09-09-proof-movie-windows-completion-design.md). -**Reviewer:** Independent Codex subagent `/root/review_windows_completion`, given the user goal, current spec, and relevant source paths without the controller's full conversation. -**Scope:** Design correctness, scope discipline, existing-code compatibility, and sufficient Windows acceptance. Read-only review; no implementation, runtime tests, provisioning, remote-host work, or additional agents. - -## Initial verdict - -Revise before implementation. The reviewer judged the narrowed architecture proportionate and found five mandatory contract corrections. None required restoring the old framework, platform matrix, or eval infrastructure. - -| Finding | Evidence in the reviewed source | Spec correction | -| --- | --- | --- | -| R1 — Producer attribution and success (P1) | Probe `dispatch` depends on `native_producer`; Bash `emit_bash` selects the first saved pipeline status. The draft required attribution but omitted the input field and aggregate success rule. | Include the field; limit its promise to a direct native invocation or first pipeline stage followed by logging. Keep raw PowerShell status and observed errors distinct. A failed/unknown identified producer cannot yield a successful command result. | -| R2 — Cached ASR verification (P1) | `narrate`'s unchanged-WAV/manifest branch bypasses all transcription, including under `--verify on`. The controller independently identified and sent this case to the reviewer, who confirmed it. | Explicit `on` verifies reused WAVs as well as new audio. Add the off→on cached-clip case to the focused checks; unchanged text does not establish verified audio. | -| R3 — Complete asynchronous control (P2) | Probe reads exactly the next consecutive request filename; arbitrary positive IDs can block it. Duplicate rejection prevents resubmitting solely to wait for an existing result. | Specify consecutive IDs, one controller, visible next ID, and prompt gap/duplicate rejection. Add a wait-only `result` command; distinguish acknowledgment from completion and client timeout from cancellation. | -| R4 — Timeout/shutdown state (P2) | Probe command timeout terminates the session, but the draft left this ambiguous. Probe dispatch publishes close/cancel replies before cleanup. | Command timeout records unknown and tears down the session. Define active-take/pending-command behavior for close/cancel. Successful shutdown completion is published only after resource cleanup, separately from acknowledgment. | -| R5 — Event timing and automatic capture (P2) | Draft allowed nearly two-second duplicate intervals while requiring only total-duration accuracy; a transient could be omitted without failing that duration check. | Specify monotonic boundaries, capture request/completion timestamps, conservative placement on the output grid, and visible gaps. Require several ordered TUI states in automatic frames before exit; a manual checkpoint cannot substitute. | - -The controller checked R1–R4 against the cited implementation paths and R5 against the actual capture/export contract before editing. The revisions add focused checks inside the existing Windows validation work, not new infrastructure. - -## Boundaries retained - -- Fixed geometry removes runtime resize support. It does not prove wrapping/redraw correctness. -- Periodic screenshots are a proposed implementation choice. Existing successful single screenshots do not establish sustained capture correctness. -- A focused actual Windows cadence/wrapping test remains required before further recorder extraction. Its failure requires a bounded design decision, not automatic expansion into the old plan. -- The three Windows shell runs may share downloaded model caches and fixture setup, but each must produce its own final-code evidence. -- Existing agents remain stopped. This newly authorized reviewer performs review only. - -## Scoped recheck - -The same reviewer rechecked R1–R5 and contradictions introduced by their revisions. **All five are resolved sufficiently for implementation; no new concrete blocker or mandatory scope reduction was found.** The revised design is ready to guide implementation when execution is authorized. - -The reviewer found no evidence that fixed-geometry periodic screenshots fail as a design. Sustained capture and wrapping correctness remain unproven runtime questions covered by the focused Windows decision gate. Design approval does not establish Windows support or replace that test. - -Both review passes were read-only. The controller changed only this review record and the completion spec; implementation did not resume. -- cgit From 35e5696b39a4639ea406b71ad95256b30ce2e320 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 22:53:20 -0700 Subject: docs(movie): trim Windows guidance to what the tools need Remove generic shell exit-status recipes and a stills wrapper that the card scene already covers. Keep the gdigrab commands and the verify-on notes short. Reduce the spec to the design: drop execution logistics, host names, and references to deleted files. Co-Authored-By: Claude Fable 5.1 --- ...-09-09-proof-movie-windows-completion-design.md | 70 +++++----------------- 1 file changed, 15 insertions(+), 55 deletions(-) (limited to 'docs') diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md index 7f5f56b..a451f69 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md @@ -1,13 +1,5 @@ # Finish Windows support for the movie skill -**Status:** Reviewed execution completed through the three implementation milestones. Native workflow results and the remaining candidate-instruction verification gaps are recorded in the [results report](../reports/2026-09-09-proof-movie-os-compatibility.md#reviewed-windows-completion--final-results). - -**Baseline:** `feat/movie-os-compatibility` at `442a48d9`, based on the movie import at `f6617db1`. - -**Implementation plan:** [Three-milestone completion plan](../plans/2026-09-09-proof-movie-windows-completion.md). Execution was authorized and resumed. - -This replaces the remaining scope of the [earlier OS compatibility design](2026-09-09-proof-movie-os-compatibility-design.md) and its [12-task implementation plan](../plans/2026-09-09-proof-movie-os-compatibility.md). Completed fixes and retained evidence remain useful. Unfinished tasks in that plan are not instructions to resume work. - ## Goal and limits An agent on native Windows can use the existing movie skill from **PowerShell 5.1, PowerShell 7, or Git Bash** to capture real software, generate local narration, assemble the movie, add subtitles, and apply the existing movie verification gate. @@ -16,21 +8,10 @@ An agent on native Windows can use the existing movie skill from **PowerShell 5. - PowerShell does not require Git Bash. Native Windows does not require WSL, tmux, Docker, administrator rights, a cloud key, or changes to machine settings. - Reuse native Python/uv, FFmpeg/ffprobe, Chromium-family browsers, ttyd, and the existing local voice/transcription dependencies. First use may download prerequisites and models; document that setup separately from recording. - Keep the existing five tool CLIs, scene kinds, narration manifest, offsets, SRT files, and checker behavior. Preserve the existing Unix terminal recipe and macOS/Linux behavior. -- Validate native Windows x64 on the available Ballmer host. Record its actual Windows version; do not infer support for untested Windows releases or architectures, or add a Windows 11-only restriction without a demonstrated need. +- Validated on native Windows 11 x64. Support for other Windows releases or architectures is not inferred. This is a Windows port. It does not deliver a general process-management framework, a cross-platform recorder rewrite, a new eval harness, or a new OS/architecture certification matrix. Existing Linux, Mac, WSL, Rosetta, and offline-isolation setup may be reused when useful; extending that setup is not a deliverable. -## Keep the completed work - -| Existing work | Treatment | -| --- | --- | -| `assemble` and `media_paths.py` at `442a48d9` | Keep numbered ordinary-file frame staging, FFconcat escaping, UTF-8 writes, ordering, and cleanup. The native Windows path/assembly evidence covers images, frames, and movie segments; cards remain open. | -| Portable runner and tests | Keep the original 18 assertion intents and the corrected subtitle-offset assertion. Extend this runner for the remaining fixes. | -| `probe-windows.py` | Reuse the demonstrated ttyd launch, same-page observation, shell status, and Windows Job Object mechanisms. Keep test fixtures and evidence aggregation out of the user-facing recorder. | -| Existing host inventory and artifacts | Use the prepared ordinary-user Windows runner and explicit tool paths. Prior evidence is labeled with its source revision; it does not replace testing the final changed code. | - -The probe's TUI success used a bounded checkpoint. Its event-driven screencast and arbitrary resize behavior are not accepted as a finished capture implementation. - ## 1. Finish the existing media tools | Area | Required resulting behavior | @@ -45,22 +26,22 @@ The narration change addresses observed failures: native Windows could synthesiz ## 2. Provide a usable Windows terminal example -Add `skills/proving-it-works-with-a-movie/examples/film-terminal.py` as the Windows recording entry point referenced by the Windows instructions. It uses the proven native ttyd/ConPTY and browser approach. The existing Unix tmux recipe remains documented separately; do not advertise this new entry point as a tested Unix recorder. +Add `skills/proving-it-works-with-a-movie/examples/film-terminal.py` as the Windows recording entry point referenced by the Windows instructions. It serves the shell through ttyd and observes it in a headless browser. The existing Unix tmux recipe remains documented separately; do not advertise this new entry point as a tested Unix recorder. ### Session and control contract - `serve --shell powershell51|powershell7|gitbash --directory ` owns one recorded shell and one browser page. Allow explicit shell/browser/ttyd executable paths and `--cwd` (default: the invoking working directory). Launch ttyd with explicit `-w` for that cwd, writable mode, one client, and loopback binding. - Keep `serve` in a foreground/background task owned by the invoking harness, as the visual companion does. Later shell tool calls control the same process. It is not an installed service or self-daemonizing launcher. -- `request --directory --file ` submits a request. Files avoid inline command length and cross-shell JSON quoting problems. A session has one requesting controller; IDs are consecutive integers starting at one, matching the probe's ordered reader. Expose `next_request_id` in the ready/status files and `inspect` result; publish the updated status before acknowledging a consumed ID. Reject duplicate or non-next IDs before publication, with an immediate error rather than waiting for a missing file. Writes and replies are atomic. Default output is acknowledgment JSON, which does not claim command completion; a rejection is nonzero. `--wait-result` waits up to `--timeout` (default: 30 seconds) and exits nonzero for command/control failure, unknown/interrupted outcome, or missing result. A client wait timeout does not cancel the pending command. +- `request --directory --file ` submits a request. Files avoid inline command length and cross-shell JSON quoting problems. A session has one requesting controller; IDs are consecutive integers starting at one. Expose `next_request_id` in the ready/status files and `inspect` result; publish the updated status before acknowledging a consumed ID. Reject duplicate or non-next IDs before publication, with an immediate error rather than waiting for a missing file. Writes and replies are atomic. Default output is acknowledgment JSON, which does not claim command completion; a rejection is nonzero. `--wait-result` waits up to `--timeout` (default: 30 seconds) and exits nonzero for command/control failure, unknown/interrupted outcome, or missing result. A client wait timeout does not cancel the pending command. - `result --directory --id --timeout ` waits for or reads an existing result without submitting another request or consuming an ID. Default timeout is 30 seconds; use the same completion/exit-status rules as `request --wait-result`. This is the supported follow-up after acknowledgment or client timeout. - Supported request operations are `run` (`command`, optional `timeout_seconds`, optional `native_producer`), `begin-take` (`name`), `end-take`, `key` (`key`), `inspect`, `close`, and `cancel`. Support printable keys, Enter, Escape, arrows, Tab, and Ctrl-C. Diagnostic probe phases, crash fixtures, and aggregation are test-only. -- `run` acknowledges acceptance without waiting for the command to finish. Its result deadline defaults to 90 seconds and is independent of the client's wait timeout. Reuse the probe's numbered request/ack/result files under `control/`, with session ID and request ID in replies. `inspect` exposes pending request and active take. A second `run` while one is pending fails before typing, leaving the session usable; take controls and intentional `key` input remain available. A known failing command can be followed by another command; it does not itself terminate recording. +- `run` acknowledges acceptance without waiting for the command to finish. Its result deadline defaults to 90 seconds and is independent of the client's wait timeout. Use numbered request/ack/result files under `control/`, with session ID and request ID in replies. `inspect` exposes pending request and active take. A second `run` while one is pending fails before typing, leaving the session usable; take controls and intentional `key` input remain available. A known failing command can be followed by another command; it does not itself terminate recording. - `end-take` stops capture only. It preserves the shell, working directory, variables, pending command, and browser connection for a later take, including across separate harness tool calls. - Readiness requires a nonce, shell identity, and cwd returned through the filmed terminal, plus a readable preflight image. Opening another ttyd connection is not an observation mechanism. A reconnect fails the session instead of silently replacing its identity. Command results distinguish `completed`, `unknown`, and `interrupted`; shell success is nullable. Preserve raw PowerShell `$?` separately from observed request-attributed errors, including PS5.1 expression-wrapper behavior; instrumentation must not change the submitted statement's semantics. Capture status before logging. -`native_producer` identifies the native executable for a direct invocation or the first stage of a pipeline followed by logging commands. This is the bounded attribution contract already exercised by the probe: Bash uses the first saved `PIPESTATUS` entry; PowerShell uses that request's native exit status. Opaque/mixed scripts omit this field and report their observed shell outcome without claiming individual internal commands succeeded. Do not infer producer identity or reuse stale native status. A completed result is successful only when shell success is true, no request-attributed shell error is present, and any explicitly identified producer has a known zero exit code. Thus successful `tee`/`Tee-Object` cannot hide a producer failure. Retain the existing probe's relevant outcome cases as regressions for the adapted code. +`native_producer` identifies the native executable for a direct invocation or the first stage of a pipeline followed by logging commands. This is the bounded attribution contract: Bash uses the first saved `PIPESTATUS` entry; PowerShell uses that request's native exit status. Opaque/mixed scripts omit this field and report their observed shell outcome without claiming individual internal commands succeeded. Do not infer producer identity or reuse stale native status. A completed result is successful only when shell success is true, no request-attributed shell error is present, and any explicitly identified producer has a known zero exit code. Thus successful `tee`/`Tee-Object` cannot hide a producer failure. ### Capture choice and deliberately limited geometry @@ -73,17 +54,15 @@ Use **bounded `Page.captureScreenshot` PNG capture at 5 fps**, with a fixed **16 - Check preflight pixels and final exported frames. A static application can legitimately produce identical frames; image similarity alone is not a stalled-capture test. Acceptance must show several successive visible TUI states, each held for at least 1.3 seconds, in the automatically captured sequence while the command owns input, before its exit key. Check their order and placement against capture times. A manually requested snapshot cannot rescue this acceptance check; missing states fail it. - At the fixed geometry, long wrapping output followed by a command completion must work. Invalid/truncated completion records time out as unknown; they never produce success. A general VT emulator and arbitrary resizing are outside this delivery. -The screenshot cadence and fixed-geometry adapter require a focused actual Windows test before committing to further recorder extraction. If either fails, retain the failure and propose a bounded alternative; do not silently resume the old recorder architecture. - ### Ownership and failure handling -Reuse the probe's Windows Job Object mechanism: establish containment before recorder-owned roots execute, and retain kill-on-close semantics. Normal close, cancel, browser loss, and forced recorder exit must remove its browser/ttyd/shell descendants within ten seconds. An unrelated process must survive. Cleanup still runs when capture, control-file, or report writes fail; such failures remain nonzero results. Pending command success becomes unknown/interrupted when observation is lost. +Use a Windows Job Object: establish containment before recorder-owned roots execute, and retain kill-on-close semantics. Normal close, cancel, browser loss, and forced recorder exit must remove its browser/ttyd/shell descendants within ten seconds. An unrelated process must survive. Cleanup still runs when capture, control-file, or report writes fail; such failures remain nonzero results. Pending command success becomes unknown/interrupted when observation is lost. A command-result deadline expiring records an unknown outcome, fails the active take, and terminates the session with owned-resource cleanup. It must not clear pending state and type another command into the still-running program. Browser loss, capture timeout, or a forbidden geometry change likewise ends the session. Client wait deadlines have no such effect. `close` finalizes a healthy active take; `cancel` marks an active take incomplete. Both mark any pending command interrupted with null success and release owned processes. Earlier completed takes remain available. A shutdown acknowledgment means only accepted; publish the successful close/cancel result only after cleanup finishes. That success describes resource release, not the interrupted command. A finalization, cleanup, or result-write failure makes shutdown nonzero or leaves no successful result; the client must not infer success from a missing result. -Keep ownership code specific to this recorder and its launched browser. Extract a small Windows helper only where it avoids duplicating the proven mechanism; do not introduce the previous generic `OwnedProcesses` framework. +Keep ownership code specific to this recorder and its launched browser. Share a small Windows helper between the recorder and the card renderer; do not introduce a generic process framework. ## 3. Update only the Windows-facing guidance @@ -95,31 +74,12 @@ Update the existing skill/route documents where Unix-only commands block Windows - Retain browser-driven motion, stills, existing movie segments, and log reels as existing routes through the same media tools. No new scene language or browser automation framework is needed. - Correct the current dangling terminal-example reference so Unix and Windows instructions point to what actually exists. -## 4. Finite acceptance checklist - -All results below are required unless explicitly conditional. Reuse prepared tools and the existing portable runner. A missing prerequisite or skipped required test is an incomplete result, not compatibility proof. - -| Check | Required evidence | -| --- | --- | -| Three native Windows workflow runs | One run invoked from each of PS5.1, PS7, and Git Bash on Ballmer, recording the corresponding shell. Record actual tool paths, native Windows Python identity, shell versions, and ordinary-user token. | -| One repeatable fixture per run | Combine a rendered title card, still image, changing real browser content, terminal takes, and an existing movie segment into a narrated, hard-subtitled movie. Use a path such as `movie O'Brien λ & [take]`, CRLF scene input, and a separate work directory. Preserve source movie audio and measured offsets; cover both narration-longer and visuals-longer scene timing. | -| Terminal behavior per recorded shell | Known success/failure; PowerShell cmdlet/native distinctions and raw expression-wrapper status; explicitly attributed producer failure through logging must make `result` nonzero; one command running across two takes and separate tool calls; cwd/variable persistence; long wrapped output; several ordered TUI states in automatic frames before the exit key. Validate timestamp placement and fixed geometry. | -| Local voice per workflow | Fresh local Piper synthesis and actual transcription with no cloud key, including a repeat using cached models. Invoke the finished helper through `narrate --verify on`. Synthetic audio/text comparisons and skipped ASR do not satisfy this check. Additional OS network-isolation experiments are unnecessary. | -| Final movie per workflow | All five tools complete; hard subtitles are visible, narration audible, action and timing visible in the finished movie; checker passes; inspect its contact sheet and transcribe/check the rendered audio. Record artifacts and commands. | -| Browser fallback and desktop | Render an actual title card with Chrome and Edge once each. Run the desktop preflight in the existing interactive session and inspect real app pixels; separately verify that unavailable capture is reported as unavailable. No RDP/compositor matrix. | -| Focused negative tests | Bad browser override, browser timeout, missing libass/soft fallback, malformed or unavailable ASR under `--verify on` for both fresh and off→on cached clips, no-Bash PowerShell launch, screenshot timeout, geometry change, and cleanup after control/report failures. Control cases cover immediate gap/duplicate-ID rejection, wait-only result retrieval after client timeout, second-run rejection, command-timeout teardown, and no successful shutdown result before cleanup. Use controlled tests for these failure cases. | -| Ownership regressions | Normal close, cancel, browser loss, and forced exit on the final recorder for each recorded shell. Reuse the existing child/grandchild and unrelated-sentinel fixtures. | -| Existing platforms | Run the existing portable regressions on the available native Mac and Linux runner, including the modified browser/subtitle/narration code paths. Preserve Unix instructions. No additional WSL, Rosetta, Intel-hardware, or architecture certification gate. | -| Skill instructions | Four focused agent sessions: before/after using actual PowerShell tools and before/after using actual Git Bash tools. Use the same Windows scenario to exercise paths, no-key narration, terminal commands, and honest capture failure. Follow `superpowers:writing-skills`; retain transcripts and before/after results. No new eval platform or 36-session matrix. | - -Share the fixture and downloaded model caches across shell runs; each run must still produce its own final-code artifacts. Fix demonstrated failures and rerun the affected checks. A final integration run uses the final code; unchanged prerequisite investigations and already-reviewed unrelated fixtures do not need repeating. - -## Delivery and stopping point - -Work has three implementation milestones: **media tools**, **Windows terminal example**, and **instructions plus final acceptance**. The first two can be reviewed as concrete changes without creating another platform-wide task hierarchy. - -Expected edits are the existing five scripts, at most the browser/Windows ownership helpers actually shared by the example, the new terminal example, focused tests in the existing test directory, and affected movie Markdown files. Existing scratch evidence is retained, not promoted wholesale into production. Summarize final results in the existing report with stable artifact locations and source revision. - -Done means the three native Windows workflow runs and this checklist have concrete results, documented limitations are visible, and the user has a complete diff to review. Missing Windows route evidence remains unfinished work. Pushing, opening a PR, and merging are separate from this specification request. +## 4. Validation -Execution resumed under this reviewed scope. The results report records each acceptance disposition, including incomplete candidate-instruction verification; the superseded plan and earlier workers were not resumed. +Each of PowerShell 5.1, PowerShell 7, and Git Bash on Windows 11 x64 produced +a complete narrated, hard-subtitled movie from a title card, a still, real +browser clicks, two terminal takes across separate tool calls, and a source +movie segment, using local Piper narration verified by local transcription, +with the checker passing. The portable suites pass on macOS and were also run +on Linux during development. Full-desktop `gdigrab` capture returned only +wallpaper on the test host; window-title capture worked. -- cgit From 26c44ceee0a9df9d9d1074bd74083cf9694f1e35 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Wed, 9 Sep 2026 23:41:25 -0700 Subject: feat(movie): simplify the Windows terminal recorder to serve/run/key/watch/close Windows has no tmux, so the recorder had grown into a 738-line daemon with a file-based request protocol, request IDs, wait-only result retrieval, and a Win32 Job Object module. Replace it with the Unix route's shape: serve keeps ttyd and a headless browser alive and logs the terminal's output; run, key, watch, and close are one-shot CDP calls against that browser. The installed prompt reports each command's status through the window title, so run can print it without any visible marker. Process cleanup uses taskkill /T (a pgrep walk on Unix) instead of Job Objects, which also simplifies the card renderer. The session tests run on macOS too, since nothing in the script is Windows-specific. Verified: 9 session tests per shell on Windows 11 for PowerShell 5.1, PowerShell 7, and Git Bash; the browser suite with Chrome and Edge; 44 portable tests on macOS against a real ttyd session. Co-Authored-By: Claude Fable 5.1 --- ...-09-09-proof-movie-windows-completion-design.md | 65 +++++++++------------- 1 file changed, 26 insertions(+), 39 deletions(-) (limited to 'docs') diff --git a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md index a451f69..84b2aaa 100644 --- a/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md +++ b/docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md @@ -26,43 +26,29 @@ The narration change addresses observed failures: native Windows could synthesiz ## 2. Provide a usable Windows terminal example -Add `skills/proving-it-works-with-a-movie/examples/film-terminal.py` as the Windows recording entry point referenced by the Windows instructions. It serves the shell through ttyd and observes it in a headless browser. The existing Unix tmux recipe remains documented separately; do not advertise this new entry point as a tested Unix recorder. - -### Session and control contract - -- `serve --shell powershell51|powershell7|gitbash --directory ` owns one recorded shell and one browser page. Allow explicit shell/browser/ttyd executable paths and `--cwd` (default: the invoking working directory). Launch ttyd with explicit `-w` for that cwd, writable mode, one client, and loopback binding. -- Keep `serve` in a foreground/background task owned by the invoking harness, as the visual companion does. Later shell tool calls control the same process. It is not an installed service or self-daemonizing launcher. -- `request --directory --file ` submits a request. Files avoid inline command length and cross-shell JSON quoting problems. A session has one requesting controller; IDs are consecutive integers starting at one. Expose `next_request_id` in the ready/status files and `inspect` result; publish the updated status before acknowledging a consumed ID. Reject duplicate or non-next IDs before publication, with an immediate error rather than waiting for a missing file. Writes and replies are atomic. Default output is acknowledgment JSON, which does not claim command completion; a rejection is nonzero. `--wait-result` waits up to `--timeout` (default: 30 seconds) and exits nonzero for command/control failure, unknown/interrupted outcome, or missing result. A client wait timeout does not cancel the pending command. -- `result --directory --id --timeout ` waits for or reads an existing result without submitting another request or consuming an ID. Default timeout is 30 seconds; use the same completion/exit-status rules as `request --wait-result`. This is the supported follow-up after acknowledgment or client timeout. -- Supported request operations are `run` (`command`, optional `timeout_seconds`, optional `native_producer`), `begin-take` (`name`), `end-take`, `key` (`key`), `inspect`, `close`, and `cancel`. Support printable keys, Enter, Escape, arrows, Tab, and Ctrl-C. Diagnostic probe phases, crash fixtures, and aggregation are test-only. -- `run` acknowledges acceptance without waiting for the command to finish. Its result deadline defaults to 90 seconds and is independent of the client's wait timeout. Use numbered request/ack/result files under `control/`, with session ID and request ID in replies. `inspect` exposes pending request and active take. A second `run` while one is pending fails before typing, leaving the session usable; take controls and intentional `key` input remain available. A known failing command can be followed by another command; it does not itself terminate recording. -- `end-take` stops capture only. It preserves the shell, working directory, variables, pending command, and browser connection for a later take, including across separate harness tool calls. -- Readiness requires a nonce, shell identity, and cwd returned through the filmed terminal, plus a readable preflight image. Opening another ttyd connection is not an observation mechanism. A reconnect fails the session instead of silently replacing its identity. - -Command results distinguish `completed`, `unknown`, and `interrupted`; shell success is nullable. Preserve raw PowerShell `$?` separately from observed request-attributed errors, including PS5.1 expression-wrapper behavior; instrumentation must not change the submitted statement's semantics. Capture status before logging. - -`native_producer` identifies the native executable for a direct invocation or the first stage of a pipeline followed by logging commands. This is the bounded attribution contract: Bash uses the first saved `PIPESTATUS` entry; PowerShell uses that request's native exit status. Opaque/mixed scripts omit this field and report their observed shell outcome without claiming individual internal commands succeeded. Do not infer producer identity or reuse stale native status. A completed result is successful only when shell success is true, no request-attributed shell error is present, and any explicitly identified producer has a known zero exit code. Thus successful `tee`/`Tee-Object` cannot hide a producer failure. - -### Capture choice and deliberately limited geometry - -Use **bounded `Page.captureScreenshot` PNG capture at 5 fps**, with a fixed **1600 × 900** browser viewport set before terminal navigation. This reuses the successful live-screenshot mechanism and the imported skill's deliberate-frame route. Continuous CDP screencast delivery is not required for this port. - -- Observe and record actual terminal rows/columns; require at least 80 columns for the existing 60-character completion framing. Do not offer resize controls. A detected terminal geometry change fails the session with an actionable message. -- The CDP receiver must continue handling terminal output, command replies, and cancellation during capture. Use a two-second screenshot response deadline; a timeout or lost browser fails the active take. -- Treat 5 fps as the target sampling cadence, not a guarantee that every 0.2-second event is observed. Record monotonic take boundaries and screenshot request/completion times. A take starts at its first completed screenshot; `begin-take` completes only then. Place frames on the 0.2-second output grid using the latest screenshot completed at or before that grid time, never a future screenshot. Record duplicated intervals; a gap between completed captures, or from the last capture to take end, exceeding two seconds fails the take. Match total take duration within one frame (0.2 seconds). Total duration alone does not establish event timing. -- `end-take` returns a take directory and the corresponding existing `kind: frames` scene fields (`src`, `rate: 5`). These artifacts feed the existing assembler directly. -- Check preflight pixels and final exported frames. A static application can legitimately produce identical frames; image similarity alone is not a stalled-capture test. Acceptance must show several successive visible TUI states, each held for at least 1.3 seconds, in the automatically captured sequence while the command owns input, before its exit key. Check their order and placement against capture times. A manually requested snapshot cannot rescue this acceptance check; missing states fail it. -- At the fixed geometry, long wrapping output followed by a command completion must work. Invalid/truncated completion records time out as unknown; they never produce success. A general VT emulator and arbitrary resizing are outside this delivery. - -### Ownership and failure handling - -Use a Windows Job Object: establish containment before recorder-owned roots execute, and retain kill-on-close semantics. Normal close, cancel, browser loss, and forced recorder exit must remove its browser/ttyd/shell descendants within ten seconds. An unrelated process must survive. Cleanup still runs when capture, control-file, or report writes fail; such failures remain nonzero results. Pending command success becomes unknown/interrupted when observation is lost. - -A command-result deadline expiring records an unknown outcome, fails the active take, and terminates the session with owned-resource cleanup. It must not clear pending state and type another command into the still-running program. Browser loss, capture timeout, or a forbidden geometry change likewise ends the session. Client wait deadlines have no such effect. - -`close` finalizes a healthy active take; `cancel` marks an active take incomplete. Both mark any pending command interrupted with null success and release owned processes. Earlier completed takes remain available. A shutdown acknowledgment means only accepted; publish the successful close/cancel result only after cleanup finishes. That success describes resource release, not the interrupted command. A finalization, cleanup, or result-write failure makes shutdown nonzero or leaves no successful result; the client must not infer success from a missing result. - -Keep ownership code specific to this recorder and its launched browser. Share a small Windows helper between the recorder and the card renderer; do not introduce a generic process framework. +Windows has no tmux, so `examples/film-terminal.py` stands in for it, keeping +the Unix route's shape: ttyd serves the shell, a headless Chrome or Edge page +renders it, screenshots are the frames. `serve` starts both, keeps them alive +in a harness-owned background task, and appends the raw terminal output to a +log. `run`, `key`, `watch`, and `close` are one-shot CDP calls against that +browser, so the shell, its variables, and its cwd persist across separate +tool calls with no daemon protocol. + +- The installed prompt reports a counter, the shell's success flag, the last + native exit code, and the cwd through the window title, which the picture + never shows. `run` types a command, waits for the next prompt, and prints + that status as JSON; it exits 1 when the command failed and 2 when it is + still running after `--seconds`. +- Capture is bounded `Page.captureScreenshot` at 5 fps in a fixed 1600×900 + viewport. Frames sit on the 0.2-second grid and a slow screenshot repeats + the previous frame, so every `--record` directory is a `kind: frames` scene + at `rate: 5` for the assembler. +- `serve` refuses a blank canvas at readiness and exits nonzero if the + browser or ttyd connection drops. `close` kills ttyd, the browser, and + their descendants (`taskkill /T` on Windows) and removes the browser + profile. +- The script does not check which OS it runs on, which is how its session + tests run on macOS too; the Unix route stays the tmux recipe. ## 3. Update only the Windows-facing guidance @@ -80,6 +66,7 @@ Each of PowerShell 5.1, PowerShell 7, and Git Bash on Windows 11 x64 produced a complete narrated, hard-subtitled movie from a title card, a still, real browser clicks, two terminal takes across separate tool calls, and a source movie segment, using local Piper narration verified by local transcription, -with the checker passing. The portable suites pass on macOS and were also run -on Linux during development. Full-desktop `gdigrab` capture returned only +with the checker passing. The recorder's session tests pass on Windows 11 for +all three shells and on macOS against a real ttyd; the media suites were also +run on Linux during development. Full-desktop `gdigrab` capture returned only wallpaper on the test host; window-title capture worked. -- cgit From 9fe81b48a2d9599d0a39cca0a1e5329f3905cae4 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Fri, 11 Sep 2026 16:54:26 -0700 Subject: docs(movie): make native Windows recorder recipes executable Replace the Git Bash PowerShell shorthand with complete native commands, explicit path conversion, a kept-alive serve task, bounded readiness, and run/key/watch/close examples. Use native input and sleep commands so the recipe works without a sample app. Explain empty take directories and PowerShell 5.1 embedded-quote escaping observed in native trials. The original PowerShell missing-cwd finding does not reproduce when the session is nested under the working directory; retain the successful baseline and describe explicit directory creation as setup clarity. Fresh readers exercised the final recipes on native PowerShell 5.1, PowerShell 7, and Git Bash. Preserve the failed first candidate and driver setup failures, distinguish instruction trials from full skill evaluation, and keep movie acceptance with Drew. Record Drew's approval of the normal workflow dependencies and the bounded repair plan. --- .../plans/2026-09-11-movie-review-fixes.md | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 docs/superpowers/plans/2026-09-11-movie-review-fixes.md (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-11-movie-review-fixes.md b/docs/superpowers/plans/2026-09-11-movie-review-fixes.md new file mode 100644 index 0000000..e0f2fc8 --- /dev/null +++ b/docs/superpowers/plans/2026-09-11-movie-review-fixes.md @@ -0,0 +1,60 @@ +# Movie review fixes implementation plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [x]`) syntax for tracking. + +**Goal:** Repair the reproduced findings on #2214/#2275 while retaining the existing movie workflow. + +**Architecture:** Keep the recorder and five media tools. Refuse reused take directories before sending input; publish only accepted narration in the manifest. Correct the Windows recipes and missing-capability test handling. + +**Tech Stack:** Python, unittest, uv, ttyd, Chromium, PowerShell and Git Bash. + +**Spec:** `docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md` + +## Global constraints + +- Native Windows 11 x64: PowerShell 5.1, PowerShell 7, Git Bash; invoking and recorded shells match. +- Preserve the Unix recipe, existing CLI interfaces, media formats, and verification policy. +- Drew approved the necessary third-party dependencies on 2026-09-11: "those deps are normal and fine". Remove only the unused `websockets` test dependency. +- Drew personally watches the movies for final acceptance. Do not run movie checkers, audio transcription, or image inspection for this repair pass. Mock external media boundaries in code-contract tests. +- Preserve old takes and failed audio as evidence. Do not delete user output directories. +- No new framework, backwards compatibility layer, merge, or external review comment. + +### Task 1: Repair reusable output and missing-capability contracts + +**Files:** +- Modify `skills/proving-it-works-with-a-movie/examples/film-terminal.py` and `scripts/narrate`. +- Modify `tests/proving-it-works-with-a-movie/test_terminal.py`, `test_narration.py`, `test_subtitles.py`, and `run-tests.py`. + +**Interfaces:** Existing recorder `film`, `run`, `key`, `watch`, and `main`; existing narration manifest; existing unittest runner. + +- [x] Add regressions that execute real cache/filesystem behavior with fake external synthesis/capture. Two rejected `openai-chat --verify off` invocations must both return 1 and regenerate, with failed scenes absent from the manifest; an accepted scene still caches. A cached clip rejected by strict ASR must be removed from the manifest. No actual ASR or media inspection. +- [x] Add a frame-directory regression with existing PNGs plus a sentinel file: recording must fail before capture and preserve every byte. Test CLI refusal before connecting or typing, for run/key/watch. Keep empty/new directories valid. +- [x] Run focused tests to observe the known failures. +- [x] Implement the smallest guards. Before manifest append: `if sid in failures: continue`. Share a small nonempty-directory guard between the CLI preflight and direct `film()` path; use `any(out.iterdir())` only after checking existence. Report a clear error instructing the caller to use a new take directory. Guard before run/key side effects, not only inside `film`. +- [x] Mock `module.shutil.which` in subtitle unit tests. In the real subtitle integration test call `fixtures.missing_executables("uv", "ffmpeg")` and skip before invoking `has_libass` if missing. Preserve strict runner rejection of skipped capabilities. +- [x] Remove only `websockets` from the runner's inline dependency list. +- [x] Run narration and recorder unit tests. Run subtitle tests with an isolated PATH containing uv and no FFmpeg; ordinary mode must pass with a capability skip, strict mode must fail because of that skip. Do not run media integration tests with FFmpeg available. +- [x] Self-review and commit only owned files. Report commands, results, commits, and any concerns. + +### Task 2: Make Windows recipes executable from a fresh directory + +**Files:** Modify `skills/proving-it-works-with-a-movie/recording-a-terminal.md`; record local before/after instruction evidence separately from shipped guidance. + +**Interfaces:** Existing serve/run/key/watch/close CLI, readiness JSON, exit codes 0/1/2. + +- [x] Preserve current docs as the baseline. Have fresh readers identify and exercise setup and invocation for each shell without consulting recorder source. Record outcomes against the unchanged recipe. The actual PowerShell recipe creates the cwd indirectly and passes; the missing-cwd review finding is not reproduced. +- [x] Add `[System.IO.Directory]::CreateDirectory($work) | Out-Null` before PowerShell serve. Use literal-path checks for readiness because the sample directory contains brackets. +- [x] Replace the Git Bash shorthand with a complete Bash block: `skill=$(cygpath -m /c/path/to/skills/proving-it-works-with-a-movie)`, `work=$(cygpath -m "$HOME/movie O'Brien λ & [take]")`, `mkdir -p "$work"`, `film="$skill/examples/film-terminal.py"`, then `uv run --script "$film" ...` with `--shell gitbash`. Explain the harness-owned background serve lifetime and readiness before commands. +- [x] Explain that each take needs an empty/new directory; return code 2 means the command remains active and should continue through key/watch. Include cleanup and keep the Unix section untouched. +- [x] Use fresh readers for corrected-doc trials on native Windows. Verify shell startup, cwd, persistent state, status handling, and close; do not grade media. Record exact commands, docs revision, and limitations. Cover PowerShell 5.1 and 7 plus Git Bash without a cross-product matrix. +- [x] Commit the corrected recipe. Review the complete repair diff against the reproduced comments; keep final media acceptance with Drew. + +## Results + +- Code repair: `4d4ede29`; 10 narration tests, 8 recorder unit tests, and 4 subtitle tests passed. The FFmpeg-dependent integration test was skipped; strict mode rejected that skip. +- Fresh-reader baseline: Git Bash failed on the copied PowerShell call operator; PowerShell 7 passed the nested session/cwd recipe. +- Corrected recipes passed on native Windows PowerShell 5.1, PowerShell 7, and Git Bash: echo, persistent state, interactive key, long-command watch, and close. PowerShell quoted-command arguments were checked in both versions. +- An initial PowerShell 5.1 candidate exposed native argument quote loss. Final examples use Read-Host/Start-Sleep, with verified version-specific quoting guidance. PowerShell can retain a true success flag after a parse error; the guidance now states that limitation. +- These are bounded instruction trials, not proof of automatic skill discovery or a full adversarial evaluation of the imported skill. Drew retains movie acceptance. +- The worker accidentally ran one integration test that checked temporary test frames before restricting subsequent execution to unit tests. Drew was informed; that run is excluded from acceptance evidence. +- Detailed local reports, command logs, and preserved failures are under `.superpowers/sdd/2026-09-11-movie-review-fixes/`. -- cgit From 4f0e87496be650832a3015a2298b5348e40ab9c0 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Fri, 11 Sep 2026 19:07:49 -0700 Subject: docs: plan consolidated movie committee repairs Drew requested a whole-PR committee review after repeated narrow fixes missed failures. Record the repair boundaries, acceptance handoff, timing and lifecycle contracts, and focused regression cases before implementation. Preserve existing artifact formats and Drew-owned video acceptance; all automated checks in this pass use mocked media boundaries. --- .../plans/2026-09-11-movie-committee-repairs.md | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 docs/superpowers/plans/2026-09-11-movie-committee-repairs.md (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md b/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md new file mode 100644 index 0000000..fd85698 --- /dev/null +++ b/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md @@ -0,0 +1,80 @@ +# Movie committee repairs implementation plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Repair the full-PR committee's concrete failure cases in #2214, including the narration producer/consumer gap that survived narrow reviews. + +**Architecture:** Keep the five tools, adjacent helpers, recorder, and existing artifact formats. Acceptance must be withdrawn before accepted bytes can change, and assembly must enforce current scene intent against that acceptance. Keep timing inside measured intervals and resource cleanup around acquisition. + +**Tech Stack:** Python 3.10+, unittest, existing uv dependencies, Bash and JavaScript recipe examples. + +**Spec:** `docs/superpowers/specs/2026-09-09-proof-movie-windows-completion-design.md`, interpreted with Drew's current instructions and the committee findings recorded under `.superpowers/review/pr2214/committee/`. + +## Global Constraints + +- Keep the existing five tool CLIs, scene kinds, narration manifest, offsets, SRT files, and checker behavior. Preserve macOS/Linux and native Windows operation. +- Keep existing dependencies; no process framework, language-segmentation dependency, compatibility layer, or new evaluation harness. +- Drew personally watches the movies for final acceptance. Do not generate or inspect media, run real movie checkers, synthesis, ASR, FFmpeg, browsers, ttyd, or image/frame inspection. Test real Python decisions using text/byte sentinels and mocked external boundaries only. +- Preserve failed evidence and do not claim mock-based checks establish live media acceptance. +- Keep `auto/on/off`, drift thresholds, authoritative browser selection, partial manual offsets, intentional silence, and source-movie own-audio behavior. +- Work only in `/Users/drewritter/.paseo/worktrees/2mmrq9t5/pr2214-narration-cache`; do not modify the parent checkout, merge, or push from workers. +- Tests exercise meaningful behavior and structured inputs, never large command/script/HTML string matches. No whole media test suites; select only verified safe classes. +- Implementers do not spawn subagents. Follow TDD, self-review, commit explicit files with a detailed message, and report RED/GREEN commands and evidence. + +### Task 1: Make narration acceptance survive reruns and govern assembly + +**Files:** `scripts/narrate`, `scripts/assemble`, `scripts/media_paths.py`, `scripts/check-movie`, optional small adjacent narration-contract helper; `test_narration.py`, `test_assembly.py`, and new safe contract test module under `tests/proving-it-works-with-a-movie/`. All script paths are under `skills/proving-it-works-with-a-movie/`. + +**Interfaces:** Preserve manifest fields `id`, `text`, `wav`, `duration`, `synthesis`. Normalize scene text for identity using `" ".join(text.split())`, without dropping Unicode or punctuation. Resolve each manifest WAV relative to the narration directory. Transcript comparison is a separate, tolerant operation. Existing movie scenes retain their own source audio and omit narration offsets. + +- [ ] Add failing tests before code: accepted two-scene render, forced rejection of first scene, exception in second, normal retry never reuses rejected bytes; strict unavailable verification withdraws acceptance; unchanged accepted settings still cache. Inject failures in synthesis and duration and assert published entries cannot point at rejected replacements. Preserve failed bytes as evidence. +- [ ] Publish manifest atomically (`temporary.write_text(..., encoding="utf-8"); temporary.replace(manifest_path)`) and withdraw acceptance before overwriting any referenced WAV. Publish each accepted scene only after transcript/ASR gates and duration succeed. Preserve the existing bounded attempts and no-narration CLI behavior. Do not silently create a fallback acceptance record. +- [ ] Add unsupported-comparison tests for unrelated Chinese/Japanese (including short and mixed-script text), symbols-only scripts, multiline text, accented Latin, and spaced Cyrillic. Use Unicode casefold/normalization and whitespace-preserving tokenization. Explicitly detect scripts requiring segmentation; do not infer support from average word length or introduce CJK character thresholds. Unsupported comparisons report unavailable/nonzero under `--drift-check` and `--verify on`; `auto` warns/allows unavailable ASR, `off` bypasses ASR. The mandatory chat transcript gate never accepts unsupported comparison. Preserve supported-word thresholds and empty/missing speech rejection. +- [ ] Preflight required ffprobe before synthesis, with a meaningful missing-tool test. Keep existing mocked tests portable by mocking this boundary. +- [ ] Add safe assembly tests: removed narration ignores leftover WAV and creates no offset; required narration with missing manifest/entry/WAV or changed text fails before encoding; accepted referenced WAV is selected even when named differently; movie scenes retain own audio and no narration offset. Validate all narration requirements before encoding the first segment. Update existing media fixture declarations/manifests to reflect the contract without running those media suites. +- [ ] Correct movie segment inputs: probe audio-stream presence, supply anullsrc only for silent source movies, explicitly map selected source video/audio, and fit both width and requested inner height before padding. Test input selection and computed geometry with mocked probes/encoder, including 2560x1080 into 1920x1080. No real encoding. +- [ ] Correct percent-bearing sequence paths in assembly and checker: escape only literal directory percent signs (or use controlled cwd plus fixed basename), retaining the intended `%08d`/numbering placeholder. Test the path helper/selected input-output target with byte sentinels; never sample media. +- [ ] Run safe narration and new assembly/path contract tests; retain existing cache/drift regressions. Self-review and commit. + +### Task 2: Keep every subtitle inside its scene and select the supplied track + +**Files:** `skills/proving-it-works-with-a-movie/scripts/make-subtitles`, `scripts/burn-subtitles`; `tests/proving-it-works-with-a-movie/test_subtitles.py` or a separate safe subtitle contract module. + +**Interfaces:** Manifest schema stays unchanged. Assembly offsets select membership and start times; manual offsets retime selected scenes without reintroducing omitted scenes. Task 1 makes assembly offsets refer only to accepted narration. + +- [ ] Add failing timing tests by parsing emitted SRT: five chunks in 0.5 seconds followed immediately by another scene; one chunk in 12 seconds; mixed-length chunks; submillisecond/invalid duration handling; empty cut; nonzero manual offsets. Assert every word survives, ordered positive millisecond cue intervals stay within the measured scene, the final cue covers the narration end within rounding, and reported end agrees with emitted cues. +- [ ] Allocate proportional durations over the entire scene. Readability limits can guide splitting/allocation but cannot overflow or truncate the measured interval. Coalesce chunks if there are fewer representable milliseconds than chunks; reject unrepresentable/nonpositive durations clearly rather than emit invalid cues. Remove the serialization fallback that extends collapsed cues by one second. +- [ ] Preserve assembly membership selection and partial manual offsets. Validate offsets keys that have no manifest entry with a named nonzero error; do not reject manifest entries omitted from the assembled cut. Add a failing mismatch regression before this change. +- [ ] Add safe replacement-track tests for explicit soft mode and hard-burn fallback by inspecting selected stream maps, including an input already containing subtitles and a video without audio. Explicitly select `0:v:0`, optional source audio, and `1:s:0` from the supplied SRT. Preserve truthful fallback diagnostics. +- [ ] Run only safe subtitle classes (existing offset/path tests and BOM/fallback cases plus new contract tests). Self-review and commit. + +### Task 3: Own recorder resources from acquisition through shutdown + +**Files:** `skills/proving-it-works-with-a-movie/examples/film-terminal.py`, `tests/proving-it-works-with-a-movie/test_terminal.py` or a separate safe recorder contract module. + +**Interfaces:** Preserve `serve/run/key/watch/close`, prompt markers, session files, exit 1 on failure and exit 2 only for a live unfinished command, 5 fps timing, and 1600x900 viewport. Preserve logs; only remove the recorder's own profile and readiness state. + +- [ ] Add startup-failure tests with fake Popen handles and no processes: first/second log open, ttyd launch, browser launch, session metadata write, terminal log open, later connection failure. Verify each acquired process is cleaned, handles close, failed startup cannot remain ready, and profile cleanup is owned. Register resources immediately under an encompassing try/finally (or ExitStack); no general process framework. +- [ ] Resolve session directory before child arguments, cwd, and profile construction. Test a relative path against the actual child argv/cwd relationship using fake processes. +- [ ] Retire PID metadata after serve cleanup and remove stale ready state; test repeated close after cleanup kills nothing and retains logs. Make profile-removal failure truthful. Avoid creating a new cross-platform PID-identity protocol. +- [ ] Add no-record observation tests for connection/session loss using fake CDP and log text. Poll connection/liveness while waiting; a dead session is failure, never `running`. A live timed-out command still returns 2. Do not consume prompt status incorrectly or lose completed native exit status. +- [ ] Test timing using a fake clock, capture callback returning byte tokens, and mocked writes: a final capture crossing a one-second endpoint must fill exactly the bounded 5 fps slots; also cover hold endpoint, normal completion and mid-capture stalls. No real image/frame inspection or integration tests. +- [ ] Fix ST-terminated OSC stripping and test both BEL/ST markers in actual visible-text parsing. Emit ASCII-escaped stdout JSON (or explicit UTF-8) and test a CP1252 stream with René and λ; keep UTF-8 JSON files. +- [ ] Register real-session test cleanup immediately after Popen so failed setUp cannot leak it; do not run SessionTests in this pass. Run safe prompt, serve-argument, and new recorder contract tests; self-review and commit. + +### Task 4: Make shipped recipes preserve failures and measured timing + +**Files:** `skills/proving-it-works-with-a-movie/SKILL.md`, `assembling.md`, `rendering-from-a-log.md`, `recording-motion.md`, `recording-a-terminal.md`, `narrating.md`; focused documentation test evidence under ignored review/SDD directories. + +**Interfaces:** Documentation describes Tasks 1-3's existing formats and corrected behavior. Existing evidence standards and Windows shell recipes remain intact. This is a focused reference correction, not a broad skill-policy rewrite. + +- [ ] Use writing-skills. Preserve the before-change fresh-reader reference trial and execute the original recipes with fake producer commands and log fixtures to record failures. No real media or OS recording. +- [ ] Put `set -euo pipefail` in the primary Unix pipeline's executing Bash scope, retaining all five commands and offsets. In the assembling subtitle example pass `--offsets-json segments/offsets.json` and stop if subtitle production fails. Explain current scene plus accepted manifest, relative WAV reference, and movie own-audio behavior in one paragraph. +- [ ] Put the producer-to-tee logging pipeline under the shell that owns pipefail, preserving the real producer exit status and printed STARTED/FINISHED/EXIT_STATUS markers. Execute the recipe with failing and passing fake producers; assert shell status and log content without matching a large rendered command. +- [ ] Restore the cursor transform on mouseup. Execute the documented JavaScript with a minimal fake DOM/event dispatcher and assert repeated press/release state changes; no browser or pixels. +- [ ] State that session directories, like take directories, must be new or empty on retries. Document unsupported transcript verification and existing retry behavior accurately without adding a user approval gate. +- [ ] Fresh-reader candidate trials use the same bounded scenarios as baseline, then execute supplied commands with fake boundaries. Preserve both failures and successes; do not call this full skill evaluation. Self-review and commit documentation plus concise results in this plan. + +## Final verification and review + +Run the safe accumulated contract selection once after all code changes. Have an independent reviewer read the full accumulated PR from `fd02874aa5c55ba3c2bca431253b48e0e4c8be5a` through the final head, including docs/spec and tests, and resolve concrete remaining findings. Push only to Ada's `import/proving-it-works-skill` branch after passing review, verify #2214's remote head, and reply to the four current external threads with exact evidence. Do not merge. Drew's viewing remains final acceptance. -- cgit From b206e0cbe1aaf4b37b6c34e44ecf00cb23466840 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Fri, 11 Sep 2026 20:16:33 -0700 Subject: docs: make proof-movie recipes preserve failures Repair the shipped Unix, logging, subtitle, cursor, narration, and recorder guidance against the literal fake-boundary failures recorded for Task 4. The primary pipeline and subtitle recipe now fail fast, measured offsets reach subtitle generation, producer logging preserves the real status under the pipefail owner, and cursor mouseup restores the released state. Document the accepted narration/cache contract, cooperative recorder cleanup limits, and the safe contracts-suite entrypoint without changing Windows recipes or the existing evidence and human-viewing gates. Include the controller-owned plan bookkeeping and record the executable RED/GREEN results while leaving independent fresh-reader trials pending. Prompt: implement Task 4 focused executable movie-guide corrections after Tasks 1-3, using writing-skills and only fake producers, text fixtures, and fake DOM execution. Verification: python3 .superpowers/review/pr2214/committee/recipe-probes.py; uv run --script tests/proving-it-works-with-a-movie/run-tests.py --suite contracts; git diff --check. --- .../plans/2026-09-11-movie-committee-repairs.md | 69 +++++++++++++--------- 1 file changed, 42 insertions(+), 27 deletions(-) (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md b/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md index fd85698..1b66818 100644 --- a/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md +++ b/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md @@ -27,26 +27,29 @@ **Interfaces:** Preserve manifest fields `id`, `text`, `wav`, `duration`, `synthesis`. Normalize scene text for identity using `" ".join(text.split())`, without dropping Unicode or punctuation. Resolve each manifest WAV relative to the narration directory. Transcript comparison is a separate, tolerant operation. Existing movie scenes retain their own source audio and omit narration offsets. -- [ ] Add failing tests before code: accepted two-scene render, forced rejection of first scene, exception in second, normal retry never reuses rejected bytes; strict unavailable verification withdraws acceptance; unchanged accepted settings still cache. Inject failures in synthesis and duration and assert published entries cannot point at rejected replacements. Preserve failed bytes as evidence. -- [ ] Publish manifest atomically (`temporary.write_text(..., encoding="utf-8"); temporary.replace(manifest_path)`) and withdraw acceptance before overwriting any referenced WAV. Publish each accepted scene only after transcript/ASR gates and duration succeed. Preserve the existing bounded attempts and no-narration CLI behavior. Do not silently create a fallback acceptance record. -- [ ] Add unsupported-comparison tests for unrelated Chinese/Japanese (including short and mixed-script text), symbols-only scripts, multiline text, accented Latin, and spaced Cyrillic. Use Unicode casefold/normalization and whitespace-preserving tokenization. Explicitly detect scripts requiring segmentation; do not infer support from average word length or introduce CJK character thresholds. Unsupported comparisons report unavailable/nonzero under `--drift-check` and `--verify on`; `auto` warns/allows unavailable ASR, `off` bypasses ASR. The mandatory chat transcript gate never accepts unsupported comparison. Preserve supported-word thresholds and empty/missing speech rejection. -- [ ] Preflight required ffprobe before synthesis, with a meaningful missing-tool test. Keep existing mocked tests portable by mocking this boundary. -- [ ] Add safe assembly tests: removed narration ignores leftover WAV and creates no offset; required narration with missing manifest/entry/WAV or changed text fails before encoding; accepted referenced WAV is selected even when named differently; movie scenes retain own audio and no narration offset. Validate all narration requirements before encoding the first segment. Update existing media fixture declarations/manifests to reflect the contract without running those media suites. -- [ ] Correct movie segment inputs: probe audio-stream presence, supply anullsrc only for silent source movies, explicitly map selected source video/audio, and fit both width and requested inner height before padding. Test input selection and computed geometry with mocked probes/encoder, including 2560x1080 into 1920x1080. No real encoding. -- [ ] Correct percent-bearing sequence paths in assembly and checker: escape only literal directory percent signs (or use controlled cwd plus fixed basename), retaining the intended `%08d`/numbering placeholder. Test the path helper/selected input-output target with byte sentinels; never sample media. -- [ ] Run safe narration and new assembly/path contract tests; retain existing cache/drift regressions. Self-review and commit. +- [x] Add failing tests before code: accepted two-scene render, forced rejection of first scene, exception in second, normal retry never reuses rejected bytes; strict unavailable verification withdraws acceptance; unchanged accepted settings still cache. Inject failures in synthesis and duration and assert published entries cannot point at rejected replacements. Preserve failed bytes as evidence. +- [x] Publish manifest atomically (`temporary.write_text(..., encoding="utf-8"); temporary.replace(manifest_path)`) and withdraw acceptance before overwriting any referenced WAV. Publish each accepted scene only after transcript/ASR gates and duration succeed. Preserve the existing bounded attempts and no-narration CLI behavior. Do not silently create a fallback acceptance record. +- [x] Add unsupported-comparison tests for unrelated Chinese/Japanese (including short and mixed-script text), symbols-only scripts, multiline text, accented Latin, and spaced Cyrillic. Use Unicode casefold/normalization and whitespace-preserving tokenization. Explicitly detect scripts requiring segmentation; do not infer support from average word length or introduce CJK character thresholds. Unsupported comparisons report unavailable/nonzero under `--drift-check` and `--verify on`; `auto` warns/allows unavailable ASR, `off` bypasses ASR. The mandatory chat transcript gate never accepts unsupported comparison, including existing cached chat clips under off/auto. Preserve supported-word thresholds and empty/missing speech rejection. +- [x] Preflight required ffprobe before synthesis, with a meaningful missing-tool test. Keep existing mocked tests portable by mocking this boundary. +- [x] Add safe assembly tests: removed narration ignores leftover WAV and creates no offset; required narration with missing manifest/entry/WAV or changed text fails before encoding; accepted referenced WAV is selected even when named differently; movie scenes retain own audio and no narration offset. Validate all narration requirements before encoding the first segment. Update existing media fixture declarations/manifests to reflect the contract without running those media suites. +- [x] Correct movie segment inputs: probe audio-stream presence, supply anullsrc only for silent source movies, explicitly map selected source video/audio, and fit both width and requested inner height before padding. Test input selection and computed geometry with mocked probes/encoder, including 2560x1080 into 1920x1080. No real encoding. +- [x] Correct percent-bearing sequence paths in assembly and checker: escape only literal directory percent signs (or use controlled cwd plus fixed basename), retaining the intended `%08d`/numbering placeholder. Test the path helper/selected input-output target with byte sentinels; never sample media. +- [x] Run safe narration and new assembly/path contract tests; retain existing cache/drift regressions. Self-review and commit. ### Task 2: Keep every subtitle inside its scene and select the supplied track -**Files:** `skills/proving-it-works-with-a-movie/scripts/make-subtitles`, `scripts/burn-subtitles`; `tests/proving-it-works-with-a-movie/test_subtitles.py` or a separate safe subtitle contract module. +**Files:** `skills/proving-it-works-with-a-movie/scripts/make-subtitles`, `scripts/burn-subtitles`, `scripts/check-movie` (SRT text parser only); `tests/proving-it-works-with-a-movie/test_subtitles.py` or a separate safe subtitle contract module, safe checker policy/parser regressions, and `run-tests.py`. **Interfaces:** Manifest schema stays unchanged. Assembly offsets select membership and start times; manual offsets retime selected scenes without reintroducing omitted scenes. Task 1 makes assembly offsets refer only to accepted narration. -- [ ] Add failing timing tests by parsing emitted SRT: five chunks in 0.5 seconds followed immediately by another scene; one chunk in 12 seconds; mixed-length chunks; submillisecond/invalid duration handling; empty cut; nonzero manual offsets. Assert every word survives, ordered positive millisecond cue intervals stay within the measured scene, the final cue covers the narration end within rounding, and reported end agrees with emitted cues. -- [ ] Allocate proportional durations over the entire scene. Readability limits can guide splitting/allocation but cannot overflow or truncate the measured interval. Coalesce chunks if there are fewer representable milliseconds than chunks; reject unrepresentable/nonpositive durations clearly rather than emit invalid cues. Remove the serialization fallback that extends collapsed cues by one second. -- [ ] Preserve assembly membership selection and partial manual offsets. Validate offsets keys that have no manifest entry with a named nonzero error; do not reject manifest entries omitted from the assembled cut. Add a failing mismatch regression before this change. -- [ ] Add safe replacement-track tests for explicit soft mode and hard-burn fallback by inspecting selected stream maps, including an input already containing subtitles and a video without audio. Explicitly select `0:v:0`, optional source audio, and `1:s:0` from the supplied SRT. Preserve truthful fallback diagnostics. -- [ ] Run only safe subtitle classes (existing offset/path tests and BOM/fallback cases plus new contract tests). Self-review and commit. +- [x] Add failing timing tests by parsing emitted SRT: five chunks in 0.5 seconds followed immediately by another scene; one chunk in 12 seconds; mixed-length chunks; submillisecond/invalid duration handling; empty cut; nonzero manual offsets. Assert every word survives, ordered positive millisecond cue intervals stay within the measured scene, the final cue covers the narration end within rounding, and reported end agrees with emitted cues. +- [x] Allocate proportional durations over the entire scene. Readability limits can guide splitting/allocation but cannot overflow or truncate the measured interval. Coalesce chunks if there are fewer representable milliseconds than chunks; reject unrepresentable/nonpositive durations clearly rather than emit invalid cues. Remove the serialization fallback that extends collapsed cues by one second. +- [x] Preserve assembly membership selection as the manifest/offset intersection, including unknown offset keys producing no cues, and partial manual offsets. Enforce accepted membership in Task 1's assembly handoff tests rather than changing this existing subtitle CLI contract. +- [x] Add one safe producer/consumer regression that invokes narrate, assemble, and make-subtitles sequentially using their real files and mocked synthesis/probing/encoding. Remove an opening scene's narration on rerun: its old WAV survives as evidence, assembly omits that audio/offset, and the remaining scene's caption starts at its measured assembly offset. Assert emitted manifest/offset/SRT data and chosen inputs, not full commands. +- [x] Add safe replacement-track tests for explicit soft mode and hard-burn fallback by inspecting selected stream maps, including an input already containing subtitles and a video without audio. Explicitly select `0:v:0`, optional source audio, and `1:s:0` from the supplied SRT. Preserve truthful fallback diagnostics. +- [x] Repair `subtitle_end` to read cue timing lines rather than any caption text containing an arrow. Root reproduced a valid cue with `Follow source --> destination.` raising ValueError. Add text-only parser tests for literal arrows, fake timestamps in caption text, actual malformed cue timing, empty subtitles, and multiple cues; keep the checker's existing last-cue policy unchanged. +- [x] Register a `contracts` test-runner suite for `test_*contract*.py`, so the new safe regression files run through the normal entrypoint and are included in `all`. Keep only mocked/text-based tests in those modules. Verify by executing `--suite contracts`, never `--suite all` in this pass. +- [x] Run only safe subtitle classes (existing offset/path tests and BOM/fallback cases plus new contract tests). Self-review and commit. ### Task 3: Own recorder resources from acquisition through shutdown @@ -54,27 +57,39 @@ **Interfaces:** Preserve `serve/run/key/watch/close`, prompt markers, session files, exit 1 on failure and exit 2 only for a live unfinished command, 5 fps timing, and 1600x900 viewport. Preserve logs; only remove the recorder's own profile and readiness state. -- [ ] Add startup-failure tests with fake Popen handles and no processes: first/second log open, ttyd launch, browser launch, session metadata write, terminal log open, later connection failure. Verify each acquired process is cleaned, handles close, failed startup cannot remain ready, and profile cleanup is owned. Register resources immediately under an encompassing try/finally (or ExitStack); no general process framework. -- [ ] Resolve session directory before child arguments, cwd, and profile construction. Test a relative path against the actual child argv/cwd relationship using fake processes. -- [ ] Retire PID metadata after serve cleanup and remove stale ready state; test repeated close after cleanup kills nothing and retains logs. Make profile-removal failure truthful. Avoid creating a new cross-platform PID-identity protocol. -- [ ] Add no-record observation tests for connection/session loss using fake CDP and log text. Poll connection/liveness while waiting; a dead session is failure, never `running`. A live timed-out command still returns 2. Do not consume prompt status incorrectly or lose completed native exit status. -- [ ] Test timing using a fake clock, capture callback returning byte tokens, and mocked writes: a final capture crossing a one-second endpoint must fill exactly the bounded 5 fps slots; also cover hold endpoint, normal completion and mid-capture stalls. No real image/frame inspection or integration tests. -- [ ] Fix ST-terminated OSC stripping and test both BEL/ST markers in actual visible-text parsing. Emit ASCII-escaped stdout JSON (or explicit UTF-8) and test a CP1252 stream with René and λ; keep UTF-8 JSON files. -- [ ] Register real-session test cleanup immediately after Popen so failed setUp cannot leak it; do not run SessionTests in this pass. Run safe prompt, serve-argument, and new recorder contract tests; self-review and commit. +- [x] Add startup-failure tests with fake Popen handles and no processes: first/second log open, ttyd launch, browser launch, session metadata write, terminal log open, later connection failure. Verify each acquired process is cleaned, handles close, failed startup cannot remain ready, and profile cleanup is owned. Register resources immediately under an encompassing try/finally (or ExitStack); no general process framework. +- [x] Resolve session directory before child arguments, cwd, and profile construction. Test a relative path against the actual child argv/cwd relationship using fake processes. +- [x] Make serve the cleanup owner: close writes the existing stop request and waits with one overall 30-second deadline for completed cleanup, instead of killing historical numeric PIDs. Honor stop requests inside startup pump/retry loops too. Retire PID metadata atomically only after confirmed process and profile cleanup and remove stale ready state; test repeated close after cleanup kills nothing and retains logs. A wait timeout, unreadable/missing metadata, unavailable serve, or failed profile removal is not successful cleanup and returns nonzero. The deadline accommodates an active bounded CDP call, both five-second child waits, and profile release. Avoid creating a new cross-platform PID-identity protocol. +- [x] Add no-record observation tests for connection/session loss using fake CDP and log text. Poll connection/liveness while waiting; a dead session is failure, never `running`. A live timed-out command still returns 2. Do not consume prompt status incorrectly or lose completed native exit status. +- [x] Test timing using a fake clock, capture callback returning byte tokens, and mocked writes: a final capture crossing a one-second endpoint must fill exactly the bounded 5 fps slots; also cover hold endpoint, normal completion and mid-capture stalls. No real image/frame inspection or integration tests. +- [x] Fix ST-terminated OSC stripping and test both BEL/ST markers in actual visible-text parsing. Emit ASCII-escaped stdout JSON (or explicit UTF-8) and test a CP1252 stream with René and λ; keep UTF-8 JSON files. +- [x] Register real-session test cleanup immediately after Popen so failed setUp cannot leak it; do not run SessionTests in this pass. Retain the tests' real owned-process assertions when shutdown clears PID metadata: snapshot owned IDs for assertions while the session is live rather than iterating an empty completed list. Run safe prompt, serve-argument, and new recorder contract tests; self-review and commit. ### Task 4: Make shipped recipes preserve failures and measured timing -**Files:** `skills/proving-it-works-with-a-movie/SKILL.md`, `assembling.md`, `rendering-from-a-log.md`, `recording-motion.md`, `recording-a-terminal.md`, `narrating.md`; focused documentation test evidence under ignored review/SDD directories. +**Files:** `skills/proving-it-works-with-a-movie/SKILL.md`, `assembling.md`, `rendering-from-a-log.md`, `recording-motion.md`, `recording-a-terminal.md`, `narrating.md`, `tests/proving-it-works-with-a-movie/README.md`; focused documentation test evidence under ignored review/SDD directories. **Interfaces:** Documentation describes Tasks 1-3's existing formats and corrected behavior. Existing evidence standards and Windows shell recipes remain intact. This is a focused reference correction, not a broad skill-policy rewrite. -- [ ] Use writing-skills. Preserve the before-change fresh-reader reference trial and execute the original recipes with fake producer commands and log fixtures to record failures. No real media or OS recording. -- [ ] Put `set -euo pipefail` in the primary Unix pipeline's executing Bash scope, retaining all five commands and offsets. In the assembling subtitle example pass `--offsets-json segments/offsets.json` and stop if subtitle production fails. Explain current scene plus accepted manifest, relative WAV reference, and movie own-audio behavior in one paragraph. -- [ ] Put the producer-to-tee logging pipeline under the shell that owns pipefail, preserving the real producer exit status and printed STARTED/FINISHED/EXIT_STATUS markers. Execute the recipe with failing and passing fake producers; assert shell status and log content without matching a large rendered command. -- [ ] Restore the cursor transform on mouseup. Execute the documented JavaScript with a minimal fake DOM/event dispatcher and assert repeated press/release state changes; no browser or pixels. -- [ ] State that session directories, like take directories, must be new or empty on retries. Document unsupported transcript verification and existing retry behavior accurately without adding a user approval gate. +- [x] Use writing-skills. Preserve the before-change fresh-reader reference trial and execute the original recipes with fake producer commands and log fixtures to record failures. No real media or OS recording. +- [x] Put `set -euo pipefail` in the primary Unix pipeline's executing Bash scope, retaining all five commands and offsets. In the assembling subtitle example pass `--offsets-json segments/offsets.json` and stop if subtitle production fails. Explain current scene plus accepted manifest, relative WAV reference, and movie own-audio behavior in one paragraph. +- [x] Put the producer-to-tee logging pipeline under the shell that owns pipefail, preserving the real producer exit status and printed STARTED/FINISHED/EXIT_STATUS markers. Execute the recipe with failing and passing fake producers; assert shell status and log content without matching a large rendered command. +- [x] Restore the cursor transform on mouseup. Execute the documented JavaScript with a minimal fake DOM/event dispatcher and assert repeated press/release state changes; no browser or pixels. +- [x] State that session directories, like take directories, must be new or empty on retries. Explain that close requests cleanup from serve, waits up to 30 seconds, and reports failure when the owner is unavailable or cleanup fails; hard-killing serve can leave its children and stale readiness, so these signals cannot establish a live owner. Document unsupported transcript verification and existing retry behavior accurately without adding a user approval gate. +- [x] Document the new `--suite contracts` entrypoint as safe mocked/text checks, distinct from existing media/session suites and live acceptance. - [ ] Fresh-reader candidate trials use the same bounded scenarios as baseline, then execute supplied commands with fake boundaries. Preserve both failures and successes; do not call this full skill evaluation. Self-review and commit documentation plus concise results in this plan. +Task 4 executable snippet result: the preserved baseline returned success after +an assembly failure and a failed logged producer, emitted subtitles at zero +instead of the measured two-second offset, and left the cursor pressed after +mouseup. After the focused guide edits, the fake-boundary harness preserves +assembly exit 41 and logger exit 23, stops later producers, retains prior +outputs, runs all five stages on success, emits the subtitle interval at +`00:00:02,000`, and restores the cursor on two releases. The safe `contracts` +entrypoint passes 66 tests. Independent fresh-reader candidate trials remain +pending after the documentation commit; these snippet checks are not full skill +evaluation or live movie acceptance. + ## Final verification and review Run the safe accumulated contract selection once after all code changes. Have an independent reviewer read the full accumulated PR from `fd02874aa5c55ba3c2bca431253b48e0e4c8be5a` through the final head, including docs/spec and tests, and resolve concrete remaining findings. Push only to Ada's `import/proving-it-works-skill` branch after passing review, verify #2214's remote head, and reply to the four current external threads with exact evidence. Do not merge. Drew's viewing remains final acceptance. -- cgit From 90ff8ef95521280e23b74dfe48be43cd077000a5 Mon Sep 17 00:00:00 2001 From: Drew Ritter Date: Fri, 11 Sep 2026 20:21:22 -0700 Subject: docs: record consolidated movie repair verification Complete the four-task repair plan after independent reviews and two fresh-reader reference trials. Record 66 current contract tests and 45 existing safe regressions, executable recipe failures and repairs, and the limits of those checks. Drew requested a committee and full local review after repeated PR feedback. Preserve the negative evidence, distinguish historical native runs from current mocked/text checks, and retain Drew's video viewing as final acceptance. The whole accumulated PR review and authorized existing-branch update remain the next steps; no merge is performed. --- .../plans/2026-09-11-movie-committee-repairs.md | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md b/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md index 1b66818..f284001 100644 --- a/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md +++ b/docs/superpowers/plans/2026-09-11-movie-committee-repairs.md @@ -77,7 +77,7 @@ - [x] Restore the cursor transform on mouseup. Execute the documented JavaScript with a minimal fake DOM/event dispatcher and assert repeated press/release state changes; no browser or pixels. - [x] State that session directories, like take directories, must be new or empty on retries. Explain that close requests cleanup from serve, waits up to 30 seconds, and reports failure when the owner is unavailable or cleanup fails; hard-killing serve can leave its children and stale readiness, so these signals cannot establish a live owner. Document unsupported transcript verification and existing retry behavior accurately without adding a user approval gate. - [x] Document the new `--suite contracts` entrypoint as safe mocked/text checks, distinct from existing media/session suites and live acceptance. -- [ ] Fresh-reader candidate trials use the same bounded scenarios as baseline, then execute supplied commands with fake boundaries. Preserve both failures and successes; do not call this full skill evaluation. Self-review and commit documentation plus concise results in this plan. +- [x] Fresh-reader candidate trials use the same bounded scenarios as baseline, then execute supplied commands with fake boundaries. Preserve both failures and successes; do not call this full skill evaluation. Self-review and commit documentation plus concise results in this plan. Task 4 executable snippet result: the preserved baseline returned success after an assembly failure and a failed logged producer, emitted subtitles at zero @@ -86,10 +86,20 @@ mouseup. After the focused guide edits, the fake-boundary harness preserves assembly exit 41 and logger exit 23, stops later producers, retains prior outputs, runs all five stages on success, emits the subtitle interval at `00:00:02,000`, and restores the cursor on two releases. The safe `contracts` -entrypoint passes 66 tests. Independent fresh-reader candidate trials remain -pending after the documentation commit; these snippet checks are not full skill -evaluation or live movie acceptance. +entrypoint passes 66 tests. Two independent fresh-reader candidate trials also +passed the bounded command checks recorded below; these checks are not full +skill evaluation or live movie acceptance. ## Final verification and review Run the safe accumulated contract selection once after all code changes. Have an independent reviewer read the full accumulated PR from `fd02874aa5c55ba3c2bca431253b48e0e4c8be5a` through the final head, including docs/spec and tests, and resolve concrete remaining findings. Push only to Ada's `import/proving-it-works-skill` branch after passing review, verify #2214's remote head, and reply to the four current external threads with exact evidence. Do not merge. Drew's viewing remains final acceptance. + +## Consolidated verification results + +- Narration/assembly, subtitle, recorder, and guide tasks each passed independent spec and quality review after their recorded fix rounds. +- At `b206e0cb`, the normal `--suite contracts` entrypoint passed 66 mocked/text tests and the selected existing portable regressions passed 45 tests: 111 safe tests total. No media/session suites ran. +- Executing the original guide snippets with fake producers reproduced lost failure statuses, missing measured subtitle offsets, continued burning after subtitle failure, and a cursor that stayed pressed. The corrected snippets passed failure and success cases while preserving prior output evidence. +- Two independent fresh readers used the candidate guides. Their supplied Bash commands passed the bounded failed-rebuild, producer-status, evidence-preservation, and measured-caption-offset checks with fake tool boundaries. These are focused reference trials, not a full skill evaluation or native workflow acceptance. +- The before-change fresh reader independently supplied fail-fast/offset corrections but also deleted prior outputs. No before/after agent success-rate improvement is claimed. +- Logs, rejected-attempt evidence, reports, and review packages remain in the worktree's ignored review/SDD directories. The parent checkout remains untouched. +- Final whole-PR review and normal push to the existing Ada-fork PR head follow these results. Drew's viewing remains the final acceptance decision; this pass does not merge the PR. -- cgit