Sign inStart creating

Continuity Engine + Film Audit

Implementation: src/server/services/continuity.ts. UI: /studio/[projectId]/audit.

What these checks actually are

Structural, not perceptual. They reason over the Media Graph — what the state machine says a character is carrying, which wardrobe a shot was generated against, whether a version pin drifted out of range, whether time-of-day contradicts the previous scene, whether asset metadata meets the delivery floor.

They do not look at pixels. Whether the scar actually rendered, or whether the mouth matches the phonemes, needs a vision model. Those findings are flagged requiresVision: true and shown in the UI as "needs visual review" — never reported as clean.

This distinction is the difference between a useful tool and a liability.

Per-shot lint

lintShot(projectId, shotId) runs after every render:

  1. State events missing from the prompt — the state machine says Mara has a burn from scene 2; this shot's generation prompt does not mention it → red, with a regenerate fix.
  2. Wardrobe drift — the shot pins outfit A, the state machine resolves outfit B → red, with a one-click re-pin.
  3. Version pin out of range — the shot uses a canon version not valid for its scene → amber.
  4. No reference pack — identity will drift → amber.
  5. Dialogue without a voice profileamber.
  6. Technical QC — rendered duration vs planned, resolution below 1280px.
  7. Lip-sync presentinfo, requiresVision.

Checks 1–5 are exactly the failures the spec calls out, and all are catchable structurally.

Cross-scene checks

  • Time and weather — same location, adjacent scenes, opposite time of day with no transition. Night→day is amber; other jumps are info.
  • Props — a prop appearing in exactly one shot of a long film is usually a modelling mistake.
  • Story contradictions (Part 4.4) — the canonical example: "Scene 27: John's arm is broken; Scene 29 shows him climbing two-handed."

The contradiction checker cross-references active injuries against action verbs requiring that body part, respecting healing windows and clear points, and only fires when the character is actually present. Rules live in a LIMITATIONS table — extend it there.

  • Lighting coherence — more than two distinct key-light setups within one scene means the cut will not match.

Film Audit

runFilmAudit(projectId) scores all eleven categories. Penalties: red 18, amber 7, info 1, floored at zero. Overall is the mean.

Fix All

applyFixes(projectId, flagIds, userId) executes the graph-targeted repair recipe on each flag:

ActionBehaviour
update_shot_fieldRe-point wardrobe
repin_versionCorrect the canon version
regenerate_shotQueue a re-render (bypasses the storyboard gate — the composition was already approved)
manualReturned untouched with its label

Anything needing a human is returned, not silently skipped, so the creator sees exactly what remains.

Extending

Add a check by returning ContinuityIssue[] from a new function and calling it in runFilmAudit. Set requiresVision: true if confirming it needs perceptual analysis. Attach a fix recipe if it is machine-repairable — a flag without a fix is a to-do item, and too many of those train people to ignore the panel.