Raven Pipeline Audit Review: Scope, Staging, @name → Claude
The audit is a strong, technically precise static analysis of the Raven request pipeline. It maps the flow from dual-channel @Name ingestion through staging, scope, and mode resolution into the Claude prompt builders with unusual clarity for a conversational state machine this complex.
Core architectural bet remains sound:
@Name / role / vault data determine who the read is about.
- Intent, slash commands, sticky mode, and doctrine determine what kind of read is being produced.
- Prompt builders bind final resolved state to sealed natal, counterpart, synastry, and context profile data.
The architecture is intentionally stateful and deterministic. The remaining risks are mostly friction points where implicit carryover competes with explicit user language.
Verified strengths
1. Dual-channel @Name handling is clean
Structured VaultMentionPayload plus text regex fallback merge before scope resolution. The sanitization, dedupe, cap at 6, and re-fetch behavior for staged profiles with incomplete chart data are pragmatic.
Text-only extraction is correctly treated as fallback rather than equal authority.
2. Scope and mode separation is correctly enforced
@Name and role drive resolvedReadScope and staging state.
promptMode is resolved separately through the intent cascade, slash commands, doctrine, and sticky overrides.
Important invariant: a scope change such as @Abby what's asking for attention... can remain in FIELD_REPORT without forcing a mode switch.
3. Staging state machine is deterministic
The S0/S1/S2 staging model and precedence ladder are clear:
S0_PRIMARY_ONLY
S1_PRIMARY_PLUS
S2_SOLO_MIRROR
First-match-wins avoids ambiguous staging mutation.
4. Scope resolution ladder has useful safeguards
The vulnerable-context clarification prompt and structured single-mention → OTHER_SOLO path are good defensive design.
Prior-scope carry-forward and relational continuation preserve dyadic continuity without forcing users to re-mention the same person.
5. Sticky mode enforcement is defense-in-depth
The mode cascade followed by slash > doctrine > sticky overrides is the right priority structure.
The known collision pattern — sticky FIELD_REPORT from ui_button source blocking NEW_SYMBOLIC_READ intent — matches the mechanics described in stickyMode.ts and route.ts:1577-1589.
6. Prompt builders bind data to resolved state
Good isolation and minimal leakage behaviors:
[NATAL DATA SEAL] tied to active primary from resolved scope
[STRICT IDENTITY BOUNDARY]
- conditional
[COUNTERPART DATA]
- conditional
[SYNASTRY GEOMETRY]
contextProfiles for non-subject mentions
- gated
relationalDirection
- gated
symbolicMomentDeliveryRubric
Highest-priority friction points
1. Sticky mode can override Symbolic Moment intent
shouldReleaseStickyModeForTurn is the intended release valve, especially the symbolicMomentTurnIntent === 'NEW_SYMBOLIC_READ' guard.
However, the ui_button sticky source path can still produce MODE_DRIFT_BLOCKED in cases where the user is clearly asking for a fresh symbolic read.
Tasks
- Refactor
shouldReleaseStickyModeForTurn into named predicates.
- Add an explicit decision table in docs.
- Add regression coverage for:
- sticky
FIELD_REPORT
- source
ui_button
- symbolic-moment phrasing
- no slash override
- expected release to new symbolic read
2. Staging reducer runs before scope resolution, allowing @Name demotion
When conversationalStagingLocked plus carryover fires, a new structured @mention with role: 'solo_subject' can be reduced to passive contextProfile instead of becoming the active reading subject.
This preserves conversational continuity, but can create a user-visible mismatch: “why didn’t my @mention take?”
Tasks
- Decide whether structured
solo_subject should pierce carryover staging locks.
- If not, expose current staging/scope state visibly in debug output or
/status.
- Add test coverage for structured solo-subject mention during locked carryover state.
3. S2 solo mirror first-person release is fragile
The first-person release heuristic correctly treats language such as “I feel…” as intent to return to anchor.
But mixed phrases can be misread:
- “I wonder about @x’s transits”
- “What is active for @name right now?”
- “I’m curious what @name is carrying today”
These contain first-person framing while the target is clearly third-party.
Tasks
- Strengthen first-person release logic with a secondary check for explicit target name plus curious/possessive verbs.
- Consider requiring an explicit scope pin phrase for ambiguous releases.
- Add regression tests for
OTHER_SOLO plus first-person curiosity about the third party.
4. Text @Name regex is functional but narrow
Current regex:
/@([a-zA-Z]+(?:[\s'\-.][a-zA-Z]+){0,3})/g
Issues:
- misses some Unicode names
- may miss longer hyphenated/apostrophe names
- can false-positive inside URLs or markdown/code contexts
- Western-name assumptions are baked in
Tasks
- Add safer boundaries.
- Consider Unicode letter matching with
\p{L} and u flag.
- Add negative checks for inline code / code fences / URLs.
- Normalize title-case only after matching, not during detection.
5. Conversational locks are powerful but opaque
conversationalScopeLocked and conversationalStagingLocked make text cues inert while allowing structured payloads through.
This is deterministic, but not obvious to users or maintainers.
Tasks
Expose a machine-readable “current conversation model state” packet:
type RavenConversationModelState = {
resolvedScopeKind: string;
stagingState: 'S0_PRIMARY_ONLY' | 'S1_PRIMARY_PLUS' | 'S2_SOLO_MIRROR';
activePrimaryId?: string;
activeCounterpartId?: string;
contextProfileIds: string[];
promptMode: string;
stickyMode?: string;
stickyModeSource?: string;
conversationalScopeLocked: boolean;
conversationalStagingLocked: boolean;
releaseReason?: string;
blockingReason?: string;
};
Use this for logs, debug footer, /status, and later Sherlog / Coherence Engine observability.
Additional coverage gaps
Not defects, but good future audit passes:
- vault fetch failure for
@mention
- partial chart data fallback
- Claude rate-limit / prompt builder failure paths
- transition logging with turn ID, prior state, trigger cue, and final state
- performance of synastry geometry on polyadic turns
- persistence / TTL model for continuous thread, prior scope, and prior staging
- focused diagram or decision table for late mode/sticky resolution
Recommended immediate action order
- Add targeted sticky +
NEW_SYMBOLIC_READ release tests.
- Harden or document first-person release heuristic for
OTHER_SOLO.
- Expose current pipeline state: scope, staging, mode, sticky source, locks.
- Improve text
@Name regex and add false-positive guards.
- Create a living spec artifact:
Raven Conversation Model.
Suggested regression matrix
Collision class 1
Sticky FIELD_REPORT from UI + new symbolic request:
- prior mode:
FIELD_REPORT
- sticky source:
ui_button
- user asks: “give me the symbolic moment now”
- no slash override
- expected: sticky releases; fresh symbolic read starts
Collision class 2
Carryover staging + structured solo-subject mention:
- prior state: relational or staged carryover
- lock:
conversationalStagingLocked = true
- input includes structured
@Name with role: 'solo_subject'
- expected behavior should be explicitly decided and tested
Collision class 3
OTHER_SOLO + first-person curiosity about third party:
- prior scope:
OTHER_SOLO
- user says: “I wonder what @name is carrying today”
- expected: do not release back to anchor merely because of first person
Verdict
The pipeline is already close to a coherent, self-diagnosing conversational engine. The complexity is intentional and justified by the need for continuity-preserving symbolic reads.
The weak point is not the architecture itself. It is explainability at the collision points where sticky mode, staging carryover, locks, and explicit new user signals compete.
Targeted tests plus better state observability should make the wrong-person / wrong-mode failures rarer and much easier to diagnose.
Raven Pipeline Audit Review: Scope, Staging, @name → Claude
The audit is a strong, technically precise static analysis of the Raven request pipeline. It maps the flow from dual-channel
@Nameingestion through staging, scope, and mode resolution into the Claude prompt builders with unusual clarity for a conversational state machine this complex.Core architectural bet remains sound:
@Name/ role / vault data determine who the read is about.The architecture is intentionally stateful and deterministic. The remaining risks are mostly friction points where implicit carryover competes with explicit user language.
Verified strengths
1. Dual-channel
@Namehandling is cleanStructured
VaultMentionPayloadplus text regex fallback merge before scope resolution. The sanitization, dedupe, cap at 6, and re-fetch behavior for staged profiles with incomplete chart data are pragmatic.Text-only extraction is correctly treated as fallback rather than equal authority.
2. Scope and mode separation is correctly enforced
@Nameand role driveresolvedReadScopeand staging state.promptModeis resolved separately through the intent cascade, slash commands, doctrine, and sticky overrides.Important invariant: a scope change such as
@Abby what's asking for attention...can remain inFIELD_REPORTwithout forcing a mode switch.3. Staging state machine is deterministic
The S0/S1/S2 staging model and precedence ladder are clear:
S0_PRIMARY_ONLYS1_PRIMARY_PLUSS2_SOLO_MIRRORFirst-match-wins avoids ambiguous staging mutation.
4. Scope resolution ladder has useful safeguards
The vulnerable-context clarification prompt and structured single-mention →
OTHER_SOLOpath are good defensive design.Prior-scope carry-forward and relational continuation preserve dyadic continuity without forcing users to re-mention the same person.
5. Sticky mode enforcement is defense-in-depth
The mode cascade followed by slash > doctrine > sticky overrides is the right priority structure.
The known collision pattern — sticky
FIELD_REPORTfromui_buttonsource blockingNEW_SYMBOLIC_READintent — matches the mechanics described instickyMode.tsandroute.ts:1577-1589.6. Prompt builders bind data to resolved state
Good isolation and minimal leakage behaviors:
[NATAL DATA SEAL]tied to active primary from resolved scope[STRICT IDENTITY BOUNDARY][COUNTERPART DATA][SYNASTRY GEOMETRY]contextProfilesfor non-subject mentionsrelationalDirectionsymbolicMomentDeliveryRubricHighest-priority friction points
1. Sticky mode can override Symbolic Moment intent
shouldReleaseStickyModeForTurnis the intended release valve, especially thesymbolicMomentTurnIntent === 'NEW_SYMBOLIC_READ'guard.However, the
ui_buttonsticky source path can still produceMODE_DRIFT_BLOCKEDin cases where the user is clearly asking for a fresh symbolic read.Tasks
shouldReleaseStickyModeForTurninto named predicates.FIELD_REPORTui_button2. Staging reducer runs before scope resolution, allowing
@NamedemotionWhen
conversationalStagingLockedplus carryover fires, a new structured@mentionwithrole: 'solo_subject'can be reduced to passivecontextProfileinstead of becoming the active reading subject.This preserves conversational continuity, but can create a user-visible mismatch: “why didn’t my @mention take?”
Tasks
solo_subjectshould pierce carryover staging locks./status.3. S2 solo mirror first-person release is fragile
The first-person release heuristic correctly treats language such as “I feel…” as intent to return to anchor.
But mixed phrases can be misread:
These contain first-person framing while the target is clearly third-party.
Tasks
OTHER_SOLOplus first-person curiosity about the third party.4. Text
@Nameregex is functional but narrowCurrent regex:
/@([a-zA-Z]+(?:[\s'\-.][a-zA-Z]+){0,3})/gIssues:
Tasks
\p{L}anduflag.5. Conversational locks are powerful but opaque
conversationalScopeLockedandconversationalStagingLockedmake text cues inert while allowing structured payloads through.This is deterministic, but not obvious to users or maintainers.
Tasks
Expose a machine-readable “current conversation model state” packet:
Use this for logs, debug footer,
/status, and later Sherlog / Coherence Engine observability.Additional coverage gaps
Not defects, but good future audit passes:
@mentionRecommended immediate action order
NEW_SYMBOLIC_READrelease tests.OTHER_SOLO.@Nameregex and add false-positive guards.Raven Conversation Model.Suggested regression matrix
Collision class 1
Sticky
FIELD_REPORTfrom UI + new symbolic request:FIELD_REPORTui_buttonCollision class 2
Carryover staging + structured solo-subject mention:
conversationalStagingLocked = true@Namewithrole: 'solo_subject'Collision class 3
OTHER_SOLO+ first-person curiosity about third party:OTHER_SOLOVerdict
The pipeline is already close to a coherent, self-diagnosing conversational engine. The complexity is intentional and justified by the need for continuity-preserving symbolic reads.
The weak point is not the architecture itself. It is explainability at the collision points where sticky mode, staging carryover, locks, and explicit new user signals compete.
Targeted tests plus better state observability should make the wrong-person / wrong-mode failures rarer and much easier to diagnose.