Write lint_sop(sop) — the gate every SOP passes before it ships.
It returns a list of reason strings, in this order:
- If
sop["owner"]is falsy →"no owner" - Then for each step, in order, check both rules on that step:
source == "model-filled"and notverified→f"step {n} unverified model fill"safetyis truthy andsafety_reviewedis not (use.get("safety_reviewed")— most steps don't have the key) →f"step {n} safety step unreviewed"
The call site prints READY for an empty list, else
BLOCKED — with reasons joined by "; ".
Expected output:
sop-receiving: READY
sop-stuck-orders: BLOCKED — step 3 unverified model fill
sop-hazmat-intake: BLOCKED — no owner; step 2 safety step unreviewed