# Workflow Contracts

## 1. Weekly Founder Operating Review

**Trigger:** the current operating cycle reaches its review cadence or an urgent exception is raised.

**Flow:** evidence → issue → decision → commitment → exception monitoring → review/lesson.

**Required control:** accountable owner, source authority, status, confidence, review trigger, and definition of done where action is expected. Decisions require an approver and rationale. Records may connect to the relevant actor, opportunity, and project.

**Success evidence:** an accepted outcome, closed or explicitly accepted exceptions, current evidence, measured actual-versus-expected result, and reusable lesson.

## 2. Client Lead-to-Cash

**Trigger:** a relationship is captured as a lead, prospect, or client.

**Flow:** actor → interaction/next action → opportunity → proposal version → acceptance → project → invoice → cleared collection.

**Required control:** opportunity owner, value/currency, stage, probability, next step, and expected close date. A proposal is immutable as a numbered version; changes create a later version. Project conversion closes the opportunity as won.

**Integrity:** actor identity remains the same across opportunity, project, invoice, and payment. Payments cannot be posted against the wrong currency, organization, or invoice and cannot exceed outstanding value.

Cash evidence is never hard-deleted through the UI. Pending entries may be cleared; erroneous entries are voided with an audit event, and any linked invoice status/outstanding value is recalculated inside the same database transaction.

**Success evidence:** accepted proposal, won opportunity, mobilized project, invoice issued, cleared collection, and audit history.

## 3. Project Delivery Control

**Trigger:** accepted work is converted into a project or an internal project is authorized.

**Flow:** project definition → ordered milestones → active commitments → acceptance/evidence → invoice/collection and delivery cost → closure/review.

**Required control:** manager, client, status, health, dates, budget/currency, and definition of done. Each milestone should carry an owner, due date, acceptance criteria, value where relevant, and evidence reference.

**Integrity:** project financials are derived from linked invoices and transactions. At-risk health, overdue milestones, and blocked commitments remain visible in the executive workflow.

**Success evidence:** all required milestones accepted or completed, exceptions resolved/accepted, evidence attached, delivery economics reconciled, and actual outcome reviewed.

## Shared state ownership

| Question | Source of truth |
|---|---|
| Who is the client? | `actors` |
| What may be sold? | `opportunities` and versioned `proposals` |
| What must be delivered? | `projects`, `milestones`, and linked `work_records` |
| What was invoiced/paid/spent? | `invoices` and `financial_transactions` |
| Who decided and why? | decision `work_records` plus `audit_logs` |
| What proves the state? | `evidence_files`, source authority, acceptance reference, measurements |
| What requires attention? | exceptions, overdue commitments/milestones, outstanding invoices, next actions |

No workflow is allowed to copy these identities into an unrelated shadow table.
