Skip to content

Agent-first rework: staged toolchain, workflows + skills, hyperframes runtime, audio engine - #23

Draft
ennsharma wants to merge 19 commits into
mainfrom
ennsharma/showrunner-v2
Draft

Agent-first rework: staged toolchain, workflows + skills, hyperframes runtime, audio engine#23
ennsharma wants to merge 19 commits into
mainfrom
ennsharma/showrunner-v2

Conversation

@ennsharma

Copy link
Copy Markdown
Contributor

What this is

Inverts showrunner's control surface: the coding agent is now the director, and showrunner is the studio it drives. The fixed embedded pipeline is decomposed into staged, gated CLI commands; workflows are declarative contracts; craft knowledge ships as repo skills. The agent authors the storyboard and the visuals itself — no embedded LLM calls anywhere in the new path.

Phase 1 — inversion

  • Projects, not tempdirs: showrunner new scaffolds a persistent project (showrunner.json manifest, runtime scaffold).
  • Staged CLI: storyboard validatetts (measured narration durations, stretch-back) → scene validate (design-system lint + tsc) → compose (timeline + music bed + ducking) → checkrender.
  • showrunner check: manifest-driven quality gate. Each workflow stage names its check; the report fingerprints gated artifacts and render refuses missing/failed/stale checks (--force to bypass).
  • Workflow contracts: src/showrunner/workflows/<name>/manifest.yaml (stages, artifacts, checks, numeric constraints) — machine-read, not prose.
  • Agent surface: AGENTS.md (Rule Zero), skills/INDEX.md router, explainer workflow run book, storyboard + scene-code craft skills extracted from the production prompts. A surface test pins skills to real CLI commands.
  • Shared provider factory; legacy create/refine unchanged and green.

Phase 2 — second runtime + audio

  • hyperframes runtime (pinned CLI version): contract-valid skeleton at scaffold, render/preview dispatch, and the runtime's own check --json mapped into showrunner check findings.
  • kinetic-typography workflow + html-composition craft skill (timing contract, determinism rules).
  • carousel-reel workflow: beat-synced image reels; new music check verifies the track, the analyzed beat grid, and that every clip start sits on a beat within one frame.
  • showrunner music analyze: BPM + beat grid (librosa when installed, numpy comb-scoring fallback with octave correction); new [audio] extra.
  • showrunner audio master: ffmpeg loudnorm to -14 LUFS / -1.5 dBTP, video stream copied untouched.
  • Audio + voiceover craft skills.

Verification

  • 262 tests passing (89 new), ruff clean repo-wide.
  • Smoke-tested the real CLI: workflows, new on both runtimes, storyboard validate on a kinetic project.
  • All providers/subprocesses mocked in tests; no network/npm/ffmpeg in CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RLwStc1sMxYtjo77Qg6jww

showrunner.json carries a project's workflow/runtime/style/canvas;
workflow manifest.yaml (package data) declares stages, produced
artifacts, named checks, and numeric constraints.
Projects replace throwaway work dirs: showrunner.json + the runtime
scaffold (remotion template, preset tokens, asset dirs). --no-install
skips npm for offline/test use.
Pure validator returning findings (errors + warnings) driven by the
workflow spec's constraints; storyboard validate exposes it with
--json output and a nonzero exit on errors.
Provider construction moves to providers/factory.py (Pipeline
delegates). tts synthesizes per-scene narration into the project,
records measured durations in narration.json, persists stretched
scene durations back to storyboard.json, and skips silent scenes.
Music picking (music/selection.py) and work-dir staging with the
ducking envelope (music_staging.py) are now callable outside the
Pipeline; compose generates Root.tsx from storyboard + measured
narration durations.
Runs every check the workflow's stages declare (storyboard rules,
narration coverage, scene lint + whole-project tsc, compose
freshness) and writes check.json with a content fingerprint of the
gated artifacts.
render refuses without a fresh passing check.json (content
fingerprint must match); --force bypasses. preview dispatches to the
project's runtime.
Rule Zero routing (AGENTS.md), a compact skills index, the explainer
workflow run book, and storyboard/scene-code craft skills extracted
from the production rules. A surface test keeps the index complete
and pins skill-referenced CLI commands to real ones.
Single-file HTML compositions rendered/gated through the pinned
hyperframes CLI: contract-valid skeleton at scaffold, render/preview
dispatch, and the runtime's own check --json mapped into
showrunner check findings.
Type-driven pieces: storyboard as beat contract, optional narration,
directly-authored index.html gated by the runtime check. Adds the
html-composition craft skill (timing contract + determinism rules).
librosa when installed, else a numpy comb-scoring estimator
(fractional beat grids, ±1-frame tolerance, octave correction).
Powers beat-synced clip timing; new [audio] extra.
Image reels cut to a music bed: music.json (track + analyzed beat
grid) is a gated stage, and the check verifies every clip's
data-start sits on a beat within one frame.
ffmpeg loudnorm wrapper (default -14 LUFS / -1.5 dBTP); copies the
video stream untouched when mastering a rendered mp4.
README and CLAUDE.md now document the staged, gated, agent-driven
flow as the primary interface (legacy one-shot mode retained).
Repo-wide lint cleanup of stale imports/vars.
The real check --json nests findings under sections (lint.findings[]
with severity/code/fixHint), not top-level errors[]. Surface error
findings with their fix hints; warnings stay advisory. Found
producing a real carousel reel.
Conditions (agent command × toolchain access) run headless on an
identical brief in isolated workspaces; the harness stages the
toolchain, strips it from bare conditions' PATH, collects
out/final.mp4 + cost/turns, and builds a side-by-side report.html
with a quality-rubric scorecard + results.json.
An inherited ANTHROPIC_API_KEY silently overrides the machine's
subscription login and bills every run at per-token API prices.
Child agents now get it stripped by default; conditions can opt back
in with use_api_key: true.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@ennsharma