Skip to content

feat(persona): RoomRosterSource — ground cognition in airc room presence - #1650

Merged
joelteply merged 3 commits into
canaryfrom
feat/persona-room-roster-grounding
Jun 16, 2026
Merged

joelteply merged 3 commits into
canaryfrom
feat/persona-room-roster-grounding

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

What

Slice 1 of the airc-native rebuild (docs/grid/AIRC-NATIVE-IDENTITY-ROOMS-SECURITY.md): ground persona cognition in who else is present in the room, read from airc — the fix for personas confabulating other citizens' turns (the "Ivar" bug).

Why

The cognition loop had no grounding in room presence: compose_for_turn bound only engram + airc sources, and other_persona_names was hardcoded empty — both since the original port (4214287b). A small model saw other citizens' names in the transcript with nothing declaring them real, distinct participants, so it role-played the whole room.

How

  • RoomRosterSource — a RagSource reading airc active_agents (truthful presence, incl. cross-grid peers + each peer's runtime origin), persona-scoped, fails-safe-empty, with a test stub. Mirrors AircRagSource.
  • AircRosterReader — a second supertrait of AircCitizen (symmetric with AircTranscriptReader); impl'd for PersonaAircRuntime, AircHandleAdapter, StubAircCitizen, airc_lib::Airc. runtime upcasts into it — no new plumbing.
  • compose_for_turn binds it in the reserved "identity card" source slot; it rides capture_sink → recorded + replayable.
  • service_loop projects the delivery into system-prompt grounding (a [Present in this room] block in prompt_assembly), not recent_history — injecting it as chat is the confusion the source removes.

Carries origin + availability per present citizen for the trust slice (slice 3).

Validation

  • Compiles clean (lib + tests, metal,accelerate,test-fixtures), clippy 0 errors.
  • 9 new tests (7 source + 2 prompt rendering), replay path intact.
  • Diff is the logical change only — a 213-file rustfmt-version churn (repo pins 1.95, local Homebrew is 1.96) was caught and stripped.

Out of scope (follow-up slices)

  • Slice 2: room-nature grounding (calibrate participation to activity kind).
  • Slice 3: trust/origin enforcement at the cognition boundary.
  • Node/web unified-client rebuild (later).

🤖 Generated with Claude Code

Personas confabulated other citizens' turns because the cognition loop
had no grounding in who else was in the room: compose_for_turn bound only
engram + airc sources, and other_persona_names was hardcoded empty (both
since the original port, 4214287). A small model saw other citizens'
names in the transcript with nothing declaring them real, distinct
participants — so it role-played the whole room.

Slice 1 of the airc-native rebuild
(docs/grid/AIRC-NATIVE-IDENTITY-ROOMS-SECURITY.md):

- RoomRosterSource: a RagSource reading airc active_agents (the truthful
  presence list, incl. cross-grid peers + outsider-agent runtime origin),
  persona-scoped, fails-safe-empty, with a test stub. Mirrors AircRagSource.
- AircRosterReader: a second supertrait of AircCitizen (symmetric with
  AircTranscriptReader); impl'd for PersonaAircRuntime, AircHandleAdapter,
  StubAircCitizen, and airc_lib::Airc, so the runtime upcasts into it.
- compose_for_turn binds it in the reserved "identity card" source slot;
  it rides capture_sink (recorded + replayable).
- service_loop projects the room-roster delivery into system-prompt
  GROUNDING (a [Present in this room] block in prompt_assembly), NOT into
  recent_history — injecting it as chat is the confusion the source removes.

Carries origin + availability per present citizen for the trust slice.
Tests: 7 source + 2 rendering.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
joelteply and others added 2 commits June 16, 2026 17:08
…for the Node rebuild

Node's per-call latency compounds across personas (14 now, target ~100);
Node was the prime culprit atop broader legacy debt. The Rust concurrent
substrate + thin-continuum shape is what keeps a hundred citizens
responsive. Captures Joel's 2026-06-16 framing.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Two MAJORs from the adversarial reviewers on this PR, plus the minors:

- N+1 IPC under the cognition lock: airc `peer_alias` scans a full
  transcript page PER peer, so an N-peer room = N+1 page scans (IPC
  round-trips) every turn while compose_for_turn holds the cognition
  mutex. Replaced per-peer resolution with one `peer_alias_map()` scan
  (parse IdentityPublished once) → a roster delivery is O(1) in room
  size. Directly the compounding-latency concern at 100-persona scale.
- Parallel roster field: `other_persona_names` already existed for this
  data (feeds single-party ChatML history-drop) and sat empty. The
  service-loop projection now populates it from the SAME roster delivery
  (metadata display_name), so there is one roster source of truth and
  the long-inert history-drop finally works.
- Budget: the roster claimed 500/500/per_source_max it never used,
  starving airc's recent_history at small windows + shrinking its grow
  share. Now a small no-floor claim (max 256) matching its real appetite.
- peer_alias_map failure logs at debug before degrading to short labels.
- Updated the stale "two first-class sources" budget comment.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit 13f12aa into canary Jun 16, 2026
4 checks passed
@joelteply
joelteply deleted the feat/persona-room-roster-grounding branch June 16, 2026 22:35
joelteply added a commit that referenced this pull request Jun 17, 2026
… spawn contract (#1652)

BigMama shipped the spawn contract in airc #1222 (attach_as → subscribe →
publish_identity → grounded by name), but continuum's persona spawn never
called publish_identity, so personas appeared on the wire as anonymous
peer-ids and every peer's RoomRosterSource (#1650) resolved no display
names for them. This wires the continuum half.

- Bump airc pin f6ed190 → 1a47231 (canary tip) to get Airc::publish_identity.
- PersonaAircRuntime::bootstrap now calls publish_identity() after the
  command pump subscribes — seeds the identity card from the agent-name
  floor and broadcasts it, so the persona is grounded by NAME. WARN-and-
  continue on failure (anonymous-but-functional beats dead; asymmetric with
  the subscribe failure above, which stays fatal).
- Behavior-preserving fix for the bump: AttachRequest dropped Default for
  explicit builders; the prior `..default()` was from_now:false =
  FromTranscriptStart (airc's documented "legacy meaning"), so use
  AttachRequest::new(channel, AttachStart::FromTranscriptStart) — full
  backlog, not a silent switch to live-only.

295 airc + 13 persona-room unit tests pass against the bumped airc.

Co-authored-by: Claude Opus 4.8 <[email protected]>
joelteply added a commit that referenced this pull request Jun 17, 2026
…dentityPublished parsing (#1654)

BigMama shipped Airc::room_roster (airc#1232) exactly to the spec I sent over
airc: one batched call returning Vec<RoomMember{peer_id, display_name, runtime,
availability, last_seen_ms}> = active_agents + IdentityPublished name-join done
airc-side. So continuum stops doing that join itself.

- Bump airc pin 1a47231 → 72824ba (one commit: #1232 room_roster).
- RoomRosterSource: AircRosterReader collapses from {self_peer_id, active_agents,
  peer_alias_map} to {self_peer_id, room_roster}. deliver() makes ONE room_roster
  call and iterates RoomMembers. DELETED: parse_identity_names, the IdentityScan
  constant, and the airc_core IdentityEvent/Body/TranscriptEvent/TranscriptKind +
  HashMap imports — the wire-format coupling the adversarial review of #1650
  flagged. Thin continuum: airc owns presence+identity join.
- The 3 AircRosterReader impls (PersonaAircRuntime, AircHandleAdapter,
  StubAircCitizen) collapse to a single room_roster delegation.

Same [Present in this room] grounding, same self-exclusion, same projection
contract (metadata.display_name → other_persona_names); fewer moving parts and
zero IPC amplification. 7 tests green; clippy clean.

Co-authored-by: Claude Opus 4.8 <[email protected]>
joelteply added a commit that referenced this pull request Jun 17, 2026
…ng in the Workspace brain (#1660)

The gating cutover (#1659) routes the participation Decision through the
WorkspaceCycle. But the cycle only had RecallFaculty + LlmDeliberationFaculty —
so the roster (#1650) and doctrine (#1651) grounding, which are RagSources not
Faculties, silently fell out of the live decision path the moment the switch
flipped. The persona would forget who is present and what the room is for.

This adds ONE generic bridge — RagSourceFaculty — that lifts any RagSource into
a perception-tier Faculty (no second source of truth; reuses the reviewed
sources verbatim). It is the concrete first step of "broadcast == RAG context"
(task #8). Per the grid elegance thread (M5/IntelMac/BigMama, 2026-06-17): the
bridge is migration scaffolding, the end-state is full convergence to native
faculties, and RagSource deletion is gated on observability parity.

Load-bearing guard (BigMama): a flat lift is a latent bug — a high-cosine memory
could evict the doctrine and the persona forgets the room's rules mid-turn. So
the bridge carries a SaliencePolicy: StandingFraming (roster/doctrine — high
floor the top-k arbiter won't truncate) vs Retrieved (engram/conversation —
competes on relevance). The classification lives at the assembly layer
(build_workspace_cycle), never inside RagSource — the source stays salience-free.

Wiring: supervisor passes roster + doctrine as StandingFraming grounding into
PersonaBrainConfig; the same Arc still feeds the legacy compose path during the
transition (one source of truth, two consumers — not a parallel allocator).

Tests: bridge lift, abstain-on-empty, persona-scope passthrough, end-to-end
grounding reaching the decider, salience-policy ordering, and the canary —
standing framing keeps non-zero presence in context_broadcast even when a
retrieved bid out-saliences it (the "forgot the room rules" regression net).

Co-authored-by: Claude Opus 4.8 <[email protected]>
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