GeezerVison is showing github.com — id: rich presentation surfaces — versioned scene/audio/widget contract extension + Bevy renderers (F13.6 follow-on) · Issue #12657 · developing-today/code
id: rich presentation surfaces — versioned scene/audio/widget contract extension + Bevy renderers (F13.6 follow-on) #12657DescriptionWhat and why
Follow-on to #788 (F13.6), split out by the Q1 decision recorded on #788 on 2026-11-22: F13.6's first shell is contract-parity only, so the rich native surfaces its motivation names (3D, audio, native widgets) live here instead. Today's typed presentation has exactly one variant, WorldSurface::Screen; richer semantics cannot be claimed by a shell that only implements the screen/text view — they need a separately designed, versioned, host-validated presentation extension first (design of record: doc/2026-11-01_design_id788.md §7 steps 3–4, §6 conditional criteria).
Scope — two steps, in order, separate PRs
- Portable rich-presentation contract. Design and validate the minimal typed scene/audio/widget payloads in the existing optional
surface slot of the server view (or propose a separately versioned alternative if that slot cannot express them). Update host validation, the machine-readable contract (pkgs/id/contract/shell-contract.v1.json), and conformance/fallback tests in its own PR. Any new frame kind waits for the F11.12 gate — prefer the surface slot, which needs none.
- Bevy rich-surface renderers. Add renderers and a deterministic example world for only the payloads accepted in step 1, in
pkgs/id/crates/id-native-shell; world input stays on the same contract frames.
Acceptance criteria
- The selected surface schema has explicit versions, bounds, safe fallback behavior, contract/conformance coverage, and host-side validation before the Bevy renderer consumes it
- Old shells still render
view.data unchanged; malformed or oversized rich surfaces are refused by host validation
- A real session demonstrates each selected surface in the native shell, its transcript passes
id world contract --check, and an older shell's text fallback remains usable
- No WIT/component-model dependency: per the id: Phase 13 F13.6 native client shells on the shell contract #788 decision record, WIT (F12.8/id: F12.8 guest SDKs — Rust + Zig/AssemblyScript, component-model decision #1065) governs the guest ABI only and does not change the shell contract
Prerequisites
Size
XL (two sequenced steps; step 1 is the design-bearing one) Activitydeveloping-today commented on Nov 22, 2026 added app/idPackage/app: id (pkgs/ or apps/ in this repo) effort/lLarge: multi-day or open-ended; expect staged check-ins nextOrg Project gate: queued next — orchestrator adds to the board on Nov 22, 2026dezren39 commented on Nov 22, 2026
Triage of #12657 (queue task 21074) — premise checked against main on 2026-11-22; slice sequence below; slice 1a is enqueued as queue task 21075 (repo-health-code-pilot, queued).
Premise verdict
Holds:
- Shell contract is v1 revision 12 (
pkgs/id/contract/shell-contract.v1.json: version 1, revision 12). The server view frame carries an optional surface object, and the contract's feature note states a shell that does not understand the surface renders data — the fallback this issue relies on.
id-native-shell is a workspace member in pkgs/id/Cargo.toml and is excluded from default-members — the default id build carries no Bevy.
- Host validation is real, central, and already shaped the way step 1 needs:
parse_surface in pkgs/id/crates/id-core/src/world_presentation.rs dispatches on the document kind, enforces a per-kind payload struct (version == 1, deny_unknown_fields, per-kind MAX_* bounds, validate()), and is called by the host in pkgs/id/crates/id-worlds/src/world_session/view.rs, which refuses an invalid known-kind document with an error frame and caps the whole presentation at MAX_FRAME_BYTES.
- No new frame kind is needed: rich payloads ride the existing
surface slot, so the F11.12 gate is not triggered. The F13.1 conformance seam (id world contract --check, transcript tests) exists for the oracles below.
Stale / needs correcting in the issue text:
- "Today's typed presentation has exactly one variant,
WorldSurface::Screen" is no longer true. On current main the enum has three variants: Screen, Text (text/1 — the main mode for agents and scripts), and Form (structured input). The rich-surface gap itself is real (no scene/audio/widget kind), but step 1 extends a three-variant enum, not a one-variant one.
- Load-bearing constraint the issue does not name: every
WorldSurface variant must implement text_projection(), and the match is deliberately exhaustive with no wildcard arm — adding a variant without a deterministic, escape-free text projection is a compile error. That projection is the old-shell fallback for a rich kind, so it is designed per kind in step 1, not discovered in step 2.
- Forward-compat seam worth designing against:
parse_surface returns Ok(None) for an unknown kind, which drops the document to the legacy plain-text path — a rich document is automatically safe on an old host. But the duplicate-key rejection (id(world_presentation): parse_surface collapses duplicate JSON keys before its checks — a forbidden version, width, lines, or rows hidden behind a duplicate is accepted #6491/Design: a duplicate key is a parse error — one duplicate-key refusal contract for pkgs/id's checked JSON gates #6520 rule) currently names only screen/text/form; each new kind must be added to that guard or duplicate keys in a rich document take the lenient path.
- "Explicit versions" in the acceptance criteria means the established per-kind pattern (own payload struct,
version == 1 check), not one schema version for the slot as a whole.
Slice sequence (one PR each; step 1 splits into three)
Step 1 — contract (this issue's step 1 is three PRs, not one):
- 1a — Scene kind (contract only).
SceneSurface in world_presentation.rs: versioned payload, MAX_* bounds, validate(), text_projection(), parse_surface dispatch + duplicate-key guard; contract JSON surface documentation + revision bump; conformance cases for accept / refuse (malformed, oversized, bad version) / old-shell fallback. No renderer changes. Oracle: id-core world_presentation tests + id world contract --check on the new cases; default id build unchanged, id-native-shell builds unmodified. Prerequisites: none. Enqueued: task 21075.
- 1b — Audio kind. Same per-kind pattern; the slice carries the decision on what an audio payload may contain (bounded descriptive/metadata payload vs embedded bytes, sized by the validation caps). Oracle: same test/conformance shape as 1a. Prerequisites: 1a (pattern set; independent of 1c).
- 1c — Widget kind. Same pattern; the slice carries the explicit boundary against
Form (Form is structured input rendered by trusted adapters; widget is presentation). Oracle: same shape. Prerequisites: 1a (independent of 1b).
Step 2 — Bevy renderers in id-native-shell (per kind, matching "only the payloads accepted in step 1"):
- 2a — Scene renderer + deterministic example world. Real session demonstrates the scene surface, transcript passes
id world contract --check, older shell's text fallback remains usable. Prerequisites: 1a.
- 2b — Audio renderer. Prerequisites: 1b.
- 2c — Widget renderer. Prerequisites: 1c.
Dependency shape: 1a → {1b, 1c, 2a}; 1b → 2b; 1c → 2c. Step 2 does not have to wait for all of step 1 — 2a can start once 1a lands. Acceptance mapping: criterion 1 ← 1a–1c; criterion 2 ← 1a–1c (host refusal) + 2a (real-session fallback); criterion 3 ← 2a–2c; criterion 4 ← all slices (no WIT anywhere — WIT stays guest-ABI only, per the #788 record).
Later slices file under the same fix-family dedupe key (repo-health:v1:fix:developing-today/code:issue:12657, revive-on-enqueue) as each predecessor completes; only slice 1a is enqueued now, since 1b/1c scope details ride on 1a's landed pattern.
Labels
Applied per the sibling id-program feature convention (#12232, #12492): kind/feature, app/id, epic/id-program, source/agent, effort/l (no effort/xl label exists; effort/l is the largest and matches #788), next, priority/normal, queue/queued. The issue's XL size stands as written in its body — it is the two-step total; each slice above is a single PR. dezren39 commented on Nov 22, 2026
Lane AE (archer) picking up slice 1a of #12657 via queue task 21075: scene surface kind, contract only — versioned SceneSurface payload, bounds, validate(), text_projection(), parse_surface dispatch + duplicate-key guard, contract JSON documentation + revision bump, conformance cases. No renderer (2a), no audio/widget kinds (1b/1c). dezren39 commented on Nov 23, 2026
Slice 1b (audio surface contract) is done: PR #12843 merged as f06c0ee22f4cc4c2e5e9b8933f742a784b1b9da5.
Payload-content decision (the open question the triage left to this slice): descriptive cues only — no embedded bytes. An audio/1 document is a bounded list of cues; each cue names a sound (id, label) and describes it — format from the closed set (wav, ogg, mp3), duration_ms, repeat flag. No byte, URL, script or gain fields: a presenter resolves each cue id against the world's own assets and derives everything audible from the description. Rationale: surfaces are centrally validated presentation documents under a serialized-size cap and the frame budget; embedded media would blow both, duplicate the world's asset path, and force every presenter to carry a decoder for guest bytes. Same precedent as scene/1 (data only; renderers derive the rest).
What it proves: a guest audio/1 document now parses centrally in parse_surface with full host validation — per-kind version == 1, MAX_AUDIO_CUES 64, MAX_AUDIO_BYTES 64 KiB, MAX_AUDIO_DURATION_MS 3,600,000, unique safe cue ids, safe labels/title, durations in bounds — and Audio joins the duplicate-key guard. text_projection(): title (or Audio), then N. <label> (<format>; <duration> ms[; repeats]) per cue, pinned byte-exact by test. All-integer fields keep WorldSurface's derived Eq (no float caveat). Contract revision 13 → 14 with the audio/1 shape documented in the surface feature note; id-cli maps Audio to None like Form/Scene; the native shell's wildcard arm presents the text projection unchanged. Default build unchanged (no Cargo.toml touched).
Verification:
- Failing-first (tests-only commit
a1f09f446, fleet-run 45101105846): world_presentation suite 45 passed / 2 failed — exactly the new audio tests.
- Final (fleet-run 45105557422,
cargo test -p id-core -p id-worlds -p id-cli --no-fail-fast, pkgs/id dev shell): 2,621 passed / 1 failed across 34 targets; both audio tests green.
- The one failure is pre-existing on main and unrelated:
cli::tests::test_command_lists_cover_all_clap_subcommands ("README CLI Commands table omits walk" — the walk subcommand landed via id: walking skeleton for #9106 — a signed record at an id:// address synced between two nodes #12232's B3 commits after 1a's green run; this slice's diff touches no CLI/README files). Recorded on id: walking skeleton for #9106 — a signed record at an id:// address synced between two nodes #12232 (comment 7090694166).
- Not gated on
cargo fmt --check in the fleet image: its rustfmt reformats main's own committed scene code too (pre-existing toolchain style drift); the new code mirrors main's committed formatting, as 1a did.
Remainders, per the triage sequence: 1c (widget kind) is unblocked and independent; 2b (audio renderer) is unblocked by this slice; 2a (scene renderer) remains unblocked by 1a. #12657 stays open. dezren39 commented on Nov 23, 2026
🤖 Agent note · claimed — slice 1c (widget kind) of the rich-presentation contract (Lane KY, archer)
Premise + ownership check (fresh gh REST, 2026-11-23 ~01:41 CST): #12657 OPEN; slices 1a (scene, PR #12824-line) and 1b (audio, PR #12843) landed; Lane BO's done record names 1c (widget kind) as unblocked and independent. No live claim on 1c. Slices 2a/2b (Bevy renderers) are separate and not touched here.
Scope: mirror the 1a/1b pattern for a widget/1 payload in the existing surface slot — central parse + host validation in parse_surface, a pinned text_projection(), duplicate-key guard coverage, contract revision bump, the surface feature note updated, id-cli mapping like Form/Scene/Audio, conformance tests failing-first. Payload-content decision (following the audio precedent: data only, no bytes/URLs/scripts): a bounded list of widget controls, each with a safe id, a kind from a closed set, and a safe label; any action is named by id and resolved by the presenter against the world's own surface actions, never a URL or script. dezren39 commented on Nov 23, 2026
🤖 Agent note · slice 1c (widget kind) landed — Lane KY (archer), 2026-11-23
Landed: PR #13138 merged (ecc05bd6105, head d1e7ef3c406 SHA-guarded; verified on main: contract revision 15, WidgetSurface present in world_presentation.rs).
Payload-content decision (following the 1b audio precedent — descriptive data only): a widget/1 document is a bounded list of controls; each control has a safe id, a safe label, and a kind from a closed set (button, toggle, link); a toggle carries its current state (on); where a control acts it names a world action by id, resolved by the presenter against the world's own actions (the audio-cue precedent). No URLs, scripts or embedded payloads (deny_unknown_fields at every level); a link's action is required.
What it proves: a guest widget/1 document parses centrally in parse_surface with full host validation — per-kind version == 1, MAX_WIDGET_CONTROLS 64, MAX_WIDGET_BYTES 64 KiB, unique safe ids, safe labels and action ids — the duplicate-key guard covers the kind, and text_projection() is pinned byte-exact by test (title or Widgets, then N. <label> (<kind>[; on|off][; action <id>])). Contract revision 14 → 15 with the widget/1 shape documented in the surface feature note; id-cli maps Widget to the JSON-lines presentation like Form/Scene/Audio; the native shell's wildcard arm presents the text projection unchanged. The forward-compat test that recorded widget as an unknown kind now records it as known. Default build unchanged (no Cargo.toml touched).
Verification: cargo test -p id-core -p id-worlds -p id-cli --no-fail-fast (laptop, pkgs/id dev shell): 2,683 passed / 1 failed across 40 suites; both new widget tests green; all 49 world_presentation tests green (re-run after a formatting-only pass). The one failure is pre-existing on main and unrelated — cli::tests::test_command_lists_cover_all_clap_subcommands ("README CLI Commands table omits walk"), recorded on #12232 and reproduced on pristine main by the 1b run; this diff touches no CLI command or README surface.
Remainders: step 1 of the contract is now complete (scene 1a, audio 1b, widget 1c). What remains is step 2 — the Bevy renderers: 2a (scene renderer, unblocked by 1a), 2b (audio renderer, unblocked by 1b), and 2c (widget renderer, unblocked by this slice), each in pkgs/id/crates/id-native-shell with the deterministic example world. #12657 stays open. dezren39 commented on Nov 23, 2026
Claim — Lane QD (archer, sandbox fix lane), 2026-11-23.
Taking #12657 step 2a: the Bevy scene renderer in pkgs/id/crates/id-native-shell, with deterministic example-world coverage for the scene surface.
Premise + ownership check (fresh gh reads, 2026-11-23): #12657 OPEN; step 1 of the contract is complete (1a scene, 1b audio PR #12843, 1c widget PR #13138; contract revision 15, SceneSurface/AudioSurface/WidgetSurface in world_presentation.rs). KY's done record names 2a (scene renderer) as unblocked and independent. No live claim on step 2 — the newest comments on this issue are KY's 1c claim/done pair. Slices 2b (audio) and 2c (widget) are not touched here.
Plan: follow how the native shell currently presents surfaces (today the wildcard arm presents the text projection) and add a real scene renderer consuming only the host-validated SceneSurface contract types from id-core; a deterministic example world emitting a scene surface; tests in the crate's existing style. Land as a PR referencing this issue; #12657 stays open on 2b/2c. dezren39 commented on Nov 23, 2026
Step 2a landed — Lane QD (archer), 2026-11-23. PR #13214 merged (082f0e347098, head 8bbb7f479de SHA-guarded).
What landed (all in pkgs/id/crates/id-native-shell):
scene::SceneModel — the pure render model, mirroring render::ScreenGrid's separation: a host-validated SceneSurface becomes node models (shape, position, size carried through from the contract types) plus derived visuals in one testable place. The contract carries no visual fields beyond shape/position/size, so the derivation is defined here: fixed hue family per shape, lightness stepped deterministically by the node id's FNV-1a hash; camera framing from the scene's bounds (centroid target, bounding-sphere standoff along a fixed direction).
scene::SceneRenderPlugin — reads the existing PresentedView (world input stays on the same contract frames; no new frame kinds): per view-sequence change it despawns the old scene's nodes, reframes the camera, and spawns one entity per node (cuboid / unit sphere scaled to extents / ground plane; StandardMaterial in the derived color; contract position). Non-scene views clear the scene. The binary registers it beside ShellRenderPlugin.
scene::example_scene — the deterministic example world for this surface: a Harbor scene (water plane, dock box, buoy sphere, beacon point) covering the closed shape set; tests present exactly this document through the session-frame seam.
- bevy gains the
bevy_pbr feature on the existing step-2 render wiring; no new system libraries.
Verification: cargo nextest run -p id-native-shell 81 passed / 0 failed (8 new scene tests: determinism, document-order geometry, shape-keyed colors, camera framing, one-entity-per-node, clear-on-non-scene, text-projection parity, scene-only from_view); cargo fmt clean; clippy clean in the new module.
Side finding, filed: the full clippy-native-shell gate is red on main for an unrelated reason — id-store/src/admission.rs (PR #13156, #10192) trips the denied expect_used lint at 9 sites. Filed as #13207 with the fix shape; this slice did not touch id-store.
Remainders on #12657: step 2b (audio renderer, unblocked by 1b) and 2c (widget renderer, unblocked by 1c), each the same two-layer shape in id-native-shell. The issue-level acceptance item "a real session demonstrates each selected surface" completes when 2b/2c land; 2a's demonstration here is the headless Bevy app + session-frame seam, matching how the screen renderer's own tests demonstrate presentation. dezren39 commented on Nov 23, 2026
Claim — Lane SY (archer, sandbox fix lane), 2026-11-23.
Taking #12657 step 2b: the Bevy audio renderer in pkgs/id/crates/id-native-shell, following the two-layer shape step 2a (PR #13214) established for the scene renderer — a pure render model over the host-validated audio surface from step 1b, a Bevy plugin consuming PresentedView, a deterministic example, and tests. Step 2c (widget renderer) is NOT in my claim.
Premise + ownership check (fresh, 2026-11-23T11:36Z): issue open; step 1 complete (1a/1b/1c landed), 2a landed via PR #13214; QD's done record names 2b/2c as the remainders; no live claim on either. dezren39 commented on Nov 23, 2026
Step 2b landed — Lane SY (archer), 2026-11-23. PR #13244 merged (7fecf882f614, head 538f48fe95f SHA-guarded); the change is verified present on main.
What landed (all in pkgs/id/crates/id-native-shell):
audio::AudioModel — the pure presentation model, mirroring scene::SceneModel's separation: a validated AudioSurface becomes a cue schedule — cues sound one at a time in document order, each starting when the previous ends; a repeating cue loops until the view changes, so cues behind it wait indefinitely and the schedule total is open-ended (total_ms: None). Each cue also carries a derived fallback tone (13 semitone steps over the octave above 220 Hz, stepped by the cue id's FNV-1a hash) for presenters holding no world asset for the cue. cue_phase() is the pure phase function (Waiting / Sounding / Looping / Finished) shared by the plugin and the tests.
audio::AudioRenderPlugin — reads the existing PresentedView (world input stays on the same contract frames): per view-sequence change it despawns the old view's cue entities and spawns one entity per cue with its prescribed CueSchedule; a chained system keeps a Sounding marker on exactly the cues the phase function calls audible at the view's playhead. Non-audio views clear the entities and playback state. The binary registers it beside SceneRenderPlugin.
audio::example_audio — the deterministic example world's audio: the harbor of example_scene (buoy bell, gulls, looping waves).
Scope boundary (stated on the PR too): the plugin owns presentation state only. The crate's Bevy feature set has no audio output backend — bevy_audio would pull rodio/cpal and need ALSA system wiring in the flake — so device playback is a later wiring step over the same entities and schedule. No new Cargo features were added in this slice.
Verification: cargo nextest run -p id-native-shell 91 passed / 0 failed (81 baseline + 10 new audio tests: determinism, back-to-back schedule + open-ended total, tone bounds, phase function incl. repeat looping and cues-behind-a-repeat, from_view gating, entity spawn + schedule fields, first-cue Sounding marker, clear-on-non-audio, text-projection parity); cargo fmt --check clean; clippy has no findings in the new module (cap-lints verification run; the un-capped workspace run still stops earlier on the pre-existing id-store expect() sites tracked by #13207, untouched). Remote dispatch not used — the fleet-build container cannot run nix develop (the #13159-family gap); the laptop route is the verifying route, and main CI is the gate per repo policy.
Remainder on #12657: step 2c (widget renderer, unblocked by 1c) — the same two-layer shape in id-native-shell. The issue-level acceptance item "a real session demonstrates each selected surface" completes when 2c lands; 2b's demonstration here is the headless Bevy app + session-frame seam, matching how 2a demonstrated the scene surface. dezren39 commented on Nov 23, 2026
Claim — Lane VC (archer, sandbox fix lane), 2026-11-23.
Taking #12657 step 2c: the Bevy widget renderer in pkgs/id/crates/id-native-shell, following the two-layer shape steps 2a (PR #13214, scene) and 2b (PR #13244, audio) established — a pure render model over the host-validated widget surface from step 1c, a Bevy plugin consuming PresentedView, a deterministic example, and tests.
Premise + ownership check (fresh, 2026-11-23T12:24Z): issue open; steps 1a/1b/1c and 2a/2b landed; SY's done record names 2c as the sole remaining slice and explicitly did not claim it; no live claim on 2c. dezren39 commented on Nov 23, 2026
Step 2c landed — Lane VC (archer), 2026-11-23. PR #13266 merged (795b2401de35, head 1fde2dd4e606 SHA-guarded); widget.rs verified present on main.
What landed (all in pkgs/id/crates/id-native-shell):
widget::WidgetModel — the pure presentation model, mirroring scene::SceneModel / audio::AudioModel: a validated WidgetSurface becomes control models in document order, one per row, carrying kind, label, action and toggle state, plus the derivations this renderer owns — an accent color (fixed hue family per kind: button blue, toggle green, link violet; lightness stepped by the control id's FNV-1a hash, mirroring scene::node_color) and the focus order (controls delivering an action are focusable, display-only controls are not; focus starts on the first focusable control; focus_step is the pure wrap-around navigation rule skipping display-only controls).
widget::WidgetRenderPlugin — reads the existing PresentedView: per view-sequence change it despawns the old view's control entities and spawns one entity per control with its prescribed ControlPlacement; a chained system keeps the Focused marker on exactly the control the focus state names. Non-widget views clear the entities and focus state. Registered in the binary beside SceneRenderPlugin and AudioRenderPlugin.
widget::example_widgets — the deterministic example world's widget document: the harbor controls (Start button, Lights toggle on, Enter-the-harbor link) — the same document the step-1c contract tests project.
Scope boundary (stated on the PR too): the plugin owns presentation state only. Capturing keyboard/pointer input, moving focus with it, and delivering a focused control's named action to the world are later wiring steps over these same entities and the model's pure navigation functions — the same boundary 2b drew at device playback. No new Cargo features were added.
Verification: cargo nextest run -p id-native-shell 101 passed / 0 failed (91 baseline + 10 new widget tests: determinism, stack order + state carriage, display-only focus skipping, wrap-around navigation incl. the no-focusable case, accent kind families, from_view gating, entity spawn + placement fields, initial Focused marker, clear-on-non-widget, text-projection parity); cargo fmt --check clean; clippy cap-lints run has no findings in the new module (the un-capped workspace run still stops earlier on the pre-existing id-store expect() sites tracked by #13207, untouched). Remote dispatch not used — the fleet-build container cannot run nix develop (the #13159-family gap); the laptop route is the verifying route, and main CI is the gate per repo policy.
Issue disposition — closing as completed. Step 2c was the last named remainder (SY's 2b record). Against the acceptance criteria: the step-1 schema work (1a/1b/1c) delivered explicit versions, bounds, safe fallback, contract/conformance coverage and host validation before any renderer consumed the surfaces; old shells keep rendering view.data / the text projections unchanged (parity tests in the suite); each selected surface is now demonstrated in the native shell through the headless Bevy app + session-frame seam — scene (2a), audio (2b), widget (2c) — with the transcript/contract tests in the same suite green; and no WIT/component-model dependency was introduced. If the program owner wants a live-host demonstration held to a separate bar, reopen with that bar named.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|