Skip to content

feat(positron): runtime wall projector (task #89 Unit 2) - #1735

Merged
joelteply merged 2 commits into
canaryfrom
feat/positron-wall-projector
Jul 3, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/positron-wall-projector

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

The runtime wall projector — the sibling of the chat projection (task #89 Unit 2, following the merged Unit 1 wall contract #1734). It projects the room's pinned board (airc WallPostPublished supersede chain) into a renderer-shaped kind="wall" WallViewState on the thin-client substrate, so a wall widget is defined once for web / terminal / mobile / AI-observer surfaces.

How

  • ipc/positron_wall_source.rs (new) — WallProjection folds two bus streams for one room:
    • wall:changed → RE-READ airc's authoritative Airc::wall_posts() through the existing WallReader seam. It never re-implements the supersede fold (one supersede impl, in airc — the continuum side is a cache of airc's truth). The signal carries only room_id; the board comes from the authoritative re-read, never from one delta.
    • presence:updated → the wall carries only a published_by peer id, so the projector resolves each author's name / kind / badges / provenance from the roster exactly as the chat projection resolves a sender, and re-projects so a post pinned before its author's card arrived upgrades in place. Attribution woven in from day one.
  • airc/inbound_attach.rs — added wall_changed_from_event: a TranscriptKind::WallPostPublished event classifies into a thin wall:changed re-read cue (room-id only, no content).
  • ipc/positron_source.rs — compression: extracted resolve_identity + roster_slots_from as pub(crate) helpers, reused by both projections (one identity-resolution decision, one place). Chat behavior unchanged.
  • ipc/mod.rs — spawn-wired under the same (socket, room) precondition as the presence emitter, with a dedicated node continuum-wall heartbeat-less lurker as its WallReader so the board renders with zero resident personas.

Doctrine

  • Fail loud, no fabrication — a read failure keeps the last-good board (reader owns reconnection); a failed node-reader attach disables the projection loudly. Never an empty/fabricated board.
  • Re-read, not re-fold — the supersede projection stays airc-owned.

Tests

  • 5 wall-projector: project-into-substrate, author-upgrades-on-presence, empty-board-is-valid, foreign/malformed-skip, monotonic-revision.
  • 1 inbound-attach classification (wall:changed cue, no content).
  • Regression-safe: chat projection (10) and inbound-attach (now 6) still green.

cargo check --features metal,accelerate -p continuum-core clean; targeted tests pass.

🤖 Generated with Claude Code

Project the room's pinned board (airc WallPostPublished supersede chain)
into a renderer-shaped `kind="wall"` WallViewState on the thin-client
substrate — the sibling of the chat projection, so a wall widget is
defined once for web / terminal / mobile / AI-observer surfaces.

The projector RE-READS airc's authoritative `Airc::wall_posts()` via the
existing WallReader seam on each change, rather than re-implementing the
supersede fold (one supersede impl, in airc). Two bus streams drive it:

- `wall:changed` — a WallPostPublished transcript event landed for the
  room; inbound_attach classifies it into a thin room-id-only re-read cue
  (never the post content — the board can't be rebuilt from one delta).
- `presence:updated` — the roster changed; the wall carries only a
  published_by peer id, so the projector resolves each author's name /
  kind / badges / provenance from the roster exactly as the chat
  projection resolves a sender, and re-projects so a post pinned before
  its author's card arrived upgrades in place. Attribution woven in from
  day one ([[positron-identity-security-first-class]]).

Compression: extracted `resolve_identity` + `roster_slots_from` as
pub(crate) helpers in positron_source, reused by both projections — one
identity-resolution decision, one place. A read failure keeps the
last-good board (reader owns reconnection), never blinks it empty; a
failed node-reader attach disables the projection loudly, never
fabricates a board ([[fallbacks-are-illegal-fail-loud]]).

Spawn-wired in ipc/mod.rs under the same (socket, room) precondition as
the presence emitter, with a dedicated node "continuum-wall" lurker as
its WallReader so the board renders with zero resident personas.

Tests: 5 wall-projector (project, author-upgrade, empty-board,
foreign/malformed skip, monotonic revision) + 1 inbound-attach
classification; chat projection (10) and inbound (now 6) still green.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…-up)

The spawned review of PR #1735 flagged three loop branches as trust-me
(the consume loop is an infinite `recv().await`, so its Lagged / Closed /
foreign-room guards had no coverage) and one distinct resilience contract
that no test pinned (a read failure keeps the last-good board, never
blinks it empty — different from the RagSource path's read-fresh).

Factor the loop's per-event decision into a pure `fold_recv` helper
(returns LoopStep::Continue | Stop) so those branches are unit-testable
without racing a live broadcast channel, and add three tests:

- read_error_keeps_the_last_good_board — a wall_posts() failure keeps the
  last board (extends the test StubReader with the same set_fail toggle
  wall_source::tests already uses; one fixture pattern, not a parallel
  mock).
- lagged_re_reads_to_re_establish_coherence — the projector's one
  improvement over chat: Lagged RE-READS rather than continuing stale.
- closed_channel_stops_the_loop_and_foreign_room_is_not_re_read — Closed
  stops the loop; a foreign room's wall:changed does not thrash our board.

Re-export BusEvent from runtime so the helper's signature is nameable in
the test. No behavior change to run_wall_loop (same branches, now via the
extracted helper). 8/8 wall tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply

Copy link
Copy Markdown
Contributor Author

Spawned review came back clean and mergeable (no blockers). Both should-fixes were test-coverage gaps for behavior this PR uniquely introduces — addressed in a606f3ac4:

  • read-error-keeps-last-board — the projector's distinct resilience contract (a wall_posts() failure keeps the last-good board, never blinks empty) is now pinned. Extends the test StubReader with the same set_fail toggle wall_source::tests already uses (one fixture pattern, no parallel mock).
  • Lagged → re-read — the projector's one improvement over the chat projection (Lagged re-reads authoritatively rather than continuing stale) is now pinned via an extracted, testable fold_recv helper.
  • Bonus: Closed → stop and the foreign-room guard (was "trust-me" per the review) are now covered too.

8/8 wall tests pass; full lib cargo check --features metal,accelerate clean.

The one design-level note (a static roster's sole presence:updated emit can be missed by a late subscriber, leaving authors provisional) is shared with the already-merged chat projection — not introduced here — so it's tracked as a follow-up, not gated on this unit.

@joelteply
joelteply merged commit c102608 into canary Jul 3, 2026
4 checks passed
@joelteply
joelteply deleted the feat/positron-wall-projector branch July 3, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant