PSoW → ABSoW → Cert + Invoice Pipeline

Core data pipeline for the certification workflow. Three stages:

1. Parse (PSoW — Permitted Scope of Work)

permit-parser extracts structured data from permits, plans, and drive logs at upload. All 9 product divisions produce typed spec objects:

  • UND: pier count, spacing, depth, PSI/torque, extension sleeves, manufacturer
  • ANC: anchor count, spacing, rod length/diameter, plate dimensions, wall location
  • BRC: strap/brace count, spacing, width, wall height, tensile strength, fastening
  • SUP: column count, height, footer type/dims, beam section/LF, joist specs
  • FND: wall thickness/height, footer width/depth, slab thickness, rebar spec, concrete PSI
  • WTR: drain LF, pump count/HP, discharge LF, component list
  • ENC: vapor barrier SF, wall LF, barrier mil, dehumidifier PPD, vents sealed
  • RTW: wall height/thickness, footing dims, rebar spec, material

Auto-SOW creation (auto_create_sow_lines) creates Supabase SOW lines with specs in notes JSON. Add-on triggers fire automatically (UND→BKFL, WTR-BSMT→SLAB+WSEAL, SUP-COL→FTR).

2. Field Verify (ABSoW — As-Built Scope of Work)

Darius confirms or modifies scope via Rob/OpenClaw. The ABSoW bridge writes to BOTH Supabase (SOW_AS_BUILT_QTY) and SOW Gate SQLite (absow_confirmations) in a single operation.

If PSoW == ABSoW: all parsed data flows through automatically. If PSoW ≠ ABSoW: SOW_MODIFIED flag set; cert validation (Check 10) blocks until resolved.

3. Generate (Cert + Invoice)

  • Auto-validation runs 10-point check at Field Complete
  • Production days auto-calculated from SOW quantities (8 division rules)
  • Cert generation uses depth-associated sparklines for pier cards
  • Pre-invoice validation checks ABSoW completeness (blocks if modified scope unconfirmed)
  • Confidence routing guardrails: $5K+, proprietary-form county, or incomplete ABSoW → queued for review

Reference Sources

  • Field Guide: unlikely.pro/fieldguide (source: /opt/fieldguide/src/data.ts)
  • Cert Module Library: unlikely.guide/cert-module-library.html
  • Config: PRODUCT_SPEC_REGISTRY in /opt/unlikely-api/config.py