The problem

Film production has a department whose job is to keep the world of the story consistent. Not to make the shots look alike, but to keep the facts stable. The wound stays on the left cheek. The ring goes on after the wedding, not before. The dog that died in scene 9 does not reappear in scene 20.

The industry uses one term, continuity, for two problems that are not alike.

The first is shot continuity. Two takes are cut together and the glass is full in one and empty in the next. This problem is solved. The frames are visually similar, so you can register one onto the other and compare pixels. Pickup and Zisserman published the method in 2009 and a company is selling it today.

The second is story continuity, and it is open. The reason is structural. A cut appears on the left cheek in scene 12, filmed in April, and on the right cheek in scene 30, filmed in June at a different location. The camera angle differs, the lighting differs, sometimes the year differs. No homography fits between the two frames, so no registration based method has anything to say about them. Story continuity is also the harder task for a person. A script supervisor can hold one scene in working memory. Nobody holds seventy hours of a series.

The approach

The system does not compare images. It compares claims about the world.

For every shot and every line of dialogue, it extracts what is asserted to be true: who is present, what they are wearing and carrying, what is injured and where, the time of day, the weather. Each assertion carries provenance, meaning title, scene, shot, timecode, and a confidence value. The system then searches for pairs of assertions that cannot both hold, given the order of events in the story and given whether anything occurring between them would explain the change.

The clearest case has no second frame at all. In Detour (1945) a line of dialogue places three scratches "about a quarter of an inch apart." The hand shown on screen has them roughly three times that far apart. This is a contradiction between what is said and what is shown. No pixel method can reach it, because there is no second image to register against.

Division of labour between the two components

Neither component can do the other's work.

ClickHouse narrows the search space. Contradiction search is quadratic in the length of the story. A feature film produces thousands of shots and each shot yields tens of assertions. Checking the history of one attribute means ordering the assertions, self joining them, and asking for every pair whether an explaining event falls between them. A windowed query reduces billions of candidate comparisons to a shortlist of transitions. The database identifies transitions. It never decides whether a transition is an error.

Gemini adjudicates the shortlist. Deciding whether "left cheek" followed by "right cheek" is an error requires world knowledge and narrative reasoning: that a cut does not migrate across a face, that four days have passed, that nothing shown in between accounts for it. There is no threshold that expresses this. Gemini judges only the candidates the database hands it, because scanning the full corpus with a model is neither affordable nor reliable.

Implementation

The system runs as a Google ADK agent, an LlmAgent backed by Gemini 3.6 Flash on Vertex AI. Its only route to data is the ClickHouse MCP server, mcp-clickhouse, mounted as the agent's toolset over stdio and pointed at a ClickHouse Cloud cluster at runtime. Gemini decides which contradiction to investigate, the MCP server executes the SQL, and Gemini reads the returned rows. The model never touches the database directly. The specific call sites are listed in docs/PARTNER.md.

The hosted page queries the same cluster on each request, so a visitor sees a live query rather than stored output.

Evaluation against the prior art

The claim that distinguishes this work from registration based tools is that it reaches pairs of frames those tools cannot. We measured this rather than asserting it, by running the prior art's own technique: ORB feature detection, RANSAC homography estimation, and a count of geometric inliers. Below fifteen inliers no homography fits, and a registration based tool cannot align the pair.

pairs unreachable by registration
our findings (cross scene and flagged errors) 146 of 159, or 92%
control: two frames 0.5s apart within one shot 2 of 60, or 3%

On Detour (1945), about 92% of what the system finds connects frames that a registration based method cannot align, against about 3% for control pairs that are guaranteed to come from the same camera setup. This is classical computer vision rather than a model. It runs the competing method and reports where it stops. The measurement can be regenerated with evals/reachability.py.

Limits worth stating

Findings carry a verdict, and "explained" matters as much as "error." A change the story accounts for is not a mistake, and on Detour most flagged transitions resolve to explained rather than error.

The system does not address shot continuity. That problem is solved, and docs/PRIOR-ART.md says so directly.

The corpus is public domain film. The film itself is not committed to the repository. scripts/fetch_corpus.sh downloads it and prints its sha256 so the input can be verified.

Built With

Share this project:

Updates

Submission history