From c1378dabf75d96e0f56f8fe24e2d228dcbc88495 Mon Sep 17 00:00:00 2001 From: Dan Wahlin Date: Mon, 2 Nov 2026 12:48:51 -0700 Subject: [PATCH] docs(videos): add source for the /workflows demo video Add the reproducible source for the narrated dynamic workflows demo: VHS tapes, capture scripts, the timeline-driven production code, narration script and timing, captions, and the evidence ledger. Recordings, renders, review images, and generated audio stay out of Git; the full production archive is in the video-generation-skills repository. AGENTS.md documents the project's npm scripts. --- AGENTS.md | 7 + videos/workflows/.gitignore | 11 + videos/workflows/README.md | 290 ++++++ .../capture/book-release-check/extension.mjs | 112 ++ videos/workflows/capture/record-console.sh | 17 + .../capture/record-created-workflow.sh | 37 + videos/workflows/capture/record-creation.sh | 15 + videos/workflows/capture/record.sh | 35 + videos/workflows/capture/render.sh | 5 + videos/workflows/capture/setup-env.sh | 39 + .../capture/tapes/console-report.tape | 11 + .../capture/tapes/console-settings.tape | 16 + videos/workflows/capture/tapes/report.tape | 11 + videos/workflows/capture/tapes/settings.tape | 16 + .../capture/tapes/workflow-create.tape | 22 + .../tapes/workflow-created-report.tape | 8 + .../capture/tapes/workflow-created-run.tape | 34 + .../capture/tapes/workflow-demo.tape | 45 + videos/workflows/capture/title.svg | 23 + videos/workflows/narration-captions.srt | 197 ++++ videos/workflows/narration-script.md | 231 +++++ videos/workflows/narration-timing.json | 957 ++++++++++++++++++ videos/workflows/package.json | 18 + videos/workflows/production/build.mjs | 547 ++++++++++ videos/workflows/production/evidence.json | 110 ++ videos/workflows/production/mux.mjs | 42 + videos/workflows/production/narrate.mjs | 319 ++++++ .../production/narration-config.json | 12 + videos/workflows/production/styles.css | 70 ++ videos/workflows/production/timeline.json | 226 +++++ videos/workflows/production/tools.mjs | 7 + videos/workflows/production/verify.mjs | 375 +++++++ videos/workflows/production/visuals.html | 14 + videos/workflows/production/visuals.js | 118 +++ 34 files changed, 3997 insertions(+) create mode 100644 videos/workflows/.gitignore create mode 100644 videos/workflows/README.md create mode 100644 videos/workflows/capture/book-release-check/extension.mjs create mode 100644 videos/workflows/capture/record-console.sh create mode 100644 videos/workflows/capture/record-created-workflow.sh create mode 100644 videos/workflows/capture/record-creation.sh create mode 100644 videos/workflows/capture/record.sh create mode 100644 videos/workflows/capture/render.sh create mode 100644 videos/workflows/capture/setup-env.sh create mode 100644 videos/workflows/capture/tapes/console-report.tape create mode 100644 videos/workflows/capture/tapes/console-settings.tape create mode 100644 videos/workflows/capture/tapes/report.tape create mode 100644 videos/workflows/capture/tapes/settings.tape create mode 100644 videos/workflows/capture/tapes/workflow-create.tape create mode 100644 videos/workflows/capture/tapes/workflow-created-report.tape create mode 100644 videos/workflows/capture/tapes/workflow-created-run.tape create mode 100644 videos/workflows/capture/tapes/workflow-demo.tape create mode 100644 videos/workflows/capture/title.svg create mode 100644 videos/workflows/narration-captions.srt create mode 100644 videos/workflows/narration-script.md create mode 100644 videos/workflows/narration-timing.json create mode 100644 videos/workflows/package.json create mode 100644 videos/workflows/production/build.mjs create mode 100644 videos/workflows/production/evidence.json create mode 100644 videos/workflows/production/mux.mjs create mode 100644 videos/workflows/production/narrate.mjs create mode 100644 videos/workflows/production/narration-config.json create mode 100644 videos/workflows/production/styles.css create mode 100644 videos/workflows/production/timeline.json create mode 100644 videos/workflows/production/tools.mjs create mode 100644 videos/workflows/production/verify.mjs create mode 100644 videos/workflows/production/visuals.html create mode 100644 videos/workflows/production/visuals.js diff --git a/AGENTS.md b/AGENTS.md index 649a9469..754ccd20 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -37,3 +37,10 @@ Beginner-friendly course teaching GitHub Copilot CLI. Educational content, not s ```bash npm install && npm run release ``` + +The standalone video project under `videos/workflows/` has its own package +manifest: `npm run build` renders the silent workflow demo and `npm run verify` +checks its encoding, timing, and closing QR. `npm run narrate` generates cached +timestamped speech, and `npm run finalize` adds it to the picture and verifies +the narrated MP4. See that project's README for +dependency reuse and the recording prerequisites. diff --git a/videos/workflows/.gitignore b/videos/workflows/.gitignore new file mode 100644 index 00000000..0a67e63a --- /dev/null +++ b/videos/workflows/.gitignore @@ -0,0 +1,11 @@ +capture-home.txt +capture.log +capture-exit.txt +preflight.* +assets/ +renders/ +review/ +node_modules/ +console/ +# Copies of capture/tapes made by the recording scripts. +creation/capture/ diff --git a/videos/workflows/README.md b/videos/workflows/README.md new file mode 100644 index 00000000..60f2be64 --- /dev/null +++ b/videos/workflows/README.md @@ -0,0 +1,290 @@ +# Copilot CLI: a useful `/workflows` demo + +A narrated 1920x1080, 30 fps video lasting **2:36.0**, showing a real release-readiness +check on an isolated copy of `samples/book-app-project/`. + +**Current narrated video:** `renders/workflows-demo-narrated-1080p.mp4` + +**Fresh review copy:** `renders/workflows-demo-complete-story-1080p.mp4` + +**Silent picture master:** `renders/workflows-demo-console-1080p.mp4` + +**Audio handoff:** [timed narration script](narration-script.md) and +[machine-readable timing](narration-timing.json). These are editorial speech +windows; the script also lists measured speech boundaries from the generated audio. +The **audio-only listening preview** is +`assets/narration/narration-preview.mp3`. A lossless listening copy, +`narration-preview.wav`, and a **2:36.0 synchronized track**, +`narration-timed.wav`, are alongside it. The listening preview omits the picture's +reading holds. `assets/narration/manifest.json` and the per-cue JSON files retain +the actual ElevenLabs character/word alignment, voice, model, settings, and hashes. + +The edit starts inside an already-open Copilot CLI with experimental features +enabled. It first asks Copilot to create the custom `book-release-check` +workflow from a plain-language request. It shows the actual saved and registered +extension, runs that unchanged workflow, reviews the checks, opens `/workflows`, +resumes a human-review checkpoint, and shows the report produced by the workflow. +Five existing tests and the CLI help check pass. The report identifies test gaps; +passing checks are not a production-readiness guarantee. + +## Where does book-release-check come from? + +`book-release-check` is a custom name chosen for this example, not a built-in +command. The creation recording starts with no workflow extension. The visible +request asks Copilot to write a reusable project extension, run tests and CLI +help, pause for review, ask an agent for two test gaps, and save a report. +Copilot creates `.github/extensions/book-release-check/extension.mjs`, reloads +extensions, and confirms registration without running it. + +The exact generated code is retained in `creation/assets/generated-extension.mjs`. +Its SHA256 before and after the recorded run is identical; the hashes, run ID, +and source paths are in `creation/assets/workflow-origin.json`. The edit then +shows this workflow running, not the previous hand-authored implementation. +Application source files remain unchanged. The earlier prepared extension in +`capture/book-release-check/extension.mjs` is retained for the older run-only recipe. + +The edit uses an animated Mona Sans title with GitHub's green/purple palette, +matching the supplied FinOps video's restrained title/underline/mark treatment. +The title reads **What are Dynamic Workflows?** and the narration asks why to +use them, without an +untested-code tagline. A separate hook reveals "The tests passed" and +"That's a good start, but what's still untested?" word by word using the real +voice alignment, then defines the reusable process. A spoken introduction +leads into the three examples rather than jumping directly into a list. +Three illustrative workflows show the +broader use cases: preparing a release, reviewing a pull request, and +investigating a failed build. These are examples users can define, not built-in +workflows or additional recorded demonstrations. + +The story then selects the book app's release check and shows its four actual +phases: run tests, stop for your review, assess coverage gaps, and save a report. +It explains that this is our custom workflow, then shows how Copilot creates it +from the requested process and saves the steps as reusable code. Creation and +registration do not start a run. The same +question carries through the native console: what passed, and what still needs +testing? The fresh report answers it with corrupted-data recovery and +case-insensitive author-matching +coverage gaps. No release is performed or approved. + +The three opening scenarios are spoken in the same order and wording as their +labels. Each reveal is derived from the actual ElevenLabs word alignment, +starting 80 ms before its phrase and settling 160 ms after it starts. Previous +points dim as the next one is discussed; the demo sentence has its own spoken +anchor. `assets/production/purpose-sync.json` records the measured anchors. +The selected scenario's four cards use the same word-driven timing, with +rounded corners, simple role icons, restrained green-to-purple accents, and a +small upward entrance. Each card appears as its step is introduced, rather +than presenting four static boxes before the narration reaches them. +Both supporting footer lines stay hidden while the four cards are introduced. +The release-decision line enters on "so we can decide"; the loaded-workflow +line follows on "This is our own workflow." Both use a short fade and upward entrance. +`assets/production/focus-sync.json` records the +four card anchors and these two later footer anchors. +`assets/production/hook-sync.json` records the eleven individual word entrances +and definition. The verifier checks encoded frames before, on, and after all +twenty-two explanatory reveals, +not merely whether the audio track and picture have matching lengths. + +The narration uses plain, conversational instructions rather than presentation +slogans. Scene lengths follow measured speech, with roughly 1.1-second +transitions, a 0.65-second minimum, and a 1.6-second maximum. Incoming speech +waits at least 0.35 seconds for the new picture. A deliberate pause before +"Prepare a release" separates the examples lead-in from the first scenario; +it requires at least 0.6 seconds of actual quiet audio. The other examples +retain natural sentence breaks; no pause is forced into connected speech. +The audio-only preview adds 0.25-second separators in addition to clip tails. +Planning windows allow up to 180 words per minute; no additional speech or +footage speed-up is used to shorten the edit. Unneeded waiting frames and +reading freezes are cut instead. + +Encoded-audio measurements must show no uninterrupted silence over 1.8 seconds +anywhere in the video, not just acceptable gaps between timestamped words. +Proof is saved in `review/narration-pacing.json`. The selected +scenario card is also checked against the encoded video, with the story +boundaries recorded in `review/story-verification.json`. + +The console was recorded at **1920x1016 with native 26px text**, reduced from +32px by recording again rather than shrinking or framing the old footage. It fills the +screen below a **64px title strip**, with a consistent 28px product/feature +title at the top-left and a brief 26px step label at the top-right. There are +no enlarged crops, framed proof panels, stretched pixels, or large demo +headings. Native tabs, phases, output, and keyboard hints remain visible. +The actual report is shown in the terminal, not on a redesigned slide. +Cuts and reading freezes are used; playback is not sped up. + +Nine thin, unfilled boxes draw around real text as it is discussed: the generated +extension, its review checkpoint, the paused +review checkpoint, five passing tests, CLI help, the assessment phase, and the +report's test-gaps section and two individual items. Source pixels are not +replaced, enlarged, or dimmed. Each console overlay is rendered with transparency +at native size, and the encoded verifier checks that the outlines progress from +absent to partially drawn to complete. Box positions are specific to this +recording, not inferred from arbitrary terminal output. + +The closing QR is in the lower-right, links to the official usage guide, +and remains fully visible for **10.7 seconds** through the final frame. +Its actual bounds are x=1660, y=812, 180x180, with a four-module white quiet zone. +The verifier decodes it at one-second intervals and from the final frame. +The final video includes synchronized AAC narration using the existing Ignite +ElevenLabs voice and a selectable English caption track. Captions come from the +approved script and measured word alignment, not speech recognition; they say +**pull request**, not "poll request." `narration-captions.srt` is the matching +sidecar. Captions are not burned over the native console. The intermediate +picture master stays silent. No music or simulated AI responses are included. The +original 97-second edit and previous 146-second framed edit remain available as +`renders/workflows-demo-1080p.mp4` and +`renders/workflows-demo-polished-1080p.mp4`. The first recording's source clips +and report are archived in `assets/first-recording/`. The previous 32px footage, +report, and audio are preserved in `assets/recording-32px/`. + +The closing headline and final spoken sentence are **Give dynamic workflows +a try.** Previous guided reviews, including +`renders/workflows-demo-guided-v3-1080p.mp4`, remain available. + +## Recreate the video + +Requirements: Copilot CLI with dynamic workflow support, VHS, ttyd, ffmpeg, +ffprobe, Node.js, a signed-in GitHub CLI, and Python 3.10+ with pytest. +The example was exercised with Copilot CLI 1.0.98 and VHS 0.12.1. +If the workflow feature is unavailable, update with `copilot update`, enable +experimental features, and check current account/plan eligibility. + +From this directory: + +```bash +# Choose a Python interpreter with pytest available under a clean HOME. +# python3.14 was available locally; another compatible interpreter is fine. +CAPTURE_PYTHON=python3.14 bash capture/record-creation.sh +# Inspect the generated extension before executing it. +bash capture/record-created-workflow.sh +``` + +This uses the reusable skill's recorder and the local console-specific tape +settings. Set `CLI_TO_VIDEO_SKILL=/absolute/path/to/cli-to-video` if the skill +is installed elsewhere. The recorder uses the skill's dynamic-workflows example +hooks for the fixture instructions, hash checks, and origin evidence. New recording artifacts are written to `creation/assets/`. +The second script uses the same temporary HOME and never replaces the generated +extension. It also records the focused report view and generates origin evidence +from the source hashes. Inspect the actual report before rebuilding; a new +assessment can change the findings. The supplied `creation/assets/` retains +the complete verified evidence; do not record again merely to rebuild the video. + +Record only when new evidence is needed; rebuilding from the retained footage +does not consume Copilot credits. A new run can produce different timings or +findings. Inspect it and adapt `production/timeline.json` and the narration +before rebuilding; the supplied source ranges describe this recording. + +The local renderer reuses the already installed reference-video dependencies: + +```bash +VIDEO_TOOLS="$HOME/Desktop/test/ignite-2026/.github/skills/content-to-video/template" \ + bash capture/render.sh +``` + +For a standalone copy, run `npm install` and `npx playwright install chromium` +in this directory, then `bash capture/render.sh`. The renderer uses the local +font files, their OFL license, and official GitHub mark in `assets/production/`. +If restoring source assets, supply `VIDEO_FONTS=/path/to/fonts` and +`VIDEO_MARK=/path/to/GitHub_Invertocat_White.svg`; never redraw the brand mark. +`VIDEO_TOOLS` changes dependency resolution only, not where the output is written. + +## Narration + +The audio uses the reference FinOps video's existing ElevenLabs voice +`gwU7DXdLrTvWCiUTPZG8`, model `eleven_v4`, stability 0.5, similarity 0.75, and +the same +5% post-generation delivery rate, alignment-aware pause shortening, +and 0.45-second natural tail. Settings are in `production/narration-config.json`. +Ask before changing the voice or model. An explicit narration request authorizes +normal synthesis; do not request approval again. + +```bash +elevenlabs auth status +NARRATION_TOOLS="$HOME/Desktop/test/ignite-2026/.github/skills/content-to-video/template" \ + npm run narrate +``` + +`NARRATION_TOOLS` supplies the existing pipeline's alignment helpers; `VIDEO_TOOLS` +can supply the same directory. OAuth stays in the CLI's credential store. +The generator reuses unchanged, hash-verified clips and retained provider +responses rather than paying for repeated speech. It never reads timecodes or +visual directions aloud. The synchronized track preserves the picture's reading +holds without truncating or further accelerating speech. + +After rendering the picture master, make the requested narrated delivery: + +```bash +VIDEO_TOOLS="$HOME/Desktop/test/ignite-2026/.github/skills/content-to-video/template" \ + npm run finalize +``` + +This copies the H.264 picture without another video encode, adds 192 kbps AAC +narration, and verifies `renders/workflows-demo-narrated-1080p.mp4`. Verification +compares decoded audio with the synchronized WAV, rejecting silent, incorrect, +or shifted narration; it also checks the native console and final-frame QR. + +## Picture verification + +For still previews without encoding, use `node production/build.mjs --stills` +with the same dependency environment. `npm run verify` checks the final MP4, +fully decodes it, checks the timing budgets, and decodes the QR from both the +closing hold and the encoded final frame. It also compares the complete encoded +console region with its native source using SSIM, rejecting cropped, scaled, +or obstructed output. Final delivery remains under three minutes. + +The runner creates a new temporary HOME and copies the sample app into it. +It authenticates through an environment variable, warms up first-run notices, +and records creation, execution, and the report in the same environment. Tokens are not written to tapes +or files. Recording consumes real Copilot credits. + +`--allow-all-tools` is used only for this disposable fixture to avoid unattended +approval dialogs. Do not copy that approval policy into a production project. +The extension executes its own known Python checks directly. + +VHS renders a virtual terminal, so monitor scaling does not change the MP4 +dimensions. A dedicated recording-control window was placed on the MacBook's +built-in display; existing windows were not moved. + +## Source map + +| Path | Purpose | +| --- | --- | +| `capture/setup-env.sh` | Build the isolated book app and CLI configuration | +| `capture/record-console.sh` | Record the native 32px console through the reusable skill | +| `capture/record-creation.sh` | Record real Copilot authoring in a fresh app with no preloaded workflow | +| `capture/record-created-workflow.sh` | Run the generated extension unchanged and record its actual report | +| `capture/tapes/workflow-create.tape` | Plain-language creation request and real registration output | +| `capture/tapes/workflow-created-run.tape` | Start, inspect, and resume the newly created workflow | +| `capture/tapes/workflow-created-report.tape` | Show the actual report header and findings with sed/fold | +| `capture/record.sh` | Original 28px full-frame recording recipe | +| `capture/tapes/console-settings.tape` | 1920x1016 native terminal below the 64px title | +| `capture/tapes/console-report.tape` | Show the real report with 112-column word wrapping at 26px | +| `capture/tapes/preflight.tape` | Exercise the live experimental `/workflows` UI | +| `capture/tapes/workflow-demo.tape` | Launch, run, inspect, and resume | +| `capture/tapes/report.tape` | Display the real report with word wrapping | +| `capture/render.sh` | Build and verify the polished edit | +| `production/timeline.json` | Scene lengths, full-console source ranges, reading holds, and speech windows | +| `production/visuals.*`, `production/styles.css` | Deterministic local animation and layout | +| `production/build.mjs`, `production/verify.mjs` | Local browser/ffmpeg build and final media checks | +| `production/evidence.json` | Official-source claims and sample-specific evidence | +| `production/narrate.mjs`, `production/narration-config.json` | Cached timestamped synthesis using the existing Ignite voice/settings | +| `production/mux.mjs` | Add synchronized AAC narration without re-encoding the picture | +| `assets/production/purpose-sync.json`, `review/purpose-word-sync.json` | Actual word-derived reveal anchors and encoded-frame synchronization proof | +| `assets/narration/` | Listening preview, synchronized track, and measured alignment/provenance | +| `narration-script.md`, `narration-timing.json` | Timestamped voice-production handoff | +| `creation/assets/release-report.md` | Actual report from the newly authored workflow | +| `creation/assets/workflow-origin.json` | Creation/run artifact hashes and source provenance | +| `assets/` | Real source recordings and local production assets | +| `review/` | Full-size scene previews, QR proof, and verification results | +| `renders/` | Final video | + +Generated recordings and temporary capture metadata are ignored by Git. + +## Related documentation + +- [Dynamic workflows](https://docs.github.com/en/copilot/concepts/agent-capabilities/agent-powered-workflows-and-operations/dynamic-workflows) +- [Using dynamic workflows](https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-dynamic-workflows) +- [VHS](https://github.com/charmbracelet/vhs) + +The reusable, self-contained `cli-to-video` skill (formerly `ghcp-cli-to-video`) +is in `ignite-2026/.github/skills/cli-to-video/`. It works for any CLI scenario; +this video is its `examples/dynamic-workflows/` example. diff --git a/videos/workflows/capture/book-release-check/extension.mjs b/videos/workflows/capture/book-release-check/extension.mjs new file mode 100644 index 00000000..f2028f2e --- /dev/null +++ b/videos/workflows/capture/book-release-check/extension.mjs @@ -0,0 +1,112 @@ +import { spawn } from "node:child_process"; +import { readFile, writeFile } from "node:fs/promises"; +import { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; +import { defineWorkflow, joinSession } from "@github/copilot-sdk/extension"; + +const app = resolve(dirname(fileURLToPath(import.meta.url)), "../../.."); + +function runPython(args, signal) { + return new Promise((resolveRun, reject) => { + const child = spawn("python3", args, { + cwd: app, + signal, + env: { ...process.env, PYTHONDONTWRITEBYTECODE: "1" }, + }); + let output = ""; + child.stdout.setEncoding("utf8").on("data", (chunk) => { output += chunk; }); + child.stderr.setEncoding("utf8").on("data", (chunk) => { output += chunk; }); + child.on("error", reject); + child.on("close", (code) => { + if (code === null) { + reject(new Error(`Python was terminated: ${args.join(" ")}`)); + } else { + resolveRun({ command: `python3 ${args.join(" ")}`, exitCode: code, output: output.trim() }); + } + }); + }); +} + +const releaseCheck = defineWorkflow({ + meta: { + name: "book-release-check", + description: "Check the Python book app, pause for human review, then write release-report.md. No inputs.", + phases: [ + { title: "Run project checks", detail: "Run pytest and the CLI help smoke check." }, + { title: "Human review checkpoint", detail: "Resume in /workflows when ready." }, + { title: "Assess release readiness", detail: "An agent evaluates the evidence and test coverage." }, + { title: "Save release report", detail: "Write release-report.md in the book app." }, + ], + }, + run: async (ctx) => { + ctx.phase("Run project checks"); + const checks = await ctx.step("book-checks-v1", async () => { + const results = await Promise.all([ + runPython(["-m", "pytest", "-q", "-p", "no:cacheprovider", "tests/"], ctx.signal), + runPython(["book_app.py", "help"], ctx.signal), + ]); + for (const check of results) { + ctx.log(`${check.exitCode === 0 ? "PASS" : "FAIL"}: ${check.command}\n${check.output}`); + } + return results; + }); + + ctx.phase("Human review checkpoint"); + ctx.log("Project checks are saved. Review the evidence, then resume this run in /workflows."); + await ctx.pause("review-project-checks"); + + ctx.phase("Assess release readiness"); + ctx.log("Resumed with saved check results; the test commands are not run again."); + const sourceFiles = ["books.py", "tests/test_books.py", "README.md"]; + const sources = await Promise.all(sourceFiles.map(async (file) => + `${file}:\n${await readFile(resolve(app, file), "utf8")}`)); + const assessment = await ctx.agent( + "Assess this small Python book collection app for a demo release, not production. " + + "Use only the supplied evidence; do not run tools or edit files. " + + "Passing tests do not prove production readiness. Identify exactly two concrete " + + "untested behaviors from the supplied source. Keep each item under 18 words, " + + "and the summary under 30 words.\n\n" + + `Check evidence:\n${JSON.stringify(checks)}\n\n${sources.join("\n\n")}`, + { + label: "Release-readiness assessment", + schema: { + type: "object", + required: ["summary", "untestedBehaviors"], + properties: { + summary: { type: "string" }, + untestedBehaviors: { type: "array", items: { type: "string" } }, + }, + }, + }, + ); + if (assessment === null) { + throw new Error("The release-readiness agent did not return a valid assessment."); + } + + ctx.phase("Save release report"); + const allPassed = checks.every((check) => check.exitCode === 0); + const report = [ + "# Book app release readiness", + "", + `Checks: ${allPassed ? "PASS" : "FAIL"}`, + ...checks.map((check) => `- ${check.command}: ${check.exitCode === 0 ? "PASS" : "FAIL"}`), + "", + "## Assessment", + assessment.summary, + "", + "## Test gaps to address", + ...assessment.untestedBehaviors.map((gap) => `- ${gap}`), + "", + "Passing checks are evidence, not a guarantee of production readiness.", + "", + ].join("\n"); + await ctx.step("save-release-report-v1", async () => { + await writeFile(resolve(app, "release-report.md"), report, "utf8"); + return { file: "release-report.md" }; + }); + ctx.log("Saved release-report.md with check results and concrete test gaps."); + return { checksPassed: allPassed, report: "release-report.md", assessment }; + }, +}); + +await joinSession({ workflows: [releaseCheck] }); diff --git a/videos/workflows/capture/record-console.sh b/videos/workflows/capture/record-console.sh new file mode 100644 index 00000000..2b9cff04 --- /dev/null +++ b/videos/workflows/capture/record-console.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +SKILL_ROOT="${CLI_TO_VIDEO_SKILL:-$HOME/Desktop/test/ignite-2026/.github/skills/cli-to-video}" +EXAMPLE="$SKILL_ROOT/examples/dynamic-workflows" +SOURCE_APP="$(cd ../.. && pwd)/samples/book-app-project" +OUTPUT="$PWD/console" +mkdir -p "$OUTPUT/capture/tapes" +trap 'status=$?; printf "%s\n" "$status" > "$OUTPUT/capture-status.txt"' EXIT +cp capture/tapes/console-settings.tape "$OUTPUT/capture/tapes/settings.tape" +cp capture/tapes/console-report.tape "$OUTPUT/capture/tapes/report.tape" +cp capture/tapes/workflow-demo.tape "$OUTPUT/capture/tapes/workflow-demo.tape" +CAPTURE_PYTHON="${CAPTURE_PYTHON:-python3.14}" \ +PREFLIGHT='python -m pytest -q -p no:cacheprovider tests/' \ +FIXTURE_INSTRUCTIONS="$EXAMPLE/fixture-instructions.md" \ +PRELOAD_DIR="$EXAMPLE/preload" \ + bash "$SKILL_ROOT/scripts/record.sh" "$SOURCE_APP" "$OUTPUT" workflow-demo report diff --git a/videos/workflows/capture/record-created-workflow.sh b/videos/workflows/capture/record-created-workflow.sh new file mode 100644 index 00000000..1770ac4a --- /dev/null +++ b/videos/workflows/capture/record-created-workflow.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +OUTPUT="$PWD/creation" +SKILL_ROOT="${CLI_TO_VIDEO_SKILL:-$HOME/Desktop/test/ignite-2026/.github/skills/cli-to-video}" +EXAMPLE="$SKILL_ROOT/examples/dynamic-workflows" +SOURCE_APP="$(cd ../.. && pwd)/samples/book-app-project" +export CAPTURE_HOME +CAPTURE_HOME="$(cat "$OUTPUT/capture-home.txt")" +export DEMO_APP="$CAPTURE_HOME/demo-app" +EXTENSION="$DEMO_APP/.github/extensions/book-release-check/extension.mjs" +test -f "$EXTENSION" +PYTHON_EXECUTABLE="$("$CAPTURE_HOME/bin/python3" -c 'import sys; print(sys.executable)')" +if [ ! -e "$CAPTURE_HOME/bin/python" ]; then + ln -s "$PYTHON_EXECUTABLE" "$CAPTURE_HOME/bin/python" +fi +export PATH="$CAPTURE_HOME/bin:$PATH" +HOME="$CAPTURE_HOME" python -m pytest -q -p no:cacheprovider "$DEMO_APP/tests/" +node --check "$EXTENSION" +shasum -a 256 "$EXTENSION" > "$OUTPUT/assets/workflow-before-run.sha256" +export COPILOT_GITHUB_TOKEN +COPILOT_GITHUB_TOKEN="$(gh auth token)" +export COPILOT_AUTO_UPDATE=false +unset COPILOT_CUSTOM_INSTRUCTIONS_DIRS COPILOT_SUPERVISED COPILOT_LOADER_PID +cp capture/tapes/workflow-created-run.tape "$OUTPUT/capture/tapes/" +cp capture/tapes/console-report.tape "$OUTPUT/capture/tapes/report.tape" +cp capture/tapes/workflow-created-report.tape "$OUTPUT/capture/tapes/" +cd "$OUTPUT/capture" +vhs tapes/workflow-created-run.tape +test -s "$DEMO_APP/release-report.md" +vhs tapes/report.tape +vhs tapes/workflow-created-report.tape +cp "$DEMO_APP/release-report.md" "$OUTPUT/assets/release-report.md" +cp "$EXTENSION" "$OUTPUT/assets/generated-extension.mjs" +shasum -a 256 "$EXTENSION" > "$OUTPUT/assets/workflow-after-run.sha256" +cmp "$OUTPUT/assets/workflow-before-run.sha256" "$OUTPUT/assets/workflow-after-run.sha256" +node "$EXAMPLE/hooks/record-origin.mjs" "$OUTPUT" "$SOURCE_APP" diff --git a/videos/workflows/capture/record-creation.sh b/videos/workflows/capture/record-creation.sh new file mode 100644 index 00000000..cbcca7a3 --- /dev/null +++ b/videos/workflows/capture/record-creation.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +SKILL_ROOT="${CLI_TO_VIDEO_SKILL:-$HOME/Desktop/test/ignite-2026/.github/skills/cli-to-video}" +EXAMPLE="$SKILL_ROOT/examples/dynamic-workflows" +SOURCE_APP="$(cd ../.. && pwd)/samples/book-app-project" +OUTPUT="$PWD/creation" +mkdir -p "$OUTPUT/capture/tapes" +cp capture/tapes/console-settings.tape "$OUTPUT/capture/tapes/settings.tape" +cp capture/tapes/workflow-create.tape "$OUTPUT/capture/tapes/workflow-create.tape" +CAPTURE_PYTHON="${CAPTURE_PYTHON:-python3.14}" \ +PREFLIGHT='python -m pytest -q -p no:cacheprovider tests/' \ +FIXTURE_INSTRUCTIONS="$EXAMPLE/fixture-instructions.md" \ +AFTER_TAPE="$EXAMPLE/hooks/after-tape.sh" \ + bash "$SKILL_ROOT/scripts/record.sh" "$SOURCE_APP" "$OUTPUT" workflow-create diff --git a/videos/workflows/capture/record.sh b/videos/workflows/capture/record.sh new file mode 100644 index 00000000..c569bf89 --- /dev/null +++ b/videos/workflows/capture/record.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")" + +for tool in vhs ttyd ffmpeg ffprobe copilot gh; do + command -v "$tool" >/dev/null || { echo "Missing required tool: $tool" >&2; exit 1; } +done +CAPTURE_PYTHON="${CAPTURE_PYTHON:-python3}" +PYTHON_EXECUTABLE="$("$CAPTURE_PYTHON" -c 'import sys; assert sys.version_info >= (3, 10), "Use Python 3.10+ via CAPTURE_PYTHON"; print(sys.executable)')" + +export CAPTURE_HOME +CAPTURE_HOME="$(mktemp -d /private/tmp/ghcp-workflows.XXXXXX)" +bash setup-env.sh "$CAPTURE_HOME" +mkdir -p "$CAPTURE_HOME/bin" +ln -s "$PYTHON_EXECUTABLE" "$CAPTURE_HOME/bin/python3" +export PATH="$CAPTURE_HOME/bin:$PATH" +HOME="$CAPTURE_HOME" python3 -m pytest --version +mkdir -p "$CAPTURE_HOME/book-app/.github/extensions/book-release-check" ../assets ../renders +cp book-release-check/extension.mjs "$CAPTURE_HOME/book-app/.github/extensions/book-release-check/" +printf '%s\n' "$CAPTURE_HOME" > ../capture-home.txt +export COPILOT_GITHUB_TOKEN +COPILOT_GITHUB_TOKEN="$(gh auth token)" +export COPILOT_AUTO_UPDATE=false + +TAPE="${1:-workflow-demo}" +vhs validate "tapes/$TAPE.tape" +echo "Warming up authentication and first-run notices..." +vhs tapes/preflight.tape >/dev/null +echo "Recording $TAPE..." +vhs "tapes/$TAPE.tape" +if [ "$TAPE" = workflow-demo ]; then + test -s "$CAPTURE_HOME/book-app/release-report.md" + cp "$CAPTURE_HOME/book-app/release-report.md" ../assets/release-report.md + vhs tapes/report.tape +fi diff --git a/videos/workflows/capture/render.sh b/videos/workflows/capture/render.sh new file mode 100644 index 00000000..5bcb4f07 --- /dev/null +++ b/videos/workflows/capture/render.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +node production/build.mjs +node production/verify.mjs diff --git a/videos/workflows/capture/setup-env.sh b/videos/workflows/capture/setup-env.sh new file mode 100644 index 00000000..7a390ac6 --- /dev/null +++ b/videos/workflows/capture/setup-env.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail + +PROJECT_ROOT="$(cd "$(dirname "$0")/../../.." && pwd)" +CAPTURE_HOME="${1:?Pass a newly created temporary HOME directory}" +APP="$CAPTURE_HOME/book-app" + +mkdir -p "$APP/.github/extensions" "$CAPTURE_HOME/.copilot" +rsync -a --exclude '__pycache__' --exclude '.pytest_cache' --exclude '*.pyc' \ + "$PROJECT_ROOT/samples/book-app-project/" "$APP/" + +cat > "$CAPTURE_HOME/.copilot/settings.json" < "$CAPTURE_HOME/.copilot/config.json" + +cat > "$APP/.github/copilot-instructions.md" <<'MD' +# Book app recording + +This is an isolated copy of the course's Python book collection app. +Keep responses short and beginner-friendly. Do not change application code. +When explicitly asked to run a dynamic workflow, use the registered workflow. +Do not recreate it or substitute normal subagents. +MD + +cat > "$APP/.gitignore" <<'EOF' +__pycache__/ +.pytest_cache/ +*.pyc +release-report.md +EOF +git -C "$APP" init -q -b main diff --git a/videos/workflows/capture/tapes/console-report.tape b/videos/workflows/capture/tapes/console-report.tape new file mode 100644 index 00000000..6a1a5bbf --- /dev/null +++ b/videos/workflows/capture/tapes/console-report.tape @@ -0,0 +1,11 @@ +Output "../assets/report-raw.mp4" +Output "../assets/report-terminal.txt" +Source tapes/settings.tape +Type "# The workflow saved this report in the project" +Enter +Sleep 2s +Type "fold -s -w 112 release-report.md" +Sleep 700ms +Enter +Sleep 12s +Screenshot "../assets/09-report.png" diff --git a/videos/workflows/capture/tapes/console-settings.tape b/videos/workflows/capture/tapes/console-settings.tape new file mode 100644 index 00000000..e7e44859 --- /dev/null +++ b/videos/workflows/capture/tapes/console-settings.tape @@ -0,0 +1,16 @@ +Set Shell "bash" +Set Width 1920 +Set Height 1016 +Set FontSize 26 +Set FontFamily "JetBrainsMono Nerd Font Mono" +Set LineHeight 1.10 +Set Padding 24 +Set Framerate 30 +Set TypingSpeed 45ms +Set CursorBlink false +Set Theme { "name": "workflow-console", "black": "#484f58", "red": "#ff7b72", "green": "#3fb950", "yellow": "#d29922", "blue": "#58a6ff", "magenta": "#d2a8ff", "cyan": "#56d4dd", "white": "#e6edf3", "brightBlack": "#6e7681", "brightRed": "#ffa198", "brightGreen": "#56d364", "brightYellow": "#e3b341", "brightBlue": "#79c0ff", "brightMagenta": "#f0b6ff", "brightCyan": "#87e8ef", "brightWhite": "#ffffff", "background": "#0e1116", "foreground": "#e6edf3", "selection": "#264f78", "cursor": "#58a6ff" } +Hide +Type `export HOME="$CAPTURE_HOME" COPILOT_AUTO_UPDATE=false; cd "$DEMO_APP"; export PS1='\[\e[38;5;117m\]~/demo-app\[\e[0m\] $ '; clear` +Enter +Sleep 500ms +Show diff --git a/videos/workflows/capture/tapes/report.tape b/videos/workflows/capture/tapes/report.tape new file mode 100644 index 00000000..65672de4 --- /dev/null +++ b/videos/workflows/capture/tapes/report.tape @@ -0,0 +1,11 @@ +Output "../assets/report-raw.mp4" +Output "../assets/report-terminal.txt" +Source tapes/settings.tape +Type "# The workflow saved this report in the project" +Enter +Sleep 2s +Type "fold -s -w 100 release-report.md" +Sleep 700ms +Enter +Sleep 12s +Screenshot "../assets/09-report.png" diff --git a/videos/workflows/capture/tapes/settings.tape b/videos/workflows/capture/tapes/settings.tape new file mode 100644 index 00000000..d846a96a --- /dev/null +++ b/videos/workflows/capture/tapes/settings.tape @@ -0,0 +1,16 @@ +Set Shell "bash" +Set Width 1920 +Set Height 1080 +Set FontSize 28 +Set FontFamily "JetBrainsMono Nerd Font Mono" +Set LineHeight 1.15 +Set Padding 36 +Set Framerate 30 +Set TypingSpeed 45ms +Set CursorBlink false +Set Theme { "name": "workflow-demo", "black": "#484f58", "red": "#ff7b72", "green": "#3fb950", "yellow": "#d29922", "blue": "#58a6ff", "magenta": "#d2a8ff", "cyan": "#56d4dd", "white": "#e6edf3", "brightBlack": "#6e7681", "brightRed": "#ffa198", "brightGreen": "#56d364", "brightYellow": "#e3b341", "brightBlue": "#79c0ff", "brightMagenta": "#f0b6ff", "brightCyan": "#87e8ef", "brightWhite": "#ffffff", "background": "#0e1116", "foreground": "#e6edf3", "selection": "#264f78", "cursor": "#58a6ff" } +Hide +Type `export HOME="$CAPTURE_HOME" COPILOT_AUTO_UPDATE=false; cd "$HOME/book-app"; export PS1='\[\e[38;5;117m\]~/book-app\[\e[0m\] $ '; clear` +Enter +Sleep 500ms +Show diff --git a/videos/workflows/capture/tapes/workflow-create.tape b/videos/workflows/capture/tapes/workflow-create.tape new file mode 100644 index 00000000..f9a28a49 --- /dev/null +++ b/videos/workflows/capture/tapes/workflow-create.tape @@ -0,0 +1,22 @@ +Output "../assets/creation-raw.mp4" +Output "../assets/creation-terminal.txt" +Source tapes/settings.tape + +Hide +Type "copilot --experimental --disable-builtin-mcps --allow-all-tools --no-remote" +Enter +Sleep 10s +Show +Sleep 1s +Screenshot "../assets/creation-open.png" +Set TypingSpeed 24ms +Type "Create book-release-check as a reusable project dynamic workflow extension: run pytest and CLI help; pause for my review; ask an agent for two untested behaviors; save release-report.md. Journal checks so resume does not rerun them. Do not run it yet." +Sleep 2s +Screenshot "../assets/creation-prompt.png" +Enter +Sleep 180s +Screenshot "../assets/creation-result.png" +Ctrl+C +Sleep 500ms +Ctrl+C +Sleep 1s diff --git a/videos/workflows/capture/tapes/workflow-created-report.tape b/videos/workflows/capture/tapes/workflow-created-report.tape new file mode 100644 index 00000000..f4d50cc9 --- /dev/null +++ b/videos/workflows/capture/tapes/workflow-created-report.tape @@ -0,0 +1,8 @@ +Output "../assets/report-focused-raw.mp4" +Output "../assets/report-focused-terminal.txt" +Source tapes/settings.tape +Type "sed -n '1,7p;/## Two untested behaviors/,$p' release-report.md | fold -s -w 112" +Sleep 800ms +Enter +Sleep 14s +Screenshot "../assets/report-focused.png" diff --git a/videos/workflows/capture/tapes/workflow-created-run.tape b/videos/workflows/capture/tapes/workflow-created-run.tape new file mode 100644 index 00000000..d71bb95b --- /dev/null +++ b/videos/workflows/capture/tapes/workflow-created-run.tape @@ -0,0 +1,34 @@ +Output "../assets/workflows-raw.mp4" +Output "../assets/workflows-terminal.txt" +Source tapes/settings.tape +Hide +Type "copilot --experimental --disable-builtin-mcps --allow-all-tools --no-remote" +Enter +Sleep 10s +Show +Sleep 1s +Type "Run the book-release-check dynamic workflow." +Sleep 1s +Enter +Sleep 30s +Screenshot "../assets/run-checkpoint.png" +Type "/workflows" +Sleep 700ms +Enter +Sleep 6s +Screenshot "../assets/run-workflows.png" +Enter +Sleep 3s +Screenshot "../assets/run-details.png" +Type "r" +Sleep 3s +Screenshot "../assets/run-resumed.png" +Sleep 50s +Screenshot "../assets/run-result.png" +Tab +Sleep 4s +Screenshot "../assets/run-completed.png" +Ctrl+C +Sleep 500ms +Ctrl+C +Sleep 1s diff --git a/videos/workflows/capture/tapes/workflow-demo.tape b/videos/workflows/capture/tapes/workflow-demo.tape new file mode 100644 index 00000000..3aab0036 --- /dev/null +++ b/videos/workflows/capture/tapes/workflow-demo.tape @@ -0,0 +1,45 @@ +Output "../assets/workflows-raw.mp4" +Output "../assets/workflows-terminal.txt" +Source tapes/settings.tape + +Type "# Release readiness: real checks, human review, reusable report" +Enter +Sleep 2s +Type "copilot --experimental --disable-builtin-mcps --allow-all-tools --no-remote" +Sleep 600ms +Enter +Sleep 9s +Screenshot "../assets/01-launched.png" + +Type "Run the book-release-check dynamic workflow." +Sleep 1s +Enter +Sleep 22s +Screenshot "../assets/02-checkpoint.png" + +Type "/workflows" +Sleep 700ms +Enter +Sleep 6s +Screenshot "../assets/03-workflows.png" +Enter +Sleep 3s +Screenshot "../assets/04-run-details.png" + +Type "r" +Sleep 2s +Screenshot "../assets/05-resumed.png" +Sleep 12s +Down 2 +Sleep 3s +Screenshot "../assets/06-result.png" +Down +Sleep 4s +Screenshot "../assets/07-saved-report.png" +Tab +Sleep 4s +Screenshot "../assets/08-completed-overview.png" +Ctrl+C +Sleep 500ms +Ctrl+C +Sleep 1s diff --git a/videos/workflows/capture/title.svg b/videos/workflows/capture/title.svg new file mode 100644 index 00000000..597ca075 --- /dev/null +++ b/videos/workflows/capture/title.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + GITHUB COPILOT CLI + /workflows + A real release-readiness check + Run tests. Pause for review. Resume and save a report. + + $ copilot --experimental + Authentic VHS recording - workflow prepared before recording + + diff --git a/videos/workflows/narration-captions.srt b/videos/workflows/narration-captions.srt new file mode 100644 index 00000000..6f2b6506 --- /dev/null +++ b/videos/workflows/narration-captions.srt @@ -0,0 +1,197 @@ +1 +00:00:00,500 --> 00:00:03,774 +What are dynamic workflows, and why would +you use them? + +2 +00:00:05,050 --> 00:00:08,707 +The tests passed. That's a good start, but +what's still + +3 +00:00:08,707 --> 00:00:12,440 +untested? Dynamic workflows bring commands, +AI + +4 +00:00:12,440 --> 00:00:15,562 +agents, and review checkpoints into one +reusable + +5 +00:00:15,945 --> 00:00:16,629 +process. + +6 +00:00:17,700 --> 00:00:20,974 +Here are a few examples of where dynamic +workflows can help. + +7 +00:00:21,885 --> 00:00:25,961 +Prepare a release with tests and a list of +what's untested. Review + +8 +00:00:25,961 --> 00:00:29,692 +a pull request with the checks and findings +in one place. + +9 +00:00:29,796 --> 00:00:33,123 +Investigate a failed build by gathering +logs and possible next + +10 +00:00:33,123 --> 00:00:36,625 +steps. Let's look at a simple example with +a Python book + +11 +00:00:36,628 --> 00:00:37,387 +app. + +12 +00:00:38,350 --> 00:00:42,252 +Here's the plan. Run the tests first. Then, +take a look at the + +13 +00:00:42,636 --> 00:00:46,443 +results. Find the gaps with an AI agent. +We'll save the + +14 +00:00:46,560 --> 00:00:50,557 +report so we can decide what needs work. +This is our own workflow, + +15 +00:00:50,560 --> 00:00:54,214 +not a built-in command. Let's create book +release check. + +16 +00:00:55,550 --> 00:00:59,700 +First, tell Copilot what the workflow +should do. We give it a name, + +17 +00:00:59,931 --> 00:01:03,967 +describe the checks and review checkpoint, +and ask it to save a reusable + +18 +00:01:04,007 --> 00:01:07,700 +project extension. Creating it doesn't run +it. + +19 +00:01:08,650 --> 00:01:12,076 +Copilot turns that request into code and +registers the + +20 +00:01:12,460 --> 00:01:16,495 +workflow. The saved extension holds the +steps, including our pause for + +21 +00:01:16,840 --> 00:01:20,190 +review. Now book release check is ready to +run. + +22 +00:01:21,150 --> 00:01:25,226 +Let's ask Copilot to run book release +check. This starts the workflow + +23 +00:01:25,226 --> 00:01:28,881 +we just created, beginning with the tests +and help check. + +24 +00:01:29,850 --> 00:01:33,733 +The checks are done. The workflow's paused +here, so we can look at the + +25 +00:01:33,812 --> 00:01:35,867 +results before going any further. + +26 +00:01:36,850 --> 00:01:40,888 +All five tests passed, and the help command +works. But does + +27 +00:01:40,888 --> 00:01:44,695 +it handle damaged data? And can we find +authors regardless of + +28 +00:01:44,736 --> 00:01:47,819 +capitalization? Let's have the agent check. + +29 +00:01:48,783 --> 00:01:52,781 +Type slash workflows, pick our paused +release check, and press + +30 +00:01:52,783 --> 00:01:55,752 +Enter. Now we can see what's happened so +far. + +31 +00:01:56,717 --> 00:02:00,717 +Press R to keep going. We don't need to +rerun those checks; their + +32 +00:02:00,717 --> 00:02:04,679 +results are saved. The agent now looks +through the code and tests for + +33 +00:02:04,679 --> 00:02:05,667 +gaps. + +34 +00:02:06,617 --> 00:02:10,652 +That's finished. Let's open the report and +see what needs attention. + +35 +00:02:11,617 --> 00:02:15,500 +The report gives us two things to test +next: handling a damaged + +36 +00:02:15,502 --> 00:02:18,319 +data file and finding authors regardless of + +37 +00:02:18,360 --> 00:02:22,052 +capitalization. So, before we ship, we know +where to spend our + +38 +00:02:22,312 --> 00:02:22,919 +time. + +39 +00:02:23,883 --> 00:02:27,896 +If you keep doing the same checks by hand, +this is worth trying. + +40 +00:02:27,896 --> 00:02:31,883 +The QR code links to the guide. Use slash +workflows to keep + +41 +00:02:31,883 --> 00:02:35,462 +track of your runs. Give dynamic workflows +a try. diff --git a/videos/workflows/narration-script.md b/videos/workflows/narration-script.md new file mode 100644 index 00000000..ce49f2ac --- /dev/null +++ b/videos/workflows/narration-script.md @@ -0,0 +1,231 @@ +# Dynamic Workflows - timed narration script + +Picture length: **156.03333333333336 seconds** at **30 fps**. +ElevenLabs audio has been generated. Actual speech alignment and listening-preview timing are in assets/narration/manifest.json. +These are editorial recording windows, not measured word-level alignment. +Record only the quoted speech. Timecodes, directions, and reading holds are not spoken. +Timecodes are HH:MM:SS:FF at 30 fps. The JSON sidecar also contains seconds. + +## ElevenLabs handoff + +- Synthesize one cue at a time; timestamps and visual directions are not spoken. +- Speech windows are editorial targets, not provider word alignment. +- Measure the actual ElevenLabs character alignment before assembling final audio. +- Do not speed speech unnaturally to fill a window; use the reserved reading holds. +- Pronounce CLI as C L I, QR as Q R, and R as the letter R. Say /workflows as slash workflows. + +Keep the voice natural. The end of each speech window leaves a deliberate reading hold. +If measured speech overruns, revise the text or use an available hold; do not silently truncate it. + +## intro - 00:00:00:00 to 00:00:04:15 + +**Speak:** 00:00:00:15 to 00:00:04:14 (4.0 s available; about 152 words/minute if the whole window is used). + +> What are dynamic workflows, and why would you use them? + +**Measured speech:** 00:00:00:15 to 00:00:03:19. Audio clip ends at 00:00:04:08; character alignment: `assets/narration/segments/intro.json`. + +**Picture:** What are +Dynamic Workflows?. **Then hold:** 0.0 s with no speech. + +## hook - 00:00:04:15 to 00:00:17:00 + +**Speak:** 00:00:05:02 to 00:00:16:29 (11.9 s available; about 121 words/minute if the whole window is used). + +> The tests passed. That's a good start, but what's still untested? Dynamic workflows bring commands, AI agents, and review checkpoints into one reusable process. + +**Measured speech:** 00:00:05:01 to 00:00:16:14. Audio clip ends at 00:00:16:29; character alignment: `assets/narration/segments/hook.json`. + +**Picture:** hook. **Then hold:** 0.1 s with no speech. + +## purpose - 00:00:17:00 to 00:00:37:24 + +**Speak:** 00:00:17:21 to 00:00:37:23 (20.1 s available; about 168 words/minute if the whole window is used). + +> Here are a few examples of where dynamic workflows can help. Prepare a release with tests and a list of what's untested. Review a pull request with the checks and findings in one place. Investigate a failed build by gathering logs and possible next steps. Let's look at a simple example with a Python book app. + +**Measured speech:** 00:00:17:21 to 00:00:37:07. Audio clip ends at 00:00:37:22; character alignment: `assets/narration/segments/purpose.json`. + +**Picture:** A few places this helps. **Then hold:** 0.1 s with no speech. + +## focus - 00:00:37:24 to 00:00:55:03 + +**Speak:** 00:00:38:10 to 00:00:55:02 (16.7 s available; about 165 words/minute if the whole window is used). + +> Here's the plan. Run the tests first. Then, take a look at the results. Find the gaps with an AI agent. We'll save the report so we can decide what needs work. This is our own workflow, not a built-in command. Let's create book release check. + +**Measured speech:** 00:00:38:10 to 00:00:54:02. Audio clip ends at 00:00:55:02; character alignment: `assets/narration/segments/focus.json`. + +**Picture:** What haven't we tested yet?. **Then hold:** 0.1 s with no speech. + +## create - 00:00:55:03 to 00:01:08:06 + +**Speak:** 00:00:55:17 to 00:01:08:04 (12.6 s available; about 157 words/minute if the whole window is used). + +> First, tell Copilot what the workflow should do. We give it a name, describe the checks and review checkpoint, and ask it to save a reusable project extension. Creating it doesn't run it. + +**Measured speech:** 00:00:55:17 to 00:01:07:17. Audio clip ends at 00:01:08:01; character alignment: `assets/narration/segments/create.json`. + +**Picture:** Describe the workflow in plain language. **Then hold:** 0.0 s with no speech. + +- Picture movement: 00:00:55:03-00:01:02:15; reading freeze: 00:01:02:15-00:01:06:06. +- Picture movement: 00:01:06:06-00:01:08:06; reading freeze: 00:01:08:06-00:01:08:06. + +## created - 00:01:08:06 to 00:01:20:21 + +**Speak:** 00:01:08:19 to 00:01:20:19 (12.0 s available; about 145 words/minute if the whole window is used). + +> Copilot turns that request into code and registers the workflow. The saved extension holds the steps, including our pause for review. Now book release check is ready to run. + +**Measured speech:** 00:01:08:20 to 00:01:20:01. Audio clip ends at 00:01:20:16; character alignment: `assets/narration/segments/created.json`. + +**Picture:** Inspect the workflow Copilot created. **Then hold:** 0.1 s with no speech. + +- Picture movement: 00:01:08:06-00:01:09:06; reading freeze: 00:01:09:06-00:01:20:21. + +## run - 00:01:20:21 to 00:01:29:12 + +**Speak:** 00:01:21:04 to 00:01:29:11 (8.2 s available; about 161 words/minute if the whole window is used). + +> Let's ask Copilot to run book release check. This starts the workflow we just created, beginning with the tests and help check. + +**Measured speech:** 00:01:21:04 to 00:01:28:22. Audio clip ends at 00:01:29:06; character alignment: `assets/narration/segments/run.json`. + +**Picture:** Start the book app's release check. **Then hold:** 0.0 s with no speech. + +- Picture movement: 00:01:20:21-00:01:24:06; reading freeze: 00:01:24:06-00:01:24:27. +- Picture movement: 00:01:24:27-00:01:27:27; reading freeze: 00:01:27:27-00:01:29:12. + +## checkpoint - 00:01:29:12 to 00:01:36:12 + +**Speak:** 00:01:29:26 to 00:01:36:11 (6.5 s available; about 175 words/minute if the whole window is used). + +> The checks are done. The workflow's paused here, so we can look at the results before going any further. + +**Measured speech:** 00:01:29:26 to 00:01:35:22. Audio clip ends at 00:01:36:06; character alignment: `assets/narration/segments/checkpoint.json`. + +**Picture:** Stop at a human-review checkpoint. **Then hold:** 0.0 s with no speech. + +- Picture movement: 00:01:29:12-00:01:30:12; reading freeze: 00:01:30:12-00:01:36:12. + +## checks - 00:01:36:12 to 00:01:48:10 + +**Speak:** 00:01:36:26 to 00:01:48:08 (11.4 s available; about 147 words/minute if the whole window is used). + +> All five tests passed, and the help command works. But does it handle damaged data? And can we find authors regardless of capitalization? Let's have the agent check. + +**Measured speech:** 00:01:36:26 to 00:01:47:20. Audio clip ends at 00:01:48:05; character alignment: `assets/narration/segments/checks.json`. + +**Picture:** Review the evidence before continuing. **Then hold:** 0.1 s with no speech. + +- Picture movement: 00:01:36:12-00:01:38:12; reading freeze: 00:01:38:12-00:01:48:10. + +## monitor - 00:01:48:10 to 00:01:56:08 + +**Speak:** 00:01:48:24 to 00:01:56:06 (7.4 s available; about 153 words/minute if the whole window is used). + +> Type slash workflows, pick our paused release check, and press Enter. Now we can see what's happened so far. + +**Measured speech:** 00:01:48:24 to 00:01:55:18. Audio clip ends at 00:01:56:03; character alignment: `assets/narration/segments/monitor.json`. + +**Picture:** Open /workflows. **Then hold:** 0.1 s with no speech. + +- Picture movement: 00:01:48:10-00:01:50:10; reading freeze: 00:01:50:10-00:01:50:25. +- Picture movement: 00:01:50:25-00:01:54:25; reading freeze: 00:01:54:25-00:01:56:08. + +## resume - 00:01:56:08 to 00:02:06:05 + +**Speak:** 00:01:56:22 to 00:02:06:04 (9.4 s available; about 172 words/minute if the whole window is used). + +> Press R to keep going. We don't need to rerun those checks; their results are saved. The agent now looks through the code and tests for gaps. + +**Measured speech:** 00:01:56:22 to 00:02:05:16. Audio clip ends at 00:02:06:00; character alignment: `assets/narration/segments/resume.json`. + +**Picture:** Resume the saved run. **Then hold:** 0.1 s with no speech. + +- Picture movement: 00:01:56:08-00:01:58:08; reading freeze: 00:01:58:08-00:01:59:14. +- Picture movement: 00:01:59:14-00:02:04:14; reading freeze: 00:02:04:14-00:02:06:05. + +## completed - 00:02:06:05 to 00:02:11:05 + +**Speak:** 00:02:06:19 to 00:02:11:04 (4.5 s available; about 147 words/minute if the whole window is used). + +> That's finished. Let's open the report and see what needs attention. + +**Measured speech:** 00:02:06:19 to 00:02:10:15. Audio clip ends at 00:02:11:00; character alignment: `assets/narration/segments/completed.json`. + +**Picture:** Find the completed run. **Then hold:** 0.0 s with no speech. + +- Picture movement: 00:02:06:05-00:02:08:05; reading freeze: 00:02:08:05-00:02:11:05. + +## report - 00:02:11:05 to 00:02:23:13 + +**Speak:** 00:02:11:19 to 00:02:23:12 (11.8 s available; about 158 words/minute if the whole window is used). + +> The report gives us two things to test next: handling a damaged data file and finding authors regardless of capitalization. So, before we ship, we know where to spend our time. + +**Measured speech:** 00:02:11:19 to 00:02:22:23. Audio clip ends at 00:02:23:08; character alignment: `assets/narration/segments/report.json`. + +**Picture:** Use the report to choose the next fix. **Then hold:** 0.0 s with no speech. + +- Picture movement: 00:02:11:05-00:02:22:14; reading freeze: 00:02:22:14-00:02:23:13. + +## closing - 00:02:23:13 to 00:02:36:01 + +**Speak:** 00:02:23:27 to 00:02:36:00 (12.1 s available; about 169 words/minute if the whole window is used). + +> If you keep doing the same checks by hand, this is worth trying. The QR code links to the guide. Use slash workflows to keep track of your runs. Give dynamic workflows a try. + +**Measured speech:** 00:02:23:27 to 00:02:35:09. Audio clip ends at 00:02:35:24; character alignment: `assets/narration/segments/closing.json`. + +**Picture:** Give dynamic +workflows a try.. **Then hold:** 0.0 s with no speech. + +## Explanation reveal timing + +- "The": reveal 00:00:05:00; spoken phrase 00:00:05:02; settled 00:00:05:03. +- "tests": reveal 00:00:05:10; spoken phrase 00:00:05:12; settled 00:00:05:14. +- "passed.": reveal 00:00:05:18; spoken phrase 00:00:05:20; settled 00:00:05:22. +- "That's": reveal 00:00:06:18; spoken phrase 00:00:06:20; settled 00:00:06:22. +- "a": reveal 00:00:06:22; spoken phrase 00:00:06:24; settled 00:00:06:26. +- "good": reveal 00:00:06:25; spoken phrase 00:00:06:26; settled 00:00:06:28. +- "start,": reveal 00:00:07:01; spoken phrase 00:00:07:03; settled 00:00:07:05. +- "but": reveal 00:00:07:27; spoken phrase 00:00:07:29; settled 00:00:08:01. +- "what's": reveal 00:00:08:03; spoken phrase 00:00:08:05; settled 00:00:08:07. +- "still": reveal 00:00:08:13; spoken phrase 00:00:08:14; settled 00:00:08:16. +- "untested?": reveal 00:00:08:19; spoken phrase 00:00:08:21; settled 00:00:08:23. +- "Commands, AI agents, and review checkpoints. +One reusable process.": reveal 00:00:10:03; spoken phrase 00:00:10:05; settled 00:00:10:06. +- "Prepare a release": reveal 00:00:21:24; spoken phrase 00:00:21:27; settled 00:00:22:01. +- "Review a pull request": reveal 00:00:25:21; spoken phrase 00:00:25:23; settled 00:00:25:28. +- "Investigate a failed build": reveal 00:00:29:21; spoken phrase 00:00:29:24; settled 00:00:29:29. +- "Demo: a simple Python book app.": reveal 00:00:33:29; spoken phrase 00:00:34:01; settled 00:00:34:06. +- "Run the tests": reveal 00:00:39:12; spoken phrase 00:00:39:15; settled 00:00:39:20. +- "Take a look": reveal 00:00:41:15; spoken phrase 00:00:41:18; settled 00:00:41:23. +- "Find the gaps": reveal 00:00:43:07; spoken phrase 00:00:43:10; settled 00:00:43:14. +- "Save the report": reveal 00:00:46:01; spoken phrase 00:00:46:03; settled 00:00:46:08. +- "We get a report. We still make the release decision.": reveal 00:00:46:24; spoken phrase 00:00:46:26; settled 00:00:47:01. +- "Custom workflow: book-release-check": reveal 00:00:48:28; spoken phrase 00:00:49:00; settled 00:00:49:05. +- "created-extension": reveal 00:01:10:22; spoken phrase 00:01:10:25; settled 00:01:11:07. +- "created-checkpoint": reveal 00:01:15:29; spoken phrase 00:01:16:01; settled 00:01:16:14. +- "paused-review": reveal 00:01:31:15; spoken phrase 00:01:31:17; settled 00:01:32:00. +- "five-tests": reveal 00:01:36:23; spoken phrase 00:01:36:26; settled 00:01:37:08. +- "help-check": reveal 00:01:38:23; spoken phrase 00:01:38:25; settled 00:01:39:08. +- "assessment-agent": reveal 00:02:02:06; spoken phrase 00:02:02:08; settled 00:02:02:21. +- "test-gaps": reveal 00:02:12:16; spoken phrase 00:02:12:18; settled 00:02:13:01. +- "damaged-file": reveal 00:02:14:13; spoken phrase 00:02:14:15; settled 00:02:14:28. +- "author-matching": reveal 00:02:16:17; spoken phrase 00:02:16:19; settled 00:02:17:02. + +## Accuracy boundaries + +- The authoring recording starts without a workflow extension. Copilot creates and registers the project extension from the visible request. +- The subsequent run uses that unchanged generated extension; its source hashes are recorded in the origin evidence. +- `/workflows` manages runs; the natural-language request starts this workflow. +- The checkpoint is defined in this example, not automatically added to every workflow. +- This example journals its checks; not every unsaved operation is skipped on resume. +- The report's two gaps come from the actual saved assessment. +- Automatic tool approval applies only to the isolated demo fixture. +- The lower-right QR links to the official usage guide and stays visible through the end. + +- The complete console is shown at native size, below a separate 64px title strip. +- Console text is 26px; the title and brief step labels are 28px and 26px. diff --git a/videos/workflows/narration-timing.json b/videos/workflows/narration-timing.json new file mode 100644 index 00000000..5f3d950f --- /dev/null +++ b/videos/workflows/narration-timing.json @@ -0,0 +1,957 @@ +{ + "timingStatus": "Editorial picture targets; measured speech alignment is stored separately with the generated audio", + "fps": 30, + "durationSeconds": 156.03333333333336, + "audioGenerated": true, + "hookSync": { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "hook", + "sceneStart": 4.5, + "fps": 30, + "audioSha256": "8edc25f5b620bebcff82064c1058c03c3b76a0c0bdcaaf75a7fdf229603fcea8", + "alignmentFile": "assets/narration/segments/hook.json", + "reveals": [ + { + "selector": ".hook-word[data-word-index=\"0\"]", + "text": "The", + "phrase": "The", + "wordIndex": 0, + "spokenStart": 0.55, + "spokenEnd": 0.702381, + "revealStart": 0.49000000000000005, + "settledAt": 0.6100000000000001, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"1\"]", + "text": "tests", + "phrase": "tests", + "wordIndex": 1, + "spokenStart": 0.892857, + "spokenEnd": 1.083333, + "revealStart": 0.832857, + "settledAt": 0.952857, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"2\"]", + "text": "passed.", + "phrase": "passed.", + "wordIndex": 2, + "spokenStart": 1.159524, + "spokenEnd": 2.07381, + "revealStart": 1.099524, + "settledAt": 1.2195239999999998, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"3\"]", + "text": "That's", + "phrase": "That's", + "wordIndex": 3, + "spokenStart": 2.175714, + "spokenEnd": 2.2642860000000002, + "revealStart": 2.115714, + "settledAt": 2.235714, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"4\"]", + "text": "a", + "phrase": "a", + "wordIndex": 4, + "spokenStart": 2.302381, + "spokenEnd": 2.340476, + "revealStart": 2.242381, + "settledAt": 2.362381, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"5\"]", + "text": "good", + "phrase": "good", + "wordIndex": 5, + "spokenStart": 2.378571, + "spokenEnd": 2.530952, + "revealStart": 2.318571, + "settledAt": 2.438571, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"6\"]", + "text": "start,", + "phrase": "start,", + "wordIndex": 6, + "spokenStart": 2.6071429999999998, + "spokenEnd": 3.216667, + "revealStart": 2.5471429999999997, + "settledAt": 2.667143, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"7\"]", + "text": "but", + "phrase": "but", + "wordIndex": 7, + "spokenStart": 3.4709520000000005, + "spokenEnd": 3.597619, + "revealStart": 3.4109520000000004, + "settledAt": 3.5309520000000005, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"8\"]", + "text": "what's", + "phrase": "what's", + "wordIndex": 8, + "spokenStart": 3.6738100000000005, + "spokenEnd": 3.8261900000000004, + "revealStart": 3.6138100000000004, + "settledAt": 3.7338100000000005, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"9\"]", + "text": "still", + "phrase": "still", + "wordIndex": 9, + "spokenStart": 3.9785709999999996, + "spokenEnd": 4.130952, + "revealStart": 3.9185709999999996, + "settledAt": 4.038570999999999, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-word[data-word-index=\"10\"]", + "text": "untested?", + "phrase": "untested?", + "wordIndex": 10, + "spokenStart": 4.207143, + "spokenEnd": 5.35, + "revealStart": 4.147143000000001, + "settledAt": 4.267143000000001, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + }, + { + "selector": ".hook-definition", + "text": "Commands, AI agents, and review checkpoints.\nOne reusable process.", + "phrase": "Dynamic workflows", + "wordIndex": 11, + "spokenStart": 5.654762, + "spokenEnd": 6.4166669999999995, + "revealStart": 5.594762, + "settledAt": 5.714762, + "leadSeconds": 0.06, + "settleSeconds": 0.06 + } + ] + }, + "purposeSync": { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "purpose", + "sceneStart": 17, + "fps": 30, + "audioSha256": "dcfff5701e7267238c33ecf6bc62a4a177baa5993792fff670e03787ced3dc6b", + "alignmentFile": "assets/narration/segments/purpose.json", + "reveals": [ + { + "selector": ".purpose-point:nth-child(1)", + "text": "Prepare a release", + "phrase": "Prepare a release", + "wordIndex": 11, + "spokenStart": 4.884762, + "spokenEnd": 5.684762, + "revealStart": 4.804762, + "settledAt": 5.044762, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".purpose-point:nth-child(2)", + "text": "Review a pull request", + "phrase": "Review a pull request", + "wordIndex": 22, + "spokenStart": 8.782857, + "spokenEnd": 9.799047999999999, + "revealStart": 8.702857, + "settledAt": 8.942857, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".purpose-point:nth-child(3)", + "text": "Investigate a failed build", + "phrase": "Investigate a failed build", + "wordIndex": 34, + "spokenStart": 12.79619, + "spokenEnd": 14.141905, + "revealStart": 12.71619, + "settledAt": 12.95619, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".purpose-example", + "text": "Demo: a simple Python book app.", + "phrase": "Let's look at a simple example", + "wordIndex": 45, + "spokenStart": 17.037143, + "spokenEnd": 18.408571, + "revealStart": 16.957143000000002, + "settledAt": 17.197143, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + } + ] + }, + "focusSync": { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "focus", + "sceneStart": 37.8, + "fps": 30, + "audioSha256": "224559757eb2ad8301e9aa6074c81d4132abe12f1094c199e7bfc60a9c564281", + "alignmentFile": "assets/narration/segments/focus.json", + "reveals": [ + { + "selector": ".focus-step:nth-child(1)", + "text": "Run the tests", + "phrase": "Run the tests", + "wordIndex": 3, + "spokenStart": 1.692857, + "spokenEnd": 2.454762, + "revealStart": 1.612857, + "settledAt": 1.852857, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".focus-step:nth-child(2)", + "text": "Take a look", + "phrase": "Take a look", + "wordIndex": 8, + "spokenStart": 3.7947620000000004, + "spokenEnd": 4.07381, + "revealStart": 3.7147620000000003, + "settledAt": 3.9547620000000006, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".focus-step:nth-child(3)", + "text": "Find the gaps", + "phrase": "Find the gaps", + "wordIndex": 14, + "spokenStart": 5.5214289999999995, + "spokenEnd": 6.283333, + "revealStart": 5.441428999999999, + "settledAt": 5.681429, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".focus-step:nth-child(4)", + "text": "Save the report", + "phrase": "Save the report", + "wordIndex": 22, + "spokenStart": 8.302381, + "spokenEnd": 9.026190000000001, + "revealStart": 8.222381, + "settledAt": 8.462381, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".focus-outcome", + "text": "We get a report. We still make the release decision.", + "phrase": "so we can decide", + "wordIndex": 25, + "spokenStart": 9.064286000000001, + "spokenEnd": 9.788095, + "revealStart": 8.984286, + "settledAt": 9.224286000000001, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + }, + { + "selector": ".focus-registered", + "text": "Custom workflow: book-release-check", + "phrase": "This is our own workflow", + "wordIndex": 32, + "spokenStart": 11.21, + "spokenEnd": 12.607143, + "revealStart": 11.13, + "settledAt": 11.370000000000001, + "leadSeconds": 0.08, + "settleSeconds": 0.15999999999999998 + } + ] + }, + "calloutSync": [ + { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "created", + "sceneStart": 68.19999999999999, + "fps": 30, + "audioSha256": "da2f1014440eb9874100539f4cb54bdde33f126ec4b141fb3230d857766d9d7e", + "alignmentFile": "assets/narration/segments/created.json", + "reveals": [ + { + "selector": "#callout-created-extension", + "text": "created-extension", + "phrase": "code", + "wordIndex": 5, + "spokenStart": 2.621429, + "spokenEnd": 2.8880950000000003, + "revealStart": 2.541429, + "settledAt": 3.041429, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "created-extension", + "rect": [ + 160, + 239, + 1200, + 50 + ], + "color": "#72e49a", + "endAt": 4.188095000000001 + }, + { + "selector": "#callout-created-checkpoint", + "text": "created-checkpoint", + "phrase": "pause for review", + "wordIndex": 18, + "spokenStart": 7.840476, + "spokenEnd": 9.17381, + "revealStart": 7.760476, + "settledAt": 8.260476, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "created-checkpoint", + "rect": [ + 60, + 660, + 1810, + 95 + ], + "color": "#c0a0f5", + "endAt": 10.27381 + } + ] + }, + { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "checkpoint", + "sceneStart": 89.39999999999999, + "fps": 30, + "audioSha256": "7b6a9d3396310b0732785420872f7bcb531863f1ffb708435976f9ee76936e37", + "alignmentFile": "assets/narration/segments/checkpoint.json", + "reveals": [ + { + "selector": "#callout-paused-review", + "text": "paused-review", + "phrase": "workflow's paused", + "wordIndex": 5, + "spokenStart": 2.164286, + "spokenEnd": 2.964286, + "revealStart": 2.084286, + "settledAt": 2.584286, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "paused-review", + "rect": [ + 60, + 546, + 610, + 50 + ], + "color": "#c0a0f5", + "endAt": 5.164286000000001 + } + ] + }, + { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "checks", + "sceneStart": 96.39999999999999, + "fps": 30, + "audioSha256": "fc7abc7d6f7ddf07d73e646c9acdfea8148606e7af11999cbc25eca7269791fe", + "alignmentFile": "assets/narration/segments/checks.json", + "reveals": [ + { + "selector": "#callout-five-tests", + "text": "five-tests", + "phrase": "All five tests passed", + "wordIndex": 0, + "spokenStart": 0.45, + "spokenEnd": 2.0500000000000003, + "revealStart": 0.37, + "settledAt": 0.87, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "five-tests", + "rect": [ + 474, + 707, + 315, + 48 + ], + "color": "#72e49a", + "endAt": 3.1500000000000004 + }, + { + "selector": "#callout-help-check", + "text": "help-check", + "phrase": "help command works", + "wordIndex": 6, + "spokenStart": 2.430952, + "spokenEnd": 3.878571, + "revealStart": 2.350952, + "settledAt": 2.850952, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "help-check", + "rect": [ + 861, + 707, + 527, + 48 + ], + "color": "#c0a0f5", + "endAt": 5.078571 + } + ] + }, + { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "resume", + "sceneStart": 116.26666666666667, + "fps": 30, + "audioSha256": "a27b53a43e678ae0e758d1e3042c7159d6d238b0027c13c10df6a5f2c3ca0fe0", + "alignmentFile": "assets/narration/segments/resume.json", + "reveals": [ + { + "selector": "#callout-assessment-agent", + "text": "assessment-agent", + "phrase": "The agent now", + "wordIndex": 16, + "spokenStart": 5.999524, + "spokenEnd": 6.659524, + "revealStart": 5.919524, + "settledAt": 6.419524, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "assessment-agent", + "rect": [ + 16, + 394, + 535, + 46 + ], + "color": "#72e49a", + "endAt": 8.259524 + } + ] + }, + { + "timingSource": "elevenlabs-word-alignment", + "sceneId": "report", + "sceneStart": 131.16666666666669, + "fps": 30, + "audioSha256": "2459e4ef37b67c18c207c6d83619d799fda9e706894f4fdbb68e692daea4fdca", + "alignmentFile": "assets/narration/segments/report.json", + "reveals": [ + { + "selector": "#callout-test-gaps", + "text": "test-gaps", + "phrase": "two things to test next", + "wordIndex": 4, + "spokenStart": 1.440476, + "spokenEnd": 3.269048, + "revealStart": 1.360476, + "settledAt": 1.860476, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "test-gaps", + "rect": [ + 12, + 397, + 1852, + 350 + ], + "color": "#c0a0f5", + "endAt": 12.266666666666667 + }, + { + "selector": "#callout-damaged-file", + "text": "damaged-file", + "phrase": "handling a damaged data file", + "wordIndex": 9, + "spokenStart": 3.345238, + "spokenEnd": 5.021429, + "revealStart": 3.265238, + "settledAt": 3.765238, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "damaged-file", + "rect": [ + 16, + 470, + 1846, + 121 + ], + "color": "#72e49a", + "endAt": 12.266666666666667 + }, + { + "selector": "#callout-author-matching", + "text": "author-matching", + "phrase": "finding authors regardless of capitalization", + "wordIndex": 15, + "spokenStart": 5.4785710000000005, + "spokenEnd": 8.45, + "revealStart": 5.3985710000000005, + "settledAt": 5.8985710000000005, + "leadSeconds": 0.08, + "settleSeconds": 0.42, + "id": "author-matching", + "rect": [ + 16, + 625, + 1846, + 121 + ], + "color": "#72e49a", + "endAt": 12.266666666666667 + } + ] + } + ], + "synthesisNotes": [ + "Synthesize one cue at a time; timestamps and visual directions are not spoken.", + "Speech windows are editorial targets, not provider word alignment.", + "Measure the actual ElevenLabs character alignment before assembling final audio.", + "Do not speed speech unnaturally to fill a window; use the reserved reading holds.", + "Pronounce CLI as C L I, QR as Q R, and R as the letter R. Say /workflows as slash workflows." + ], + "cues": [ + { + "id": "intro", + "sceneStart": 0, + "sceneEnd": 4.5, + "speechStart": 0.5, + "speechEnd": 4.45, + "inTimecode": "00:00:00:15", + "outTimecode": "00:00:04:14", + "text": "What are dynamic workflows, and why would you use them?", + "words": 10, + "budgetSeconds": 3.95, + "requiredWpm": 152, + "silentTailSeconds": 0.04999999999999982, + "visualCue": "What are\nDynamic Workflows?", + "pictureTiming": [], + "audioFile": "assets/narration/segments/intro.wav", + "audioAlignmentFile": "assets/narration/segments/intro.json", + "measuredSpeechStart": 0.5, + "measuredSpeechEnd": 3.62381, + "audioEnd": 4.2609580000000005 + }, + { + "id": "hook", + "sceneStart": 4.5, + "sceneEnd": 17, + "speechStart": 5.05, + "speechEnd": 16.95, + "inTimecode": "00:00:05:02", + "outTimecode": "00:00:16:29", + "text": "The tests passed. That's a good start, but what's still untested? Dynamic workflows bring commands, AI agents, and review checkpoints into one reusable process.", + "words": 24, + "budgetSeconds": 11.899999999999999, + "requiredWpm": 121, + "silentTailSeconds": 0.05000000000000071, + "visualCue": "hook", + "pictureTiming": [], + "audioFile": "assets/narration/segments/hook.wav", + "audioAlignmentFile": "assets/narration/segments/hook.json", + "measuredSpeechStart": 5.049999999999999, + "measuredSpeechEnd": 16.478571000000002, + "audioEnd": 16.963458 + }, + { + "id": "purpose", + "sceneStart": 17, + "sceneEnd": 37.8, + "speechStart": 17.7, + "speechEnd": 37.75, + "inTimecode": "00:00:17:21", + "outTimecode": "00:00:37:23", + "text": "Here are a few examples of where dynamic workflows can help. Prepare a release with tests and a list of what's untested. Review a pull request with the checks and findings in one place. Investigate a failed build by gathering logs and possible next steps. Let's look at a simple example with a Python book app.", + "words": 56, + "budgetSeconds": 20.05, + "requiredWpm": 168, + "silentTailSeconds": 0.05000000000000071, + "visualCue": "A few places this helps", + "pictureTiming": [], + "audioFile": "assets/narration/segments/purpose.wav", + "audioAlignmentFile": "assets/narration/segments/purpose.json", + "measuredSpeechStart": 17.699999999999996, + "measuredSpeechEnd": 37.237142999999996, + "audioEnd": 37.722125 + }, + { + "id": "focus", + "sceneStart": 37.8, + "sceneEnd": 55.099999999999994, + "speechStart": 38.349999999999994, + "speechEnd": 55.05, + "inTimecode": "00:00:38:10", + "outTimecode": "00:00:55:02", + "text": "Here's the plan. Run the tests first. Then, take a look at the results. Find the gaps with an AI agent. We'll save the report so we can decide what needs work. This is our own workflow, not a built-in command. Let's create book release check.", + "words": 46, + "budgetSeconds": 16.700000000000003, + "requiredWpm": 165, + "silentTailSeconds": 0.05000000000000071, + "visualCue": "What haven't we tested yet?", + "pictureTiming": [], + "audioFile": "assets/narration/segments/focus.wav", + "audioAlignmentFile": "assets/narration/segments/focus.json", + "measuredSpeechStart": 38.349999999999994, + "measuredSpeechEnd": 54.064285999999996, + "audioEnd": 55.08241699999999 + }, + { + "id": "create", + "sceneStart": 55.099999999999994, + "sceneEnd": 68.19999999999999, + "speechStart": 55.55, + "speechEnd": 68.14999999999999, + "inTimecode": "00:00:55:17", + "outTimecode": "00:01:08:04", + "text": "First, tell Copilot what the workflow should do. We give it a name, describe the checks and review checkpoint, and ask it to save a reusable project extension. Creating it doesn't run it.", + "words": 33, + "budgetSeconds": 12.599999999999994, + "requiredWpm": 157, + "silentTailSeconds": 0.049999999999998934, + "visualCue": "Describe the workflow in plain language", + "pictureTiming": [ + { + "playbackStart": 55.099999999999994, + "playbackEnd": 62.49999999999999, + "holdEnd": 66.19999999999999, + "source": "creation/assets/creation-raw.mp4", + "sourceStart": 1, + "sourceEnd": 8.4 + }, + { + "playbackStart": 66.19999999999999, + "playbackEnd": 68.19999999999999, + "holdEnd": 68.19999999999999, + "source": "creation/assets/creation-raw.mp4", + "sourceStart": 8.4, + "sourceEnd": 10.4 + } + ], + "audioFile": "assets/narration/segments/create.wav", + "audioAlignmentFile": "assets/narration/segments/create.json", + "measuredSpeechStart": 55.55, + "measuredSpeechEnd": 67.55, + "audioEnd": 68.034667 + }, + { + "id": "created", + "sceneStart": 68.19999999999999, + "sceneEnd": 80.69999999999999, + "speechStart": 68.64999999999999, + "speechEnd": 80.64999999999999, + "inTimecode": "00:01:08:19", + "outTimecode": "00:01:20:19", + "text": "Copilot turns that request into code and registers the workflow. The saved extension holds the steps, including our pause for review. Now book release check is ready to run.", + "words": 29, + "budgetSeconds": 12, + "requiredWpm": 145, + "silentTailSeconds": 0.05000000000000071, + "visualCue": "Inspect the workflow Copilot created", + "pictureTiming": [ + { + "playbackStart": 68.19999999999999, + "playbackEnd": 69.19999999999999, + "holdEnd": 80.69999999999999, + "source": "creation/assets/creation-raw.mp4", + "sourceStart": 64, + "sourceEnd": 65 + } + ], + "audioFile": "assets/narration/segments/created.wav", + "audioAlignmentFile": "assets/narration/segments/created.json", + "measuredSpeechStart": 68.65, + "measuredSpeechEnd": 80.04047599999998, + "audioEnd": 80.52562499999999 + }, + { + "id": "run", + "sceneStart": 80.69999999999999, + "sceneEnd": 89.39999999999999, + "speechStart": 81.14999999999999, + "speechEnd": 89.35, + "inTimecode": "00:01:21:04", + "outTimecode": "00:01:29:11", + "text": "Let's ask Copilot to run book release check. This starts the workflow we just created, beginning with the tests and help check.", + "words": 22, + "budgetSeconds": 8.200000000000003, + "requiredWpm": 161, + "silentTailSeconds": 0.049999999999998934, + "visualCue": "Start the book app's release check", + "pictureTiming": [ + { + "playbackStart": 80.69999999999999, + "playbackEnd": 84.19999999999999, + "holdEnd": 84.89999999999999, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 1, + "sourceEnd": 4.5 + }, + { + "playbackStart": 84.89999999999999, + "playbackEnd": 87.89999999999999, + "holdEnd": 89.39999999999999, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 8, + "sourceEnd": 11 + } + ], + "audioFile": "assets/narration/segments/run.wav", + "audioAlignmentFile": "assets/narration/segments/run.json", + "measuredSpeechStart": 81.14999999999999, + "measuredSpeechEnd": 88.73095199999999, + "audioEnd": 89.21545799999998 + }, + { + "id": "checkpoint", + "sceneStart": 89.39999999999999, + "sceneEnd": 96.39999999999999, + "speechStart": 89.85, + "speechEnd": 96.35, + "inTimecode": "00:01:29:26", + "outTimecode": "00:01:36:11", + "text": "The checks are done. The workflow's paused here, so we can look at the results before going any further.", + "words": 19, + "budgetSeconds": 6.5, + "requiredWpm": 175, + "silentTailSeconds": 0.04999999999999982, + "visualCue": "Stop at a human-review checkpoint", + "pictureTiming": [ + { + "playbackStart": 89.39999999999999, + "playbackEnd": 90.39999999999999, + "holdEnd": 96.39999999999999, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 30, + "sourceEnd": 31 + } + ], + "audioFile": "assets/narration/segments/checkpoint.wav", + "audioAlignmentFile": "assets/narration/segments/checkpoint.json", + "measuredSpeechStart": 89.85, + "measuredSpeechEnd": 95.716667, + "audioEnd": 96.201875 + }, + { + "id": "checks", + "sceneStart": 96.39999999999999, + "sceneEnd": 108.33333333333333, + "speechStart": 96.85, + "speechEnd": 108.283333, + "inTimecode": "00:01:36:26", + "outTimecode": "00:01:48:08", + "text": "All five tests passed, and the help command works. But does it handle damaged data? And can we find authors regardless of capitalization? Let's have the agent check.", + "words": 28, + "budgetSeconds": 11.433333000000005, + "requiredWpm": 147, + "silentTailSeconds": 0.0500003333333332, + "visualCue": "Review the evidence before continuing", + "pictureTiming": [ + { + "playbackStart": 96.39999999999999, + "playbackEnd": 98.39999999999998, + "holdEnd": 108.33333333333331, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 30, + "sourceEnd": 32 + } + ], + "audioFile": "assets/narration/segments/checks.wav", + "audioAlignmentFile": "assets/narration/segments/checks.json", + "measuredSpeechStart": 96.85, + "measuredSpeechEnd": 107.669048, + "audioEnd": 108.154417 + }, + { + "id": "monitor", + "sceneStart": 108.33333333333333, + "sceneEnd": 116.26666666666667, + "speechStart": 108.78333333333333, + "speechEnd": 116.21666633333334, + "inTimecode": "00:01:48:24", + "outTimecode": "00:01:56:06", + "text": "Type slash workflows, pick our paused release check, and press Enter. Now we can see what's happened so far.", + "words": 19, + "budgetSeconds": 7.433333000000005, + "requiredWpm": 153, + "silentTailSeconds": 0.0500003333333332, + "visualCue": "Open /workflows", + "pictureTiming": [ + { + "playbackStart": 108.33333333333333, + "playbackEnd": 110.33333333333333, + "holdEnd": 110.83333333333333, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 33.2, + "sourceEnd": 35.2 + }, + { + "playbackStart": 110.83333333333333, + "playbackEnd": 114.83333333333331, + "holdEnd": 116.26666666666665, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 39.5, + "sourceEnd": 43.5 + } + ], + "audioFile": "assets/narration/segments/monitor.wav", + "audioAlignmentFile": "assets/narration/segments/monitor.json", + "measuredSpeechStart": 108.78333333333333, + "measuredSpeechEnd": 115.60238133333334, + "audioEnd": 116.08720833333334 + }, + { + "id": "resume", + "sceneStart": 116.26666666666667, + "sceneEnd": 126.16666666666667, + "speechStart": 116.71666666666667, + "speechEnd": 126.11666666666666, + "inTimecode": "00:01:56:22", + "outTimecode": "00:02:06:04", + "text": "Press R to keep going. We don't need to rerun those checks; their results are saved. The agent now looks through the code and tests for gaps.", + "words": 27, + "budgetSeconds": 9.399999999999991, + "requiredWpm": 172, + "silentTailSeconds": 0.05000000000000071, + "visualCue": "Resume the saved run", + "pictureTiming": [ + { + "playbackStart": 116.26666666666667, + "playbackEnd": 118.26666666666665, + "holdEnd": 119.46666666666665, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 43.5, + "sourceEnd": 45.5 + }, + { + "playbackStart": 119.46666666666665, + "playbackEnd": 124.46666666666664, + "holdEnd": 126.16666666666664, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 47, + "sourceEnd": 52 + } + ], + "audioFile": "assets/narration/segments/resume.wav", + "audioAlignmentFile": "assets/narration/segments/resume.json", + "measuredSpeechStart": 116.71666666666667, + "measuredSpeechEnd": 125.51666666666668, + "audioEnd": 126.00133366666667 + }, + { + "id": "completed", + "sceneStart": 126.16666666666667, + "sceneEnd": 131.16666666666669, + "speechStart": 126.61666666666667, + "speechEnd": 131.11666666666667, + "inTimecode": "00:02:06:19", + "outTimecode": "00:02:11:04", + "text": "That's finished. Let's open the report and see what needs attention.", + "words": 11, + "budgetSeconds": 4.5, + "requiredWpm": 147, + "silentTailSeconds": 0.04999999999999982, + "visualCue": "Find the completed run", + "pictureTiming": [ + { + "playbackStart": 126.16666666666667, + "playbackEnd": 128.16666666666669, + "holdEnd": 131.16666666666669, + "source": "creation/assets/workflows-raw.mp4", + "sourceStart": 58, + "sourceEnd": 60 + } + ], + "audioFile": "assets/narration/segments/completed.wav", + "audioAlignmentFile": "assets/narration/segments/completed.json", + "measuredSpeechStart": 126.61666666666666, + "measuredSpeechEnd": 130.50238066666668, + "audioEnd": 130.98779166666668 + }, + { + "id": "report", + "sceneStart": 131.16666666666669, + "sceneEnd": 143.43333333333337, + "speechStart": 131.61666666666667, + "speechEnd": 143.3833336666667, + "inTimecode": "00:02:11:19", + "outTimecode": "00:02:23:12", + "text": "The report gives us two things to test next: handling a damaged data file and finding authors regardless of capitalization. So, before we ship, we know where to spend our time.", + "words": 31, + "budgetSeconds": 11.766667000000012, + "requiredWpm": 158, + "silentTailSeconds": 0.04999966666666822, + "visualCue": "Use the report to choose the next fix", + "pictureTiming": [ + { + "playbackStart": 131.16666666666669, + "playbackEnd": 142.46666666666667, + "holdEnd": 143.43333333333334, + "source": "creation/assets/report-focused-raw.mp4", + "sourceStart": 5.8, + "sourceEnd": 17.1 + } + ], + "audioFile": "assets/narration/segments/report.wav", + "audioAlignmentFile": "assets/narration/segments/report.json", + "measuredSpeechStart": 131.61666666666667, + "measuredSpeechEnd": 142.76904766666672, + "audioEnd": 143.2539996666667 + }, + { + "id": "closing", + "sceneStart": 143.43333333333337, + "sceneEnd": 156.03333333333336, + "speechStart": 143.88333333333335, + "speechEnd": 155.98333333333338, + "inTimecode": "00:02:23:27", + "outTimecode": "00:02:36:00", + "text": "If you keep doing the same checks by hand, this is worth trying. The QR code links to the guide. Use slash workflows to keep track of your runs. Give dynamic workflows a try.", + "words": 34, + "budgetSeconds": 12.100000000000023, + "requiredWpm": 169, + "silentTailSeconds": 0.049999999999998934, + "visualCue": "Give dynamic\nworkflows a try.", + "pictureTiming": [], + "audioFile": "assets/narration/segments/closing.wav", + "audioAlignmentFile": "assets/narration/segments/closing.json", + "measuredSpeechStart": 143.88333333333338, + "measuredSpeechEnd": 155.31190433333336, + "audioEnd": 155.79679133333335 + } + ] +} diff --git a/videos/workflows/package.json b/videos/workflows/package.json new file mode 100644 index 00000000..d2b43344 --- /dev/null +++ b/videos/workflows/package.json @@ -0,0 +1,18 @@ +{ + "name": "copilot-cli-workflows-video", + "private": true, + "type": "module", + "scripts": { + "build": "node production/build.mjs", + "narrate": "node production/narrate.mjs", + "finalize": "node production/mux.mjs && node production/verify.mjs --narrated", + "verify": "node production/verify.mjs" + }, + "devDependencies": { + "gsap": "3.15.0", + "jsqr": "1.4.0", + "playwright": "1.64.0", + "qrcode": "1.5.4", + "sharp": "0.35.5" + } +} diff --git a/videos/workflows/production/build.mjs b/videos/workflows/production/build.mjs new file mode 100644 index 00000000..935d9ed6 --- /dev/null +++ b/videos/workflows/production/build.mjs @@ -0,0 +1,547 @@ +import fs from "node:fs/promises"; +import http from "node:http"; +import { spawn } from "node:child_process"; +import { once } from "node:events"; +import { createHash } from "node:crypto"; +import { resolve } from "node:path"; +import { root, requireTool } from "./tools.mjs"; + +const { chromium } = requireTool("playwright"); +const QRCode = requireTool("qrcode"); +const config = JSON.parse(await fs.readFile(resolve(root, "production/timeline.json"), "utf8")); +const assets = resolve(root, "assets/production"); +const review = resolve(root, "review"); +const stillsOnly = process.argv.includes("--stills"); +const output = resolve(root, "renders/workflows-demo-console-1080p.mp4"); +await fs.mkdir(resolve(assets, "fonts"), { recursive: true }); +await fs.mkdir(review, { recursive: true }); +await fs.mkdir(resolve(root, "renders"), { recursive: true }); + +function assert(condition, message) { + if (!condition) throw new Error(message); +} +assert(config.width === 1920 && config.height === 1080 && config.fps === 30, + "This production recipe requires a 1920x1080, 30 fps timeline."); +assert(config.console.width === 1920 && config.console.height + config.console.top === 1080, + "The full-width console and reserved title strip must exactly fill the output."); + +async function run(command, args) { + const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"] }); + let stdout = ""; + let stderr = ""; + child.stdout.on("data", (chunk) => { stdout += chunk; }); + child.stderr.on("data", (chunk) => { stderr += chunk; }); + const [code] = await once(child, "close"); + assert(code === 0, `${command} failed (${code}): ${stderr}`); + return stdout; +} + +for (const file of ["MonaSansVF.woff2", "MonaSansMonoVF.woff2", "OFL.txt"]) { + const destination = resolve(assets, "fonts", file); + const source = process.env.VIDEO_FONTS ? resolve(process.env.VIDEO_FONTS, file) : destination; + if (source !== destination) await fs.copyFile(source, destination); + await fs.access(destination); +} +const mark = process.env.VIDEO_MARK; +if (mark) await fs.copyFile(resolve(mark), resolve(assets, "GitHub_Invertocat_White.svg")); +await fs.access(resolve(assets, "GitHub_Invertocat_White.svg")); +await QRCode.toFile(resolve(assets, "resource-qr.png"), config.resourceUrl, { + width: 360, margin: config.qr.quietZoneModules, errorCorrectionLevel: "M", + color: { dark: "#000000", light: "#ffffff" }, +}); + +const workflowOrigin = JSON.parse(await fs.readFile(resolve(root, config.evidence.origin), "utf8")); +const generatedExtension = await fs.readFile(resolve(root, workflowOrigin.extensionFile)); +assert(createHash("sha256").update(generatedExtension).digest("hex") === workflowOrigin.extensionSha256 + && workflowOrigin.extensionSha256 === workflowOrigin.executedExtensionSha256, + "The workflow shown being created must be the unchanged artifact used in the recorded run."); +const creationTranscript = await fs.readFile(resolve(root, workflowOrigin.creationTranscript), "utf8"); +assert(creationTranscript.includes("Created and registered book-release-check") + && creationTranscript.includes("Not run. Application code is unchanged."), + "The authoring recording must show real creation and registration, not a preloaded workflow."); +const reportText = await fs.readFile(resolve(root, config.evidence.report), "utf8"); +const summary = reportText.split("\n").find((line) => line.startsWith("Checks: ")); +const gaps = reportText.split("## Two untested behaviors\n")[1]?.trim().split(/\n\n+/) + .map((line) => line.replace(/^\d+\.\s*/, "")); +assert(reportText.includes("Checks: PASS") && summary && gaps?.length === 2, "The real report is missing or has changed shape. Review its contents before editing the video."); +assert(gaps[0].includes("Corrupted-data recovery") && gaps[0].includes("malformed JSON") + && gaps[1].includes("Case-insensitive author matching") && gaps[1].includes("find_by_author"), + "The report's findings changed. Revise the narration and evidence ledger before rebuilding this example."); +await fs.writeFile(resolve(assets, "report.json"), JSON.stringify({ summary, gaps }, null, 2)); +const transcript = await fs.readFile(resolve(root, config.evidence.transcript), "utf8"); +assert(reportText.includes("5 passed") && transcript.includes("All 5 tests passed") + && transcript.includes("paused") && transcript.includes("completed"), + "The source transcript does not contain the expected test, checkpoint, and completion evidence."); + +const timecode = (seconds) => { + const frame = Math.round(seconds * config.fps); + return [Math.floor(frame / 108000), Math.floor(frame / 1800) % 60, Math.floor(frame / 30) % 60, frame % 30] + .map((part) => String(part).padStart(2, "0")).join(":"); +}; +let cursor = 0; +for (const scene of config.scenes) { + scene.start = cursor; + scene.end = cursor + scene.duration; + cursor = scene.end; + if (scene.shots) { + const seconds = scene.shots.reduce((sum, shot) => sum + shot.to - shot.from + shot.hold, 0); + assert(Math.abs(seconds - scene.duration) < 0.001, `${scene.id}: shots do not fit the scene.`); + } +} +assert(cursor <= config.maximumSeconds, "The edit exceeds the requested duration limit."); +let audioManifest; +try { + audioManifest = JSON.parse(await fs.readFile(resolve(root, "assets/narration/manifest.json"), "utf8")); +} catch (error) { + if (error.code !== "ENOENT") throw error; +} +const audioGenerated = audioManifest?.segments?.length === config.scenes.length + && config.scenes.every((scene, index) => audioManifest.segments[index].id === scene.id + && audioManifest.segments[index].text === scene.narration); +const purpose = config.scenes.find((scene) => scene.kind === "purpose"); +assert(purpose?.points?.length === 3 && purpose.example, "The explanation needs three points and a demo sentence."); +const wordKey = (text) => text.toLowerCase().replace(/[^\p{L}\p{N}]/gu, ""); +async function makeWordSync(scene, revealItems) { + let record; + if (audioGenerated) { + const segment = audioManifest.segments.find((candidate) => candidate.id === scene.id); + record = JSON.parse(await fs.readFile(resolve(root, segment.alignmentFile), "utf8")); + assert(record.text === scene.narration, `${scene.id}: the alignment is stale.`); + const hash = createHash("sha256").update(await fs.readFile(resolve(root, record.audioFile))).digest("hex"); + assert(hash === record.audioSha256, `${scene.id}: the audio changed after alignment.`); + } + const sync = { + timingSource: audioGenerated ? "elevenlabs-word-alignment" : "editorial-without-audio", + sceneId: scene.id, sceneStart: scene.start, fps: config.fps, + ...(record ? { audioSha256: record.audioSha256, alignmentFile: `assets/narration/segments/${scene.id}.json` } : {}), + reveals: revealItems.map((item) => { + let spokenStart = null; + let spokenEnd = null; + let wordIndex = null; + if (record) { + const phrase = item.phrase.split(/\s+/).map(wordKey); + const words = record.words; + const matches = words.flatMap((_, index) => + phrase.every((word, offset) => wordKey(words[index + offset]?.word || "") === word) ? [index] : []); + assert(matches.length === 1, `The narration must say "${item.phrase}" exactly once.`); + wordIndex = matches[0]; + spokenStart = scene.speech[0] + words[wordIndex].start; + spokenEnd = scene.speech[0] + words[wordIndex + phrase.length - 1].end; + } + const leadSeconds = scene.kind === "hook" ? 0.06 : 0.08; + const revealSeconds = scene.kind === "hook" ? 0.12 : scene.callouts ? 0.5 : 0.24; + const revealStart = spokenStart === null ? item.editorialStart : spokenStart - leadSeconds; + const settledAt = revealStart + revealSeconds; + assert(revealStart >= 0 && settledAt < scene.duration, `The reveal for "${item.text}" does not fit.`); + return { selector: item.selector, text: item.text, phrase: item.phrase, wordIndex, spokenStart, spokenEnd, + revealStart, settledAt, leadSeconds, settleSeconds: revealSeconds - leadSeconds, + ...(item.rect ? { id: item.id, rect: item.rect, color: item.color, + endAt: item.untilEnd ? scene.duration : Math.min(scene.duration - 0.6, (spokenEnd ?? settledAt) + item.holdSeconds) } : {}) }; + }), + }; + assert(sync.reveals.every((event, index, all) => + index === 0 || event.revealStart > (scene.kind === "hook" ? all[index - 1].revealStart : all[index - 1].settledAt)), + "Reveals must follow the spoken order."); + scene.motion ||= []; + scene.motion.push(...sync.reveals.map((event) => [event.revealStart, event.settledAt])); + scene.motion.push(...sync.reveals.filter((event) => event.endAt).map((event) => [event.endAt - 0.25, event.endAt])); + await fs.writeFile(resolve(assets, `${scene.id}-sync.json`), JSON.stringify(sync, null, 2) + "\n"); + return sync; +} +const purposeSync = await makeWordSync(purpose, [ + ...purpose.points.map((point, index) => ({ + ...point, phrase: point.text, selector: `.purpose-point:nth-child(${index + 1})`, + })), + { ...purpose.example, selector: ".purpose-example" }, +]); +const focus = config.scenes.find((scene) => scene.kind === "focus"); +assert(focus?.steps?.length === 4, "The selected scenario needs four steps."); +const focusSync = await makeWordSync(focus, [ + ...focus.steps.map((step, index) => ({ + text: step.title, phrase: step.title, editorialStart: step.editorialStart, + selector: `.focus-step:nth-child(${index + 1})`, + })), + { text: focus.outcome, phrase: focus.outcomePhrase, selector: ".focus-outcome", editorialStart: 13 }, + { text: focus.registered, phrase: focus.registeredPhrase, selector: ".focus-registered", editorialStart: 14 }, +]); +const hook = config.scenes.find((scene) => scene.kind === "hook"); +assert(hook && hook.narration.startsWith(hook.wordLines.join(" ")), "The hook's visible words must match its speech."); +const hookSync = await makeWordSync(hook, [ + ...hook.wordLines.join(" ").split(/\s+/).map((text, index) => ({ + text, phrase: text, selector: `.hook-word[data-word-index="${index}"]`, editorialStart: 0.6 + index * 0.35, + })), + { text: hook.definition, phrase: hook.definitionPhrase, selector: ".hook-definition", editorialStart: 6 }, +]); +const calloutSync = []; +for (const scene of config.scenes.filter((candidate) => candidate.callouts?.length)) { + for (const callout of scene.callouts) { + const [left, top, width, height] = callout.rect; + assert(scene.kind === "footage" && left >= 4 && top >= config.console.top + 4 && width > 0 && height > 0 + && left + width < config.width - 4 && top + height < config.height - 4 && /^#[\da-f]{6}$/i.test(callout.color), + `${scene.id}: the callout must fit the native console.`); + } + calloutSync.push(await makeWordSync(scene, scene.callouts.map((callout, index) => ({ + ...callout, text: callout.id, selector: `#callout-${callout.id}`, editorialStart: 0.6 + index * 2, + })))); +} +await fs.writeFile(resolve(assets, "callout-sync.json"), JSON.stringify(calloutSync, null, 2) + "\n"); +const narration = { + timingStatus: config.timingStatus, fps: config.fps, durationSeconds: cursor, + audioGenerated, + hookSync, purposeSync, focusSync, calloutSync, + synthesisNotes: [ + "Synthesize one cue at a time; timestamps and visual directions are not spoken.", + "Speech windows are editorial targets, not provider word alignment.", + "Measure the actual ElevenLabs character alignment before assembling final audio.", + "Do not speed speech unnaturally to fill a window; use the reserved reading holds.", + "Pronounce CLI as C L I, QR as Q R, and R as the letter R. Say /workflows as slash workflows.", + ], + cues: config.scenes.map((scene) => { + const words = scene.narration.split(/\s+/).length; + const speechStart = scene.start + scene.speech[0]; + const speechEnd = scene.start + scene.speech[1]; + const maximumWpm = words / (speechEnd - speechStart) * 60; + assert(maximumWpm <= config.maximumNarrationWpm, `${scene.id}: speech window is too short (${maximumWpm.toFixed(1)} WPM).`); + let shotCursor = scene.start; + const pictureTiming = (scene.shots || []).map((shot) => { + const playbackStart = shotCursor; + const playbackEnd = shotCursor + shot.to - shot.from; + const holdEnd = playbackEnd + shot.hold; + shotCursor = holdEnd; + return { + playbackStart, playbackEnd, holdEnd, source: scene.source, + sourceStart: shot.from, sourceEnd: shot.to, + }; + }); + const generated = audioGenerated ? audioManifest.segments.find((segment) => segment.id === scene.id) : undefined; + return { + id: scene.id, sceneStart: scene.start, sceneEnd: scene.end, speechStart, speechEnd, + inTimecode: timecode(speechStart), outTimecode: timecode(speechEnd), + text: scene.narration, words, budgetSeconds: speechEnd - speechStart, + requiredWpm: Math.round(maximumWpm), silentTailSeconds: scene.duration - scene.speech[1], + visualCue: scene.headline || scene.kind, + pictureTiming, + ...(generated ? { + audioFile: generated.audioFile, + audioAlignmentFile: generated.alignmentFile, + measuredSpeechStart: speechStart + generated.previewWords[0].start - generated.previewStart, + measuredSpeechEnd: speechStart + generated.previewWords.at(-1).end - generated.previewStart, + audioEnd: speechStart + generated.duration, + } : {}), + }; + }), +}; +await fs.writeFile(resolve(root, "narration-timing.json"), JSON.stringify(narration, null, 2) + "\n"); +const script = [ + "# Dynamic Workflows - timed narration script", "", + `Picture length: **${cursor} seconds** at **30 fps**.`, + audioGenerated + ? "ElevenLabs audio has been generated. Actual speech alignment and listening-preview timing are in assets/narration/manifest.json." + : "Audio for the current script has not yet been generated.", + "These are editorial recording windows, not measured word-level alignment.", + "Record only the quoted speech. Timecodes, directions, and reading holds are not spoken.", + "Timecodes are HH:MM:SS:FF at 30 fps. The JSON sidecar also contains seconds.", "", + "## ElevenLabs handoff", "", + ...narration.synthesisNotes.map((note) => `- ${note}`), "", + "Keep the voice natural. The end of each speech window leaves a deliberate reading hold.", + "If measured speech overruns, revise the text or use an available hold; do not silently truncate it.", "", + ...narration.cues.flatMap((cue) => [ + `## ${cue.id} - ${timecode(cue.sceneStart)} to ${timecode(cue.sceneEnd)}`, "", + `**Speak:** ${cue.inTimecode} to ${cue.outTimecode} (${cue.budgetSeconds.toFixed(1)} s available; about ${cue.requiredWpm} words/minute if the whole window is used).`, "", + `> ${cue.text}`, "", + ...(cue.audioFile ? [ + `**Measured speech:** ${timecode(cue.measuredSpeechStart)} to ${timecode(cue.measuredSpeechEnd)}. Audio clip ends at ${timecode(cue.audioEnd)}; character alignment: \`${cue.audioAlignmentFile}\`.`, "", + ] : []), + `**Picture:** ${cue.visualCue}. **Then hold:** ${cue.silentTailSeconds.toFixed(1)} s with no speech.`, "", + ...cue.pictureTiming.map((shot) => `- Picture movement: ${timecode(shot.playbackStart)}-${timecode(shot.playbackEnd)}; reading freeze: ${timecode(shot.playbackEnd)}-${timecode(shot.holdEnd)}.`), + ...(cue.pictureTiming.length ? [""] : []), + ]), + "## Explanation reveal timing", "", + ...[hookSync, purposeSync, focusSync, ...calloutSync].flatMap((sync) => sync.reveals.map((event) => + `- "${event.text}": reveal ${timecode(sync.sceneStart + event.revealStart)}; ` + + (event.spokenStart === null ? "editorial target; no synthesized word timing." + : `spoken phrase ${timecode(sync.sceneStart + event.spokenStart)}; settled ${timecode(sync.sceneStart + event.settledAt)}.`))), + "", + "## Accuracy boundaries", "", + "- The authoring recording starts without a workflow extension. Copilot creates and registers the project extension from the visible request.", + "- The subsequent run uses that unchanged generated extension; its source hashes are recorded in the origin evidence.", + "- `/workflows` manages runs; the natural-language request starts this workflow.", + "- The checkpoint is defined in this example, not automatically added to every workflow.", + "- This example journals its checks; not every unsaved operation is skipped on resume.", + "- The report's two gaps come from the actual saved assessment.", + "- Automatic tool approval applies only to the isolated demo fixture.", + "- The lower-right QR links to the official usage guide and stays visible through the end.", "", + "- The complete console is shown at native size, below a separate 64px title strip.", + `- Console text is ${config.console.fontSize}px; the title and brief step labels are 28px and 26px.`, "", +].join("\n"); +await fs.writeFile(resolve(root, "narration-script.md"), script); +if (audioGenerated) { + const captions = []; + for (const cue of narration.cues) { + const segment = audioManifest.segments.find((candidate) => candidate.id === cue.id); + let chunk = []; + const flush = (nextWord) => { + if (!chunk.length) return; + const lines = [""]; + for (const word of chunk) { + const text = word.text || word.word; + if (lines.at(-1).length + text.length + 1 > 43) lines.push(""); + lines[lines.length - 1] += (lines.at(-1) ? " " : "") + text; + } + assert(lines.length <= 2, `${cue.id}: caption exceeds two lines.`); + const start = cue.speechStart + chunk[0].start - segment.previewStart; + const end = Math.min(cue.sceneEnd, cue.speechStart + chunk.at(-1).end - segment.previewStart + 0.15, + nextWord ? cue.speechStart + nextWord.start - segment.previewStart : Infinity); + assert(end > start && (!captions.length || start >= captions.at(-1).end - 0.001), "Captions overlap or have invalid timing."); + captions.push({ start, end, text: lines.join("\n") }); + chunk = []; + }; + for (const word of segment.previewWords) { + if (chunk.length && (chunk.map((part) => part.text || part.word).join(" ").length + (word.text || word.word).length + 1 > 78 + || word.end - chunk[0].start > 4)) flush(word); + chunk.push(word); + } + flush(); + } + const canonical = config.scenes.map((scene) => scene.narration).join(" ").replace(/\s+/g, " "); + assert(captions.map((caption) => caption.text).join(" ").replace(/\s+/g, " ") === canonical, + "Authored captions must exactly reproduce the approved narration."); + const subtitleTime = (seconds) => { + const milliseconds = Math.round(seconds * 1000); + return `${String(Math.floor(milliseconds / 3600000)).padStart(2, "0")}:${String(Math.floor(milliseconds / 60000) % 60).padStart(2, "0")}:${String(Math.floor(milliseconds / 1000) % 60).padStart(2, "0")},${String(milliseconds % 1000).padStart(3, "0")}`; + }; + await fs.writeFile(resolve(root, "narration-captions.srt"), captions.map((caption, index) => + `${index + 1}\n${subtitleTime(caption.start)} --> ${subtitleTime(caption.end)}\n${caption.text}\n`).join("\n")); +} + +const routes = new Map([ + ["/", ["production/visuals.html", "text/html"]], + ["/production/styles.css", ["production/styles.css", "text/css"]], + ["/production/visuals.js", ["production/visuals.js", "text/javascript"]], + ["/production/timeline.json", ["production/timeline.json", "application/json"]], + ["/assets/production/report.json", ["assets/production/report.json", "application/json"]], + ["/assets/production/purpose-sync.json", ["assets/production/purpose-sync.json", "application/json"]], + ["/assets/production/focus-sync.json", ["assets/production/focus-sync.json", "application/json"]], + ["/assets/production/hook-sync.json", ["assets/production/hook-sync.json", "application/json"]], + ["/assets/production/callout-sync.json", ["assets/production/callout-sync.json", "application/json"]], + ["/assets/production/resource-qr.png", ["assets/production/resource-qr.png", "image/png"]], + ["/assets/production/GitHub_Invertocat_White.svg", ["assets/production/GitHub_Invertocat_White.svg", "image/svg+xml"]], + ["/assets/production/fonts/MonaSansVF.woff2", ["assets/production/fonts/MonaSansVF.woff2", "font/woff2"]], + ["/assets/production/fonts/MonaSansMonoVF.woff2", ["assets/production/fonts/MonaSansMonoVF.woff2", "font/woff2"]], +]); +const server = http.createServer(async (request, response) => { + const pathname = new URL(request.url, "http://localhost").pathname; + const entry = routes.get(pathname); + if (pathname === "/vendor/gsap.js") { + response.writeHead(200, { "content-type": "text/javascript" }); + response.end(await fs.readFile(requireTool.resolve("gsap/dist/gsap.js"))); + } else if (entry) { + response.writeHead(200, { "content-type": entry[1] }); + response.end(await fs.readFile(resolve(root, entry[0]))); + } else { + response.writeHead(404); response.end("Not found"); + } +}); +server.listen(0, "127.0.0.1"); +await once(server, "listening"); +const origin = `http://127.0.0.1:${server.address().port}`; +const browser = await chromium.launch({ headless: true, args: ["--disable-background-networking"] }); +const context = await browser.newContext({ viewport: { width: 1920, height: 1080 }, deviceScaleFactor: 1 }); +await context.route("**/*", (route) => new URL(route.request().url()).origin === origin ? route.continue() : route.abort()); +const page = await context.newPage(); +page.on("pageerror", (error) => { throw error; }); + +async function setScene(scene, at, overlay = false) { + await page.evaluate(([id, seconds, transparent]) => window.renderScene(id, seconds, transparent), [scene.id, at, overlay]); +} + +async function checkLayout(scene) { + const problems = await page.evaluate(() => [...document.querySelectorAll("h1,h2,p,.intro-product,.intro-subject,.closing-command,.qr-label")].flatMap((element) => { + let ancestor = element; + while (ancestor && ancestor !== document.body) { + if (Number(getComputedStyle(ancestor).opacity) < 0.05) return []; + ancestor = ancestor.parentElement; + } + const rect = element.getBoundingClientRect(); + const fontSize = Number.parseFloat(getComputedStyle(element).fontSize); + const text = element.textContent.trim(); + const issues = []; + const hasDirectText = [...element.childNodes].some((node) => node.nodeType === Node.TEXT_NODE && node.textContent.trim()); + if (hasDirectText && fontSize < 26) issues.push(`Text smaller than 26px: ${text}`); + const bottomLimit = element.matches(".qr-label") ? 1048 : 884; + if (rect.left < -1 || rect.right > 1921 || rect.top < -1 || rect.bottom > bottomLimit) issues.push(`Text outside the content zone: ${text} (${JSON.stringify(rect.toJSON())})`); + if (element.scrollWidth > element.clientWidth + 2) issues.push(`Horizontal text overflow: ${text}`); + return issues; + })); + assert(!problems.length, `${scene.id}: ${problems.join("\n")}`); +} + +async function checkWordSync(scene, sync) { + for (const event of sync.reveals) { + await setScene(scene, event.revealStart - 0.05); + const before = await page.$eval(event.selector, (element) => Number(getComputedStyle(element).opacity)); + assert(before < 0.01, `"${event.text}" appears before its reveal.`); + if (event.spokenStart !== null) { + await setScene(scene, event.spokenStart); + const during = await page.$eval(event.selector, (element) => Number(getComputedStyle(element).opacity)); + assert(during >= 0.65, `"${event.text}" is not legible when its phrase begins.`); + event.opacityAtWord = during; + } + await setScene(scene, event.settledAt + 0.001); + if (scene.kind === "focus" && event.selector.startsWith(".focus-step")) { + const footerHidden = await page.$$eval(".focus-outcome,.focus-registered", (elements) => + elements.every((element) => Number(getComputedStyle(element).opacity) < 0.01)); + assert(footerHidden, "The focus footer must stay hidden while the four cards are introduced."); + } + event.bounds = await page.$eval(event.selector, (element) => { + const rect = element.getBoundingClientRect(); + return { left: Math.floor(rect.left), top: Math.floor(rect.top), width: Math.ceil(rect.width), height: Math.ceil(rect.height) }; + }); + await page.screenshot({ path: resolve(review, `${scene.id}-beat-${sync.reveals.indexOf(event) + 1}.png`) }); + } + await fs.writeFile(resolve(assets, `${scene.id}-sync.json`), JSON.stringify(sync, null, 2) + "\n"); +} + +async function animatedClip(scene, file, transparent = false) { + const child = spawn("ffmpeg", [ + "-hide_banner", "-loglevel", "error", "-y", "-f", "image2pipe", "-framerate", "30", "-i", "-", + "-an", ...(transparent ? ["-c:v", "qtrle", "-pix_fmt", "argb"] : ["-c:v", "libx264", "-preset", "fast", "-crf", "18", "-pix_fmt", "yuv420p"]), + "-r", "30", "-video_track_timescale", "15360", "-movflags", "+faststart", file, + ], { stdio: ["pipe", "ignore", "pipe"] }); + let errorText = ""; + child.stderr.on("data", (chunk) => { errorText += chunk; }); + const closed = once(child, "close"); + let buffer; + let wasMoving = false; + for (let frame = 0; frame < Math.round(scene.duration * 30); frame++) { + const seconds = frame / 30; + const moving = scene.motion.some(([from, to]) => seconds >= from && seconds <= to); + if (!buffer || moving || wasMoving) { + await setScene(scene, seconds, transparent); + buffer = await page.screenshot({ type: "png", animations: "allow", omitBackground: transparent }); + } + wasMoving = moving; + if (!child.stdin.write(buffer)) await once(child.stdin, "drain"); + } + child.stdin.end(); + const [code] = await closed; + assert(code === 0, `${scene.id} encoder failed: ${errorText}`); +} + +async function footageClip(scene, overlay, file) { + const args = ["-hide_banner", "-loglevel", "error", "-y"]; + for (const shot of scene.shots) args.push("-ss", String(shot.from), "-t", String(shot.to - shot.from), "-i", resolve(root, scene.source)); + args.push(...(scene.callouts ? [] : ["-loop", "1"]), "-i", overlay); + const filters = scene.shots.map((shot, index) => { + return `[${index}:v]setsar=1,fps=30,tpad=stop_mode=clone:stop_duration=${shot.hold},trim=duration=${shot.to - shot.from + shot.hold},setpts=PTS-STARTPTS[s${index}]`; + }); + filters.push(scene.shots.map((_, index) => `[s${index}]`).join("") + `concat=n=${scene.shots.length}:v=1:a=0[proof]`); + filters.push(`[proof]pad=1920:1080:0:${config.console.top}:color=0x0e1116[placed]`); + filters.push(`[placed][${scene.shots.length}:v]overlay=0:0:shortest=1[out]`); + args.push("-filter_complex", filters.join(";"), "-map", "[out]", "-t", String(scene.duration), + "-an", "-c:v", "libx264", "-preset", "fast", "-crf", "18", "-pix_fmt", "yuv420p", + "-r", "30", "-video_track_timescale", "15360", "-movflags", "+faststart", file); + await run("ffmpeg", args); +} + +try { + const response = await page.goto(origin); + assert(response?.ok(), "The local composition server did not respond."); + await page.waitForFunction(() => window.visualsReady); + const sceneFiles = []; + const sourceInfo = new Map(); + for (const scene of config.scenes) { + console.log(`${stillsOnly ? "Inspecting" : "Rendering"} ${scene.id} (${scene.start}-${scene.end}s)`); + if (scene.kind === "purpose") await checkWordSync(scene, purposeSync); + if (scene.kind === "focus") await checkWordSync(scene, focusSync); + if (scene.kind === "hook") await checkWordSync(scene, hookSync); + if (scene.callouts) { + const sync = calloutSync.find((candidate) => candidate.sceneId === scene.id); + for (const event of sync.reveals) { + await setScene(scene, event.revealStart - 0.05, true); + assert(await page.$eval(event.selector, (element) => Number(getComputedStyle(element).opacity)) < 0.01, + `${event.id}: callout appears before its spoken anchor.`); + await setScene(scene, event.settledAt + 0.01, true); + assert(await page.$eval(`${event.selector} rect`, (element) => Number(element.getAttribute("stroke-dashoffset"))) < 0.01, + `${event.id}: callout did not finish drawing.`); + const overlay = resolve(review, `${scene.id}-${event.id}-overlay.png`); + await page.screenshot({ path: overlay, omitBackground: true }); + let remaining = event.settledAt + 0.01; + let sourceAt; + for (const shot of scene.shots) { + const play = shot.to - shot.from; + if (remaining < play + shot.hold) { sourceAt = shot.from + Math.min(remaining, play - 0.04); break; } + remaining -= play + shot.hold; + } + assert(Number.isFinite(sourceAt), `${event.id}: no corresponding source frame.`); + await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-ss", String(sourceAt), + "-i", resolve(root, scene.source), "-i", overlay, "-filter_complex", + `[0:v]pad=1920:1080:0:${config.console.top}:color=0x0e1116[bg];[bg][1:v]overlay=0:0[out]`, + "-map", "[out]", "-frames:v", "1", resolve(review, `${scene.id}-${event.id}-proof.png`)]); + } + } + await setScene(scene, scene.duration - 0.1, scene.kind === "footage"); + await checkLayout(scene); + if (scene.kind === "closing") { + const qr = await page.$eval(".qr-code", (element) => { + const rect = element.getBoundingClientRect(); + return { x: rect.x, y: rect.y, size: rect.width }; + }); + assert(qr.x === config.qr.x && qr.y === config.qr.y && qr.size === config.qr.size, + "The visible QR must match its verified lower-right bounds."); + } + const still = resolve(review, `${scene.id}.png`); + await page.screenshot({ path: still, omitBackground: scene.kind === "footage" }); + if (scene.kind === "footage") { + if (!sourceInfo.has(scene.source)) { + sourceInfo.set(scene.source, JSON.parse(await run("ffprobe", ["-v", "error", "-select_streams", "v:0", + "-show_entries", "stream=width,height", "-show_entries", "format=duration", "-of", "json", resolve(root, scene.source)]))); + } + const source = sourceInfo.get(scene.source); + assert(source.streams[0].width === config.console.width && source.streams[0].height === config.console.height, + `${scene.id}: record a native 1920x1016 console; do not crop or stretch old footage.`); + for (const shot of scene.shots) { + assert(shot.from >= 0 && shot.to > shot.from && shot.to <= Number(source.format.duration) && shot.hold >= 0 && !shot.crop, + `${scene.id}: source range is invalid or introduces a crop.`); + } + const overlay = resolve(assets, `${scene.id}-overlay.png`); + await fs.copyFile(still, overlay); + const shot = scene.shots[0]; + await run("ffmpeg", [ + "-hide_banner", "-loglevel", "error", "-y", "-ss", String(shot.to - 0.1), "-i", resolve(root, scene.source), + "-i", overlay, "-filter_complex", + `[0:v]pad=1920:1080:0:${config.console.top}:color=0x0e1116[bg];[bg][1:v]overlay=0:0[out]`, + "-map", "[out]", "-frames:v", "1", resolve(review, `${scene.id}-proof.png`), + ]); + } + if (stillsOnly) continue; + const file = resolve(assets, `${scene.id}.mp4`); + if (scene.kind === "footage") { + let overlay = resolve(assets, `${scene.id}-overlay.png`); + if (scene.callouts) { + overlay = resolve(assets, `${scene.id}-overlay.mov`); + await animatedClip(scene, overlay, true); + } + await footageClip(scene, overlay, file); + } + else await animatedClip(scene, file); + sceneFiles.push(file); + } + if (!stillsOnly) { + const concat = resolve(assets, "concat.txt"); + await fs.writeFile(concat, sceneFiles.map((file) => `file '${file.replaceAll("'", "'\\''")}'`).join("\n")); + await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-f", "concat", "-safe", "0", "-i", concat, + "-map", "0:v:0", "-an", "-c:v", "copy", "-movflags", "+faststart", "-map_metadata", "-1", output]); + const hash = createHash("sha256").update(await fs.readFile(output)).digest("hex"); + await fs.writeFile(resolve(review, "build.json"), JSON.stringify({ + output, duration: cursor, fps: 30, audioIncluded: false, narrationGenerated: audioGenerated, sha256: hash, + edits: `Full-width native ${config.console.fontSize}px console, a reserved 64px title strip, cuts, and reading holds; no crop, scaling, or simulated AI output.`, + scenes: config.scenes.map(({ id, start, end }) => ({ id, start, end })), + }, null, 2)); + console.log(`Built ${output} (${cursor}s). Picture master is silent; narration is delivered separately.`); + } +} finally { + await context.close(); + await browser.close(); + await new Promise((done) => server.close(done)); +} diff --git a/videos/workflows/production/evidence.json b/videos/workflows/production/evidence.json new file mode 100644 index 00000000..4c08f39c --- /dev/null +++ b/videos/workflows/production/evidence.json @@ -0,0 +1,110 @@ +{ + "scope": "Evidence for the 156.03-second creation-to-report story and its ElevenLabs narration. Claims apply to the recorded example unless explicitly attributed to the feature.", + "officialGuide": "https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-dynamic-workflows", + "featureClaims": [ + { + "claim": "A dynamic workflow defines a reusable process in code, combining commands, agents, and optional human checkpoints.", + "source": "https://docs.github.com/en/copilot/concepts/agent-capabilities/agent-powered-workflows-and-operations/dynamic-workflows", + "section": "About dynamic workflows", + "quote": "A dynamic workflow is a program that defines how a task is carried out. It can combine automated steps with the work of one or more agents." + }, + { + "claim": "Repeatable release checks and code reviews are appropriate uses; simple questions usually need only a normal prompt.", + "source": "https://docs.github.com/en/copilot/concepts/agent-capabilities/agent-powered-workflows-and-operations/dynamic-workflows", + "section": "When to use a dynamic workflow", + "quote": "Use a dynamic workflow when you want to define a process you can reuse, or when a single task needs clear stages, checks, or limits." + }, + { + "claim": "Experimental features must be enabled.", + "section": "Prerequisite", + "quote": "To use dynamic workflows in Copilot CLI, you must enable experimental features by running the CLI with the --experimental command-line option, or by using /experimental on in an interactive session." + }, + { + "claim": "The named natural-language request runs an already registered workflow.", + "section": "Running a dynamic workflow", + "quote": "Use the workflow's registered name, and supply any required inputs." + }, + { + "claim": "Creation, registration, and execution are separate.", + "section": "Creating a dynamic workflow", + "quote": "Creating and registering a workflow does not start a run." + }, + { + "claim": "/workflows lists runs; Enter opens details.", + "section": "Monitoring and managing dynamic workflow runs", + "quote": "In an interactive session, enter /workflows. The currently running and recently completed dynamic workflow runs are listed." + }, + { + "claim": "R resumes a resumable run.", + "section": "Resuming a run", + "quote": "Press R to resume the run." + }, + { + "claim": "Saved results can be reused, but unsaved work may rerun.", + "section": "Resuming a run", + "quote": "The workflow can reuse saved results from completed steps and subagents, rather than starting a new run. Work that was not saved may need to run again." + } + ], + "introductoryScenarios": [ + { "name": "Prepare a release", "outcome": "Passing checks and missing test coverage", "demonstrated": true }, + { "name": "Review a pull request", "outcome": "Collected check results and review findings", "demonstrated": false }, + { "name": "Investigate a failed build", "outcome": "Logs, evidence, and suggested next steps", "demonstrated": false } + ], + "exampleEvidence": [ + { + "claim": "Copilot creates and registers book-release-check from the actual recorded natural-language request, without preloading or running it.", + "artifact": "creation/assets/creation-raw.mp4", + "supportingArtifact": "creation/assets/creation-terminal.txt", + "mechanism": "The generated project extension uses defineWorkflow and joinSession. The native output confirms creation, registration, and Not run." + }, + { + "claim": "The example journals checks and defines a durable human-review checkpoint.", + "artifact": "creation/assets/generated-extension.mjs", + "mechanism": "ctx.step('pytest-v1', ...), ctx.step('cli-help-v1', ...), and ctx.pause('human-review-v1')." + }, + { + "claim": "The run executes the unchanged extension shown being created, and application source files remain unchanged.", + "artifact": "creation/assets/workflow-origin.json", + "mechanism": "The generated source SHA256 matches both before-run and after-run hashes. The actual report identifies the same run shown in the terminal." + }, + { + "claim": "Five tests and CLI help passed in the recorded run.", + "artifact": "creation/assets/workflows-raw.mp4", + "sourceSeconds": [30, 32], + "supportingArtifact": "creation/assets/release-report.md" + }, + { + "claim": "One agent is active after resume; the phases then complete.", + "artifact": "creation/assets/workflows-raw.mp4", + "sourceSeconds": [43.5, 60] + }, + { + "claim": "The new report names corrupted-data recovery and case-insensitive author-matching coverage gaps.", + "artifact": "creation/assets/release-report.md", + "presentation": "A real terminal recording selects the actual header and findings with sed and wraps them with fold -s -w 112. Omitted check-log detail remains in the unchanged report; no assessment is replaced or rewritten." + }, + { + "claim": "Tool auto-approval is limited to this disposable recording fixture.", + "artifact": "capture/tapes/workflow-created-run.tape", + "supportingArtifact": "capture/record-created-workflow.sh", + "boundary": "Not a recommendation for live projects. Extension code itself also requires trust." + } + ], + "editorialBoundaries": [ + "The opening presents three illustrative workflows a user could define, not three built-in commands. Only the book-app release check is executed.", + "The story asks what works and what still needs testing, then answers it with the actual report. No release is approved, deployed, or performed.", + "Recorded waiting intervals and excess freezes are cut to follow actual narration. The run retains the submitted prompt and started response; resume retains the keypress and live agent; the report retains its real command and output. No source footage is sped up.", + "The title asks what dynamic workflows are and why to use them. A separate word-revealed test-results hook explains their reusable process before a spoken lead-in introduces the examples.", + "The title includes its question mark. A verified quiet pause separates the examples lead-in from Prepare a release; the closing headline and final spoken sentence invite the viewer to Give dynamic workflows a try.", + "Eleven hook words, its definition, four scenario reveals, four workflow cards, two delayed footer lines, and seven drawn console callouts use transformed provider word timing. Encoded audio must have no quiet span longer than 1.8 seconds.", + "The focus scene's two footer lines remain hidden until all four cards have been introduced, then enter on the decision and custom-workflow narration. Four existing cues and two new authoring cues are synthesized; eight approved clips are reused.", + "Thin unfilled outlines identify existing checkpoint, test, help, assessment-phase, and report text. They do not replace source pixels or imply a live agent when the run has completed.", + "Selectable English captions are generated from approved narration and measured alignment, not automatic transcription. The encoded track must reproduce the script and spell pull request correctly.", + "This is an end-to-end authoring and run-management demonstration: describe the job, create and register its code, run it, review the checkpoint, resume, and inspect the report. Creating a workflow does not start a run.", + "No AI response has been simulated or hand-edited.", + "The native 1920x1016 console uses 26px text, filling the screen below a reserved 64px title strip. No footage is cropped, magnified, stretched, or sped up. Cuts and reading holds remain.", + "A completed workflow and passing checks do not establish production readiness.", + "The picture master stays silent. Separately generated ElevenLabs narration uses actual provider alignment; no music or word timing is fabricated.", + "The lower-right QR at x=1660, y=812 encodes the official usage guide, not an invented shortcut URL. It stays fully visible for at least eight seconds and is decoded throughout the hold and from the final frame." + ] +} diff --git a/videos/workflows/production/mux.mjs b/videos/workflows/production/mux.mjs new file mode 100644 index 00000000..b7423adc --- /dev/null +++ b/videos/workflows/production/mux.mjs @@ -0,0 +1,42 @@ +import fs from "node:fs/promises"; +import { createHash } from "node:crypto"; +import { spawn } from "node:child_process"; +import { once } from "node:events"; +import { resolve } from "node:path"; +import { root } from "./tools.mjs"; + +const timeline = JSON.parse(await fs.readFile(resolve(root, "production/timeline.json"), "utf8")); +const manifest = JSON.parse(await fs.readFile(resolve(root, "assets/narration/manifest.json"), "utf8")); +const assert = (condition, message) => { if (!condition) throw new Error(message); }; +const sha256 = (value) => createHash("sha256").update(value).digest("hex"); +const duration = timeline.scenes.reduce((sum, scene) => sum + scene.duration, 0); +assert(manifest.fitsPicture && manifest.timedFile && manifest.editorialPictureDuration === duration, + "Generate a synchronized narration track matching the current picture before finalizing."); +assert(manifest.segments.length === timeline.scenes.length + && timeline.scenes.every((scene, index) => manifest.segments[index].id === scene.id + && manifest.segments[index].text === scene.narration), + "Narration does not match the current script."); +const audio = resolve(root, manifest.timedFile); +assert(sha256(await fs.readFile(audio)) === manifest.timedSha256, "The synchronized narration audio has changed."); +const source = resolve(root, "renders/workflows-demo-console-1080p.mp4"); +const output = resolve(root, "renders/workflows-demo-narrated-1080p.mp4"); +const captions = resolve(root, "narration-captions.srt"); +await fs.access(captions); +const child = spawn("ffmpeg", [ + "-hide_banner", "-loglevel", "error", "-y", "-i", source, "-i", audio, "-i", captions, + "-map", "0:v:0", "-map", "1:a:0", "-map", "2:s:0", "-c:v", "copy", "-c:a", "aac", "-b:a", "192k", + "-ar", "48000", "-metadata:s:a:0", "language=eng", "-map_metadata", "-1", + "-c:s", "mov_text", "-metadata:s:s:0", "language=eng", "-metadata:s:s:0", "title=English", + "-disposition:s:0", "0", + "-movflags", "+faststart", output, +], { stdio: ["ignore", "ignore", "pipe"] }); +let stderr = ""; +child.stderr.on("data", (chunk) => { stderr += chunk; }); +const [code] = await once(child, "close"); +assert(code === 0, `Narration mux failed (${code}): ${stderr}`); +await fs.writeFile(resolve(root, "review/narrated-build.json"), JSON.stringify({ + output, duration, videoSource: source, audioSource: audio, captionsSource: captions, + voiceId: manifest.voiceId, modelId: manifest.modelId, + sha256: sha256(await fs.readFile(output)), videoReencoded: false, +}, null, 2) + "\n"); +console.log(`Narrated export: ${output}`); diff --git a/videos/workflows/production/narrate.mjs b/videos/workflows/production/narrate.mjs new file mode 100644 index 00000000..66cd09fb --- /dev/null +++ b/videos/workflows/production/narrate.mjs @@ -0,0 +1,319 @@ +import fs from "node:fs/promises"; +import { spawn } from "node:child_process"; +import { once } from "node:events"; +import { createHash } from "node:crypto"; +import { resolve } from "node:path"; +import { pathToFileURL } from "node:url"; +import { root } from "./tools.mjs"; + +const tools = process.env.NARRATION_TOOLS || process.env.VIDEO_TOOLS; +if (!tools) throw new Error("Set NARRATION_TOOLS or VIDEO_TOOLS to the existing content-to-video template directory."); +const { + validateAlignment, wordsFromAlignment, rateFactor, spokenNarration, displayAlignment, + pauseCuts, removePauses, shiftAlignment, tailNoise, silence, +} = await import(pathToFileURL(resolve(tools, "scripts/alignment.mjs")).href); +const timeline = JSON.parse(await fs.readFile(resolve(root, "production/timeline.json"), "utf8")); +const settings = JSON.parse(await fs.readFile(resolve(root, "production/narration-config.json"), "utf8")); +const audioRoot = resolve(root, "assets/narration"); +const assert = (condition, message) => { if (!condition) throw new Error(message); }; +const hash = (value) => createHash("sha256").update(value).digest("hex"); +const tempo = rateFactor(settings.prosodyRate); +assert(typeof settings.modelId === "string" && settings.modelId.length > 0 + && typeof settings.voiceId === "string" && settings.voiceId.length > 0, + "Configure the explicitly approved voice and model before synthesis."); + +async function run(command, args, input) { + const child = spawn(command, args, { stdio: ["pipe", "pipe", "pipe"], timeout: 240000 }); + let stdout = ""; + let stderr = ""; + child.stdout.on("data", (chunk) => { stdout += chunk; }); + child.stderr.on("data", (chunk) => { stderr += chunk; }); + const closed = once(child, "close"); + child.stdin.end(input); + const [code] = await closed; + assert(code === 0, command === "elevenlabs" + ? `ElevenLabs ${args[0]} failed (${code}); provider output was not printed. Authentication or service access may need attention.` + : `${command} failed (${code}): ${stderr}`); + return stdout; +} + +function addSectionPauses(pcm, alignment, normalizedAlignment, plan) { + const words = wordsFromAlignment(alignment); + const key = (text) => text.toLowerCase().replace(/[^\p{L}\p{N}]/gu, ""); + const insertions = plan.before.map((phrase) => { + const target = phrase.split(/\s+/).map(key); + const matches = words.flatMap((_, index) => + target.every((word, offset) => key(words[index + offset]?.word || "") === word) ? [index] : []); + assert(matches.length === 1 && matches[0] > 0, `Cannot place a section pause before "${phrase}".`); + const index = matches[0]; + const from = words[index - 1].end; + const to = words[index].start; + // Provider word gaps can contain speech; insert the full pause plus tempo-processing margin. + const extraSamples = Math.ceil((plan.minimumSeconds + plan.tempoPaddingSeconds) * tempo * 24000); + if (!extraSamples) return { phrase, samples: 0 }; + const frame = 120; + let quietAt = -1; + let quietRms = Infinity; + for (let sample = Math.ceil(from * 24000); sample + frame <= Math.floor(to * 24000); sample += frame / 4) { + let power = 0; + for (let offset = 0; offset < frame; offset++) power += (pcm.readInt16LE((sample + offset) * 2) / 32768) ** 2; + const rms = Math.sqrt(power / frame); + if (rms < quietRms) { quietRms = rms; quietAt = sample + frame / 2; } + } + assert(quietAt >= 0 && quietRms < 0.01, `No safe silent interval before "${phrase}"; speech was not cut.`); + let boundaryLevel = Infinity; + const center = quietAt; + for (let sample = center - frame / 4; sample <= center + frame / 4; sample++) { + const level = Math.abs(pcm.readInt16LE((sample - 1) * 2)) + Math.abs(pcm.readInt16LE(sample * 2)); + if (level < boundaryLevel) { boundaryLevel = level; quietAt = sample; } + } + return { phrase, sample: quietAt, samples: extraSamples, at: quietAt / 24000, seconds: extraSamples / 24000 }; + }).filter((insertion) => insertion.samples > 0).sort((a, b) => a.sample - b.sample); + const parts = []; + let previous = 0; + for (const insertion of insertions) { + parts.push(pcm.subarray(previous * 2, insertion.sample * 2), Buffer.alloc(insertion.samples * 2)); + previous = insertion.sample; + } + parts.push(pcm.subarray(previous * 2)); + const shift = (value) => value + insertions.reduce((sum, insertion) => sum + (value >= insertion.at ? insertion.seconds : 0), 0); + const shifted = (value) => value ? { + ...value, + character_start_times_seconds: value.character_start_times_seconds.map(shift), + character_end_times_seconds: value.character_end_times_seconds.map(shift), + } : null; + return { pcm: Buffer.concat(parts), alignment: shifted(alignment), + normalizedAlignment: shifted(normalizedAlignment), insertions }; +} + +const auth = JSON.parse(await run("elevenlabs", ["auth", "status"])); +assert(auth.schemes?.some((scheme) => scheme.logged_in && scheme.scheme === "OAuth"), + "ElevenLabs OAuth is not active. Run elevenlabs auth login."); +await fs.mkdir(resolve(audioRoot, "segments"), { recursive: true }); +await fs.mkdir(resolve(audioRoot, "provider"), { recursive: true }); +let previousManifest; +try { + previousManifest = JSON.parse(await fs.readFile(resolve(audioRoot, "manifest.json"), "utf8")); +} catch (error) { + if (error.code !== "ENOENT") throw error; +} +const segments = []; +let pictureCursor = 0; +let previewCursor = 0; +for (let index = 0; index < timeline.scenes.length; index++) { + const scene = timeline.scenes[index]; + const sceneStart = pictureCursor; + pictureCursor += scene.duration; + if (index > 0) previewCursor += timeline.audioPacing.previewGapSeconds; + const pronunciations = [ + { text: "CLI", say: "C L I" }, { text: "QR", say: "Q R" }, + ].filter((entry) => new RegExp(`\\b${entry.text}\\b`).test(scene.narration)); + const spoken = spokenNarration(scene.narration, pronunciations); + const input = { + text: scene.narration, spokenText: spoken.text, ...settings, + pronunciations: spoken.replacements, + previousText: timeline.scenes[index - 1]?.narration || "", + nextText: timeline.scenes[index + 1]?.narration || "", + outputFormat: "pcm_24000", + ...(scene.pausesBefore ? { sectionPauses: { + before: scene.pausesBefore, minimumSeconds: scene.minimumPauseSeconds, tempoPaddingSeconds: 0.08, + } } : {}), + }; + const inputHash = hash(JSON.stringify(input)); + const requestHash = hash(JSON.stringify({ + text: input.spokenText, voiceId: input.voiceId, modelId: input.modelId, + voiceSettings: input.voiceSettings, previousText: input.previousText, nextText: input.nextText, + outputFormat: input.outputFormat, + })); + const clipHash = hash(JSON.stringify({ ...input, previousText: "", nextText: "" })); + const file = resolve(audioRoot, "segments", `${scene.id}.wav`); + const recordFile = resolve(audioRoot, "segments", `${scene.id}.json`); + let record; + try { + record = JSON.parse(await fs.readFile(recordFile, "utf8")); + } catch (error) { + if (error.code !== "ENOENT") throw error; + } + let cached = false; + // Preserve verified speech when only a neighboring cue changes, retaining its original request hash. + const oldIndex = previousManifest?.segments?.findIndex((segment) => segment.id === scene.id) ?? -1; + const oldContextHash = oldIndex >= 0 && previousManifest.segments[oldIndex].text === scene.narration + ? hash(JSON.stringify({ + ...input, + previousText: previousManifest.segments[oldIndex - 1]?.text || "", + nextText: previousManifest.segments[oldIndex + 1]?.text || "", + })) : null; + if (record && (record.inputHash === inputHash || record.clipHash === clipHash || record.inputHash === oldContextHash)) { + try { + cached = record.audioSha256 === hash(await fs.readFile(file)); + } catch (error) { + if (error.code !== "ENOENT") throw error; + } + if (cached && record.clipHash !== clipHash) { + record.clipHash = clipHash; + await fs.writeFile(recordFile, JSON.stringify(record, null, 2)); + } + } + if (!cached) { + const providerFile = resolve(audioRoot, "provider", `${scene.id}.json`); + let provider; + try { + provider = JSON.parse(await fs.readFile(providerFile, "utf8")); + } catch (error) { + if (error.code !== "ENOENT") throw error; + } + if (provider?.requestHash !== requestHash && provider?.inputHash !== inputHash) { + console.log(`Synthesizing ${scene.id} with the existing Ignite voice...`); + const request = { + text: spoken.text, model_id: settings.modelId, voice_settings: settings.voiceSettings, + ...(input.previousText ? { previous_text: input.previousText } : {}), + ...(input.nextText ? { next_text: input.nextText } : {}), + }; + const response = JSON.parse(await run("elevenlabs", [ + "text-to-speech", "convert_with_timestamps", "--voice-id", settings.voiceId, + "--output-format", "pcm_24000", "--json", "-", "--format", "json", + "--via", "ghcp-cli-to-video", "--no-retry", "--no-pager", + ], JSON.stringify(request))); + assert(typeof response.audio_base64 === "string" && response.audio_base64.length, + `${scene.id}: no audio was returned.`); + validateAlignment(response.alignment, spoken.text); + provider = { + inputHash, requestHash, audio_base64: response.audio_base64, alignment: response.alignment, + normalized_alignment: response.normalized_alignment || null, + }; + await fs.writeFile(providerFile, JSON.stringify(provider)); + } + let pcm = Buffer.from(provider.audio_base64, "base64"); + assert(pcm.length > 0 && pcm.length % 2 === 0, `${scene.id}: invalid PCM audio.`); + validateAlignment(provider.alignment, spoken.text); + const cuts = pauseCuts(pcm, 24000, provider.alignment, settings.maxPauseSeconds); + pcm = removePauses(pcm, 24000, cuts); + let providerAlignment = shiftAlignment(provider.alignment, cuts); + let providerNormalizedAlignment = shiftAlignment(provider.normalized_alignment, cuts); + let sectionPauses = []; + if (input.sectionPauses) { + const paused = addSectionPauses(pcm, providerAlignment, providerNormalizedAlignment, input.sectionPauses); + pcm = paused.pcm; + providerAlignment = paused.alignment; + providerNormalizedAlignment = paused.normalizedAlignment; + sectionPauses = paused.insertions; + } + const alignment = validateAlignment(displayAlignment(providerAlignment, spoken.replacements), scene.narration); + const words = wordsFromAlignment(alignment, tempo); + const finalCharacter = Math.max( + providerAlignment.character_end_times_seconds.at(-1), + providerNormalizedAlignment?.character_end_times_seconds.at(-1) || 0, + ); + assert(finalCharacter <= pcm.length / 48000 + 0.12, `${scene.id}: alignment exceeds the returned audio.`); + const needed = Math.ceil((finalCharacter + settings.tailSeconds) * 24000) * 2; + if (pcm.length < needed) pcm = Buffer.concat([pcm, Buffer.alloc(needed - pcm.length)]); + const keep = Math.min(pcm.length / 48000 / tempo, finalCharacter / tempo + settings.tailSeconds); + assert(keep >= words.at(-1).end, `${scene.id}: trimming would cut speech.`); + const temporary = resolve(audioRoot, "segments", `${scene.id}.pcm`); + await fs.writeFile(temporary, pcm); + try { + await run("ffmpeg", [ + "-hide_banner", "-loglevel", "error", "-y", "-f", "s16le", "-ar", "24000", "-ac", "1", + "-i", temporary, "-af", + `atempo=${tempo},atrim=end=${keep.toFixed(6)},afade=t=out:st=${Math.max(finalCharacter / tempo, keep - 0.08).toFixed(6)}:d=0.08`, + "-ar", "48000", "-c:a", "pcm_s16le", "-map_metadata", "-1", file, + ]); + } finally { + await fs.unlink(temporary); + } + const wav = await fs.readFile(file); + const data = wav.indexOf("data", 12) + 8; + assert(data >= 20, `${scene.id}: missing WAV data chunk.`); + const noise = tailNoise(wav.subarray(data), 48000, words.at(-1).start); + if (noise) await fs.writeFile(file, Buffer.concat([wav.subarray(0, data), silence(wav.subarray(data), 48000, noise)])); + const info = JSON.parse(await run("ffprobe", ["-v", "error", "-show_format", "-show_streams", "-of", "json", file])); + const duration = Number(info.format.duration); + assert(duration >= words.at(-1).end && duration > 0, `${scene.id}: speech was cut off.`); + record = { + id: scene.id, text: scene.narration, spokenText: spoken.text, inputHash, clipHash, + voiceId: settings.voiceId, modelId: settings.modelId, voiceSettings: settings.voiceSettings, + prosodyRate: settings.prosodyRate, tempo, duration, rawDuration: Buffer.from(provider.audio_base64, "base64").length / 48000, + audioFile: `assets/narration/segments/${scene.id}.wav`, audioSha256: hash(await fs.readFile(file)), + alignment, providerAlignment, providerNormalizedAlignment, words, pauseCuts: cuts, sectionPauses, + ...(noise ? { tailNoise: noise } : {}), + }; + await fs.writeFile(recordFile, JSON.stringify(record, null, 2)); + } + validateAlignment(record.alignment, scene.narration); + assert(record.words.at(-1).end <= record.duration, `${scene.id}: invalid cached speech timing.`); + const editorialStart = sceneStart + scene.speech[0]; + assert(index === 0 || scene.speech[0] >= timeline.audioPacing.minimumSceneLeadSeconds, + `${scene.id}: narration starts before the incoming picture has settled.`); + const previousSegment = segments.at(-1); + const measuredStart = editorialStart + record.words[0].start; + const measuredEnd = editorialStart + record.words.at(-1).end; + const transitionPause = previousSegment ? measuredStart - previousSegment.measuredSpeechEnd : null; + assert(transitionPause === null || transitionPause >= timeline.audioPacing.minimumTransitionSeconds, + `${scene.id}: insufficient breathing room after the preceding section.`); + const fitsPicture = editorialStart + record.duration <= pictureCursor; + segments.push({ + id: scene.id, text: scene.narration, audioFile: record.audioFile, duration: record.duration, + previewStart: previewCursor, previewEnd: previewCursor + record.duration, + editorialStart, editorialSceneEnd: pictureCursor, fitsPicture, + measuredSpeechStart: measuredStart, measuredSpeechEnd: measuredEnd, transitionPause, + alignmentFile: `assets/narration/segments/${scene.id}.json`, + previewWords: record.words.map((word) => ({ ...word, start: word.start + previewCursor, end: word.end + previewCursor })), + }); + previewCursor += record.duration; + console.log(`${scene.id}: ${record.duration.toFixed(2)}s${cached ? " (cached)" : ""}${fitsPicture ? "" : " (picture timing needs review)"}`); +} + +const concat = resolve(audioRoot, "concat.txt"); +await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", + "-i", "anullsrc=r=48000:cl=mono", "-t", String(timeline.audioPacing.previewGapSeconds), + "-c:a", "pcm_s16le", resolve(audioRoot, "section-gap.wav")]); +await fs.writeFile(concat, segments.flatMap((segment, index) => [ + ...(index > 0 ? ["file 'section-gap.wav'"] : []), + `file 'segments/${segment.id}.wav'`, +]).join("\n")); +const wavFile = resolve(audioRoot, "narration-preview.wav"); +const mp3File = resolve(audioRoot, "narration-preview.mp3"); +await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-f", "concat", "-safe", "0", + "-i", concat, "-c:a", "pcm_s16le", "-map_metadata", "-1", wavFile]); +await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-i", wavFile, + "-c:a", "libmp3lame", "-b:a", "192k", "-map_metadata", "-1", mp3File]); +const info = JSON.parse(await run("ffprobe", ["-v", "error", "-show_format", "-of", "json", wavFile])); +const duration = Number(info.format.duration); +assert(Math.abs(duration - previewCursor) < 0.02, "The listening preview lost or duplicated speech."); +await run("ffmpeg", ["-hide_banner", "-v", "error", "-xerror", "-i", mp3File, "-f", "null", "-"]); +const fitsPicture = segments.every((segment) => segment.fitsPicture); +let timedFile; +if (fitsPicture) { + timedFile = "assets/narration/narration-timed.wav"; + const inputs = segments.flatMap((segment) => ["-i", resolve(root, segment.audioFile)]); + const delays = segments.map((segment, index) => + `[${index + 1}:a]adelay=${Math.round(segment.editorialStart * 1000)}:all=1[s${index}]`); + const filters = [...delays, + `[0:a]${segments.map((_, index) => `[s${index}]`).join("")}amix=inputs=${segments.length + 1}:normalize=0:duration=first[out]`, + ].join(";"); + await run("ffmpeg", [ + "-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-t", String(pictureCursor), + "-i", "anullsrc=r=48000:cl=mono", ...inputs, "-filter_complex", filters, "-map", "[out]", + "-t", String(pictureCursor), "-c:a", "pcm_s16le", "-map_metadata", "-1", resolve(root, timedFile), + ]); + const timed = JSON.parse(await run("ffprobe", [ + "-v", "error", "-show_format", "-of", "json", resolve(root, timedFile), + ])); + assert(Math.abs(Number(timed.format.duration) - pictureCursor) < 0.001, + "The synchronized narration track does not match the picture duration."); +} else { + console.warn("The listening preview is ready, but the picture needs retiming before synchronized audio can be assembled."); +} +const manifest = { + provider: "elevenlabs-cli", ...settings, + kind: "Listening preview with deliberate section pauses; longer picture reading holds are omitted.", + audioPacing: timeline.audioPacing, + previewFile: "assets/narration/narration-preview.mp3", + losslessFile: "assets/narration/narration-preview.wav", + previewDuration: duration, editorialPictureDuration: pictureCursor, + previewSha256: hash(await fs.readFile(mp3File)), fitsPicture, + ...(timedFile ? { timedFile, timedSha256: hash(await fs.readFile(resolve(root, timedFile))) } : {}), + segments, +}; +await fs.writeFile(resolve(audioRoot, "manifest.json"), JSON.stringify(manifest, null, 2) + "\n"); +console.log(`Audio preview ready: ${duration.toFixed(2)}s, ${segments.length} segments, same Ignite voice and Eleven v4.`); diff --git a/videos/workflows/production/narration-config.json b/videos/workflows/production/narration-config.json new file mode 100644 index 00000000..6f0ae799 --- /dev/null +++ b/videos/workflows/production/narration-config.json @@ -0,0 +1,12 @@ +{ + "reference": "ignite-2026/videos/microsoft-finops-for-ai/video.config.json", + "voiceId": "gwU7DXdLrTvWCiUTPZG8", + "modelId": "eleven_v4", + "prosodyRate": "+5%", + "tailSeconds": 0.45, + "voiceSettings": { + "stability": 0.5, + "similarity_boost": 0.75 + }, + "maxPauseSeconds": 0.4 +} diff --git a/videos/workflows/production/styles.css b/videos/workflows/production/styles.css new file mode 100644 index 00000000..16f5de3c --- /dev/null +++ b/videos/workflows/production/styles.css @@ -0,0 +1,70 @@ +@font-face { + font-family: Mona; + src: url("/assets/production/fonts/MonaSansVF.woff2") format("woff2"); + font-weight: 200 900; +} +@font-face { + font-family: MonaMono; + src: url("/assets/production/fonts/MonaSansMonoVF.woff2") format("woff2"); + font-weight: 200 900; +} +* { box-sizing: border-box; } +html, body { + width: 1920px; height: 1080px; margin: 0; overflow: hidden; + -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; +} +body { font-family: Mona, sans-serif; color: #f5f5f5; background: transparent; } +#stage { position: relative; width: 1920px; height: 1080px; overflow: hidden; } +.background { + position: absolute; inset: 0; background: + radial-gradient(ellipse at 1% 36%, #123c29 0, transparent 59%), + radial-gradient(ellipse at 98% 70%, #2b1b47 0, transparent 58%), #0e1116; +} +.titlebar { position: absolute; left: 0; top: 0; width: 1920px; height: 64px; background: #0e1116; border-bottom: 1px solid #30363d; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; } +.persistent-title { margin: 0; color: #72e49a; font-size: 28px; font-weight: 650; line-height: 34px; white-space: nowrap; } +.persistent-title span { color: #e6edf3; } +.step-label { margin: 0; color: #b1bac4; font-size: 26px; font-weight: 500; line-height: 32px; white-space: nowrap; } +.intro-copy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; } +.intro-title { width: 1720px; margin: 0; text-align: center; opacity: 0; } +.intro-product { display: block; color: #72e49a; font-size: 56px; letter-spacing: .01em; line-height: 1.2; font-weight: 650; margin-bottom: 30px; } +.intro-subject { display: block; font-size: 124px; line-height: 1.08; font-weight: 810; letter-spacing: -.035em; white-space: pre-line; } +.intro-rule { width: 860px; height: 6px; margin-top: 56px; background: linear-gradient(90deg, #56d364, #a371f7); transform-origin: 50% 50%; opacity: 0; } +.brand-mark { width: 98px; height: 96px; object-fit: contain; } +.intro-mark { margin-top: 36px; opacity: 0; } +.hook-copy { position: absolute; left: 112px; top: 215px; width: 1696px; } +.hook-line { font-size: 76px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; margin: 0 0 28px; max-width: 1560px; } +.hook-line:first-child { color: #72e49a; font-size: 94px; margin-bottom: 34px; } +.hook-word { display: inline-block; opacity: 0; margin-right: .22em; } +.hook-definition { font-size: 38px; line-height: 1.45; color: #d1d9e0; margin: 52px 0 0; white-space: pre-line; opacity: 0; } +.console-callouts { position: absolute; inset: 0; width: 1920px; height: 1080px; pointer-events: none; } +.console-callout { opacity: 0; } +.console-callout rect { fill: none; stroke: currentColor; stroke-width: 3; } +.purpose-copy { position: absolute; left: 112px; top: 150px; width: 1696px; } +.purpose-heading { font-size: 72px; line-height: 1.12; letter-spacing: -.025em; font-weight: 760; margin: 0; opacity: 0; } +.purpose-definition { font-size: 38px; line-height: 1.3; color: #d1d9e0; margin: 20px 0 32px; opacity: 0; } +.purpose-point { border-left: 3px solid #72e49a; padding-left: 24px; margin: 0 0 20px; opacity: 0; } +.scenario-title { font-size: 42px; line-height: 1.2; font-weight: 600; margin: 0; } +.scenario-detail { font-size: 30px; line-height: 1.3; color: #d1d9e0; margin: 6px 0 0; } +.purpose-example { font-size: 34px; line-height: 1.3; color: #d1d9e0; margin: 28px 0 0; opacity: 0; } +.focus-copy { position: absolute; left: 112px; top: 170px; width: 1696px; opacity: 0; } +.focus-copy h1 { font-size: 72px; line-height: 1.15; letter-spacing: -.025em; margin: 0; } +.focus-definition { font-size: 38px; line-height: 1.3; color: #d1d9e0; margin: 24px 0 46px; } +.focus-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; } +.focus-step { --accent: #72e49a; padding: 28px; border: 1px solid #415247; border-top: 3px solid var(--accent); border-radius: 20px; background: linear-gradient(145deg, #1a2b25, #11191c); box-shadow: 0 14px 28px #00000024; opacity: 0; transform-origin: 50% 80%; } +.focus-step:nth-child(2) { --accent: #85d9c1; } +.focus-step:nth-child(3) { --accent: #a6b8ef; background: linear-gradient(145deg, #22283c, #141922); } +.focus-step:nth-child(4) { --accent: #c0a0f5; background: linear-gradient(145deg, #30243e, #191622); } +.focus-badge { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; color: var(--accent); } +.focus-badge svg { width: 54px; height: 54px; padding: 10px; border: 1px solid currentColor; border-radius: 15px; } +.focus-step .focus-number { font-size: 28px; color: var(--accent); margin: 0; } +.focus-step h2 { font-size: 34px; line-height: 1.2; margin: 0 0 16px; } +.focus-step p { font-size: 28px; line-height: 1.3; margin: 0; color: #d1d9e0; } +.focus-registered { font: 500 30px/1.3 MonaMono, monospace; color: #72e49a; margin: 32px 0 0; opacity: 0; } +.focus-outcome { font-size: 34px; line-height: 1.3; color: #d1d9e0; margin: 42px 0 0; opacity: 0; } +.closing-heading { position: absolute; left: 100px; top: 250px; width: 1460px; font-size: 112px; line-height: 1.04; font-weight: 790; letter-spacing: -.035em; margin: 0; opacity: 0; } +.closing-action { position: absolute; left: 100px; top: 560px; width: 1430px; font-size: 52px; line-height: 1.24; color: #d1d9e0; opacity: 0; } +.closing-command { position: absolute; left: 100px; top: 700px; font: 600 64px/1.2 MonaMono, monospace; color: #72e49a; opacity: 0; } +.closing-mark { position: absolute; right: 100px; top: 96px; opacity: 0; } +.qr-group { position: absolute; left: 1590px; top: 812px; width: 320px; text-align: center; opacity: 0; } +.qr-code { display: block; width: 180px; height: 180px; margin: 0 auto; background: white; image-rendering: pixelated; } +.qr-label { margin-top: 8px; font-size: 28px; font-weight: 600; line-height: 34px; } diff --git a/videos/workflows/production/timeline.json b/videos/workflows/production/timeline.json new file mode 100644 index 00000000..c535b3d9 --- /dev/null +++ b/videos/workflows/production/timeline.json @@ -0,0 +1,226 @@ +{ + "title": "GitHub Copilot CLI: Dynamic Workflows", + "width": 1920, + "height": 1080, + "fps": 30, + "maximumSeconds": 180, + "maximumNarrationWpm": 180, + "audioPacing": { "minimumTransitionSeconds": 0.65, "maximumTransitionSeconds": 1.6, "maximumQuietSeconds": 1.8, "minimumSceneLeadSeconds": 0.35, "previewGapSeconds": 0.25 }, + "console": { "width": 1920, "height": 1016, "top": 64, "fontSize": 26 }, + "resourceUrl": "https://docs.github.com/en/copilot/how-tos/use-copilot-agents/use-dynamic-workflows", + "qr": { "x": 1660, "y": 812, "size": 180, "quietZoneModules": 4, "minimumHoldSeconds": 8 }, + "reference": "finops-for-ai.mp4: centered Mona Sans title, clean gradient, expanding underline, and official brand mark", + "timingStatus": "Editorial picture targets; measured speech alignment is stored separately with the generated audio", + "evidence": { + "report": "creation/assets/release-report.md", + "transcript": "creation/assets/workflows-terminal.txt", + "origin": "creation/assets/workflow-origin.json" + }, + "scenes": [ + { + "id": "intro", + "kind": "intro", + "duration": 4.5, + "motion": [[0, 2.4]], + "headline": "What are\nDynamic Workflows?", + "speech": [0.5, 4.45], + "narration": "What are dynamic workflows, and why would you use them?" + }, + { + "id": "hook", + "kind": "hook", + "duration": 12.5, + "motion": [[0, 0.5]], + "cue": "Passing tests are only part of the picture", + "wordLines": ["The tests passed.", "That's a good start,", "but what's still untested?"], + "definition": "Commands, AI agents, and review checkpoints.\nOne reusable process.", + "definitionPhrase": "Dynamic workflows", + "speech": [0.55, 12.45], + "narration": "The tests passed. That's a good start, but what's still untested? Dynamic workflows bring commands, AI agents, and review checkpoints into one reusable process." + }, + { + "id": "purpose", + "kind": "purpose", + "duration": 20.8, + "motion": [[0, 2]], + "headline": "A few places this helps", + "cue": "Some jobs you can give a workflow", + "definition": "Give a repeatable job a workflow of its own.", + "points": [ + { "text": "Prepare a release", "detail": "What passed + what's still untested", "editorialStart": 4 }, + { "text": "Review a pull request", "detail": "Check results + review findings", "editorialStart": 8 }, + { "text": "Investigate a failed build", "detail": "Logs + evidence + next steps", "editorialStart": 12 } + ], + "example": { + "text": "Demo: a simple Python book app.", + "phrase": "Let's look at a simple example", + "editorialStart": 16 + }, + "pausesBefore": ["Prepare a release"], + "minimumPauseSeconds": 0.6, + "speech": [0.7, 20.75], + "narration": "Here are a few examples of where dynamic workflows can help. Prepare a release with tests and a list of what's untested. Review a pull request with the checks and findings in one place. Investigate a failed build by gathering logs and possible next steps. Let's look at a simple example with a Python book app." + }, + { + "id": "focus", + "kind": "focus", + "duration": 17.3, + "motion": [[0, 1.5]], + "headline": "What haven't we tested yet?", + "cue": "Let's check the book app", + "definition": "Here's the plan for this Python book app.", + "steps": [ + { "title": "Run the tests", "detail": "Commands", "editorialStart": 3 }, + { "title": "Take a look", "detail": "Your checkpoint", "editorialStart": 6 }, + { "title": "Find the gaps", "detail": "AI agent", "editorialStart": 9 }, + { "title": "Save the report", "detail": "release-report.md", "editorialStart": 12 } + ], + "registered": "Custom workflow: book-release-check", + "registeredPhrase": "This is our own workflow", + "outcome": "We get a report. We still make the release decision.", + "outcomePhrase": "so we can decide", + "speech": [0.55, 17.25], + "narration": "Here's the plan. Run the tests first. Then, take a look at the results. Find the gaps with an AI agent. We'll save the report so we can decide what needs work. This is our own workflow, not a built-in command. Let's create book release check." + }, + { + "id": "create", + "kind": "footage", + "duration": 13.1, + "headline": "Describe the workflow in plain language", + "cue": "First: ask Copilot to create the workflow", + "source": "creation/assets/creation-raw.mp4", + "shots": [ + { "from": 1, "to": 8.4, "hold": 3.7 }, + { "from": 8.4, "to": 10.4, "hold": 0 } + ], + "speech": [0.45, 13.05], + "narration": "First, tell Copilot what the workflow should do. We give it a name, describe the checks and review checkpoint, and ask it to save a reusable project extension. Creating it doesn't run it." + }, + { + "id": "created", + "kind": "footage", + "duration": 12.5, + "headline": "Inspect the workflow Copilot created", + "cue": "Created: a reusable workflow saved as code", + "source": "creation/assets/creation-raw.mp4", + "shots": [{ "from": 64, "to": 65, "hold": 11.5 }], + "callouts": [ + { "id": "created-extension", "phrase": "code", "rect": [160, 239, 1200, 50], "color": "#72e49a", "holdSeconds": 1.3 }, + { "id": "created-checkpoint", "phrase": "pause for review", "rect": [60, 660, 1810, 95], "color": "#c0a0f5", "holdSeconds": 1.1 } + ], + "speech": [0.45, 12.45], + "narration": "Copilot turns that request into code and registers the workflow. The saved extension holds the steps, including our pause for review. Now book release check is ready to run." + }, + { + "id": "run", + "kind": "footage", + "duration": 8.7, + "headline": "Start the book app's release check", + "cue": "Let's run the release check", + "source": "creation/assets/workflows-raw.mp4", + "shots": [ + { "from": 1, "to": 4.5, "hold": 0.7 }, + { "from": 8, "to": 11, "hold": 1.5 } + ], + "speech": [0.45, 8.65], + "narration": "Let's ask Copilot to run book release check. This starts the workflow we just created, beginning with the tests and help check." + }, + { + "id": "checkpoint", + "kind": "footage", + "duration": 7, + "headline": "Stop at a human-review checkpoint", + "cue": "Release check: your review checkpoint", + "source": "creation/assets/workflows-raw.mp4", + "shots": [{ "from": 30, "to": 31, "hold": 6 }], + "callouts": [ + { "id": "paused-review", "phrase": "workflow's paused", "rect": [60, 546, 610, 50], "color": "#c0a0f5", "holdSeconds": 2.2 } + ], + "speech": [0.45, 6.95], + "narration": "The checks are done. The workflow's paused here, so we can look at the results before going any further." + }, + { + "id": "checks", + "kind": "footage", + "duration": 11.933333333333334, + "headline": "Review the evidence before continuing", + "cue": "The tests passed. What might be missing?", + "source": "creation/assets/workflows-raw.mp4", + "shots": [{ "from": 30, "to": 32, "hold": 9.933333333333334 }], + "callouts": [ + { "id": "five-tests", "phrase": "All five tests passed", "rect": [474, 707, 315, 48], "color": "#72e49a", "holdSeconds": 1.1 }, + { "id": "help-check", "phrase": "help command works", "rect": [861, 707, 527, 48], "color": "#c0a0f5", "holdSeconds": 1.2 } + ], + "speech": [0.45, 11.883333], + "narration": "All five tests passed, and the help command works. But does it handle damaged data? And can we find authors regardless of capitalization? Let's have the agent check." + }, + { + "id": "monitor", + "kind": "footage", + "duration": 7.933333333333334, + "headline": "Open /workflows", + "cue": "/workflows > our release check > Enter", + "source": "creation/assets/workflows-raw.mp4", + "shots": [ + { "from": 33.2, "to": 35.2, "hold": 0.5 }, + { "from": 39.5, "to": 43.5, "hold": 1.4333333333333333 } + ], + "speech": [0.45, 7.883333], + "narration": "Type slash workflows, pick our paused release check, and press Enter. Now we can see what's happened so far." + }, + { + "id": "resume", + "kind": "footage", + "duration": 9.9, + "headline": "Resume the saved run", + "cue": "R: continue to the coverage assessment", + "source": "creation/assets/workflows-raw.mp4", + "shots": [ + { "from": 43.5, "to": 45.5, "hold": 1.2 }, + { "from": 47, "to": 52, "hold": 1.7 } + ], + "callouts": [ + { "id": "assessment-agent", "phrase": "The agent now", "rect": [16, 394, 535, 46], "color": "#72e49a", "holdSeconds": 1.6 } + ], + "speech": [0.45, 9.85], + "narration": "Press R to keep going. We don't need to rerun those checks; their results are saved. The agent now looks through the code and tests for gaps." + }, + { + "id": "completed", + "kind": "footage", + "duration": 5, + "headline": "Find the completed run", + "cue": "Completed: now inspect the findings", + "source": "creation/assets/workflows-raw.mp4", + "shots": [{ "from": 58, "to": 60, "hold": 3 }], + "speech": [0.45, 4.95], + "narration": "That's finished. Let's open the report and see what needs attention." + }, + { + "id": "report", + "kind": "footage", + "duration": 12.266666666666667, + "headline": "Use the report to choose the next fix", + "cue": "The answer: two behaviors still need tests", + "source": "creation/assets/report-focused-raw.mp4", + "shots": [{ "from": 5.8, "to": 17.1, "hold": 0.9666666666666667 }], + "callouts": [ + { "id": "test-gaps", "phrase": "two things to test next", "rect": [12, 397, 1852, 350], "color": "#c0a0f5", "untilEnd": true }, + { "id": "damaged-file", "phrase": "handling a damaged data file", "rect": [16, 470, 1846, 121], "color": "#72e49a", "untilEnd": true }, + { "id": "author-matching", "phrase": "finding authors regardless of capitalization", "rect": [16, 625, 1846, 121], "color": "#72e49a", "untilEnd": true } + ], + "speech": [0.45, 12.216667], + "narration": "The report gives us two things to test next: handling a damaged data file and finding authors regardless of capitalization. So, before we ship, we know where to spend our time." + }, + { + "id": "closing", + "kind": "closing", + "duration": 12.6, + "motion": [[0, 2.6]], + "headline": "Give dynamic\nworkflows a try.", + "definition": "Try it with a process you already repeat.", + "speech": [0.45, 12.55], + "narration": "If you keep doing the same checks by hand, this is worth trying. The QR code links to the guide. Use slash workflows to keep track of your runs. Give dynamic workflows a try." + } + ] +} diff --git a/videos/workflows/production/tools.mjs b/videos/workflows/production/tools.mjs new file mode 100644 index 00000000..530efd23 --- /dev/null +++ b/videos/workflows/production/tools.mjs @@ -0,0 +1,7 @@ +import { createRequire } from "node:module"; +import { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +export const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +export const toolRoot = process.env.VIDEO_TOOLS ? resolve(process.env.VIDEO_TOOLS) : root; +export const requireTool = createRequire(resolve(toolRoot, "package.json")); diff --git a/videos/workflows/production/verify.mjs b/videos/workflows/production/verify.mjs new file mode 100644 index 00000000..17a85b02 --- /dev/null +++ b/videos/workflows/production/verify.mjs @@ -0,0 +1,375 @@ +import fs from "node:fs/promises"; +import { spawn } from "node:child_process"; +import { once } from "node:events"; +import { resolve } from "node:path"; +import { root, requireTool } from "./tools.mjs"; + +const sharp = requireTool("sharp"); +const jsQR = requireTool("jsqr"); +const config = JSON.parse(await fs.readFile(resolve(root, "production/timeline.json"), "utf8")); +const narration = JSON.parse(await fs.readFile(resolve(root, "narration-timing.json"), "utf8")); +const narrated = process.argv.includes("--narrated"); +const file = resolve(root, narrated ? "renders/workflows-demo-narrated-1080p.mp4" : "renders/workflows-demo-console-1080p.mp4"); +const run = async (command, args) => { + const child = spawn(command, args, { stdio: ["ignore", "pipe", "pipe"] }); + let stdout = ""; + let stderr = ""; + child.stdout.on("data", (chunk) => { stdout += chunk; }); + child.stderr.on("data", (chunk) => { stderr += chunk; }); + const [code] = await once(child, "close"); + if (code !== 0) throw new Error(`${command} failed (${code}): ${stderr}`); + return { stdout, stderr }; +}; +const assert = (condition, message) => { if (!condition) throw new Error(message); }; +const info = JSON.parse((await run("ffprobe", ["-v", "error", "-show_streams", "-show_format", "-of", "json", file])).stdout); +const [video] = info.streams; +const duration = Number(info.format.duration); +assert(video.codec_type === "video" && info.streams.length === (narrated ? 3 : 1), + narrated ? "The narrated delivery must contain video, audio, and authored English captions." : "The picture master must contain video only."); +let audioCorrelation; +let pacingProof; +let captionsProof; +if (narrated) { + const subtitles = info.streams.filter((stream) => stream.codec_type === "subtitle"); + assert(subtitles.length === 1 && subtitles[0].codec_name === "mov_text" && subtitles[0].tags.language === "eng", + "The delivery needs a selectable English caption track."); + const encodedCaptions = (await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-i", file, + "-map", "0:s:0", "-f", "srt", "pipe:1"])).stdout; + const captionText = encodedCaptions.split(/\r?\n/).filter((line) => line.trim() && !/^\d+$/.test(line.trim()) + && !line.includes("-->")).join(" ").replace(/<[^>]*>/g, "").replace(/\s+/g, " ").trim(); + assert(captionText === config.scenes.map((scene) => scene.narration).join(" ").replace(/\s+/g, " "), + "The encoded captions do not match the approved narration."); + assert(/\bpull request\b/.test(captionText) && !/\bpoll request\b/.test(captionText), + "Captions must say pull request, not poll request."); + captionsProof = { passed: true, source: "approved narration and measured word alignment", language: "eng", pullRequestCorrect: true }; + const audio = info.streams.find((stream) => stream.codec_type === "audio"); + assert(audio?.codec_name === "aac" && audio.sample_rate === "48000" && audio.channels === 1, + "The narrated delivery needs a real 48 kHz mono AAC narration stream."); + assert(Math.abs(Number(audio.duration) - duration) < 0.05, "Narration and picture lengths differ."); + const manifest = JSON.parse(await fs.readFile(resolve(root, "assets/narration/manifest.json"), "utf8")); + assert(manifest.fitsPicture && Math.abs(manifest.editorialPictureDuration - duration) < 1 / config.fps, + "The audio manifest does not match the picture."); + const decodedAudio = resolve(root, "review/narrated-audio-check.wav"); + const pcm = (wav) => { + assert(wav.toString("ascii", 0, 4) === "RIFF", "Audio comparison requires PCM WAV."); + for (let at = 12; at + 8 <= wav.length;) { + const size = wav.readUInt32LE(at + 4); + if (wav.toString("ascii", at, at + 4) === "data") return wav.subarray(at + 8, at + 8 + size); + at += 8 + size + size % 2; + } + throw new Error("Missing PCM audio data."); + }; + try { + await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-i", file, + "-map", "0:a:0", "-ar", "48000", "-ac", "1", "-c:a", "pcm_s16le", decodedAudio]); + const actual = pcm(await fs.readFile(decodedAudio)); + const expected = pcm(await fs.readFile(resolve(root, manifest.timedFile))); + assert(Math.abs(actual.length - expected.length) <= 4096, "Decoded narration length is incorrect."); + let dot = 0; + let a2 = 0; + let b2 = 0; + for (let at = 0; at + 1 < Math.min(actual.length, expected.length); at += 2) { + const a = actual.readInt16LE(at); + const b = expected.readInt16LE(at); + dot += a * b; + a2 += a * a; + b2 += b * b; + } + audioCorrelation = dot / Math.sqrt(a2 * b2); + assert(audioCorrelation >= 0.98, "The encoded audio is silent, shifted, or does not match the synchronized narration."); + const quietRms = (from, to) => { + const start = Math.ceil(from * 48000); + const end = Math.floor(to * 48000); + assert(end > start && start >= 0 && end * 2 <= actual.length, "Invalid pause-check interval."); + let power = 0; + for (let sample = start; sample < end; sample++) power += (actual.readInt16LE(sample * 2) / 32768) ** 2; + return Math.sqrt(power / (end - start)); + }; + const longestQuietSeconds = (from, to) => { + const frame = 480; + let longest = 0; + let streak = 0; + for (let at = Math.ceil(from * 48000); at + frame <= Math.floor(to * 48000); at += frame) { + let power = 0; + for (let offset = 0; offset < frame; offset++) power += (actual.readInt16LE((at + offset) * 2) / 32768) ** 2; + streak = Math.sqrt(power / frame) < 0.01 ? streak + 1 : 0; + longest = Math.max(longest, streak); + } + return longest * frame / 48000; + }; + const transitions = []; + const explanation = []; + const preview = pcm(await fs.readFile(resolve(root, manifest.losslessFile))); + let previousEnd; + for (const [index, segment] of manifest.segments.entries()) { + const record = JSON.parse(await fs.readFile(resolve(root, segment.alignmentFile), "utf8")); + const scene = config.scenes[index]; + const start = segment.editorialStart + record.words[0].start; + const end = segment.editorialStart + record.words.at(-1).end; + if (index > 0) { + assert(segment.editorialStart - narration.cues[index].sceneStart >= config.audioPacing.minimumSceneLeadSeconds, + `${segment.id}: speech begins before the incoming picture has settled.`); + const gap = start - previousEnd; + assert(gap >= config.audioPacing.minimumTransitionSeconds, `${segment.id}: the section transition is rushed.`); + assert(gap <= config.audioPacing.maximumTransitionSeconds, `${segment.id}: the section transition drags.`); + const middle = (start + previousEnd) / 2; + const halfWindow = Math.min(0.18, gap / 4); + const rms = quietRms(middle - halfWindow, middle + halfWindow); + assert(rms < 0.01, `${segment.id}: the encoded transition pause contains unexpected sound.`); + const quietSeconds = longestQuietSeconds(previousEnd, start); + assert(quietSeconds >= config.audioPacing.minimumTransitionSeconds, + `${segment.id}: insufficient measured silence between sections.`); + const previous = manifest.segments[index - 1]; + const previewGap = segment.previewStart - previous.previewEnd; + assert(Math.abs(previewGap - config.audioPacing.previewGapSeconds) < 0.0001, + `${segment.id}: the listening preview lost its section pause.`); + const quietPreview = preview.subarray( + Math.ceil((previous.previewEnd + 0.005) * 48000) * 2, + Math.floor((segment.previewStart - 0.005) * 48000) * 2); + assert(quietPreview.length > 0 && quietPreview.every((value) => value === 0), + `${segment.id}: the listening-preview separator is not silent.`); + transitions.push({ next: segment.id, gapSeconds: gap, quietSeconds, quietRms: rms, previewGapSeconds: previewGap }); + } + previousEnd = end; + for (const phrase of scene.pausesBefore || []) { + const key = (text) => text.toLowerCase().replace(/[^\p{L}\p{N}]/gu, ""); + const target = phrase.split(/\s+/).map(key); + const matches = record.words.flatMap((_, at) => + target.every((word, offset) => key(record.words[at + offset]?.word || "") === word) ? [at] : []); + assert(matches.length === 1 && matches[0] > 0, `Missing paced phrase "${phrase}".`); + const at = matches[0]; + const from = segment.editorialStart + record.words[at - 1].end; + const to = segment.editorialStart + record.words[at].start; + const gap = to - from; + assert(gap >= scene.minimumPauseSeconds - 0.0001, `"${phrase}" needs a longer pause.`); + const quietSeconds = longestQuietSeconds(from, to); + assert(quietSeconds >= scene.minimumPauseSeconds, `"${phrase}" has insufficient measured silence.`); + explanation.push({ phrase, gapSeconds: gap, quietSeconds }); + } + } + assert(manifest.audioPacing.previewGapSeconds === config.audioPacing.previewGapSeconds, + "The listening-preview spacing is stale."); + const longestSilence = longestQuietSeconds(0, Math.min(duration, actual.length / 96000)); + assert(longestSilence <= config.audioPacing.maximumQuietSeconds, + `The encoded video contains ${longestSilence.toFixed(2)} seconds of uninterrupted silence.`); + pacingProof = { passed: true, transitions, explanation, longestQuietSeconds: longestSilence, + previewGapSeconds: manifest.audioPacing.previewGapSeconds }; + await fs.writeFile(resolve(root, "review/narration-pacing.json"), JSON.stringify(pacingProof, null, 2) + "\n"); + } finally { + await fs.unlink(decodedAudio).catch((error) => { if (error.code !== "ENOENT") throw error; }); + } +} +assert(video.width === 1920 && video.height === 1080 && video.codec_name === "h264" && video.pix_fmt === "yuv420p" && video.avg_frame_rate === "30/1", "Delivery format is incorrect."); +assert(duration <= 180 && Math.abs(duration - narration.durationSeconds) <= 2 / 30, "Picture and narration plan durations do not match."); +assert(typeof narration.audioGenerated === "boolean", "The narration handoff must report whether audio has been generated."); +for (let index = 0; index < narration.cues.length; index++) { + const cue = narration.cues[index]; + assert(cue.speechStart >= cue.sceneStart && cue.speechEnd <= cue.sceneEnd && cue.speechEnd > cue.speechStart && cue.requiredWpm <= config.maximumNarrationWpm, `${cue.id}: invalid speech budget.`); + assert(index === 0 || cue.sceneStart === narration.cues[index - 1].sceneEnd, "The timing plan has a gap or overlap."); +} +const decoded = await run("ffmpeg", ["-hide_banner", "-nostats", "-v", "info", "-xerror", "-i", file, + "-vf", "blackdetect=d=0.1:pix_th=0.01:pic_th=0.995", "-f", "null", "-"]); +assert(!decoded.stderr.includes("black_start:"), "Unexpected black frames were detected."); + +async function verifyWordSync(sceneId) { + const sync = JSON.parse(await fs.readFile(resolve(root, `assets/production/${sceneId}-sync.json`), "utf8")); + const cue = narration.cues.find((candidate) => candidate.id === sync.sceneId); + const scene = config.scenes.find((candidate) => candidate.id === sceneId); + const expectedReveals = sceneId === "hook" ? scene.wordLines.join(" ").split(/\s+/).length + 1 + : sceneId === "focus" ? scene.steps.length + 2 : 4; + assert(sync.sceneStart === cue.sceneStart && sync.reveals.length === expectedReveals, + "Explanation reveal timing does not match the picture."); + if (sceneId === "focus") assert(sync.reveals.slice(scene.steps.length).every((event) => + event.revealStart > sync.reveals[scene.steps.length - 1].settledAt), + "The footer lines must appear after all four workflow cards."); + if (narrated) assert(sync.timingSource === "elevenlabs-word-alignment", + "Narrated explanation reveals must use measured word timing, not editorial guesses."); + const record = sync.alignmentFile + ? JSON.parse(await fs.readFile(resolve(root, sync.alignmentFile), "utf8")) : null; + if (record) assert(record.audioSha256 === sync.audioSha256, + "Explanation reveal timing refers to a different voice clip."); + const baselineFile = resolve(root, `review/${sceneId}-word-baseline.png`); + await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-ss", + String(cue.sceneStart + 1 / 30), "-i", file, "-frames:v", "1", baselineFile]); + const baseline = await fs.readFile(baselineFile); + const visualProof = []; + for (const [index, event] of sync.reveals.entries()) { + if (record) { + const words = record.words.slice(event.wordIndex, event.wordIndex + event.phrase.split(/\s+/).length); + const key = (text) => text.toLowerCase().replace(/[^\p{L}\p{N}]/gu, ""); + assert(words.map((word) => key(word.word)).join(" ") === event.phrase.split(/\s+/).map(key).join(" "), + `The reveal for "${event.text}" is anchored to the wrong words.`); + const expectedStart = cue.speechStart - cue.sceneStart + words[0].start; + assert(Math.abs(expectedStart - event.spokenStart) < 0.000001 + && Math.abs(event.spokenStart - event.revealStart - event.leadSeconds) < 0.000001 + && Math.abs(event.settledAt - event.spokenStart - event.settleSeconds) < 0.000001, + `The reveal for "${event.text}" is not synchronized to its spoken words.`); + } + assert(event.bounds, `Missing encoded-frame check region for "${event.text}".`); + const reference = await sharp(baseline).extract(event.bounds).removeAlpha().raw().toBuffer(); + const times = { + before: Math.floor((cue.sceneStart + event.revealStart) * 30 - 1) / 30, + onWord: Math.ceil((cue.sceneStart + (event.spokenStart ?? event.settledAt)) * 30) / 30, + settled: Math.ceil((cue.sceneStart + event.settledAt) * 30 + 1) / 30, + }; + const scores = {}; + for (const [name, at] of Object.entries(times)) { + const frame = resolve(root, `review/${sceneId}-word-${index + 1}-${name}.png`); + await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-ss", String(at), + "-i", file, "-frames:v", "1", frame]); + const pixels = await sharp(frame).extract(event.bounds).removeAlpha().raw().toBuffer(); + let difference = 0; + for (let pixel = 0; pixel < pixels.length; pixel++) difference += Math.abs(pixels[pixel] - reference[pixel]); + scores[name] = difference / pixels.length; + } + assert(scores.settled > 1.5 && scores.before < scores.settled * 0.1 + && scores.onWord >= scores.settled * 0.6, + `Encoded "${event.text}" is visible too early, missing, or not legible on its spoken phrase.`); + visualProof.push({ text: event.text, spokenAt: event.spokenStart === null ? null : cue.sceneStart + event.spokenStart, + frameTimes: times, contrast: scores, legibleOnWord: event.spokenStart === null ? null : true }); + } + await fs.writeFile(resolve(root, `review/${sceneId}-word-sync.json`), JSON.stringify({ + timingSource: sync.timingSource, passed: true, reveals: visualProof, + }, null, 2) + "\n"); + return { timingSource: sync.timingSource, checkedReveals: visualProof.length, passed: true }; +} +const purposeWordSync = await verifyWordSync("purpose"); +const focusWordSync = await verifyWordSync("focus"); +const hookWordSync = await verifyWordSync("hook"); +const calloutProof = []; +for (const scene of config.scenes.filter((candidate) => candidate.callouts)) { + const sync = JSON.parse(await fs.readFile(resolve(root, `assets/production/${scene.id}-sync.json`), "utf8")); + assert(sync.sceneStart === narration.cues.find((cue) => cue.id === scene.id).sceneStart + && sync.reveals.length === scene.callouts.length, `${scene.id}: stale console callouts.`); + if (narrated) assert(sync.timingSource === "elevenlabs-word-alignment", "Console callouts need real speech alignment."); + const record = sync.alignmentFile ? JSON.parse(await fs.readFile(resolve(root, sync.alignmentFile), "utf8")) : null; + if (record) assert(record.audioSha256 === sync.audioSha256, `${scene.id}: callouts refer to a different voice clip.`); + for (const event of sync.reveals) { + if (record) { + const key = (text) => text.toLowerCase().replace(/[^\p{L}\p{N}]/gu, ""); + const words = record.words.slice(event.wordIndex, event.wordIndex + event.phrase.split(/\s+/).length); + assert(words.map((word) => key(word.word)).join(" ") === event.phrase.split(/\s+/).map(key).join(" ") + && Math.abs(event.spokenStart - scene.speech[0] - words[0].start) < 0.000001 + && Math.abs(event.spokenStart - event.revealStart - event.leadSeconds) < 0.000001, + `${event.id}: callout is not anchored to its spoken phrase.`); + } + const [left, top, width, height] = event.rect; + const color = [1, 3, 5].map((at) => Number.parseInt(event.color.slice(at, at + 2), 16)); + const scores = {}; + for (const [name, local] of Object.entries({ + before: event.revealStart - 0.06, + midway: (event.revealStart + event.settledAt) / 2, + settled: event.settledAt + 0.08, + })) { + const frame = resolve(root, `review/${scene.id}-${event.id}-${name}.png`); + await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-ss", String(sync.sceneStart + local), + "-i", file, "-frames:v", "1", frame]); + const pixels = await sharp(frame).extract({ left: left - 2, top: top - 2, width: width + 4, height: height + 4 }) + .removeAlpha().raw().toBuffer(); + let matches = 0; + for (let at = 0; at < pixels.length; at += 3) { + if (color.every((channel, index) => Math.abs(pixels[at + index] - channel) < 40)) matches++; + } + scores[name] = matches; + } + assert(scores.settled >= 0.7 * (width + height) * 2 && scores.before < scores.settled * 0.15 + && scores.midway > scores.settled * 0.2 && scores.midway < scores.settled * 0.85, + `${event.id}: the encoded outline is premature, incomplete, or not visibly drawn.`); + calloutProof.push({ scene: scene.id, id: event.id, phrase: event.phrase, drawnAt: sync.sceneStart + event.settledAt, + rect: event.rect, colorPixels: scores, passed: true }); + } +} +await fs.writeFile(resolve(root, "review/console-callouts.json"), JSON.stringify(calloutProof, null, 2) + "\n"); +const purposeCue = narration.cues.find((cue) => cue.id === "purpose"); + +const scenarios = config.scenes.find((scene) => scene.kind === "purpose"); +const focus = config.scenes.find((scene) => scene.kind === "focus"); +const focusCue = narration.cues.find((cue) => cue.id === focus?.id); +const createCue = narration.cues.find((cue) => cue.id === "create"); +const createdCue = narration.cues.find((cue) => cue.id === "created"); +const runCue = narration.cues.find((cue) => cue.id === "run"); +assert(scenarios.points.length >= 2 && scenarios.points.length <= 3 + && scenarios.points.every((point) => point.detail), "Each opening scenario needs a concrete outcome."); +assert(focusCue?.sceneStart === purposeCue.sceneEnd && focus.steps.length === 4 + && focus.registered.includes("book-release-check") + && focus.steps.at(-1).detail === "release-report.md", +"The selected release story must bridge the scenarios and the real console with its four actual phases."); +assert(createCue?.sceneStart === focusCue.sceneEnd && createdCue?.sceneStart === createCue.sceneEnd + && runCue?.sceneStart === createdCue.sceneEnd, + "The story must show real creation and its saved result before running the custom workflow."); +const origin = JSON.parse(await fs.readFile(resolve(root, config.evidence.origin), "utf8")); +assert(origin.extensionSha256 === origin.executedExtensionSha256 && origin.preloaded === false, + "The authored workflow and the executed workflow must be the same artifact, without preloading."); +const creationProof = []; +for (const cue of [createCue, createdCue]) { + const scene = config.scenes.find((candidate) => candidate.id === cue.id); + const shot = scene.shots.at(-1); + const outputAt = cue.sceneEnd - 0.1; + const sourceAt = shot.to - 1 / 25; + const comparison = await run("ffmpeg", ["-hide_banner", "-nostats", "-loglevel", "info", + "-ss", String(sourceAt), "-i", resolve(root, scene.source), "-ss", String(outputAt), "-i", file, + "-filter_complex", `[1:v]crop=1920:1016:0:${config.console.top}[console];[0:v][console]ssim[out]`, + "-map", "[out]", "-frames:v", "1", "-f", "null", "-"]); + const ssim = Number(comparison.stderr.match(/All:([\d.]+)/)?.[1]); + assert(ssim >= 0.99, `${cue.id}: the authoring console does not match its authentic source.`); + creationProof.push({ scene: cue.id, source: scene.source, sourceAt, outputAt, ssim }); +} +const focusComparison = await run("ffmpeg", ["-hide_banner", "-nostats", "-loglevel", "info", + "-ss", String(focusCue.sceneEnd - 0.5), "-i", file, "-i", resolve(root, "review/focus.png"), + "-filter_complex", "[0:v][1:v]ssim[out]", "-map", "[out]", "-frames:v", "1", "-f", "null", "-"]); +const focusSimilarity = Number(focusComparison.stderr.match(/All:([\d.]+)/)?.[1]); +assert(focusSimilarity >= 0.99, "The encoded release-story card does not match its inspected layout."); +const storyProof = { + passed: true, scenarios: scenarios.points.map(({ text, detail }) => ({ scenario: text, outcome: detail })), + demonstratedWorkflow: "book-release-check", question: focus.headline, + phases: focus.steps, decisionBoundary: focus.outcome, encodedFocusSsim: focusSimilarity, + origin: { ...origin, encodedCreation: creationProof }, +}; +await fs.writeFile(resolve(root, "review/story-verification.json"), JSON.stringify(storyProof, null, 2) + "\n"); + +const checks = config.scenes.find((scene) => scene.id === "checks"); +const checkCue = narration.cues.find((cue) => cue.id === "checks"); +const shot = checks.shots.at(-1); +assert(shot.hold >= 0.5, "Native-console verification needs a settled reading hold."); +const source = JSON.parse((await run("ffprobe", ["-v", "error", "-select_streams", "v:0", + "-show_entries", "stream=width,height,r_frame_rate", "-of", "json", resolve(root, checks.source)])).stdout).streams[0]; +assert(source.width === config.console.width && source.height === config.console.height, "The source console dimensions changed."); +const [numerator, denominator] = source.r_frame_rate.split("/").map(Number); +const sourceAt = shot.to - denominator / numerator; +const outputAt = checkCue.sceneEnd - 0.5; +const comparison = await run("ffmpeg", ["-hide_banner", "-nostats", "-loglevel", "info", + "-ss", String(sourceAt), "-i", resolve(root, checks.source), "-ss", String(outputAt), "-i", file, + "-filter_complex", `[1:v]crop=1920:1016:0:${config.console.top}[console];[0:v][console]ssim[out]`, + "-map", "[out]", "-frames:v", "1", "-f", "null", "-"]); +const nativeSimilarity = Number(comparison.stderr.match(/All:([\d.]+)/)?.[1]); +assert(nativeSimilarity >= 0.99, "The encoded console no longer matches the complete native source; check for cropping, scaling, or obstructing overlays."); + +const closing = narration.cues.at(-1); +const qrProof = []; +const fullyVisibleAt = closing.sceneStart + 1.9; +assert(config.qr.x >= 1500 && config.qr.y + config.qr.size >= 980 + && config.qr.x + config.qr.size <= 1888 && config.qr.y + config.qr.size <= 1048, + "The QR must sit safely in the lower-right corner."); +for (const at of [...Array.from({ length: Math.floor(duration - fullyVisibleAt) }, (_, index) => fullyVisibleAt + index), duration - 1 / 30]) { + const frame = resolve(root, `review/qr-${at.toFixed(2)}.png`); + await run("ffmpeg", ["-hide_banner", "-loglevel", "error", "-y", "-ss", String(at), "-i", file, "-frames:v", "1", frame]); + const { data, info: pixels } = await sharp(frame).extract({ + left: config.qr.x, top: config.qr.y, width: config.qr.size, height: config.qr.size, + }).ensureAlpha().raw().toBuffer({ resolveWithObject: true }); + const qr = jsQR(new Uint8ClampedArray(data), pixels.width, pixels.height); + assert(qr?.data === config.resourceUrl, `The QR does not decode to the official URL at ${at}s.`); + qrProof.push({ at, url: qr.data }); +} +assert(duration - fullyVisibleAt >= config.qr.minimumHoldSeconds, "The QR hold is too short to scan."); +const verification = { + passed: true, duration, width: video.width, height: video.height, fps: video.avg_frame_rate, + audioIncluded: narrated, narrationGenerated: narration.audioGenerated, fullDecode: true, blackFrames: false, qrProof, + ...(narrated ? { audioCorrelation, audioPacing: pacingProof, captions: captionsProof } : {}), + hookWordSync, purposeWordSync, focusWordSync, callouts: calloutProof, + qrFullyVisibleSeconds: duration - fullyVisibleAt, + story: storyProof, + narrationCues: narration.cues.length, + nativeConsole: { width: source.width, height: source.height, sourceAt, outputAt, ssim: nativeSimilarity }, +}; +await fs.writeFile(resolve(root, narrated ? "review/narrated-verification.json" : "review/verification.json"), JSON.stringify(verification, null, 2) + "\n"); +console.log(`Verified: ${duration.toFixed(2)}s, 1080p30, ${narrated ? "synchronized AAC narration" : "picture only"}, ${narration.cues.length} timed narration cues, final-frame QR decoded.`); diff --git a/videos/workflows/production/visuals.html b/videos/workflows/production/visuals.html new file mode 100644 index 00000000..5fa07dee --- /dev/null +++ b/videos/workflows/production/visuals.html @@ -0,0 +1,14 @@ + + + + + + GitHub Copilot CLI: Dynamic Workflows + + + +
+ + + + diff --git a/videos/workflows/production/visuals.js b/videos/workflows/production/visuals.js new file mode 100644 index 00000000..e067f70b --- /dev/null +++ b/videos/workflows/production/visuals.js @@ -0,0 +1,118 @@ +const timeline = await (await fetch("/production/timeline.json")).json(); +const purposeSync = await (await fetch("/assets/production/purpose-sync.json")).json(); +const focusSync = await (await fetch("/assets/production/focus-sync.json")).json(); +const hookSync = await (await fetch("/assets/production/hook-sync.json")).json(); +const calloutSync = await (await fetch("/assets/production/callout-sync.json")).json(); +gsap.config({ force3D: false }); +const stage = document.getElementById("stage"); +const escape = (value) => value.replaceAll("&", "&").replaceAll("<", "<").replaceAll('"', """); +const mark = 'GitHub'; +const background = '
'; +const stepIcons = [ + '', + '', + '', + '', +]; +const header = (scene) => `

GitHub Copilot CLI / Dynamic Workflows

${escape(scene.cue || "Official feature guide")}

`; +let active; +let animation; + +window.renderScene = async (id, at, overlay = false) => { + if (active !== id) { + animation?.kill(); + const scene = timeline.scenes.find((candidate) => candidate.id === id); + if (!scene) throw new Error(`Unknown scene ${id}`); + if (scene.kind === "intro") { + stage.innerHTML = `${background}

GitHub Copilot CLI${escape(scene.headline)}

${mark}
`; + } else if (scene.kind === "hook") { + let wordIndex = 0; + stage.innerHTML = `${background}${header(scene)}
+ ${scene.wordLines.map((line) => `

${line.split(/\s+/).map((word) => + `${escape(word)}`).join("")}

`).join("")} +

${escape(scene.definition)}

`; + } else if (scene.kind === "purpose") { + stage.innerHTML = `${background}${header(scene)}
+

${escape(scene.headline)}

+

${escape(scene.definition)}

+
+ ${scene.points.map((point) => `

${escape(point.text)}

${escape(point.detail)}

`).join("")} +
+

${escape(scene.example.text)}

+
`; + } else if (scene.kind === "focus") { + stage.innerHTML = `${background}${header(scene)}
+

${escape(scene.headline)}

${escape(scene.definition)}

+
${scene.steps.map((step, index) => `
+

0${index + 1}

${escape(step.title)}

${escape(step.detail)}

+
`).join("")}

${escape(scene.registered)}

+

${escape(scene.outcome)}

`; + } else if (scene.kind === "closing") { + stage.innerHTML = `${background}${header(scene)}
${mark}
+

${escape(scene.headline).replaceAll("\n", "
")}

+

${escape(scene.definition)}

+
/workflows
+
Official dynamic workflows guide
Scan to learn more
`; + } else { + const sync = calloutSync.find((candidate) => candidate.sceneId === scene.id); + stage.innerHTML = `${overlay ? "" : background}${header(scene)}${sync ? `` : ""}`; + } + await document.fonts.ready; + await Promise.all([...stage.querySelectorAll("img")].map((image) => image.decode())); + animation = gsap.timeline({ paused: true }); + if (scene.kind === "intro") { + animation.to(".intro-title", { opacity: 1, duration: 0.75, ease: "power2.out" }, 0.3); + animation.fromTo(".intro-mark", { opacity: 0, scale: 0.72 }, { opacity: 1, scale: 1, duration: 1.2, ease: "expo.out", immediateRender: false }, 0.45); + animation.fromTo(".intro-rule", { opacity: 0, scaleX: 0 }, { opacity: 1, scaleX: 1, duration: 0.8, ease: "power3.out", immediateRender: false }, 0.85); + } else if (scene.kind === "hook") { + hookSync.reveals.forEach((event) => { + animation.fromTo(event.selector, { opacity: 0 }, { + opacity: 1, duration: event.settledAt - event.revealStart, ease: "power2.out", immediateRender: false, + }, event.revealStart); + }); + } else if (scene.kind === "purpose") { + animation.to(".purpose-heading,.purpose-definition", { opacity: 1, duration: 0.45 }, 0.2); + purposeSync.reveals.forEach((event, index) => { + animation.fromTo(event.selector, { opacity: 0, y: 10 }, { + opacity: 1, y: 0, duration: event.settledAt - event.revealStart, + ease: "power2.out", immediateRender: false, + }, event.revealStart); + if (index > 0) { + animation.to(purposeSync.reveals[index - 1].selector, { + opacity: 0.66, duration: 0.24, + }, event.revealStart); + } + }); + } else if (scene.kind === "focus") { + animation.to(".focus-copy", { opacity: 1, duration: 0.45, ease: "power2.out" }, 0.2); + focusSync.reveals.forEach((event, index) => { + const isCard = index < scene.steps.length; + animation.fromTo(event.selector, { opacity: 0, y: isCard ? 14 : 8, scale: isCard ? 0.985 : 1 }, { + opacity: 1, y: 0, scale: 1, duration: event.settledAt - event.revealStart, + ease: "power2.out", immediateRender: false, + }, event.revealStart); + if (index > 0 && isCard) animation.to(focusSync.reveals[index - 1].selector, { + opacity: 0.86, duration: 0.24, + }, event.revealStart); + }); + } else if (scene.kind === "closing") { + animation.to(".closing-heading,.closing-mark", { opacity: 1, duration: 0.65 }, 0.25); + animation.to(".closing-action,.closing-command", { opacity: 1, duration: 0.6 }, 0.7); + animation.to(".qr-group", { opacity: 1, duration: 0.7 }, 1.2); + } else if (scene.callouts) { + const sync = calloutSync.find((candidate) => candidate.sceneId === scene.id); + sync.reveals.forEach((event) => { + animation.to(event.selector, { opacity: 1, duration: 0.1 }, event.revealStart); + animation.fromTo(`${event.selector} rect`, { attr: { "stroke-dashoffset": 1 } }, { + attr: { "stroke-dashoffset": 0 }, duration: event.settledAt - event.revealStart, + ease: "power1.inOut", immediateRender: false, + }, event.revealStart); + if (event.endAt < scene.duration) animation.to(event.selector, { opacity: 0, duration: 0.25 }, event.endAt - 0.25); + }); + } + active = id; + } + animation.seek(at, true); +}; +window.visualsReady = true;