ENGINE 48

SFS-E48-TBR · WORKPAPER ROLLFORWARD · REV 2026-07-27 · PRODUCTION

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

Trial-Balance Roll-Forward

Every column rebuilt from the extract's declared balance column, and every figure linked to its backup.

Once a fiscal year the group rebuilds a workpaper it does not maintain in between: one column per entity, carried forward from last year's structure and repopulated from the year-end trial-balance extract. Entities dissolve and lose their columns, entities are renamed and must be carried exactly once, entities are formed and arrive with a registration date that starts their first period. This engine reads the seven artifacts that cycle emits -- the entity register, last year's structure, the year-end extract, the chart-equivalence map, the populated workpaper, the embedded backup tab and the second rendered format -- and runs twenty-four deterministic controls over them. Is the file complete and the fiscal window readable, are the entity ids unique and every column entity's book present, were only code-position rows harvested, does every book in the extract foot to zero, was any column populated from the monthly-activity column instead of the balance column, did final-year entities lose their columns, was each rename carried once, are first-year entities registered inside the window, does the column set equal the register both directions, does every nonzero book balance land in a row, does every nonzero cell trace back to the extract, does every cell equal its re-derivation to the penny, does each dual-chart row sum every code it collects through the equivalence map, is a duplicated row code zero on its later instance, does every column foot to zero, does the eliminations range cover every column, does the combined column foot, is the backup tab complete and titled from the source's title column, does every figure link to a backup row that agrees with it, do both rendered formats match, and does the fixed annual fee follow entity status. Every comparison is exact == in integer cents, every date is tested against the fiscal window the file carries rather than the system clock, and no source artifact is ever written.

The failure modes of an annual roll-forward all share one property: the workpaper still balances. That is what makes them survive review. A column populated from the extract's monthly-activity column rather than its balance column foots to zero exactly the way a real column does, because activity nets to zero too -- so the footing check, the reviewer's whole defence, passes while the column carries movement instead of balances. A retained-earnings balance riding a legacy chart code disappears the moment the equivalence is dropped, and both sides still foot. An eliminations range written over last year's structure keeps evaluating happily after two columns are inserted beyond its end. A backup tab built from the source's category column instead of its title column reads plausibly forever -- Cash, Equity -- and reconciles to nothing anybody can look up. None of these announce themselves; all of them are found only by re-derivation. So the engine locates every column it reads by its declared role rather than its position, re-derives the whole grid from the extract through one kernel the generator also imports, sweeps completeness in both directions, and ships a planted-defect file for every registered control -- including one that proves the footing check genuinely cannot catch the activity-column substitution, because if it could, the control would be redundant.

Run it Book a consultation

Architecture

functional block stack · static overview
Structural Precondition Entity Register Source Extract Roll-Forward Scope Mapping and Re-derivation Column Footing Eliminations Coverage Combined Column Backup Tab Live Links Rendered Twins Fixed Annual Fee Dormant Column Review substrate: seeded fictional data

Select a layer

Twelve control families run in registry order over each workpaper file. The first proves the others had something to read and that the fiscal window is legible, because a control that passes on absent evidence reports assurance it never performed.

Key specifications

at a glance
10,4051
Tests
the collected checks that pin this engine's behavior
242
Controls
independent rules run over every workpaper file
123
Families
groups of controls, each answering one question
274
Workpaper files
one clean baseline plus twenty-six planted-defect files
75
Artifacts read
entity register, prior structure, source extract, chart map, workpaper, backup tab, twin export
06
Tolerance
a cell a penny off its re-derivation is a break, not a rounding band

What it does for you

plain terms

Once a fiscal year the group rebuilds a workpaper it does not maintain in between: one column per entity, carried forward from last year's structure and repopulated from the year-end trial-balance extract. Entities dissolve and lose their columns, entities are renamed and must be carried exactly once, entities are formed and arrive with a registration date that starts their first period. Five failures hide inside that, and they share the property that makes them dangerous: the workpaper still balances. First, a column is populated from the wrong source column -- some books carry a monthly-activity figure beside the balance, and a harvest that reads by position takes movement instead of balances; activity foots to zero exactly the way balances do, so the column self-balances and the reviewer's whole defence passes. Second, a balance rides an equivalent chart code and disappears: two charts share one workpaper row, and dropping the equivalence strands a retained-earnings balance on a code the sheet displays but the sum ignores, while every column still foots. Third, the eliminations range excludes this year's columns, because a range written over last year's structure keeps evaluating without error after columns are inserted beyond its end. Fourth, the backup tab quotes the source's category column instead of its title column, so the evidence a reviewer lands on reads plausibly and reconciles to nothing. Fifth, the two rendered formats drift, and a repair applied to one leaves the other in circulation. Which return each entity owes is a separate engine's question. This is the workpaper underneath that filing, and none of it is a judgment call: it is a column located by its declared role, a sum against its constituent codes, a set compared in both directions, a range against a column list, and a figure against the row it links to -- which a deterministic control settles better than a sheet rebuilt each July.

