Slides: scene ids keep the id pattern; no __proto__ keys in scenes
Task 2 review, fix round 2. - Raw live updates: sceneRefusal returns an error, never an empty-id sentinel, so a scene under the empty id no longer slips through. It also refuses a scene id outside the document's pattern (12 lowercase base32), "__proto__" as a state id, word key or data key, and data over 960 KiB, for scenes the update added or changed. - Ops (Rust and JS) refuse the same: scene ids must match the pattern, and "__proto__" is refused as a state id, a word key and anywhere in data, because lib0's decoder would lose it in the browser. - Version vectors keep __proto__ only as text; the scenes vector uses legal ids, and a new JS test decodes every vector's bytes and views them. Poison shapes scenenoid, scenebadid and sceneproto.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 files changed,
+514
−215
core/src/ops.rs+5 −1core/src/scene.rs+29 −0core/tests/scenes.rs+140 −52docs/api.md+9 −4fixtures/data/scenes.json+15 −15fixtures/poison.mjs+21 −12fixtures/scenes.mjs+13 −1fixtures/scenes.test.mjs+86 −51fixtures/vectors/scene-version.json+4 −4fixtures/vectors/scenes.view.json+21 −22fixtures/vectors/scenes.yjsbinaryfixtures/view.test.mjs+11 −0internal/slides/agent_edit_contract.go+2 −1internal/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+35 −0internal/slides/live.go+2 −2internal/slides/scene_writes.go+34 −15internal/slides/scene_writes_test.go+47 −0internal/slides/static/editor.82163de0c34fe9a9.js+0 −18internal/slides/static/editor.9c05be46d0d57612.js+18 −0internal/slidestest/scenes_test.go+18 −13internal/slidestest/testdata/poison/scenebadid.yjsbinaryinternal/slidestest/testdata/poison/scenedata.yjsbinaryinternal/slidestest/testdata/poison/scenenoid.yjsbinaryinternal/slidestest/testdata/poison/sceneproto.yjsbinary
core/src/ops.rsLoading diff…
core/src/scene.rsLoading diff…
core/tests/scenes.rsLoading diff…
docs/api.mdLoading diff…
fixtures/data/scenes.jsonLoading diff…
fixtures/poison.mjsLoading diff…
fixtures/scenes.mjsLoading diff…
fixtures/scenes.test.mjsLoading diff…
fixtures/vectors/scene-version.jsonLoading diff…
fixtures/vectors/scenes.view.jsonLoading diff…
fixtures/vectors/scenes.yjsLoading diff…
fixtures/view.test.mjsLoading diff…
internal/slides/agent_edit_contract.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/scene_writes.goLoading diff…
internal/slides/scene_writes_test.goLoading diff…
internal/slides/static/editor.82163de0c34fe9a9.jsLoading diff…
internal/slides/static/editor.9c05be46d0d57612.jsLoading diff…
internal/slidestest/scenes_test.goLoading diff…
internal/slidestest/testdata/poison/scenebadid.yjsLoading diff…
internal/slidestest/testdata/poison/scenedata.yjsLoading diff…
internal/slidestest/testdata/poison/scenenoid.yjsLoading diff…
internal/slidestest/testdata/poison/sceneproto.yjsLoading diff…