oficina / slides Public

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>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 6e51bedea6da091b13c454472e7153f6c0ff9186 parent 4b0250e
22 files changed, +467 −54
  • core/src/ops.rs +36 −1
  • core/src/scene.rs +11 −3
  • core/tests/scene_update.rs +121 −0
  • core/tests/scenes.rs +2 −2
  • docs/api.md +8 −2
  • docs/scenes.md +9 −1
  • docs/superpowers/plans/2026-11-24-scenes-and-clips.md +1 −1
  • fixtures/ops.mjs +32 −0
  • fixtures/scene-data.mjs +16 −11
  • fixtures/scene-update.test.mjs +76 −0
  • fixtures/scenes.mjs +7 −1
  • fixtures/scenes.test.mjs +2 −2
  • internal/slides/agent_edit_contract.go +3 −2
  • internal/slides/core/core_test.go +22 −0
  • internal/slides/core/testdata/slides_core.wasm binary
  • internal/slides/core/testdata/slides_core.wasm.stamp +2 −2
  • internal/slides/credits/assets.json +2 −2
  • internal/slides/deck/scenes.go +7 −4
  • internal/slides/live.go +5 −1
  • internal/slides/static/{editor.3402a720a42a04c0.js => editor.9dd5fa8c96e57356.js} +19 −19
  • internal/slidestest/scenes_final_browser_test.go +44 −0
  • internal/slidestest/scenes_test.go +42 −0
core/src/ops.rs

Loading diff…

core/src/scene.rs

Loading diff…

core/tests/scene_update.rs

Loading diff…

core/tests/scenes.rs

Loading diff…

docs/api.md

Loading diff…

docs/scenes.md

Loading diff…

docs/superpowers/plans/2026-11-24-scenes-and-clips.md

Loading diff…

fixtures/ops.mjs

Loading diff…

fixtures/scene-data.mjs

Loading diff…

fixtures/scene-update.test.mjs

Loading diff…

fixtures/scenes.mjs

Loading diff…

fixtures/scenes.test.mjs

Loading diff…

internal/slides/agent_edit_contract.go

Loading diff…

internal/slides/core/core_test.go

Loading diff…

internal/slides/core/testdata/slides_core.wasm

Loading diff…

internal/slides/core/testdata/slides_core.wasm.stamp

Loading diff…

internal/slides/credits/assets.json

Loading diff…

internal/slides/deck/scenes.go

Loading diff…

internal/slides/live.go

Loading diff…

internal/slides/static/{editor.3402a720a42a04c0.js => editor.9dd5fa8c96e57356.js}

Loading diff…

internal/slidestest/scenes_final_browser_test.go

Loading diff…

internal/slidestest/scenes_test.go

Loading diff…