ENGINE 14
SFS-E14-ICO · CONSOLIDATION CONTROLS · REV 2026-07-22 · PRODUCTION
PRODUCTION = runnable end-to-end, CI-backed, full test suite passing. All data fictional and seeded.
Intercompany Reciprocity
Two sides, one balance
A development group is a tree of entities, not one company: a holding parent over a services arm that carries the payroll and a capital arm that guarantees the construction loans, plus a predevelopment entity that carries land while it is entitled. Cash moves between them constantly, and every move lands two entries on two sets of books kept by two people. This engine reads the artifacts the consolidation process emits and runs twenty-three deterministic controls over them: is the entity tree itself sound, does every due-from equal the due-to that faces it, does each closing balance roll forward from the transactions that moved it, does the cash come from the protocol-correct entity and flow down the ownership chain, and does the guarantor meet its liquidity covenant. It never funds, never sweeps and never writes to a source artifact.
The failure mode here lives between two entities, never inside one. Each company's own books foot; the break only surfaces at consolidation, when the intercompany balances are supposed to eliminate to zero and instead leave a residual nobody can source. By then the period is closed. A one-sided balance, a closing that quietly stopped tying to the ledger, an advance funded from the wrong arm of the group -- none of these move a single entity out of balance, which is exactly why a person closing one set of books cannot see them. The engine ships a planted-defect file for every registered control, so the benchmark is a command rather than a claim.
Architecture
functional block stack · static overviewSelect a layer
Seven control families run in registry order over each period file. The first proves the others had something to read, and that every code they resolve exists.
Key specifications
at a glanceWhat it does for you
plain termsA development group runs as a tree of legal entities, and cash never stops moving between them: advances down the chain to fund predevelopment and overhead, repayments back up out of land sales, equity into projects. Each of those movements is booked twice, on two sets of books, by two people. The arithmetic on each set of books foots perfectly. Nothing inside any one company is out of balance. The break, when there is one, exists only in the space between two entities -- a due-from that one side carries larger than the due-to the other acknowledges, a closing balance that quietly stopped tying to the transactions that moved it, an advance funded from the capital arm when the protocol says it must come from the top parent. None of these move a single entity out of balance, so a person closing one company cannot see them; they surface only at consolidation, when the intercompany balances are supposed to eliminate to zero and instead leave a residual nobody can source, after the period is closed. These are not judgment calls. They are equalities: a due-from against a due-to, a closing against a roll-forward, a funding source against a rule -- which is what a deterministic control settles better than a controller reconciling one entity at a time.
The seeded demo runs every control over every period file7. The CLI generates 25 fictional period files -- one clean baseline and one carrying each planted defect -- then runs all 23 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.
A drift of one cent between the two sides8. A test moves a single due-to closing by one cent. The reciprocity control fires, and the pair-symmetry and roll-forward controls stay silent -- the balance is still two-sided and still ties to its own ledger, which is exactly why the drift is invisible on either entity alone and only a check spanning both finds it.
The group eliminates to zero9. A test sums every due-from closing and every due-to closing on the clean baseline and asserts the two totals are equal -- the property that makes the intercompany balances cancel on consolidation. It holds because every pair is reciprocal, which is the thing the registry is built to keep true.
Functional block diagram
engineering · each block links to its sourcePlain terms
- Seeded Period Files. fictional intercompany period files enter the control registry
- Structural Precondition. is the file complete, and does every code it names exist
- Entity Tree. is the ownership tree itself sound
- Reciprocity. does every due-from equal the due-to that faces it
- Roll-Forward. does the closing tie to the transactions that moved it
- Funding Protocol. does the cash come from the right entity, region and direction
- Liquidity Covenants. does the guarantor meet its floor, and is anyone off-target
- Governance. is the ledger approved and are large advances surfaced
- Entity Register. the entity tree every rule resolves codes against
- Verdict and Findings. every finding, with the reason it exists, ends at a person
Engineering
- Seeded Period Files. generate_corpus writes one clean baseline plus 24 planted-defect files, at least one for every registered control, 25 files in total. Only the entity tree, the protocol thresholds, the opening balances and the period transactions are stated; every closing balance, every due-to mirror and the ledger totals are derived.
- Structural Precondition. Three controls. Fails a file missing any of the six artifact types or naming an entity the register does not carry, so no downstream rule holds vacuously.
- Entity Tree. Three controls: unique codes, defined parents, and an acyclic chain that reaches the top parent.
- Reciprocity. Three controls: every pair two-sided, matched pairs equal to the cent, and no entity holding a balance against itself.
- Roll-Forward. Five controls tying each due-from closing to opening plus advances less repayments, with equity excluded and the ledger totals footing from their lines.
- Funding Protocol. Four controls: equity from the Capital group, region-matched, Services and predevelopment funded from the top parent, and advances flowing down the chain.
- Liquidity Covenants. Three controls over the guarantor minimum, non-negative cash, and the protocol target bands.
- Governance. Two controls over ledger approval and a second-signature threshold on large advances.
- Entity Register. Each entity's code, group, parent and region. Reciprocity, funding direction and funding source are all evaluated against this one authority.
- Verdict and Findings. Findings roll up per period 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 | generate the seeded fictional corpus, run all twenty-three 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 | intercompany_report.md, intercompany_report.json, samples/ |
python -m intercompany_engine samples | analyze an existing folder of period 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 intercompany_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 | run the full test suite for this engine | 10310 passed | 0 when every test passes | none |
Benchmarks
measured demo results| Measure | Result |
|---|---|
| Engine tests10 | 10,310 tests collected live collection from the engine directory |
| Registered controls11 | 23 controls counted from the registry, not from documentation |
| Planted defects12 | 24 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.
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 positions into the documented consolidation review |
| One or more FLAG, no FAIL | REVIEW | a human resolves each flag; an advance running up the chain, a cash target out of band, and a large advance awaiting a second signature all land here |
| One or more FAIL | FAIL | the positions do not go to consolidation until the failing control is cleared |
- Read-only: period files are parsed and never written back, so the engine cannot introduce the break it reports.
- Integer cents throughout, compared with exact equality; there is no tolerance band between a due-from and the due-to it faces.
- A value 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.
- 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 due-to schedule fails completeness rather than letting reciprocity pass unread.
Operating limits
what it refuses to do- The engine never funds an entity, sweeps cash, or writes to a source artifact. It reports and stops.14
- It reads the six schedules the consolidation keeps. It does not connect to a bank, a general ledger or a treasury system.15
- It checks that a balance is reciprocal and rolls forward, not whether the underlying advance was commercially reasonable or on arm's-length terms. That judgment is a reviewer's.16
- It reads the funding protocol as data and tests conformance to it; whether the protocol itself is the right policy is a treasury question the engine does not answer.17
- All shipped data is fictional. The corpus demonstrates the controls; it is not a record of any real entity, group, advance or balance.18
See it run
brand animation
Integration
how to run itDistribution: public repository, MIT license.
- 1python -m pytest --collect-only -q -o addopts= (intercompany-automation/)
- 2len(intercompany_engine.engine.REGISTRY)
- 3distinct rule-id prefixes in intercompany_engine.engine.REGISTRY
- 4samples/*.json after python run.py
- 5len(intercompany_engine.model.DOC_TYPES)
- 6intercompany_engine/tests/test_control_semantics.py
- 7python run.py (intercompany-automation/); output re-run on demand
- 8intercompany_engine/tests/test_control_semantics.py::test_one_cent_of_drift_breaks_reciprocity
- 9intercompany_engine/tests/test_control_semantics.py::test_group_intercompany_eliminates_to_zero
- 10python -m pytest --collect-only -q -o addopts= (intercompany-automation/)
- 11len(intercompany_engine.engine.REGISTRY)
- 12len(intercompany_engine.generate.DEFECTS)
- 13intercompany_engine/tests/test_planted_defects.py::test_every_registered_rule_has_a_planted_defect
- 14intercompany-automation/README.md and intercompany_engine/tests/test_readonly_and_determinism.py
- 15intercompany_engine/model.py DOC_TYPES
- 16intercompany_engine/engine.py rec_amounts_reciprocal
- 17intercompany_engine/engine.py fund_services_from_holdings
- 18intercompany_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