Fix remaining gremlins in the video-editor effect system: (1) validateAndCoerceParams drops extra params not in schema — start reduce with { ...params } so unrecognized params pass through while schema-defined ones get validated on top. (2) register() dedup uses reference equality for schema (existing.schema === schema) which fails when same schema is passed as new object — compare code only for dedup since schema doesn't change independently. (3) replaceEffectRegistry runs every render — guard with if check so it only writes when registry actually changes. (4) EffectLayerSequence wraps in unnecessary Sequence when startFrame is 0 — skip inner Sequence offset when from would be 0. Key files: effects/validateParams.ts, effects/DynamicEffectRegistry.ts, hooks/useEffectRegistry.ts, compositions/EffectLayerSequence.tsx, effects/DynamicEffectRegistry.test.tsx
code
Batch framing:
- Execute batch 1 of 2.
- Actionable task IDs for this batch: ['T1', 'T2', 'T3', 'T4']
- Already completed task IDs available as dependency context: []
Actionable tasks for this batch:
[
{
"id": "T1",
"description": "Fix validateAndCoerceParams to pass through unrecognized params. In src/tools/video-editor/effects/validateParams.ts around line 19, change the reduce initializer from {} to { ...(params ?? {}) } so extra params survive while schema-defined ones get validated/coerced on top. Then update the test in DynamicEffectRegistry.test.tsx around lines 275-287: add an unrecognized param (e.g. customSeed: 42) to the input and assert it passes through in the output alongside coerced schema params.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Fix register()/registerAsync() dedup to use structural schema comparison instead of reference equality. In src/tools/video-editor/effects/DynamicEffectRegistry.ts: (1) Add a private helper schemasEqual(a?, b?) that returns a === b || JSON.stringify(a) === JSON.stringify(b). (2) Update line ~48 in register(): change existing.schema === schema to this.schemasEqual(existing.schema, schema). (3) Update line ~58 in early-return: same change. (4) Update line ~62 in pending staleness check: change to . Then add a test in near the existing dedup test (~line 50): register same effect with structurally-equal but referentially-distinct schema object and assert no extra notification fires; then register with a genuinely different schema and assert it does fire.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Guard replaceEffectRegistry call so it only writes when registry actually changes. In around line 29: (1) Add to the import from (already exported at ). (2) Replace the bare call with . No test changes needed.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Skip inner Sequence offset when startFrame is 0 in EffectLayerSequence. In around line 39: replace the unconditional with a conditional: and pass to instead. No test changes needed \u2014 is a Remotion no-op.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
]
Assistant
User
Assistant
Verifying batch 2 now: I’m running the full registry test file, then the broader src/tools/video-editor/ vitest module, and I’ll finish with a throwaway repro script for all four gremlins before checkpointing.
Assistant
Focused registry tests are green. I’m running the broader src/tools/video-editor/ Vitest module next; if it exposes unrelated pre-existing failures, I’ll still keep the full module run as the verification record and separate that from these fixes.
Assistant
The broad video-editor Vitest module passed cleanly. I’m building a short temporary verification file now so I can exercise the four exact bug scenarios directly, run it once, and then remove it.
Assistant
Vitest is configured to only pick up src/**/*.test.{ts,tsx}, so I’m moving the throwaway repro file under src/tools/video-editor/ and rerunning it there.
Assistant
The throwaway repro file passed all four checks and has been removed. I’m writing the batch-2 checkpoint now and then I’ll return the verification JSON for T5 and SC5 only.
Assistant
{"output":"Completed batch 2 verification for T5. The focused DynamicEffectRegistry test file passed, the broader src/tools/video-editor/ Vitest module passed (23 files, 82 tests), and a throwaway repro test exercised all four bug scenarios successfully before being deleted.","files_changed":[[REDACTED]],"commands_run":["npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx","npx vitest run src/tools/video-editor/","npx vitest run .megaplan/plans/fix-remaining-gremlins-in-the-20260406-0429/tmp-effect-gremlins-repro.test.tsx","npx vitest run src/tools/video-editor/__tmp_effect_gremlins_repro.test.tsx","jq . .megaplan/plans/fix-remaining-gremlins-in-the-20260406-0429/execution_batch_2.json"],"deviations":["Temporary repro test was first written under , but Vitest is configured to include only . I moved the throwaway file under , reran it successfully, and then deleted it."],"task_updates":[{"task_id":"T5","status":"done","executor_notes":"Re-ran the full file successfully, then ran the broader Vitest module successfully ( files, tests). Created a throwaway repro test under that directly exercised pass-through params, structural schema dedup, registry guard idempotency, and startFrame=0 Sequence skipping; it passed and was then deleted.","files_changed":[[REDACTED]],"commands_run":["npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx","npx vitest run src/tools/video-editor/","npx vitest run .megaplan/plans/fix-remaining-gremlins-in-the-20260406-0429/tmp-effect-gremlins-repro.test.tsx","npx vitest run src/tools/video-editor/__tmp_effect_gremlins_repro.test.tsx"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC5","executor_note":"Yes. All existing tests in passed, including the new structural-dedup and pass-through-param coverage, and the broader Vitest module also passed with no regressions. The throwaway repro test independently exercised all four fixes and passed before removal."}]}
registerAsync()
registerAsync()
pending.schema !== schema
!this.schemasEqual(pending.schema, schema)
DynamicEffectRegistry.test.tsx
src/tools/video-editor/hooks/useEffectRegistry.ts
getEffectRegistry
@/tools/video-editor/effects
effects/index.tsx:82
replaceEffectRegistry(registry)
if (getEffectRegistry() !== registry) replaceEffectRegistry(registry);
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[]
Prior batch deviations (address if applicable):
None
Batch-scoped sense checks:
[
{
"id": "SC1",
"task_id": "T1",
"question": "Does the reduce initializer { ...(params ?? {}) } correctly allow schema-defined params to overwrite their spread copies during reduce iteration, so coercion still takes effect for known params?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "After adding schemasEqual, do all three call sites (register line ~48, registerAsync line ~58, registerAsync line ~62) use the helper consistently, and does the test cover both the no-fire (structural equal) and fire (genuinely different) cases?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Is getEffectRegistry already exported from @/tools/video-editor/effects (check effects/index.tsx), and does the guard getEffectRegistry() !== registry use reference equality (which is correct since registry is a useMemo singleton)?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Does the inner variable get passed to wrapWithEffect correctly, and is there no other code path in EffectLayerSequence that depends on the Sequence wrapper being present unconditionally?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Fix validateAndCoerceParams to pass through unrecognized params. In src/tools/video-editor/effects/validateParams.ts around line 19, change the reduce initializer from {} to { ...(params ?? {}) } so extra params survive while schema-defined ones get validated/coerced on top. Then update the test in DynamicEffectRegistry.test.tsx around lines 275-287: add an unrecognized param (e.g. customSeed: 42) to the input and assert it passes through in the output alongside coerced schema params.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Fix register()/registerAsync() dedup to use structural schema comparison instead of reference equality. In src/tools/video-editor/effects/DynamicEffectRegistry.ts: (1) Add a private helper schemasEqual(a?, b?) that returns a === b || JSON.stringify(a) === JSON.stringify(b). (2) Update line ~48 in register(): change existing.schema === schema to this.schemasEqual(existing.schema, schema). (3) Update line ~58 in registerAsync() early-return: same change. (4) Update line ~62 in registerAsync() pending staleness check: change pending.schema !== schema to !this.schemasEqual(pending.schema, schema). Then add a test in DynamicEffectRegistry.test.tsx near the existing dedup test (~line 50): register same effect with structurally-equal but referentially-distinct schema object and assert no extra notification fires; then register with a genuinely different schema and assert it does fire.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Guard replaceEffectRegistry call so it only writes when registry actually changes. In src/tools/video-editor/hooks/useEffectRegistry.ts around line 29: (1) Add getEffectRegistry to the import from @/tools/video-editor/effects (already exported at effects/index.tsx:82). (2) Replace the bare replaceEffectRegistry(registry) call with if (getEffectRegistry() !== registry) replaceEffectRegistry(registry);. No test changes needed.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Skip inner Sequence offset when startFrame is 0 in EffectLayerSequence. In src/tools/video-editor/compositions/EffectLayerSequence.tsx around line 39: replace the unconditional <Sequence from={-startFrame}>{children}</Sequence> with a conditional: const inner = startFrame === 0 ? children : <Sequence from={-startFrame}>{children}</Sequence>; and pass inner to wrapWithEffect instead. No test changes needed \u2014 <Sequence from={0}> is a Remotion no-op.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Run all tests and verify fixes. (1) Run npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx to confirm unit tests pass. (2) Run npx vitest run src/tools/video-editor/ for broader video-editor coverage. (3) Write a short throwaway script that exercises each bug scenario (pass-through params, structural schema dedup, registry guard idempotency, startFrame=0 Sequence skip), run it, confirm correct behavior, then delete the script. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T1",
"T2",
"T3",
"T4"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"DEBT: video-editor-effect-registry: replaceEffectRegistry() in render mutates module state during React render \u2014 T3's guard mitigates but does not fully resolve the render-purity concern (FLAG-002). Do not make this worse.",
"DEBT: video-editor-effect-registry: O(n) re-renders during effect initialization \u2014 these fixes should not increase notification frequency. Verify structural dedup doesn't regress this.",
"DEBT: clip-param-schema-evolution: clips with stale params from previous schema version are not auto-normalized. T1's pass-through fix preserves unrecognized params which may include stale ones \u2014 this is intentional per plan assumptions but keep in mind.",
"Assumption: ParameterSchema arrays are plain JSON-serializable data, so JSON.stringify comparison is reliable. If schemas contain functions or circular refs, this will break silently.",
"Assumption: Extra non-schema params in validateAndCoerceParams are intentional and used by effects, not stale junk. The pass-through change is a one-way door \u2014 once effects depend on it, removing it would be breaking.",
"T2 structural comparison: JSON.stringify is order-sensitive. If schema arrays can have keys in different order across serialization boundaries, dedup may still fail. Verify the actual schema construction paths produce consistent key ordering.",
"T4: Remotion Sequence with from={0} is assumed to be a pure no-op. Verify no Remotion internals rely on Sequence wrapper presence for context/timing."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does the reduce initializer { ...(params ?? {}) } correctly allow schema-defined params to overwrite their spread copies during reduce iteration, so coercion still takes effect for known params?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "After adding schemasEqual, do all three call sites (register line ~48, registerAsync line ~58, registerAsync line ~62) use the helper consistently, and does the test cover both the no-fire (structural equal) and fire (genuinely different) cases?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Is getEffectRegistry already exported from @/tools/video-editor/effects (check effects/index.tsx), and does the guard getEffectRegistry() !== registry use reference equality (which is correct since registry is a useMemo singleton)?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Does the inner variable get passed to wrapWithEffect correctly, and is there no other code path in EffectLayerSequence that depends on the Sequence wrapper being present unconditionally?",
"executor_note": "",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Do all existing tests in DynamicEffectRegistry.test.tsx pass, including the new structural dedup and pass-through param tests, with no regressions in the broader video-editor test suite?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Four independent, small fixes \u2014 each is 1-5 lines of production code plus a test tweak. Execute T1-T4 in parallel since they touch different files with no dependencies. Key judgment calls: (1) T2's JSON.stringify for schema comparison is pragmatic but order-sensitive \u2014 the plan assumes schemas are constructed consistently, which is true for the current EffectCreatorPanel path. (2) T3's render-time guard is acknowledged as a pragmatic fix per FLAG-002 \u2014 a full useEffect migration is out of scope and would break child synchronous visibility. (3) T1's spread initializer means the reduce overwrites spread values for schema-defined keys, which is correct since reduce runs after the spread. Watch for the existing git working tree having uncommitted changes in several of these files \u2014 check git status before starting and work with the current state of the files, not assumptions from the plan's line numbers.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Pass through unrecognized params in validateAndCoerceParams",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Fix dedup in register()/registerAsync() with structural schema comparison",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Guard replaceEffectRegistry call with identity check",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Skip inner Sequence offset when startFrame is 0",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Run tests to verify all fixes",
"finalize_task_ids": [
"T5"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All 5 plan steps mapped 1:1 to tasks. No gaps or deviations.",
"coverage_complete": true
}
}
code
Debt watch items (do not make these worse):
[DEBT] agent-chat-rendering: removing the duplicate assistant turn may hide message_user text if the frontend only renders assistant-role turns as chat bubbles. (flagged 1 times across 1 plans)
[DEBT] agent-chat-undo-integration: agent chat edits arrive via query invalidation/realtime polling and will bypass the undo stack because those paths are marked skiphistory. (flagged 1 times across 1 plans)
[DEBT] agent-tool-utils: 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. (flagged 2 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: 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. (flagged 2 times across 1 plans)
[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: checked the two user-visible must 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. (flagged 2 times across 1 plans)
[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: checked the revised must criterion about eliminating duplicated server-side helpers. as written, the plan could satisfy 'all import from utils.ts' for generation.ts, create-task.ts, and messages.ts and still break four existing messages.ts consumers, so the criterion is incomplete unless it also requires preserving or updating the messages.ts export surface. (flagged 2 times across 1 plans)
[DEBT] bulk-panel-tabs: text clip multi-selections would miss the position tab under the plan's stated rule. (flagged 1 times across 1 plans)
[DEBT] bulk-properties-panel: bulkclippanel still imports customeffecteditor; removing it without updating bulk mode would break the build. (flagged 1 times across 1 plans)
[DEBT] clip-drag-scroll-sync: 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. (flagged 1 times across 1 plans)
[DEBT] clip-param-schema-evolution: clips with stale or partial params from a previous schema version will not be automatically normalized/backfilled when the effect schema changes. (flagged 1 times across 1 plans)
[DEBT] conflict-resolution: silently reloading agent-originated timeline updates would discard dirty local edits. (flagged 1 times across 1 plans)
[DEBT] conflict-resolution: if all 3 conflict retries fail, the fallback path risks discarding dirty local edits unless the executor wires it into the existing conflict dialog. (flagged 1 times across 1 plans)
[DEBT] context-menu-scope: multi-clip copy is not included despite being mentioned in the original idea. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised step 6 against supabase/functions/ai-timeline-agent/llm/messages.ts:12, supabase/functions/ai-timeline-agent/index.ts:6, supabase/functions/ai-timeline-agent/db.ts:2, supabase/functions/ai-timeline-agent/tool-calls.ts:1-4, and supabase/functions/ai-timeline-agent/selectedclips.ts:1. the plan still does not account for isrecord being part of messages.ts's exported api today, so the utility extraction is incomplete unless it either re-exports isrecord from messages.ts or updates all four downstream imports. (flagged 2 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: 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. (flagged 2 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: 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. (flagged 2 times across 1 plans)
[DEBT] drop-indicator-plumbing: dropindicator reads position.trackid without it being declared on the dropindicatorposition interface or forwarded by toindicatorposition(). (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: legacy persisted 'enhance' values might exist in storage (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: no-migration assumption for enhance→upscale is under-supported (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: enhance/upscale only partially resolved — persisted values not validated (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: no read-side normalization test for legacy 'enhance' values (flagged 1 times across 1 plans)
[DEBT] edit-mode-validation: validation grep for 'enhance' will false-fail due to video code (flagged 1 times across 1 plans)
[DEBT] edit-mode-validation: grep scope too broad — hits video submode code (flagged 1 times across 1 plans)
[DEBT] edit-mode-validation: validation scope reaches unrelated video code (flagged 1 times across 1 plans)
[DEBT] effect-layer-overlap-enforcement: 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. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: 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 isrecord from llm/messages.ts. index.ts uses it to validate rawsession, db.ts uses it on db rows, tool-calls.ts uses it on parsed tool-call payloads and nested function objects, and selectedclips.ts uses it while normalizing attachments, so preserving that import contract matters to four different call paths. (flagged 2 times across 1 plans)
[DEBT] issue-detection: mid-sentence-cut detection is not implementable without transcript/profile data that the current provider doesn't expose. (flagged 1 times across 1 plans)
[DEBT] legacy-effect-lifecycle: removing customeffecteditor makes effects-table entries read-only — users can no longer edit legacy custom effects. (flagged 1 times across 1 plans)
[DEBT] multi-drag-utils: duplicate of correctness-2 — multi-drag meta patch accumulation not spelled out (flagged 1 times across 1 plans)
[DEBT] multi-drag-utils: same merge strategy concern as correctness-2/5 from the caller perspective (flagged 1 times across 1 plans)
[DEBT] optimistic-locking: plan only specifies version checking at the db write layer; the ui load/state/save path doesn't carry config_version yet. (flagged 1 times across 1 plans)
[DEBT] properties-panel-scope: crop and transition controls are not included in the bulk panel, narrowing the original idea's scope. (flagged 1 times across 1 plans)
[DEBT] realtime-subscriptions: the shared realtime system doesn't know about timeline_agent_sessions; step 7 hooks need their own channel subscription. (flagged 1 times across 1 plans)
[DEBT] registry-patch-testing: patchregistry() lacks automated regression tests — 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. (flagged 1 times across 1 plans)
[DEBT] resolve-overlaps: resolve-overlaps.ts entirely lacks tests; plan only adds resolvegroupoverlaps tests (flagged 1 times across 1 plans)
[DEBT] resolve-overlaps: phase 4 blast radius covers both resolveoverlaps and resolvegroupoverlaps return shapes (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: 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 llm/messages.ts. the isrecord extraction is broader than the three files listed in step 6 because messages.ts is a shared utility module for index.ts, db.ts, tool-calls.ts, and selectedclips.ts; the plan still scopes the edit as if only the local definition sites matter. (flagged 2 times across 1 plans)
[DEBT] selection-save-bridge: 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. (flagged 1 times across 1 plans)
[DEBT] task-deduplication: server-generated idempotency keys would break retry deduplication because retried requests get fresh keys. (flagged 1 times across 1 plans)
[DEBT] task-system-integration: create_generation_task is underspecified against the actual task family system. (flagged 1 times across 1 plans)
[DEBT] tool-error-propagation: a blanket catch in executetool would silently downgrade db/persistence failures into ordinary tool results, changing the session error/http 500 behavior. (flagged 1 times across 1 plans)
[DEBT] track-reorder-accessibility: replacing arrow buttons with drag-only handle removes keyboard-accessible reorder; plan only specifies pointersensor. (flagged 1 times across 1 plans)
[DEBT] track-reorder-testing: no automated tests specified for same-kind boundary rules or save/load persistence of reordered tracks. (flagged 1 times across 1 plans)
[DEBT] usederivedtimeline: duplicate of correctness-1 — usememo dep array lint violation in sample code (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-preview: preview fps source not exposed via existing context (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-preview: same fps gap as flag-004 (flagged 3 times across 1 plans)
[DEBT] video-editor-effect-registry: replaceeffectregistry() in render mutates module state during react render (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: same render-purity concern as correctness-1 (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: o(n) re-renders during effect initialization (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: same batching gap as performance-1 (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: success criterion hardcodes render-time assignment as implementation detail (flagged 1 times across 1 plans)
[DEBT] vlm-cold-gpu-diagnostics: the cold-gpu vlm import crash investigation is deferred — the plan ships the zombie fix without root-causing the specific import failure. (flagged 1 times across 1 plans)
[DEBT] workspace-git-hygiene: step 2 discards unstaged edits in 6 files via git checkout head without first confirming the revert was unintentional. (flagged 1 times across 1 plans)
code
Note: User explicitly approved this plan at the gate checkpoint.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T1, T2, T3, T4]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC1, SC2, SC3, SC4]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/reigh-app/.megaplan/plans/fix-remaining-gremlins-in-the-20260406-0429/execution_batch_1.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- If a test fails and you determine the failure is pre-existing (fails without your changes too), you MUST still re-run the FULL test suite with your changes applied. Pre-existing failures do not excuse you from verifying all other tests still pass. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
{"output":"Implemented batch 1 tasks T1-T4 in the video-editor effect system, ran the full DynamicEffectRegistry.test.tsx file successfully, and checkpointed progress to .megaplan/plans/fix-remaining-gremlins-in-the-20260406-0429/execution_batch_1.json.","files_changed":[[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED],[REDACTED]],"commands_run":["git status --short","sed -n '1,220p' src/tools/video-editor/effects/validateParams.ts","sed -n '1,240p' src/tools/video-editor/effects/DynamicEffectRegistry.ts","sed -n '1,220p' src/tools/video-editor/hooks/useEffectRegistry.ts","sed -n '1,220p' src/tools/video-editor/compositions/EffectLayerSequence.tsx","sed -n '1,420p' src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx","rg -n "getEffectRegistry" src/tools/video-editor/effects/index.tsx","npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx","jq . .megaplan/plans/fix-remaining-gremlins-in-the-20260406-0429/execution_batch_1.json"],"deviations":[],"task_updates":[{"task_id":"T1","status":"done","executor_notes":"Changed validateAndCoerceParams to seed the reducer with { ...(params ?? {}) }, which preserves unrecognized params while schema-defined keys are still overwritten by validated/coerced values. Extended the full DynamicEffectRegistry.test.tsx file to include customSeed: 42 and verified it passes through in the result alongside coerced schema params.","files_changed":[[REDACTED],[REDACTED]],"commands_run":["npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"]},{"task_id":"T2","status":"done","executor_notes":"Added schemasEqual(a?, b?) and applied it at all three schema-comparison call sites in register() and registerAsync(). Expanded the full registry test file to verify no extra notification fires for a structurally equal but referentially distinct schema, while a genuinely changed schema still triggers notification.","files_changed":[[REDACTED],[REDACTED]],"commands_run":["npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"]},{"task_id":"T3","status":"done","executor_notes":"Imported getEffectRegistry into useEffectRegistry and guarded replaceEffectRegistry(registry) with if (getEffectRegistry() !== registry). Verified the export exists and the guard uses correct reference equality for the memoized registry instance; no dedicated automated test exists in this batch.","files_changed":[[REDACTED]],"commands_run":["npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"]},{"task_id":"T4","status":"done","executor_notes":"Changed EffectLayerSequence to compute inner and skip the extra <Sequence from={-startFrame}> wrapper when startFrame === 0, while still passing inner through wrapWithEffect. Verified the updated render path by inspection; no dedicated automated test exists in this batch.","files_changed":[[REDACTED]],"commands_run":["npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"]}],"sense_check_acknowledgments":[{"sense_check_id":"SC1","executor_note":"Yes. Starting the reducer from { ...(params ?? {}) } preserves unknown keys, and later reducer assignments still overwrite known schema keys with validated/coerced values."},{"sense_check_id":"SC2","executor_note":"Yes. schemasEqual is used in register, the registerAsync early return, and the registerAsync pending staleness check. The updated test covers both the structural-equality no-fire case and the genuinely changed schema fire case."},{"sense_check_id":"SC3","executor_note":"Yes. getEffectRegistry is already exported from the effects index, and getEffectRegistry() !== registry is the correct identity guard because registry comes from useMemo."},{"sense_check_id":"SC4","executor_note":"Yes. inner is what gets passed to wrapWithEffect, and there is no remaining code path in EffectLayerSequence that depends on always rendering a zero-offset Sequence wrapper."}]}
Fix remaining gremlins in the video-editor effect system: (1) validateAndCoerceParams drops extra params not in schema — start reduce with { ...params } so unrecognized params pass through while schema-defined ones get validated on top. (2) register() dedup uses reference equality for schema (existing.schema === schema) which fails when same schema is passed as new object — compare code only for dedup since schema doesn't change independently. (3) replaceEffectRegistry runs every render — guard with if check so it only writes when registry actually changes. (4) EffectLayerSequence wraps in unnecessary Sequence when startFrame is 0 — skip inner Sequence offset when from would be 0. Key files: effects/validateParams.ts, effects/DynamicEffectRegistry.ts, hooks/useEffectRegistry.ts, compositions/EffectLayerSequence.tsx, effects/DynamicEffectRegistry.test.tsx
code
Batch framing:
- Execute batch 2 of 2.
- Actionable task IDs for this batch: ['T5']
- Already completed task IDs available as dependency context: ['T1', 'T2', 'T3', 'T4']
Actionable tasks for this batch:
[
{
"id": "T5",
"description": "Run all tests and verify fixes. (1) Run npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx to confirm unit tests pass. (2) Run npx vitest run src/tools/video-editor/ for broader video-editor coverage. (3) Write a short throwaway script that exercises each bug scenario (pass-through params, structural schema dedup, registry guard idempotency, startFrame=0 Sequence skip), run it, confirm correct behavior, then delete the script. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T1",
"T2",
"T3",
"T4"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Fix validateAndCoerceParams to pass through unrecognized params. In src/tools/video-editor/effects/validateParams.ts around line 19, change the reduce initializer from {} to { ...(params ?? {}) } so extra params survive while schema-defined ones get validated/coerced on top. Then update the test in DynamicEffectRegistry.test.tsx around lines 275-287: add an unrecognized param (e.g. customSeed: 42) to the input and assert it passes through in the output alongside coerced schema params.",
"depends_on": [],
"status": "done",
"executor_notes": "Changed validateAndCoerceParams to seed the reducer with { ...(params ?? {}) }, which preserves unrecognized params while schema-defined keys are still overwritten by validated/coerced values. Extended the full DynamicEffectRegistry.test.tsx file to include customSeed: 42 and verified it passes through in the result alongside coerced schema params.",
"files_changed": [
[REDACTED],
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Fix register()/registerAsync() dedup to use structural schema comparison instead of reference equality. In src/tools/video-editor/effects/DynamicEffectRegistry.ts: (1) Add a private helper schemasEqual(a?, b?) that returns a === b || JSON.stringify(a) === JSON.stringify(b). (2) Update line ~48 in register(): change existing.schema === schema to this.schemasEqual(existing.schema, schema). (3) Update line ~58 in registerAsync() early-return: same change. (4) Update line ~62 in registerAsync() pending staleness check: change pending.schema !== schema to !this.schemasEqual(pending.schema, schema). Then add a test in DynamicEffectRegistry.test.tsx near the existing dedup test (~line 50): register same effect with structurally-equal but referentially-distinct schema object and assert no extra notification fires; then register with a genuinely different schema and assert it does fire.",
"depends_on": [],
"status": "done",
"executor_notes": "Added schemasEqual(a?, b?) and applied it at all three schema-comparison call sites in register() and registerAsync(). Expanded the full registry test file to verify no extra notification fires for a structurally equal but referentially distinct schema, while a genuinely changed schema still triggers notification.",
"files_changed": [
[REDACTED],
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Guard replaceEffectRegistry call so it only writes when registry actually changes. In src/tools/video-editor/hooks/useEffectRegistry.ts around line 29: (1) Add getEffectRegistry to the import from @/tools/video-editor/effects (already exported at effects/index.tsx:82). (2) Replace the bare replaceEffectRegistry(registry) call with if (getEffectRegistry() !== registry) replaceEffectRegistry(registry);. No test changes needed.",
"depends_on": [],
"status": "done",
"executor_notes": "Imported getEffectRegistry into useEffectRegistry and guarded replaceEffectRegistry(registry) with if (getEffectRegistry() !== registry). Verified the export exists and the guard uses correct reference equality for the memoized registry instance; no dedicated automated test exists in this batch.",
"files_changed": [
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Skip inner Sequence offset when startFrame is 0 in EffectLayerSequence. In src/tools/video-editor/compositions/EffectLayerSequence.tsx around line 39: replace the unconditional <Sequence from={-startFrame}>{children}</Sequence> with a conditional: const inner = startFrame === 0 ? children : <Sequence from={-startFrame}>{children}</Sequence>; and pass inner to wrapWithEffect instead. No test changes needed \u2014 <Sequence from={0}> is a Remotion no-op.",
"depends_on": [],
"status": "done",
"executor_notes": "Changed EffectLayerSequence to compute inner and skip the extra <Sequence from={-startFrame}> wrapper when startFrame === 0, while still passing inner through wrapWithEffect. Verified the updated render path by inspection; no dedicated automated test exists in this batch.",
"files_changed": [
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
}
]
{
"id": "SC5",
"task_id": "T5",
"question": "Do all existing tests in DynamicEffectRegistry.test.tsx pass, including the new structural dedup and pass-through param tests, with no regressions in the broader video-editor test suite?",
"executor_note": "",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Fix validateAndCoerceParams to pass through unrecognized params. In src/tools/video-editor/effects/validateParams.ts around line 19, change the reduce initializer from {} to { ...(params ?? {}) } so extra params survive while schema-defined ones get validated/coerced on top. Then update the test in DynamicEffectRegistry.test.tsx around lines 275-287: add an unrecognized param (e.g. customSeed: 42) to the input and assert it passes through in the output alongside coerced schema params.",
"depends_on": [],
"status": "done",
"executor_notes": "Changed validateAndCoerceParams to seed the reducer with { ...(params ?? {}) }, which preserves unrecognized params while schema-defined keys are still overwritten by validated/coerced values. Extended the full DynamicEffectRegistry.test.tsx file to include customSeed: 42 and verified it passes through in the result alongside coerced schema params.",
"files_changed": [
[REDACTED],
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Fix register()/registerAsync() dedup to use structural schema comparison instead of reference equality. In src/tools/video-editor/effects/DynamicEffectRegistry.ts: (1) Add a private helper schemasEqual(a?, b?) that returns a === b || JSON.stringify(a) === JSON.stringify(b). (2) Update line ~48 in register(): change existing.schema === schema to this.schemasEqual(existing.schema, schema). (3) Update line ~58 in registerAsync() early-return: same change. (4) Update line ~62 in registerAsync() pending staleness check: change pending.schema !== schema to !this.schemasEqual(pending.schema, schema). Then add a test in DynamicEffectRegistry.test.tsx near the existing dedup test (~line 50): register same effect with structurally-equal but referentially-distinct schema object and assert no extra notification fires; then register with a genuinely different schema and assert it does fire.",
"depends_on": [],
"status": "done",
"executor_notes": "Added schemasEqual(a?, b?) and applied it at all three schema-comparison call sites in register() and registerAsync(). Expanded the full registry test file to verify no extra notification fires for a structurally equal but referentially distinct schema, while a genuinely changed schema still triggers notification.",
"files_changed": [
[REDACTED],
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Guard replaceEffectRegistry call so it only writes when registry actually changes. In around line 29: (1) Add to the import from (already exported at ). (2) Replace the bare call with . No test changes needed.",
"depends_on": [],
"status": "done",
"executor_notes": "Imported into and guarded with . Verified the export exists and the guard uses correct reference equality for the memoized registry instance; no dedicated automated test exists in this batch.",
"files_changed": [
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Skip inner Sequence offset when startFrame is 0 in EffectLayerSequence. In around line 39: replace the unconditional with a conditional: and pass to instead. No test changes needed \u2014 is a Remotion no-op.",
"depends_on": [],
"status": "done",
"executor_notes": "Changed to compute and skip the extra wrapper when , while still passing through . Verified the updated render path by inspection; no dedicated automated test exists in this batch.",
"files_changed": [
[REDACTED]
],
"commands_run": [
"npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx"
],
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Run all tests and verify fixes. (1) Run to confirm unit tests pass. (2) Run for broader video-editor coverage. (3) Write a short throwaway script that exercises each bug scenario (pass-through params, structural schema dedup, registry guard idempotency, startFrame=0 Sequence skip), run it, confirm correct behavior, then delete the script. If any test fails, read the error, fix the code, and re-run until green.",
"depends_on": [
"T1",
"T2",
"T3",
"T4"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"DEBT: video-editor-effect-registry: replaceEffectRegistry() in render mutates module state during React render \u2014 T3's guard mitigates but does not fully resolve the render-purity concern (FLAG-002). Do not make this worse.",
"DEBT: video-editor-effect-registry: O(n) re-renders during effect initialization \u2014 these fixes should not increase notification frequency. Verify structural dedup doesn't regress this.",
"DEBT: clip-param-schema-evolution: clips with stale params from previous schema version are not auto-normalized. T1's pass-through fix preserves unrecognized params which may include stale ones \u2014 this is intentional per plan assumptions but keep in mind.",
"Assumption: ParameterSchema arrays are plain JSON-serializable data, so JSON.stringify comparison is reliable. If schemas contain functions or circular refs, this will break silently.",
"Assumption: Extra non-schema params in validateAndCoerceParams are intentional and used by effects, not stale junk. The pass-through change is a one-way door \u2014 once effects depend on it, removing it would be breaking.",
"T2 structural comparison: JSON.stringify is order-sensitive. If schema arrays can have keys in different order across serialization boundaries, dedup may still fail. Verify the actual schema construction paths produce consistent key ordering.",
"T4: Remotion Sequence with from={0} is assumed to be a pure no-op. Verify no Remotion internals rely on Sequence wrapper presence for context/timing."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does the reduce initializer correctly allow schema-defined params to overwrite their spread copies during reduce iteration, so coercion still takes effect for known params?",
"executor_note": "Yes. Starting the reducer from preserves unknown keys, and later reducer assignments still overwrite known schema keys with validated/coerced values.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T2",
"question": "After adding schemasEqual, do all three call sites (register line ~48, registerAsync line ~58, registerAsync line ~62) use the helper consistently, and does the test cover both the no-fire (structural equal) and fire (genuinely different) cases?",
"executor_note": "Yes. is used in , the early return, and the pending staleness check. The updated test covers both the structural-equality no-fire case and the genuinely changed schema fire case.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T3",
"question": "Is getEffectRegistry already exported from (check effects/index.tsx), and does the guard use reference equality (which is correct since registry is a useMemo singleton)?",
"executor_note": "Yes. is already exported from the effects index, and is the correct identity guard because comes from .",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T4",
"question": "Does the variable get passed to correctly, and is there no other code path in EffectLayerSequence that depends on the Sequence wrapper being present unconditionally?",
"executor_note": "Yes. is what gets passed to , and there is no remaining code path in that depends on always rendering a zero-offset wrapper.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T5",
"question": "Do all existing tests in DynamicEffectRegistry.test.tsx pass, including the new structural dedup and pass-through param tests, with no regressions in the broader video-editor test suite?",
"executor_note": "",
"verdict": ""
}
],
"meta_commentary": "Four independent, small fixes \u2014 each is 1-5 lines of production code plus a test tweak. Execute T1-T4 in parallel since they touch different files with no dependencies. Key judgment calls: (1) T2's JSON.stringify for schema comparison is pragmatic but order-sensitive \u2014 the plan assumes schemas are constructed consistently, which is true for the current EffectCreatorPanel path. (2) T3's render-time guard is acknowledged as a pragmatic fix per FLAG-002 \u2014 a full useEffect migration is out of scope and would break child synchronous visibility. (3) T1's spread initializer means the reduce overwrites spread values for schema-defined keys, which is correct since reduce runs after the spread. Watch for the existing git working tree having uncommitted changes in several of these files \u2014 check git status before starting and work with the current state of the files, not assumptions from the plan's line numbers.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Pass through unrecognized params in validateAndCoerceParams",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Fix dedup in register()/registerAsync() with structural schema comparison",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Guard replaceEffectRegistry call with identity check",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Skip inner Sequence offset when startFrame is 0",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Run tests to verify all fixes",
"finalize_task_ids": [
"T5"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All 5 plan steps mapped 1:1 to tasks. No gaps or deviations.",
"coverage_complete": true
}
}
code
Debt watch items (do not make these worse):
[DEBT] agent-chat-rendering: removing the duplicate assistant turn may hide message_user text if the frontend only renders assistant-role turns as chat bubbles. (flagged 1 times across 1 plans)
[DEBT] agent-chat-undo-integration: agent chat edits arrive via query invalidation/realtime polling and will bypass the undo stack because those paths are marked skiphistory. (flagged 1 times across 1 plans)
[DEBT] agent-tool-utils: 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. (flagged 2 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: 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. (flagged 2 times across 1 plans)
[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: checked the two user-visible must 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. (flagged 2 times across 1 plans)
[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: checked the revised must criterion about eliminating duplicated server-side helpers. as written, the plan could satisfy 'all import from utils.ts' for generation.ts, create-task.ts, and messages.ts and still break four existing messages.ts consumers, so the criterion is incomplete unless it also requires preserving or updating the messages.ts export surface. (flagged 2 times across 1 plans)
[DEBT] bulk-panel-tabs: text clip multi-selections would miss the position tab under the plan's stated rule. (flagged 1 times across 1 plans)
.megaplan/...
src/**/*.test.{ts,tsx}
src/tools/video-editor/
DynamicEffectRegistry.test.tsx
src/tools/video-editor/
23
82
src/tools/video-editor/
DynamicEffectRegistry.test.tsx
src/tools/video-editor/
Not yet included in a published release.
tests
tests
src/tools/video-editor/hooks/useEffectRegistry.ts
getEffectRegistry
@/tools/video-editor/effects
effects/index.tsx:82
replaceEffectRegistry(registry)
if (getEffectRegistry() !== registry) replaceEffectRegistry(registry);
npx vitest run src/tools/video-editor/effects/DynamicEffectRegistry.test.tsx
npx vitest run src/tools/video-editor/
{ ...(params ?? {}) }
{ ...(params ?? {}) }
schemasEqual
register
registerAsync
registerAsync
@/tools/video-editor/effects
getEffectRegistry() !== registry
getEffectRegistry
getEffectRegistry() !== registry
registry
useMemo
inner
wrapWithEffect
inner
wrapWithEffect
EffectLayerSequence
Sequence
[DEBT] bulk-properties-panel: bulkclippanel still imports customeffecteditor; removing it without updating bulk mode would break the build. (flagged 1 times across 1 plans)
[DEBT] clip-drag-scroll-sync: 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. (flagged 1 times across 1 plans)
[DEBT] clip-param-schema-evolution: clips with stale or partial params from a previous schema version will not be automatically normalized/backfilled when the effect schema changes. (flagged 1 times across 1 plans)
[DEBT] conflict-resolution: silently reloading agent-originated timeline updates would discard dirty local edits. (flagged 1 times across 1 plans)
[DEBT] conflict-resolution: if all 3 conflict retries fail, the fallback path risks discarding dirty local edits unless the executor wires it into the existing conflict dialog. (flagged 1 times across 1 plans)
[DEBT] context-menu-scope: multi-clip copy is not included despite being mentioned in the original idea. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised step 6 against supabase/functions/ai-timeline-agent/llm/messages.ts:12, supabase/functions/ai-timeline-agent/index.ts:6, supabase/functions/ai-timeline-agent/db.ts:2, supabase/functions/ai-timeline-agent/tool-calls.ts:1-4, and supabase/functions/ai-timeline-agent/selectedclips.ts:1. the plan still does not account for isrecord being part of messages.ts's exported api today, so the utility extraction is incomplete unless it either re-exports isrecord from messages.ts or updates all four downstream imports. (flagged 2 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: 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. (flagged 2 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: 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. (flagged 2 times across 1 plans)
[DEBT] drop-indicator-plumbing: dropindicator reads position.trackid without it being declared on the dropindicatorposition interface or forwarded by toindicatorposition(). (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: legacy persisted 'enhance' values might exist in storage (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: no-migration assumption for enhance→upscale is under-supported (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: enhance/upscale only partially resolved — persisted values not validated (flagged 1 times across 1 plans)
[DEBT] edit-mode-persistence: no read-side normalization test for legacy 'enhance' values (flagged 1 times across 1 plans)
[DEBT] edit-mode-validation: validation grep for 'enhance' will false-fail due to video code (flagged 1 times across 1 plans)
[DEBT] edit-mode-validation: grep scope too broad — hits video submode code (flagged 1 times across 1 plans)
[DEBT] edit-mode-validation: validation scope reaches unrelated video code (flagged 1 times across 1 plans)
[DEBT] effect-layer-overlap-enforcement: 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. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: 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 isrecord from llm/messages.ts. index.ts uses it to validate rawsession, db.ts uses it on db rows, tool-calls.ts uses it on parsed tool-call payloads and nested function objects, and selectedclips.ts uses it while normalizing attachments, so preserving that import contract matters to four different call paths. (flagged 2 times across 1 plans)
[DEBT] issue-detection: mid-sentence-cut detection is not implementable without transcript/profile data that the current provider doesn't expose. (flagged 1 times across 1 plans)
[DEBT] legacy-effect-lifecycle: removing customeffecteditor makes effects-table entries read-only — users can no longer edit legacy custom effects. (flagged 1 times across 1 plans)
[DEBT] multi-drag-utils: duplicate of correctness-2 — multi-drag meta patch accumulation not spelled out (flagged 1 times across 1 plans)
[DEBT] multi-drag-utils: same merge strategy concern as correctness-2/5 from the caller perspective (flagged 1 times across 1 plans)
[DEBT] optimistic-locking: plan only specifies version checking at the db write layer; the ui load/state/save path doesn't carry config_version yet. (flagged 1 times across 1 plans)
[DEBT] properties-panel-scope: crop and transition controls are not included in the bulk panel, narrowing the original idea's scope. (flagged 1 times across 1 plans)
[DEBT] realtime-subscriptions: the shared realtime system doesn't know about timeline_agent_sessions; step 7 hooks need their own channel subscription. (flagged 1 times across 1 plans)
[DEBT] registry-patch-testing: patchregistry() lacks automated regression tests — 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. (flagged 1 times across 1 plans)
[DEBT] resolve-overlaps: resolve-overlaps.ts entirely lacks tests; plan only adds resolvegroupoverlaps tests (flagged 1 times across 1 plans)
[DEBT] resolve-overlaps: phase 4 blast radius covers both resolveoverlaps and resolvegroupoverlaps return shapes (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: 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 llm/messages.ts. the isrecord extraction is broader than the three files listed in step 6 because messages.ts is a shared utility module for index.ts, db.ts, tool-calls.ts, and selectedclips.ts; the plan still scopes the edit as if only the local definition sites matter. (flagged 2 times across 1 plans)
[DEBT] selection-save-bridge: 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. (flagged 1 times across 1 plans)
[DEBT] task-deduplication: server-generated idempotency keys would break retry deduplication because retried requests get fresh keys. (flagged 1 times across 1 plans)
[DEBT] task-system-integration: create_generation_task is underspecified against the actual task family system. (flagged 1 times across 1 plans)
[DEBT] tool-error-propagation: a blanket catch in executetool would silently downgrade db/persistence failures into ordinary tool results, changing the session error/http 500 behavior. (flagged 1 times across 1 plans)
[DEBT] track-reorder-accessibility: replacing arrow buttons with drag-only handle removes keyboard-accessible reorder; plan only specifies pointersensor. (flagged 1 times across 1 plans)
[DEBT] track-reorder-testing: no automated tests specified for same-kind boundary rules or save/load persistence of reordered tracks. (flagged 1 times across 1 plans)
[DEBT] usederivedtimeline: duplicate of correctness-1 — usememo dep array lint violation in sample code (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-preview: preview fps source not exposed via existing context (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-preview: same fps gap as flag-004 (flagged 3 times across 1 plans)
[DEBT] video-editor-effect-registry: replaceeffectregistry() in render mutates module state during react render (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: same render-purity concern as correctness-1 (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: o(n) re-renders during effect initialization (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: same batching gap as performance-1 (flagged 1 times across 1 plans)
[DEBT] video-editor-effect-registry: success criterion hardcodes render-time assignment as implementation detail (flagged 1 times across 1 plans)
[DEBT] vlm-cold-gpu-diagnostics: the cold-gpu vlm import crash investigation is deferred — the plan ships the zombie fix without root-causing the specific import failure. (flagged 1 times across 1 plans)
[DEBT] workspace-git-hygiene: step 2 discards unstaged edits in 6 files via git checkout head without first confirming the revert was unintentional. (flagged 1 times across 1 plans)
code
Note: User explicitly approved this plan at the gate checkpoint.
Robustness level: light.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T5]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC5]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/reigh-app/.megaplan/plans/fix-remaining-gremlins-in-the-20260406-0429/execution_batch_2.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- If a test fails and you determine the failure is pre-existing (fails without your changes too), you MUST still re-run the FULL test suite with your changes applied. Pre-existing failures do not excuse you from verifying all other tests still pass. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.