Skip to content

feat(positron): converge roster projection — one neutral RoomMember→RosterSlotView both rails read (#8/#13) - #1748

Merged
joelteply merged 4 commits into
canaryfrom
feat/roster-projection-converge
Jul 3, 2026
Merged

joelteply merged 4 commits into
canaryfrom
feat/roster-projection-converge

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

Kills the parallel roster derivation between the WS widget rail (ChatProjection) and the persona grounding rail (RoomRosterSource) — the compression violation task #8/#13 targets. Both projected the same airc RoomMember and dropped different fields: Rail A kept availability + last_seen_ms; Rail B silently dropped them.

Now there is one neutral superset projection — roster_slot_from_member(&RoomMember) -> RosterSlotView — and both rails call it. This is the personaRag leg of the "web + terminal + personaRag off one seam" north-star.

How

  • positron package (neutral, publicly-reusable): RosterSlotView gains availability: Option<String> (airc's stable snake_case label — ready/busy/away — transported verbatim, never a positron-side enum; same not-interpreted discipline as provenance.runtime/integrations) + last_seen_ms: u64. Additive + #[serde(default)] → wire-safe.
  • continuum-core: deleted the hand-copied AircPresenceSlot twin (RosterSlotView already derives Serialize/Deserialize, so the neutral view is the wire shape) and the now-identity roster_slots_from. Collapsed the two provisional-name fallbacks into one.
  • Rail A formats its grounding line from the shared slot — availability + recency now survive into the persona's [Present in this room] block.
  • Test drift-proofing: the projector tests hand-authored camelCase presence JSON (the "hand-copied JSON literal" the module doc forbids, which the type change exposed) — replaced with #[cfg(test)] helpers that serialize the real AircPresenceUpdate.
  • Extracted project_room_roster (the delivery→grounding fold) out of serve_persona_loop into a pure pub(crate) fn beside build_workspace_turns — behavior-preserving, and the seam a deterministic integration test can drive.

Proof

Leg Status
web + terminal ✅ merged crossConsumer.spec + shared projection
personaRag convergence ✅ unit + wire (ts-rs regen + re-vendor) + a deterministic end-to-end test: present RoomMember → RoomRosterSource.deliver → project_room_roster → prompt_assembly lands win-claude [claude] — busy in the live [Present in this room] block
live core ✅ rebooted onto this branch; persona reads the channel + takes turns; assembly intact

Transcript/ChannelDigest path intentionally untouched — display (flat ring) and cognition (consolidated digest) are legitimately different projections; sharing the ChannelElement upstream is a separate follow-up.

Honest caveat: the live [Present in this room] block does not render on this host because airc presence returns no member (0 route(s) healthy; separate persona airc homes) — the known event/presence-wake gap (#16/#84), upstream of and independent from this change. The deterministic integration test covers that seam without depending on presence.

Validation

  • continuum-positron: 88 tests; continuum-core roster/positron-projector/prompt-assembly/service_loop: green (incl. the new e2e seam test); ts-rs bindings regenerated + re-vendored to sdk/typescript.
  • chat-view / web / sdk / tui: typecheck + vitest all pass.

🤖 Generated with Claude Code

joelteply and others added 2 commits July 3, 2026 14:20
…osterSlotView both rails read (#8/#13)

The persona's room-presence grounding (Rail A, RoomRosterSource) and the WS
widget roster (Rail B, ChatProjection) independently projected the SAME airc
`RoomMember` and dropped DIFFERENT fields: Rail A kept availability +
last_seen_ms; Rail B silently dropped them. Two projections of one truth — the
compression violation task #8/#13 targets.

Converge on ONE neutral superset projection, keeping positron generic:

- continuum-positron (the public, framework-neutral package): extend the
  neutral `RosterSlotView` with `availability: Option<String>` (airc's stable
  snake_case label, transported VERBATIM — positron never enumerates
  availability states, same not-interpreted discipline as provenance.runtime /
  integrations) and `last_seen_ms: u64`. Additive + serde(default) → wire-safe.

- continuum-core: one shared `roster_slot_from_member(&RoomMember) ->
  RosterSlotView` — the single place a slot is built. Both rails call it, so
  they can never drop different fields again. Delete the hand-copied
  `AircPresenceSlot` twin (RosterSlotView already derives Serialize/Deserialize,
  so the neutral view IS the wire shape) and the now-identity `roster_slots_from`.
  Collapses the two provisional-name fallbacks into one decision.

- Rail A formats its grounding line from the shared slot (availability/recency
  now survive into the persona's prompt — the fields Rail B used to drop).

Test drift-proofing: the projector tests hand-authored camelCase presence JSON
— the exact "hand-copied JSON literal" the module doc forbids, which my type
change exposed. Replace with shared `#[cfg(test)] test_presence_payload` /
`test_roster_slot` that serialize the REAL AircPresenceUpdate, so a test's wire
can never drift from the struct's field names again.

Transcript/ChannelDigest path is intentionally untouched — display (flat ring)
and cognition (consolidated digest) are legitimately different projections;
sharing the ChannelElement upstream is a separate follow-up.

Validated: continuum-positron 83+5 tests; continuum-core roster + positron
projection modules 40 tests; ts-rs bindings regenerated + re-vendored to
sdk/typescript; chat-view/web/sdk/tui typecheck + vitest all green.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…n this room] via one projection

Prove the personaRag consumer reads the converged roster projection end to end,
through the exact code the live heartbeat loop runs — deterministically, without
depending on airc presence (which is empty on this host: 0 healthy routes, the
known event/presence-wake gap #16/#84, upstream of this convergence).

- Extract `project_room_roster` (the room-roster delivery → grounding fold) out
  of `serve_persona_loop` into a pure `pub(crate)` fn beside its sibling
  `build_workspace_turns`. The loop now calls it; behavior-preserving (all
  service_loop projection tests stay green). One roster truth, and a testable
  seam instead of inline loop code.

- Add `present_member_reaches_present_in_room_block_end_to_end`: a present airc
  RoomMember (self-reported Busy) flows RoomRosterSource.deliver (the ONE shared
  roster_slot_from_member projection both rails use) → project_room_roster (the
  live fold) → prompt_assembly, and lands `win-claude [claude] — busy` in the
  [Present in this room] block — availability carried as airc's neutral label,
  the field the widget rail dropped before the convergence (#8/#13). Connects the
  three separately-unit-tested halves via real code.

Live core (rebooted onto this branch) confirmed the plumbing runs: persona reads
the channel + takes turns, prompt assembly intact. The [Present in this room]
block can't render live only because airc presence returns no member — a separate
infra gap, not this change.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 2 commits July 3, 2026 15:18
… drop generation-lane --embeddings

Two regressions were keeping the live persona stack dark; found + fixed while
proving the roster convergence end-to-end on a running core.

1. Generation lane ran with `--embeddings` (inference/llama_server.rs). On the
   current llama.cpp build that flag forces embedding (non-causal) mode, so
   EVERY generation request failed with `500 "Compute error."` — no persona
   could take a turn — and OAI `/v1/embeddings` still 400'd ("pooling type
   'none'"), so it wasn't even serving embeddings. One server can't do both
   causal generation and non-causal embeddings. Dropped the flag from the
   generation lane; verified the base GGUF generates cleanly the instant it's
   gone (`200` "Hello!" vs `500`). llama-hosted embeddings need their own lane
   (follow-up); the live embedding path is the fastembed/ONNX provider.

2. Personas never emitted airc `Alive` heartbeats. airc `active_agents`
   (which backs `room_roster`) reduces heartbeat events, NOT `say()` messages,
   so co-resident personas were invisible to each other's roster — the
   `[room-roster]` grounding went dark and personas leaked raw peer UUIDs
   instead of names. The spawn contract was attach → join → subscribe →
   publish_identity but never started the heartbeat pump. Now bootstrap calls
   `start_agent_heartbeat("persona", …, DEFAULT_HEARTBEAT_INTERVAL)` and holds
   the `HeartbeatTask` for the persona's lifetime (drop on teardown ages it out
   of the roster — the honest "no longer here"). WARN-and-continue on failure,
   symmetric with publish_identity.

Live proof (rebooted onto this branch): room_roster deliver `present=1` for
both Asha and Solenne; Asha's live brain-assembled system prompt now carries
`[room-roster]\nSolenne [persona]` (the converged roster_slot_from_member line),
and she converses as a grounded citizen.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… not just fits_on_gpu

The `--embeddings` outage was silent because persona-boot spawned citizens the
moment the serving PLAN said `fits_on_gpu` — a pure VRAM/resource decision that
says nothing about whether the lane can actually generate. So a lane that fit
GPU but 500'd on every `llama_decode` (embedding/non-causal mode, a bad LoRA, a
wedged Metal context — all while `/health` answers 200) got personas hosted onto
it, and every turn failed silently.

The decode-verified signal already existed and was correct: `ServingSnapshot.ready`
is published ONLY on a serve/adopt outcome that passed the 1-token decode
smoke-probe (`wait_ready` → `decode_smoke_ok`). Persona-boot just wasn't waiting
on it. Now, after `fits_on_gpu`, the boot loop `await_ready_serving(120s)` — parks
on the serving snapshot until the lane proves it can decode. Timeout → do NOT host
(loud warn, retry on the next serving edge, self-healing), never spawn personas
onto a can't-generate lane.

Verified live: healthy lane → `citizen(s) hosted, attempts=1` (no deadlock); a
can't-decode lane now warns loudly and holds off hosting instead of producing
silent per-turn 500s. This is the startup/health guard that makes the
`--embeddings`-class regression impossible to land silently again.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply merged commit 46722a9 into canary Jul 3, 2026
4 checks passed
@joelteply
joelteply deleted the feat/roster-projection-converge branch July 3, 2026 20:43
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