Status Triggers & Lifecycle
Every status, every transition, every trigger, and who is responsible. This describes the Mostly (v1) 8-stage pipeline. Entirely v2 uses a simplified 5-stage pipeline with independent cert/invoice sub-tracks.
Project Status (8 Values + 2 Flags)
The primary lifecycle stored in Supabase projects.status. All status writes route through Supabase as the sole source of truth.
| Status | Value ID | Who Advances | Auto? |
|---|---|---|---|
| Intake | go210 | Portal / Admin | Manual |
| Scheduled | jKK2p | Scheduler | Manual |
| In Progress | 0Xf2F | Inspector | Semi-auto |
| Field Complete | 1yplc | Inspector / Ops | Semi-auto |
| Pending RFI | DPBDX | System | Auto — resolves when last RFI closed |
| Ready for Cert | ogUeq | System | Auto — auto-validation passes all 10 checks |
| Certified | z1Tft | Ops Manager | Manual |
| Invoiced | 6yJZI | System | Auto — cert + invoice sent |
| Closed | O1GXV | System / Admin | Auto — payment confirmed |
Flags
- On Hold — boolean flag, freezes all auto-advance logic. Can be set on any active status. Set by Admin or Ops Manager.
- Cancelled — boolean flag, terminal. Project permanently stopped. Set by Admin only. No further transitions possible.
Cert Sub-Status (3 Values)
Tracks the certification document lifecycle in Supabase projects.cert_status.
| Status | Value ID | Who Sets | Trigger |
|---|---|---|---|
| Not Started | ffypR | System | Default on project creation |
| Draft | pD6PP | System | Auto — cert package generated via cert-generator-v3 |
| Approved | Ph6RR | Ops Manager | Cert reviewed and approved |
Invoice Sub-Status (3 Values)
Tracks invoicing lifecycle. Payment confirmation via EFT reconciliation (transitioning to Revolut).
| Status | Value ID | Who Sets | Trigger |
|---|---|---|---|
| Not Invoiced | xmcJK | System | Default |
| Sent | PtYwM | System | Auto — invoice emailed to client |
| Paid | 2GdlH | System | Auto — payment confirmed (EFT or Stripe webhook) |
Triage (Flag-Based)
Triage is not a lifecycle stage — it is a flag that overlays the project status. The 45-day scan automatically assigns JES-account projects to triage when they have been in an active status for more than 45 days without advancing.
See triage-guide for the full triage workflow.
Transition Map
Intake ──[manual]──> Scheduled ──[manual]──> In Progress ──[semi-auto]──> Field Complete
│
[auto-validation passes]
│
v
Ready for Cert
│
[manual review]
│
v
Certified
│
[auto: cert+inv sent]
│
v
Invoiced
│
[auto: payment confirmed]
│
v
Closed
At any point, on_hold can freeze the pipeline or cancelled can terminate it.
Pipeline Intelligence
Four automated layers monitor transitions:
- auto-validation — 10-point check on Field Complete, auto-advances to Ready for Cert or generates RFI
- pipeline-shepherd — daily 7:45 AM scan, detects stuck projects, sends alerts
- Intake enrichment — auto-populates jurisdiction, certifier routing, forms, timeline on new submissions
- confidence-routing — determines whether cert/invoice goes direct or queues for OwnerReviewQueue