Phase 2 cleanup from the activePairData fix: now that activePairData is derived from pairDataByIndex via useMemo (no more useState snapshot), the PairData objects constructed at event boundaries are redundant — the consumer ignores passedPairData. Clean up: (1) Simplify onPairClick signature from (pairIndex: number, pairData: PairData) to (pairIndex: number) across all ~25 files that thread it. (2) Remove inline PairData construction in PairRegionsLayer (lines 131-151), PairRegion (lines 137-154), TrailingEndpointLayer (lines 89-103), ImageGrid (lines 445-461). (3) Simplify usePairSettingsHandler — it no longer needs to construct PairData or merge frame data, just forward the index. (4) Remove now-unused props from these components (images, imagePositions, etc. that were only needed for PairData construction — verify each is truly unused before removing). This is mechanical signature cleanup with zero behavioral change.
code
Plan:
# Implementation Plan: Remove Redundant PairData from onPairClick Signature
Overview
After the Phase 1 activePairData fix, the consumer (handlePairClick in useSegmentSlotMode.ts:110) ignores the pairData parameter entirely — it only uses pairIndex to call setSegmentSlotLightboxIndex(pairIndex). The activePairData is now derived from pairDataByIndex via useMemo, making all inline PairData construction at call sites dead code.
This cleanup simplifies onPairClick from (pairIndex: number, pairData: PairData) => void to (pairIndex: number) => void across ~25 files, removes ~100 lines of inline PairData construction, and simplifies usePairSettingsHandler from a complex PairData-building hook to a simple index-forwarding wrapper.
Key constraint: Zero behavioral change. The consumer already ignores pairData.
UpdateuseSegmentSlotMode.ts:110 — remove the _passedPairData?: PairData parameter and unused PairData import.
UpdateuseLightboxContextData.ts:20 — change onPairClick from (pairIndex: number, pairData?: PairData) => void to (pairIndex: number) => void, remove PairData import.
UpdateuseAdjacentSegmentsData.ts:9 — the hook already types it as (pairIndex: number) => void, no change needed. Verify.
Step 2: Run TypeScript to find all downstream breakage
Scope: Small
Runnpx tsc --noEmit from reigh-app/ to get the full list of type errors. This will surface every file that still passes PairData — use this as the definitive worklist rather than relying on the brief's file list.
Phase 2: Remove PairData Construction at Call Sites
Update the PairRegionsLayerProps interface (line 31) to use (pairIndex: number) => void.
Check whether images prop is still needed after removing PairData construction. It IS still used at lines 110-111 for startImage/endImage lookups used in enhancedPrompt extraction (line 115) and numPairs (line 128). Do not remove images prop.
Check whether imagePositionsWithPending is still needed — it IS used at line 73 for sortedDynamicPositions (pixel calculations). Do not remove.
Simplify onTouchEnd handler (lines 146-155): same change.
Remove PairData import if no longer used.
Check whether startFrame, endFrame, actualFrames props are still needed — they are used for display (framesToSeconds at line 158), NOT just for PairData. Do not remove.
Check whether images prop is still needed — it IS used at line 56 (isMultiImage) and line 67-70 (finding lastImage for... wait, lastImage is only used in the PairData construction). Re-check: lastImage is used in the onPairClick && lastImage guard (line 89). After simplification, we only need onPairClick in the guard. But lastImage was gating "only click if there's a valid image" — this guard can be simplified to just onPairClick since the consumer doesn't use the image data anymore.
Checkimages usage: line 56 (images.length > 1 for isMultiImage), line 67-70 (finding lastImage). After removing the PairData construction, lastImage is only used in the guard on line 89. We can simplify the guard to just onPairClick and remove the lastImage lookup (lines 67-70). But images is still needed for isMultiImage (line 56). Keep images prop.
RemoveimagePositions and sortedEntries IF they're only used for PairData construction. Check: imagePositions → sortedEntries (line 44) → used at lines 46, 50, 55, 66, 72. Lines 46/50/55 are for getting lastEntry → [id, imageFrame] which feeds into effectiveEndFrame, gapToImage, trailingPairIndex. These are all still needed for the TrailingEndpoint rendering (frame position, gap). Keep imagePositions prop.
UpdateImageGridPromptModel interface (line 61) to (pairIndex: number) => void.
Replace trailing indicator PairData construction (lines 445-461) with:
typescript
onClick={() => onPairClick(0)}
Remove PairData import if no longer used elsewhere in the file.
Verify the existing non-PairData call sites (lines 339-340, 416-417) already only pass the index — they do (onPairClick(index - 1) and onPairClick(index)), so no change needed there.
UpdateonPairClick type in MobileImageGrid's props (line 40 area). It likely already uses (pairIndex: number) => void since it never constructs PairData — verify.
Check all call sites: lines 164-165, 276-277 already call onPairClick?.(index) with just the index. Confirm no PairData is constructed.
Change onPairClick to (pairIndex: number) => void (line 13)
Remove images, imagePositions, pairDataByIndex from the interface — they were only needed for PairData construction
Keep trailingEndFrame and pairInfo only if they're still needed. After simplification, handleOpenPairSettings just needs to call onPairClick(pairIndex). The three cases (single-image, trailing, regular) all collapse to the same thing: forward the index. So we can remove images, imagePositions, trailingEndFrame, pairInfo, pairDataByIndex.
For each: update the onPairClick prop type from (pairIndex: number, pairData: PairData) => void to (pairIndex: number) => void and remove PairData imports where they become unused.
Phase 3: Tests
Step 11: Update test files
Scope: Medium
UpdatePairRegionsLayer.test.tsx:
Remove mock's PairData parameter (line 18)
Update mock click to just pass index (line 24)
Simplify assertion: onPairClick should be called with just (0) instead of (0, expect.objectContaining({...})) (lines 105-126)
UpdateTrailingEndpointLayer.test.tsx:
Simplify assertion: onPairClick should be called with just (1) instead of (1, expect.objectContaining({...})) (lines 103-119)
UpdateTimelineTrackContent.test.tsx (line 112) — adjust onPairClick mock type if needed.
Runnpx vitest run (or project-specific test command) — all tests must pass.
Grep for PairData in import statements across the changed files to confirm no orphaned imports remain.
Execution Order
Start with type definitions (Step 1) → run tsc (Step 2) to get the full worklist.
Work through call sites bottom-up: leaf components first (Steps 3-7), then hooks (Steps 8-9), then threading (Step 10).
Update tests last (Step 11) since they follow the component signatures.
Final verification (Step 12).
Validation Order
TypeScript compilation after each phase.
Test suite after all code changes.
Final grep for orphaned PairData imports.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-31T01:58:36Z",
"hash": "sha256:3079f47e5eab25d1db0cb70a5edf422ae37b49cc6928801d3bf6591f31f41bbb",
"questions": [
"usePairSettingsHandler currently receives passedFrameData from callers (e.g., PairRegion passes frame data on click). After this cleanup, handleOpenPairSettings becomes a trivial (pairIndex) => onPairClick(pairIndex) wrapper. Should we keep the wrapper for future extensibility, or inline the call and remove usePairSettingsHandler entirely? (Assumption: keep the hook as a thin wrapper since callers already import it and it provides a named abstraction.)",
"The brief mentions ~25 files. My audit found 25 source files + 4 test files. The PairData type itself (shared/types/pairData.ts) is used by usePairData.ts (which builds pairDataByIndex) and other systems. Should we leave the PairData type definition untouched since it's still used by the data layer? (Assumption: yes, only remove PairData from the onPairClick signature path, not from usePairData or the segment slot system.)"
],
"success_criteria": [
{
"criterion": "onPairClick signature is (pairIndex: number) => void in all type definitions and call sites",
"priority": "must"
},
{
"criterion": "No inline PairData construction remains in PairRegionsLayer, PairRegion, TrailingEndpointLayer, ImageGrid, or usePairSettingsHandler for the purpose of passing to onPairClick",
"priority": "must"
},
{
"criterion": "npx tsc --noEmit passes with zero errors",
"priority": "must"
},
{
"criterion": "All existing tests pass (updated to match new signatures)",
"priority": "must"
},
{
"criterion": "Zero behavioral change \u2014 clicking any pair indicator still opens the correct SegmentSettingsModal with the correct pair data (derived from pairDataByIndex, not from the click event)",
"priority": "must"
},
{
"criterion": "No orphaned PairData imports in files that no longer use the type",
"priority": "should"
},
{
"criterion": "usePairSettingsHandler simplified to remove images, imagePositions, pairDataByIndex, pairInfo props that were only needed for PairData construction",
"priority": "should"
},
{
"criterion": "Net line count reduction of ~80-120 lines across all changed files",
"priority": "info"
}
],
"assumptions": [
"The PairData type definition (shared/types/pairData.ts) stays untouched \u2014 it's still used by usePairData, useSegmentSlotPresentationAdapter, and the segment slot system.",
"usePairSettingsHandler is kept as a thin wrapper rather than fully removed, since multiple callers already import it and it provides a named abstraction point.",
"InlineSegmentVideo's onOpenPairSettings prop is already typed as (pairIndex: number) => void and needs no changes.",
"PairPromptIndicator's onPairClick prop is already typed as () => void (no parameters) and needs no changes \u2014 callers wrap the index.",
"The images prop on PairRegionsLayer and TrailingEndpointLayer is NOT removable \u2014 it's still used for non-PairData purposes (enhanced prompt extraction, isMultiImage check, etc.).",
"MobileImageGrid already only passes the index (no PairData), so changes there are limited to updating the type annotation."
],
"structure_warnings": []
}
code
Plan structure warnings from validator:
[]
Existing flags:
[]
Known accepted debt grouped by subsystem:
{
"are-the-proposed-changes-technically-correct": [
{
"id": "DEBT-007",
"concern": "are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs url and primaryvariantid, and the regenerate path reads exactly starturl, endurl, startgenid, endgenid, startvariantid, and endvariantid from segmentslotmode.pairdata in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. adding thumburl and generationid to the sync does not, by itself, explain why an old image url is still being used for regular pairs.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-008",
"concern": "are the proposed changes technically correct?: the fix is incomplete for extra trailing slots. handlepairclick can populate activepairdata from trailingpairdata when pairindex === pairdatabyindex.size in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only reads pairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot cases fresh is undefined, so no image refresh happens.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-018",
"concern": "are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omits id and position from change detection, and when fresh.startimage or fresh.endimage becomes null it preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads of prev.startimage / prev.endimage to be safe in strict typescript.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"are-the-success-criteria-well-prioritized-and-verifiable": [
{
"id": "DEBT-019",
"concern": "are the success criteria well-prioritized and verifiable?: the attached success criteria are stale and do not match the current plan body. they still require 'no usestate for activepairdata', 'setactivepairdata fully removed', 'sync effect deleted', and 'onpairclick simplified to (pairindex: number) => void', which are the opposite of the current targeted-sync plan. as presented, the criteria are not usable for review or execution.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"batch-generation-pipeline": [
{
"id": "DEBT-006",
"concern": "enhancement in usegeneratebatch before generatevideo() could compute prompts against a stale pair snapshot if mutations are still in flight.",
"occurrence_count": 1,
"plan_ids": [
"in-cloud-mode-when-users-20260330-2214"
]
}
],
"criteria-verifiability": [
{
"id": "DEBT-036",
"concern": "'no unsafe .maybesingle()' criterion requires judgment about column uniqueness.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-037",
"concern": "decision documentation location not specified.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
],
"did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements": [
{
"id": "DEBT-013",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the package is internally inconsistent. the plan body says to keep activepairdata in usestate and make phase 2 optional, but the attached metadata and success criteria still describe the previous derive-via-usememo / remove-setactivepairdata / simplify-onpairclick plan. that means the approved-plan requirements are only partially coherent as presented.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"does-the-change-touch-all-locations-and-supporting-infrastructure": [
{
"id": "DEBT-014",
"concern": "does the change touch all locations and supporting infrastructure?: phase 1 still misses a real supporting-data location: trailingpairdata lives outside pairdatabyindex in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotpresentationadapter.ts, but the proposed sync logic only considers pairdatabyindex. if trailing slot regenerate is part of the bug surface, that location is not covered.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"edge-test-config": [
{
"id": "DEBT-022",
"concern": "plan's vitest commands use the wrong config entry point.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-023",
"concern": "same as verification-3: wrong vitest config in validation commands.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-024",
"concern": "success criterion references wrong test command.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
],
"error-propagation-logging": [
{
"id": "DEBT-027",
"concern": "generation.ts and handler.ts logging endpoints are not directly tested.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
],
"error-propagation-testing": [
{
"id": "DEBT-020",
"concern": "no end-to-end regression test for the full symptom chain (db error \u2192 tocompletionerror metadata \u2192 handler log).",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-025",
"concern": "handler.ts metadata surfacing criterion lacks a concrete automated verifier.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-026",
"concern": "main issue only partially validated without an integration test.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
],
"is-the-change-in-the-right-place-and-would-it-break-any-callers": [
{
"id": "DEBT-015",
"concern": "is the change in the right place, and would it break any callers?: the optional cleanup steps are not in the right place yet. pairregionslayer does not receive pairdatabyindex today; its props are only images, imagepositionswithpending, pairinfowithpending, and callback/display props in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/timeline/timelinecontainer/components/pairregionslayer.tsx. so step 4's 'pass pairdatabyindex.get(pairindex) directly' would require new prop plumbing or a different seam.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"is-the-scope-and-scale-of-the-change-appropriate": [
{
"id": "DEBT-009",
"concern": "is the scope and scale of the change appropriate?: phase 2 is still under-specified for execution. step 4 says pairregionslayer should either pass pairdatabyindex.get(pairindex) directly or 'just pass the index + frame-only data', which are materially different designs. if phase 2 is kept in the plan, it needs a single concrete direction.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"is-there-convincing-verification-for-the-change": [
{
"id": "DEBT-010",
"concern": "is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check that usevideoregeneratemode now gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the fresh url, generationid, and primaryvariantid.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-011",
"concern": "is there convincing verification for the change?: the current usesegmentslotmode test remains only a smoke test in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/tests/usesegmentslotmode.test.ts, and the plan does not add behavior coverage for the new sync effect.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-012",
"concern": "is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently misses trailingpairdata refreshes.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"legacy-data-backfill": [
{
"id": "DEBT-004",
"concern": "the step 8 diagnostic query only detects cross-shot pair_shot_generation_id misassociations, not same-shot misassociations caused by timeline reordering within a shot.",
"occurrence_count": 1,
"plan_ids": [
"redesign-the-segment-position-20260330-1913"
]
}
],
"lookup-consistency": [
{
"id": "DEBT-029",
"concern": "other repo call sites use unordered .limit(1).maybesingle() and will remain inconsistent.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-033",
"concern": "other call sites with same unsafe pattern not covered.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
],
"media-lightbox-persistence": [
{
"id": "DEBT-002",
"concern": "variant switches do not clear/restore inpaintprompt, so stale prompt state can leak across variants with no cached prompt.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-prompt-text-reset-bug-20260330-1410"
]
},
{
"id": "DEBT-003",
"concern": "removing prompt/numgenerations from the variant-keyed localstorage cache means all variants within a generation share the same prompt. this broadens existing debt-002 (variant prompt leakage).",
"occurrence_count": 1,
"plan_ids": [
"consolidate-the-media-20260330-1449"
]
}
],
"media-lightbox-segment-slot": [
{
"id": "DEBT-016",
"concern": "media lightbox / segment slot: the targeted sync rationale does not fully explain the reported stale-url bug for regular pairs, and the proposed effect still misses trailing-slot refreshes because those can come from trailingpairdata rather than pairdatabyindex.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"plan-scope": [
{
"id": "DEBT-032",
"concern": "step 3 is larger than a light megaplan warrants.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
],
"planning-metadata": [
{
"id": "DEBT-017",
"concern": "planning metadata: the attached metadata and success criteria still describe a different implementation than the current plan body, which risks sending execution and review down the wrong path.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"position-key-semantics": [
{
"id": "DEBT-028",
"concern": "plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-030",
"concern": "plan weights toward child_order rather than pair_shot_generation_id as the key that matters.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-031",
"concern": "unique constraint on (parent_generation_id, child_order) not supported by repo semantics.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
],
"prompt-composition": [
{
"id": "DEBT-005",
"concern": "the plan's step 1 signature includes textbeforeprompts/textafterprompts parameters that would be applied before enhancement, double-wrapping the prompt.",
"occurrence_count": 1,
"plan_ids": [
"in-cloud-mode-when-users-20260330-2214"
]
}
],
"shot-linking-testing": [
{
"id": "DEBT-021",
"concern": "no test covers the linkgenerationtoshot error/catch branches.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
],
"test-coverage": [
{
"id": "DEBT-034",
"concern": "current generation-child.test.ts is only a smoke test.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-035",
"concern": "no plan to verify other lookup paths choose rows consistently.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
],
"timeline-scaling": [
{
"id": "DEBT-001",
"concern": "the plan only specifies a concrete fix for the default scale(1) case; explicit-scale tracks may still break blend-mode effects.",
"occurrence_count": 1,
"plan_ids": [
"investigate-why-custom-ai-20260330-0408"
]
}
]
}
code
Escalated debt subsystems:
[
{
"subsystem": "are-the-proposed-changes-technically-correct",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-007",
"concern": "are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs url and primaryvariantid, and the regenerate path reads exactly starturl, endurl, startgenid, endgenid, startvariantid, and endvariantid from segmentslotmode.pairdata in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. adding thumburl and generationid to the sync does not, by itself, explain why an old image url is still being used for regular pairs.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-008",
"concern": "are the proposed changes technically correct?: the fix is incomplete for extra trailing slots. handlepairclick can populate activepairdata from trailingpairdata when pairindex === pairdatabyindex.size in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only reads pairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot cases fresh is undefined, so no image refresh happens.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-018",
"concern": "are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omits id and position from change detection, and when fresh.startimage or fresh.endimage becomes null it preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads of prev.startimage / prev.endimage to be safe in strict typescript.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
]
},
{
"subsystem": "edge-test-config",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-022",
"concern": "plan's vitest commands use the wrong config entry point.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-023",
"concern": "same as verification-3: wrong vitest config in validation commands.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-024",
"concern": "success criterion references wrong test command.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
]
},
{
"subsystem": "error-propagation-testing",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-020",
"concern": "no end-to-end regression test for the full symptom chain (db error \u2192 tocompletionerror metadata \u2192 handler log).",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-025",
"concern": "handler.ts metadata surfacing criterion lacks a concrete automated verifier.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-026",
"concern": "main issue only partially validated without an integration test.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
]
},
{
"subsystem": "is-there-convincing-verification-for-the-change",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-010",
"concern": "is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check that usevideoregeneratemode now gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the fresh url, generationid, and primaryvariantid.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-011",
"concern": "is there convincing verification for the change?: the current usesegmentslotmode test remains only a smoke test in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/tests/usesegmentslotmode.test.ts, and the plan does not add behavior coverage for the new sync effect.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
},
{
"id": "DEBT-012",
"concern": "is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently misses trailingpairdata refreshes.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
]
},
{
"subsystem": "position-key-semantics",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-028",
"concern": "plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-030",
"concern": "plan weights toward child_order rather than pair_shot_generation_id as the key that matters.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-031",
"concern": "unique constraint on (parent_generation_id, child_order) not supported by repo semantics.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
]
}
]
code
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Fill in ALL 8 checks below. For each, add at least one finding with "detail" (what you found) and "flagged" (true if it's a problem). {"detail": "No issue found", "flagged": false} is valid. You can add multiple findings per check.
1. id="issue_hints" — "Did the work fully address the issue hints, user notes, and approved plan requirements?"
Cross-check the result against explicit user notes, critique corrections, and watch items. Flag anything the implementation ignored, contradicted, or only partially covered.
2. id="correctness" — "Are the proposed changes technically correct?"
Look for logic errors, invalid assumptions, broken invariants, schema mismatches, or behavior that would fail at runtime.
3. id="scope" — "Is the scope and scale of the change appropriate?"
Flag missing required work, out-of-scope edits, or changes that expand behavior without clear justification. Also ask: is a minimal patch the right scale, or does this issue need new code, new methods, or restructuring?
4. id="all_locations" — "Does the change touch all locations AND supporting infrastructure?"
Search for all instances of the symbol/pattern being changed. Also ask: does this feature require supporting infrastructure (merge functions, init wiring, registries, configuration hooks) that doesn't exist yet? Missing infrastructure causes test failures even when the core logic is correct.
5. id="callers" — "Is the change in the right place, and would it break any callers?"
First ask: should this change be HERE, or in a caller, callee, or new method? Then check function signatures, data contracts, and other entry points that rely on the current behavior.
6. id="conventions" — "Does the approach match how the codebase solves similar problems?"
Check not just naming/style but how similar PROBLEMS are solved in this codebase. If the codebase adds new methods for similar cases, the plan should too. Do not spend findings on trivial stylistic preferences.
7. id="verification" — "Is there convincing verification for the change?"
Flag missing tests or weak validation. If verification tests exist, trace the test's execution path through your patch — does every branch it exercises produce the expected result? A patch can look correct but fail because it misses one code path the test covers.
8. id="criteria_quality" — "Are the success criteria well-prioritized and verifiable?"
Check that each `must` criterion has a clear yes/no answer verifiable from code, tests, or git diff. Subjective goals, numeric guidelines, and aspirational targets should be `should`, not `must`. Criteria requiring manual testing or human judgment should be `info`. Flag any `must` criterion that is ambiguous, subjective, or unverifiable in the review pipeline.
After filling in checks, add any additional concerns to the `flags` array (e.g., security, performance, dependencies). Use the standard format (id, concern, category, severity_hint, evidence). This array can be empty.
Fill in this template with your findings:
[
{
"id": "issue_hints",
"question": "Did the work fully address the issue hints, user notes, and approved plan requirements?",
"findings": []
},
{
"id": "correctness",
"question": "Are the proposed changes technically correct?",
"findings": []
},
{
"id": "scope",
"question": "Is the scope and scale of the change appropriate?",
"findings": []
},
{
"id": "all_locations",
"question": "Does the change touch all locations AND supporting infrastructure?",
"findings": []
},
{
"id": "callers",
"question": "Is the change in the right place, and would it break any callers?",
"findings": []
},
{
"id": "conventions",
"question": "Does the approach match how the codebase solves similar problems?",
"findings": []
},
{
"id": "verification",
"question": "Is there convincing verification for the change?",
"findings": []
},
{
"id": "criteria_quality",
"question": "Are the success criteria well-prioritized and verifiable?",
"findings": []
}
]
code
Additional guidelines:
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Over-engineering: prefer the simplest approach that fully solves the problem.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Verify that the plan follows the expected structure when validator warnings or the outline suggest drift.
- Additional flags may use these categories: correctness, security, completeness, performance, maintainability, other.
- Focus on concrete issues, not structural formatting.
{"checks":[{"id":"issue_hints","question":"Did the work fully address the issue hints, user notes, and approved plan requirements?","findings":[{"detail":"Issue hints: Repo evidence supports the core premise. useSegmentSlotMode.ts:76-81 derives activePairData from pairDataByIndex/trailingPairData, and handlePairClick at useSegmentSlotMode.ts:110-112 ignores _passedPairData.","flagged":false},{"detail":"Signature propagation: The plan does not explicitly include src/tools/travel-between-images/components/Timeline/index.tsx:44 or src/tools/travel-between-images/components/ShotImagesEditor/hooks/segmentSlotContracts.ts:57, both of which still define the two-argument contract and are part of the end-to-end cleanup.","flagged":true}]},{"id":"correctness","question":"Are the proposed changes technically correct?","findings":[{"detail":"Behavioral premise: The current data-building wrappers are dead for the only consumer. usePairSettingsHandler.ts:46-121 builds PairData, but useSegmentSlotMode.ts:110-112 drops it, so removing that payload is technically sound.","flagged":false},{"detail":"Pair-settings caller plumbing: Step 8/9 removes passedFrameData, but the second-arg contract is still embedded in src/tools/travel-between-images/components/Timeline/SegmentOutputStrip.tsx:42,187-190 and src/tools/travel-between-images/components/Timeline/hooks/segment/useSegmentOutputStrip.ts:193-212. If those sites are not updated too, the simplification is only partial and leaves dead caller plumbing behind.","flagged":true}]},{"id":"scope","question":"Is the scope and scale of the change appropriate?","findings":[{"detail":"Abstraction scope: usePairSettingsHandler has a single caller at src/tools/travel-between-images/components/Timeline/TimelineContainer/TimelineContainer.tsx:263-269. If the hook becomes onPairClick?.(pairIndex), keeping it is extra indirection rather than the minimal patch; inlining or deleting it is the smaller change.","flagged":true}]},{"id":"all_locations","question":"Does the change touch all locations AND supporting infrastructure?","findings":[{"detail":"Core dead-construction sites: The named builders in PairRegionsLayer, PairRegion, TrailingEndpointLayer, ImageGrid, and usePairSettingsHandler do exist as described.","flagged":false},{"detail":"Location coverage: Beyond the four leaf builders, the repo has supporting contract/plumbing sites at src/tools/travel-between-images/components/Timeline/index.tsx:44, src/tools/travel-between-images/components/ShotImagesEditor/hooks/segmentSlotContracts.ts:57, src/tools/travel-between-images/components/Timeline/TimelineContainer/components/TimelineTrackPrelude.tsx:45, src/tools/travel-between-images/components/Timeline/SegmentOutputStrip.tsx:42, and src/tools/travel-between-images/components/Timeline/hooks/segment/useSegmentOutputStrip.ts:196. The concrete checklist does not currently name all of them.","flagged":true}]},{"id":"callers","question":"Is the change in the right place, and would it break any callers?","findings":[{"detail":"Caller compatibility: TimelineTrackPrelude.tsx:45,155 and SegmentOutputStrip.tsx:42,187-190 are the caller-facing seams for handleOpenPairSettings; they still advertise and forward (pairIndex, pairFrameData). The plan should update those callers in the same pass or the wrapper/handoff contract stays split.","flagged":true}]},{"id":"conventions","question":"Does the approach match how the codebase solves similar problems?","findings":[{"detail":"Codebase fit: The repo already has an index-only consumer shape in src/shared/components/ShotImageManager/hooks/useAdjacentSegmentsData.ts:7-13, so converging onPairClick to (pairIndex: number) => void matches existing segment-navigation usage.","flagged":false}]},{"id":"verification","question":"Is there convincing verification for the change?","findings":[{"detail":"Verification: Recurring debt: The planned checks do not prove the user-visible behavior. src/tools/travel-between-images/components/ShotImagesEditor/hooks/__tests__/useSegmentSlotMode.test.ts:8-13 is only an export smoke test, so there is still no automated coverage that clicking a pair or segment opens the correct segment-slot modal after the signature cleanup.","flagged":true},{"detail":"Verification workflow: reigh-app/tsconfig.app.json:25-30 excludes test files, so Step 2's npx tsc --noEmit is not a definitive worklist for downstream breakage; it will miss broken test-only typings and will not catch unused imports.","flagged":true}]},{"id":"criteria_quality","question":"Are the success criteria well-prioritized and verifiable?","findings":[{"detail":"Criteria quality: The must criterion 'Zero behavioral change — clicking any pair indicator still opens the correct SegmentSettingsModal with the correct pair data' is not yes/no verifiable from the planned tsc plus existing unit tests. It needs a dedicated integration test, or it should be downgraded from must.","flagged":true},{"detail":"Criteria quality: The signature-conversion and dead-construction criteria are concrete and machine-checkable.","flagged":false}]}],"flags":[{"id":"FLAG-001","concern":"Signature propagation: Plan omits explicit updates for Timeline/index.tsx and segmentSlotContracts.ts, which still publish the two-argument onPairClick/handlePairClick contracts.","category":"completeness","severity_hint":"likely-significant","evidence":"src/tools/travel-between-images/components/Timeline/index.tsx:44 has onPairClick?: (pairIndex: number, pairData: PairData) => void; src/tools/travel-between-images/components/ShotImagesEditor/hooks/segmentSlotContracts.ts:57 has handlePairClick: (pairIndex: number, passedPairData?: PairData) => void."},{"id":"FLAG-002","concern":"Pair-settings caller plumbing: Plan does not explicitly cover the onOpenPairSettings(pairIndex, pairFrameData) path in TimelineTrackPrelude, SegmentOutputStrip, and useSegmentOutputStrip, so the wrapper simplification can be left half-done.","category":"correctness","severity_hint":"likely-significant","evidence":"src/tools/travel-between-images/components/Timeline/TimelineContainer/components/TimelineTrackPrelude.tsx:45,155, src/tools/travel-between-images/components/Timeline/SegmentOutputStrip.tsx:42,187-190, and src/tools/travel-between-images/components/Timeline/hooks/segment/useSegmentOutputStrip.ts:193-212 still carry and forward pairFrameData."},{"id":"FLAG-003","concern":"Verification: Recurring debt: No automated test currently exercises the actual segment-slot opening path after the signature cleanup, so the plan's must 'zero behavioral change' claim is not convincingly verified.","category":"completeness","severity_hint":"likely-significant","evidence":"src/tools/travel-between-images/components/ShotImagesEditor/hooks/__tests__/useSegmentSlotMode.test.ts:8-13 is only an export smoke test; the plan only updates leaf-component assertions plus tsc/existing tests."}],"verified_flag_ids":[],"disputed_flag_ids":[]}