ENGINE 10

SFS-E10-APX · PAYABLES CONTROLS · REV 2026-07-21 · PRODUCTION

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

Accounts Payable

The payables cycle proved rather than assumed

Accounts payable is where controls are asserted most often and proven least often. This engine reads the fixed-format posting artifacts the cycle already emits and runs thirty deterministic controls over them: did the post actually happen and balance, is this payment allowed to be released yet, is every job routed to a valid approver chain with duties segregated, and will year-end information reporting be complete. It never posts, never pays, and never writes to a source artifact. Every exception it raises ends at a person.

A control engine is only credible if it can be wrong in public. This one ships the defects it claims to catch: one planted defect per registered control, each of which must trip its own control and leave the other twenty-nine silent. The benchmark is a command, not a claim.

Run it Book a consultation

Architecture

functional block stack · static overview
Structural Precondition Posting Integrity Payment Release Gate Routing and Duties Information Reporting Commitment Hygiene substrate: seeded fictional data

Select a layer

Six control families run in registry order over each document set. The first proves the others had something to read.

Key specifications

at a glance
12,2231
Tests
the collected checks that pin this engine's behavior
302
Controls
independent payables controls, run in registry order
63
Families
groups the controls fall into, from structural to commitment hygiene
304
Planted defects
one deliberate fault per control, so none can silently stop working
55
Artifact types
the source documents a payables cycle emits
06
Write paths
the engine reports; it never posts, pays, or edits a source

What it does for you

plain terms

Three payables failures recur across the industry and all three are invisible to the people running the cycle. A posting run aborts on batch contention and is filed as though it succeeded -- the report still balances, because nothing moved. A payment is released through an open compliance gate: no taxpayer certificate on a first payment, waivers missing from a subcontractor's lower tiers, insurance expired before the payment date. And a routing matrix drifts until a job maps to no workflow, or one person holds both data entry and final review. Each is deterministic to detect from artifacts that already exist, and none of them needs a model's judgment.

The seeded demo runs every control over every document set7. The CLI generates thirty-one fictional document sets -- one clean baseline plus one planted defect per control -- and runs all thirty controls over each. The clean set reports PASS with every control held; each defective set reports the exact control it was built to trip. The run exits 2 because the corpus deliberately contains failures.

Absent evidence must not read as a passing control8. One fixture removes an entire artifact type from its document set. Every control that reads that artifact returns nothing, which without a structural precondition would render as a clean result. The set_complete control is registered first and fails the set, so the report opens with proof that the controls below it had something to read.

Every control must prove both of its sides9. Each of the thirty controls is exercised against its own planted defect, which it must catch, and against the clean baseline, where it must stay silent. A coverage test asserts the planted-defect set and the registry are the same set, so a control cannot be added without a fixture that exercises it, and an implementation that always passes or always fails cannot satisfy the suite.

Functional block diagram

engineering · each block links to its source
Functional block diagram of the Accounts Payable engine document sets posting reports selection registers routing matrix vendor register commitments findings findings findings findings findings findings roll-up decision Seeded Document Sets StructuralPrecondition Posting Integrity Payment Release Gate Routing and Duties Information Reporting Commitment Hygiene Findings Verdict Human Gate SFS-E10-APX · FUNCTIONAL BLOCK DIAGRAM · REV 2026-07-21

Plain terms

  • Seeded Document Sets. fictional posting document sets enter the control registry
  • Structural Precondition. proves the controls below had something to read
  • Posting Integrity. did the post happen, and did it balance
  • Payment Release Gate. is this payment allowed out yet
  • Routing and Duties. does every job reach a real approver, with duties split
  • Information Reporting. will year-end reporting be complete
  • Commitment Hygiene. do commitments mirror their contracts
  • Findings. each control yields a finding carrying its own rationale
  • Verdict. one verdict per document set, worst finding wins
  • Human Gate. a person decides; the engine has no write path

Engineering

  • Seeded Document Sets. generate_corpus writes one clean baseline plus one planted defect per registered control from a single seeded Random instance
  • Structural Precondition. check_set_complete -- FAILs when any of the five artifact types is absent
  • Posting Integrity. eight controls: proof, ledger recap, posting totals, rejects, posted count, error markers, job-cost tie, header date
  • Payment Release Gate. eight controls: taxpayer certificate, waivers, insurance currency and limits, funding, duplicates, retention, off-cycle approval
  • Routing and Duties. five controls: job mapping, approver presence, final-review group, duty segregation, declared direct-post
  • Information Reporting. five controls: threshold coverage, identifier presence and structure, split-vendor detection, filed-count reconciliation
  • Commitment Hygiene. three controls: schedule of values not a lump line, identifier convention, change-order attachment
  • Findings. frozen Finding(rule, status, location, message); location is doc_type:document_id/field path and the message states why the control exists
  • Verdict. any FAIL rolls up to FAIL; otherwise any FLAG rolls up to REVIEW; otherwise PASS. The process exit code carries the same verdict.
  • Human Gate. the engine emits markdown and JSON only. It holds no connection to a ledger, payment provider or approval system, so nothing it produces can post or pay.

