Slides: a scene change must fit one live update, checked before it lands
Data within 960 KiB of canonical JSON could still encode past the 1 MiB a posted update may be: 150,000 copies of 0.1 are 600,001 bytes of JSON and a 1,350,029-byte update. The editor took the edit locally and then its save was refused; the API stored it, so no editor could save that scene again. Ruling: keep the 960 KiB JSON limit, and also refuse a batch carrying add_scene or set_scene whose update would exceed 1 MiB (live.go's maxUpdateBytes). The core's apply_ops and fixtures/ops.mjs both apply such a batch to a copy of the document first and measure its update; past the cap they refuse with the same developer message, having written nothing (the JS error carries tooBig). The editor's data panel shows the approved "data too big" words and keeps the edit in its field. Docs (scenes.md, api.md), the deck comment and the plan's limit line say number-heavy data encodes larger than its JSON. Tests: core/tests/scene_update.rs, fixtures/scene-update.test.mjs, TestASceneChangePastOneUpdateIsRefused (Go core), TestTheAPIRefusesASceneChangePastOneUpdate and the browser test TestSceneDataPastOneUpdateIsRefused: 150,000 tenths refused, 116,000 (just under the cap) taken. Wasm, bundle and credits rebuilt.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 files changed,
+467
−54
core/src/ops.rs+36 −1core/src/scene.rs+11 −3core/tests/scene_update.rs+121 −0core/tests/scenes.rs+2 −2docs/api.md+8 −2docs/scenes.md+9 −1docs/superpowers/plans/2026-11-24-scenes-and-clips.md+1 −1fixtures/ops.mjs+32 −0fixtures/scene-data.mjs+16 −11fixtures/scene-update.test.mjs+76 −0fixtures/scenes.mjs+7 −1fixtures/scenes.test.mjs+2 −2internal/slides/agent_edit_contract.go+3 −2internal/slides/core/core_test.go+22 −0internal/slides/core/testdata/slides_core.wasmbinaryinternal/slides/core/testdata/slides_core.wasm.stamp+2 −2internal/slides/credits/assets.json+2 −2internal/slides/deck/scenes.go+7 −4internal/slides/live.go+5 −1internal/slides/static/{editor.3402a720a42a04c0.js => editor.9dd5fa8c96e57356.js}+19 −19internal/slidestest/scenes_final_browser_test.go+44 −0internal/slidestest/scenes_test.go+42 −0
core/src/ops.rsLoading diff…
core/src/scene.rsLoading diff…
core/tests/scene_update.rsLoading diff…
core/tests/scenes.rsLoading diff…
docs/api.mdLoading diff…
docs/scenes.mdLoading diff…
docs/superpowers/plans/2026-11-24-scenes-and-clips.mdLoading diff…
fixtures/ops.mjsLoading diff…
fixtures/scene-data.mjsLoading diff…
fixtures/scene-update.test.mjsLoading diff…
fixtures/scenes.mjsLoading diff…
fixtures/scenes.test.mjsLoading diff…
internal/slides/agent_edit_contract.goLoading diff…
internal/slides/core/core_test.goLoading diff…
internal/slides/core/testdata/slides_core.wasmLoading diff…
internal/slides/core/testdata/slides_core.wasm.stampLoading diff…
internal/slides/credits/assets.jsonLoading diff…
internal/slides/deck/scenes.goLoading diff…
internal/slides/live.goLoading diff…
internal/slides/static/{editor.3402a720a42a04c0.js => editor.9dd5fa8c96e57356.js}Loading diff…
internal/slidestest/scenes_final_browser_test.goLoading diff…
internal/slidestest/scenes_test.goLoading diff…