-
-
3 decisions waiting, each with JADE's recommendation
-
Programs read into terms, each citing its clause, TP-0214 tagged "amended AM-03"
-
A Walmart deduction notice arrives by email; JADE reads every field from its line and opens the deduction
-
Restatement comparison: September re-priced from $4.20 to $4.50, a $190,415.99 catch-up
-
Kroger's May accrual, unclaimed for five months: JADE recommends releasing it
-
JADE recommends a hold: "an email is not an amendment"
-
The controller approves the restatement; it becomes precedent PR-0018
-
Segregation of duties: the sales lead who negotiated TP-0214 can't approve its catch-up
-
The controller's typed reason becomes the next precedent
-
Sign-off blocked
-
Flux & close review
-
Close report
-
Architecture
-
Eval Set : Refer to Google Drive for more Details on how Evals were done
JADE (the Deterministic JADE Engine) fills two seats on a consumer-goods finance team: the trade promotion accountant and the deduction analyst. It works the way those seats work under U.S. GAAP. It records the obligation when the revenue is earned, settles it against the evidence when the customer collects, reconciles the subledger to the general ledger, and hands a reviewer a close package to sign.
Inspiration
Trade promotion is one of the largest numbers in consumer goods, and it is mostly an estimate. Roughly 20% of CPG gross sales goes to trade (Strategy&/PwC). General Mills sold $18.4B in fiscal 2026, 22% of it to Walmart. At year end it carried $493M of accrued trade and coupon promotion liabilities, which its 10-K lists as a critical accounting estimate.
The accounting is simple to state and hard to run:
- Under ASC 606, a promised discount to a customer is variables consideration. It reduces the transaction price, so it is recorded as contra-revenue when the goods ship, not as an expense when the bill arrives. That is the accrual basis: recognize the obligation in the period the revenue is earned.
- Settlement comes months later, as a deduction. The retailer short-pays an invoice instead of sending a bill, often at a different rate, citing a program from two quarters ago, with backup that doesn't tie. Each one must clear accounts receivable and the accrued liability together, or the two ledgers drift apart. A manual deduction costs about $97 to process (CRF benchmark).
- When the estimate trues up, reported results move. Trade expense timing swung General Mills' Q4 adjusted operating profit growth by −13 points in FY2025 and +7 in FY2026.
The costly failure is not a bad claim. It's a valid document that never reaches the books. A signed amendment raises a program's rate in February and is filed but never entered, so six months close under-accrued. Someone then has to measure the shortfall in each closed month, book the true-up without erasing what was reported, and make sure the person who negotiated the deal is not the one approving it.
We don't let the model reason about accounting. It's to compute every number in code, prove it with reconciliations, and ask a person only when the agreement itself can't decide.
What it does
JADE runs the monthly trade promotion close for Walmart, Costco and Kroger in our example, step by step as a controller would.
- Contract set-up. Every trade agreement is read into terms: rate, base, eligibility window and claim window. Each term cites the clause it came from. An agreement missing a required term is refused, not guessed. Controls are mined from last year's books: the thresholds people actually acted at, and the roles that acted.
- Revenue and accrual at shipment (ASC 606). Each shipment books revenue and the expected promotion as variable consideration: Dr Trade promotion (contra-revenue) / Cr Accrued trade promotions. Net revenue is right in the period it is earned, never deferred to the period the claim arrives.
- Deduction intake. A deduction notice lands in the deductions inbox (Gmail). JADE parses it by code; every field keeps the line it was read from. It is recorded as a short payment held apart from collectible receivables (Dr Deductions pending resolution / Cr Accounts receivable) until it is resolved. Nobody keys it.
- Matching and settlement. Each deduction is matched to customer, program, period, rate and backup. A supported claim relieves the accrual and the receivable together (Dr Accrued trade promotions / Cr Deductions pending), so revenue is never reduced twice for the same promotion. Unsupported, duplicate or excess amounts are disputed or held, and stay open.
- Exceptions go to their owner. What the agreement can't settle becomes a card for the person who owns that decision, with JADE's recommendation and the evidence. The answer is kept as a precedent, so the same situation settles without asking next time. An override must carry a reason, and the reason becomes the precedent.
- Segregation of duties. It is enforced as a capability check, not a reminder. The Walmart sales lead who negotiated the deal tries to approve its catch-up and is refused in code. The attempt is recorded as its own finding.
- Closed-period true-ups. When the late amendment is entered, JADE measures the under-accrual in every closed month it reaches: $1,391,636.52 across February–July in the year we played. It proposes a catch-up for the controller to approve. The original entries stay as booked and the adjustment posts beside them, so "what we knew then" and "what we know now" are both on the record. Whether a true-up is treated as a change in estimate or a correction is a classification judgment, so it goes to the controller.
- Reconciliation and review. Every program rolls forward: ending accrual = opening + new accruals + estimate adjustments − settled claims, with a check that must equal zero. Orphan accruals, unmatched deductions and estimate variances are flagged. Flux analysis explains each material movement with the journal lines behind it. An analytical review compares the liability with General Mills' own reported ratio to net sales.
- Sign-off. Five verifiability gates re-run at signature: journals balance, reversals mirror their originals, no stale accruals, claims inside their windows, nothing cleared beyond what was accrued. A failing gate blocks the close; it doesn't warn. The close leaves as a package a reviewer can audit: the report, and an Excel workbook with the ledger, trial balance, reconciliation, gates and flux on their own sheets, each with check rows that must read zero.
- An audit trail you can question. Ask why any number exists and JADE answers with the rule, the clause, the shipments, what was known at the time, and any later correction.
How we built it
- Ledger. PostgreSQL 16 holds a double-entry, insert-only, bitemporal ledger. Every journal must balance, and every row records both when it was true and when we learned it. There is one write path. Corrections are reversals or adjusting entries, never edits or deletes, so the audit trail is complete by construction.
- Engine. Python and FastAPI. Accruals, clearings, catch-ups, roll-forwards and ratios are computed deterministically, in decimal arithmetic, and reproduce to the cent.
- Model. Claude reads agreements, drafts the questions on escalation cards and phrases explanations. It never computes a number and never approves. A rewrite that changes a figure is discarded. With the model off, every path falls back to deterministic templates.
- Frontend. React 19, TypeScript and Vite. The screens are Home (what needs you), Decisions, Close and Ask, with setup, controls, integrations and evals one click away.
- Integrations. Gmail is the deductions inbox. Notices, backup and signed amendments become source rows. Anything else is quoted on the card it concerns, never followed as an instruction. SEC EDGAR supplies the 10-K figures every close is checked against.
- Rules as code. ASC 606 (consideration payable to a customer, variable consideration) and ASC 326 (credit losses, kept separate from promotional liabilities), twelve deduction-control rules, and one rule above all: one deduction, one documented resolution, with AR and the accrual reconciled. Thresholds come from company policy or last year's decisions and are never presented as GAAP requirements.
Deterministic evals
An accountant isn't graded on how plausible their journal entries sound. The entries either tie or they don't. We hold JADE to the same standard: every eval has a fixed input, an exact expected answer, and a pass condition checked by code. There is no model-as-judge and no rubric. Because the engine is deterministic, every result reproduces to the cent from a seed and a command.
- Planted errors against an answer key. 24 months of seeded books hide 42 errors plus 8 clean look-alikes that must pass silently. A finding counts only if its evidence names the planted row's own deduction, shipment or accrual. Result: 100% precision and 100% recall at month 12.
- Holdout seeds. The same error types placed differently, on two seeds we never developed on: the same 42 of 42, with no false positives.
- Reproducibility (pass^k). Agents that pass once often fail on a retry. We run the full year three times from the same seed and get byte-identical books: 979 ledger lines, 75 findings, the same ledger and decision hashes every time.
- Learning, measured. 37 of 40 repeat situations settled by precedent without asking anyone. The 3 asked again were each larger than any amount a person had approved, which is the precedent rule working as designed.
- Refusal on real data. 4,996 real emails (Enron business mail and spam) and 102 real commercial contracts (CUAD), run through the same readers: 0 actions taken, 0 terms guessed. Rewording 28 deduction notices found two real parser gaps, and both are fixed.
- Walk-forward backtest on General Mills' 10-Ks. Each year-end liability is estimated using only filings public before that year's 10-K, then scored against what the 10-K reported. The audited balance swings by up to 22.1% a year, so a ±50% analytical-review threshold can never fire; about ±22% is calibrated on real history. Carrying last year's balance forward misses by 9.4%, and scaling by sales misses by 12.3%. That is why JADE accrues program by program instead of as a share of sales. Replayed on audited books, the analytical review raises zero false alarms.
- Accounting invariants as tests. 149 backend tests and 17 frontend tests check that journals balance, every program rolls forward to a zero difference, each deduction has exactly one resolution, and trade promotion lands in contra-revenue, never operating expense. What it got wrong is documented with each fix. On an unseen seed, for example, it flagged a valid Kroger display claim by splitting one event across two months.
Challenges we ran into
- Keeping the model out of the math. An LLM can sound right about a deduction and still be off by a cent. We drew a hard line: the model writes sentences, and code moves money. Any model output that touches a number is checked against the computed value and discarded on mismatch.
- Two clocks. Truing up closed months without rewriting them forced a bitemporal ledger. When something was true and when we knew it are different questions, and both the close and the audit need both answers.
- Matching both sides of every settlement. A deduction touches AR and the accrual at once. Clearing one without the other leaves a reconciling item nobody can explain, so every settlement posts both legs or neither.
- Escalating the right amount. Too eager and it's a notification machine; too confident and it approves unsupported claims. Mining thresholds from last year's real decisions, instead of inventing them, made each escalation defensible.
- An email is not an amendment. A sales lead writing "$4.50, paperwork to follow" is evidence, not terms. JADE quotes it on the card, recommends a hold, and trues up only when the signed amendment arrives.
What we learned
- The hard part of autonomous accounting isn't the arithmetic. It's knowing when not to act, and leaving an audit trail for that decision.
- Accounting fundamentals are the best guardrails an agent can have. If the entry doesn't balance, the roll-forward doesn't tie or the gate fails, the system stops.
- Evals are easier to trust when they work like an audit: a fixed input, an exact expected answer, and a result that reproduces.
- A control mined from people's past decisions earns more trust than one configured from a blank page.
What's next for JADE
- A QuickBooks journal import alongside the Excel close package.
- More promotion types, and the ASC 326 expected-credit-loss evaluation for deductions that are really unpaid receivables, kept separate from the promotional liability.
Built With
- anthropic-claude
- bun
- docker
- fastapi
- figma
- postgresql
- psycopg
- pytest
- python
- react
- sec-edgar
- typescript
- uv
- uvicorn
- vite
- xbrl
Log in or sign up for Devpost to join the conversation.