# DO-007 — Ratify 9-Layer Smart Adapter Dispatcher + 4-Part Response Format

**Date:** 2026-06-29
**Status:** Locally binding via OSCR-

---

## Decision

Oscar ratifies the **9-layer dispatcher** as the Smart adapter's response pipeline:

```
L0  writing-mode detection (when generative provider required for prose)
L1  heuristic fast-path (25+ pre-baked answers)
L1.5 opt-in web search (DuckDuckGo, fails honestly on CORS)
L2  data queries (across 6 IDB stores via summarise())
L3  history question (ConversationMemory)
L4  classification (rules engine; tree classification)
L5  standard / cache lookup (6 cached standards with citations)
L6  how-to
L7  off-topic decline
L8  medium-confidence heuristic
L9  clarifying question (echo user's words + offer action chips)
```

Cheapest first (L1), expensive last (L9). Never reaches LLM unless drafted content needed.

## 4-Part Response Format

Every Smart adapter response follows:

```
{
  text: "<claim> [<evidence>] [~<hedge>] [<action chip>]",
  provider: "smart",
  latencyMs: <number>,
  error?: <string>?
}
```

- **Claim** — concise statement (the answer)
- **Evidence** — citations to standards, rules, or data (e.g., `[BS5837 §4.5]`)
- **Hedge** — uncertainty marker (e.g., `~ low confidence`, `~ partial match`)
- **Action** — concrete next step (rendered as action chip)

## Action chips (4 types)

- **navigate** — routes user to a view
- **open-item** — opens a specific item
- **compose** — opens an editor with prefilled content
- **export** — generates PDF/DOCX/MD/HTML

## Cross-references

- `app/src/intelligence/adapters/smart.ts` (9-layer dispatcher)
- `app/src/assistant/heuristics.ts` (25+ heuristics)
- `app/src/assistant/memory.ts` (ConversationMemory)
- `app/src/assistant/actions.ts` (action chips)
- `app/src/assistant/web-search.ts` (L1.5)
- `pact/codex/assistant.codex.md` C1, C8
- `pact/codex/intelligence.codex.md` C1

