CDO creative render tools with route-level cover persistence#2234
Merged
Conversation
Register four cover-render creative tools (pipeline_renderComicCover,
renderComicBackCover, renderVolumeCover, renderVolumeBackCover) so the
Creative Director orchestrator can render comic-issue and volume covers.
A bare enqueue is not enough: the media-job filename hook attaches the
finished image only if the target cover slot already carries the returned
jobId, and that slot write used to live in the route factory
(routes/pipeline/covers.js#makeCoverRenderHandler). Wrapping the bare
enqueueComicCover-style service in a tool would silently drop orchestrated
covers.
Extract the enqueue+persist flow into shared service entry points in
visualStages.js -- renderComicCover/renderComicBackCover (persist onto
stages.comicPages.{cover|backCover} via the serialized updateStageWithLatest
series write tail) and renderVolumeCover/renderVolumeBackCover (persist onto
series.seasons[].{cover|backCover} via updateSeasonOnSeries) -- so the four
cover-render routes and the four orchestrator tools share ONE code path.
The persist keeps script-gate semantics (absent preserves, empty clears)
and serializes against a concurrent blur-save on the same record.
Refs #2220
This was referenced Jul 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds four cover-render creative tools so the Creative Director orchestrator (epic #2182) can render comic-issue and volume (season) covers, and extracts the enqueue+persist flow the routes and tools now share.
server/services/creative/tools/pipeline.js):pipeline_renderComicCover,pipeline_renderComicBackCover,pipeline_renderVolumeCover,pipeline_renderVolumeBackCover— each a thin conductor over a shared service entry point, charged asrenderagainst the daily action budget, with a Zod schema + OpenAI-functionparametersfragment mirroring the route's render knobs.jobId. That slot write used to live in the route factory (routes/pipeline/covers.js#makeCoverRenderHandler), so wrapping the bareenqueueComicCover-style service in a tool would silently drop orchestrated covers (the exact reason the tool was deferred in CDO Phase 1: Creative Tool Registry + gated dispatch (creative autonomy domain, budget, ledger) #2183).server/services/pipeline/visualStages.js):renderComicCover/renderComicBackCoverpersist ontostages.comicPages.{cover|backCover}through the serializedupdateStageWithLatestseries write tail;renderVolumeCover/renderVolumeBackCoverpersist ontoseries.seasons[].{cover|backCover}throughupdateSeasonOnSeries. The four cover-render routes now call these, shrinking the route factory to validation + dispatch + response shaping — so route and orchestrator share ONE code path.coverScript/backCoverScriptpreserves the persisted concept, an empty string clears it, so a render can't clobber a concurrent blur-save of the script field.Cover render is the primary deliverable of #2220; wrapping the remaining route-persisted render actions (comic page render / refine-render) as tools stays tracked on the issue.
Test plan
server/services/creative/toolRegistry.test.js— new cases: dispatchpipeline_renderComicCoverthrough the shared service + charge one render action;pipeline_renderVolumeCoversplits seriesId/seasonId from options; Zod gate rejects a call missing its required id.server/services/pipeline/visualStages.test.js— newrenderComicCover/renderComicBackCoverandrenderVolumeCover/renderVolumeBackCoverdescribe blocks asserting the proof/final slot lands withfromProofprovenance and the script-gate (absent preserves / present writes).server/routes/pipeline.test.js— updated thevisualStages.jsmock to drive persistence through the real issues/series write tails (persistence moved out of the route), keeping the cover-render route tests' preserve/clear assertions green.creative/+ the full server suite (excluding*.db.test.js): all branch-related tests pass. The only failures in the full run (visionCli,runner,dataRoot,installState) are pre-existing and environmental — confirmed identical on a clean checkout of this branch's base.Refs #2220