refactor(producer): flag cfg.forceScreenshot mutation as distributed-render TODO

Add a `TODO(distributed-render):` comment near the `applyRenderModeHints`
call documenting that this caller-owned-object mutation needs to move
into the result type before `freezePlan` wires up. The mutation pattern
works in-process but won't survive across processes / replays from a
frozen plan — the value belongs in `LockedRenderConfig`, not on a
mutated `EngineConfig`.

No behavior change. Comment-only.

Review feedback addressed: vanceingalls on #718.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
James
2026-05-11 19:00:59 +00:00
co-authored by Claude Opus 4.7
parent 4f648c8122
commit d168397758
@@ -70,6 +70,11 @@ export async function runCompileStage(input: CompileStageInput): Promise<Compile
const compiled = await compileForRender(projectDir, htmlPath, join(workDir, "downloads"));
assertNotAborted();
const compileOnlyMs = Date.now() - compileStart;
// TODO(distributed-render): `applyRenderModeHints` mutates `cfg.forceScreenshot`
// on a caller-owned object. Before freezePlan wires up, this side-effect
// needs to move into the result (e.g. `forceScreenshot: boolean` on
// `CompileStageResult`) so the value can be baked into `LockedRenderConfig`
// and survive across processes / replays.
applyRenderModeHints(cfg, compiled, log);
writeCompiledArtifacts(compiled, workDir, Boolean(job.config.debug));