Repository navigation
feat(persona): RoomDoctrineSource — ground cognition in the room's operating doctrine - #1651
Merged
Merged
Conversation
…erating doctrine Slice 2 of the airc-native rebuild. Slice 1 grounded a persona in WHO is present; this grounds it in WHAT KIND of room it is, so it calibrates participation to the activity (sparse in a coordination room, conversational in chat — Ivar's other failure: over-participating in a dev-coordination room). - RoomDoctrineSource: a RagSource reading airc `Airc::room_doctrine` (the room's published operating contract — markdown airc-core says agents should inject as a system message). Persona-scoped, fails-safe-empty, truncates an oversized doctrine rather than dropping it, with a test stub. Mirrors RoomRosterSource. - AircDoctrineReader: 3rd supertrait of AircCitizen (alongside AircTranscriptReader + AircRosterReader); impl'd for PersonaAircRuntime, AircHandleAdapter, StubAircCitizen, airc_lib::Airc — the runtime upcasts. - compose_for_turn binds it; rides capture_sink (recorded + replayable); small floorless budget (max 1024) so it never starves airc's recent_history. - service_loop projects the delivery into a [Room operating doctrine] system-prompt block in prompt_assembly. None doctrine → no block. Tests: 5 source + 1 rendering. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ent-free block Adversarial review of PR #1651 found fit_body overspent at tiny budgets: the truncation marker is 24 bytes / 22 chars, so for budget<=6 the char budget floored to 0 and the result was the marker alone (~6 tokens > budget), producing a [Room operating doctrine] block with zero actual doctrine — reachable in production at context windows where the grow pass hands the doctrine source 1-5 tokens. The old test only checked budget=20 and missed it. Fix: compute max chars whose estimate stays within budget (4*budget - 4), subtract the marker's CHAR count (not byte len), and if there's no room for the marker plus real content, return None (no block) rather than a token-wasting marker-only one. Test now sweeps budgets {1,2,3,5,6,7,8,20, 100,500} asserting never-overspend AND that any delivered block carries real content; plus a tiny-budget→no-block test. 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Slice 2 of the airc-native rebuild (
docs/grid/AIRC-NATIVE-IDENTITY-ROOMS-SECURITY.md§5). Slice 1 (#1650) grounded a persona in who is present; this grounds it in what kind of room it is, so it calibrates participation to the activity.Why
Rooms are the universal activity primitive (chat, dev-coordination, game, academy, help, settings). A coordination room is not a free-for-all chat. The "Ivar" persona's other failure (besides confabulation, fixed in #1650) was over-participating in a dev-coordination room because it had no signal about the room's nature.
How
RoomDoctrineSource— aRagSourcereading aircAirc::room_doctrine, the room's published operating contract (markdown the airc-core docs say agents should "inject as a system message into agent context"). Persona-scoped, fails-safe-empty, truncates an oversized doctrine rather than dropping it, test stub. MirrorsRoomRosterSource.AircDoctrineReader— 3rd supertrait ofAircCitizen(alongsideAircTranscriptReader+AircRosterReader); impl'd forPersonaAircRuntime,AircHandleAdapter,StubAircCitizen,airc_lib::Airc, soruntimeupcasts.compose_for_turnbinds it; ridescapture_sink(recorded + replayable); small floorless budget (max 1024) so it never starves airc'srecent_history(the lesson from slice 1's review).service_loopprojects the delivery into a[Room operating doctrine]system-prompt block inprompt_assembly.Nonedoctrine → no block (backwards-compatible).Validation
metal,accelerate,test-fixtures), clippy 0 errors.Out of scope (follow-up)
🤖 Generated with Claude Code