Raahat Scenario Harness

Curated conversation replay against the real runtime with stepwise diagnostics, readable deltas, and deterministic checks.

Known Customer Medical Context

medical_known_customer_context · medical · 1/1 turns executed

Scenario Summary

IDmedical_known_customer_context
TitleKnown Customer Medical Context
Categorymedical
Turns1/1
Run Statecompleted
known context

Seed State

UserKnown user
Phone919900000007
Seed Workflow
Seed State Machine

Current Runtime State

Routemedical_triage
Workflowmedical_triage
State Machinemedical_triage
Stage

Checks And Lifecycle

Expectations Passed2
Expectations Failed0
Heuristic Warnings0
Final assessmentScenario completed cleanly with no flagged issues.

Final Outcome

Completed

Completed vs partial run state.

Final Route

medical_triage

Current route at the end of the replay.

Final Workflow / State

medical_triage

Workflow preferred; state machine shown if no workflow is active.

Final Stage

Resolved from workflow progress or active snapshot.

Expectation Totals

Pass 2 Fail 0

Heuristic Totals

Warnings 0

Missing Fields

No unresolved workflow fields.

Lifecycle Events Seen

No notable lifecycle events yet.
Turn 1
medical_triage medical_triage intent_match
PASS PASS
User
Mochi has been vomiting since last night
Assistant

What Changed This Turn

  • No material state change.

Expectation And Heuristic Results

