Make the timeline agent's image generation match the ImageGenerationForm behavior. Core changes: (1) Always send model_name from project settings so tasks show in TaskPane with correct task_type. (2) Load and use the user's active style reference from project settings. (3) Include reference prompts in the system prompt context. (4) Update the agent's prompts/schemas to reflect actual available models (qwen-image/qwen-image-2512/z-image, NOT wan-2.2 for text-to-image). (5) Support reference modes (style/subject/scene/style-character) in create_task.
User notes and answers:
Complete context from research:
How settings are stored
ProjectImageSettings is in the 'settings' table: tool_id='project-image-settings', project_id scope, value is JSONB
executeCreateTask in create-task.ts passes model_name to createGenerationTask
createGenerationTask in generation.ts calls normalizeImageGenerationModelName which returns null for 'wan-2.2'
No model_name sent → resolver defaults to wan_2_2_t2i
What needs to happen
Load project image settings when building the system prompt (same place timeline state is loaded)
Default model_name to selectedTextModel from settings (fallback: 'qwen-image')
Include the user's active reference image URL in the system prompt so the LLM can use it
Fix normalizeImageGenerationModelName to accept all 3 valid models
Update prompts.ts: text-to-image models are qwen-image (default), qwen-image-2512, z-image
Update tool-schemas.ts: model enum should have qwen-image, qwen-image-2512, z-image for text-to-image
Keep wan-2.2, ltx-2.3, ltx-2.3-fast for image-to-video only
Assistant
Reference images
The form stores references in ProjectImageSettings.references array
Each reference has an id pointing to the 'resources' table
The selected reference for a shot is in selectedReferenceIdByShot[shotId]
When generating by-reference, the form sends style_reference_image (a URL)
The agent's executeCreateTask already handles reference_image_urls and maps to style_reference_image
What's missing: the agent doesn't know about the user's saved references. We need to:
a) Load the active reference URL from settings + resources table
b) Include it in the system prompt so the LLM knows it can use it
c) When the LLM uses style-transfer/subject-transfer, it can reference the user's active reference
Reference prompt propagation
When a reference is created from an existing generation, the original prompt should be attached
The enrichClipsWithPrompts in selectedClips.ts already fetches generation prompts
For references, need similar: load the generation that created the reference image and attach its prompt
Scope boundaries (NOT doing)
LoRAs: too complex for agent, skip for now
Hires fix: only for local generation, skip
Resolution/aspect ratio: use project defaults
Privacy settings: not relevant to task creation
Prompt expansion/automated mode: the LLM IS the prompt expander
Answers to questions:
The LLM should decide when to use the reference. Just surface it in the prompt context. Don't auto-convert.
For reference prompt loading: defer to follow-up if complex. The selected reference from settings has an ID pointing to the resources table. Resources may have a generation_id or source metadata. Check resources table schema.
Use 'none' as the fallback shot key. If selected clips have a shot_id, use that for per-shot reference lookup.
The timeline agent creates image generation tasks that don't match the ImageGenerationForm's behavior. Three core problems:
Wrong model default — The agent tells the LLM to use wan-2.2 for text-to-image, but normalizeImageGenerationModelName returns null for it, so the resolver defaults to wan_2_2_t2i (invisible in TaskPane). The form always sends a valid model from selectedTextModel.
No reference awareness — The form loads the user's active style reference from project settings and sends style_reference_image. The agent has no knowledge of saved references.
Stale prompts/schemas — The system prompt and tool schema list wan-2.2 as a text-to-image model when it's actually only valid for image-to-video.
Files to modify
File
Purpose
supabase/functions/ai-timeline-agent/db.ts
Add loadProjectImageSettings()
supabase/functions/ai-timeline-agent/prompts.ts
Accept settings + reference context, fix model guide
Extract metadata.styleReferenceImage (the URL), metadata.referenceMode
Return ResolvedReference with url, referenceMode, and optionally the prompt from the resource's source generation
AddloadReferencePrompt(supabaseAdmin, resourceId) to fetch the generation prompt associated with a reference:
Query the generations table for any generation whose output matches this resource, extract params.prompt or orchestrator_details.prompt
This mirrors the extractGenerationPrompt pattern already in selectedClips.ts
Step 3: Wire settings loading into the agent loop (loop.ts)
Scope: Small
AfterloadTimelineState at loop.ts:306, call loadProjectImageSettings(supabaseAdmin, timelineState.projectId)
CallloadActiveReference(supabaseAdmin, settings) to resolve the active reference
Pass both settings and resolvedReference to buildTimelineAgentSystemPrompt as new optional fields
Passsettings to executeCreateTask so it can default model_name
Phase 2: Prompt and Schema Fixes
Step 4: Fix tool schema model enum (tool-schemas.ts)
Scope: Small
Split the model enum at tool-schemas.ts:56 into task-type-aware guidance. Since JSON Schema enums can't be conditional, update the enum to list all valid models and fix the description:
Addqwen-image-2512 which was missing from the enum entirely.
Step 5: Fix system prompt model guide and add reference context (prompts.ts)
Scope: Medium
UpdatebuildTimelineAgentSystemPrompt signature to accept optional defaultModel?: string and activeReference?: { url: string; referenceMode: string; prompt?: string } in the options.
IfdefaultModel is provided, append to model guide: User's preferred model: ${defaultModel}
IfactiveReference is provided, append a reference context section:
code
Active style reference: ${activeReference.url} (mode: ${activeReference.referenceMode})
${activeReference.prompt ? `Reference was created with prompt: "${activeReference.prompt}"` : ''}
When creating text-to-image tasks, consider using this reference for style-transfer or subject-transfer.
To use it, set reference_image_urls to include this URL and choose the appropriate task_type (style-transfer, subject-transfer, or scene-transfer).
Fix the example at prompts.ts:90 — change "model":"z-image" (already valid) but remove any example that suggests wan-2.2 for text-to-image.
Step 6: Default model_name and inject reference in create-task (create-task.ts)
Scope: Medium
AdddefaultModelName?: string and activeReferenceUrl?: string to executeCreateTask parameters.
Atcreate-task.ts:124, update the model_name fallback:
This ensures that if the LLM doesn't specify a model, we use the user's preferred model from settings, which will flow through to buildImageGenerationInput and get normalized properly.
For reference handling: when taskType is a transfer type (style/subject/scene) and the LLM didn't provide reference_image_urls, check if activeReferenceUrl is available and use it as the default reference. This lets the LLM simply say "style-transfer" without needing to know the reference URL.
UpdateexecuteCreateTask call sites in loop.ts:177 to pass the new parameters from loaded settings.
Atgeneration.ts:68-74, the function currently returns null for wan-2.2 (treating it as "no model specified" default). This is correct behavior — when the agent sends a valid model like qwen-image, it passes through. The problem was only that the agent's prompts told the LLM to use wan-2.2 for text-to-image.
Verify that qwen-image-2512 is in the IMAGE_GENERATION_MODELS set at line 32 — it already is. No change needed here.
No code change needed in this function. The fix is upstream: steps 4-6 ensure the agent sends valid text-to-image models.
Phase 4: Validation
Step 8: Manual validation
Scope: Small
Verify the TypeScript compiles: run npx tsc --noEmit on the edge function (or use Deno check if that's the pattern)
executeCreateTask passes through with reference_mode: 'style'
buildImageGenerationInput → sets style_reference_image, model_name: 'qwen-image' (forced for references) ✓
Execution Order
Types first (Step 1) — no dependencies
Data loading (Step 2) — depends on types
Wire into loop (Step 3) — depends on data loading
Fix schemas/prompts (Steps 4-5) — independent of data loading, but do after types
Default model in create-task (Step 6) — depends on loop wiring
Verify normalization (Step 7) — confirm no changes needed
Validate (Step 8) — after all changes
Validation Order
TypeScript compilation check after each step
Manual trace of both flows (text-to-image without model, style-transfer with reference) after all changes
Deploy to staging and test with real agent conversation
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-04-06T04:06:19Z",
"hash": "sha256:bb8308000afca6b5eeae0009af0e0c49b62c9b243d124872d6a08cb41a5a9fb3",
"questions": [
"Should the agent automatically apply the user's active reference for ALL text-to-image tasks (converting them to style-transfers), or only when the user explicitly asks for style/reference-related generation? The plan currently only injects the reference into the system prompt context and lets the LLM decide \u2014 it does NOT auto-convert text-to-image to style-transfer.",
"For reference prompt loading (Step 2c), is there a reliable way to find which generation created a given resource? Is there a foreign key from resources to generations, or do we need to search by URL/metadata? If this is complex, we could skip reference prompt propagation for v1.",
"The agent currently has no concept of 'shot context' (which shot the user is working on). References are per-shot via selectedReferenceIdByShot. Should we use the 'none' fallback (project-level default reference), or is there a way to know the active shot from the timeline state or selected clips?"
],
"success_criteria": [
{
"criterion": "Agent text-to-image tasks use the user's selectedTextModel from project settings (not wan-2.2), resulting in a task_type visible in TaskPane (qwen_image, qwen_image_2512, or z_image_turbo)",
"priority": "must"
},
{
"criterion": "System prompt model guide lists qwen-image/qwen-image-2512/z-image for text-to-image and wan-2.2/ltx-2.3/ltx-2.3-fast for image-to-video only",
"priority": "must"
},
{
"criterion": "Tool schema model enum includes qwen-image-2512 and description clarifies which models apply to which task types",
"priority": "must"
},
{
"criterion": "When project has an active style reference, the reference URL and mode are included in the system prompt",
"priority": "must"
},
{
"criterion": "If the LLM omits model from create_task, the user's preferred model from settings is used as fallback",
"priority": "must"
},
{
"criterion": "TypeScript/Deno compilation passes with no type errors",
"priority": "must"
},
{
"criterion": "Existing agent behaviors (image-to-video, duplicate, timeline editing) are unaffected",
"priority": "must"
},
{
"criterion": "Reference prompt from the original generation is included in the system prompt when available",
"priority": "should"
},
{
"criterion": "The agent can infer shot context from selected clips to pick the right per-shot reference",
"priority": "should"
},
{
"criterion": "No new Supabase queries are made when project has no image settings configured",
"priority": "should"
},
{
"criterion": "System prompt additions for reference context are under ~200 tokens to avoid bloating the prompt",
"priority": "should"
},
{
"criterion": "Manual smoke test: agent creates a visible text-to-image task in TaskPane",
"priority": "info"
},
{
"criterion": "Manual smoke test: agent creates a style-transfer task using the user's saved reference",
"priority": "info"
}
],
"assumptions": [
"The 'none' key in selectedReferenceIdByShot is the project-level default reference (used when no shot-specific reference is set). We'll use this unless we can determine the active shot from selected clips.",
"loadProjectImageSettings will return null for projects that have never configured image settings \u2014 all downstream code handles null gracefully with sensible defaults (qwen-image as fallback model).",
"The resources table metadata JSONB for style-reference type resources contains styleReferenceImage (a URL string) and referenceMode \u2014 matching the StyleReferenceMetadata interface from the frontend.",
"The agent's SupabaseAdmin type can query the 'settings' and 'resources' tables \u2014 the type definition allows arbitrary table names via the from() method.",
"Reference prompt loading (generation that created the reference) can be deferred to a follow-up if there's no clean FK path from resources to generations."
],
"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"
]
}
],
"audio-loading": [
{
"id": "DEBT-086",
"concern": "getaudiodata in useeffect removes render-readiness signal",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-087",
"concern": "same as correctness-3 \u2014 preview/render parity risk",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-088",
"concern": "preview/render parity partially satisfied",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
}
],
"audio-reactivity": [
{
"id": "DEBT-082",
"concern": "overlapping clips use first-found, volume not scaled",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-083",
"concern": "same as audio-reactivity-1 \u2014 overlapping/volume-adjusted clips diverge from audible mix",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-084",
"concern": "textclip missing globalframeprovider",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-085",
"concern": "same as audio-reactivity-2 \u2014 textclipsequence missing provider",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-089",
"concern": "textclip effects surface not covered",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-090",
"concern": "continuous effects shared by visual and text clips",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
}
],
"batch-generation-pipeline": [
{
"id": "DEBT-006",
"concern": "enhancement in usegeneratebatch before generatevideo() could compute prompts against a stale pair snapshot if mutations are still in flight.",
"occurrence_count": 1,
"plan_ids": [
"in-cloud-mode-when-users-20260330-2214"
]
}
],
"crash-recovery-cascade-paths": [
{
"id": "DEBT-065",
"concern": "cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-067",
"concern": "duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-069",
"concern": "shared orchestrator-reference helpers not referenced.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-072",
"concern": "orchestrator tasks that crash don't get orchestrator-self cascade.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-074",
"concern": "hardcoded params->>'orchestrator_task_id_ref' misses other reference paths.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
}
],
"crash-recovery-retry": [
{
"id": "DEBT-063",
"concern": "crash requeue sql does not increment attempts, risking infinite requeue loop.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-066",
"concern": "duplicate of correctness-1: attempts never advance on crash requeue.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-068",
"concern": "missing attempts increment location in heartbeat sql.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-073",
"concern": "step 6 under-scoped for real retry convergence and orchestrator-self handling.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
}
],
"crash-recovery-sql-syntax": [
{
"id": "DEBT-064",
"concern": "bare select inside plpgsql is invalid \u2014 needs perform.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
}
],
"crash-recovery-testing": [
{
"id": "DEBT-070",
"concern": "no multi-crash convergence test exercising attempts 0\u21921\u21922\u21923.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-071",
"concern": "no validation that plpgsql body executes successfully.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-075",
"concern": "criteria don't require proof of crash requeue convergence.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
}
],
"criteria-verifiability": [
{
"id": "DEBT-036",
"concern": "'no unsafe .maybesingle()' criterion requires judgment about column uniqueness.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-037",
"concern": "decision documentation location not specified.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-062",
"concern": "the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone \u2014 it requires a live db query.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-delete-the-20260331-0519"
]
}
],
"db-fallback-testing": [
{
"id": "DEBT-060",
"concern": "no new automated test for the db fallback dispatch path or dependant_on preservation for raw worker families.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-delete-the-20260331-0519"
]
}
],
"did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements": [
{
"id": "DEBT-013",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the package is internally inconsistent. the plan body says to 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"
]
}
],
"hook-abstraction": [
{
"id": "DEBT-043",
"concern": "usepairsettingshandler becomes trivial with single caller \u2014 keeping it is extra indirection.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
],
"is-the-change-in-the-right-place-and-would-it-break-any-callers": [
{
"id": "DEBT-015",
"concern": "is the change in the right place, and would it break any callers?: the optional cleanup steps are not in the right place yet. 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"
]
}
],
"number-input-nullable": [
{
"id": "DEBT-076",
"concern": "plan doesn't explicitly state onchange must also accept null, though step 3 depends on it.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
},
{
"id": "DEBT-077",
"concern": "disputed v1 flag \u2014 original concern about bulkclippanel being unimplementable.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
},
{
"id": "DEBT-079",
"concern": "onchange null filtering not explicitly addressed in plan.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
}
],
"number-input-testing": [
{
"id": "DEBT-081",
"concern": "no planned tests for numberinput shared component or bulkclippanel nullable draft flow.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
}
],
"orchestrator-completion-rollout": [
{
"id": "DEBT-049",
"concern": "pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-051",
"concern": "missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-053",
"concern": "mixed old/new data during rollout can leave old orchestrators without completion counting.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-054",
"concern": "no test or deployment guard for pre-existing individual_travel_segment children completing after worker change.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-056",
"concern": "plan overstates backward compatibility for existing data.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-057",
"concern": "missing rollout compatibility step for in-flight individual_travel_segment tasks.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-058",
"concern": "pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-059",
"concern": "orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
}
],
"pair-settings-plumbing": [
{
"id": "DEBT-039",
"concern": "handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-042",
"concern": "same as flag-002 \u2014 segmentoutputstrip and usesegmentoutputstrip still carry pairframedata.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-045",
"concern": "timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata).",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
],
"plan-scope": [
{
"id": "DEBT-032",
"concern": "step 3 is larger than a light megaplan warrants.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
],
"planning-metadata": [
{
"id": "DEBT-017",
"concern": "planning metadata: the attached metadata and success criteria still describe a different implementation than the current plan body, which risks sending execution and review down the wrong path.",
"occurrence_count": 1,
"plan_ids": [
"fix-the-denormalized-20260331-0225"
]
}
],
"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"
]
}
],
"shared-component-compatibility": [
{
"id": "DEBT-078",
"concern": "numberinput changes affect callers outside video-editor (billing, travel-between-images, phaseconfigselectormodal).",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
},
{
"id": "DEBT-080",
"concern": "shared ui component blast radius not audited in plan.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
}
],
"shot-linking-testing": [
{
"id": "DEBT-021",
"concern": "no test covers the linkgenerationtoshot error/catch branches.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
],
"signature-propagation": [
{
"id": "DEBT-038",
"concern": "plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-041",
"concern": "same as flag-001 \u2014 timeline/index.tsx and segmentslotcontracts.ts not in checklist.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-044",
"concern": "five supporting contract/plumbing sites not named in the checklist.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
],
"task-types-verification": [
{
"id": "DEBT-050",
"concern": "step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-052",
"concern": "step 3 should cite task_types source, not task_cost_configs.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-055",
"concern": "plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
}
],
"test-coverage": [
{
"id": "DEBT-034",
"concern": "current generation-child.test.ts is only a smoke test.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-035",
"concern": "no plan to verify other lookup paths choose rows consistently.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
],
"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"
]
}
],
"verification": [
{
"id": "DEBT-091",
"concern": "no end-to-end render test for audio analysis timing",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-092",
"concern": "no automated coverage for text clips or overlapping clips with audio effects",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
}
],
"verification-coverage": [
{
"id": "DEBT-040",
"concern": "no automated test exercises the full segment-slot opening path after cleanup.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-046",
"concern": "no automated coverage that clicking a pair opens the correct modal after cleanup.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-048",
"concern": "zero behavioral change criterion is not verifiable from tsc + existing tests alone.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
],
"verification-workflow": [
{
"id": "DEBT-047",
"concern": "tsconfig.app.json excludes test files, so tsc won't catch test breakage.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
],
"worker-test-staleness": [
{
"id": "DEBT-061",
"concern": "worker test in test_additional_coverage_modules.py:37 may assert stale payload structure (task_type vs family).",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-delete-the-20260331-0519"
]
}
]
}
code
Escalated debt subsystems:
[
{
"subsystem": "orchestrator-completion-rollout",
"total_occurrences": 8,
"plan_count": 1,
"entries": [
{
"id": "DEBT-049",
"concern": "pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-051",
"concern": "missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-053",
"concern": "mixed old/new data during rollout can leave old orchestrators without completion counting.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-054",
"concern": "no test or deployment guard for pre-existing individual_travel_segment children completing after worker change.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-056",
"concern": "plan overstates backward compatibility for existing data.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-057",
"concern": "missing rollout compatibility step for in-flight individual_travel_segment tasks.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-058",
"concern": "pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-059",
"concern": "orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
}
]
},
{
"subsystem": "audio-reactivity",
"total_occurrences": 6,
"plan_count": 1,
"entries": [
{
"id": "DEBT-082",
"concern": "overlapping clips use first-found, volume not scaled",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-083",
"concern": "same as audio-reactivity-1 \u2014 overlapping/volume-adjusted clips diverge from audible mix",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-084",
"concern": "textclip missing globalframeprovider",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-085",
"concern": "same as audio-reactivity-2 \u2014 textclipsequence missing provider",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-089",
"concern": "textclip effects surface not covered",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-090",
"concern": "continuous effects shared by visual and text clips",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
}
]
},
{
"subsystem": "crash-recovery-cascade-paths",
"total_occurrences": 5,
"plan_count": 1,
"entries": [
{
"id": "DEBT-065",
"concern": "cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-067",
"concern": "duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-069",
"concern": "shared orchestrator-reference helpers not referenced.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-072",
"concern": "orchestrator tasks that crash don't get orchestrator-self cascade.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-074",
"concern": "hardcoded params->>'orchestrator_task_id_ref' misses other reference paths.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
}
]
},
{
"subsystem": "crash-recovery-retry",
"total_occurrences": 4,
"plan_count": 1,
"entries": [
{
"id": "DEBT-063",
"concern": "crash requeue sql does not increment attempts, risking infinite requeue loop.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-066",
"concern": "duplicate of correctness-1: attempts never advance on crash requeue.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-068",
"concern": "missing attempts increment location in heartbeat sql.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-073",
"concern": "step 6 under-scoped for real retry convergence and orchestrator-self handling.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
}
]
},
{
"subsystem": "are-the-proposed-changes-technically-correct",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-007",
"concern": "are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs 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": "audio-loading",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-086",
"concern": "getaudiodata in useeffect removes render-readiness signal",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-087",
"concern": "same as correctness-3 \u2014 preview/render parity risk",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
},
{
"id": "DEBT-088",
"concern": "preview/render parity partially satisfied",
"occurrence_count": 1,
"plan_ids": [
"add-audio-reactive-visual-20260331-2159"
]
}
]
},
{
"subsystem": "crash-recovery-testing",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-070",
"concern": "no multi-crash convergence test exercising attempts 0\u21921\u21922\u21923.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-071",
"concern": "no validation that plpgsql body executes successfully.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
},
{
"id": "DEBT-075",
"concern": "criteria don't require proof of crash requeue convergence.",
"occurrence_count": 1,
"plan_ids": [
"deep-dive-into-root-causes-of-20260331-0534"
]
}
]
},
{
"subsystem": "criteria-verifiability",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-036",
"concern": "'no unsafe .maybesingle()' criterion requires judgment about column uniqueness.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-037",
"concern": "decision documentation location not specified.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-062",
"concern": "the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone \u2014 it requires a live db query.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-delete-the-20260331-0519"
]
}
]
},
{
"subsystem": "edge-test-config",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-022",
"concern": "plan's vitest commands use the wrong config entry point.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-023",
"concern": "same as verification-3: wrong vitest config in validation commands.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-024",
"concern": "success criterion references wrong test command.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
]
},
{
"subsystem": "error-propagation-testing",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-020",
"concern": "no end-to-end regression test for the full symptom chain (db error \u2192 tocompletionerror metadata \u2192 handler log).",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-025",
"concern": "handler.ts metadata surfacing criterion lacks a concrete automated verifier.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
},
{
"id": "DEBT-026",
"concern": "main issue only partially validated without an integration test.",
"occurrence_count": 1,
"plan_ids": [
"fix-complete-task-variant-20260331-0300"
]
}
]
},
{
"subsystem": "is-there-convincing-verification-for-the-change",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-010",
"concern": "is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check 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": "number-input-nullable",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-076",
"concern": "plan doesn't explicitly state onchange must also accept null, though step 3 depends on it.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
},
{
"id": "DEBT-077",
"concern": "disputed v1 flag \u2014 original concern about bulkclippanel being unimplementable.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
},
{
"id": "DEBT-079",
"concern": "onchange null filtering not explicitly addressed in plan.",
"occurrence_count": 1,
"plan_ids": [
"video-editor-three-fixes-20260331-1533"
]
}
]
},
{
"subsystem": "pair-settings-plumbing",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-039",
"concern": "handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-042",
"concern": "same as flag-002 \u2014 segmentoutputstrip and usesegmentoutputstrip still carry pairframedata.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-045",
"concern": "timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata).",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
]
},
{
"subsystem": "position-key-semantics",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-028",
"concern": "plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-030",
"concern": "plan weights toward child_order rather than pair_shot_generation_id as the key that matters.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
},
{
"id": "DEBT-031",
"concern": "unique constraint on (parent_generation_id, child_order) not supported by repo semantics.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-audit-and-fix-20260331-0341"
]
}
]
},
{
"subsystem": "signature-propagation",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-038",
"concern": "plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-041",
"concern": "same as flag-001 \u2014 timeline/index.tsx and segmentslotcontracts.ts not in checklist.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-044",
"concern": "five supporting contract/plumbing sites not named in the checklist.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
]
},
{
"subsystem": "task-types-verification",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-050",
"concern": "step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-052",
"concern": "step 3 should cite task_types source, not task_cost_configs.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
},
{
"id": "DEBT-055",
"concern": "plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table.",
"occurrence_count": 1,
"plan_ids": [
"light-megaplan-unify-task-20260331-0443"
]
}
]
},
{
"subsystem": "verification-coverage",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-040",
"concern": "no automated test exercises the full segment-slot opening path after cleanup.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-046",
"concern": "no automated coverage that clicking a pair opens the correct modal after cleanup.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
},
{
"id": "DEBT-048",
"concern": "zero behavioral change criterion is not verifiable from tsc + existing tests alone.",
"occurrence_count": 1,
"plan_ids": [
"phase-2-cleanup-from-the-20260331-0354"
]
}
]
}
]
code
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Your output template is at: /Users/user_c042661f/Documents/reigh-workspace/.megaplan/plans/make-the-timeline-agent-s-20260406-0602/critique_output.json
Review the plan with a broad scope. Consider whether the approach is correct, whether it covers
all the places it needs to, whether it would break callers or violate codebase conventions,
and whether its verification strategy is adequate.
Place any concrete concerns in the flags array in the template file using the standard format
(id, concern, category, severity_hint, evidence). Leave checks as an empty array.
Workflow: read the file → investigate → read file again → add findings → write file back.
code
Additional guidelines:
- Robustness level: light. Be pragmatic. Only flag issues that would cause real failures. Ignore style, minor edge cases, and issues the executor will naturally resolve.
- Over-engineering: prefer the simplest approach that fully solves the problem.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids`: list flag IDs from prior iterations that the revised plan actually resolves (e.g., if the plan was revised to fix FLAG-001, and you confirm the fix is correct, include "FLAG-001"). Only include flags you've verified — don't guess.
- Verify that the plan follows the expected structure when validator warnings or the outline suggest drift.
- Additional flags may use these categories: correctness, security, completeness, performance, maintainability, other.
- Focus on concrete issues, not structural formatting.
{"checks":[],"flags":[{"id":"FLAG-001","concern":"Settings plumbing: The plan loads project-image-settings from a standalone settings table, but the repo's tool-settings system reads project-scoped tool settings from projects.settings[toolId] (with shot overrides from shots.settings). Implementing the plan as written would query the wrong source and miss the user's actual selected model and reference selection.","category":"correctness","severity_hint":"likely-significant","evidence":"reigh-app/src/shared/settings/runtime/toolSettingsScopes.ts:24-59 fetches tool settings from users.settings, projects.settings, and shots.settings, and :91-101 reads projectSettingsData?.[toolId]; there is no corresponding repo path here that reads project-image-settings from a standalone settings table."},{"id":"FLAG-002","concern":"Reference hydration: The proposed reference resolver pulls mode from resources.metadata, but the repo treats the project pointer in references[] as authoritative and lets it override referenceMode, strengths, subject description, and scene settings. As written, the agent would not actually mirror the active reference behavior the form uses.","category":"correctness","severity_hint":"likely-significant","evidence":"reigh-app/src/shared/components/ImageGenerationForm/hooks/useHydratedReferences.ts:86-109 explicitly merges resource metadata with pointer overrides from project settings (pointer.referenceMode ?? metadata.referenceMode, same for strengths/description/scene fields). The plan's loadActiveReference() only mentions metadata.styleReferenceImage and metadata.referenceMode."},{"id":"FLAG-003","concern":"Create-task schema: The idea requires create_task to support reference modes including style-character, but the plan never adds a reference_mode argument and still models transfer only as style-transfer|subject-transfer|scene-transfer. That leaves the agent unable to express the form's reference_mode: 'style-character' path.","category":"completeness","severity_hint":"likely-significant","evidence":"reigh-app/supabase/functions/ai-timeline-agent/tool-schemas.ts:34-84 exposes only transfer task types and no reference_mode field; reigh-app/supabase/functions/ai-timeline-agent/tools/create-task.ts:12-28,114-124 hard-maps task type to style|subject|scene; meanwhile the form sends reference_mode directly in reigh-app/src/shared/components/ImageGenerationForm/hooks/formSubmission/referenceParams.ts:21-30, and the resolver already supports style-character in reigh-app/supabase/functions/create-task/resolvers/imageGeneration.ts:106-139."},{"id":"FLAG-004","concern":"Shot-scoped references: The plan resolves the active reference before tool execution without deriving shot context from the selected clips, even though reference selection is stored per shot. In selected-clip workflows this would usually surface the none fallback instead of the selected shot's active reference.","category":"completeness","severity_hint":"uncertain","evidence":"The form keys selection by effectiveShotId and reads selectedReferenceIdByShot[effectiveShotId] in reigh-app/src/shared/components/ImageGenerationForm/hooks/useProjectImageSettings.ts:58-76. Agent attachments currently send generation_id but no shot_id in reigh-app/src/tools/video-editor/hooks/useAgentSession.ts:266-277, while the agent already has findShotForGenerations(...) available in reigh-app/supabase/functions/ai-timeline-agent/tools/create-task.ts:86-95 to infer a shared shot from selected clips."}],"verified_flag_ids":[],"disputed_flag_ids":[]}