You are an independent reviewer. Critique the plan against the actual repository.…
- User
You are an independent reviewer. Critique the plan against the actual repository.
codeProject directory: /Users/user_c042661f/Documents/reigh-workspace Idea:Add production diagnostics for video editor performance issues — detect and log render loops, excessive re-renders, CPU-heavy animation frames, and memory leaks. Only error-level logging (since only errors show in production). Focus on: infinite useEffect/requestAnimationFrame loops, runaway React re-renders, canvas/WebGL resource leaks, and heavy computation in the render path.
User notes and answers:
- Context: The video editor works but causes CPU heating on production. The user sees a permission denied error for voice recording but the main concern is video playback performance. We need diagnostics that only fire as console.error (since only errors show in production builds).
Key areas to instrument:
- requestAnimationFrame loops — detect if RAF callbacks fire more than expected (e.g., >1000 calls without meaningful work)
- React re-render detection — detect components re-rendering excessively (>50 renders/sec)
- useEffect infinite loops — detect effects that fire more than N times per second
- Canvas/video element resource tracking — detect if canvas contexts or video elements accumulate without cleanup
- Memory pressure — detect if heap usage grows continuously
The video editor lives in src/tools/video-editor/. Key rendering components:
- TimelineCanvas (canvas-based timeline rendering)
- PreviewPanel (video playback)
- Various effect/overlay components
Approach: Create a lightweight production diagnostics utility that components can opt into. Should be zero-cost when not triggered (only fires when thresholds are exceeded). Should use console.error with a [PERF] tag so it's visible in production.
NOT doing: profiling tools, devtools integration, or anything that adds overhead during normal operation.
-
Answers: 1) Start with just the 4 high-risk components — we can always add more later. 2) Video-editor local (src/tools/video-editor/lib/) is correct. 3) Chrome-only for memory is fine, no-op on others. 4) Don't worry about existing tests — this is additive diagnostics.
codePlan: # Implementation Plan: Production Performance Diagnostics for Video Editor
Overview
The video editor at
reigh-app/src/tools/video-editor/works but causes CPU heating in production. We need lightweight diagnostics that fireconsole.errorwith a[PERF]tag when pathological patterns are detected — infinite RAF loops, runaway re-renders, effect storms, resource leaks, and memory growth.The editor uses Remotion for video rendering, DOM-based timeline (not
<canvas>), 57 custom hooks with heavyuseEffectusage, andrequestAnimationFrameinauto-scroll.tsanduseTimelineSync.ts. There is no existing performance monitoring framework. Existing logging uses[TagName]pattern (e.g.,[DebugTrack]).Constraint: Only
console.error— production builds strip lower log levels. Zero overhead when thresholds aren't exceeded.Phase 1: Core Diagnostics Utility
Step 1: Create the diagnostics module (
reigh-app/src/tools/video-editor/lib/perf-diagnostics.ts)Scope: Medium
-
Create
perf-diagnostics.tswith these standalone detector classes/functions:a)
RafLoopDetector— Tracks RAF callback invocation counts per caller. If a single caller exceeds 1000 calls within 5 seconds without a pause, fireconsole.error('[PERF] Possible RAF loop', { caller, callCount, elapsed }). Uses a simple Map of caller ID → { count, startTime }. Resets when the caller stops for >1s.b)
RenderStormDetector— Tracks component render counts. If a component renders >50 times in 1 second, fireconsole.error('[PERF] Excessive re-renders', { component, renderCount, window: '1s' }). Uses a rolling window: each call increments a counter and checks against a timestamp. Resets each second.c)
EffectLoopDetector— Tracks useEffect fire counts per effect ID. If an effect fires >30 times in 1 second, fireconsole.error('[PERF] Possible useEffect loop', { effectId, fireCount }). Same rolling-window pattern as render detector.d)
ResourceLeakDetector— Tracks creation/disposal of video elements and canvas contexts. If net count (created - disposed) exceeds 20, fireconsole.error('[PERF] Resource leak suspected', { type, netCount }). Simple increment/decrement counter.e)
MemoryPressureDetector— Samplesperformance.memory.usedJSHeapSize(Chrome-only, guarded) every 30 seconds. If heap grows monotonically across 5 consecutive samples (2.5 minutes), fireconsole.error('[PERF] Possible memory leak', { samples, growth }). No-op ifperformance.memoryis unavailable. -
Design principle: Each detector is a plain object/class with
track()/report()methods. No React dependency in this file — it's a pure JS utility. Detectors are lazy singletons (created on first use). -
Ensure zero-cost path: each
track()call does one increment + one timestamp comparison. No allocations on the hot path. The error fires at most once per threshold window (don't spam).
Step 2: Create React integration hooks (
reigh-app/src/tools/video-editor/hooks/usePerfDiagnostics.ts)Scope: Small
-
Create
usePerfDiagnostics.tswith thin React wrappers:a)
useRenderDiagnostic(componentName: string)— CallsRenderStormDetector.track(componentName)on every render (in the function body, not in an effect). One-liner hook.b)
useEffectDiagnostic(effectId: string)— Returns amarkFiredcallback. The consuming component callsmarkFired()inside its useEffect. CallsEffectLoopDetector.track(effectId).c)
useResourceDiagnostic(type: string)— Returns{ trackCreate, trackDispose }callbacks for resource tracking. -
No hook for RAF or memory — those are wired differently (see Step 3).
Phase 2: Instrument Key Components
Step 3: Instrument RAF callers (
auto-scroll.ts,useTimelineSync.ts)Scope: Small
-
Edit
reigh-app/src/tools/video-editor/lib/auto-scroll.ts— AddRafLoopDetector.track('autoScroll')inside the RAF tick function (~1 line addition). -
Edit
reigh-app/src/tools/video-editor/hooks/useTimelineSync.ts— AddRafLoopDetector.track('timelineSync')inside the RAF callback (~1 line addition).
Step 4: Instrument high-risk rendering components
Scope: Small
Add
useRenderDiagnostic()calls to the components most likely to re-render excessively:- Edit
reigh-app/src/tools/video-editor/components/PreviewPanel/RemotionPreview.tsx— AdduseRenderDiagnostic('RemotionPreview'). - Edit
reigh-app/src/tools/video-editor/components/TimelineEditor/TimelineCanvas.tsx— AdduseRenderDiagnostic('TimelineCanvas'). - Edit
reigh-app/src/tools/video-editor/components/PreviewPanel/OverlayEditor.tsx— AdduseRenderDiagnostic('OverlayEditor'). - Edit
reigh-app/src/tools/video-editor/compositions/TimelineRenderer.tsx— AdduseRenderDiagnostic('TimelineRenderer').
Each is a single line at the top of the component function body.
Step 5: Instrument effects and resource tracking
Scope: Small
-
Edit
reigh-app/src/tools/video-editor/hooks/useTimelinePlayback.ts— Add effect loop diagnostic to the main sync effect (the one that fires on frame updates). -
Edit
reigh-app/src/tools/video-editor/compositions/VisualClip.tsx— Add resource tracking for<Video>mount/unmount usinguseResourceDiagnostic('video'). -
Edit
reigh-app/src/tools/video-editor/components/PreviewPanel/RemotionPreview.tsx— Track Player mount/unmount with resource diagnostic.
Step 6: Wire memory pressure monitoring (
VideoEditorShell.tsxor top-level provider)Scope: Small
- Edit
reigh-app/src/tools/video-editor/components/VideoEditorShell.tsx(or equivalent top-level component) — StartMemoryPressureDetectorin a useEffect on mount, stop on unmount. This is the only place memory monitoring runs.
Phase 3: Validation
Step 7: Verify no build breakage and no runtime cost
Scope: Small
- Run the project's TypeScript type check to ensure no type errors.
- Run any existing tests for the video editor (
jest,vitest, or whatever the project uses). - Verify the diagnostics module has no side effects on import (lazy initialization only).
- Verify that
performance.memoryaccess is guarded for non-Chrome browsers.
Execution Order
- Build the core diagnostics utility first (Step 1) — everything depends on it.
- Create React hooks (Step 2) — thin wrappers over Step 1.
- Instrument components (Steps 3-6) in parallel — each is independent.
- Validate (Step 7) after all instrumentation is in place.
Validation Order
-
Type check after Step 2 to catch API mismatches early.
-
Full test suite after Step 6.
-
Manual verification: in a dev build, artificially trigger a threshold (e.g., force 60 rapid re-renders) to confirm the error fires.
codePlan metadata: {
"version": 1, "timestamp": "2026-04-06T09:05:53Z", "hash": "sha256:df0110609d758f54b636e60474f518aa941b753e330b158b23e42a43e9b2ab9f", "questions": [ "The codebase has 57 hooks \u2014 should we add useRenderDiagnostic to all high-frequency components or keep it to just the 4 identified (RemotionPreview, TimelineCanvas, OverlayEditor, TimelineRenderer)? More coverage means more detection but more code changes.", "Is there a preference for where the diagnostics module lives \u2014 in the video-editor's own lib/ directory or in the shared src/shared/lib/ directory? The plan assumes video-editor-local since this is specific to the editor.", "Should the memory pressure detector run in all browsers or only Chrome (which exposes performance.memory)? The plan guards it and no-ops on non-Chrome, but if there's a polyfill preference we should know.", "Are there any existing test files for the video editor components that we should be aware of for Step 7?" ], "success_criteria": [ { "criterion": "A single perf-diagnostics.ts file exists with all 5 detectors (RAF, render, effect, resource, memory) as importable utilities", "priority": "must" }, { "criterion": "All detectors use console.error with [PERF] prefix \u2014 no console.log or console.warn", "priority": "must" }, { "criterion": "Zero allocations on the hot path \u2014 track() calls do only increment + comparison", "priority": "must" }, { "criterion": "performance.memory access is guarded so non-Chrome browsers don't throw", "priority": "must" }, { "criterion": "Each detector fires at most once per threshold window to avoid log spam", "priority": "must" }, { "criterion": "TypeScript compiles without errors after all changes", "priority": "must" }, { "criterion": "Existing tests pass without modification", "priority": "must" }, { "criterion": "No React dependency in the core perf-diagnostics.ts module \u2014 hooks are in a separate file", "priority": "must" }, { "criterion": "Instrumented components each require only 1-2 added lines", "priority": "should" }, { "criterion": "perf-diagnostics.ts is under 200 lines", "priority": "should" }, { "criterion": "usePerfDiagnostics.ts is under 50 lines", "priority": "should" }, { "criterion": "Detectors use lazy singleton pattern \u2014 no work done until first track() call", "priority": "should" }, { "criterion": "Manual test confirms console.error fires when threshold is artificially exceeded in dev", "priority": "info" } ], "assumptions": [ "The project uses TypeScript \u2014 all new files will be .ts/.tsx", "Production builds strip console.log and console.warn but preserve console.error", "The video editor's lib/ directory is the right home for editor-specific utilities", "Remotion's internal rendering (useCurrentFrame, springs, interpolation) is not the bottleneck \u2014 the issue is likely in React/DOM layer around Remotion", "The 4 identified components (RemotionPreview, TimelineCanvas, OverlayEditor, TimelineRenderer) are the highest-risk for re-render storms based on their position in the component tree and their use of frequently-changing props/state", "Thresholds (1000 RAF calls/5s, 50 renders/s, 30 effects/s, 20 net resources) are reasonable starting points \u2014 they can be tuned later", "VideoEditorShell.tsx is the right place to mount the memory pressure detector as it wraps the entire editor" ], "structure_warnings": [] }
codePlan structure warnings from validator: [] Existing flags: [] Known accepted debt grouped by subsystem: {"are-the-proposed-changes-technically-correct": [ { "id": "DEBT-007", "concern": "are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs
urlandprimaryvariantid, and the regenerate path reads exactlystarturl,endurl,startgenid,endgenid,startvariantid, andendvariantidfromsegmentslotmode.pairdatain /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. addingthumburlandgenerationidto the sync does not, by itself, explain why an old image url is still being used for regular pairs.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-008", "concern": "are the proposed changes technically correct?: the fix is incomplete for extra trailing slots.handlepairclickcan populateactivepairdatafromtrailingpairdatawhenpairindex === pairdatabyindex.sizein /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only readspairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot casesfreshisundefined, so no image refresh happens.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-018", "concern": "are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omitsidandpositionfrom change detection, and whenfresh.startimageorfresh.endimagebecomesnullit preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads ofprev.startimage/prev.endimageto be safe in strict typescript.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "are-the-success-criteria-well-prioritized-and-verifiable": [ { "id": "DEBT-019", "concern": "are the success criteria well-prioritized and verifiable?: the attached success criteria are stale and do not match the current plan body. they still require 'nousestateforactivepairdata', 'setactivepairdatafully removed', 'sync effect deleted', and 'onpairclicksimplified to(pairindex: number) => void', which are the opposite of the current targeted-sync plan. as presented, the criteria are not usable for review or execution.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "audio-loading": [ { "id": "DEBT-086", "concern": "getaudiodata in useeffect removes render-readiness signal", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-087", "concern": "same as correctness-3 \u2014 preview/render parity risk", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-088", "concern": "preview/render parity partially satisfied", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] } ], "audio-reactivity": [ { "id": "DEBT-082", "concern": "overlapping clips use first-found, volume not scaled", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-083", "concern": "same as audio-reactivity-1 \u2014 overlapping/volume-adjusted clips diverge from audible mix", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-084", "concern": "textclip missing globalframeprovider", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-085", "concern": "same as audio-reactivity-2 \u2014 textclipsequence missing provider", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-089", "concern": "textclip effects surface not covered", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-090", "concern": "continuous effects shared by visual and text clips", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] } ], "batch-generation-pipeline": [ { "id": "DEBT-006", "concern": "enhancement in usegeneratebatch before generatevideo() could compute prompts against a stale pair snapshot if mutations are still in flight.", "occurrence_count": 1, "plan_ids": [ "in-cloud-mode-when-users-20260330-2214" ] } ], "crash-recovery-cascade-paths": [ { "id": "DEBT-065", "concern": "cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-067", "concern": "duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-069", "concern": "shared orchestrator-reference helpers not referenced.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-072", "concern": "orchestrator tasks that crash don't get orchestrator-self cascade.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-074", "concern": "hardcoded params->>'orchestrator_task_id_ref' misses other reference paths.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] } ], "crash-recovery-retry": [ { "id": "DEBT-063", "concern": "crash requeue sql does not increment attempts, risking infinite requeue loop.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-066", "concern": "duplicate of correctness-1: attempts never advance on crash requeue.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-068", "concern": "missing attempts increment location in heartbeat sql.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-073", "concern": "step 6 under-scoped for real retry convergence and orchestrator-self handling.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] } ], "crash-recovery-sql-syntax": [ { "id": "DEBT-064", "concern": "bare select inside plpgsql is invalid \u2014 needs perform.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] } ], "crash-recovery-testing": [ { "id": "DEBT-070", "concern": "no multi-crash convergence test exercising attempts 0\u21921\u21922\u21923.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-071", "concern": "no validation that plpgsql body executes successfully.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-075", "concern": "criteria don't require proof of crash requeue convergence.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] } ], "criteria-verifiability": [ { "id": "DEBT-036", "concern": "'no unsafe .maybesingle()' criterion requires judgment about column uniqueness.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-037", "concern": "decision documentation location not specified.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-062", "concern": "the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone \u2014 it requires a live db query.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-delete-the-20260331-0519" ] } ], "db-fallback-testing": [ { "id": "DEBT-060", "concern": "no new automated test for the db fallback dispatch path or dependant_on preservation for raw worker families.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-delete-the-20260331-0519" ] } ], "did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements": [ { "id": "DEBT-013", "concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the package is internally inconsistent. the plan body says to keepactivepairdatainusestateand make phase 2 optional, but the attached metadata and success criteria still describe the previous derive-via-usememo/ remove-setactivepairdata/ simplify-onpairclickplan. that means the approved-plan requirements are only partially coherent as presented.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "does-the-change-touch-all-locations-and-supporting-infrastructure": [ { "id": "DEBT-014", "concern": "does the change touch all locations and supporting infrastructure?: phase 1 still misses a real supporting-data location:trailingpairdatalives outsidepairdatabyindexin /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotpresentationadapter.ts, but the proposed sync logic only considerspairdatabyindex. if trailing slot regenerate is part of the bug surface, that location is not covered.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "edge-test-config": [ { "id": "DEBT-022", "concern": "plan's vitest commands use the wrong config entry point.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-023", "concern": "same as verification-3: wrong vitest config in validation commands.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-024", "concern": "success criterion references wrong test command.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] } ], "error-handling": [ { "id": "DEBT-095", "concern": "db loader error handling convention mismatch (plan says log+null, existing loaders throw)", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ], "error-propagation-logging": [ { "id": "DEBT-027", "concern": "generation.ts and handler.ts logging endpoints are not directly tested.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] } ], "error-propagation-testing": [ { "id": "DEBT-020", "concern": "no end-to-end regression test for the full symptom chain (db error \u2192 tocompletionerror metadata \u2192 handler log).", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-025", "concern": "handler.ts metadata surfacing criterion lacks a concrete automated verifier.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-026", "concern": "main issue only partially validated without an integration test.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] } ], "hook-abstraction": [ { "id": "DEBT-043", "concern": "usepairsettingshandler becomes trivial with single caller \u2014 keeping it is extra indirection.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ], "is-the-change-in-the-right-place-and-would-it-break-any-callers": [ { "id": "DEBT-015", "concern": "is the change in the right place, and would it break any callers?: the optional cleanup steps are not in the right place yet.pairregionslayerdoes not receivepairdatabyindextoday; its props are onlyimages,imagepositionswithpending,pairinfowithpending, and callback/display props in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/timeline/timelinecontainer/components/pairregionslayer.tsx. so step 4's 'passpairdatabyindex.get(pairindex)directly' would require new prop plumbing or a different seam.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "is-the-scope-and-scale-of-the-change-appropriate": [ { "id": "DEBT-009", "concern": "is the scope and scale of the change appropriate?: phase 2 is still under-specified for execution. step 4 says pairregionslayer should either passpairdatabyindex.get(pairindex)directly or 'just pass the index + frame-only data', which are materially different designs. if phase 2 is kept in the plan, it needs a single concrete direction.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "is-there-convincing-verification-for-the-change": [ { "id": "DEBT-010", "concern": "is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check thatusevideoregeneratemodenow gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the freshurl,generationid, andprimaryvariantid.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-011", "concern": "is there convincing verification for the change?: the currentusesegmentslotmodetest remains only a smoke test in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/tests/usesegmentslotmode.test.ts, and the plan does not add behavior coverage for the new sync effect.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-012", "concern": "is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently missestrailingpairdatarefreshes.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "legacy-data-backfill": [ { "id": "DEBT-004", "concern": "the step 8 diagnostic query only detects cross-shot pair_shot_generation_id misassociations, not same-shot misassociations caused by timeline reordering within a shot.", "occurrence_count": 1, "plan_ids": [ "redesign-the-segment-position-20260330-1913" ] } ], "lookup-consistency": [ { "id": "DEBT-029", "concern": "other repo call sites use unordered .limit(1).maybesingle() and will remain inconsistent.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-033", "concern": "other call sites with same unsafe pattern not covered.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] } ], "lora-management": [ { "id": "DEBT-099", "concern": "lora tools simplified vs full ui parity (multi-stage metadata, private loras)", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ], "media-lightbox-persistence": [ { "id": "DEBT-002", "concern": "variant switches do not clear/restore inpaintprompt, so stale prompt state can leak across variants with no cached prompt.", "occurrence_count": 1, "plan_ids": [ "fix-the-prompt-text-reset-bug-20260330-1410" ] }, { "id": "DEBT-003", "concern": "removing prompt/numgenerations from the variant-keyed localstorage cache means all variants within a generation share the same prompt. this broadens existing debt-002 (variant prompt leakage).", "occurrence_count": 1, "plan_ids": [ "consolidate-the-media-20260330-1449" ] } ], "media-lightbox-segment-slot": [ { "id": "DEBT-016", "concern": "media lightbox / segment slot: the targeted sync rationale does not fully explain the reported stale-url bug for regular pairs, and the proposed effect still misses trailing-slot refreshes because those can come fromtrailingpairdatarather thanpairdatabyindex.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ], "number-input-nullable": [ { "id": "DEBT-076", "concern": "plan doesn't explicitly state onchange must also accept null, though step 3 depends on it.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] }, { "id": "DEBT-077", "concern": "disputed v1 flag \u2014 original concern about bulkclippanel being unimplementable.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] }, { "id": "DEBT-079", "concern": "onchange null filtering not explicitly addressed in plan.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] } ], "number-input-testing": [ { "id": "DEBT-081", "concern": "no planned tests for numberinput shared component or bulkclippanel nullable draft flow.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] } ], "orchestrator-completion-rollout": [ { "id": "DEBT-049", "concern": "pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-051", "concern": "missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-053", "concern": "mixed old/new data during rollout can leave old orchestrators without completion counting.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-054", "concern": "no test or deployment guard for pre-existing individual_travel_segment children completing after worker change.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-056", "concern": "plan overstates backward compatibility for existing data.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-057", "concern": "missing rollout compatibility step for in-flight individual_travel_segment tasks.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-058", "concern": "pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-059", "concern": "orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] } ], "pair-settings-plumbing": [ { "id": "DEBT-039", "concern": "handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-042", "concern": "same as flag-002 \u2014 segmentoutputstrip and usesegmentoutputstrip still carry pairframedata.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-045", "concern": "timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata).", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ], "plan-scope": [ { "id": "DEBT-032", "concern": "step 3 is larger than a light megaplan warrants.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] } ], "planning-metadata": [ { "id": "DEBT-017", "concern": "planning metadata: the attached metadata and success criteria still describe a different implementation than the current plan body, which risks sending execution and review down the wrong path.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-103", "concern": "success criteria don't cover wave 4 scope", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ], "position-key-semantics": [ { "id": "DEBT-028", "concern": "plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-030", "concern": "plan weights toward child_order rather than pair_shot_generation_id as the key that matters.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-031", "concern": "unique constraint on (parent_generation_id, child_order) not supported by repo semantics.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] } ], "prompt-composition": [ { "id": "DEBT-005", "concern": "the plan's step 1 signature includes textbeforeprompts/textafterprompts parameters that would be applied before enhancement, double-wrapping the prompt.", "occurrence_count": 1, "plan_ids": [ "in-cloud-mode-when-users-20260330-2214" ] } ], "settings-resolution": [ { "id": "DEBT-093", "concern": "settings cascade missing \u2014 shot-only read diverges from form's defaults\u2192user\u2192project\u2192shot merge", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-098", "concern": "settings cascade missing \u2014 shot-only read", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ], "shared-component-compatibility": [ { "id": "DEBT-078", "concern": "numberinput changes affect callers outside video-editor (billing, travel-between-images, phaseconfigselectormodal).", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] }, { "id": "DEBT-080", "concern": "shared ui component blast radius not audited in plan.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] } ], "shot-linking-testing": [ { "id": "DEBT-021", "concern": "no test covers the linkgenerationtoshot error/catch branches.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] } ], "signature-propagation": [ { "id": "DEBT-038", "concern": "plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-041", "concern": "same as flag-001 \u2014 timeline/index.tsx and segmentslotcontracts.ts not in checklist.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-044", "concern": "five supporting contract/plumbing sites not named in the checklist.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ], "task-types-verification": [ { "id": "DEBT-050", "concern": "step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-052", "concern": "step 3 should cite task_types source, not task_cost_configs.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-055", "concern": "plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] } ], "test-coverage": [ { "id": "DEBT-034", "concern": "current generation-child.test.ts is only a smoke test.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-035", "concern": "no plan to verify other lookup paths choose rows consistently.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-096", "concern": "no new tests for db loader or travel param merge path", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-097", "concern": "must-level criteria depend on manual testing rather than automated assertions", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-102", "concern": "no new unit tests for wave 4 tools", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-104", "concern": "must criteria backed by manual testing only", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ], "test-infrastructure": [ { "id": "DEBT-101", "concern": "no test fixtures for resources table", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ], "timeline-scaling": [ { "id": "DEBT-001", "concern": "the plan only specifies a concrete fix for the default scale(1) case; explicit-scale tracks may still break blend-mode effects.", "occurrence_count": 1, "plan_ids": [ "investigate-why-custom-ai-20260330-0408" ] } ], "travel-continuations": [ { "id": "DEBT-094", "concern": "smooth continuations not threaded \u2014 agent tasks won't have continuation_config even when shot settings enable it", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-100", "concern": "continuation_config omitted from form parity", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ], "verification": [ { "id": "DEBT-091", "concern": "no end-to-end render test for audio analysis timing", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-092", "concern": "no automated coverage for text clips or overlapping clips with audio effects", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] } ], "verification-coverage": [ { "id": "DEBT-040", "concern": "no automated test exercises the full segment-slot opening path after cleanup.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-046", "concern": "no automated coverage that clicking a pair opens the correct modal after cleanup.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-048", "concern": "zero behavioral change criterion is not verifiable from tsc + existing tests alone.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ], "verification-workflow": [ { "id": "DEBT-047", "concern": "tsconfig.app.json excludes test files, so tsc won't catch test breakage.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ], "worker-test-staleness": [ { "id": "DEBT-061", "concern": "worker test in test_additional_coverage_modules.py:37 may assert stale payload structure (task_type vs family).", "occurrence_count": 1, "plan_ids": [ "light-megaplan-delete-the-20260331-0519" ] } ] }codeEscalated debt subsystems: [{ "subsystem": "orchestrator-completion-rollout", "total_occurrences": 8, "plan_count": 1, "entries": [ { "id": "DEBT-049", "concern": "pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-051", "concern": "missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-053", "concern": "mixed old/new data during rollout can leave old orchestrators without completion counting.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-054", "concern": "no test or deployment guard for pre-existing individual_travel_segment children completing after worker change.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-056", "concern": "plan overstates backward compatibility for existing data.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-057", "concern": "missing rollout compatibility step for in-flight individual_travel_segment tasks.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-058", "concern": "pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-059", "concern": "orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] } ] }, { "subsystem": "audio-reactivity", "total_occurrences": 6, "plan_count": 1, "entries": [ { "id": "DEBT-082", "concern": "overlapping clips use first-found, volume not scaled", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-083", "concern": "same as audio-reactivity-1 \u2014 overlapping/volume-adjusted clips diverge from audible mix", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-084", "concern": "textclip missing globalframeprovider", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-085", "concern": "same as audio-reactivity-2 \u2014 textclipsequence missing provider", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-089", "concern": "textclip effects surface not covered", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-090", "concern": "continuous effects shared by visual and text clips", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] } ] }, { "subsystem": "test-coverage", "total_occurrences": 6, "plan_count": 2, "entries": [ { "id": "DEBT-034", "concern": "current generation-child.test.ts is only a smoke test.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-035", "concern": "no plan to verify other lookup paths choose rows consistently.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-096", "concern": "no new tests for db loader or travel param merge path", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-097", "concern": "must-level criteria depend on manual testing rather than automated assertions", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-102", "concern": "no new unit tests for wave 4 tools", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] }, { "id": "DEBT-104", "concern": "must criteria backed by manual testing only", "occurrence_count": 1, "plan_ids": [ "make-the-timeline-agent-s-20260406-0647" ] } ] }, { "subsystem": "crash-recovery-cascade-paths", "total_occurrences": 5, "plan_count": 1, "entries": [ { "id": "DEBT-065", "concern": "cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-067", "concern": "duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-069", "concern": "shared orchestrator-reference helpers not referenced.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-072", "concern": "orchestrator tasks that crash don't get orchestrator-self cascade.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-074", "concern": "hardcoded params->>'orchestrator_task_id_ref' misses other reference paths.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] } ] }, { "subsystem": "crash-recovery-retry", "total_occurrences": 4, "plan_count": 1, "entries": [ { "id": "DEBT-063", "concern": "crash requeue sql does not increment attempts, risking infinite requeue loop.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-066", "concern": "duplicate of correctness-1: attempts never advance on crash requeue.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-068", "concern": "missing attempts increment location in heartbeat sql.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-073", "concern": "step 6 under-scoped for real retry convergence and orchestrator-self handling.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] } ] }, { "subsystem": "are-the-proposed-changes-technically-correct", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-007", "concern": "are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs
urlandprimaryvariantid, and the regenerate path reads exactlystarturl,endurl,startgenid,endgenid,startvariantid, andendvariantidfromsegmentslotmode.pairdatain /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. addingthumburlandgenerationidto the sync does not, by itself, explain why an old image url is still being used for regular pairs.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-008", "concern": "are the proposed changes technically correct?: the fix is incomplete for extra trailing slots.handlepairclickcan populateactivepairdatafromtrailingpairdatawhenpairindex === pairdatabyindex.sizein /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only readspairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot casesfreshisundefined, so no image refresh happens.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-018", "concern": "are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omitsidandpositionfrom change detection, and whenfresh.startimageorfresh.endimagebecomesnullit preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads ofprev.startimage/prev.endimageto be safe in strict typescript.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ] }, { "subsystem": "audio-loading", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-086", "concern": "getaudiodata in useeffect removes render-readiness signal", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-087", "concern": "same as correctness-3 \u2014 preview/render parity risk", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] }, { "id": "DEBT-088", "concern": "preview/render parity partially satisfied", "occurrence_count": 1, "plan_ids": [ "add-audio-reactive-visual-20260331-2159" ] } ] }, { "subsystem": "crash-recovery-testing", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-070", "concern": "no multi-crash convergence test exercising attempts 0\u21921\u21922\u21923.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-071", "concern": "no validation that plpgsql body executes successfully.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] }, { "id": "DEBT-075", "concern": "criteria don't require proof of crash requeue convergence.", "occurrence_count": 1, "plan_ids": [ "deep-dive-into-root-causes-of-20260331-0534" ] } ] }, { "subsystem": "criteria-verifiability", "total_occurrences": 3, "plan_count": 2, "entries": [ { "id": "DEBT-036", "concern": "'no unsafe .maybesingle()' criterion requires judgment about column uniqueness.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-037", "concern": "decision documentation location not specified.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-062", "concern": "the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone \u2014 it requires a live db query.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-delete-the-20260331-0519" ] } ] }, { "subsystem": "edge-test-config", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-022", "concern": "plan's vitest commands use the wrong config entry point.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-023", "concern": "same as verification-3: wrong vitest config in validation commands.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-024", "concern": "success criterion references wrong test command.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] } ] }, { "subsystem": "error-propagation-testing", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-020", "concern": "no end-to-end regression test for the full symptom chain (db error \u2192 tocompletionerror metadata \u2192 handler log).", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-025", "concern": "handler.ts metadata surfacing criterion lacks a concrete automated verifier.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] }, { "id": "DEBT-026", "concern": "main issue only partially validated without an integration test.", "occurrence_count": 1, "plan_ids": [ "fix-complete-task-variant-20260331-0300" ] } ] }, { "subsystem": "is-there-convincing-verification-for-the-change", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-010", "concern": "is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check thatusevideoregeneratemodenow gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the freshurl,generationid, andprimaryvariantid.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-011", "concern": "is there convincing verification for the change?: the currentusesegmentslotmodetest remains only a smoke test in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/tests/usesegmentslotmode.test.ts, and the plan does not add behavior coverage for the new sync effect.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] }, { "id": "DEBT-012", "concern": "is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently missestrailingpairdatarefreshes.", "occurrence_count": 1, "plan_ids": [ "fix-the-denormalized-20260331-0225" ] } ] }, { "subsystem": "number-input-nullable", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-076", "concern": "plan doesn't explicitly state onchange must also accept null, though step 3 depends on it.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] }, { "id": "DEBT-077", "concern": "disputed v1 flag \u2014 original concern about bulkclippanel being unimplementable.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] }, { "id": "DEBT-079", "concern": "onchange null filtering not explicitly addressed in plan.", "occurrence_count": 1, "plan_ids": [ "video-editor-three-fixes-20260331-1533" ] } ] }, { "subsystem": "pair-settings-plumbing", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-039", "concern": "handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-042", "concern": "same as flag-002 \u2014 segmentoutputstrip and usesegmentoutputstrip still carry pairframedata.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-045", "concern": "timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata).", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ] }, { "subsystem": "position-key-semantics", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-028", "concern": "plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-030", "concern": "plan weights toward child_order rather than pair_shot_generation_id as the key that matters.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] }, { "id": "DEBT-031", "concern": "unique constraint on (parent_generation_id, child_order) not supported by repo semantics.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-audit-and-fix-20260331-0341" ] } ] }, { "subsystem": "signature-propagation", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-038", "concern": "plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-041", "concern": "same as flag-001 \u2014 timeline/index.tsx and segmentslotcontracts.ts not in checklist.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-044", "concern": "five supporting contract/plumbing sites not named in the checklist.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ] }, { "subsystem": "task-types-verification", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-050", "concern": "step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-052", "concern": "step 3 should cite task_types source, not task_cost_configs.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] }, { "id": "DEBT-055", "concern": "plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table.", "occurrence_count": 1, "plan_ids": [ "light-megaplan-unify-task-20260331-0443" ] } ] }, { "subsystem": "verification-coverage", "total_occurrences": 3, "plan_count": 1, "entries": [ { "id": "DEBT-040", "concern": "no automated test exercises the full segment-slot opening path after cleanup.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-046", "concern": "no automated coverage that clicking a pair opens the correct modal after cleanup.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] }, { "id": "DEBT-048", "concern": "zero behavioral change criterion is not verifiable from tsc + existing tests alone.", "occurrence_count": 1, "plan_ids": [ "phase-2-cleanup-from-the-20260331-0354" ] } ] } ]codeDebt 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/.megaplan/plans/add-production-diagnostics-20260406-1102/critique_output.jsonReview 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
flagsarray in the template file using the standard format (id, concern, category, severity_hint, evidence). Leavechecksas an empty array.Workflow: read the file → investigate → read file again → add findings → write file back.
codeAdditional 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. - Assistant
{"checks":[],"flags":[{"id":"FLAG-001","concern":"Video editor diagnostics: RAF/useEffect instrumentation is aimed at the wrong seams.
useTimelineSynconly schedules one-frame flag resets, anduseTimelinePlaybackhas nouseEffect, so Steps 3 and 5 would miss the editor's actual sustained frame loops.","category":"completeness","severity_hint":"likely-significant","evidence":"useTimelineSynconly callsrequestAnimationFrameto clear sync flags after preview or cursor events in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useTimelineSync.ts:22-50, and /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useTimelinePlayback.ts:19-56 contains no effect at all. The real repeating frame-driven sites in this repo are /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/lib/auto-scroll.ts:15-28, /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useExternalDrop.ts:219-251, and /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useDragCoordinator.ts:148-153."},{"id":"FLAG-002","concern":"Video editor diagnostics: adding a generic>50 renders/secalarm toTimelineRendererwill false-positive during normal preview playback, because that composition is expected to advance at the configured video FPS.","category":"correctness","severity_hint":"likely-significant","evidence":"The preview player mountsTimelineRendereras the Remotion composition and drives it withfps={metadata.fps}in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/PreviewPanel/RemotionPreview.tsx:96-103. Inside the composition, clips useuseCurrentFrame()in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/compositions/VisualClip.tsx:199-229, so per-frame rerenders are normal. A 50-renders/sec threshold will fire on ordinary 60fps timelines."},{"id":"FLAG-003","concern":"Video editor diagnostics: the resource-leak plan does not match the actual resource model. This editor's timeline UI is DOM-based, not canvas-based, and countingVisualClip/ player mounts will confuse Remotion's intentional premounting with leaks while still not observing real canvas/WebGL internals.","category":"correctness","severity_hint":"likely-significant","evidence":"The so-calledTimelineCanvasedit surface is a<div>tree in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/TimelineEditor/TimelineCanvas.tsx:727-740, and a repo-wide search underreigh-app/src/tools/video-editorshows no localgetContext(...)canvas usage. Meanwhile video clips are rendered through Remotion<Video>insideSequence premountFor={fps}with an extra overlap frame in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/compositions/VisualClip.tsx:239-256, so multiple mounted video components are expected during healthy playback and transitions."}],"verified_flag_ids":[],"disputed_flag_ids":[]}