Instruction set

every public command
CommandOperationOutputExitArtifacts
python run.py
generate the seeded fictional corpus, run all thirty controls, write both artifactsper-document-set verdicts and every actionable finding, then the overall verdict2 for the bundled corpus, which carries one planted defect per controlap_report.md, ap_report.json, samples/
python -m ap_engine ./samples
analyze an existing folder of document sets, read-onlyper-document-set verdicts and findings0 PASS, 1 REVIEW, 2 FAIL, 3 usage or IO errornone
python -m ap_engine ./samples --quiet
print only the overall verdict linea single overall verdict line0 PASS, 1 REVIEW, 2 FAIL, 3 usage or IO errornone
python -m pytest -q
run the curated suite exactly as CI does12,223 passed0none

Benchmarks

measured demo results
MeasureResult
Engine tests1012,223 tests collected
live collection from the engine directory
Curated invariant grid111,977 parametrized cases
bounded arithmetic and verdict identities, asserted exactly over integers
Planted-defect cases12152 cases
every control against its own defect and against a clean baseline
Opt-in property sweep1399,223 tests collected
the exhaustive grid, gated behind SWEEP=1 so it never slows CI

Control characteristics

engineering

Plain terms

The engine has no write path and therefore no autonomy to gate. A verdict is an input to a person's decision, never a substitute for it: posting, payment release and approval all remain outside the engine, and no finding it raises is actioned without review.

Engineering

Deterministic envelope. seeded fictional inputs, read-only operation, offline default mode.

Demo gate. FAIL on the bundled corpus, by design -- it carries one planted defect per control

SeverityVerdictAction
No findings above PASSPASSsend the mechanically clean result to the documented manual gates
One or more FLAG, no FAILREVIEWroute the flagged items to a person for judgment; do not treat as cleared
One or more FAILFAILhold the affected posting or payment and resolve at source before re-running

Operating limits

what it refuses to do

See it run

brand animation
Accounts Payable diagram: a posting report and a ledger recap joined by a green verified check reading debits equals credits and proof zero, above four payment release gates for taxpayer certificate, lien waivers, insurance and funding, each ticked green
The Accounts Payable engine tile depicts the posting tie-out above the four payment release gates, with the note that any unmet gate holds the payment for a person.

Integration

how to run it

Distribution: public repository, MIT license.

Substantiation
  • 1python -m pytest --collect-only -q -o addopts= (accounts-payable-automation/); 12,223 tests collected on 2026-07-21 and pinned in site-datasheets/counts.json
  • 2accounts-payable-automation/ap_engine/engine.py REGISTRY; mirrored in the rule-registry table of accounts-payable-automation/README.md
  • 3accounts-payable-automation/ap_engine/engine.py RULE_FAMILIES
  • 4accounts-payable-automation/ap_engine/generate.py DEFECTS; test_checks_coverage.py asserts the defect set equals the registry
  • 5accounts-payable-automation/ap_engine/model.py DOC_TYPES
  • 6accounts-payable-automation/ap_engine/tests/test_readonly_and_determinism.py -- source artifacts are hashed before and after a run and asserted byte-identical
  • 7python run.py (accounts-payable-automation/); output re-run on 2026-07-21; committed as accounts-payable-automation/ap_report.md
  • 8accounts-payable-automation/ap_engine/engine.py check_set_complete; fixture in generate.py _defect_set_incomplete; asserted in ap_engine/tests/test_generate_and_cli_coverage.py
  • 9accounts-payable-automation/ap_engine/tests/test_planted_defects.py (152 cases) and test_checks_coverage.py
  • 10python -m pytest --collect-only -q -o addopts= (accounts-payable-automation/); re-run 2026-07-21 and pinned in site-datasheets/counts.json
  • 11accounts-payable-automation/ap_engine/tests/test_curated_invariant_grid.py
  • 12accounts-payable-automation/ap_engine/tests/test_planted_defects.py
  • 13SWEEP=1 python -m pytest --collect-only -q -o addopts= (accounts-payable-automation/); re-run 2026-07-21
  • 14accounts-payable-automation/README.md and ap_engine/tests/test_readonly_and_determinism.py
  • 15accounts-payable-automation/README.md -- verdict roll-up; site-datasheets/specs/ap.json control_characteristics.plain
  • 16specs/2026-07-21-ap-engine-design.md -- Out of scope
  • 17specs/2026-07-21-ap-engine-design.md -- Architecture; accounts-payable-automation/README.md -- What this demonstrates
  • 18accounts-payable-automation/README.md confidentiality note; finance-atlas/atlas_tests/test_deny_list.py repo-sweep surface

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