Port comics, the iterate editor, and the enqueued-panels job onto the generation graph (generateFromGraph / whatIfFromGraph) and remove the legacy submission, formatting, and metadata code now that the graph is the single path. - Add shared preset-image-gen.service.ts (model registry + graph-input builder + submit/what-if wrappers); repoint comics.router, the iterate endpoints, and process-enqueued-comic-panels at it. Delete legacy imageGen.ts. - Remove the dead video config layer: all 10 video *.schema.ts files + the VideoGenerationConfig2 factory + the videoGenerationConfig2 registry. Relocate the few live wan/veo3 symbols into their ecosystem handlers; generation.config.ts is now types-only (OrchestratorEngine2). - Remove legacy orchestrator/common.ts: the formatGenerationResponse formatter tree and parseGenerateImageInput pipeline were reachable only from the deleted comfy.ts / textToImage.ts paths. Move updateWorkflow into orchestration-new.service. Delete the unused /api/generation/workflows/[workflowId] endpoint. - Remove normalize-meta.service.ts: fold prompt-clean / type->process / ecosystem resolution into the remix pipeline (resolveGraphParamsFromImageMeta) and lean on the wan graph to resolve generic 'WanVideo'. getMetaResources is now a local helper. - Remove unused getGenerationEngines / engines.ts and its tRPC endpoint + callers. - Delete the now-dead orchestrator/generation/generation.schema.ts. - Docs: add legacy-generation-removal record, drop the obsolete handoff doc. Typecheck/lint/prettier clean. Remix (esp. old Wan video) and comics/iterate/video generation still need runtime verification against a live orchestrator. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6.2 KiB
Legacy Generation Removal
Record of retiring the legacy generation submission / formatting / metadata code, now that the
generation graph (generateFromGraph / whatIfFromGraph + formatGenerationResponse2) is the single
path. Follow-on to the comics → generationGraph port
(comics-generation-graph-port.md).
Decisions (context)
- Shared preset service —
src/server/services/orchestrator/preset-image-gen.service.ts: one service for comics, the iterate editor, and the enqueued-panels job (their model-config maps were ~90% duplicated). "Preset" = app-driven generation against a locked model version, vs the user-selected model the main generator form produces. - Audit (option c) — the explicit
auditPromptServeris kept only in the enqueued-panels job (it runs outside tRPC, so an early gate there is defensible). Comics + the iterate editor rely ongenerateFromGraph's internal audit, avoiding a double-audit on the interactive paths. - Video config + normalize-meta — full removal; live symbols sourced from the graph/handler files.
Phase 1 — imageGen.ts removed ✅
Extracted the shared preset-image-gen.service.ts; repointed comics.router, the iterate endpoints
(iterateGenerate / getIterateCostEstimate — now thin handlers, ITERATE_MODEL_CONFIG deleted), and
process-enqueued-comic-panels.ts at it; deleted src/server/services/orchestrator/imageGen/imageGen.ts.
Phase 2 — video config layer removed ✅
All 10 video ecosystem *.schema.ts files + the VideoGenerationConfig2 factory
(infrastructure/GenerationConfig.ts) + the videoGenerationConfig2 registry were deleted. Video
generation runs entirely through the graph (every ecosystem has a graph + handler); the schema configs
were dead runtime code.
- The
src/shared/data-graph/generation/*files define their own constants — they do not import the legacy schemas. Only 3 server files imported any video schema, and only fromwan/veo3. generation.config.tsreduced to a types-only module exportingOrchestratorEngine2(explicit literal union). (VideoGenerationSchema2was added here, then removed in Phase 3 — see below.)- 8 schema files deleted outright (zero importers):
minimax,mochi,lightricks,haiper,vidu,sora,kling,hunyuan(empty folders removed). - wan/veo3 live symbols relocated into the handler layer (decision: handler files, move-as-is):
veo3.handler.ts→getVeo3ProcessFromAir(+veo3ModelOptions);wan.handler.ts→wanBaseModelGroupIdMap(the others —wanVersionMap/getWanVersion/wan21BaseModelMap/wanGeneralBaseModelMap— were relocated but then pruned once Phase 3/4 removed their consumers). orchestrator/generation/generation.schema.tsdeleted — entirely dead (not to be confused with the livesrc/server/schema/generation.schema.ts). Theorchestrator/generation/folder now holds onlygeneration.config.ts.
Phase 3 — legacy orchestrator/common.ts removed ✅
The legacy formatGenerationResponse is no longer the feed's formatter (formatGenerationResponse2
in orchestration-new.service.ts is). A full dependency trace showed the only symbol external code
imported from common.ts was updateWorkflow.
- Deleted
comfy/comfy.ts,textToImage/textToImage.ts, and the unused API endpointpages/api/generation/workflows/[workflowId]/index.ts. Keptcomfy/comfy.utils.ts+comfy/comfy.types.ts(live). common.tsdeleted —updateWorkflowmoved intoorchestration-new.service.ts(next toformatGenerationResponse2, which it calls),orchestrator.router.tsrepointed. The whole orphaned closure went with it: theformatGenerationResponseformatter tree (incl.formatVideoGenStep),parseGenerateImageInput+ its resource helpers, the deadgetGenerationStatus/getGenerationStatusLimitsduplicates (live code uses thegeneration.serviceversions), and the associated types.- Knock-on: deleting
formatVideoGenStepremoved the last consumer ofVideoGenerationSchema2, so it was deleted fromgeneration.config.tstoo.
Phase 4 — normalize-meta.service.ts removed ✅
The remix / "generate from this image" pipeline ran normalizeMeta as a pre-step before
mapDataToGraphInput; most of it was redundant with the mapper. Removed the file (used by only 2 sites
in generation.service.ts: getMediaGenerationData + resolveImageMeta).
cleanPrompt+type→process+ ecosystem resolution now run inline at the 2 sites (extracted to the sharedresolveGraphParamsFromImageMetahelper in the same file); rawcivitaiResources/resources/typeare dropped before the mapper.- Wan legacy resolution (
processWanVideoGenMeta) deleted — generic'WanVideo'baseModel + version are now resolved by the wan graph (ecosystemToVersionDefextraEcosystems: ['WanVideo']→ v2.1 + workflow/resolution effects) and the mapper'sinferBaseModel/resolveWorkflow. getMetaResourcesmoved intogeneration.service.tsas a local helper.
Status
Typecheck fully clean (after initializing the event-engine-common git submodule in this
worktree — it was uninitialized, which is unrelated to these changes), lint 0 errors, prettier applied
throughout.
Remaining runtime verification
The code typechecks/lints clean, but these paths need exercising against a real DB / orchestrator before merge:
- Old Wan video remix (Phase 4) — generate-from-image for a Wan video stored with a generic
'WanVideo'baseModel: confirm it resolves to the correct version/process now thatprocessWanVideoGenMetais gone and the graph does the resolution. - Normal image remix (Phase 4) — prompt prefill + ecosystem/resource filtering.
- Comics + iterate (Phase 1) — a free what-if + one real generation per ecosystem, plus one
enqueued comic panel. Watch aspectRatio: the graph snaps dimensions to ecosystem-canonical sizes,
and the iterate path returns width/height to the client (
pollIterationStatus).
The earlier "historical video formatting" concern is moot — that formatter (formatVideoGenStep)
lived only in the dead formatGenerationResponse tree the live feed never used, and was deleted in
Phase 3.