ENGINE 32

SFS-E32-COE · CLOSING CONTROLS · REV 2026-07-24 · PRODUCTION

PRODUCTION = runnable end-to-end, CI-backed, full test suite passing. All data fictional and seeded.

Home Sale Closing & Settlement Tie-Out

Did the home close, and does its closing package agree with itself?

When a residential developer's home reaches close of escrow the accounting team assembles a package -- a settlement statement, a balanced closing journal entry, a revenue-recognition line, a loan release reconciled to the lender's statement, and a cost-of-sale relief -- and this engine proves, unit by unit, that the package agrees with itself. It is a tie-out check, not an underwriting one: what a home should have sold for, whether the proforma was right, whether the loan should have been made are questions a different engine owns. The engine reads the nine artifacts a closing file carries -- the unit register, the proforma assumptions, the settlement register, the closing journal-entry register, the revenue schedule, the loan-release register, the cost-of-sale schedule, the closing summary and the closing report -- and runs twenty-five deterministic controls over them. Is the file complete; is the unit register sound and does every closed home carry its full package; does each closing entry foot with a receivable derived rather than typed; does the settlement statement recompute -- total charges, closing costs and net to seller re-summed from the components; do the rate-derived fees strike at their proforma rates, and are an off-rate broker commission and an over-allowance concession flagged for a reviewer; was revenue recognised in the close-of-escrow month and the deferred upgrade reversed in full; does each loan release roll forward and tie to the lender's loan statement, with the bank remittance covering the scheduled release price; does the cost-of-sale margin recompute and the prepaid commission relief cap at the prepaid balance; and does the rollup -- the closed count, the total net to seller and every per-unit tie-out flag -- recompute from the units underneath it. It compares every figure with exact ==, treats the release-price gate as >=, and never writes to a source artifact.

A close-of-escrow package looks like the most finished paper a developer produces: the home sold, the money moved, the entry balanced, the report footed. That is exactly why it drifts. None of the ways it goes wrong look wrong in a folder of settlement statements. An entry balances but its receivable was typed rather than plugged; a settlement total was keyed instead of summed; a rate-derived fee was struck a few hundred dollars off its proforma rate; revenue landed a month late; the internal loan release and the lender's statement disagree by a figure nobody tied; and the rollup states a closed count, a net-to-seller total and a per-unit tie-out flag that nobody recomputed from the settlements and entries beneath them. The engine rebuilds every derived figure from the base facts through the same settlement kernel that produced the data, compares with exact ==, ships a planted-defect file for every registered control, and states its benchmark as a command rather than a claim. A figure keyed instead of derived stays invisible until someone recomputes the closing the developer already booked.

Run it Book a consultation

Architecture

functional block stack · static overview
Structural Precondition Unit Register Closing Journal Entry Settlement Statement Rate-Derived Fees Revenue Recognition Loan Release Tie Cost-of-Sale Relief Rollup Tie-Out substrate: seeded fictional data

Select a layer

Nine control families run in registry order over each closing file. The first proves the others had something to read: a control that passes because its artifact was absent reports assurance it never performed, so completeness is settled before anything is recomputed.

Key specifications

at a glance
10,3791
Tests
the collected checks that pin this engine's behavior
252
Controls
independent rules run over every closing file
93
Families
groups of controls, each answering one question
274
Closing files
one clean baseline plus twenty-six planted-defect files
95
Artifacts read
unit register, proforma, settlement, closing entry, revenue, loan release, cost-of-sale, summary, report
06
Tolerance
a figure a cent off the re-derivation is a break, not a rounding band

What it does for you

plain terms

When a residential developer's home reaches close of escrow the accounting team assembles a package: a settlement statement, a balanced journal entry, a revenue-recognition line, a loan release tied to the lender's statement, and a cost-of-sale relief. Every one of those is a spreadsheet assembled under deadline, and each goes wrong in ways nobody watches. The entry does not foot, or its Accounts Receivable plug was typed rather than derived. The settlement total settlement charges, total closing costs or net to seller was keyed instead of summed, or a rate-derived fee -- the listing sales fee, the warranty reserve -- was struck at the wrong rate. Revenue lands in the wrong month, when residential sales revenue is earned only at close of escrow. The internal loan release and the lender's loan statement disagree, or the bank remittance falls short of the scheduled release price. And the rollup states a closed count, a total net to seller or a per-unit tie-out flag that nobody recomputed from the settlements and entries underneath it. None of these are judgement calls. They are equalities, thresholds, date-gates and membership checks -- a total against its re-summed components, a receivable against the derived plug, a fee against its proforma rate, a recognition month against the close date, an ending balance against the lender statement with ==, a remittance against the release price with >= -- which a deterministic control settles better than a folder of spreadsheets inherited by whoever handles closings this quarter.

