# 04 — Process flow (in-app steps 0–8)

Source: `html/vertical-processes/process-mortgage-protection.html`.

The **progress panel** (optional, togglable) lists **steps 0–8**. Chat is the interviewer. Steps **9–11** stay in the HTML process guide for licensed humans (disclosures, application, issue) and are **out of this UI**.

## Journey (system)

```
ZERO KNOWLEDGE (loan lead)
  → Intent = mortgage_protection
  → Demographics + loan facts
  → Build + tobacco
  → Disease interview
  → Spouse / income when needed
  → DecisionResult (Level | Graded | GI | Postpone | Decline)
  → Carrier shortlist
  → Human agent briefing  ← LAST STEP IN THE CHAT UI
  (off-app, human: disclosures → e-app → issue → sale complete)
```

Soft UW is **not** a bind.

## Stepper model

```ts
type ProcessStep = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; // UI max; 9–11 human-only

type ProcessState = {
  step: ProcessStep;
  phase: "ZERO" | "INTENT" | "DATA" | "KNOWLEDGE" | "DECISION" | "MATCH" | "AGENT" | "SALE" | "COMPLETE";
  exitGateMet: boolean;
  blockedReason?: string; // WR-LOAN, NO-MTG, DNC, etc.
};
```

Advance **only** when the step’s exit gate is met (process HTML). Do not skip 3–4 in a “full SI” demo unless product mode is `mortgage_facts_only`.

## Steps and chat behavior

| Step | Title | Chat should collect | Exit gate | RAG store |
|------|--------|---------------------|-----------|-----------|
| 0 | Lead intake | Name, phone, email, state, lead context | Contactable + state | `knowledge/mortgage` + `verticals/mortgage` |
| 1 | Lock intent | `mortgage_protection`, who to cover | Intent + `coverage_on_whom` | same |
| 2 | Demographics & loan | DOB/age, sex, loan_balance, term, property, co-borrower | Age + loan_balance | same |
| 3 | Build + tobacco | height, weight, tobacco | BMI computed + tobacco answered | **`knowledge/bmi` + `verticals/bmi`** (plus mortgage process chunk for “why this step”) |
| 4 | Disease interview | R modules: heart, diabetes, cancer, kidney, disability | R paths done or explicit none | **`knowledge/health` + `verticals/health`** |
| 5 | Spouse / income | spouse if joint, income, beneficiary | Spouse if co-borrower; beneficiary | `knowledge/mortgage` |
| 6 | Decision engine | none new | Persist DecisionResult | `verticals/mortgage` + health/bmi verticals for reasons |
| 7 | Carrier shortlist | none (config list) | ≥1 path or postpone | verticals + stub carriers |
| 8 | Agent briefing | handoff UI | Agent acknowledged — **end of chat UI** | process vertical |

Steps 9–11 are not in the stepper or chat flow.

## UI copy for the stepper

Show the process HTML **goal** one-liner under the active step (e.g. step 2: “Enough non-medical data to size the case”).

Show **exit gate** as a checklist:

- Step 2: `[x] age  [x] loan_balance  [ ] loan_term_years (S)`

## Wrong-path stops (from knowledge dispositions)

If the model (or rules) detect refinance-only, health-insurance-only, or no mortgage: set `blockedReason`, freeze profile mortgage fields, do not continue SI. Display a short close message from mortgage `objection.md` RAG.

## DecisionResult (step 6)

```ts
type DecisionResult = {
  offer_family: "si_level" | "graded" | "gi" | "postpone" | "decline";
  reasons: string[];
  drivers: string[];
  suggested_next_step: string;
};
```

Show this on the profile as **“Illustrative path — not a carrier decision.”**
