Government-Contracting Cost-Accounting
Compliance Engine
A local-first engine that turns FAR Part 31, SF 1408, the 2026 NDAA cost thresholds, ICS/ICE schedules, Eichleay, and standard-cost variance analysis into a tested calculation system — with an append-only, hash-chained audit trail underneath every number.
§01 · What it does
Every module maps to a real regulatory reference and is exercised by a build phase and, where relevant, a CLI command.
The five-part allowability test, stamped onto every transaction at capture as a structured vector — reasonableness, allocability, CAS/GAAP, the unallowable Chart-of-Accounts map, and contract-clause overrides.
The six pre-award accounting-system criteria run as assertions against the live database — segregation, job-cost accumulation, pool allocation, unallowable exclusion, the close gate, and billing tie-out.
CAS coverage tier and TINA applicability decided against the threshold in force on the award date — the 2026 NDAA resets ($2.5M→$10M TINA, $7.5M→$35M CAS) as versioned rules, evaluated per contract action.
Three-tier rate calculation with provisional-to-final true-up and fully-burdened cost. Every run stamps its inputs so any figure reproduces from its own record eighteen months later.
Ten ICS/ICE schedules generated as structured data, gated on a period-close mechanism whose three-way GL/JCL/billing reconciliation must pass before a period locks.
The deterministic post-award sweep: each locked baseline assumption compared against subsequent ledger activity, one reproducible finding row per comparison — the log is the audit trail.
REA-vs-CDA comparator with the DFARS absolute-value certification test, plus the three-step Eichleay unabsorbed-overhead calculator — refusing to run on unreconciled inputs or undocumented entitlement.
Provisional-billing-rate fluctuation monitoring during the year, and an audit-response simulator that escalates T-30/14/7/3/1 and blocks submission without a recorded management-review sign-off.
Six textbook variance calculators — material price/usage, labor rate/efficiency, two-way overhead spending/volume — with one sign convention, computed independently of the allowability layer.
The four proposal-evaluation determinations — price-vs-cost analysis, the subcontractor certified-data threshold keyed to TINA, weighted-guidelines profit (the DD-1547 / DFARS 215.404-71 factor ranges plus facilities capital), and cost realism rolling proposed costs up to a probable cost — each grounded to its subsection with its own reasons and caveats. The related facilities capital cost of money (DD Form 1861, FAR 31.205-10 / CAS 414) is computed as an allowable cost, distinct from the weighted-guidelines facilities-capital profit factor.
Every write captured in a SHA-256 chained log — tamper-evident by construction, contiguity-checked, and verifiable on demand. The foundation the other ten modules are built on. Try tampering with it below ↓
§02 · How it's built — the data flow
A transaction is validated and classified the moment it's written. Click a stage to inspect it — by the time anything reaches a report, the rules have already held.
§03 · How to run it
Everything runs locally on SQLite with zero configuration. The demo builds a synthetic contractor from scratch and takes it through the whole pipeline.
$ uv sync # Python 3.11+, managed by uv$ uv run pytest # 433 tests — one per business rule$ uv run python scripts/demo.py # end-to-end synthetic world → demo_out/$ govcon serve --demo # the guided web workbench (+ /api/ask if a key is set)$ govcon rules show CAS_COVERAGE # read the rules-as-data decision table$ govcon watch scan # Federal-Register suggestions for human review
$ uv run govcon sf1408 # SF 1408 six-criteria self-check$ uv run govcon audit verify # recompute the audit-trail hash chain$ uv run govcon contract 1 # one contract, inception to present$ uv run govcon export 2026 G # render a schedule (--format md|xlsx)$ uv run govcon reverify # regulatory re-verification watch list$ uv run govcon about # the tool's own limitations, stated plainly
Database defaults to sqlite:///govcon.db — override anything with the GOVCON_DB_URL environment variable.
§04 · Why it's trustworthy
Every dollar figure carries its effective date, source citation, and legal status. Drag the award date — the engine picks the threshold in force, never a hard-coded scalar.
Decimal end to end via a custom SQLAlchemy type that stays lossless on SQLite — floats are rejected at the bind boundary, not tolerated.
Rate runs, Eichleay claims, and TINA sweeps store their inputs, so any historical figure recomputes from its own record — proven by tests that mutate the world afterward.
A four-agent adversarial pass found and fixed two critical and three high-severity bugs in the author's own tool — each pinned by a regression test.
§05 · Beyond v1 — enterprise & AI
The core stays deterministic and grounded; these layers make it usable by anyone, adaptable when regulation moves, and honest about what an AI can and cannot do.
govcon serve puts a browser UI over the same pure services — enter a contract, get the CAS/TINA determination with reasons, caveats, and the citation, explained in plain language. Self-contained, WCAG 2.2 AA.
The CAS coverage order and TINA exception ladder live as versioned, dated, append-only decision tables, not hard-coded logic — 239-case parity against a frozen oracle proves identical behaviour. Regulation changes shape via a reviewed migration, never a silent edit.
A plain-English glossary, six worked scenarios that run live against the engine, and five persona depths (Newcomer → Auditor) surface exactly as much of the reasoning as each reader needs.
A Federal-Register watcher records rule changes as suggestions for a human to verify — never auto-applied. Its first live scan caught the CAS-to-GAAP final rule (effective 2026-08-07).
Per-workspace database isolation, a verified dual-backend port to PostgreSQL (26 plpgsql triggers, advisory-locked audit chain), and optional per-user JWT auth — every audit row attributed to a cryptographically verified actor, not a spoofable header. Authentication and real data stay separate switches: still advisory, synthetic-data only.
Four surfaces over one kernel — ask, tutor (taught at your persona depth), draft-rule, and draft-narrative — each calls the deterministic engine as a tool and never decides. A grounding verifier withholds any number or citation the engine didn't return; the authoritative determination is always shown beside the prose, and streams over SSE as it resolves. Rule-drafting can apply nothing — it only proposes a human-reviewed migration.
§06 · Say it in plain English
Government cost accounting has its own language. Each entry below gives the plain-English meaning, why it matters, and a concrete example — the dotted-underlined terms elsewhere on this page jump straight here.
Companies on government contracts can't bill everything they spend. FAR Part 31 sorts every cost into allowable (the government reimburses it) and unallowable (the company eats it — things like entertainment, lobbying, or alcohol).
Why it mattersBilling unallowable costs, even by accident, means paying the money back later — sometimes with penalties — when an auditor finds it.
ExampleBefore a cost is billable it must pass five checks: Is the amount sensible? Does it belong to this contract, or to shared overhead? Is it booked under the right accounting rules? Is it on the government's never-billable list? And does this contract's fine print say otherwise?
Why it mattersDeciding this months later, from memory, is how mistakes happen. Answering all five at the moment the cost is recorded makes the answer part of the permanent record.
ExampleBefore awarding certain contracts, the government checks whether a company's accounting system is designed correctly — six checks such as "do you keep each contract's costs separate from overhead?" and "do the books tie out to what you billed?" It tests the design, not whether you've ever made a mistake.
Why it mattersFail it and you can't win cost-reimbursable government work at all. It's the entry ticket.
ExampleAbove certain contract sizes, the government requires standardized accounting methods so companies can't shuffle costs to their advantage. "Modified" coverage means four core rules apply; "full" coverage means all of them — plus a formal filed description of how you do your accounting (the DS-1, below).
Why it mattersAs of July 2026 the triggers are $35 million (modified) and $100 million (full) per contract — set by a 2026 law, though the detailed regulation implementing it is still a draft. Honest reporting says so.
ExampleFor large negotiated contracts, the company must hand over the cost data behind its price and certify it is accurate, complete, and current. If that data turns out wrong, the government can take money back (see defective pricing, below).
Why it mattersThe bar keeps moving: $2 million historically, $2.5 million from late 2025, and $10 million from July 2026. Which bar applies depends on the date — using the wrong one is a common, expensive error.
ExampleGovernment dollar limits change over time, and the rules behind them aren't equally settled: some are laws, some are finished regulations, some are still drafts, some are temporary Defense-Department workarounds ("class deviations"), and some are last year's number carried forward because this year's update was formally skipped.
Why it mattersPresenting a draft rule as settled law is exactly the kind of error auditors flag. Trustworthy software tells you how solid each number is, not just the number.
ExampleOnce a company crosses into full CAS coverage (a $100M+ contract), it must file a DS-1: a document describing precisely how it estimates costs, spreads overhead, depreciates equipment, and so on. From then on the company is held to its own description.
Why it mattersChange your accounting method after filing and you may owe the government whatever the change cost it. The DS-1 turns "our practices" from folklore into a binding document.
ExampleA company may pay its executives whatever it likes — but only a capped amount per person, per year, can be charged to government contracts. The cap is set annually: $646,000 for 2024, $671,000 for 2025.
Why it mattersEvery dollar of pay above the cap must be carved out of billings. Miss it and it's a guaranteed audit finding.
ExampleA direct cost belongs to one specific contract — an engineer's hours on Project X, parts bought for it. An indirect cost keeps the whole company running — rent, HR, the finance team — and must be shared across all contracts by a formula.
Why it mattersMixing these up is the fastest way to overbill one customer and underbill another. Keeping them separate is the very first thing the SF 1408 checks.
ExampleShared costs are distributed through three stacked rates: Fringe (benefits — health insurance, payroll taxes — as a percentage of wages), Overhead (the cost of doing the work — facilities, supervision), and G&A (the cost of running the company — executives, accounting, HR).
Why it mattersThese rates decide what a $100 hour of labor really costs the government — often $150+ once the stack is applied. An error compounds across every invoice.
ExampleNobody knows the true overhead rate until the year ends, so companies bill using estimates ("provisional" rates), then compute the real ("final") rates from actual costs — and settle the difference. That settling is the true-up.
Why it mattersBill at 24% all year when the real rate turns out to be 22%, and you owe the government the difference on every invoice you sent.
ExampleSet a standard ("this part should take 2 lbs of material at $10/lb and 3 hours at $20/hr"), then measure the six classic gaps between plan and reality: material price and usage, labor rate and efficiency, overhead spending and volume.
Why it mattersVariances tell you why a job cost more — paid too much, used too much, or worked too slowly — instead of just "it cost more."
ExampleSix months after year-end, contractors file a package proving what they actually spent, what rates that implies, and that everything ties together. "ICE" is the government auditors' standard spreadsheet format — schedules labeled A through O (this engine generates ten of them).
Why it mattersIt's how a year of estimated billing gets squared with reality — and it's the single document auditors mine hardest for findings.
ExampleBefore a month can close, three views of the same money must match: the general ledger (all spending), the job-cost ledger (spending by contract), and what was actually billed. If they agree, the month locks and can never be silently edited. If not, it stays open until fixed.
Why it mattersReports built on unreconciled books inherit whatever error sits upstream. Locking closed months prevents the "quiet fix" auditors distrust most.
ExampleIf certified cost data turns out to have been wrong, that's defective pricing. A "sweep" is the self-audit: take every assumption in the proposal and comb the books for anything that happened before the price was agreed that contradicts it.
Why it mattersGovernment auditors run this exact exercise after award. Running it on yourself first — and keeping the log — is the defense.
ExampleAn REA (request for equitable adjustment) is the cooperative route — "this change cost us more; let's adjust the price." A CDA claim is the legal route — a formal dispute with statutory deadlines and interest. Both need an executive's certification above certain dollar lines ($350K for REAs, $100K for claims).
Why it mattersThe certification math trips people: you add the sizes of the increases and the decreases — |+$300K| + |-$80K| = $380K — never the net ($220K). Netting understates the total and skips a legally required certification.
ExampleWhen the government freezes work but keeps you on standby, headquarters costs keep burning with no work to absorb them. Eichleay is the only formula federal courts accept for that damage: your contract's share of overhead → per day → times the delay days.
Why it mattersCourts also demand strict preconditions — a government-caused delay, being kept on standby, and being unable to take replacement work. A number without those proven is worthless.
ExampleDCAA are the government's auditors: they examine your books, question costs, and write reports — but can't make binding decisions. DCMA administers contracts: its contracting officers read those reports and issue the decisions that actually bind both sides.
Why it mattersKnowing which one you're facing changes the play: you persuade DCAA with records; you settle with DCMA.
ExampleBecause you bill on estimated rates all year (see provisional vs final, above), someone should check every month whether reality is drifting from the estimate — and write the explanation down while it's fresh.
Why it mattersThe auditor's question is always "you were 9% under plan in November — why?" The winning answer is a note written in November.
ExampleEvery write to the ledger is recorded with a cryptographic fingerprint (a SHA-256 hash) that also bakes in the previous record's fingerprint — forming a chain. Alter or delete any historical record and every fingerprint after it stops matching. There is no way to quietly rewrite history.
Why it matters"Trust me" doesn't survive an audit. "Run the verify command and check the chain yourself" does.
Example