feat(persona): inbox→admission bridge runner (#1121 PR-3)#1143
Conversation
Closes the e2e admission loop on top of the storage types (PR-1, #1129) and the gate machinery (PR-2, #1134) by giving callers ONE pure-Rust object — `InboxAdmissionRunner` — that wraps the recipe + config + trust mapping for a persona, exposing a single `admit(&inbox_msg, ...)` method that returns the typed `AdmissionDecision`. What ships: - `InboxAdmissionRunner<R: IsMemorable>` — generic per-persona runner. Convenience constructors: `default_v1()` (HeuristicIsMemorable + permissive config + permissive trust mapping) and `strict_v1()` (same recipe + strict config + strict trust mapping). - `TrustMapping` — configurable map from `SenderType` (Human/Persona/ Agent/System) to `TrustState`. `default_v1()`: Human=IntragridMember, Persona/Agent=ApprovedPeer, System=SelfTrust. `strict_v1()`: demotes Persona+Agent to Authenticated for SOC governance contexts. - `inbox_message_to_candidate(msg, mapping)` — pure converter. Synthesizes a `ChatMessageRef` origin (internal Continuum chat is Chat-origin, not AIRC; AIRC envelope path lands in PR-5 alongside the AIRC event converter that carries signature/proof material the inbox doesn't). - `inbox_message_to_origin(msg)` — pure helper (always Chat for v1). - `content_hash_sha256(s)` — canonical hash format `"sha256:<hex>"` used by the converter so dedup keys are consistent across all admission paths. What this PR does NOT ship (deferred): - Call-site integration with `PersonaInbox::drain_frame()` — PR-4 adds the actual call from the cognition path. - Engram persistence — admitted engrams come back from the runner; caller stores them. PR-5+ adds the ORM persistence path. - AIRC envelope origin converter — separate slice; AIRC events carry signature/proof material `InboxMessage` doesn't. Tests: 16/16 covering content_hash_sha256 (canonical format, deterministic, distinguishing), TrustMapping (default + strict), pure converters (origin always Chat, candidate carries full provenance, trust varies by SenderType), runner end-to-end (admit well-formed, drop short, drop duplicate, strict-admit System via SelfTrust, strict- reject Persona at trust boundary, custom recipe via generic, accessors, seam-emission invariant across outcomes). Card: continuum#1140. Builds on continuum#1129 + continuum#1134 (both merged on canary). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Substantive review (claude tab #2). Reviewed PR-2 (#1134) earlier; this is the natural PR-3 closing the inbox→admission loop on top of it. Architecture — consistent with PR-1 + PR-2
The split between What I verified
Things to consider (none blocking)
What I particularly like
RecommendationLGTM to merge. Architecture is consistent with PR-1 + PR-2; tests are surgical with regression-anchor preambles; scope honestly delivers what PR-3 should. The 7 nits are polish or PR-5+ territory, none blocking. The hot-path allocation in Thanks for the consistent shape across the engram→admission lane (PR-1, PR-2, PR-3 all read like one design). Makes PR-4 + PR-5 review much cheaper. |
…#1185) Per task #71 — survey of every .json under src/system/recipes/. Findings: the 28 split into 3 pipeline shapes (15 static-view, 10 single-persona-chat, 1 full multi-persona) plus 2 outliers (gan, academy-training). The 10 single-persona-chat are missing 6 steps that multi-persona-chat has (loop-risk, fast-respond, training-mode, record-interaction, chat/send, cooldown). NO recipe currently integrates the engram admission gate shipped on canary in #1129/ #1134/#1143/#1155/#1163. 5 identified gaps with concrete next-sprint cards: 1. Engram integration in Shape B + C (11 recipes need cognition/ admit-inbox-message + cognition/recall-engrams) 2. Resolve academy-training half-migrated state 3. Document gan orphan intent 4. Shape B → Shape C decision (or shared inheritance) 5. version field discipline across all 28 Pure docs PR. Output at docs/cognition/RECIPE-AUDIT-2026-05-14.md. Closes #71. Co-authored-by: Test <test@test.com>
Summary
Closes the e2e admission loop on top of the storage types (#1129 PR-1) and gate machinery (#1134 PR-2) by giving callers ONE pure-Rust object —
InboxAdmissionRunner— that wraps the recipe + config + trust mapping for a persona. Single methodrunner.admit(&inbox_msg, ...)returns the typedAdmissionDecision.Card
continuum#1140.
What ships
InboxAdmissionRunner<R: IsMemorable>— generic per-persona runner. Convenience constructors:default_v1()(HeuristicIsMemorable + permissive config + permissive trust) andstrict_v1()(same recipe + strict config + strict trust).TrustMapping— configurableSenderType→TrustStatemap.default_v1(): Human=IntragridMember, Persona/Agent=ApprovedPeer, System=SelfTrust.strict_v1(): demotes Persona+Agent to Authenticated for SOC governance.inbox_message_to_candidate(msg, mapping),inbox_message_to_origin(msg)(always Chat-origin for v1),content_hash_sha256(s)(canonical"sha256:<hex>"format).Scope (sliced)
PersonaInbox::drain_frame()from the cognition pathValidation
16/16 unit tests covering:
content_hash_sha256— canonical format + deterministic + distinguishingTrustMapping— default + strict variants pin documented valuesnpm run build:tsclean.cargo clippyclean (156 warnings vs baseline 163 — 7 BELOW). Hooks ran without--no-verify.Test plan
🤖 Generated with Claude Code