Adversarial review of the previous commit found four real defects, all
confirmed:
1. A run covering more than one scene (the whole-timeline H3 shape, or any
single-scene click whose gen-unit has sibling subclips) only ever sent
the FIRST scene id as extra_data.funpack_scene_id. On reload mid-run,
reattach recovered just that one id, so _recordSegment only ever wrote
the finished media onto scene 1 -- every other scene the job actually
rendered silently got nothing recorded, no error shown.
Fixed by adding funpack_scene_ids (plural) alongside the existing
singular field, threaded through client.js's queuedFor and session.js's
reattach() (both additive -- a new optional third onAdopt argument and
a new optional response field, ignored by every existing caller such as
app/boot.js) down to generate_bridge.js/store.js, which now record onto
every adopted scene.
2 & 3. A run adopted on reload never primed pollStart/genWallStart, so
_elapsed() and the transport button's own clock read time since the
Unix epoch instead of real elapsed time, and never stopped afterward --
wedging genElapsed() for the rest of the session (its own guard is "if
already started, do nothing"). Fixed: the "adopt" handler now primes
both clocks (flagged approximate, same as the deleted
resumeRunningGeneration used to), and every terminal run phase now
stops them.
4. check()'s `notes` field (e.g. "N settings didn't reach the pipeline")
was fired through transport.warn() but nothing ever subscribed to
GenerateBridge's "warn" event -- silently dropped, reproducing the
exact bug class the deleted code's own comment said must not recur.
Fixed: wired into state.notice, same as the old code did.
New tests added for both the plural-scene-id path (client.test.js,
session.test.js) and the fallback-to-one-scene case. 691/692 JS tests and
548/548 Python tests pass (the one JS failure is the pre-existing,
unrelated projects.test.js import-race flake). Live-verified against the
dev server: a multi-scene GenerateBridge.generate() call still correctly
surfaces a real pipeline refusal with no console errors.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>