The seeded demo runs every control over every workpaper file7. The CLI generates twenty-seven fictional workpaper files -- one clean baseline and one carrying each of the twenty-six planted defects -- then runs all twenty-four 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 column populated from the activity column still foots, and is caught anyway8. One planted defect repopulates the parent column from the book's monthly-activity column instead of its balance column, then rebuilds the combined column and the twin from those same wrong figures, exactly as a real workpaper would. The column still sums to zero, so the footing control stays silent -- a test asserts that silence, because if the footing check could catch this the basis control would be redundant. src_balance_basis catches it by re-deriving what the column would carry if populated from activity and finding that every differing row matches.

A dropped chart equivalence strands a balance while everything still balances9. The workpaper carries retained earnings on a legacy code that the chart map equates to the book's current code. One planted defect empties the equivalence list. The balance is then collected by no row at all -- and both the book and the column still foot, because the balance simply never arrives. Only the forward completeness sweep, which enumerates every nonzero book balance and asks which row collected it, reports the loss.

Functional block diagram

engineering · each block links to its source
Functional block diagram of the Trial-Balance Roll-Forward engine workpaper files workpaper files workpaper files workpaper files workpaper files workpaper files workpaper files workpaper files workpaper files resolves resolves resolves resolves resolves balances statuses cells accounts columns findings findings findings findings findings Seeded Workpaper Files StructuralPrecondition Entity Register Source Extract Roll-Forward Scope Mapping andRe-derivation Column Footing Eliminationsand Combined Backup and Links Twins and Fees Registers,Extract & Map Verdict and Findings SFS-E48-TBR · FUNCTIONAL BLOCK DIAGRAM · REV 2026-07-27

Plain terms

  • Seeded Workpaper Files. fictional annual roll-forward files enter the control registry
  • Structural Precondition. is the file complete and the fiscal window legible
  • Entity Register. is the confirmed population sound
  • Source Extract. was the right column of the right rows harvested
  • Roll-Forward Scope. does this year's column set match the confirmed population
  • Mapping and Re-derivation. does every cell tie the extract, both directions
  • Column Footing. does every column sum to zero
  • Eliminations and Combined. is every column eliminated and does the total foot
  • Backup and Links. can a reviewer land on the evidence for any figure
  • Twins and Fees. do both rendered formats agree, and does the fee follow status
  • Registers, Extract & Map. the artifacts and roles every rule resolves against
  • Verdict and Findings. every finding, with the reason it exists, ends at a person

Engineering

  • Seeded Workpaper Files. generate_corpus writes one clean baseline plus one planted-defect file for every registered control, twenty-seven files in total. Only the entity register, the prior structure, the extract books and the chart map are stated; the whole populated grid, every link, the backup tab, the combined column and the twin export are re-derived through the same kernel the engine later recomputes with, so the relationships the engine tests are the relationships that produced the data. The corpus deliberately puts real rows on the edges that matter: the parent book carries a monthly-activity column whose figures also net to zero, one workpaper row is shared by two charts of accounts, one row code appears twice, and one book is entirely empty.
  • Structural Precondition. One control. FAILs a file missing any of the seven artifact types or carrying a duplicate of one, and FAILs an absent, unreadable or backwards fiscal window, so no downstream rule holds vacuously on absent evidence.
  • Entity Register. Two controls: entity ids are unique, statuses are known, every column entity names a book the extract carries, and a first-year entity registered late into the window is flagged so the preparer gets its real first-period start.
  • Source Extract. Three controls: only code-position rows reach the backup, every book foots to zero, and no column was populated from a book's monthly-activity column instead of its balance column -- the substitution that self-balances and therefore survives every footing check.
  • Roll-Forward Scope. Four controls: final-year entities lost their columns, each rename is carried exactly once, first-year entities are registered inside the fiscal window, and the column set equals the register's column population as exact set equality in both directions.
  • Mapping and Re-derivation. Five controls: every nonzero book balance lands in a row, every nonzero cell traces back to a book, every cell equals its re-derivation to the penny, every dual-chart row sums all the codes it collects through the equivalence map, and a duplicated row code is zero on its later instance.
  • Column Footing. One control, necessary but deliberately not sufficient: the failures this engine exists for all foot to zero, which is why the basis and mapping controls run beside it rather than behind it.
  • Eliminations and Combined. Two controls: the declared eliminations coverage includes every entity column -- a range that ends at last year's final column silently excludes this year's additions -- and the combined column is re-struck row by row from the cells and eliminations beneath it.
  • Backup and Links. Three controls: the backup tab carries every mapped account once at the extract's own balance, every title comes from the source's title column rather than its category column, and every nonzero figure links to a backup row that exists and agrees with it.
  • Twins and Fees. Two controls: the two rendered exports of the workpaper carry identical values cell by cell, and the fixed annual fee is owed in full by continuing and first-year entities and is exactly zero for final-year and excluded ones.
  • Registers, Extract & Map. The entity register carries each entity's id, name, status, book code, registration date where the entity is new and the fee it is shown as owing; the prior structure carries last year's column list and this year's renames; the source extract carries each book's declared column roles and its rows in code or memo position, each with an account, a title, a category and a balance -- and, for books that have one, a monthly-activity figure; the chart map carries the equivalences between the workpaper's canonical row codes and a book's own; the workpaper carries its columns, its rows, every cell with its link, the eliminations coverage and the combined column; the backup tab carries one flat row per mapped account; and the file itself carries the fiscal window, the fixed fee and the short-period review band. Every control resolves against these through the shared kernel in rollforward_engine.workpaper, which locates each column by its declared role rather than its position.
  • Verdict and Findings. Findings roll up per workpaper 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 -- a change in the diff is a change in the controls, not a change in when the report was run.

