ENGINE 39
SFS-E39-CAP · COST CAPITALIZATION · REV 2026-07-24 · PRODUCTION
PRODUCTION = runnable end-to-end, CI-backed, full test suite passing. All data fictional and seeded.
Section 263A Interest Capitalization
Does the interest each project capitalized re-derive from the expenditures and the rate?
A developer that builds designated property with borrowed money cannot deduct all of the interest it pays. Under the avoided-cost method of IRC §263A(f), the interest production could have avoided -- the period rate applied to the accumulated production expenditures tied up in a project -- is capitalized into that property's basis, and only the remainder is deducted. The annual schedule lays every active project across a grid of calendar quarter-ends, pulls each project's interest expense by quarter, and computes that split, and it is rebuilt every fiscal year. This engine reads the five tabs the schedule emits -- the entity trial balance, the project status roster, the project data tab carrying the accumulated production expenditures and the period rate, the interest-by-year tab carrying interest, capitalized and deducted by quarter, and the year-over-year comparison -- and runs nineteen deterministic controls over them. Is the file complete over a readable quarter grid, are the project keys unique, named and in a known status, does every project carrying an interest balance on the trial balance reach the schedule, are the expenditures present for every quarter, non-negative and non-decreasing, is each capitalization rate a valid basis-point rate and is one rate applied across the whole period, does each quarter's capitalized interest re-derive as that rate applied to that quarter's accumulated expenditures, does the split close without leakage, does it stay within the interest actually incurred, do the quarterly columns foot to the stated annual totals, has a project placed in service stopped capitalizing, does the comparison tie the schedule's annual capitalized figure and roll the prior year's balance forward, and do the schedule's total capitalized and project count recompute from the projects they summarise. Every tie is compared with exact ==, amounts are integer cents that are never coerced into the figure the engine is meant to audit, and no source artifact is ever written.
An interest-capitalization schedule is the most reviewable-looking workpaper a developer keeps: four columns, one row per project, a grid of quarters that foots. That is exactly why it drifts. None of the ways it goes wrong look wrong in a grid of quarters. A quarter is edited and the annual total beside it is not re-added, so the row stops footing while the schedule still looks complete. The interest a project incurred no longer equals its capitalized portion plus its deducted portion, so a slice of interest is capitalized nowhere and deducted nowhere -- it has simply left the schedule. A construction project carrying an interest balance on the trial balance never reaches the roster, so its interest is deducted in full, none is capitalized, and nothing in the workbook notices. And the capitalized column itself -- the number that goes into basis and stays there for the life of the asset -- is typed rather than recomputed, or one project is rolled at a rate the others were not, or the comparison never carries last year's balance forward. The engine rebuilds every capitalized figure from the accumulated production expenditures and the period rate through the same kernel that produced the data, compares with exact ==, proves the roster against the trial balance rather than against itself, ships a planted-defect file for every registered control, and states its benchmark as a command rather than a claim. Interest capitalized into basis on a figure nobody re-derived is a misstatement that compounds every year the asset is held.
Architecture
functional block stack · static overviewSelect a layer
Six control families run in registry order over each capitalization file. The first proves the others had something to read -- every tab present and a legible quarter grid -- because a control that passes on absent evidence reports assurance it never performed.
Key specifications
at a glanceWhat it does for you
plain termsA real-estate developer that builds designated property with borrowed money may not deduct all of the interest it pays. Under the avoided-cost method of IRC §263A(f), the interest production could have avoided -- the period rate applied to the accumulated production expenditures tied up in a project -- must be capitalized into that property's basis rather than deducted in the year paid, and the rest is deducted. The annual schedule lays every active project across a grid of calendar quarter-ends, pulls each project's interest expense by quarter, and computes that split. It is rebuilt every fiscal year, and it goes stale in ways nobody watches. Four failures hide inside it, none of which look wrong in a grid of quarters. A row stops footing: a quarter column is edited and the annual total beside it is not re-added, so the interest, capitalized and deducted columns no longer cross-foot while the schedule still looks complete. The split leaks: the interest a project incurred no longer equals its capitalized portion plus its deducted portion, so a slice of interest is neither capitalized into basis nor deducted -- it has left the schedule. A project is missing: a construction project carrying an interest balance on the entity trial balance never reaches the roster, so its interest is deducted in full and none is capitalized. And the capitalized figure is asserted rather than derived: it is typed in instead of recomputed as accumulated production expenditures times the period rate rolled by quarter, or one project is rolled at a rate the others were not, or the comparison never carries the prior year's capitalized balance forward. None of these are judgment calls. They are equalities -- a stated capitalized figure against the rate applied to the expenditures, capitalized plus deducted against the interest incurred, an annual against its quarters, an ending balance against prior plus current -- which a deterministic control settles better than a workbook inherited by whoever rebuilds the schedule this year, and the consequence of missing one stays in basis for the life of the asset.
The seeded demo runs every control over every capitalization file7. The CLI generates twenty-one fictional FY2029 capitalization files -- one clean baseline and one carrying each of the twenty planted defects -- then runs all nineteen 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.
The capitalized column is recomputed, not read back8. One defect file raises a project's fourth-quarter accumulated production expenditures without re-deriving the schedule beneath it. Every column still foots, the split still closes, and the annual totals still add -- but cap_rederives rebuilds that quarter's capitalized interest as the period rate applied to the new expenditure balance, finds it is not the figure stated, and fails, proving the capitalized column is derived from the expenditures rather than trusted as written.
Completeness is proved against the trial balance, not against the schedule9. Another defect file adds a project to the entity trial balance that was never added to the roster. Nothing inside the schedule is inconsistent -- every project on it foots, ties and re-derives -- and prj_tb_complete still fails, because the trial balance is the authoritative population and a construction project absent from the schedule has all of its interest deducted and none capitalized.
Functional block diagram
engineering · each block links to its sourcePlain terms
- Seeded Capitalization Files. fictional FY2029 interest-capitalization files enter the control registry
- Structural Precondition. is the file complete over a readable quarter grid
- Project Roster. is the roster sound and complete against the trial balance
- Expenditures and Rate. are the two inputs to the derivation well-formed for every quarter
- Capitalized / Deducted Split. does the split re-derive, close, stay within the interest and foot
- Year-over-Year Comparison. does the comparison tie the schedule and roll the prior year forward
- Schedule Rollups. do the portfolio total and project count recompute from the projects
- Tabs, Grid and Rate. the five tabs and the quarter grid every rule resolves against
- Verdict and Findings. every finding, with the reason it exists, ends at a person
Engineering
- Seeded Capitalization Files. generate_corpus writes one clean baseline plus one planted-defect file for every registered control, twenty-one files in total, across four invented development projects on a four-quarter grid. Only the roster, the trial balance, the accumulated production expenditures, the period rate, the quarterly interest expense and each project's prior-year capitalized balance are stated as base facts; every quarter's capitalized and deducted interest, the annual totals, the comparison's current-year and ending balances and the schedule rollups are re-derived through the same capitalization kernel the engine later recomputes with, so the relationships the engine tests are the relationships that produced the data.
- Structural Precondition. One control. FAILs a file missing any of the five tabs or carrying a duplicate, an empty quarter grid, or an unreadable as_of date, so no downstream rule holds vacuously on absent evidence.
- Project Roster. Four controls: the (company_no, job_no) key is unique, each project carries a name, each status is one of active / complete / on_hold, and every project carrying an interest balance on the entity trial balance appears on the schedule.
- Expenditures and Rate. Four controls: every roster project is covered across the data, interest and comparison tabs for every quarter in the grid, the accumulated production expenditures are non-negative, they do not fall quarter over quarter, and each capitalization rate is an integer basis-point rate in 0..10000.
- Capitalized / Deducted Split. Six controls: one rate across the period, each quarter's capitalized interest recomputed as that rate on the quarter's accumulated expenditures, capitalized plus deducted equal to the interest incurred, capitalized never above it, the annual columns footing their quarters, and a placed-in-service project still capitalizing raised as a FLAG.
- Year-over-Year Comparison. Two controls: the comparison's current-year capitalized equals the annual capitalized the schedule foots to, and the ending capitalized balance equals the prior-year balance plus the current year, so cumulative basis is neither lost nor double-counted.
- Schedule Rollups. Two controls: the schedule's total capitalized is re-summed from the project annuals, and its stated project count is counted from the distinct roster keys.
- Tabs, Grid and Rate. The trial balance carries the authoritative population of projects holding an interest balance; the project status roster carries each project's key, name and status; the project data tab carries the accumulated production expenditures at each quarter-end and the period capitalization rate in basis points; the interest-by-year tab carries interest, capitalized and deducted by quarter plus the three annual totals, the portfolio total capitalized and the project count; and the comparison tab carries the prior-year, current-year and ending capitalized balances. The file itself carries the quarter-end grid and the as_of date. Every roster, expenditure, split, comparison and rollup control resolves against these through the shared capitalization kernel.
- Verdict and Findings. Findings roll up per capitalization 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. Both the JSON and markdown reports carry no timestamps and no absolute paths, which is what makes the committed report diffable -- a change in the diff is a change in the controls.
Instruction set
every public command| Command | Operation | Output | Exit | Artifacts |
|---|---|---|---|---|
python run.py | regenerate the seeded fictional corpus, run all nineteen 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 | capitalize_report.json, capitalize_report.md, samples/ |
python -m capitalize_engine samples | analyze an existing folder of capitalization 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 capitalize_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 capitalize_engine/tests -q | run the full test suite for this engine | 10323 passed | 0 when every test passes | none |
Benchmarks
measured demo results| Measure | Result |
|---|---|
| Engine tests10 | 10,323 tests collected live collection from the engine directory |
| Registered controls11 | 19 controls counted from the registry, not from documentation |
| Planted defects12 | 20 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 whether a capitalized figure is carried into basis and whether an in-service date or a missing project is chased.
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 schedule into the documented workpaper review and sign-off |
| One or more FLAG, no FAIL | REVIEW | a human resolves each flag; a project placed in service that is still capitalizing interest lands here, because the in-service date is a judgment the engine cannot adjudicate |
| One or more FAIL | FAIL | the figure is not carried into basis or the return workpaper until the failing control is cleared -- a capitalized figure that does not re-derive, a split that leaks, a row that does not foot, a project missing from the schedule, or a comparison that does not roll forward |
- Read-only: capitalization files are parsed and never written back, so the engine cannot introduce the break it reports.
- Integer cents throughout, compared with exact ==; there is no tolerance band on a capitalized, deducted or annual figure, and a cent off the re-derivation is reported as a break.
- An amount 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 into the number the engine is meant to audit.
- One capitalization kernel: the controls and the generator share the arithmetic in capitalize_engine.capitalize, so a re-derived figure cannot disagree with the data that produced it.
- The rate is applied with truncating division exactly once, in the kernel, so a derived capitalized figure compares to the reported figure with exact == rather than through two rounding conventions.
- Completeness is proved in the authoritative direction: the trial balance is the population, and the roster is tested against it rather than against itself.
- 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 tab or quarter fails completeness rather than letting the controls that read it pass unread.
Operating limits
what it refuses to do- The engine never posts an entry, files a return, adjusts basis, or writes to a source artifact. It reads the capitalization file and stops.14
- It reads the five tabs the annual schedule emits. It does not connect to a general ledger, a job-cost system, loan documents or a fixed-asset register.15
- It re-derives the capitalized interest at the basis-point rate the file carries and proves one rate is applied across the period; it does not decide whether that rate is the correct avoided-cost rate for the entity, whether the debt is properly traced, or whether the property is designated property at all.16
- It flags a project placed in service that is still capitalizing interest as a matter for review; it does not determine the in-service date or decide when the capitalization period ended.17
- It takes the accumulated production expenditures and the quarterly interest expense at face value: it confirms they are well-formed and that everything derived from them ties, not that the underlying cost or interest is correct. All shipped data is fictional -- the developers, the projects, the company and job numbers, the expenditures, the interest and the rate are invented, and the fiscal year is set in a fictional future.18
See it run
control architecture
Integration
how to run itDistribution: public repository, MIT license.
- 1python -m pytest --collect-only -q -o addopts= (interest-capitalization-automation/)
- 2len(capitalize_engine.engine.REGISTRY)
- 3distinct rule-id prefixes in capitalize_engine.engine.REGISTRY
- 4samples/*.json after python run.py
- 5len(capitalize_engine.model.DOC_TYPES)
- 6capitalize_engine/tests boundary tests on the cent and the quarter grid
- 7python run.py (interest-capitalization-automation/); capitalize_engine/tests planted-defect suite
- 8capitalize_engine/generate.py DEFECTS capitalized_misderived -> cap_rederives
- 9capitalize_engine/generate.py DEFECTS tb_project_missing -> prj_tb_complete
- 10python -m pytest --collect-only -q -o addopts= (interest-capitalization-automation/)
- 11len(capitalize_engine.engine.REGISTRY)
- 12len(capitalize_engine.generate.DEFECTS)
- 13capitalize_engine/tests: every registered rule has a planted defect
- 14interest-capitalization-automation/README.md and capitalize_engine read-only / determinism tests
- 15capitalize_engine/model.py DOC_TYPES
- 16capitalize_engine/engine.py data_rate_valid and cap_rate_consistent
- 17capitalize_engine/engine.py cap_ceased_on_completion
- 18capitalize_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