Skip to content

models

Class info

Classes

Name Children Inherits
ActivitySample
framesheet.models
One dense video sample: share of pixels changed since the previous sample.
    AnimationTiming
    framesheet.models
    Timing of one declarative animation, as reported by the browser.
      DurationInfo
      framesheet.models
      The sampled time span and how it was chosen.
        ElementTrack
        framesheet.models
        Geometry of one animated element over all frames.
          Finding
          framesheet.models
          A single problem (or noteworthy fact) found by a static or render check.
            FrameMetrics
            framesheet.models
            Per-frame numbers.
              Images
              framesheet.models
                InspectionResult
                framesheet.models
                Everything framesheet found out about one input.
                  LoopInfo
                  framesheet.models
                  How cleanly the last frame of a cycle joins the first.
                    MarkFrame
                    framesheet.models
                    Pixel size the coordinates refer to (omit for normalized 0-1 coordinates).
                      MarkPoint
                      framesheet.models
                      An instant at a position, e.g. a click: drawn on the tile nearest to ``t``.
                        MarkRegion
                        framesheet.models
                        A time range, optionally with a box: a target element, a zoom, a highlight.
                          MarkSpan
                          framesheet.models
                          A labelled time range, e.g. a caption; the optional box is its screen area.
                            Marks
                            framesheet.models
                            Annotations drawn onto video tiles and the timeline (``--marks marks.json``).
                              VideoInfo
                              framesheet.models
                              Media facts and dense-sample metrics of a video or animated image.
                                VideoTile
                                framesheet.models
                                Per-tile numbers for videos, so an agent can score without looking.

                                  🛈 DocStrings

                                  Result models for framesheet inspections.

                                  FINDING_CODES module-attribute

                                  FINDING_CODES: dict[str, tuple[Severity, Literal["static", "render"], str]] = {
                                      "malformed-xml": ("error", "static", "The SVG is not well-formed XML."),
                                      "not-svg": ("error", "static", "The root element is not <svg>."),
                                      "missing-xmlns": ("error", "static", "The root <svg> lacks the SVG namespace."),
                                      "missing-viewbox": ("error", "static", "The root <svg> has no viewBox."),
                                      "missing-title": ("warning", "static", "No aria-label or <title>."),
                                      "script": ("error", "static", "Contains <script>."),
                                      "foreign-object": ("warning", "static", "Contains <foreignObject>."),
                                      "event-handler": ("error", "static", "Inline on* event handler attribute."),
                                      "external-url": ("warning", "static", "External http(s) URL in an attribute."),
                                      "positive-begin": ("warning", "static", "<animateMotion> with a positive begin."),
                                      "duplicate-id": ("error", "static", "The same id is used more than once."),
                                      "broken-ref": ("error", "static", "#id / url(#id) reference without a matching id."),
                                      "css-external": ("warning", "static", "CSS references an external URL or font."),
                                      "no-reduced-motion": ("warning", "static", "CSS animations without prefers-reduced-motion."),
                                      "transform-origin-without-box": (
                                          "warning",
                                          "static",
                                          "CSS transform-origin without transform-box in SVG.",
                                      ),
                                      "transform-without-box": (
                                          "warning",
                                          "static",
                                          "@keyframes animate transforms in SVG without transform-box.",
                                      ),
                                      "large-file": ("warning", "static", "SVG larger than 100 KB."),
                                      "parked-at-origin": ("warning", "render", "Small SVG element sits at the origin (0,0)."),
                                      "outside-bounds": ("warning", "render", "Element extends outside the viewBox/viewport."),
                                      "text-overflow": ("warning", "render", "Text larger than its container."),
                                      "svg-transform-box": (
                                          "warning",
                                          "render",
                                          "CSS transform animation pivots around the SVG origin.",
                                      ),
                                      "non-seamless-loop": ("warning", "render", "The loop jumps at the cycle end."),
                                      "js-driven-motion": ("warning", "render", "Pixels change without declarative animations."),
                                      "no-visible-motion": ("info", "render", "Animations declared but no pixel changed."),
                                      "no-motion": ("info", "render", "No animation and no pixel change."),
                                      "console-error": ("warning", "render", "console.error or uncaught page error."),
                                      "video-static-stretch": (
                                          "warning",
                                          "render",
                                          "No visible change for longer than the static threshold (dead time).",
                                      ),
                                      "video-black-frames": ("warning", "render", "Sampled frames that are (almost) all black."),
                                      "video-blank-frames": ("warning", "render", "Sampled frames of one flat colour (not black)."),
                                      "video-abrupt-cut": ("info", "render", "One large change between quiet neighbours."),
                                      "video-mark-overlap": (
                                          "warning",
                                          "render",
                                          "A span box (e.g. a caption) covers an active target region.",
                                      ),
                                  }
                                  

                                  Every finding code (API: stable, kebab-case) -> (usual severity, check, meaning).

                                  Both implementations (Python and npm) may only emit these; the shared JSON Schema (schema/report.schema.json) pins them as an enum. Add new codes here first.

                                  Rect module-attribute

                                  Rect = tuple[float, float, float, float]
                                  

                                  An axis-aligned box as (x, y, width, height).

                                  ActivitySample

                                  Bases: BaseModel

                                  One dense video sample: share of pixels changed since the previous sample.

                                  Source code in src/framesheet/models.py
                                  class ActivitySample(BaseModel):
                                      """One dense video sample: share of pixels changed since the previous sample."""
                                  
                                      t: float
                                      changed_ratio: float
                                  

                                  AnimationTiming

                                  Bases: BaseModel

                                  Timing of one declarative animation, as reported by the browser.

                                  Source code in src/framesheet/models.py
                                  class AnimationTiming(BaseModel):
                                      """Timing of one declarative animation, as reported by the browser."""
                                  
                                      kind: Literal["smil", "css-animation", "css-transition", "web-animation"]
                                      target: str | None = None
                                      name: str | None = None
                                      start: float
                                      """Begin / delay in seconds (may be negative)."""
                                      duration: float
                                      """Duration of one iteration in seconds."""
                                      iterations: float | None
                                      """Iteration count; ``None`` means infinite."""
                                      direction: str = "normal"
                                      period: float
                                      """Seconds until the animation looks the same again (2x duration for alternate)."""
                                      end: float | None
                                      """End of the active interval in seconds; ``None`` if infinite."""
                                      transform_box: str | None = None
                                      """Computed ``transform-box`` of an SVG target whose transform is animated by CSS."""
                                  

                                  duration instance-attribute

                                  duration: float
                                  

                                  Duration of one iteration in seconds.

                                  end instance-attribute

                                  end: float | None
                                  

                                  End of the active interval in seconds; None if infinite.

                                  iterations instance-attribute

                                  iterations: float | None
                                  

                                  Iteration count; None means infinite.

                                  period instance-attribute

                                  period: float
                                  

                                  Seconds until the animation looks the same again (2x duration for alternate).

                                  start instance-attribute

                                  start: float
                                  

                                  Begin / delay in seconds (may be negative).

                                  transform_box class-attribute instance-attribute

                                  transform_box: str | None = None
                                  

                                  Computed transform-box of an SVG target whose transform is animated by CSS.

                                  DurationInfo

                                  Bases: BaseModel

                                  The sampled time span and how it was chosen.

                                  Source code in src/framesheet/models.py
                                  class DurationInfo(BaseModel):
                                      """The sampled time span and how it was chosen."""
                                  
                                      seconds: float
                                      method: Literal["override", "detected", "fallback", "media"]
                                      looping: bool
                                      """True if at least one animation repeats forever (or motion is JS-driven)."""
                                      detail: str
                                      animations: list[AnimationTiming] = Field(default_factory=list)
                                  

                                  looping instance-attribute

                                  looping: bool
                                  

                                  True if at least one animation repeats forever (or motion is JS-driven).

                                  ElementTrack

                                  Bases: BaseModel

                                  Geometry of one animated element over all frames.

                                  Source code in src/framesheet/models.py
                                  class ElementTrack(BaseModel):
                                      """Geometry of one animated element over all frames."""
                                  
                                      element: str
                                      animated_by: list[str]
                                      """``smil``, ``css-animation``, ``web-animation`` and/or ``moved`` (geometry changed)."""
                                      units: Literal["viewBox", "px"]
                                      boxes: list[Rect | None]
                                      """One box per frame (``None`` if not rendered at that frame)."""
                                  

                                  animated_by instance-attribute

                                  animated_by: list[str]
                                  

                                  smil, css-animation, web-animation and/or moved (geometry changed).

                                  boxes instance-attribute

                                  boxes: list[Rect | None]
                                  

                                  One box per frame (None if not rendered at that frame).

                                  Finding

                                  Bases: BaseModel

                                  A single problem (or noteworthy fact) found by a static or render check.

                                  Source code in src/framesheet/models.py
                                  class Finding(BaseModel):
                                      """A single problem (or noteworthy fact) found by a static or render check."""
                                  
                                      severity: Severity
                                      code: str
                                      """Stable, kebab-case identifier, e.g. ``parked-at-origin``."""
                                      message: str
                                      check: Literal["static", "render"]
                                      element: str | None = None
                                      """Human-readable element label such as ``circle#dot`` or ``text[2] "Hello"``."""
                                      times: list[float] | None = None
                                      """Sample times (seconds) at which the problem was observed."""
                                  

                                  code instance-attribute

                                  code: str
                                  

                                  Stable, kebab-case identifier, e.g. parked-at-origin.

                                  element class-attribute instance-attribute

                                  element: str | None = None
                                  

                                  Human-readable element label such as circle#dot or text[2] "Hello".

                                  times class-attribute instance-attribute

                                  times: list[float] | None = None
                                  

                                  Sample times (seconds) at which the problem was observed.

                                  FrameMetrics

                                  Bases: BaseModel

                                  Per-frame numbers.

                                  Source code in src/framesheet/models.py
                                  class FrameMetrics(BaseModel):
                                      """Per-frame numbers."""
                                  
                                      index: int
                                      t: float
                                      changed_ratio: float
                                      """Share of pixels that differ from the previous frame (0 for the first frame)."""
                                      changed_box: Rect | None = None
                                      """Bounding box (CSS px) of the pixels that changed vs. the previous frame."""
                                      path: Path | None = None
                                      """Path of the individual frame PNG, if frames were kept."""
                                  

                                  changed_box class-attribute instance-attribute

                                  changed_box: Rect | None = None
                                  

                                  Bounding box (CSS px) of the pixels that changed vs. the previous frame.

                                  changed_ratio instance-attribute

                                  changed_ratio: float
                                  

                                  Share of pixels that differ from the previous frame (0 for the first frame).

                                  path class-attribute instance-attribute

                                  path: Path | None = None
                                  

                                  Path of the individual frame PNG, if frames were kept.

                                  InspectionResult

                                  Bases: BaseModel

                                  Everything framesheet found out about one input.

                                  Source code in src/framesheet/models.py
                                  class InspectionResult(BaseModel):
                                      """Everything framesheet found out about one input."""
                                  
                                      source: str
                                      kind: SourceKind
                                      viewport: tuple[int, int]
                                      device_scale_factor: float
                                      canvas: Rect
                                      """Drawing area in CSS px (the viewBox for SVG documents, the viewport for HTML)."""
                                      duration: DurationInfo
                                      times: list[float]
                                      """Sample times of the contact-sheet tiles in seconds."""
                                      full_at: float
                                      images: Images
                                      findings: list[Finding]
                                      frames: list[FrameMetrics]
                                      elements: list[ElementTrack]
                                      loop: LoopInfo
                                      console_errors: list[str] = Field(default_factory=list)
                                      video: VideoInfo | None = None
                                      """Media facts and per-tile metrics (video inputs only)."""
                                      marks: Marks | None = None
                                      """The marks drawn onto the sheet (``--marks``), as given."""
                                  
                                      @property
                                      def errors(self) -> list[Finding]:
                                          return [f for f in self.findings if f.severity == "error"]
                                  
                                      @property
                                      def warnings(self) -> list[Finding]:
                                          return [f for f in self.findings if f.severity == "warning"]
                                  
                                      def codes(self) -> set[str]:
                                          """All finding codes, handy for assertions."""
                                          return {f.code for f in self.findings}
                                  
                                      def summary(self) -> str:
                                          """Concise multi-line text for humans and agents (what the CLI prints)."""
                                          w, h = self.viewport
                                          d = self.duration
                                          lines = [
                                              f"framesheet: {self.source} ({self.kind}, {w}x{h} @{self.device_scale_factor:g}x)",
                                              f"duration: {d.seconds:g}s {d.method}: {d.detail}"
                                              + (" [looping]" if d.looping else ""),
                                          ]
                                          if v := self.video:
                                              facts = f"{v.container} {v.codec or '?'} {v.width}x{v.height}"
                                              if v.fps:
                                                  facts += f" {v.fps:g}fps"
                                              if v.frame_count:
                                                  facts += f", {v.frame_count} frames"
                                              lines.append(f"video: {facts}; range {v.start:g}-{v.end:g}s, {len(v.samples)} samples")
                                          busiest = max(self.frames, key=lambda f: f.changed_ratio)
                                          motion = (
                                              f"max change {busiest.changed_ratio:.1%} at t={busiest.t:.2f}s"
                                              if busiest.changed_ratio
                                              else "no pixel changes"
                                          )
                                          lines.append(
                                              f"frames: {len(self.times)} at t={self.times[0]:.2f}..{self.times[-1]:.2f}s; {motion}"
                                          )
                                          if self.loop.checked:
                                              verdict = "seamless" if self.loop.seamless else "NOT seamless"
                                              lines.append(f"loop: {verdict} ({self.loop.detail})")
                                          else:
                                              lines.append(f"loop: not checked ({self.loop.detail})")
                                          moving = [e.element for e in self.elements][:8]
                                          if moving:
                                              more = f" (+{len(self.elements) - 8} more)" if len(self.elements) > 8 else ""  # noqa: PLR2004
                                              lines.append(f"animated elements: {', '.join(moving)}{more}")
                                          counts = {
                                              s: sum(f.severity == s for f in self.findings) for s in ("error", "warning", "info")
                                          }
                                          lines.append(
                                              f"findings: {counts['error']} error(s), {counts['warning']} warning(s), "
                                              f"{counts['info']} info"
                                          )
                                          tags = {"error": "ERROR", "warning": "WARN ", "info": "INFO "}
                                          lines.extend(
                                              f"  {tags[f.severity]} [{f.check}] {f.code}: {f.message}" for f in self.findings
                                          )
                                          lines += [
                                              "images:",
                                              f"  full     {self.images.full}  (t={self.full_at:g}s: layout, text, margins)",
                                              f"  sheet    {self.images.sheet}  "
                                              + ("(tiles over the range + timeline)" if self.video else "(motion over one cycle)"),
                                              f"  heatmap  {self.images.heatmap}  (what moves at all)",
                                              f"  report   {self.images.report}",
                                          ]
                                          return "\n".join(lines)
                                  

                                  canvas instance-attribute

                                  canvas: Rect
                                  

                                  Drawing area in CSS px (the viewBox for SVG documents, the viewport for HTML).

                                  marks class-attribute instance-attribute

                                  marks: Marks | None = None
                                  

                                  The marks drawn onto the sheet (--marks), as given.

                                  times instance-attribute

                                  times: list[float]
                                  

                                  Sample times of the contact-sheet tiles in seconds.

                                  video class-attribute instance-attribute

                                  video: VideoInfo | None = None
                                  

                                  Media facts and per-tile metrics (video inputs only).

                                  codes

                                  codes() -> set[str]
                                  

                                  All finding codes, handy for assertions.

                                  Source code in src/framesheet/models.py
                                  def codes(self) -> set[str]:
                                      """All finding codes, handy for assertions."""
                                      return {f.code for f in self.findings}
                                  

                                  summary

                                  summary() -> str
                                  

                                  Concise multi-line text for humans and agents (what the CLI prints).

                                  Source code in src/framesheet/models.py
                                  def summary(self) -> str:
                                      """Concise multi-line text for humans and agents (what the CLI prints)."""
                                      w, h = self.viewport
                                      d = self.duration
                                      lines = [
                                          f"framesheet: {self.source} ({self.kind}, {w}x{h} @{self.device_scale_factor:g}x)",
                                          f"duration: {d.seconds:g}s {d.method}: {d.detail}"
                                          + (" [looping]" if d.looping else ""),
                                      ]
                                      if v := self.video:
                                          facts = f"{v.container} {v.codec or '?'} {v.width}x{v.height}"
                                          if v.fps:
                                              facts += f" {v.fps:g}fps"
                                          if v.frame_count:
                                              facts += f", {v.frame_count} frames"
                                          lines.append(f"video: {facts}; range {v.start:g}-{v.end:g}s, {len(v.samples)} samples")
                                      busiest = max(self.frames, key=lambda f: f.changed_ratio)
                                      motion = (
                                          f"max change {busiest.changed_ratio:.1%} at t={busiest.t:.2f}s"
                                          if busiest.changed_ratio
                                          else "no pixel changes"
                                      )
                                      lines.append(
                                          f"frames: {len(self.times)} at t={self.times[0]:.2f}..{self.times[-1]:.2f}s; {motion}"
                                      )
                                      if self.loop.checked:
                                          verdict = "seamless" if self.loop.seamless else "NOT seamless"
                                          lines.append(f"loop: {verdict} ({self.loop.detail})")
                                      else:
                                          lines.append(f"loop: not checked ({self.loop.detail})")
                                      moving = [e.element for e in self.elements][:8]
                                      if moving:
                                          more = f" (+{len(self.elements) - 8} more)" if len(self.elements) > 8 else ""  # noqa: PLR2004
                                          lines.append(f"animated elements: {', '.join(moving)}{more}")
                                      counts = {
                                          s: sum(f.severity == s for f in self.findings) for s in ("error", "warning", "info")
                                      }
                                      lines.append(
                                          f"findings: {counts['error']} error(s), {counts['warning']} warning(s), "
                                          f"{counts['info']} info"
                                      )
                                      tags = {"error": "ERROR", "warning": "WARN ", "info": "INFO "}
                                      lines.extend(
                                          f"  {tags[f.severity]} [{f.check}] {f.code}: {f.message}" for f in self.findings
                                      )
                                      lines += [
                                          "images:",
                                          f"  full     {self.images.full}  (t={self.full_at:g}s: layout, text, margins)",
                                          f"  sheet    {self.images.sheet}  "
                                          + ("(tiles over the range + timeline)" if self.video else "(motion over one cycle)"),
                                          f"  heatmap  {self.images.heatmap}  (what moves at all)",
                                          f"  report   {self.images.report}",
                                      ]
                                      return "\n".join(lines)
                                  

                                  LoopInfo

                                  Bases: BaseModel

                                  How cleanly the last frame of a cycle joins the first.

                                  Source code in src/framesheet/models.py
                                  class LoopInfo(BaseModel):
                                      """How cleanly the last frame of a cycle joins the first."""
                                  
                                      checked: bool
                                      seamless: bool | None = None
                                      seam_ratio: float | None = None
                                      """Changed-pixel share between ``t=end-epsilon`` and ``t=0``."""
                                      step_ratio: float | None = None
                                      """Changed-pixel share between ``t=0`` and ``t=epsilon`` (normal motion per step)."""
                                      seam_box: Rect | None = None
                                      detail: str
                                  

                                  seam_ratio class-attribute instance-attribute

                                  seam_ratio: float | None = None
                                  

                                  Changed-pixel share between t=end-epsilon and t=0.

                                  step_ratio class-attribute instance-attribute

                                  step_ratio: float | None = None
                                  

                                  Changed-pixel share between t=0 and t=epsilon (normal motion per step).

                                  MarkFrame

                                  Bases: BaseModel

                                  Pixel size the coordinates refer to (omit for normalized 0-1 coordinates).

                                  Source code in src/framesheet/models.py
                                  class MarkFrame(BaseModel):
                                      """Pixel size the coordinates refer to (omit for normalized 0-1 coordinates)."""
                                  
                                      model_config = ConfigDict(extra="forbid", strict=True)
                                      width: float = Field(gt=0)
                                      height: float = Field(gt=0)
                                  

                                  MarkPoint

                                  Bases: BaseModel

                                  An instant at a position, e.g. a click: drawn on the tile nearest to t.

                                  Source code in src/framesheet/models.py
                                  class MarkPoint(BaseModel):
                                      """An instant at a position, e.g. a click: drawn on the tile nearest to ``t``."""
                                  
                                      model_config = ConfigDict(extra="forbid", strict=True)
                                      t: float = Field(ge=0)
                                      x: float
                                      y: float
                                      label: str | None = None
                                      kind: str | None = None
                                      """Free-form, e.g. ``click``."""
                                      duration: float = Field(default=0.0, ge=0)
                                      """Seconds the point stays relevant (drawn on every tile it overlaps)."""
                                  

                                  duration class-attribute instance-attribute

                                  duration: float = Field(default=0.0, ge=0)
                                  

                                  Seconds the point stays relevant (drawn on every tile it overlaps).

                                  kind class-attribute instance-attribute

                                  kind: str | None = None
                                  

                                  Free-form, e.g. click.

                                  MarkRegion

                                  Bases: _Box

                                  A time range, optionally with a box: a target element, a zoom, a highlight.

                                  Source code in src/framesheet/models.py
                                  class MarkRegion(_Box):
                                      """A time range, optionally with a box: a target element, a zoom, a highlight."""
                                  
                                      model_config = ConfigDict(extra="forbid", strict=True)
                                      start: float = Field(ge=0)
                                      end: float = Field(ge=0)
                                      label: str | None = None
                                      kind: str | None = None
                                      """Free-form, e.g. ``zoom``. ``target`` boxes are checked against span boxes."""
                                  
                                      @model_validator(mode="after")
                                      def _ordered(self) -> Any:
                                          if self.end < self.start:
                                              msg = "end must be >= start"
                                              raise ValueError(msg)
                                          return self
                                  

                                  kind class-attribute instance-attribute

                                  kind: str | None = None
                                  

                                  Free-form, e.g. zoom. target boxes are checked against span boxes.

                                  MarkSpan

                                  Bases: _Box

                                  A labelled time range, e.g. a caption; the optional box is its screen area.

                                  Source code in src/framesheet/models.py
                                  class MarkSpan(_Box):
                                      """A labelled time range, e.g. a caption; the optional box is its screen area."""
                                  
                                      model_config = ConfigDict(extra="forbid", strict=True)
                                      start: float = Field(ge=0)
                                      end: float = Field(ge=0)
                                      label: str
                                      kind: str | None = None
                                      """Free-form, e.g. ``caption``."""
                                  
                                      @model_validator(mode="after")
                                      def _ordered(self) -> Any:
                                          if self.end < self.start:
                                              msg = "end must be >= start"
                                              raise ValueError(msg)
                                          return self
                                  

                                  kind class-attribute instance-attribute

                                  kind: str | None = None
                                  

                                  Free-form, e.g. caption.

                                  Marks

                                  Bases: BaseModel

                                  Annotations drawn onto video tiles and the timeline (--marks marks.json).

                                  Times are seconds of the media; coordinates are fractions (0-1) of the video frame, or pixels of frame if given.

                                  Source code in src/framesheet/models.py
                                  class Marks(BaseModel):
                                      """Annotations drawn onto video tiles and the timeline (``--marks marks.json``).
                                  
                                      Times are seconds of the media; coordinates are fractions (0-1) of the video frame,
                                      or pixels of ``frame`` if given.
                                      """
                                  
                                      model_config = ConfigDict(extra="forbid", strict=True)
                                      frame: MarkFrame | None = None
                                      points: list[MarkPoint] = Field(default_factory=list)
                                      regions: list[MarkRegion] = Field(default_factory=list)
                                      spans: list[MarkSpan] = Field(default_factory=list)
                                  
                                      @model_validator(mode="after")
                                      def _coordinates(self) -> Any:
                                          fw, fh = (self.frame.width, self.frame.height) if self.frame else (1.0, 1.0)
                                          for kind, items in (("points", self.points), ("regions", self.regions)):
                                              for i, item in enumerate(items):
                                                  _check_xy(f"{kind}[{i}]", item, fw, fh)
                                          for i, item in enumerate(self.spans):
                                              _check_xy(f"spans[{i}]", item, fw, fh)
                                          return self
                                  
                                      def norm(self, x: float, y: float) -> tuple[float, float]:
                                          """A position as fractions of the frame."""
                                          if self.frame:
                                              return x / self.frame.width, y / self.frame.height
                                          return x, y
                                  

                                  norm

                                  norm(x: float, y: float) -> tuple[float, float]
                                  

                                  A position as fractions of the frame.

                                  Source code in src/framesheet/models.py
                                  def norm(self, x: float, y: float) -> tuple[float, float]:
                                      """A position as fractions of the frame."""
                                      if self.frame:
                                          return x / self.frame.width, y / self.frame.height
                                      return x, y
                                  

                                  VideoInfo

                                  Bases: BaseModel

                                  Media facts and dense-sample metrics of a video or animated image.

                                  Source code in src/framesheet/models.py
                                  class VideoInfo(BaseModel):
                                      """Media facts and dense-sample metrics of a video or animated image."""
                                  
                                      container: str
                                      """``mp4``, ``mov``, ``webm``, ``mkv``, ``gif`` or ``webp``."""
                                      codec: str | None
                                      """``h264``, ``hevc``, ``vp8``, ``vp9``, ``av1``, ``gif``, ``webp``, ... if detectable."""
                                      decoder: Literal["video", "image-decoder"]
                                      width: int
                                      height: int
                                      media_duration: float | None
                                      fps: float | None
                                      frame_count: int | None
                                      start: float
                                      end: float
                                      static_threshold: float
                                      """Seconds without visible change that count as a static stretch."""
                                      samples: list[ActivitySample]
                                      """Every sampled time in ``[start, end]`` (tiles + dense grid), in order."""
                                      tiles: list[VideoTile]
                                  

                                  codec instance-attribute

                                  codec: str | None
                                  

                                  h264, hevc, vp8, vp9, av1, gif, webp, ... if detectable.

                                  container instance-attribute

                                  container: str
                                  

                                  mp4, mov, webm, mkv, gif or webp.

                                  samples instance-attribute

                                  samples: list[ActivitySample]
                                  

                                  Every sampled time in [start, end] (tiles + dense grid), in order.

                                  static_threshold instance-attribute

                                  static_threshold: float
                                  

                                  Seconds without visible change that count as a static stretch.

                                  VideoTile

                                  Bases: BaseModel

                                  Per-tile numbers for videos, so an agent can score without looking.

                                  Source code in src/framesheet/models.py
                                  class VideoTile(BaseModel):
                                      """Per-tile numbers for videos, so an agent can score without looking."""
                                  
                                      index: int
                                      t: float
                                      media_time: float | None
                                      """Presentation time of the decoded frame (``None`` if the browser did not say)."""
                                      black: bool
                                      blank: bool
                                      """One flat colour that is not black (e.g. a white page before load)."""
                                      duplicate: bool
                                      """Near-identical to the previous tile (changes < 0.05% of pixels)."""
                                      sharpness: float
                                      """Mean luma gradient (0-510); compare tiles of one video: drops = blur/upscaling."""
                                      marks: list[str]
                                      """Labels of the marks active on this tile."""
                                  

                                  blank instance-attribute

                                  blank: bool
                                  

                                  One flat colour that is not black (e.g. a white page before load).

                                  duplicate instance-attribute

                                  duplicate: bool
                                  

                                  Near-identical to the previous tile (changes < 0.05% of pixels).

                                  marks instance-attribute

                                  marks: list[str]
                                  

                                  Labels of the marks active on this tile.

                                  media_time instance-attribute

                                  media_time: float | None
                                  

                                  Presentation time of the decoded frame (None if the browser did not say).

                                  sharpness instance-attribute

                                  sharpness: float
                                  

                                  Mean luma gradient (0-510); compare tiles of one video: drops = blur/upscaling.

                                  as_rect

                                  as_rect(values: Sequence[float]) -> Rect
                                  

                                  Coerce a 4-item sequence (e.g. a JSON list from the page) to a :data:Rect.

                                  Source code in src/framesheet/models.py
                                  def as_rect(values: Sequence[float]) -> Rect:
                                      """Coerce a 4-item sequence (e.g. a JSON list from the page) to a :data:`Rect`."""
                                      x, y, w, h = values
                                      return float(x), float(y), float(w), float(h)
                                  

                                  marks_schema

                                  marks_schema() -> dict[str, Any]
                                  

                                  JSON Schema of marks.json (--marks), shared with the npm package (schema/).

                                  Cross-field rules (box all-or-none, end >= start, coordinates inside the frame) are enforced by both implementations' validators and documented in the description.

                                  Source code in src/framesheet/models.py
                                  def marks_schema() -> dict[str, Any]:
                                      """JSON Schema of ``marks.json`` (``--marks``), shared with the npm package (``schema/``).
                                  
                                      Cross-field rules (box all-or-none, ``end >= start``, coordinates inside the frame)
                                      are enforced by both implementations' validators and documented in the description.
                                      """
                                      schema = Marks.model_json_schema(mode="validation")
                                      return {
                                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                                          "$id": "https://github.com/phil65/framesheet/schema/marks.schema.json",
                                          **schema,
                                          "description": (
                                              "framesheet marks: annotations drawn onto video contact-sheet tiles and the "
                                              "timeline. Times in seconds of the media. Coordinates are fractions (0-1) of "
                                              "the video frame, or pixels of `frame` if given. A box (x, y, w, h) is all or "
                                              "nothing; end >= start; boxes and points must lie inside the frame."
                                          ),
                                      }
                                  

                                  report_schema

                                  report_schema() -> dict[str, Any]
                                  

                                  JSON Schema of report.json, shared with the npm package (schema/).

                                  Generated from :class:InspectionResult in serialization mode; every object is closed (additionalProperties: false) and every field required, because both implementations always write all fields (null for unset ones).

                                  Source code in src/framesheet/models.py
                                  def report_schema() -> dict[str, Any]:
                                      """JSON Schema of ``report.json``, shared with the npm package (``schema/``).
                                  
                                      Generated from :class:`InspectionResult` in serialization mode; every object is closed
                                      (``additionalProperties: false``) and every field required, because both
                                      implementations always write all fields (``null`` for unset ones).
                                      """
                                  
                                      def close(node: Any) -> None:
                                          if isinstance(node, dict):
                                              if node.get("type") == "object" and "properties" in node:
                                                  node["additionalProperties"] = False
                                                  node["required"] = list(node["properties"])
                                              for value in node.values():
                                                  close(value)
                                          elif isinstance(node, list):
                                              for value in node:
                                                  close(value)
                                  
                                      schema = InspectionResult.model_json_schema(mode="serialization")
                                      close(schema)
                                      code = schema["$defs"]["Finding"]["properties"]["code"]
                                      code["enum"] = list(FINDING_CODES)
                                      return {
                                          "$schema": "https://json-schema.org/draft/2020-12/schema",
                                          "$id": "https://github.com/phil65/framesheet/schema/report.schema.json",
                                          **schema,
                                          "x-finding-codes": {
                                              name: {"severity": severity, "check": check, "description": text}
                                              for name, (severity, check, text) in FINDING_CODES.items()
                                          },
                                      }