Instruction set

every public command
CommandOperationOutputExitArtifacts
python run.py
regenerate the seeded fictional corpus, run all twenty-four 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 designrollforward_report.json, rollforward_report.md, samples/
python -m rollforward_engine samples
analyze an existing folder of workpaper files without regenerating itper-file verdicts and findings0 PASS / 1 REVIEW / 2 FAIL / 3 usagenone unless --json or --md is passed
python -m rollforward_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 rollforward_engine/tests -q
run the full test suite for this engine10405 passed0 when every test passesnone

Benchmarks

measured demo results
MeasureResult
Engine tests1010,405 tests collected
live collection from the engine directory
Registered controls1124 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 the workpaper goes to the preparer.

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 workpaper into the documented preparer review and sign-off before it is sent out
One or more FLAG, no FAILREVIEWa human resolves each flag; a genuinely empty column and a first-year entity whose registration implies a short first period both land here
One or more FAILFAILthe workpaper does not go to the preparer until the failing control is cleared -- a column off its extract, a balance collected by no row, a column outside the eliminations range, a backup that does not tie, a dead or disagreeing link, or two rendered formats that differ

Operating limits

what it refuses to do

See it run

brand animation
Trial-Balance Roll-Forward engine tile: an isometric line drawing of a wide workpaper grid. Last year's column structure enters at the left; three station marks along the top edge show a column retired, a column renamed and a column added. Beneath the grid a flat backup tab runs its full width, with fine cobalt tie-lines rising from it to individual cells. Two source columns feed the grid from the right, one drawn solid and one drawn dashed and unused, and a single cobalt path traces the route a balance takes from the extract to its cell.
The Trial-Balance Roll-Forward tile states the question the annual rebuild turns on: which column the figures came from, whether every balance found a row, and whether the reviewer can land on the evidence for any cell.

Integration

how to run it

Distribution: public repository, MIT license.

python run.py
python -m pytest rollforward_engine/tests -q
Source on GitHub Engine README All tests, by engine Run in Codespaces
Substantiation
  • 1python -m pytest --collect-only -q -o addopts= (tb-rollforward-automation/)
  • 2len(rollforward_engine.engine.REGISTRY)
  • 3distinct rule-id prefixes in rollforward_engine.engine.REGISTRY
  • 4samples/*.json after python run.py
  • 5len(rollforward_engine.model.DOC_TYPES)
  • 6rollforward_engine/tests boundary tests on the cent and the day
  • 7python run.py (tb-rollforward-automation/); rollforward_engine/tests planted-defect suite
  • 8rollforward_engine/tests test_activity_column_defect_still_self_balances and test_the_activity_column_also_foots_to_zero
  • 9rollforward_engine/tests test_a_balance_collected_by_no_row_is_reported
  • 10python -m pytest --collect-only -q -o addopts= (tb-rollforward-automation/)
  • 11len(rollforward_engine.engine.REGISTRY)
  • 12len(rollforward_engine.generate.DEFECTS)
  • 13rollforward_engine/tests: every registered rule has a planted defect
  • 14tb-rollforward-automation/README.md and rollforward_engine read-only / determinism tests
  • 15rollforward_engine/model.py DOC_TYPES
  • 16tb-rollforward-automation/README.md scope statement
  • 17rollforward_engine/engine.py check_reg_entities_valid and check_src_books_self_balance
  • 18rollforward_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