The seeded demo runs every control over every closing file7. The CLI generates twenty-seven fictional closing files -- one clean baseline and one carrying each of the twenty-six planted defects -- then runs all twenty-five 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.

The loan roll-forward and the lender tie are independent8. One defect file moves a home's stated loan ending balance and its lender-statement figure together, so the roll-forward from beginning plus activity no longer holds while the two ending figures still agree -- loan_ending_recomputes fails and loan_ties_lender_statement does not. A separate defect moves only the lender figure and trips loan_ties_lender_statement alone, proving the two controls catch different breaks.

The tie-out flag is recomputed, not read back9. A defect file flips a closed home's summary tie-out flag to false while its underlying settlement, entry, revenue line, loan release and cost-of-sale entry all still recompute. rpt_unit_tied_recomputes rebuilds the flag from that package and fails against the stated value, proving the summary is recomputed from the evidence beneath it rather than trusted as written.

Functional block diagram

engineering · each block links to its source
Functional block diagram of the Home Sale Closing & Settlement Tie-Out engine closing files closing files closing files closing files closing files closing files closing files closing files closing files resolves resolves resolves resolves resolves resolves resolves resolves findings findings findings Seeded Closing Files StructuralPrecondition Unit Register Closing Journal Entry Settlement Statement Rate-Derived Fees Revenue Recognition Loan Release Tie Cost-of-Sale Relief Rollup Tie-Out Registers,Schedules & Proforma Verdict and Findings SFS-E32-COE · FUNCTIONAL BLOCK DIAGRAM · REV 2026-07-24

Plain terms

  • Seeded Closing Files. fictional close-of-escrow packages enter the control registry
  • Structural Precondition. is the closing file complete
  • Unit Register. is the register sound and every closed home fully packaged
  • Closing Journal Entry. does each closing entry foot with a derived receivable
  • Settlement Statement. does the settlement statement recompute
  • Rate-Derived Fees. do the fees strike at their proforma rates
  • Revenue Recognition. was revenue recognised in the close month
  • Loan Release Tie. does the loan release roll forward and tie to the lender
  • Cost-of-Sale Relief. does the margin relief recompute
  • Rollup Tie-Out. do the count, total and tie-out flags recompute from the units
  • Registers, Schedules & Proforma. the artifacts and proforma rates every rule resolves against
  • Verdict and Findings. every finding, with the reason it exists, ends at a person

Engineering

  • Seeded Closing Files. generate_corpus writes one clean baseline plus one planted-defect file for every registered control -- twenty-seven files in total, one carrying each of the twenty-six planted defects. Only the units, the proforma assumptions and the settlement charge components are stated as base facts; every figure the engine later checks -- each settlement total, each closing entry, the revenue lines, the loan ending balances, the cost-of-sale relief, each home's tie-out flag and the report counts -- is re-derived through the same closing_engine.settlement kernel the controls recompute with, so the relationships the engine tests are the relationships that produced the data.
  • Structural Precondition. One control. FAILs a file missing any of the nine artifact types or carrying a duplicate, so no downstream rule holds vacuously on absent evidence.
  • Unit Register. Four controls: unique unit ids, a known sale status, the close-of-escrow base facts on every closed home, and exactly one of each closing artifact per closed home.
  • Closing Journal Entry. Three controls: every entry names a registered unit, total debits equal total credits, and the Accounts Receivable line equals the derived balancing plug rather than a typed figure.
  • Settlement Statement. Three controls: total settlement charges re-summed from the components, total closing costs as charges less the broker commission, and net to seller as gross less charges, each compared with exact ==.
  • Rate-Derived Fees. Four controls: the listing sales fee and warranty reserve re-derived at their proforma basis-point rates (hard), and a FLAG each for a broker commission off the proforma assumption and a concession above the assumed allowance.
  • Revenue Recognition. Two controls: revenue recognised in the home's close-of-escrow month, and the deferred upgrade reversed in full to the unit's deferred balance.
  • Loan Release Tie. Three controls: the ending balance re-rolled from beginning plus activity, tied to the lender's loan statement with exact ==, and the bank remittance covering the scheduled release price with exact >=.
  • Cost-of-Sale Relief. Two controls: revised project profit and margin re-derived from the base facts, and the prepaid commission relief capped at the prepaid balance.
  • Rollup Tie-Out. Three controls: the report's closed count ties the register, the total net to seller recomputes from the settlements, and every per-unit tie-out flag is rebuilt from its closing package.
  • Registers, Schedules & Proforma. The unit register carries each home's id, status, close-of-escrow date, gross sales, deferred upgrade and prepaid balance; the settlement register, closing journal-entry register, revenue schedule, loan-release register and cost-of-sale schedule carry the per-home derived figures; the proforma assumptions carry the basis-point rates the fees are measured against; and the closing summary and closing report carry the per-home tie-out flags and the rollup. Every settlement, entry, fee, revenue, loan, cost-of-sale and rollup control resolves against these through the shared closing_engine.settlement kernel.
  • Verdict and Findings. Findings roll up per closing 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
