AI and affiliation disclosure: An AI agent prepared this technical exercise for TokenPeak. The tool-library story, asset records and source identifiers are synthetic. The four local test methods below were run on November 3, 2026. No dataset, video generation, real organization or audience outcome was evaluated.
A developer is preparing a video about an imagined neighborhood tool library. Charts will carry checked values. A generated workbench scene may establish the topic between sections. A workbench cannot establish how many tools were borrowed, even when it looks plausible beside a numerical claim.
This distinction can be recorded before the edit. Give every segment an intent and a visual role, then reject combinations that your production policy does not permit. The following example enforces one deliberately narrow rule: a segment with a numerical factual claim needs a chart and a nonempty source identifier. A generated scene needs an illustrative label and cannot carry that claim.
Make the source role an input
The validator does not inspect pixels or check a dataset. It checks the declared production plan. A source identifier is a reference for later review, not proof that its contents are true. The strict Boolean checks prevent an integer such as 1 from silently supplying editorial intent.
from dataclasses import dataclass import unittest @dataclass(frozen=True) class Segment: factual: bool visual_role: str source_id: str | None illustrative_label: bool def review(segment): if type(segment.factual) is not bool or type(segment.illustrative_label) is not bool: raise ValueError("intent and label must be explicit booleans") if segment.visual_role not in {"chart", "diagram", "generated_scene"}: raise ValueError("unknown visual role") if segment.factual: if segment.visual_role != "chart" or not isinstance(segment.source_id, str) or not segment.source_id.strip(): raise ValueError("this policy requires a sourced chart for a numerical claim") if segment.visual_role == "generated_scene" and not segment.illustrative_label: raise ValueError("generated scene needs its illustrative label") return segment class RoleTests(unittest.TestCase): def test_sourced_chart_can_carry_claim(self): s = Segment(True, "chart", "synthetic-dataset-v1", False) self.assertEqual(review(s), s) def test_scene_cannot_become_evidence_by_adding_source(self): with self.assertRaises(ValueError): review(Segment(True, "generated_scene", "dataset-v1", True)) def test_context_scene_needs_label(self): self.assertEqual(review(Segment(False, "generated_scene", None, True)).source_id, None) with self.assertRaises(ValueError): review(Segment(False, "generated_scene", None, False)) def test_source_and_flags_do_not_default(self): for s in [Segment(True, "chart", None, False), Segment(True, "chart", " ", False), Segment(1, "chart", "x", False), Segment(False, "photo", None, True), Segment(False, "diagram", None, 0)]: with self.subTest(s=s), self.assertRaises(ValueError): review(s) if __name__ == "__main__": unittest.main(verbosity=2) Save this complete Python 3.10+ example and run it normally. Four test methods passed locally: a sourced chart, a generated scene with a misleading source reference, label handling, and malformed declarations. No generated footage is an input to the program.
Keep the policy narrower than the evidence review
The example permits a labelled generated scene when it is contextual. It permits a diagram without a numerical claim. These are explicit choices for this exercise, not universal rules about every illustration or diagram. An editor still needs to inspect the actual sequence, labels, units, period and supporting material.
A chart identifier that points at an outdated spreadsheet passes this structural validator. So does a chart whose axis is misleading. A scene can carry an unintended factual implication even when its declaration says factual=False. Those failures need review of the source and finished edit; adding more flags does not establish truth.
Make the illustration removable
When the narration states a number, show the relevant chart and its checked context. Keep labels and claims editable outside a generated scene. Test the script with the workbench scene removed: the numerical explanation should remain understandable. If it does not, the scene may be doing evidentiary work that its source role cannot support.
The production-policy validator needs no provider quote. It makes no claim about current Seedance pricing, generation quality or audience trust.
Python's dataclasses documentation describes the record mechanism used here. The application still owns its editorial policy and review procedure.
