Visualize audio waveforms on the video editor timeline. When a track contains audio (either an audio track or a video track with audio), render a waveform visualization on top of the clip in the timeline UI. This should show the audio amplitude over time so users can see where audio peaks/silences are when editing. Should work for both dedicated audio tracks and video clips that have embedded audio. The waveform data infrastructure already exists via AudioDataProvider and @remotion/media-utils (getAudioData) in the art-agents audio-reactive plan — but the reigh-app video editor is the current active codebase. Key files: reigh-app/src/tools/video-editor/components/TimelineEditor/ (timeline UI), reigh-app/src/tools/video-editor/compositions/AudioTrack.tsx, reigh-app/src/tools/video-editor/types/, reigh-app/src/tools/video-editor/hooks/. The timeline uses a canvas-based renderer (TimelineCanvas.tsx) for clip rendering.
code
Plan:
# Implementation Plan: Audio Waveform Visualization on Timeline Clips
Overview
Add waveform visualizations to audio clips (and video clips with audio) on the video editor timeline. When a clip has audio, render a small amplitude-over-time waveform inside the clip's visual rectangle in the timeline UI.
Current state: Clips render as styled buttons (ClipAction.tsx) with an icon, label, and optional thumbnail. Audio clips show a music note icon but no waveform. The existing AudioAnalysisProvider does per-frame FFT analysis for audio-reactive effects, but it operates at the Remotion composition level (not the timeline UI) and produces per-frame data, not a compact waveform summary.
Approach: Create a standalone hook that fetches audio files and extracts amplitude samples using the Web Audio API (decodeAudioData), then render those samples as an SVG/canvas waveform overlay inside ClipAction. This avoids coupling to the AudioAnalysisProvider (which is composition-scoped) and avoids adding @remotion/media-utils as a new dependency.
Key constraint: The timeline is div-based (not HTML5 Canvas). Each clip is a <button> rendered by ClipAction. The waveform will be rendered as an absolutely-positioned SVG or mini-canvas inside the clip button.
{"checks":[],"flags":[{"id":"FLAG-001","concern":"timeline-waveform-eligibility: the plan's default 'show waveform on muted clips' / visual-video behavior conflicts with the existing detach-audio workflow. In this repo, detaching audio mutes the original visual clip and creates a new audio-track clip from the same asset, so rendering a waveform on the muted visual clip would duplicate audio structure on a clip that no longer contributes sound.","category":"correctness","severity_hint":"likely-significant","evidence":" mutes the source visual clip by setting and appends a duplicate clip on an audio track; renders visual-clip audio using , so a muted visual clip is intentionally silent."},{"id":"FLAG-002","concern":"timeline-waveform-extraction: the plan makes embedded-video waveforms a must-have but the only extraction path it specifies is on the media URL. The current repo has no existing video-audio extraction helper and the asset model does not record whether a video actually has an audio stream, so this leaves the video-clip half of the feature dependent on a fragile assumption with no repo-backed fallback.","category":"correctness","severity_hint":"uncertain","evidence":" shows asset metadata only tracks and not ; includes Remotion media/player/web-renderer but not , so the plan is not reusing an existing extraction path in this codebase."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
Scope: Medium
Create a new hook: useWaveformData(src: string | undefined, options: { from?: number; to?: number; speed?: number; numBuckets: number }) → returns { waveform: number[] | null; loading: boolean }.
Implementation:
Fetch the audio/video file URL via fetch() + decodeAudioData() (same pattern as AudioAnalysisProvider.tsx:233-243).
Downsample the decoded PCM buffer into numBuckets RMS amplitude values (each 0-1, normalized to peak).
Respect from/to trim and speed to only analyze the audible portion.
Cache decoded AudioBuffer by URL (module-level Map<string, Promise<AudioBuffer>>) to avoid redundant fetches when multiple clips share the same source.
Use useEffect with cleanup (abort controller) to cancel in-flight fetches on unmount/prop change.
numBuckets will be driven by clip pixel width (e.g., 1 bucket per 2-3px).
Edge cases:
If src is undefined or fetch fails, return null waveform gracefully (no error thrown).
Video files with embedded audio: decodeAudioData handles these natively (extracts audio track from container).
Create a lightweight component that takes waveform: number[] and renders an SVG polyline/path.
Visual design:
Absolutely positioned, fills the clip area (inset-0).
Semi-transparent fill (e.g., fill="currentColor" with opacity-20 to opacity-30), so clip label/icon remain readable.
Mirror the waveform vertically (top half + bottom half) for the classic waveform look, or use a single-sided bar/area chart for compactness given the ~32px row height.
Use pointer-events-none so it doesn't interfere with click/drag/resize handlers.
SVG approach (preferred over canvas for simplicity in a div-based layout):
Generate a single <path> element with M/L commands.
ViewBox scales to waveform length, CSS scales to clip dimensions.
Memoize the path string to avoid re-rendering on every frame.
Phase 2: Integration into Timeline UI
Step 3: Wire waveform into ClipAction (reigh-app/src/tools/video-editor/components/TimelineEditor/ClipAction.tsx)
Scope: Medium
Add props to ClipActionProps:
audioSrc?: string — resolved URL for the clip's audio source.
clipWidth?: number — pixel width of the clip on the timeline (for bucket count).
RenderWaveformOverlay inside the clip button, after the thumbnail/icon area but behind the label:
Only render when audioSrc is truthy (clip has audio).
UpdateareClipActionPropsEqual to include the new props.
Determine audio eligibility:
Audio tracks (clipMeta.track.startsWith('A') or track kind is 'audio'): always show waveform.
Visual tracks with audio: show waveform if the asset is a video file (has audio track). This requires knowing whether the asset is a video — check file extension or asset type from the registry.
Step 4: Pass audioSrc and clipWidth from TimelineCanvas/TimelineEditor
Scope: Small-Medium
In the getActionRender callback (defined in TimelineEditor.tsx and passed to TimelineCanvas), resolve the audio source URL:
For audio clips: use resolvedConfig to get clip.assetEntry?.src.
For video clips: same — decodeAudioData will extract the audio track.
For text/effect-layer clips: don't pass audioSrc.
ComputeclipWidth from (action.end - action.start) * pixelsPerSecond — this is already calculated in TimelineCanvas.tsx:198-199. Pass it through to the render callback.
ThreadpixelsPerSecond to the render callback if not already available (check current getActionRender signature).
Step 5: Verify and test
Scope: Small
Manual verification:
Add an audio clip to the timeline → waveform appears.
Add a video clip with audio → waveform appears.
Add a text/effect clip → no waveform.
Resize/zoom the timeline → waveform re-renders with appropriate bucket count.
Trim a clip (adjust from/to) → waveform shows only the trimmed portion.
Muted clip → waveform still visible (it shows shape, not playback state).
Run existing tests to ensure no regressions:
npx vitest run --reporter verbose (or project-specific test command) on video-editor tests.
Performance check: Open a timeline with 10+ audio clips. Verify no jank — waveform extraction should happen once per unique URL and be cached.
Execution Order
Step 1 (hook) → Step 2 (overlay component) → Step 3 (wire into ClipAction) → Step 4 (pass data from parent) → Step 5 (verify).
Steps 1 and 2 can be developed in parallel since they have no dependencies on each other.
Validation Order
After Step 2: render WaveformOverlay in isolation with mock data to verify SVG output.
After Step 4: full integration test with real audio clips on the timeline.
Step 5: run existing test suite + manual smoke test.
Key Design Decisions
SVG over canvas: The timeline is div-based. An inline SVG inside the clip button is simpler than managing a separate canvas element per clip, and it inherits CSS colors/opacity naturally.
Separate hook vs. reusing AudioAnalysisProvider: AudioAnalysisProvider is tightly coupled to Remotion composition rendering (per-frame, requires fps/totalDuration, mixed across all clips). The timeline UI needs per-clip waveform data independent of playback. A standalone hook is cleaner.
No new dependency:decodeAudioData from the Web Audio API is sufficient. @remotion/media-utils's getAudioData ultimately does the same thing. No need to add a dependency.
Single-sided vs. mirrored waveform: Given the ~32px row height, a single-sided area chart (bars from bottom) may be more readable than a mirrored waveform. The component should support both — start with mirrored (classic look) and adjust based on visual testing.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-04-06T04:15:25Z",
"hash": "sha256:1b4048728546973b419977a968786348998907c317bb3ee6fbae8adc272607db",
"questions": [
"Should the waveform be visible on muted clips? (Assumption: yes, since the waveform shows audio shape/content, not playback state \u2014 users want to see where audio peaks are even when muted.)",
"Should video clips on visual tracks automatically show waveforms, or only after the user explicitly detaches audio? Showing waveforms on all video clips means fetching/decoding every video file for its audio track, which could be heavy for many clips.",
"Is there a preferred color/style for the waveform? (e.g., should it match the clip's selection color, use a fixed color like the existing sky-blue accent, or vary by track kind?)",
"What is the typical row height in practice? If it's very small (< 24px), a mirrored waveform may be unreadable and a simple amplitude bar chart would be better."
],
"success_criteria": [
{
"criterion": "Audio clips on audio tracks display a waveform visualization inside the clip rectangle on the timeline",
"priority": "must"
},
{
"criterion": "Video clips with embedded audio display a waveform when on audio tracks (after detach) or on visual tracks",
"priority": "must"
},
{
"criterion": "Waveform accurately reflects the trimmed portion of the clip (respects from/to/speed)",
"priority": "must"
},
{
"criterion": "Waveform does not interfere with existing clip interactions (click, drag, resize, context menu)",
"priority": "must"
},
{
"criterion": "Waveform data is cached per audio URL to avoid redundant fetches/decoding",
"priority": "must"
},
{
"criterion": "Existing video editor tests continue to pass",
"priority": "must"
},
{
"criterion": "Text clips and effect layers do not show waveforms",
"priority": "must"
},
{
"criterion": "Waveform updates bucket count when the timeline is zoomed (scale changes)",
"priority": "should"
},
{
"criterion": "No visible jank when loading a timeline with 10+ audio clips",
"priority": "should"
},
{
"criterion": "Waveform component is under ~100 lines",
"priority": "should"
},
{
"criterion": "useWaveformData hook is under ~80 lines",
"priority": "should"
},
{
"criterion": "Waveform is visually readable at the default row height without obscuring clip labels",
"priority": "should"
},
{
"criterion": "Manual smoke test: add audio clip, add video clip, zoom in/out, trim clip, mute clip \u2014 all render correctly",
"priority": "info"
}
],
"assumptions": [
"Row height is approximately 32-40px based on the ACTION_VERTICAL_MARGIN usage and typical timeline UIs \u2014 waveform design will be optimized for this range.",
"decodeAudioData works on video files (MP4, WebM) in modern browsers to extract the audio track \u2014 this is standard Web Audio API behavior.",
"The getActionRender callback in TimelineEditor.tsx can be extended to pass additional props (audioSrc, clipWidth) without major refactoring.",
"Waveform should be visible on muted clips (shows content structure, not playback state).",
"Video clips on visual tracks SHOULD show waveforms by default (not just after audio detach) \u2014 but this is a question above. If too heavy, can be gated behind a user toggle or limited to audio tracks only.",
"No new npm dependencies are needed \u2014 Web Audio API's decodeAudioData is sufficient for waveform extraction.",
"SVG rendering is performant enough for this use case (one path element per clip, no animation)."
],
"structure_warnings": []
}
code
Plan structure warnings from validator:
[]
Existing flags:
[]
Known accepted debt grouped by subsystem:
{
"agent-chat-rendering": [
{
"id": "DEBT-007",
"concern": "removing the duplicate assistant turn may hide message_user text if the frontend only renders assistant-role turns as chat bubbles.",
"occurrence_count": 1,
"plan_ids": [
"refactor-ai-timeline-agent-20260326-0157"
]
}
],
"agent-chat-undo-integration": [
{
"id": "DEBT-018",
"concern": "agent chat edits arrive via query invalidation/realtime polling and will bypass the undo stack because those paths are marked skiphistory.",
"occurrence_count": 1,
"plan_ids": [
"implement-undo-redo-history-20260326-2240"
]
}
],
"agent-tool-utils": [
{
"id": "DEBT-040",
"concern": "agent-tool-utils: step 6 moves isrecord out of llm/messages.ts without preserving that module's current export surface for index.ts, db.ts, tool-calls.ts, and selectedclips.ts, so the refactor plan can break four existing imports unless it adds a re-export or rewires those callers.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
}
],
"are-the-proposed-changes-technically-correct": [
{
"id": "DEBT-041",
"concern": "are the proposed changes technically correct?: checked the actual export surface in supabase/functions/ai-timeline-agent/llm/messages.ts and its consumers. step 6 says to 'remove local isrecord' from messages.ts and import it from utils.ts, but without also preserving messages.ts as an exporter or rewiring index.ts, db.ts, tool-calls.ts, and selectedclips.ts, that change would break the module graph immediately.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-055",
"concern": "are the proposed changes technically correct?: checked the render-gating cleanup plan against remotion's runtime exports in node_modules/remotion/dist/cjs/cancel-render.js:46-70. cancelrender() stores an error and throws to abort the render; it is not a benign cleanup for an abandoned delayrender handle, so step 2's instruction to call cancelrender(handle) on unmount is technically wrong and would abort preview or export with an error.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
},
{
"id": "DEBT-056",
"concern": "are the proposed changes technically correct?: checked how remotion itself acquires delay handles in node_modules/remotion/dist/cjs/iframe.js:8-18. remotion's own components create the handle synchronously with usestate(() => delayrender(...)); the plan says 'calls delayrender() on mount', which reads like an effect-time action and leaves the initial-frame blocking behavior underspecified compared with the actual library pattern.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
},
{
"id": "DEBT-057",
"concern": "are the proposed changes technically correct?: checked the new sketch against . the plan defines it in terms of but does not explicitly import into the new hook file or simplify it to straight arithmetic, so the helper's implementation contract is still looser than it needs to be.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
],
"are-the-success-criteria-well-prioritized-and-verifiable": [
{
"id": "DEBT-035",
"concern": "are the success criteria well-prioritized and verifiable?: checked the two user-visible goals for the selection ring and locked-pane chat. they describe the right product outcomes, but they are mostly manual ui behaviors rather than code-review-verifiable gates, so they are not fully testable from the listed automated checks alone.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-039",
"concern": "are the success criteria well-prioritized and verifiable?: checked the revised criterion about eliminating duplicated server-side helpers. as written, the plan could satisfy 'all import from utils.ts' for , , and and still break four existing consumers, so the criterion is incomplete unless it also requires preserving or updating the export surface.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-060",
"concern": "are the success criteria well-prioritized and verifiable?: checked the criterion 'edge function tests (ai-generate-effect/index.test.ts) pass with updated templates' against the actual test file. since mocks , this criterion can pass without validating the template edits themselves, so it is still a weak gate as written.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
],
"bulk-panel-tabs": [
{
"id": "DEBT-010",
"concern": "text clip multi-selections would miss the position tab under the plan's stated rule.",
"occurrence_count": 1,
"plan_ids": [
"multi-select-feature-parity-20260326-0548"
]
}
],
"bulk-properties-panel": [
{
"id": "DEBT-016",
"concern": "bulkclippanel still imports customeffecteditor; removing it without updating bulk mode would break the build.",
"occurrence_count": 1,
"plan_ids": [
"build-an-llm-powered-custom-20260326-2230"
]
}
],
"clip-drag-scroll-sync": [
{
"id": "DEBT-015",
"concern": "the plan's step 3 ontick callback only shows coordinator.update() but the full clip-drag state path (snap, lateststart, ghost positions) also needs re-running during stationary-pointer scroll.",
"occurrence_count": 1,
"plan_ids": [
"add-auto-scroll-to-the-20260326-2119"
]
}
],
"clip-param-schema-evolution": [
{
"id": "DEBT-019",
"concern": "clips with stale or partial params from a previous schema version will not be automatically normalized/backfilled when the effect schema changes.",
"occurrence_count": 1,
"plan_ids": [
"add-tuneable-parameters-to-20260326-2332"
]
}
],
"conflict-resolution": [
{
"id": "DEBT-004",
"concern": "silently reloading agent-originated timeline updates would discard dirty local edits.",
"occurrence_count": 1,
"plan_ids": [
"build-a-turn-based-timeline-20260326-0005"
]
},
{
"id": "DEBT-021",
"concern": "if all 3 conflict retries fail, the fallback path risks discarding dirty local edits unless the executor wires it into the existing conflict dialog.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-fix-the-20260327-0056"
]
}
],
"context-menu-scope": [
{
"id": "DEBT-012",
"concern": "multi-clip copy is not included despite being mentioned in the original idea.",
"occurrence_count": 1,
"plan_ids": [
"multi-select-feature-parity-20260326-0548"
]
}
],
"did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements": [
{
"id": "DEBT-036",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised step 6 against , , , , and . the plan still does not account for being part of 's exported api today, so the utility extraction is incomplete unless it either re-exports from or updates all four downstream imports.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-062",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised audio-binding ui step against the research note and . the plan still says 'a dual-value slider or two number inputs' instead of committing to the supported path, even though the shared slider wrapper is scalar-only, so that important review note is only partially addressed.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
],
"does-the-change-touch-all-locations-and-supporting-infrastructure": [
{
"id": "DEBT-033",
"concern": "does the change touch all locations and supporting infrastructure?: searched all imports from under and found four dependent files: , , , and . step 6 still lists only , , and as update targets, so it does not currently touch all locations that depend on the symbol being moved.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-034",
"concern": "does the change touch all locations and supporting infrastructure?: checked through . the supporting test infrastructure exists and would catch one of these export-chain breaks, but only after later refactors because the plan schedules the edge vitest run in step 9 rather than immediately after the step 6 export move.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-058",
"concern": "does the change touch all locations and supporting infrastructure?: checked the supporting ui infrastructure for audio-binding controls. because only supports one thumb and already exists as the established numeric input control, the plan should call out either usage or a new range-slider component explicitly; right now the supporting ui work is still incomplete in the plan.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
},
{
"id": "DEBT-059",
"concern": "does the change touch all locations and supporting infrastructure?: checked the planned test location for prompt-template changes against . since that suite mocks , touching only still misses the supporting test infrastructure needed to validate itself.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
],
"drop-indicator-plumbing": [
{
"id": "DEBT-023",
"concern": "dropindicator reads position.trackid without it being declared on the dropindicatorposition interface or forwarded by toindicatorposition().",
"occurrence_count": 1,
"plan_ids": [
"two-ux-improvements-1-drop-to-20260327-0520"
]
}
],
"edit-mode-persistence": [
{
"id": "DEBT-026",
"concern": "legacy persisted 'enhance' values might exist in storage",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-027",
"concern": "no-migration assumption for enhance\u2192upscale is under-supported",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-030",
"concern": "enhance/upscale only partially resolved \u2014 persisted values not validated",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-032",
"concern": "no read-side normalization test for legacy 'enhance' values",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
}
],
"edit-mode-validation": [
{
"id": "DEBT-028",
"concern": "validation grep for 'enhance' will false-fail due to video code",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-029",
"concern": "grep scope too broad \u2014 hits video submode code",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-031",
"concern": "validation scope reaches unrelated video code",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
}
],
"effect-layer-overlap-enforcement": [
{
"id": "DEBT-022",
"concern": "the plan relies on same-track overlap being forbidden but does not explicitly specify the enforcement call (resolveoverlaps or range rejection) in the drop/create path.",
"occurrence_count": 1,
"plan_ids": [
"add-adjustment-layer-effect-20260327-0358"
]
}
],
"find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them": [
{
"id": "DEBT-038",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: checked the current callers of from . uses it to validate , uses it on db rows, uses it on parsed tool-call payloads and nested objects, and uses it while normalizing attachments, so preserving that import contract matters to four different call paths.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
}
],
"issue-detection": [
{
"id": "DEBT-006",
"concern": "mid-sentence-cut detection is not implementable without transcript/profile data that the current provider doesn't expose.",
"occurrence_count": 1,
"plan_ids": [
"build-a-turn-based-timeline-20260326-0005"
]
}
],
"legacy-effect-lifecycle": [
{
"id": "DEBT-017",
"concern": "removing customeffecteditor makes effects-table entries read-only \u2014 users can no longer edit legacy custom effects.",
"occurrence_count": 1,
"plan_ids": [
"build-an-llm-powered-custom-20260326-2230"
]
}
],
"multi-drag-utils": [
{
"id": "DEBT-043",
"concern": "duplicate of correctness-2 \u2014 multi-drag meta patch accumulation not spelled out",
"occurrence_count": 1,
"plan_ids": [
"restructure-the-video-editor-20260406-0206"
]
},
{
"id": "DEBT-044",
"concern": "same merge strategy concern as correctness-2/5 from the caller perspective",
"occurrence_count": 1,
"plan_ids": [
"restructure-the-video-editor-20260406-0206"
]
}
],
"optimistic-locking": [
{
"id": "DEBT-002",
"concern": "plan only specifies version checking at the db write layer; the ui load/state/save path doesn't carry config_version yet.",
"occurrence_count": 1,
"plan_ids": [
"build-a-turn-based-timeline-20260326-0005"
]
}
],
"properties-panel-scope": [
{
"id": "DEBT-011",
"concern": "crop and transition controls are not included in the bulk panel, narrowing the original idea's scope.",
"occurrence_count": 1,
"plan_ids": [
"multi-select-feature-parity-20260326-0548"
]
}
],
"realtime-subscriptions": [
{
"id": "DEBT-003",
"concern": "the shared realtime system doesn't know about timeline_agent_sessions; step 7 hooks need their own channel subscription.",
"occurrence_count": 1,
"plan_ids": [
"build-a-turn-based-timeline-20260326-0005"
]
}
],
"registry-patch-testing": [
{
"id": "DEBT-020",
"concern": "patchregistry() lacks automated regression tests \u2014 the duplicate-id bug's most likely reproduction path is covered only by pure-function tests on the assembler it delegates to, plus manual smoke testing.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-consolidate-20260327-0022"
]
}
],
"resolve-overlaps": [
{
"id": "DEBT-045",
"concern": "resolve-overlaps.ts entirely lacks tests; plan only adds resolvegroupoverlaps tests",
"occurrence_count": 1,
"plan_ids": [
"restructure-the-video-editor-20260406-0206"
]
},
{
"id": "DEBT-046",
"concern": "phase 4 blast radius covers both resolveoverlaps and resolvegroupoverlaps return shapes",
"occurrence_count": 1,
"plan_ids": [
"restructure-the-video-editor-20260406-0206"
]
}
],
"search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader": [
{
"id": "DEBT-037",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: checked the affected edge-agent surface around . the extraction is broader than the three files listed in step 6 because is a shared utility module for , , , and ; the plan still scopes the edit as if only the local definition sites matter.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-063",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: checked the verification scope around the edge function. mocks , so adding only more cases still will not exercise the real prompt content; the revised plan improves scope on the implementation side, but its test scope is still narrower than the actual risk surface.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
],
"selection-save-bridge": [
{
"id": "DEBT-009",
"concern": "the plan specifies passing pruneselection into usetimelinesave but doesn't detail the hook-layer bridge needed because usetimelinesave is instantiated inside usetimelinedata before usetimelinestate runs.",
"occurrence_count": 1,
"plan_ids": [
"multi-select-timeline-clips-20260326-0415"
]
}
],
"task-deduplication": [
{
"id": "DEBT-001",
"concern": "server-generated idempotency keys would break retry deduplication because retried requests get fresh keys.",
"occurrence_count": 1,
"plan_ids": [
"migrate-all-task-creation-20260325-2354"
]
}
],
"task-system-integration": [
{
"id": "DEBT-005",
"concern": "create_generation_task is underspecified against the actual task family system.",
"occurrence_count": 1,
"plan_ids": [
"build-a-turn-based-timeline-20260326-0005"
]
}
],
"tool-error-propagation": [
{
"id": "DEBT-008",
"concern": "a blanket catch in executetool would silently downgrade db/persistence failures into ordinary tool results, changing the session error/http 500 behavior.",
"occurrence_count": 1,
"plan_ids": [
"refactor-ai-timeline-agent-20260326-0157"
]
}
],
"track-reorder-accessibility": [
{
"id": "DEBT-013",
"concern": "replacing arrow buttons with drag-only handle removes keyboard-accessible reorder; plan only specifies pointersensor.",
"occurrence_count": 1,
"plan_ids": [
"fix-track-reordering-bugs-and-20260326-1856"
]
}
],
"track-reorder-testing": [
{
"id": "DEBT-014",
"concern": "no automated tests specified for same-kind boundary rules or save/load persistence of reordered tracks.",
"occurrence_count": 1,
"plan_ids": [
"fix-track-reordering-bugs-and-20260326-1856"
]
}
],
"usederivedtimeline": [
{
"id": "DEBT-042",
"concern": "duplicate of correctness-1 \u2014 usememo dep array lint violation in sample code",
"occurrence_count": 1,
"plan_ids": [
"restructure-the-video-editor-20260406-0206"
]
}
],
"video-editor-effect-preview": [
{
"id": "DEBT-049",
"concern": "preview fps source not exposed via existing context",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-050",
"concern": "same fps gap as flag-004",
"occurrence_count": 3,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
}
],
"video-editor-effect-registry": [
{
"id": "DEBT-047",
"concern": "replaceeffectregistry() in render mutates module state during react render",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-048",
"concern": "same render-purity concern as correctness-1",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-051",
"concern": "o(n) re-renders during effect initialization",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-052",
"concern": "same batching gap as performance-1",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-053",
"concern": "success criterion hardcodes render-time assignment as implementation detail",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
}
],
"video-editor-parameter-controls": [
{
"id": "DEBT-061",
"concern": "video-editor-parameter-controls: the revised plan still suggests a dual-value slider for audio-binding min/max even though the shared slider wrapper is scalar-only; it should commit to two controls or a new range-slider implementation.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
],
"video-editor-render-pipeline": [
{
"id": "DEBT-054",
"concern": "video-editor-render-pipeline: recurring debt: the revised render-gating plan still uses as unmount cleanup and leaves acquisition described as a mount-time action, which can abort renders or miss initial-frame blocking.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
],
"vlm-cold-gpu-diagnostics": [
{
"id": "DEBT-025",
"concern": "the cold-gpu vlm import crash investigation is deferred \u2014 the plan ships the zombie fix without root-causing the specific import failure.",
"occurrence_count": 1,
"plan_ids": [
"fix-worker-zombie-bug-when-20260330-2035"
]
}
],
"workspace-git-hygiene": [
{
"id": "DEBT-024",
"concern": "step 2 discards unstaged edits in 6 files via git checkout head without first confirming the revert was unintentional.",
"occurrence_count": 1,
"plan_ids": [
"two-ux-improvements-1-drop-to-20260327-0520"
]
}
]
}
code
Escalated debt subsystems:
[
{
"subsystem": "does-the-change-touch-all-locations-and-supporting-infrastructure",
"total_occurrences": 6,
"plan_count": 2,
"entries": [
{
"id": "DEBT-033",
"concern": "does the change touch all locations and supporting infrastructure?: searched all isrecord imports from ./llm/messages.ts under supabase/functions/ai-timeline-agent/ and found four dependent files: index.ts, db.ts, tool-calls.ts, and selectedclips.ts. step 6 still lists only generation.ts, create-task.ts, and messages.ts as update targets, so it does not currently touch all locations that depend on the symbol being moved.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-034",
"concern": "does the change touch all locations and supporting infrastructure?: checked supabase/functions/ai-timeline-agent/selectedclips.test.ts:1 through supabase/functions/ai-timeline-agent/selectedclips.ts:1. the supporting test infrastructure exists and would catch one of these export-chain breaks, but only after later refactors because the plan schedules the edge vitest run in step 9 rather than immediately after the step 6 export move.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-058",
"concern": "does the change touch all locations and supporting infrastructure?: checked the supporting ui infrastructure for audio-binding controls. because src/shared/components/ui/slider.tsx:5-17,31-52 only supports one thumb and src/shared/components/ui/number-input.tsx:6-33 already exists as the established numeric input control, the plan should call out either numberinput usage or a new range-slider component explicitly; right now the supporting ui work is still incomplete in the plan.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
},
{
"id": "DEBT-059",
"concern": "does the change touch all locations and supporting infrastructure?: checked the planned test location for prompt-template changes against supabase/functions/ai-generate-effect/index.test.ts. since that suite mocks buildgenerateeffectmessages(), touching only index.test.ts still misses the supporting test infrastructure needed to validate templates.ts itself.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
]
},
{
"subsystem": "are-the-proposed-changes-technically-correct",
"total_occurrences": 5,
"plan_count": 2,
"entries": [
{
"id": "DEBT-041",
"concern": "are the proposed changes technically correct?: checked the actual export surface in supabase/functions/ai-timeline-agent/llm/messages.ts and its consumers. step 6 says to 'remove local ' from and import it from , but without also preserving as an exporter or rewiring , , , and , that change would break the module graph immediately.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-055",
"concern": "are the proposed changes technically correct?: checked the render-gating cleanup plan against remotion's runtime exports in . stores an error and throws to abort the render; it is not a benign cleanup for an abandoned handle, so step 2's instruction to call on unmount is technically wrong and would abort preview or export with an error.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
},
{
"id": "DEBT-056",
"concern": "are the proposed changes technically correct?: checked how remotion itself acquires delay handles in . remotion's own components create the handle synchronously with ; the plan says 'calls delayrender() on mount', which reads like an effect-time action and leaves the initial-frame blocking behavior underspecified compared with the actual library pattern.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
},
{
"id": "DEBT-057",
"concern": "are the proposed changes technically correct?: checked the new sketch against . the plan defines it in terms of but does not explicitly import into the new hook file or simplify it to straight arithmetic, so the helper's implementation contract is still looser than it needs to be.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
]
},
{
"subsystem": "are-the-success-criteria-well-prioritized-and-verifiable",
"total_occurrences": 5,
"plan_count": 2,
"entries": [
{
"id": "DEBT-035",
"concern": "are the success criteria well-prioritized and verifiable?: checked the two user-visible goals for the selection ring and locked-pane chat. they describe the right product outcomes, but they are mostly manual ui behaviors rather than code-review-verifiable gates, so they are not fully testable from the listed automated checks alone.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-039",
"concern": "are the success criteria well-prioritized and verifiable?: checked the revised criterion about eliminating duplicated server-side helpers. as written, the plan could satisfy 'all import from utils.ts' for , , and and still break four existing consumers, so the criterion is incomplete unless it also requires preserving or updating the export surface.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-060",
"concern": "are the success criteria well-prioritized and verifiable?: checked the criterion 'edge function tests (ai-generate-effect/index.test.ts) pass with updated templates' against the actual test file. since mocks , this criterion can pass without validating the template edits themselves, so it is still a weak gate as written.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
]
},
{
"subsystem": "video-editor-effect-registry",
"total_occurrences": 5,
"plan_count": 1,
"entries": [
{
"id": "DEBT-047",
"concern": "replaceeffectregistry() in render mutates module state during react render",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-048",
"concern": "same render-purity concern as correctness-1",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-051",
"concern": "o(n) re-renders during effect initialization",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-052",
"concern": "same batching gap as performance-1",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-053",
"concern": "success criterion hardcodes render-time assignment as implementation detail",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
}
]
},
{
"subsystem": "edit-mode-persistence",
"total_occurrences": 4,
"plan_count": 1,
"entries": [
{
"id": "DEBT-026",
"concern": "legacy persisted 'enhance' values might exist in storage",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-027",
"concern": "no-migration assumption for enhance\u2192upscale is under-supported",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-030",
"concern": "enhance/upscale only partially resolved \u2014 persisted values not validated",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-032",
"concern": "no read-side normalization test for legacy 'enhance' values",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
}
]
},
{
"subsystem": "video-editor-effect-preview",
"total_occurrences": 4,
"plan_count": 1,
"entries": [
{
"id": "DEBT-049",
"concern": "preview fps source not exposed via existing context",
"occurrence_count": 1,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
},
{
"id": "DEBT-050",
"concern": "same fps gap as flag-004",
"occurrence_count": 3,
"plan_ids": [
"fix-all-5-architectural-20260406-0219"
]
}
]
},
{
"subsystem": "did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-036",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised step 6 against , , , , and . the plan still does not account for being part of 's exported api today, so the utility extraction is incomplete unless it either re-exports from or updates all four downstream imports.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-062",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised audio-binding ui step against the research note and . the plan still says 'a dual-value slider or two number inputs' instead of committing to the supported path, even though the shared slider wrapper is scalar-only, so that important review note is only partially addressed.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
]
},
{
"subsystem": "edit-mode-validation",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-028",
"concern": "validation grep for 'enhance' will false-fail due to video code",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-029",
"concern": "grep scope too broad \u2014 hits video submode code",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
},
{
"id": "DEBT-031",
"concern": "validation scope reaches unrelated video code",
"occurrence_count": 1,
"plan_ids": [
"refactor-edit-mode-ownership-20260331-1842"
]
}
]
},
{
"subsystem": "search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-037",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: checked the affected edge-agent surface around . the extraction is broader than the three files listed in step 6 because is a shared utility module for , , , and ; the plan still scopes the edit as if only the local definition sites matter.",
"occurrence_count": 2,
"plan_ids": [
"cleanup-and-quality-pass-on-20260404-0138"
]
},
{
"id": "DEBT-063",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: checked the verification scope around the edge function. mocks , so adding only more cases still will not exercise the real prompt content; the revised plan improves scope on the implementation side, but its test scope is still narrower than the actual risk surface.",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-effects-to-20260406-0440"
]
}
]
}
]
code
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Your output template is at: /Users/user_c042661f/Documents/reigh-workspace/reigh-app/.megaplan/plans/visualize-audio-waveforms-on-20260406-0611/critique_output.json
Review the plan with a broad scope. Consider whether the approach is correct, whether it covers
all the places it needs to, whether it would break callers or violate codebase conventions,
and whether its verification strategy is adequate.
Place any concrete concerns in the flags array in the template file using the standard format
(id, concern, category, severity_hint, evidence). Leave checks as an empty array.
Workflow: read the file → investigate → read file again → add findings → write file back.
code
Additional guidelines:
- Robustness level: light. Be pragmatic. Only flag issues that would cause real failures. Ignore style, minor edge cases, and issues the executor will naturally resolve.
- Over-engineering: prefer the simplest approach that fully solves the problem.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids`: list flag IDs from prior iterations that the revised plan actually resolves (e.g., if the plan was revised to fix FLAG-001, and you confirm the fix is correct, include "FLAG-001"). Only include flags you've verified — don't guess.
- Verify that the plan follows the expected structure when validator warnings or the outline suggest drift.
- Additional flags may use these categories: correctness, security, completeness, performance, maintainability, other.
- Focus on concrete issues, not structural formatting.