CommandOperationOutputExitArtifacts
python run.py
regenerate the seeded fictional corpus, run all twenty-five controls, write both reportsper-file verdicts and every actionable finding, then the overall verdict2 for the bundled corpus, which carries a planted defect for every control by designclosing_report.json, closing_report.md, samples/
python -m closing_engine samples
analyze an existing folder of closing files without regenerating itper-file verdicts and findings0 PASS / 1 REVIEW / 2 FAIL / 3 usagenone unless --json or --md is passed
python -m closing_engine samples --generate --quiet
regenerate the corpus and print only the overall verdicta single verdict line0 PASS / 1 REVIEW / 2 FAIL / 3 usagesamples/
python -m pytest closing_engine/tests -q
run the full test suite for this engine10379 passed0 when every test passesnone

Benchmarks

measured demo results
MeasureResult
Engine tests1010,379 tests collected
live collection from the engine directory
Registered controls1125 controls
counted from the registry, not from documentation
Planted defects1226 defect files
every registered control has at least one file that trips it
Control coverage13100 percent of controls with a planted defect
no control ships without a file demonstrating it firing

Control characteristics

engineering

Plain terms

The engine has no write path and therefore no autonomy to gate. It produces findings; a person decides whether a home is carried into the close and whether a broken figure is corrected at its source.

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

SeverityVerdictAction
No findings above PASSPASScarry the mechanically clean closing file into the documented sign-off and close review
One or more FLAG, no FAILREVIEWa human confirms each flag; a broker commission booked off the proforma rate and a concession above the assumed allowance both land here
One or more FAILFAILthe home or figure is not carried into the close until the failing control is cleared -- an entry that does not foot, a settlement line that does not recompute, a fee off its rate, revenue in the wrong month, a loan release that does not tie, or a rollup that does not recompute

Operating limits

what it refuses to do

See it run

control architecture
Corporate reconciliation-bridge architecture for Home Sale Closing & Settlement Tie-Out: parallel source documents and ledger records converge at a tie-out control, with exceptions separated from verified evidence.
The Home Sale Closing tile states the question that has to hold unit by unit: every closed home's settlement statement, balanced closing entry, revenue line, loan release and cost-of-sale relief recompute from the base facts and the proforma rates, and the rollup's count, total and tie-out flags are rebuilt from the units beneath rather than trusted as stated.

Integration

how to run it

Distribution: public repository, MIT license.

python run.py
python -m pytest closing_engine/tests -q
Source on GitHub Engine README All tests, by engine Run in Codespaces
Substantiation
  • 1python -m pytest --collect-only -q -o addopts= (closing-settlement-automation/)
  • 2len(closing_engine.engine.REGISTRY)
  • 3distinct rule-id prefixes in closing_engine.engine.REGISTRY
  • 4samples/*.json after python run.py
  • 5len(closing_engine.model.DOC_TYPES)
  • 6closing_engine/tests boundary tests on the cent and the release-price threshold
  • 7python run.py (closing-settlement-automation/); closing_engine/tests planted-defect suite
  • 8closing_engine/generate.py DEFECTS loan_ending_wrong / loan_does_not_tie
  • 9closing_engine/generate.py DEFECTS tied_flag_wrong -> rpt_unit_tied_recomputes
  • 10python -m pytest --collect-only -q -o addopts= (closing-settlement-automation/)
  • 11len(closing_engine.engine.REGISTRY)
  • 12len(closing_engine.generate.DEFECTS)
  • 13closing_engine/tests: every registered rule has a planted defect
  • 14closing-settlement-automation/README.md and closing_engine read-only / determinism tests
  • 15closing_engine/model.py DOC_TYPES
  • 16closing_engine/engine.py module scope and README
  • 17closing_engine/engine.py fee_ family and proforma_assumptions
  • 18closing_engine/generate.py

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