# VERIFY — forge-pm-work-order-sim

> FICTIONAL / SYNTHETIC DEPLOYMENT MODEL. No real customer data is used.

`node verify.mjs` boots the real Work Order Agent Ecosystem (real PostgreSQL via
PGlite + a real gRPC dispatch service, imported from `../work-order-agents`) and
processes all 100,000 synthetic orders through classify → route → validate → action,
then asserts 25 MUST_PASS checks. What each group asserts:

## Scale & determinism
- **Scale:** the full corpus (100,000 by default) is processed through the live
  ecosystem.
- **Reproducible:** re-generating from the same seed yields an identical corpus
  fingerprint.

## Accuracy (vs. synthetic answer key)
- **Classification accuracy ≥ 0.90** on resolvable single-trade orders.
- **Priority accuracy ≥ 0.90.**
- **Routing accuracy ≥ 0.99** (zone → region) where a unit/zone exists.

## Safety & quality
- **Exception recall ≥ 0.95** — orders that must go to a human are caught.
- **False-auto-action ≤ 0.02** — the safety-critical error (auto-dispatching
  something that needed a human).
- **Exception precision ≥ 0.90** — clean orders are not over-escalated.
- **Auto-action rate in [0.45, 0.70]** — a sane human-in-the-loop reduction.
- **Duplicate suppression ≥ 0.98** via the durable fingerprint query.
- **Over-cost / missing-location / missing-description = 100% held or rejected.**
- **Emergency escalation = 100%** of P1 emergencies escalated.
- **SLA routing ≥ 0.98** of auto-dispatched orders routed within the required SLA.

## Persistence, audit & transport (live)
- **Persistence:** every order written to `work_orders`.
- **Audit completeness:** one append-only `audit_log` row per order (100%).
- **Dispatch records:** equal to the auto-dispatched count, all with refs.
- **gRPC reachable:** Health RPC succeeds over the wire.
- **Idempotent dispatch:** retrying auto-dispatched orders never double-dispatches.
- **Malformed rejection:** the server rejects contract-violating requests.
- **Audit readback:** a sample order's record + audit trail read back from the DB.

## Reconciliation & ROI
- **Reconciliation:** dispositions sum to total volume.
- **ROI:** first-year net savings positive and payback under 12 months under the
  stated assumptions.

A failure in any check sets a non-zero exit code and blocks the Proof Layer from
recording a passing verification.
