You are creating an implementation plan for the following idea.
code
Idea:
Finish the projection-model rollback that a previous megaplan started but only got ~60% done. Currently the data shape is soft-tag (pinnedShotGroups[i] = { shotId, trackId, clipIds }) but several production code paths still operate on the legacy projection-model fields (start, children, offset, duration) behind compatibility shims that are silently lossy. The result: every interaction with a shot group goes through a hybrid where live preview uses soft-tag overrides but commit goes through legacy materialize paths, causing rounding drift, position jumps, stuck preview frames after release, and pointer-capture-loss races.
This is a NARROW, SCOPED finish-the-job megaplan, not a re-architecture. We know exactly what's left.
State of partial completion:
DONE (don't touch unless broken):
PinnedShotGroup type is soft-tag in src/tools/video-editor/types/index.ts (with deprecated start? and children? legacy compat fields that should be DELETED at the end of this refactor)
pinned-group-projection.ts collapsed to ~280 lines: findEnclosingPinnedGroup, categorizeSelection, orderClipIdsByAt (real) + buildGroupFromChildren, buildGroupFromConfigClips, replaceGroupChildren, moveGroup, projectPinnedShotGroups (deprecated compatibility shims that should be DELETED at the end of this refactor)
useClipDrag.ts rewritten for soft-tag model: uses enclosingGroup.group.clipIds, computes group bounds from live actions, uses orderClipIdsByAt to re-derive clip order after drags
useClipResize.ts rewritten with resolveGroupMembers, getInteriorNeighbor, computeClipResizeMetaPatch, applyActionBounds helpers — interior-boundary commit branch is in place but routes through applyEdit({type: 'rows'}) which goes through the lossy materializeData path
useShotGroups.ts rewritten to derive children/start from live row actions
interaction-state.ts shared interaction lib created with createInteractionState, isInteractionActive, onInteractionEnd, notifyInteractionEndIfIdle
useTimelinePersistence.ts save scheduler IS gated on interactionStateRef and flushes on gesture end
usePollSync.ts poll-acceptance gate IS gated on interactionStateRef and re-evaluates on gesture end
interactionStateRef is plumbed through VideoEditorProvider data context
TimelineCanvas resize session model collapsed to one discriminated union: 'clip' | 'group-child-boundary' | 'group-edge' with one handleResizePointerDown, updateResize, endResize, handleResizePointerMove
NOT DONE (this megaplan):
useClipResize.ts interior-boundary commit drift. The interior commit calls applyEdit({type: 'rows', rows: nextRows, metaUpdates}). applyEdit for 'rows' mutations routes through materializeData -> rowsToConfig -> assembleTimelineData -> configToRows. rowsToConfig rounds clip positions to 2 decimal places (0.01s precision) and serializes hold clips as (at, hold) rounded INDEPENDENTLY, which means derived_end != round(actual_end) and tiny gaps can open between adjacent clips after every commit. Fix by increasing rowsToConfig rounding precision to at least 4 decimal places, OR better, make hold clip at/end serialization consistent.
Assistant
User
Assistant
usePinnedGroupSync rewrite for soft-tag model in src/tools/video-editor/hooks/usePinnedShotGroups.ts. Currently iterates projection-model children/offset/duration arrays. Rewrite to watch underlying Shot.images[] for added/removed/reordered generation_ids and rebuild clipIds accordingly, deferring during interaction.
useSwitchToFinalVideo.ts rewrite for soft-tag model. Currently builds projection-shape nextChildren arrays and passes to buildGroupFromChildren/replaceGroupChildren shims. Rewrite to compute the final-video clip's at/hold directly, update pinnedShotGroups[i].clipIds to [finalVideoClipId], save image clip positions in imageClipSnapshot. Restore reads imageClipSnapshot and restores row actions with updated clipIds.
useExternalDrop.ts rewrite for soft-tag shot drop. Compute clip positions directly when adding row actions, create soft-tag group with clipIds.
useTimelineTrackManagement.ts moveGroup callsites. Currently uses moveGroup shim which only updates trackId. Rewrite three callsites to also re-derive each clip's row assignment in meta.
Migration in migrate.ts repairConfig. Add one-way migration: when loading a saved config with projection-shape groups, convert to soft-tag by extracting clipIds = children.map((c) => c.clipId) and dropping start/children. Add unit test.
Delete deprecated compatibility shims from pinned-group-projection.ts: buildGroupFromChildren, buildGroupFromConfigClips, replaceGroupChildren, moveGroup, projectPinnedShotGroups. Also delete from PinnedShotGroup type: deprecated start? and children? fields. Verify type-check clean.
Update or delete the 14 failing tests in: serialize.test.ts (1), timeline-save-utils.test.ts (3), useClipDrag.test.tsx (3), useClipEditing.test.ts (6), useShotGroups.test.ts (1). Rewrite to test soft-tag model or delete if invariant no longer makes sense.
Two user-reported symptoms must be fixed: boundary jumps closer to adjacent clip / cuts into other side; doesn't release frames after release.
All listed flows must continue to work end-to-end (drag clip in group, drag edges, interior boundary, cross-track, switch to final video, switch to images, gallery drop, auto-save defer, poll-sync defer, projection-shape load migration, shot label menu, per-clip context menu lockdown).
tsc --noEmit clean for video-editor tree.
All video-editor tests pass.
The 5 deprecated shims and 2 legacy fields physically deleted.
No diagnostic console.logs left.
Constraints: scope is video-editor tool only. Follow CLAUDE.md. Prefer Edit over Write. Don't bundle unrelated cleanups. Pre-existing failing tests and TS errors in unrelated files left alone. Don't introduce new state management libraries.
Success criteria:
Two user-reported symptoms no longer reproduce.
tsc --noEmit clean for video-editor tree.
All video-editor tests pass.
Deprecated shims and legacy PinnedShotGroup fields deleted.
No diagnostic console.logs left.
Loading saved file with projection-shape pinnedShotGroups works (migration test passes).
Code line count for shot-group-related files decreases net.
code
Project directory:
/Users/user_c042661f/Documents/reigh-workspace/reigh-app
No prior clarification artifact exists. Identify ambiguities, ask clarifying questions, and state your assumptions inside the plan output.
Requirements:
- If the engineering brief suggests an approach, use it as your starting hypothesis — but before committing, consider if there's a simpler or more fundamental fix. The brief is well-researched input, not a final answer.
- If the brief is absent, incomplete, or says "skip", inspect the repository yourself before planning.
- Produce a concrete implementation plan in markdown.
- Define observable success criteria as objects with `criterion` (string) and `priority` (`must`, `should`, or `info`):
- `must` — hard gate. The reviewer will block on failure. Use for correctness, functional requirements, and verifiable outcomes (e.g., "all existing tests pass", "API returns 200 for valid input"). Every `must` criterion must have a clear yes/no answer.
- `should` — quality target. The reviewer flags but does not block. Use for subjective goals, numeric guidelines, and best-effort improvements (e.g., "file under ~300 lines", "no deeply nested conditionals", "each function has a single responsibility").
- `info` — documented for humans, reviewer skips. Use for criteria that cannot be verified in this pipeline (e.g., "13 manual smoke tests pass", "stakeholder sign-off obtained").
- Use the `questions` field for ambiguities that would materially change implementation.
- Use the `assumptions` field for defaults you are making so planning can proceed now.
- Prefer cheap validation steps early.
- Keep the plan proportional to the task. A 1-line fix needs a 2-step plan (apply fix + run tests), not a 5-step investigation.
- If user notes answer earlier questions, incorporate them into the draft plan instead of re-asking them.
- Fix the problem fully. Do not limit scope just to avoid breaking existing tests — update the tests too if needed.
- Prefer the simplest, most direct fix. No fallbacks, type conversions, or defensive wrappers without concrete evidence they are needed.
- If the task or issue hints suggest a specific approach, follow it. Only deviate with concrete counter-evidence.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
{"plan":"# Implementation Plan: Video-Editor Soft-Tag Rollback Finish\n\n## Overview\nThis is a narrow finish-the-job refactor inside src/tools/video-editor, not a redesign. The repository already moved the core model to soft-tag PinnedShotGroup.clipIds, but the remaining drift comes from two residual patterns still visible in the codebase: rows -> config commits still round clip timing too coarsely in timeline-data.ts, and several production/test callsites still build or expect legacy start/children projection shape through the compatibility layer in pinned-group-projection.ts.\n\nThe simplest fix is to keep the existing editor state flow and finish the rollback at the remaining boundaries: make row materialization numerically stable, rewrite the last legacy callers to operate on clipIds plus live row actions, then physically delete the shims and legacy fields. megaplan init could not be used end-to-end here because the sandbox is read-only and blocks creation of .megaplan/, so this is a repo-backed manual plan following the same standard-robustness workflow.\n\n## Phase 1: Stabilize Canonical Data And Commit Math\n\n### Step 1: Fix interior-boundary commit drift in row materialization\nScope: Small\n1. Update timeline-data.ts so rowsToConfig() no longer serializes grouped edits at 0.01s precision.\n2. Use one shared 4-decimal rounding path for at, hold, from, and to, and compute hold-clip duration from one rounded start/end pair so roundedStart + roundedHold == roundedEnd for boundary commits.\n3. Add a focused regression around repeated interior-boundary commits in useClipResize.test.tsx or render-bounds.validation.test.ts to prove adjacent clips do not open gaps, jump inward, or cut across the shared boundary after commit.\n\n### Step 2: Make the type/migration layer fully soft-tag\nScope: Small\n1. Remove start? and children? from types/index.ts.\n2. Expand PinnedShotImageClipSnapshot in the same file only as needed to support image restore without legacy projection fields, most likely by storing timing/position data explicitly instead of reconstructing it from start/children.\n3. Keep migrate.ts as the single backward-compat path: detect raw legacy group objects on load, derive clipIds from children, preserve mode/video snapshot metadata, and drop legacy keys.\n4. Tighten migrate.test.ts and serialize.test.ts so they assert legacy fields are stripped and never re-emitted.\n\n## Phase 2: Rewrite The Remaining Production Callers\n\n### Step 3: Rewrite pinned-group sync and mutation helpers around clipIds\nScope: Medium\n1. In usePinnedShotGroups.ts, replace buildGroupFromConfigClips, buildGroupFromChildren, and replaceGroupChildren usage with direct soft-tag group construction using orderClipIdsByAt() plus live row data.\n2. Simplify local cloning/update helpers in that file so they only copy clipIds, mode, videoAssetKey, and imageClipSnapshot.\n3. Rewrite usePinnedGroupSync() to diff Shot.images[] generation order against the current group’s live clipIds, reuse matching clips by generation id, add/remove actions directly, rebuild ordered clipIds, and continue deferring work while interactionState is active.\n4. Keep the current debounce/interaction gating behavior intact so autosave and poll-sync still wait until gesture end.\n\n### Step 4: Rewrite final-video/image switching to snapshot live clip state directly\nScope: Medium\n1. In useSwitchToFinalVideo.ts, remove updatePinnedGroupWithChildren() and any dependency on projection-shaped nextChildren.\n2. On switchToFinalVideo, snapshot each image clip’s asset/meta plus its live timing/position into imageClipSnapshot, create the final-video clip with direct at/duration data, and set the group to clipIds: [videoClipId].\n3. On switchToImages, restore row actions and meta from imageClipSnapshot, rebuild the ordered clipIds, and commit through one soft-tag rows mutation with pinnedShotGroupsOverride.\n4. Add or update coverage in useClipEditing.test.ts for both directions.\n\n### Step 5: Rewrite shot drop and grouped cross-track commit paths\nScope: Medium\n1. In useExternalDrop.ts, keep direct row insertion via buildAssetDropEdit(), but create the shot group as a soft-tag entry with ordered clipIds instead of start/children.\n2. In useTimelineTrackManagement.ts, replace all three moveGroup() callsites with atomic grouped commits that update rows, per-clip track meta, clip order, and the group’s trackId/clipIds together.\n3. Reuse the existing translateGroupMembers() helper there as the main replacement path so release-state matches the live preview and the “stuck preview frames after release” symptom is fixed at the actual commit boundary.\n4. Update useTimelineTrackManagement.test.ts and useExternalDrop.test.tsx to assert real row/meta commits instead of shim-only group rewrites.\n\n## Phase 3: Delete Compatibility Code And Realign Tests\n\n### Step 6: Remove the deprecated compatibility layer\nScope: Small\n1. Delete buildGroupFromChildren, buildGroupFromConfigClips, replaceGroupChildren, moveGroup, and projectPinnedShotGroups from pinned-group-projection.ts, leaving only soft-tag helpers such as findEnclosingPinnedGroup(), categorizeSelection(), and orderClipIdsByAt().\n2. Remove all remaining imports/usages of those helpers across production code and tests.\n3. Re-run a repo grep for start, children, and the deleted exports inside src/tools/video-editor to verify the rollback is physically complete.\n\n### Step 7: Rewrite the listed failing tests to assert soft-tag behavior\nScope: Medium\n1. serialize.test.ts: replace shim-built groups with direct soft-tag fixtures and keep load-time migration assertions for legacy input.\n2. timeline-save-utils.test.ts: stop expecting resolved-config projection from group metadata; assert repaired config shape, stable signatures, and live rows derived from actual clip timing.\n3. useClipDrag.test.tsx, useClipEditing.test.ts, and useShotGroups.test.ts: replace buildGroupFromChildren()/projectPinnedShotGroups() factories with direct soft-tag fixtures and assert derived children/start come from live row actions.\n4. Add targeted regression coverage for the two user symptoms: repeated interior-boundary commits stay stable, and grouped release commits leave preview and committed state aligned.\n\n### Step 8: Remove diagnostics and verify in cheap-to-broad order\nScope: Small\n1. Audit src/tools/video-editor for diagnostic console.log calls with the requested tags; if any survive in touched files, delete them.\n2. Validate in this order once implementation is complete:\n 1. migrate.test.ts, serialize.test.ts, timeline-save-utils.test.ts, useClipResize.test.tsx\n 2. grouped-flow hook suites for pinned sync, final-video switching, external drop, and track management\n 3. the full src/tools/video-editor/** Vitest sweep\n 4. the accepted tsc --noEmit command for the video-editor tree\n3. Finish with rg checks proving there are no remaining legacy-field or shim references in src/tools/video-editor.\n\n## Execution Order\n1. Fix canonical serialization and migration first so every later hook writes the same stable shape.\n2. Migrate runtime callers before deleting the compatibility exports.\n3. Update tests in the same slices as the code changes, then remove the final helper references.\n4. End with broad validation, shim-reference greps, and diagnostic-log audit.\n\n## Validation Order\n1. Start with focused serialization/migration/resize regressions.\n2. Then verify grouped runtime flows: sync, drop, track move, and final-video/image switching.\n3. Then run the full video-editor test sweep.\n4. End with the scoped TypeScript check and grep-based cleanup verification.","questions":["What exact acceptance commands should count for tsc --noEmit clean for video-editor tree and all video-editor tests pass in CI? I assumed a scoped vitest run over src/tools/video-editor/** plus a TypeScript command that only blocks on video-editor errors.","For imageClipSnapshot, do you want restore timing stored as absolute clip bounds (at/end) or as group-relative offsets/durations? The plan assumes adding explicit timing data is allowed, but that choice changes the type shape and tests.","If any saved fixtures outside repairConfig tests still contain projection-shaped pinnedShotGroups, should they be migrated in place during this refactor, or is load-time repair the only backward-compat path we need to keep?"],"success_criteria":[{"criterion":"rowsToConfig() commits preserve grouped clip adjacency across repeated interior-boundary resizes, with regression coverage proving no gap/overlap drift and no boundary jump into the neighboring clip.","priority":"must"},{"criterion":"repairConfig() converts legacy projection-shaped pinnedShotGroups into soft-tag groups with clipIds only, and migration coverage passes.","priority":"must"},{"criterion":"Grouped cross-track moves, final-video switching, image restore, and shot drops commit through soft-tag row/meta/clip-order/group overrides rather than legacy shim-only updates, and the affected hook tests pass.","priority":"must"},{"criterion":"The accepted video-editor TypeScript check passes with no in-scope errors.","priority":"must"},{"criterion":"The accepted video-editor Vitest sweep passes.","priority":"must"},{"criterion":"PinnedShotGroup.start, PinnedShotGroup.children, and the five deprecated shim exports are physically deleted with no remaining imports/usages in src/tools/video-editor.","priority":"must"},{"criterion":"No diagnostic console.log calls remain for [handleResizePointerDown], [outer-edge lookup], [GroupEdgeResize], [startGroupEdgeResize], [useClipDrag], or [Marquee].","priority":"must"},{"criterion":"Shot-group-related files end with a net lower line count after compatibility code is removed.","priority":"should"},{"criterion":"Manual smoke of the reported symptoms and the listed end-to-end flows confirms boundary releases are stable and preview frames clear correctly after release.","priority":"info"}],"assumptions":["The existing translateGroupMembers() helper in useTimelineTrackManagement.ts is the intended replacement for the three moveGroup() callsites, and extending it is preferable to adding new state flow.","A shared 4-decimal canonical rounding policy is acceptable for video-editor commits and is sufficient to stop the interior-boundary drift without reworking applyEdit() or materializeData().","PinnedShotImageClipSnapshot may gain explicit timing data because it is editor-owned pinned-group metadata, not an external public contract.","Unrelated repo-wide TypeScript or test failures remain out of scope; acceptance is limited to regressions introduced in src/tools/video-editor.","No production code outside src/tools/video-editor depends on the five deprecated shim exports or on PinnedShotGroup.start / PinnedShotGroup.children."]}
You are revising an implementation plan after critique and gate feedback.
Finish the projection-model rollback that a previous megaplan started but only got ~60% done. Currently the data shape is soft-tag (pinnedShotGroups[i] = { shotId, trackId, clipIds }) but several production code paths still operate on the legacy projection-model fields (start, children, offset, duration) behind compatibility shims that are silently lossy. The result: every interaction with a shot group goes through a hybrid where live preview uses soft-tag overrides but commit goes through legacy materialize paths, causing rounding drift, position jumps, stuck preview frames after release, and pointer-capture-loss races.
This is a NARROW, SCOPED finish-the-job megaplan, not a re-architecture. We know exactly what's left.
State of partial completion:
DONE (don't touch unless broken):
PinnedShotGroup type is soft-tag in src/tools/video-editor/types/index.ts (with deprecated start? and children? legacy compat fields that should be DELETED at the end of this refactor)
pinned-group-projection.ts collapsed to ~280 lines: findEnclosingPinnedGroup, categorizeSelection, orderClipIdsByAt (real) + buildGroupFromChildren, buildGroupFromConfigClips, replaceGroupChildren, moveGroup, projectPinnedShotGroups (deprecated compatibility shims that should be DELETED at the end of this refactor)
useClipDrag.ts rewritten for soft-tag model: uses enclosingGroup.group.clipIds, computes group bounds from live actions, uses orderClipIdsByAt to re-derive clip order after drags
useClipResize.ts rewritten with resolveGroupMembers, getInteriorNeighbor, computeClipResizeMetaPatch, applyActionBounds helpers — interior-boundary commit branch is in place but routes through applyEdit({type: 'rows'}) which goes through the lossy materializeData path
useShotGroups.ts rewritten to derive children/start from live row actions
interaction-state.ts shared interaction lib created with createInteractionState, isInteractionActive, onInteractionEnd, notifyInteractionEndIfIdle
useTimelinePersistence.ts save scheduler IS gated on interactionStateRef and flushes on gesture end
usePollSync.ts poll-acceptance gate IS gated on interactionStateRef and re-evaluates on gesture end
interactionStateRef is plumbed through VideoEditorProvider data context
TimelineCanvas resize session model collapsed to one discriminated union: 'clip' | 'group-child-boundary' | 'group-edge' with one handleResizePointerDown, updateResize, endResize, handleResizePointerMove
NOT DONE (this megaplan):
useClipResize.ts interior-boundary commit drift. The interior commit calls applyEdit({type: 'rows', rows: nextRows, metaUpdates}). applyEdit for 'rows' mutations routes through materializeData -> rowsToConfig -> assembleTimelineData -> configToRows. rowsToConfig rounds clip positions to 2 decimal places (0.01s precision) and serializes hold clips as (at, hold) rounded INDEPENDENTLY, which means derived_end != round(actual_end) and tiny gaps can open between adjacent clips after every commit. Fix by increasing rowsToConfig rounding precision to at least 4 decimal places, OR better, make hold clip at/end serialization consistent.
usePinnedGroupSync rewrite for soft-tag model in src/tools/video-editor/hooks/usePinnedShotGroups.ts. Currently iterates projection-model children/offset/duration arrays. Rewrite to watch underlying Shot.images[] for added/removed/reordered generation_ids and rebuild clipIds accordingly, deferring during interaction.
useSwitchToFinalVideo.ts rewrite for soft-tag model. Currently builds projection-shape nextChildren arrays and passes to buildGroupFromChildren/replaceGroupChildren shims. Rewrite to compute the final-video clip's at/hold directly, update pinnedShotGroups[i].clipIds to [finalVideoClipId], save image clip positions in imageClipSnapshot. Restore reads imageClipSnapshot and restores row actions with updated clipIds.
useExternalDrop.ts rewrite for soft-tag shot drop. Compute clip positions directly when adding row actions, create soft-tag group with clipIds.
useTimelineTrackManagement.ts moveGroup callsites. Currently uses moveGroup shim which only updates trackId. Rewrite three callsites to also re-derive each clip's row assignment in meta.
Migration in migrate.ts repairConfig. Add one-way migration: when loading a saved config with projection-shape groups, convert to soft-tag by extracting clipIds = children.map((c) => c.clipId) and dropping start/children. Add unit test.
Delete deprecated compatibility shims from pinned-group-projection.ts: buildGroupFromChildren, buildGroupFromConfigClips, replaceGroupChildren, moveGroup, projectPinnedShotGroups. Also delete from PinnedShotGroup type: deprecated start? and children? fields. Verify type-check clean.
Update or delete the 14 failing tests in: serialize.test.ts (1), timeline-save-utils.test.ts (3), useClipDrag.test.tsx (3), useClipEditing.test.ts (6), useShotGroups.test.ts (1). Rewrite to test soft-tag model or delete if invariant no longer makes sense.
Two user-reported symptoms must be fixed: boundary jumps closer to adjacent clip / cuts into other side; doesn't release frames after release.
All listed flows must continue to work end-to-end (drag clip in group, drag edges, interior boundary, cross-track, switch to final video, switch to images, gallery drop, auto-save defer, poll-sync defer, projection-shape load migration, shot label menu, per-clip context menu lockdown).
tsc --noEmit clean for video-editor tree.
All video-editor tests pass.
The 5 deprecated shims and 2 legacy fields physically deleted.
No diagnostic console.logs left.
Constraints: scope is video-editor tool only. Follow CLAUDE.md. Prefer Edit over Write. Don't bundle unrelated cleanups. Pre-existing failing tests and TS errors in unrelated files left alone. Don't introduce new state management libraries.
Success criteria:
Two user-reported symptoms no longer reproduce.
tsc --noEmit clean for video-editor tree.
All video-editor tests pass.
Deprecated shims and legacy PinnedShotGroup fields deleted.
No diagnostic console.logs left.
Loading saved file with projection-shape pinnedShotGroups works (migration test passes).
Code line count for shot-group-related files decreases net.
code
Current plan (markdown):
# Implementation Plan: Video-Editor Soft-Tag Rollback Finish
Overview
This is a narrow finish-the-job refactor inside src/tools/video-editor, not a redesign. The repository already moved the core model to soft-tag PinnedShotGroup.clipIds, but the remaining drift comes from two residual patterns still visible in the codebase: rows -> config commits still round clip timing too coarsely in timeline-data.ts, and several production/test callsites still build or expect legacy start/children projection shape through the compatibility layer in pinned-group-projection.ts.
The simplest fix is to keep the existing editor state flow and finish the rollback at the remaining boundaries: make row materialization numerically stable, rewrite the last legacy callers to operate on clipIds plus live row actions, then physically delete the shims and legacy fields. megaplan init could not be used end-to-end here because the sandbox is read-only and blocks creation of .megaplan/, so this is a repo-backed manual plan following the same standard-robustness workflow.
Phase 1: Stabilize Canonical Data And Commit Math
Step 1: Fix interior-boundary commit drift in row materialization
Scope: Small
Update timeline-data.ts so rowsToConfig() no longer serializes grouped edits at 0.01s precision.
Use one shared 4-decimal rounding path for at, hold, from, and to, and compute hold-clip duration from one rounded start/end pair so roundedStart + roundedHold == roundedEnd for boundary commits.
Add a focused regression around repeated interior-boundary commits in useClipResize.test.tsx or render-bounds.validation.test.ts to prove adjacent clips do not open gaps, jump inward, or cut across the shared boundary after commit.
Step 2: Make the type/migration layer fully soft-tag
Scope: Small
Remove start? and children? from types/index.ts.
Expand PinnedShotImageClipSnapshot in the same file only as needed to support image restore without legacy projection fields, most likely by storing timing/position data explicitly instead of reconstructing it from start/children.
Keep migrate.ts as the single backward-compat path: detect raw legacy group objects on load, derive clipIds from children, preserve mode/video snapshot metadata, and drop legacy keys.
Tighten migrate.test.ts and serialize.test.ts so they assert legacy fields are stripped and never re-emitted.
Phase 2: Rewrite The Remaining Production Callers
Step 3: Rewrite pinned-group sync and mutation helpers around clipIds
Scope: Medium
In usePinnedShotGroups.ts, replace buildGroupFromConfigClips, buildGroupFromChildren, and replaceGroupChildren usage with direct soft-tag group construction using orderClipIdsByAt() plus live row data.
Simplify local cloning/update helpers in that file so they only copy clipIds, mode, videoAssetKey, and imageClipSnapshot.
Rewrite usePinnedGroupSync() to diff Shot.images[] generation order against the current group’s live clipIds, reuse matching clips by generation id, add/remove actions directly, rebuild ordered clipIds, and continue deferring work while interactionState is active.
Keep the current debounce/interaction gating behavior intact so autosave and poll-sync still wait until gesture end.
Step 4: Rewrite final-video/image switching to snapshot live clip state directly
Scope: Medium
In useSwitchToFinalVideo.ts, remove updatePinnedGroupWithChildren() and any dependency on projection-shaped nextChildren.
On switchToFinalVideo, snapshot each image clip’s asset/meta plus its live timing/position into imageClipSnapshot, create the final-video clip with direct at/duration data, and set the group to clipIds: [videoClipId].
On switchToImages, restore row actions and meta from imageClipSnapshot, rebuild the ordered clipIds, and commit through one soft-tag rows mutation with pinnedShotGroupsOverride.
Add or update coverage in useClipEditing.test.ts for both directions.
Step 5: Rewrite shot drop and grouped cross-track commit paths
Scope: Medium
In useExternalDrop.ts, keep direct row insertion via buildAssetDropEdit(), but create the shot group as a soft-tag entry with ordered clipIds instead of start/children.
In useTimelineTrackManagement.ts, replace all three moveGroup() callsites with atomic grouped commits that update rows, per-clip track meta, clip order, and the group’s trackId/clipIds together.
Reuse the existing translateGroupMembers() helper there as the main replacement path so release-state matches the live preview and the “stuck preview frames after release” symptom is fixed at the actual commit boundary.
Update useTimelineTrackManagement.test.ts and useExternalDrop.test.tsx to assert real row/meta commits instead of shim-only group rewrites.
Phase 3: Delete Compatibility Code And Realign Tests
Step 6: Remove the deprecated compatibility layer
Scope: Small
Delete buildGroupFromChildren, buildGroupFromConfigClips, replaceGroupChildren, moveGroup, and projectPinnedShotGroups from pinned-group-projection.ts, leaving only soft-tag helpers such as findEnclosingPinnedGroup(), categorizeSelection(), and orderClipIdsByAt().
Remove all remaining imports/usages of those helpers across production code and tests.
Re-run a repo grep for start, children, and the deleted exports inside src/tools/video-editor to verify the rollback is physically complete.
Step 7: Rewrite the listed failing tests to assert soft-tag behavior
Scope: Medium
serialize.test.ts: replace shim-built groups with direct soft-tag fixtures and keep load-time migration assertions for legacy input.
timeline-save-utils.test.ts: stop expecting resolved-config projection from group metadata; assert repaired config shape, stable signatures, and live rows derived from actual clip timing.
useClipDrag.test.tsx, useClipEditing.test.ts, and useShotGroups.test.ts: replace buildGroupFromChildren()/projectPinnedShotGroups() factories with direct soft-tag fixtures and assert derived children/start come from live row actions.
Add targeted regression coverage for the two user symptoms: repeated interior-boundary commits stay stable, and grouped release commits leave preview and committed state aligned.
Step 8: Remove diagnostics and verify in cheap-to-broad order
Scope: Small
Audit src/tools/video-editor for diagnostic console.log calls with the requested tags; if any survive in touched files, delete them.
Validate in this order once implementation is complete:
grouped-flow hook suites for pinned sync, final-video switching, external drop, and track management
the full src/tools/video-editor/** Vitest sweep
the accepted tsc --noEmit command for the video-editor tree
Finish with rg checks proving there are no remaining legacy-field or shim references in src/tools/video-editor.
Execution Order
Fix canonical serialization and migration first so every later hook writes the same stable shape.
Migrate runtime callers before deleting the compatibility exports.
Update tests in the same slices as the code changes, then remove the final helper references.
End with broad validation, shim-reference greps, and diagnostic-log audit.
Validation Order
Start with focused serialization/migration/resize regressions.
Then verify grouped runtime flows: sync, drop, track move, and final-video/image switching.
Then run the full video-editor test sweep.
End with the scoped TypeScript check and grep-based cleanup verification.
code
Current plan metadata:
{
"version": 1,
"timestamp": "2026-04-08T14:34:32Z",
"hash": "sha256:adf53c6dbed47262b437035b6a295162bfeb91dabf7e84314103c7bdc9f4017b",
"questions": [
"What exact acceptance commands should count for tsc --noEmit clean for video-editor tree and all video-editor tests pass in CI? I assumed a scoped vitest run over src/tools/video-editor/** plus a TypeScript command that only blocks on video-editor errors.",
"For imageClipSnapshot, do you want restore timing stored as absolute clip bounds (at/end) or as group-relative offsets/durations? The plan assumes adding explicit timing data is allowed, but that choice changes the type shape and tests.",
"If any saved fixtures outside repairConfig tests still contain projection-shaped pinnedShotGroups, should they be migrated in place during this refactor, or is load-time repair the only backward-compat path we need to keep?"
],
"success_criteria": [
{
"criterion": "rowsToConfig() commits preserve grouped clip adjacency across repeated interior-boundary resizes, with regression coverage proving no gap/overlap drift and no boundary jump into the neighboring clip.",
"priority": "must"
},
{
"criterion": "repairConfig() converts legacy projection-shaped pinnedShotGroups into soft-tag groups with clipIds only, and migration coverage passes.",
"priority": "must"
},
{
"criterion": "Grouped cross-track moves, final-video switching, image restore, and shot drops commit through soft-tag row/meta/clip-order/group overrides rather than legacy shim-only updates, and the affected hook tests pass.",
"priority": "must"
},
{
"criterion": "The accepted video-editor TypeScript check passes with no in-scope errors.",
"priority": "must"
},
{
"criterion": "The accepted video-editor Vitest sweep passes.",
"priority": "must"
},
{
"criterion": "PinnedShotGroup.start, PinnedShotGroup.children, and the five deprecated shim exports are physically deleted with no remaining imports/usages in src/tools/video-editor.",
"priority": "must"
},
{
"criterion": "No diagnostic console.log calls remain for [handleResizePointerDown], [outer-edge lookup], [GroupEdgeResize], [startGroupEdgeResize], [useClipDrag], or [Marquee].",
"priority": "must"
},
{
"criterion": "Shot-group-related files end with a net lower line count after compatibility code is removed.",
"priority": "should"
},
{
"criterion": "Manual smoke of the reported symptoms and the listed end-to-end flows confirms boundary releases are stable and preview frames clear correctly after release.",
"priority": "info"
}
],
"assumptions": [
"The existing translateGroupMembers() helper in is the intended replacement for the three callsites, and extending it is preferable to adding new state flow.",
"A shared -decimal canonical rounding policy is acceptable for video-editor commits and is sufficient to stop the interior-boundary drift without reworking or .",
" may gain explicit timing data because it is editor-owned pinned-group metadata, not an external public contract.",
"Unrelated repo-wide TypeScript or test failures remain out of scope; acceptance is limited to regressions introduced in .",
"No production code outside depends on the five deprecated shim exports or on / ."
],
"structure_warnings": []
}
code
Gate summary:
{
"recommendation": "ITERATE",
"rationale": "Light robustness: single revision pass to incorporate critique feedback.",
"signals_assessment": "",
"warnings": [],
"settled_decisions": []
}
code
Open significant flags:
[
{
"id": "FLAG-001",
"severity": "significant",
"status": "open",
"concern": "Pointer capture cleanup: the plan never touches TimelineCanvas's resize teardown, but the current resize handles only end sessions on pointer up/cancel. There is no lost-pointer-capture fallback, so the reported 'doesn't release frames after release' symptom can still persist if capture is dropped mid-resize.",
"evidence": "src/tools/video-editor/components/TimelineEditor/TimelineCanvas.tsx:365-379 wires only onPointerDown/onPointerMove/onPointerUp/onPointerCancel on the resize handles, and src/tools/video-editor/components/TimelineEditor/TimelineCanvas.tsx:783-841 clears resizeOverrides only from endResize(). No onLostPointerCapture handler exists in the file."
},
{
"id": "FLAG-002",
"severity": "significant",
"status": "open",
"concern": "Typecheck scope: the plan treats 'tsc --noEmit clean for video-editor tree' as an acceptance gate, but this repository does not define a video-editor-only TypeScript project or script. Without first specifying how to scope or filter TypeScript errors, that success criterion is not executable against the actual repo.",
"evidence": "package.json defines build/test scripts but no video-editor-specific typecheck target, and tsconfig.json only references tsconfig.app.json and tsconfig.node.json. The plan metadata itself still asks 'What exact acceptance commands should count...?', which means the gate is unresolved."
}
]
code
Requirements:
- Before addressing individual flags, check: does any flag suggest the plan is targeting the wrong code or the wrong root cause? If so, consider whether the plan needs a new approach rather than adjustments. Explain your reasoning.
- Update the plan to address the significant issues.
- Keep the plan readable and executable.
- Return flags_addressed with the exact flag IDs you addressed.
- Preserve or improve success criteria quality. Each criterion must have a `priority` of `must`, `should`, or `info`. Promote or demote priorities if critique feedback reveals a criterion was over- or under-weighted.
- Verify that the plan remains aligned with the user's original intent, not just internal plan quality.
- Remove unjustified scope growth. If critique raised scope creep, narrow the plan back to the original idea unless the broader work is strictly required.
- Maintain the structural template: H1 title, ## Overview, phase sections with numbered step sections, ## Execution Order or ## Validation Order.
Plan template — simple format (adapt to the actual repo and scope):
md
# Implementation Plan: [Title]
## Overview
Summarize the goal, current repository shape, and the constraints that matter.
## Main Phase
### Step 1: Audit the current behavior (`megaplan/prompts.py`)
**Scope:** Small
1. **Inspect** the current implementation and call out the exact insertion points (`megaplan/prompts.py:29`).
### Step 2: Add the first change (`megaplan/evaluation.py`)
**Scope:** Medium
1. **Implement** the smallest viable change with exact file references (`megaplan/evaluation.py:1`).
2. **Capture** any tricky behavior with a short example.
```python
issues = validate_plan_structure(plan_text)
```
### Step 3: Wire downstream behavior (`megaplan/handlers.py`, `megaplan/workers.py`)
**Scope:** Medium
1. **Update** the runtime flow in the touched files (`megaplan/handlers.py:400`, `megaplan/workers.py:199`).
### Step 4: Prove the change (`tests/test_evaluation.py`, `tests/test_megaplan.py`)
**Scope:** Small
1. **Run** the cheapest targeted checks first (`tests/test_evaluation.py:1`).
2. **Finish** with broader verification once the wiring is in place (`tests/test_megaplan.py:1`).
## Execution Order
1. Update prompts and mocks before enforcing stricter validation.
2. Land higher-risk wiring after the validator and tests are ready.
## Validation Order
1. Start with focused unit tests.
2. Run the broader suite after the flow changes are in place.
For complex plans, use multiple phases:
md
## Phase 1: Foundation — Dependencies, DB, Types
### Step 1: Install dependencies (`package.json`)
...
### Step 2: Create database migration (`supabase/migrations/`)
...
## Phase 2: Core Integration
### Step 3: Port the main component (`src/components/`)
...
Template guidance:
Simple plans: use ## Main Phase with ### Step N: sections underneath.
Complex plans: use multiple ## Phase N: sections, each containing ### Step N: steps. Step numbers are global (not per-phase).
The flat ## Step N: format (without phases) also works for backwards compatibility.
Key invariants: one H1 title, one ## Overview, numbered step sections (### Step N: or ## Step N:), and at least one ordering section.
{"flags_addressed":["FLAG-001","FLAG-002"],"plan":"# Implementation Plan: Video-Editor Soft-Tag Rollback Finish\n\n## Overview\nThe critique does not change the main diagnosis or the overall approach. The core problem is still the hybrid soft-tag/legacy commit path inside src/tools/video-editor: live interactions already read clipIds, but several commit paths still rebuild or expect projection-shape group data and push edits back through lossy compatibility code. That remains the right root cause to target.\n\nTwo adjustments are required. First, the reported “doesn’t release frames after release” symptom is not only a data-shape issue: TimelineCanvas.tsx is missing a lost-pointer-capture teardown path for resize sessions, so resize preview state can survive when pointer capture drops unexpectedly. Second, the repo has no video-editor-specific TypeScript project, so the plan must define a concrete scoped typecheck gate using the existing tsconfig.app.json rather than leaving that acceptance criterion unresolved.\n\nThe revised plan keeps the rollback narrow: fix stable serialization, finish the remaining soft-tag rewrites, add the missing resize teardown fallback in TimelineCanvas, delete the deprecated shims/fields, and validate with repo-realistic scoped commands.\n\n## Phase 1: Stabilize Canonical Data And Migration\n\n### Step 1: Fix interior-boundary commit drift in row materialization\nScope: Small\n1. Update timeline-data.ts so rowsToConfig() no longer serializes grouped edits at 0.01s precision.\n2. Use one shared 4-decimal rounding path for at, hold, from, and to, and compute hold-clip duration from one rounded start/end pair so roundedStart + roundedHold == roundedEnd on commit.\n3. Add a focused regression in useClipResize.test.tsx or render-bounds.validation.test.ts that repeats interior-boundary commits and proves adjacent clips do not drift apart, jump inward, or overlap.\n\n### Step 2: Make the type and migration layer fully soft-tag\nScope: Small\n1. Remove start? and children? from types/index.ts.\n2. Expand PinnedShotImageClipSnapshot only as needed to restore image clips without legacy projection fields, storing explicit timing data instead of reconstructing from start/children.\n3. Keep migrate.ts as the single backward-compat path: detect raw legacy group objects on load, derive clipIds from children, preserve mode/video snapshot metadata, and drop legacy keys.\n4. Tighten migrate.test.ts and serialize.test.ts so they assert legacy fields are stripped and never re-emitted.\n\n## Phase 2: Finish The Remaining Runtime Callers\n\n### Step 3: Rewrite pinned-group sync and mutation helpers around clipIds\nScope: Medium\n1. In usePinnedShotGroups.ts, replace buildGroupFromConfigClips, buildGroupFromChildren, and replaceGroupChildren usage with direct soft-tag group construction using orderClipIdsByAt() plus live row data.\n2. Simplify local clone/update helpers there so they only copy clipIds, mode, videoAssetKey, and imageClipSnapshot.\n3. Rewrite usePinnedGroupSync() to diff Shot.images[] generation order against the current group’s live clipIds, reuse matching clips by generation id, add/remove actions directly, rebuild ordered clipIds, and continue deferring while interaction state is active.\n4. Keep the existing debounce and interaction gating so auto-save and poll-sync still defer until gesture end.\n\n### Step 4: Harden resize teardown against lost pointer capture\nScope: Small\n1. In TimelineCanvas.tsx, extract the resize-session cleanup in endResize() so pointer-up, pointer-cancel, and lost-pointer-capture all clear the same refs and preview overrides.\n2. Wire onLostPointerCapture on clip resize handles and group-edge resize handles so an active resize session always clears resizeSessionRef, resizeOverrides, pendingOpsRef, and interactionStateRef.current.resize even when capture drops unexpectedly.\n3. Keep this fix narrow to teardown semantics; do not introduce a new interaction model.\n4. Add regression coverage in TimelineCanvas.test.tsx proving lost pointer capture releases preview state and pending interaction bookkeeping.\n\n### Step 5: Rewrite final-video and image restore flows around live clip snapshots\nScope: Medium\n1. In useSwitchToFinalVideo.ts, remove updatePinnedGroupWithChildren() and any dependency on projection-shaped nextChildren.\n2. On switchToFinalVideo, snapshot each image clip’s asset/meta plus live timing into imageClipSnapshot, create the final-video clip with direct at/duration data, and set the group to clipIds: [videoClipId].\n3. On switchToImages, restore row actions and meta from imageClipSnapshot, rebuild ordered clipIds, and commit through one soft-tag rows mutation with pinnedShotGroupsOverride.\n4. Extend useClipEditing.test.ts for both directions.\n\n### Step 6: Rewrite shot drop and grouped cross-track commit paths\nScope: Medium\n1. In useExternalDrop.ts, keep direct row insertion via buildAssetDropEdit(), but create the shot group as a soft-tag entry with ordered clipIds instead of start/children.\n2. In useTimelineTrackManagement.ts, replace all three moveGroup() callsites with atomic grouped commits that update rows, per-clip track meta, clip order, and the group’s trackId/clipIds together.\n3. Reuse the existing translateGroupMembers() helper there as the main replacement path so grouped release-state matches the live preview and the “stuck preview frames after release” symptom is fixed at the actual commit boundary.\n4. Update useTimelineTrackManagement.test.ts and useExternalDrop.test.tsx to assert real row/meta commits instead of shim-only group rewrites.\n\n## Phase 3: Delete Compatibility Code And Re-Align Tests\n\n### Step 7: Remove the deprecated compatibility layer\nScope: Small\n1. Delete buildGroupFromChildren, buildGroupFromConfigClips, replaceGroupChildren, moveGroup, and projectPinnedShotGroups from pinned-group-projection.ts, leaving only soft-tag helpers such as findEnclosingPinnedGroup(), categorizeSelection(), and orderClipIdsByAt().\n2. Remove all remaining imports/usages of those helpers across production code and tests.\n3. Re-run a repo grep for start, children, and the deleted exports inside src/tools/video-editor to verify the rollback is physically complete.\n\n### Step 8: Rewrite the listed failing tests to assert soft-tag behavior\nScope: Medium\n1. serialize.test.ts: replace shim-built groups with direct soft-tag fixtures and keep load-time migration assertions for legacy input.\n2. timeline-save-utils.test.ts: stop expecting resolved-config projection from group metadata; assert repaired config shape, stable signatures, and live rows derived from actual clip timing.\n3. useClipDrag.test.tsx, useClipEditing.test.ts, and useShotGroups.test.ts: replace buildGroupFromChildren()/projectPinnedShotGroups() factories with direct soft-tag fixtures and assert derived children/start come from live row actions.\n4. Add targeted regressions for the two user symptoms: repeated interior-boundary commits stay stable, and resize release always clears preview state even when pointer capture is lost.\n\n### Step 9: Remove diagnostics and verify with repo-realistic scoped gates\nScope: Small\n1. Audit src/tools/video-editor for diagnostic console.log calls with the requested tags; if any survive in touched files, delete them.\n2. Validate in cheap-to-broad order:\n 1. migrate.test.ts, serialize.test.ts, timeline-save-utils.test.ts, useClipResize.test.tsx, TimelineCanvas.test.tsx\n 2. grouped-flow hook suites for pinned sync, final-video switching, external drop, drag, and track management\n 3. the full src/tools/video-editor/** Vitest sweep\n 4. npx tsc -p tsconfig.app.json --noEmit --pretty false, treating the gate as: zero diagnostics whose file path is under src/tools/video-editor/\n3. Finish with rg checks proving there are no remaining legacy-field, shim, or requested diagnostic-log references in src/tools/video-editor.\n\n## Execution Order\n1. Fix canonical serialization and migration first so every later hook writes the same stable shape.\n2. Land the TimelineCanvas lost-pointer-capture teardown before broader grouped-flow rewrites so resize cleanup is no longer a false negative in later testing.\n3. Migrate the remaining runtime callers before deleting the compatibility exports.\n4. Update failing tests in the same slices as the code changes, then remove the final helper references.\n5. End with broad validation, scoped TypeScript diagnostics, shim-reference greps, and diagnostic-log audit.\n\n## Validation Order\n1. Start with focused serialization, migration, resize, and TimelineCanvas teardown regressions.\n2. Then verify grouped runtime flows: sync, drop, track move, drag, and final-video/image switching.\n3. Then run the full video-editor test sweep.\n4. End with the scoped TypeScript diagnostic check and grep-based cleanup verification.","questions":["For lost pointer capture during resize, should the fallback semantics be cancel-and-cleanup or commit-the-latest-preview? The plan assumes cancel-and-cleanup is safer unless current UX explicitly expects commit on capture loss.","For imageClipSnapshot, do you want restore timing stored as absolute clip bounds (at plus duration/end) or as group-relative offsets/durations? The plan assumes adding explicit timing data is allowed, but that choice still affects the snapshot type and tests.","If any saved fixtures outside repairConfig tests still contain projection-shaped pinnedShotGroups, should they be migrated in place during this refactor, or is load-time repair the only backward-compat path we need to keep?"],"success_criteria":[{"criterion":"rowsToConfig() commits preserve grouped clip adjacency across repeated interior-boundary resizes, with regression coverage proving no gap/overlap drift and no boundary jump into the neighboring clip.","priority":"must"},{"criterion":"Resize sessions in TimelineCanvas always clear preview overrides and interaction bookkeeping on pointerup, pointercancel, and lostpointercapture, with regression coverage proving no stuck preview state after release.","priority":"must"},{"criterion":"repairConfig() converts legacy projection-shaped pinnedShotGroups into soft-tag groups with clipIds only, and migration coverage passes.","priority":"must"},{"criterion":"Grouped cross-track moves, final-video switching, image restore, and shot drops commit through soft-tag row/meta/clip-order/group overrides rather than legacy shim-only updates, and the affected hook tests pass.","priority":"must"},{"criterion":"Running npx tsc -p tsconfig.app.json --noEmit --pretty false produces zero diagnostics whose file path is under src/tools/video-editor/.","priority":"must"},{"criterion":"The accepted video-editor Vitest sweep passes.","priority":"must"},{"criterion":"PinnedShotGroup.start, PinnedShotGroup.children, and the five deprecated shim exports are physically deleted with no remaining imports/usages in src/tools/video-editor.","priority":"must"},{"criterion":"No diagnostic console.log calls remain for [handleResizePointerDown], [outer-edge lookup], [GroupEdgeResize], [startGroupEdgeResize], [useClipDrag], or [Marquee].","priority":"must"},{"criterion":"Shot-group-related files end with a net lower line count after compatibility code is removed.","priority":"should"},{"criterion":"Manual smoke of the reported symptoms and the listed end-to-end flows confirms boundary releases are stable and preview frames clear correctly after release.","priority":"info"}],"assumptions":["The critique did not invalidate the rollback target: the main work is still deleting the remaining legacy projection-model commit paths, with TimelineCanvas lost-pointer-capture cleanup added as one necessary symptom fix.","The existing translateGroupMembers() helper in useTimelineTrackManagement.ts is the intended replacement for the three moveGroup() callsites, and extending it is preferable to adding new state flow.","A shared 4-decimal canonical rounding policy is acceptable for video-editor commits and is sufficient to stop the interior-boundary drift without reworking applyEdit() or materializeData().","PinnedShotImageClipSnapshot may gain explicit timing data because it is editor-owned pinned-group metadata, not an external public contract.","The TypeScript acceptance gate will use tsconfig.app.json and treat only diagnostics under src/tools/video-editor/ as blocking, since the repo has no video-editor-specific tsconfig or script.","Unrelated repo-wide TypeScript or test failures remain out of scope; acceptance is limited to regressions introduced in src/tools/video-editor.","No production code outside src/tools/video-editor depends on the five deprecated shim exports or on PinnedShotGroup.start / PinnedShotGroup.children."]}