2026-10-29 · Architecture checkpoint after error rates

2026-10-29 · Architecture checkpoint after error rates

Context

JobDetail.svelte passed 500 lines with the error rates, and the 25 October checkpoint had asked for the review’s shared frame to be extracted “before the next feature that touches the review”, which three features since have touched. The whole architecture was reviewed against AGENTS.md, the specification and the roadmap: the crates and their dependencies, duplication in the providers, exporters and media steps, the oversized files, and whether resuming, caching, progress and provenance still cover every path. Three read-only reviews were run in parallel (front end, Rust structure, coverage of the job paths); their main findings were checked against the code before being recorded here.

What holds

Fixed with this checkpoint

To fix next, in this order

  1. Results that can be wrong without anyone knowing (integrity):
    • An answer cut off at the model’s output limit is stored as complete, though Gemini’s code says the engine marks it: mark it, warn, and list it in provenance.
    • A source changed on disk after it was added is read without being hashed again, so new content is cached under the old fingerprint: check size and date, hash again if they changed, and refuse the source.
    • put_result replaces an answer stored under the same key (two identical set-ups, or a batch collected after a fast run): keep the first, so corrections stay over the text they corrected.
  2. Work lost or paid twice (cost):
    • Quitting waits five seconds, then drops cloud calls still in flight, which are sent and billed again: wait for them, saying how many, with a way to quit at once.
    • Retry delays ignore pause and cancel, and an engine error returns without awaiting the calls already started.
    • At launch a job with a waiting batch is started in full, so a paused job also sends its remaining pages: collect only.
    • The cost shown covers the current run only, and billed answers that failed their fields are not counted.
  3. Results that do not reach the researcher: a document’s files are written only when every piece succeeded, so one page that always fails (no text layer, a copyright refusal) keeps the rest from disk; and two sources with the same name in one destination overwrite each other’s files.
  4. Smaller provenance gaps: whether Whisper used voice detection; speaker names; a table of contents’ usage and cost per step; preprocessing entries written where nothing was done.

Refactor

Accepted

Consequences