ENGINE 34
SFS-E34-SOV · COMMITMENT CONTROLS · REV 2026-07-24 · PRODUCTION
PRODUCTION = runnable end-to-end, CI-backed, full test suite passing. All data fictional and seeded.
Subcontract SOV & Change Orders
Did the contract move only on approved paper, and does every billed figure re-derive from it?
A residential developer buys construction through subcontract commitments -- a contract with a schedule of values (SOV) breaking the price into lines, change orders that amend it, and a monthly pay application that bills against it line by line -- and every column on that chain is derived from a column beneath it and typed by hand somewhere. This engine reads the six artifacts a commitment billing record carries -- the commitment register, the change-order log, the schedule of values, the pay-application register, the committed-cost roster and the lien-release register -- and runs twenty-nine deterministic controls over them. Is the billing file complete and one of each artifact, are the commitment ids unique and their terms readable, and does the committed-cost roster tie the register and every revised contract re-derive as original plus net approved change orders. Does every change order name a registered commitment, number sequentially as #-N, carry a known status, and is no commitment born from a change order or misnamed off the project-vendor-count pattern. Do the SOV lines foot exactly to each original contract, does every pay-app line re-derive as previously billed plus this period with its percent as floored basis points, do the headers foot, and is the current request exactly completed minus previously billed. Is every line billed within its scheduled value at exact <=, does the balance to finish re-derive, is retention the contract rate on the request, do the sales tax and the payment due including tax re-derive, does each app open at the prior app's close with the sequence numbered 1..N and periods that advance, do the roster Total columns foot, and does every conditional lien release tie the certified payment due exactly once. It compares every figure with exact ==, tests the billing cap with exact <=, counts only approved change orders as moving the contract, and never writes to a source artifact.
A pay application is a page of derived columns, and none of the ways it goes wrong look wrong on the page. The contract drifts from its paper: a pending change order is counted as if approved, or a soft-cost credit is booked as a brand-new commitment instead of a #-N amendment, and the committed-cost roster no longer states what was actually signed. The billing chain breaks a line at a time: a completed-to-date that stops equalling previously billed plus this period, a line that quietly bills past its scheduled value, a month whose previously-billed no longer equals last month's total completed -- and the overbilling compounds under a header that still foots. And the money math is asserted rather than derived: retention that stops being the contract rate on the request, sales tax off the rate, a payment due that is not request minus retention plus tax, and a conditional release signed for an amount nobody recomputed. The engine rebuilds every derived figure from the base facts through the same billing kernel that produced the baseline and compares with exact ==, tests the per-line cap with exact <= because overbilling foots, counts only approved change orders as moving the contract, and ships a planted-defect file for every registered control. A line billed past its schedule, a contract moved on a pending order, or a release signed for the wrong amount stays invisible until someone recomputes the certificate the developer already paid on.
Architecture
functional block stack · static overviewSelect a layer
Eleven control families run in registry order over each billing file. The first proves the others had something to read, because a control that passes on an absent artifact reports assurance it never performed.
Key specifications
at a glanceWhat it does for you
plain termsA residential developer buys construction through subcontract commitments: a contract with a schedule of values breaking the price into lines, change orders that amend it, and a monthly pay application that bills against it line by line. Every column on that chain is derived from a column beneath it, and every one of them is typed by hand somewhere. Three failures hide inside that, and none of them look wrong on the page. The contract drifts from its paper: the revised commitment stops equalling original plus net approved change orders -- a pending order counted early, a soft-cost credit booked as a brand-new commitment instead of a #-N amendment -- and the committed-cost roster no longer states what was signed. The billing chain breaks a line at a time: a completed-to-date that stops equalling previously billed plus this period, a line that quietly bills past its scheduled value, a month whose previously billed no longer equals last month's total completed -- and the overbilling compounds under a header that still foots. The money math is asserted, not derived: retention off the contract rate, sales tax off the rate on the taxable request, a payment due that is not request minus retention plus tax, and a conditional release signed for an amount nobody recomputed. None of these are judgment calls. They are equalities and a cap -- a completed against previously billed plus this period with exact ==, a line completed against its scheduled value with exact <=, a revised contract against original plus net approved changes -- which a deterministic control settles better than a workbook inherited by whoever bills the job this month.
The seeded demo runs every control over every billing file7. The CLI generates thirty fictional billing files -- one clean baseline and one carrying each of the twenty-nine planted defects, on the fictional Brightwater Commons project -- then runs all twenty-nine controls over each. The clean file returns PASS with no flags; every defect file returns REVIEW or FAIL and names the control it tripped along with the reason that control exists.
Only an approved change order moves the contract, and the cap is per line8. One defect file counts the pending winter-protection order as if approved, and cmt_revised_rederives recomputes the net from the change-order log through the shared kernel -- approved orders only -- and fails. Another bills the electrical rough-in line to 90,000 against its scheduled value, and because the whole chain is re-derived, only cap_not_overbilled fires at exact <= while every footing figure stays consistent.
The billing chain is recomputed, not read back9. A defect file re-types this period's work on a concrete line after the completed column was footed, so completed-to-date no longer equals previously billed plus this period. line_completed_rederives rebuilds the figure as D+E and fails, proving the pay app is recomputed from the base facts beneath it rather than trusted as stated.
Functional block diagram
engineering · each block links to its sourcePlain terms
- Seeded Billing Files. fictional subcontract billing files enter the control registry
- Structural Precondition. is the billing file complete, one of each artifact
- Commitment & Roster. are the commitments sound and the roster re-derived
- Change-Order Gate. does every change order clear the authorization and naming gate
- Schedule of Values. do the SOV lines foot to the original contract
- Pay-App Arithmetic. does every pay-app line and header re-derive
- Billing-to-Date Cap. is every line within its scheduled value
- Retention. is retention the contract rate on the request
- Tax & Payment Due. do the sales tax and payment due re-derive
- Pay-App Roll-Forward. does the billing sequence roll forward with no break
- Portfolio Footing. do the roster Total columns foot
- Conditional Release Tie. does the release tie the certified payment, exactly once
- Artifacts & Billing Kernel. the six artifacts and shared kernel every rule resolves against
- Verdict and Findings. every finding, with the reason it exists, ends at a person
Engineering
- Seeded Billing Files. generate_corpus writes one clean baseline plus one planted-defect file for every registered control, thirty files in total, for fictional developers on the fictional Brightwater Commons project in the State of Marran. Only the commitments, the change orders, the SOV lines and each pay app's work-this-period figures are stated; previously billed, completed, percents, balances, the header and request / retention / tax / payment-due chain, the committed-cost roster and the conditional releases are re-derived through the same billing kernel the engine later recomputes with, so the relationships the engine tests are the same relationships that produced the data.
- Structural Precondition. One control. FAILs a file missing any of the six artifact types or carrying a duplicate, so no downstream rule holds vacuously on absent evidence.
- Commitment & Roster. Four controls: unique commitment ids, the required terms present, the roster tying the register, and every revised contract equal to original plus net approved change orders.
- Change-Order Gate. Five controls: a registered commitment named, sequential #-N numbering, a known status, no commitment born from a change order, and an id that composes from project, vendor and sequential count.
- Schedule of Values. Two controls: every SOV line unique and attributable to a registered commitment, and each commitment's lines footing with exact == to its original contract amount.
- Pay-App Arithmetic. Five controls: valid line references, completed as D+E, the percent as floored basis points (a flag), the header footing to its lines, and the request as completed minus previously billed.
- Billing-to-Date Cap. Two controls: no line billed past its scheduled value tested with exact <=, and a balance to finish that re-derives as scheduled minus completed.
- Retention. Two controls: the rate on the standard 5% / 10% menu (a flag), and the retention held equal to the contract rate on the current request with truncating basis-point arithmetic.
- Tax & Payment Due. Two controls: sales tax as the contract rate on the taxable request (which equals the request), and payment due including tax as request minus retention plus tax.
- Pay-App Roll-Forward. Two controls: each app's previously billed equal to the prior app's total completed (the first at zero), and the app numbers 1..N with no gap or repeat and periods that advance.
- Portfolio Footing. Two controls: the three Total columns footing from the commitment rows, and the revised total equal to original total plus changes total.
- Conditional Release Tie. Two controls: exactly one conditional release per pay app, and each release signed for the certified payment due including tax.
- Artifacts & Billing Kernel. The commitment register carries each commitment's id, vendor, project and vendor codes, origin, original contract and retention and tax rates; the change-order log carries each order's commitment, number, status and amount; the schedule of values carries the per-line scheduled values; the pay-application register carries each app's lines and header totals; the committed-cost roster carries the per-commitment revised amounts and the three Total columns; and the lien-release register carries the conditional release exchanged for each payment. Every commitment, change-order, SOV, line, cap, retention, tax, roll-forward, portfolio and lien control resolves against these through the shared billing kernel.
- Verdict and Findings. Findings roll up per billing file: any FAIL is FAIL, FLAGs without FAILs are REVIEW, clean is PASS. The CLI exit code is the verdict, so a pipeline can gate on it. Reports carry no timestamps or absolute paths, which is what makes the committed report diffable.
Instruction set
every public command| Command | Operation | Output | Exit | Artifacts |
|---|---|---|---|---|
python run.py | regenerate the seeded fictional corpus, run all twenty-nine controls, write both reports | per-file verdicts and every actionable finding, then the overall verdict | 2 for the bundled corpus, which carries a planted defect for every control by design | sov_report.json, sov_report.md, samples/ |
python -m sov_engine samples | analyze an existing folder of billing files without regenerating it | per-file verdicts and findings | 0 PASS / 1 REVIEW / 2 FAIL / 3 usage | none unless --json or --md is passed |
python -m sov_engine samples --generate --quiet | regenerate the corpus and print only the overall verdict | a single verdict line | 0 PASS / 1 REVIEW / 2 FAIL / 3 usage | samples/ |
python -m pytest sov_engine/tests -q | run the full test suite for this engine | 10412 passed | 0 when every test passes | none |
Benchmarks
measured demo results| Measure | Result |
|---|---|
| Engine tests10 | 10,412 tests collected live collection from the engine directory |
| Registered controls11 | 29 controls counted from the registry, not from documentation |
| Planted defects12 | 29 defect files every registered control has at least one file that trips it |
| Control coverage13 | 100 percent of controls with a planted defect no control ships without a file demonstrating it firing |
Control characteristics
engineeringPlain terms
The engine has no write path and therefore no autonomy to gate. It produces findings; a person decides whether a pay application is certified and whether a contract, a change order or a release is corrected.
Engineering
Deterministic envelope. seeded fictional inputs, read-only operation, offline default mode.
Demo gate. FAIL on the bundled corpus, by design -- it carries a planted defect for every registered control
| Severity | Verdict | Action |
|---|---|---|
| No findings above PASS | PASS | carry the mechanically clean billing file into the documented sign-off and payment review |
| One or more FLAG, no FAIL | REVIEW | a human resolves each flag; a stated percent-complete that does not re-derive and a retention rate off the standard 5% / 10% menu both land here |
| One or more FAIL | FAIL | the figure is not certified until the failing control is cleared -- a line billed past its schedule, a contract moved on a pending order, a broken roll-forward, a release that does not tie, or a figure that does not recompute |
- Read-only: billing files are parsed and never written back, so the engine cannot introduce the break it reports.
- Integer cents throughout, compared with exact ==, and the per-line billing cap tested with exact <=; there is no tolerance band, and a cent off the re-derivation is reported as a break.
- A figure that should be integer cents but is not produces an AMOUNT_INVALID finding contained to the one row it was read on, rather than being coerced into the number the engine is meant to audit.
- One billing kernel: the controls and the generator share the formulas in sov_engine.billing, so a derived figure cannot disagree with the data that produced it.
- Only approved change orders move the revised contract: a pending or void order re-priced any number of times moves nothing until it is approved.
- Deterministic and byte-stable: same inputs produce the same findings in the same order, with no timestamps or absolute paths in any output.
- Absent evidence is never a passing control; a missing artifact fails completeness rather than letting the controls that read it pass unread.
Operating limits
what it refuses to do- The engine never certifies a pay application, cuts a payment, approves a change order, signs a lien release, or writes to a source artifact. It reads the billing file and stops.14
- It reads the six artifacts the commitment billing record emits. It does not connect to a general ledger, a lender draw system, a job-cost report or the underlying contracts and waivers.15
- It proves the arithmetic chain re-derives -- the SOV foots, the columns recompute, the cap holds, the release ties -- not that the billed work was actually performed or that a change order was authorized outside the log it reads.16
- It keeps only the arithmetic cross-tie: the conditional release amount equals the certified payment due. Which lender draw funds a pay application and whether a lien waiver's statutory form is correct stay with their own engines.17
- It re-derives retention and tax at the contract rates the file carries; it does not decide whether those rates are correct, and it treats the standard 5% / 10% retention menu as a review flag rather than a hard failure. All shipped data is fictional and every billing period sits in a fictional future.18
See it run
control architecture
Integration
how to run itDistribution: public repository, MIT license.
- 1python -m pytest --collect-only -q -o addopts= (sov-commitment-automation/)
- 2len(sov_engine.engine.REGISTRY)
- 3distinct rule-id prefixes in sov_engine.engine.REGISTRY
- 4samples/*.json after python run.py
- 5len(sov_engine.model.DOC_TYPES)
- 6sov_engine/tests boundary tests on the cent and the <= billing cap
- 7python run.py (sov-commitment-automation/); sov_engine/tests planted-defect suite
- 8sov_engine/generate.py DEFECTS net_changes_wrong -> cmt_revised_rederives; line_overbilled -> cap_not_overbilled
- 9sov_engine/generate.py DEFECTS line_completed_wrong -> line_completed_rederives
- 10python -m pytest --collect-only -q -o addopts= (sov-commitment-automation/)
- 11len(sov_engine.engine.REGISTRY)
- 12len(sov_engine.generate.DEFECTS)
- 13sov_engine/tests: every registered rule has a planted defect
- 14sov-commitment-automation/README.md and sov_engine read-only / determinism tests
- 15sov_engine/model.py DOC_TYPES
- 16sov_engine/engine.py line_, cap_ and co_ families
- 17sov_engine/engine.py lien_ family and model.py scope note
- 18sov_engine/generate.py and sov_engine/engine.py ret_ / tax_ families
Show us where the hours go.
One conversation: you describe the work that consumes your team's month; we tell you plainly what this engine can take over, what it can't, and what a scoped first phase would cost. Your people keep approval authority.
Book a free consultation