0061 — The maestro is a stateful package→reasoning→action-queue router


Context

ADR-0059 framed the maestro as a 3-rung precedence gauntlet (Safety → Resume-shortcut → Full-route) where each inbound message was bucketed into one rung via deriveEnteredRung(reason) and routed to one lane. Working through the model visually (the scenario video) with Gera exposed that the gauntlet framing is wrong in three load-bearing ways:

  1. Routing is per-PACKAGE, not per-message. A package is whatever the trigger hands over — a single text, a 5-min idle-debounce batch of texts, or a whole call transcript. One package can demand many ordered actions (a call: create WO → schedule → rate → relay). "One message → one lane" can't express that.
  2. The "rungs" were labels on one LLM decision, not three sequential gates. Resume-shortcut and Full-route were never two independent runtime checks — they were two possible answers to "what is this?". So the gauntlet over-implied a ladder where there's really one reasoning call.
  3. The maestro is stateful and that's the point. Its value is reasoning over its own memory (what it has done + the open-WO state, across both threads of a WO) — that's what resolves "I'm done with the toilet" to the right one of N toilet WOs, vs. blindly opening a new one.

ADR-0059's genuinely good bones — LLM proposes a closed vocabulary, a deterministic layer disposes, and the I3–I6 conversational-understanding invariants — are kept and re-homed, not discarded.

Decision

The maestro is one inbound PACKAGE → an ordered set of actions, executed by a stateful reasoning layer. The flow:

channel (SMS/call/in-app) → Clara gathers → flush trigger → PACKAGE → Pre-check (Haiku) → Reasoning brain (LLM) → ordered ACTION QUEUE → lanes → Temporal pipeline (WO actions) → write-back to memory.

What is removed: the 3-rung gauntlet, deriveEnteredRung + rung bucketing, resume-shortcut-as-a-gate, commandToRung. What is preserved (re-homed): safety-first precedence (→ the pre-check), the rating-hijack protection (now structural via the brain reading context+memory), I3–I6 (now requirements of the brain), and the closed-vocabulary / "LLM proposes, deterministic disposes" split.

Entity classification (per ADR-0027)

Entity Class Naming Spine trace (canonical) OR derived-from / rebuilt-by / drift-tolerance (derived)
MaestroDecision canonical bare name the maestro's own decision record (born here). Keyed WO#<woId> / MAESTRO#<ULID>; spine trace via the WO's personId and the thread party's personId. Append-only.
MaestroState derived *Snapshot-class (working name MaestroState) from: the MaestroDecision trail for the WO · Rebuilt by: each decision append (transactional) · Drift tolerance: 0 vs. the trail; the trail's openWoSnapshot is itself a cache reconciled against the real WO store.

Consequences

Alternatives considered