Skip to content

Avoid re-running the AI pipeline on derived artifacts - #1

Merged
JosephLeon merged 1 commit into
masterfrom
pipeline-artifact-reuse
Jun 19, 2026
Merged

JosephLeon merged 1 commit into
masterfrom
pipeline-artifact-reuse

Conversation

@JosephLeon

@JosephLeon JosephLeon commented Jun 19, 2026 •

Copy link
Copy Markdown
Owner

Five complementary changes so users stop accidentally re-paying for transcription + classification on content the pipeline already saw.

Pattern 1+6 (render-lineage detection on add):

  • New renderLineage.ts walks the active project's render_history when a user drags in a file. If the path matches an entry's output, the AddPanel routes through a new "That's one of your renders" modal instead of the normal copy/reference flow.
  • "Continue editing intro.mov" jumps the AI tab to the original source via setActive(), so the next render reuses cached artifacts.
  • "Add anyway" stays as an escape hatch.

Pattern 2 (UI copy):

  • Pacing tab + Audio tab render buttons now spell out "No AI cost on re-render": cuts and overrides reuse the cached classification; audio enhancement / denoise / ducking never touch the LLM.

Pattern 4 (content-hash cache for /analyze):

  • New _analysis_cache.py keys cached AnalysisBundle JSONs by SHA256 of the extracted mic WAV. /analyze hashes after ingest (~1s), looks up, and skips the Groq call on hit. Cache miss falls through to the normal Whisper pass and stores the result.
  • Catches re-imports, copies across projects, symlinks of the same audio. Doesn't catch trims / different mic tracks (correctly).
  • Saves ~$0.05 per duplicate analyze.

Pattern 5 (no code changes):

  • Verified runAllStages is idempotent on completed stages and that override / custom-cut mutations route only through the store + /render's re-plan path, never re-triggering /classify.

Pattern 3 (deferred):

  • Splice-aware Cadence (talking to the model about a spliced output without re-running transcription on each clip) is real architecture work: artifact builder with offset math, dispatcher routing, custom cuts at splice-time. Full design captured in docs/design-splice-classification-reuse.md for a future PR.

Drive-bys: re-applied two tsc -b strict-mode fixes (SplicingView discriminated-union narrowing + projectDigest export-type) that lived on the deleted public-release branch and didn't make it to master.

What this changes

Why

How I tested

Anything reviewers should pay attention to

Checklist

  • Added/updated tests for new pure-logic helpers (tests/)
  • uv run pytest passes locally
  • bun run tsc --noEmit passes locally (if frontend touched)
  • Type hints on new Python; strict TypeScript on new TS
  • No new dependencies, or the new dep is justified above
  • No secrets / personal paths in the diff

Five complementary changes so users stop accidentally re-paying for
transcription + classification on content the pipeline already saw.

Pattern 1+6 (render-lineage detection on add):
- New renderLineage.ts walks the active project's render_history when
  a user drags in a file. If the path matches an entry's output, the
  AddPanel routes through a new "That's one of your renders" modal
  instead of the normal copy/reference flow.
- "Continue editing intro.mov" jumps the AI tab to the original source
  via setActive(), so the next render reuses cached artifacts.
- "Add anyway" stays as an escape hatch.

Pattern 2 (UI copy):
- Pacing tab + Audio tab render buttons now spell out "No AI cost on
  re-render": cuts and overrides reuse the cached classification;
  audio enhancement / denoise / ducking never touch the LLM.

Pattern 4 (content-hash cache for /analyze):
- New _analysis_cache.py keys cached AnalysisBundle JSONs by SHA256 of
  the extracted mic WAV. /analyze hashes after ingest (~1s), looks up,
  and skips the Groq call on hit. Cache miss falls through to the
  normal Whisper pass and stores the result.
- Catches re-imports, copies across projects, symlinks of the same
  audio. Doesn't catch trims / different mic tracks (correctly).
- Saves ~$0.05 per duplicate analyze.

Pattern 5 (no code changes):
- Verified runAllStages is idempotent on completed stages and that
  override / custom-cut mutations route only through the store +
  /render's re-plan path, never re-triggering /classify.

Pattern 3 (deferred):
- Splice-aware Cadence (talking to the model about a spliced output
  without re-running transcription on each clip) is real architecture
  work: artifact builder with offset math, dispatcher routing, custom
  cuts at splice-time. Full design captured in
  docs/design-splice-classification-reuse.md for a future PR.

Drive-bys: re-applied two tsc -b strict-mode fixes (SplicingView
discriminated-union narrowing + projectDigest export-type) that lived
on the deleted public-release branch and didn't make it to master.
@JosephLeon
JosephLeon merged commit e4302c5 into master Jun 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant