ADR 0005: Freeze the mechanical ingest steps as `tools/ingest.py` (a toolbox, not a pipeline)

decision

ADR 0005: Freeze the mechanical ingest steps as `tools/ingest.py` (a toolbox, not a pipeline)

About this note
Field Value
Status accepted
Date 260725
Deciders chamin
On this pageContextDecisionAlternatives consideredConsequences

Context#

prd.md §10 deferred packaging the mechanical pipeline (yt-dlp -> ffmpeg -> imagehash) with an explicit revisit trigger: after ~5-10 real ingests, "only when the Markdown convention actually hurts". The brain is at 2 ingests, so on that trigger alone this would be premature.

Two things changed:

  1. ADR-0003 created a deterministic contract rule with no canonical implementation. The visual-leg switch turns on "<= 3 distinct frames after scene-detect + phash dedup". Distinctness depends entirely on two constants - the ffmpeg scene threshold and the pHash Hamming distance - and both lived only in prose. Two agents would compute different verdicts for the same podcast, and a verdict computed with different constants is not comparable to any previous source's. A threshold nobody can reproduce is not a rule.
  2. The same code kept being written and thrown away. During the 12-factor ingest, vtt_clean.py and dedup.py were both written into a scratch directory and evaporated with the session - violating the kit's own rule that ephemeral output not captured into a kit file did not happen.

The underlying principle, which is what makes this narrow rather than a general push toward scripts: generate what should vary, freeze what should not. On-the-fly code is right when variation is a feature - mid-ingest the phash dedup was abandoned for transcript-anchored extraction, and a rigid script would have fought that. It is wrong when variation is a bug: VTT parsing has no reason to differ between videos, and regenerating it re-rolls the dice on a parser whose output still looks plausible when subtly wrong.

Decision#

Freeze the deterministic steps as tools/ingest.py, exposing four independent subcommands: transcript (stdlib only), probe (the ADR-0003 verdict), frames, sheet. AGENTS.md instructs agents to use it, and specifically to run probe rather than a hand-rolled equivalent.

Three constraints:

Alternatives considered#

Consequences#