Expectations
PASS: route_type matched expected value 'medical_triage' PASS: found_customer matched expected value 'True'
Routing And Interpretation
{
  "confidence": 0.9,
  "reason_codes": [
    "intent_match"
  ],
  "route_type": "medical_triage",
  "workflow_name": "medical_triage"
}
{
  "confidence": 0.9,
  "entities": {
    "symptom_phrases": [
      "vomit",
      "vomiting"
    ],
    "time_text": "night"
  },
  "is_vague": false,
  "primary_domain": "medical",
  "reason": "clear medical request",
  "secondary_domains": [],
  "should_continue_active_workflow": false,
  "should_preempt_active_workflow": false,
  "urgency_signal": "low"
}
Workflow Progress And Intents
null
[]
Conversation Before And After
{
  "active_state_machine": null,
  "active_workflow": null,
  "current_state": null,
  "entities": {},
  "messages": [],
  "phone": "919900000007",
  "service_actions": [],
  "started_at": "2026-03-16T22:32:11.575699+00:00",
  "triage_state": null,
  "updated_at": "2026-03-16T22:32:11.575701+00:00"
}
{
  "active_state_machine": "medical_triage",
  "active_workflow": null,
  "current_state": null,
  "entities": {},
  "messages": [
    {
      "role": "user",
      "source": null,
      "text": "Mochi has been vomiting since last night",
      "timestamp": "2026-03-16T22:32:12.118797+00:00"
    }
  ],
  "phone": "919900000007",
  "service_actions": [],
  "started_at": "2026-03-16T22:32:12.118793+00:00",
  "triage_state": null,
  "updated_at": "2026-03-16T22:32:12.118802+00:00"
}
Memory And Trace
{
  "active_state_machine": null,
  "backend": "inmemory",
  "conversation_key_used": "919900000007",
  "conversation_keys": [
    "919900000007",
    "9900000007"
  ],
  "current_state": null,
  "loaded": true,
  "ping_ok": null,
  "redis_enabled": false,
  "thread_message_count": 0,
  "ttl_seconds_remaining": null
}
{
  "active_state_machine": "medical_triage",
  "backend": "inmemory",
  "conversation_key_used": "919900000007",
  "conversation_keys": [
    "919900000007",
    "9900000007"
  ],
  "current_state": null,
  "loaded": true,
  "ping_ok": null,
  "redis_enabled": false,
  "thread_message_count": 1,
  "ttl_seconds_remaining": null
}
[
  {
    "component": "brain",
    "payload": {
      "channel": "scenario_harness",
      "conversation_key": "919900000007",
      "message_text": "Mochi has been vomiting since last night",
      "normalized_phone": "919900000007",
      "phone": "919900000007"
    },
    "stage": "input",
    "summary": "Received normalized message envelope",
    "timestamp": "2026-03-16T22:32:11.587052+00:00"
  },
  {
    "component": "memory_store",
    "payload": {
      "active_state_machine": null,
      "backend": "inmemory",
      "current_state": null,
      "loaded": true,
      "message_count": 0,
      "storage_key": "919900000007"
    },
    "stage": "memory",
    "summary": "Loaded conversation memory",
    "timestamp": "2026-03-16T22:32:11.587058+00:00"
  },
  {
    "component": "brain",
    "payload": {
      "has_prior_triage_state": false,
      "prior_state_error": null
    },
    "stage": "state",
    "summary": "Parsed prior working state",
    "timestamp": "2026-03-16T22:32:11.587060+00:00"
  },
  {
    "component": "brain",
    "payload": {
      "compact_payload_keys": [
        "customer",
        "history",
        "icp",
        "incoming_message",
        "pets",
        "summary"
      ],
      "has_conversation": true,
      "has_customer": true,
      "has_icp": true,
      "has_profile": true,
      "recent_import_count": 0,
      "storage_key": "919900000007"
    },
    "stage": "context",
    "summary": "Assembled SessionContext for the turn",
    "timestamp": "2026-03-16T22:32:11.587064+00:00"
  },
  {
    "component": "contact_resolver",
    "payload": {
      "confidence": 1.0,
      "customer_id": 8,
      "display_name": "Mochi Parent",
      "matched_phone": "919900000007",
      "status": "KNOWN"
    },
    "stage": "decision",
    "summary": "Resolved sender contact status",
    "timestamp": "2026-03-16T22:32:11.587071+00:00"
  },
  {
    "component": "turn_interpretation",
    "payload": {
      "confidence": 0.9,
      "contact_status": "KNOWN",
      "entities": {
        "symptom_phrases": [
          "vomit",
          "vomiting"
        ],
        "time_text": "night"
      },
      "is_vague": false,
      "primary_domain": "medical",
      "reason": "clear medical request",
      "secondary_domains": [],
      "should_continue_active_workflow": false,
      "should_preempt_active_workflow": false,
      "urgency_signal": "low"
    },
    "stage": "decision",
    "summary": "Resolved turn interpretation deterministically",
    "timestamp": "2026-03-16T22:32:11.587750+00:00"
  },
  {
    "component": "profile_context",
    "payload": {
      "customer_id": 8,
      "customer_name": "Mochi Parent",
      "has_latest_icp": true,
      "has_latest_profile": true,
      "recent_import_count": 0
    },
    "stage": "context",
    "summary": "Loaded customer intelligence context",
    "timestamp": "2026-03-16T22:32:11.587760+00:00"
  },
  {
    "component": "entry_policy",
    "payload": {
      "allow_identity_question": false,
      "bypass_onboarding": true,
      "defer_existing_workflow": false,
      "preempt_active_workflow": false,
      "reason": "known contact with a clear request should route directly",
      "run_welcome_orientation": false,
      "selected_posture": "known_direct_route"
    },
    "stage": "decision",
    "summary": "Determined entry posture for this turn",
    "timestamp": "2026-03-16T22:32:11.587762+00:00"
  },
  {
    "component": "intent_parser",
    "payload": {
      "continue_active_workflow": false,
      "primary_intent": "medical_issue",
      "reason": "matched_keyword_rules",
      "resolved_state_machine": "medical_triage",
      "workflow_source": "intent_match"
    },
    "stage": "decision",
    "summary": "Resolved primary intent and state machine",
    "timestamp": "2026-03-16T22:32:11.587805+00:00"
  },
  {
    "component": "context_builder",
    "payload": {
      "active_workflow": "medical_triage",
      "background_fact_count": 1,
      "current_step": null,
      "foreground_fact_count": 4,
      "prompt_family": "medical",
      "purpose": "workflow_response"
    },
    "stage": "context",
    "summary": "Built workflow-response context slice for prompt assembly",
    "timestamp": "2026-03-16T22:32:11.587852+00:00"
  },
  {
    "component": "brain",
    "payload": {
      "current_state_before": null,
      "reason": "intent matched a registered state machine",
      "state_machine": "medical_triage"
    },
    "stage": "decision",
    "summary": "Executing state machine path",
    "timestamp": "2026-03-16T22:32:11.587893+00:00"
  },
  {
    "component": "medical_triage",
    "payload": {
      "compact_payload": {
        "customer": {
          "city": "Baner",
          "display_name": "Mochi Parent",
          "first_name": "Mochi"
        },
        "icp": {
          "primary_archetype": "unknown"
        },
        "incoming_message": "Mochi has been vomiting since last night",
        "older_customer_context": {
          "history": {
            "primary_intent": "boarding_request"
          },
          "summary": "Returning boarding customer with one cat named Mochi."
        },
        "pets": [
          {
            "name": "Mochi",
            "species": "cat"
          }
        ],
        "prompt_family": "medical",
        "workflow_response_context": {
          "active_workflow": "medical_triage",
          "background_facts": [
            {
              "confidence": 0.6,
              "freshness": "background",
              "key": "service_history",
              "source": "compact_payload.history",
              "use_mode": "background",
              "value": {
                "primary_intent": "boarding_request"
              }
            }
          ],
          "current_step": null,
          "entities": {
            "symptom_phrases": [
              "vomit",
              "vomiting"
            ]
          },
          "foreground_facts": [
            {
              "confidence": 1.0,
              "freshness": "current_turn",
              "key": "active_workflow",
              "source": "routing",
              "use_mode": "direct",
              "value": "medical_triage"
            },
            {
              "confidence": 0.9,
              "freshness": "current_turn",
              "key": "symptom_phrases",
              "source": "turn_interpretation.entities",
              "use_mode": "direct",
              "value": [
                "vomit",
                "vomiting"
              ]
            },
            {
              "confidence": 0.55,
              "freshness": "historical",
              "key": "city",
              "source": "profile.customer.city",
              "use_mode": "confirm",
              "value": "Baner"
            },
            {
              "confidence": 0.5,
              "freshness": "historical",
              "key": "pet_names",
              "source": "profile.pets",
              "use_mode": "confirm",
              "value": [
                "Mochi"
              ]
            }
          ],
          "icp_guidance": {
            "primary_archetype": "unknown"
          },
          "instruction_hints": [
            "Continue medical_triage at the current triage step. Prioritize the current symptom report, urgency, and recent thread details before any older profile history.",
            "Use direct facts from the active workflow and recent thread confidently.",
            "Treat confirm facts as historical references that must be verified before you assert them."
          ],
          "llm_required": true,
          "prompt_family": "medical",
          "purpose": "workflow_response",
          "recent_turns": [],
          "relationship_context": {
            "first_name": "Mochi"
          },
          "service_history_context": {
            "primary_intent": "boarding_request"
          },
          "task_hint": "Continue medical_triage at the current triage step. Prioritize the current symptom report, urgency, and recent thread details before any older profile history."
        }
      },
      "current_state_before": null,
      "model": "gpt-5.4",
      "prior_triage_state": null,
      "prompt_family": "medical"
    },
    "stage": "llm_request",
    "summary": "Prepared medical triage prompt using current machine state, prior triage state, and compact customer context",
    "timestamp": "2026-03-16T22:32:12.118759+00:00"
  },
  {
    "component": "state_machine",
    "payload": {
      "clinic_routing_triggered": false,
      "current_state": null,
      "next_state": null,
      "service_action_count": 0
    },
    "stage": "response",
    "summary": "State machine produced response",
    "timestamp": "2026-03-16T22:32:12.118780+00:00"
  },
  {
    "component": "memory_store",
    "payload": {
      "active_state_machine": "medical_triage",
      "current_state": null,
      "message_count_after": 1,
      "storage_key": "919900000007"
    },
    "stage": "mutation",
    "summary": "Persisted updated conversation memory",
    "timestamp": "2026-03-16T22:32:12.119468+00:00"
  }
]