Repository navigation
Release hardening: APR corrections, typed JSON contract, property tests, fail-closed release - #1
Merged
Merged
Conversation
… coverage Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iance, cent rounding, JSON API fuzz Fast 'ci' profile by default; HYPOTHESIS_PROFILE=deep runs 2000 examples per property. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ata (mocked) and after-tax views api.py 47% -> 92%, compare.py and live.py 100%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Correctness (differential fuzz against an independent implementation, 10,000 schedules): - The no-common-period average now rounds to every standard interval of (b)(3)(iii), including multiples such as 6 weeks; it previously chose only named units (0.32-point APR error). - A month-end series keeps its month-end anchor when one payment falls mid-month, and month-end to month-end gaps (Feb 28 -> Mar 31) count as a month. - Cent rounding could compound into a refund on the final payment at high rates over long terms (found by the property tests); the payment is then rounded down instead, in the engine and workbook. Safety (skill red-team): - Skills pass arguments as a JSON file on stdin; document text never reaches the command line, and is treated as data, not instructions. No bank credentials, SSNs or EINs are ever requested. - Released skills no longer ship the workbook writer or a `python -m capkit` entry point that bypassed the command allow-list. - Long schedules solve in about a second: ordinary schedules (advances before payments) have one root, so the solver bisects instead of scanning. Monthly sales paths no longer rebuild their dates quadratically. Flow and offer counts are capped and echoed errors are truncated. - Stop tracking .coverage (it held absolute paths). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ctuarial and U.S. Rule) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Solver fast path: a lower bracket too far out to evaluate (overflow on long schedules) moves toward zero; exact roots on the rate floor or ceiling are accepted (found by the deep property run too). - Month-end anchoring: an isolated February month-end payment in a 15th-of-month schedule is measured to the same date; month-end anchors apply only when month-end payments dominate. - Interval classification uses the series convention, so a 31st payment in a 30th-of-month series is irregular again. - Averaging ties compare in exact integers and go to the shorter interval. - Cent rounding: integer cents, half up as Excel ROUND, round down only when rounding up would refund, with no epsilon that could bump a cent; Python and the workbook formula agree on the edge cases. - APR flow cap leaves room for a full-length schedule; truncated errors stay within the limit; build_skills --check fails if excluded files appear in a released skill. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- unit "month" with a single month-end payment measures whole months (Jan 28 -> Feb 28 at 1% is 12.00%, was 10.90%) - monthly series on the 29th/30th infer a monthly unit and are not irregular (22.19%, was 22.37% on a five-week unit) - SBA 90-day combining requires the earlier loan's fee with its amount (a missing fee was taken as $0); the remaining ceiling is never negative - a lease with no buyout and no end_of_term is lease_character_unknown, not a nominal-buyout purchase; end_of_term "return" with a buyout errors - prepaid fees on the net basis also report the before-fees reading - closed-form month count removes an O(k^2) loop that could hang the CLI - every JSON argument is checked against its signature: wrong types are a ValueError naming the argument, true/false is never a number, dates are YYYY-MM-DD on every Python version, 12.0 is accepted for a whole number - workbook verifier compares rates to 1e-6 and checks the verdict - tests: brentq and XIRR oracles, closed-form and metamorphic properties, JSON fuzz with and without the fallback, skill CLI contract under -I Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The release checks tag = version, runs lint/types/tests, regenerates and verifies the shipped workbook, publishes SHA256SUMS, and no longer replaces assets of an existing release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… don't break the 3.9 check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
matveygreschner
added a commit
that referenced
this pull request
Nov 27, 2026
Release hardening: APR corrections, typed JSON contract, property tests, fail-closed release
matveygreschner
added a commit
that referenced
this pull request
Nov 27, 2026
Release hardening: APR corrections, typed JSON contract, property tests, fail-closed release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hardening pass over the released paths (engine, two skills, workbook). Nothing is tagged or released.
Corrections that change a reported figure
Each earlier figure was wrong; all are in the CHANGELOG.
unit: "month"with one month-end payment: Jan 28 → Feb 28 at 1% is 12.00% (was 10.90%).end_of_term:lease_character_unknown, not a nominal-buyout purchase.Contract and safety
ValueErrornaming the argument; true/false is never a number; dates areYYYY-MM-DDon every Python version;12.0accepted for a whole number. Remaining engine errors are wrapped with their original type.Tests
198 → 321 tests.
brentq, the XIRR identity, a separate Appendix J model.python -I.CI and release
apr.py+disclosures.py(measured 94% / 96%); workbook verified against the engine (291 comparisons, 0 mismatches).SHA256SUMS.How this was found