--- name: hermes-video-production description: Operate the governed Hermes Video Lab and promote proven productions into tenant-local Caduceus Video. Use for concept-to-blueprint-to-contract video work, canon/reference continuity, exact supplied frames, durable jobs, attempt inspection, deterministic branded finishing, filmstrip editing, recovery, and capability parity. version: 1.4.1 author: Hermes Agent license: MIT metadata: hermes: tags: [hermes-video, caduceus-video, video-production, canon, continuity, remotion, performance-marketing] related_skills: [ai-video-story-pipeline, video-media-production-operations, hermes-creative, video-watch] --- # Hermes Video Production ## Product boundaries Keep the taxonomy simple: - **Hermes Video** is the standalone internal production lab and behavioral reference implementation. - **Caduceus Video** is the tenant-local product capability. - Caduceus Video skill, typed tools, canonical commands, Studio, and runtime are layers of that one capability—not separate products. - **Hermes Creative** owns business/brand/campaign intelligence, evidence, patterns, variants, and performance learning. - **Video Story** is maintenance-only and a feature mine for existing workflows. Caduceus must never depend on the standalone Hermes Video HTTP service at runtime. Promote behavior through the versioned capability contract and parity fixtures. ## Default operating loop 1. **Inspect current state** - Project and active blueprint - Canon entries and scene assignments - Signed run contract and hard cap - Durable job/lease state - Generation attempts and selected outputs - Composition spec, export provenance, and review state 2. **Resolve production intent** - Ad, documentary, quote/talking portrait, music, ambient, explainer, or narrative - Subject/reference lock and whether new humans are allowed - Master-audio and dialogue policy - Target aspect, duration, platform, hook, proof, CTA, and Creative variant identity 3. **Build or update canon** - Characters, locations, products, props, style, logo - Prefer a few continuity-critical references over generating every noun - Record source/provenance, prompt anchors, negative anchors, lock state, and version 4. **Author the production graph and validate real invariants** - Separate semantic scenes, visual shots, narration/dialogue segments, audio tracks, and composition timing - Select an explicit timing/audio mode; continuous narration may cross shot boundaries - Translate the goal into hard media requirements, query Hermes Model Intelligence, and read the exact endpoint schema - Freeze the selected deployment, schema/capability evidence, pricing, and parameters in the blueprint/run contract - Treat provider duration enums and unsupported inputs as hard constraints; treat pacing/drift/continuity estimates as warnings for Hermes or the human - Exact artwork is supplied as an asset; do not ask an image model to redraw exact charts, glyphs, logos, or UI 5. **Estimate and sign run contract** - Never start a user-initiated paid run without user sign-off - Agent-initiated contracts may use the established agent-signing rule only within configured policy - Hard cap and per-call ledger remain authoritative 6. **Enqueue durable job** - Do not equate process-local activity with durable progress - Inspect queued/leased/failed/completed state and recover stale leases safely 7. **Supervise attempts** - Every provider call is an append-only attempt with prompt, model, references, output, cost, judgment, and error - Select a winner explicitly; never overwrite provenance - Use bounded retries and switch only for evidence-backed reasons 8. **Finish deterministically** - Use ffmpeg basic for simple cuts/mixdown - Use Remotion branded composition for captions, typography, logo, product cards, CTA, safe areas, split-screen, and repeatable templates - Pin every `remotion` / `@remotion/*` package to the exact same version; caret ranges can resolve adjacent versions and produce runtime warnings or failures - Prewarm the local Headless Shell during deployment/canary; the first local render may download roughly 87 MB and must not surprise a production job - Read `references/deterministic-remotion-composition.md` for the versioned spec, safe content-addressed local-asset staging, project-scoped output rule, provenance sidecar, dependency audit, and real ffmpeg→Remotion→ffprobe acceptance canary 9. **Review as an editor** - ffprobe final duration/aspect/codecs - Filmstrip/contact sheet before edit decisions - Inspect shot boundaries, identity continuity, text legibility, first/last frame, audio overlaps, and CTA - Store trim/reorder decisions nondestructively when possible 10. **Promote deliberately** - Validate the same byte-identical `video-capability.v1` schema and fixtures in standalone and Caduceus; compare SHA-256 hashes rather than trusting the version label - Map portable IDs to tenant-local business/project/media/connection/job/review records - Strip source signing, review approval, credentials, active-job state, and spend authority while preserving them only as historical provenance - Reject secret-shaped keys/values and credential-bearing locators recursively before mutation - Verify typed tool → project-scoped gate → canonical command - Run a zero-provider deterministic canary before paid tenant generation - Read `references/portable-capability-promotion.md` for parity artifacts, semantic validation, transactional import, authority stripping, runtime readiness, and release gates ## Agent-native dual-control architecture Hermes—not an embedded one-off “director LLM”—is the intelligent coordinator. Skills encode judgment, typed tools expose capabilities, and one actor-aware command layer serves the Hermes plugin, Studio UI, and bounded automation. The application owns durable state, authorization, budgets, jobs, adapters, attempts, media, rendering, audit, and review gates. Use one Hermes Coordinator with focused skills and typed tools. Spawn focused subagents only for bounded reasoning-heavy work such as research, script critique, continuity review, or edit review. Do not create a permanent CrewAI/LangGraph-style fleet merely to name roles. Every meaningful agent operation must have a human Studio equivalent, and every human edit must use the same canonical command/state path. “YOLO” is an autonomy policy (`manual`, `supervised`, or autonomous within an approved contract), not a separate pipeline. Persist command/job/attempt events and project them live into the Studio; never keep progress only in process memory or chat. Do not equate a semantic scene, visual shot, narration segment, dialogue utterance, or audio track. Continuous narration may span several shots. Character-count pacing estimates are warnings and planning evidence, not hard scene-fit truth; only scene-locked dialogue requires speech to fit one performance scene. For narrated work, actual synthesized/probed audio should become authoritative before expensive clip generation. State transitions, money, credentials, jobs, review, media registration, and audit belong to deterministic application commands—not prose-agent memory. Hard validators protect real invariants (capabilities, provider schema, authorization, assets, duration enums, budgets, and approvals); creative heuristics such as pacing, drift, and continuity risk normally become warnings for Hermes or the human to resolve. Read `references/agent-native-dual-control-video-architecture.md` before redesigning the domain model, timeline, Hermes plugin, Model Intelligence bridge, live Studio projection, autonomy modes, or standalone/Caduceus packaging. ## Canon rules - `character`: identity, wardrobe/appearance anchors, guide angles, lock policy - `location`: empty environment reference unless people are deliberately part of the reference - `product`: exact product shape/markings; distinguish legal logo assets from generative approximations - `prop`: object-only by default - `style`: palette, lens, lighting, texture, motion language - `logo`: supplied exact asset; never regenerate for final brand use Scene assignments carry role and priority. Reject cross-project canon references. A local one-shot detail should remain prompt-only unless repeated continuity justifies a canon entry. Read `references/durable-canon-attempt-production-map.md` before implementing or reviewing canon storage, real-pipeline attempt recording, explicit selections, retry recovery, or a production-map UI. It includes the frame-role selection pitfall, post-provider failure accounting, accepted-low-score resume rule, and immutable-delete/cascade warning. Read `references/video-director.md` and `references/continuity-validator.md` before authoring a high-stakes blueprint. ## Exact supplied-frame workflow Read `references/frame-capability-and-blueprint-timing.md` before changing model routing, first/last-frame semantics, narration preflight, interactive draft review, or release verification. It covers strict no-downgrade capability handling, exact-asset versus pixel-exact output, timing/anchoring coupling, preserving invalid drafts for repair, and Alex’s lean release preference. For exact charts, diagrams, astrology wheels, branded screens, typography, or UI: 1. Build the frame deterministically. 2. Verify the file exists and is production resolution. 3. Supply it to the scene's expected frame role. 4. Mark it as accepted supplied artwork with provenance; do not ledger it as an AI generation. 5. Use a terse motion bridge for first/last-frame models. 6. Verify the final encoded video actually preserves the exact frame at the required moment. Never bypass project media registration or allow arbitrary untrusted paths in tenant Caduceus. ## Durable recovery When a run appears stuck: 1. Read contract state and durable job state. 2. Verify whether a live lease exists and whether it is expired. 3. Inspect stage/entity statuses and append-only attempts. 4. Reclaim only stale leases; never start a duplicate worker for an active lease. 5. Resume the idempotent stage from stored state. 6. If provider output completed but finalization failed, recover from provider operation ID/output before spending again. 7. If a hard cap paused the run, require explicit budget approval. 8. Verify final state from DB plus actual media, not logs alone. For route/worker implementation, keep HTTP handlers enqueue-only, keep app factories free of worker timers, let production boot own an explicit worker lifecycle, and enforce active-job deduplication plus owner-checked leases in SQLite. Use an injected no-spend executor for focused integration tests before running the real pipeline. See `references/durable-route-worker-integration.md` for the complete store invariants, polling/heartbeat structure, API surfaces, RED tests, and verification sequence. ## Performance-ad loop Every ad production should preserve: - Creative project/brief/output/variant IDs - Evidence and pattern IDs - Hook and opening-frame identity - Product/proof/CTA - Platform, placement, audience, aspect, duration - Hermes Video production/run/export IDs - Social/Ads draft and platform identifiers Performance observations store raw counters; derived CTR/CVR/CPA/ROAS are computed server-side. Treat small samples as weak evidence and retain sample size/date range. Feed winners and losers back into Hermes Creative rather than embedding business learning in the video renderer. Read `references/performance-ad-creative.md` for the production checklist. ## Editorial review Read `references/filmstrip-editor.md`. Core rules: - Make a filmstrip before deciding trim/regenerate/reorder. - AI clips often have a settling opening and degraded tail; cut based on evidence. - Normalize streams before concatenation; avoid unsafe stream-copy assumptions. - Use nondestructive edit decisions and preserve source clips. - Keep one master voice path; generated clip speech under TTS causes doubled audio. - Verify captions and CTA at encoded output resolution. Supporting script: `scripts/build_filmstrip.py INPUT.mp4 OUTPUT.jpg`. ## Spending and review boundaries - Schema validation, local composition, ffprobe, filmstrips, and synthetic canaries are non-spending. - Provider generation requires a signed run contract and budget guard. - **Zero cost never implies final creative approval.** Final-cut acceptance must use an explicit human-only gate that bypasses general auto/judge evaluation. - Before release, negatively probe that Social handoff is rejected while final review is pending; only a recorded human approval may unlock draft creation. - Social draft creation is not publishing. - Ads draft creation is not activation or spend. - Existing tenants must not be recreated or rolled forward without preserving state, image identity, route, and rollback data. Read `references/agent-native-proof-and-human-gates.md` for the reusable authenticated no-spend proof, live Model Intelligence detail adaptation, selective-invalidation evidence, export-to-Vault lineage, and mandatory pre-approval handoff rejection. ## Completion checklist - [ ] Production intent, content mode, timing/audio mode, subject policy, and autonomy policy are explicit. - [ ] Semantic scenes, visual shots, narration/dialogue segments, and audio tracks are not falsely coupled. - [ ] Hermes and the human Studio operate the same actor-aware commands and canonical state. - [ ] Model Intelligence requirements were queried and the exact deployment/schema/capability/pricing evidence was frozen into the contract. - [ ] Canon references are minimal, scoped, versioned, and assigned. - [ ] Hard validation covers executable provider/authority/budget invariants; creative heuristics remain warnings or explicit override decisions. - [ ] Signed run contract and hard cap exist before provider spend. - [ ] Durable job state—not only process state—shows progress. - [ ] Attempts preserve exact payload/provenance/cost/judgment/error. - [ ] Selected output is explicit. - [ ] Deterministic composition preserves brand assets and safe areas. - [ ] A real artifact is registered as an immutable Vault version with hash/duration/provenance and typed relations to exact frozen source versions; synthetic task completion alone does not satisfy this gate. - [ ] Final creative acceptance is human-only; a pre-approval Social handoff negative probe fails, then human approval unlocks draft creation only. - [ ] ffprobe and filmstrip/visual review pass. - [ ] Variant/pattern/production lineage survives Social/Ads handoff. - [ ] Caduceus schema/fixture hashes match standalone exactly; import strips credentials, signing, approval, active jobs, and spend authority. - [ ] Typed tool path and unprivileged tenant media-runtime readiness pass before tenant release.