A full-featured CRM built with React, shadcn/ui, and Supabase.
Plan gate fails closed to plan when GATE is absent (verify finding 1)
Jeromef076df4e5204
diff --git a/.claude/agents/orchestrator.md b/.claude/agents/orchestrator.mdindex 0492b61b..8a31c298 100644--- a/.claude/agents/orchestrator.md+++ b/.claude/agents/orchestrator.md@@ -344,7 +344,7 @@ Entered only from S-REVIEW on `BLOCKED:`.The planner runs in the **foreground**: its result returns this same turn.-**Plan gate (audit D8).** Read `GATE` from your dispatch prompt: `none` | `plan` | `waves` (default **`plan`** on the developer surface; the CRM Builder launcher sets `none`). If `GATE` is `plan` or `waves`: do NOT continue to STATE B. Emit the plan (one line per ticket: id, title, `files_to_modify`, `dependencies`, acceptance) plus an approval question, and **END THE TURN** so the user can review and edit the tickets on disk (`${TICKETS_DIR}/TASK-*.json`). On approval a FRESH orchestrator resumes with `<intent>execute-plan</intent>` and enters STATE B (no re-planning); wants-changes re-plans with their new input; abort stops. If `GATE=none` (autonomous / overnight / CRM Builder): **do NOT end the turn**, continue straight into STATE B. Additionally, if `GATE=waves`, pause the same way after EACH wave's merges (before the next wave); the `<intent>execute-plan</intent>` resume continues from the merged state (RECOVERY dispatches only tickets whose dependencies are now merged).+**Plan gate (audit D8).** Read `GATE` from your dispatch prompt: `none` | `plan` | `waves`. **Resolve the default fail-closed: any value other than the exact literal `none` (including an ABSENT or unrecognized `GATE`) is treated as `plan`** (only the CRM Builder launcher sets an explicit `none`). You must NEVER silently skip the plan gate: absence is not permission. So unless `GATE` is exactly `none`, do NOT continue to STATE B. Emit the plan (one line per ticket: id, title, `files_to_modify`, `dependencies`, acceptance) plus an approval question, and **END THE TURN** so the user can review and edit the tickets on disk (`${TICKETS_DIR}/TASK-*.json`). On approval a FRESH orchestrator resumes with `<intent>execute-plan</intent>` and enters STATE B (no re-planning); wants-changes re-plans with their new input; abort stops. If `GATE=none` (autonomous / overnight / CRM Builder): **do NOT end the turn**, continue straight into STATE B. Additionally, if `GATE=waves`, pause the same way after EACH wave's merges (before the next wave); the `<intent>execute-plan</intent>` resume continues from the merged state (RECOVERY dispatches only tickets whose dependencies are now merged).---diff --git a/CLAUDE.md b/CLAUDE.mdindex 5671ae95..759ec420 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -14,7 +14,7 @@ Code-change requests can be handled by the **agent harness**: a team of subagentWhile that fresh dispatch runs, do not start a parallel plan B (don't generate the migration yourself, don't `TaskStop` it); wait for it to finish, then relay its result.-**Gate level (plan review vs autonomy).** A harness request may carry `gate=none|plan|waves` (default **`plan`**); pass it as a `GATE: <level>` line in the orchestrator dispatch prompt. `plan` (default) pauses after planning so the user reviews the tickets before any code is written; `none` runs autonomously to the terminal point (overnight); `waves` also pauses at each wave boundary. On a plan-gate pause, relay the plan + approval question to the user; on approval, dispatch a FRESH `orchestrator` with `<intent>execute-plan</intent>` and the same `<session_dir>` (never `SendMessage` the old one, same rule as the migration round-trip); on "wants changes", dispatch a fresh orchestrator with their new input. CRM Builder's launcher sets `gate=none`.+**Gate level (plan review vs autonomy).** A harness request may carry `gate=none|plan|waves` (default **`plan`**); ALWAYS pass it as an explicit `GATE: <level>` line in the orchestrator dispatch prompt (use `GATE: plan` when the user did not specify). The orchestrator also fails closed (a missing or unrecognized `GATE` is treated as `plan`), so the gate is never silently skipped by an omitted line. `plan` (default) pauses after planning so the user reviews the tickets before any code is written; `none` runs autonomously to the terminal point (overnight); `waves` also pauses at each wave boundary. On a plan-gate pause, relay the plan + approval question to the user; on approval, dispatch a FRESH `orchestrator` with `<intent>execute-plan</intent>` and the same `<session_dir>` (never `SendMessage` the old one, same rule as the migration round-trip); on "wants changes", dispatch a fresh orchestrator with their new input. CRM Builder's launcher sets `gate=none`.## Opting in