The phase-2 blanket freeze on foundation files (models.py, config.py, transcribe/base.py, ...) is reopened: deliberate changes are fine when they land through a reviewed issue that records the motivation. The freeze left behind exactly the friction the architecture review surfaced - a config bag that shadows per-stage options, a one-method Transcriber interface callers must reach past, a run-time path cached inside a content-addressed value. - CONTRACTS.md: post-v1 note up top, 1.10 rewritten as the reviewed-issue rule, ownership-map row updated - docs/adr/0001-reopen-foundation-freeze.md: the decision and consequences - GLOSSARY.md: the domain language, including the terms adopted by the architecture issues (analysis module, front door, MediaFacts/MediaRef, stage descriptor) Tracker: issues #5/#6/#7 relabeled ready-for-agent (freeze approved); #7 disposition decided (MediaInfo replaced in one sweep); #9 divergences confirmed (transcribe follows settings.diarize, ask gains no_cache, analyse gains --max-shots/--no-describe, va moment in scope).
3.4 KiB
video-analyse
The domain language of a local-first toolkit that turns one source into a staged, content-cached analysis. Stage results are pydantic models cached by content hash, so re-running with the same inputs is free and changing one knob invalidates exactly the stages it affects.
Language
The pipeline
Stage:
One analysis step: ingest, probe, audio, transcribe, diarize, shots,
describe, report. Stages run in that order; the report always closes the run.
Avoid: step, pass, phase ("phase" is taken by the build phases in PLAN.md/CONTRACTS.md).
Artifact: A stage's typed result, stored in the cache and reloaded instead of recomputed. A corrupt artifact is treated as a cache miss, never an error. Avoid: output, payload, result file.
Cache key:
The identity of a cached artifact: the stage name plus its params. Two runs share an
artifact exactly when their keys are equal; force re-runs a stage and drops the keys
of every stage downstream of it.
Source:
The thing being analysed — a local media path or an http(s) URL, identified by the
sha256 of its bytes. Two aliases of identical bytes are one source.
Avoid: input, video (audio-only files are valid sources too).
Want:
The set of stage results a caller asks for; prerequisites run as needed. want
names outcomes, not ordering — the pipeline owns the order.
Avoid: targets, requested stages.
Stage descriptor: The single record describing one stage — its prerequisites, cache-key params, artifact model and runner. The stage graph is encoded once, in the descriptor table. Avoid: stage config, stage definition.
Vision
Shot: A contiguous span of the video treated as one unit, carrying one keyframe. Shots cover the whole duration exactly once, in order. Avoid: scene (PySceneDetect calls its cuts "scenes"; here a cut is only a boundary between shots).
Keyframe: The still image standing in for a shot — in adaptive sampling, the calmest sample of the span, not its midpoint. Avoid: thumbnail, frame.
Activity curve: Frame-difference samples over time, used to subdivide long shots at equal cumulative-activity boundaries, so dense stretches get short shots and quiet ones long. Avoid: energy curve.
Diarization: Segmenting the audio by who is speaking, producing speaker turns. Speaker labels come from clustering; one dynamic person may legitimately hold several labels. Avoid: speaker separation, voiceprint.
Speaker turn: A contiguous span attributed to one speaker label ("S1", "S2", ...). Avoid: utterance, segment ("segment" is a transcript segment).
Surfaces and values
Front door:
A user-facing adapter over the analysis module: the va CLI and the MCP server. Front
doors map arguments to options and shape output; they own no analysis policy.
Avoid: interface, entry point, client.
Analysis module: The deep interface both front doors adapt to: operations named for outcomes — analyse, transcript, shots, ask, moment — over the pipeline and the cache. One operation, two front doors. Avoid: service, orchestrator, facade.
MediaFacts: The content-only probe result: duration, streams, codecs. A MediaFacts value contains no run-time paths. Avoid: metadata, MediaInfo (the pre-split name).
MediaRef: The run-time location of a source — its original string and local path — attached when cached facts are read, never cached itself.