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.

StatusValue IDWho AdvancesAuto?
Intakego210Portal / AdminManual
ScheduledjKK2pSchedulerManual
In Progress0Xf2FInspectorSemi-auto
Field Complete1yplcInspector / OpsSemi-auto
Pending RFIDPBDXSystemAuto — resolves when last RFI closed
Ready for CertogUeqSystemAuto — auto-validation passes all 10 checks
Certifiedz1TftOps ManagerManual
Invoiced6yJZISystemAuto — cert + invoice sent
ClosedO1GXVSystem / AdminAuto — 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.

StatusValue IDWho SetsTrigger
Not StartedffypRSystemDefault on project creation
DraftpD6PPSystemAuto — cert package generated via cert-generator-v3
ApprovedPh6RROps ManagerCert reviewed and approved

Invoice Sub-Status (3 Values)

Tracks invoicing lifecycle. Payment confirmation via EFT reconciliation (transitioning to Revolut).

StatusValue IDWho SetsTrigger
Not InvoicedxmcJKSystemDefault
SentPtYwMSystemAuto — invoice emailed to client
Paid2GdlHSystemAuto — 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:

  1. auto-validation — 10-point check on Field Complete, auto-advances to Ready for Cert or generates RFI
  2. pipeline-shepherd — daily 7:45 AM scan, detects stuck projects, sends alerts
  3. Intake enrichment — auto-populates jurisdiction, certifier routing, forms, timeline on new submissions
  4. confidence-routing — determines whether cert/invoice goes direct or queues for OwnerReviewQueue