Repository navigation
Conversation
Chronicle's Thesis ledger is moving to plain numbers: 7716000 in count, not 7.716 in millions. A row in a base unit keeps what it was recorded as in source.recorded_value and source.recorded_unit, so SourceProvenance has to accept them, or arch/store.py and the ledger tests would refuse the row. Facts with no pair serialize as they did, so the bundles don't move. A test holds every recorded pair in the ledger to its stored value in exact decimals, and holds every unit_restatement to the row it names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A restatement adds a second line with the same week as the row it restates, so the strip fixture test now counts records rather than lines. The full-file test rewrites line 1 to show that mode trusts the manifest. Once a later row supersedes line 1, the rewrite breaks that link and the check catches it, which would pass this strict xfail. The test now rewrites a row nothing names, which is the case it was written to document. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Status: draft. This is part of the base-unit migration Max ruled on 2026-10-21 ("why not enter all chronicle facts as numbers (ie 1000000)?", then "Yes, migrate everything"). No data changes. It lands after #306 and before any row carries the pair.
What this PR does
Chronicle's Thesis ledger is moving to plain numbers:
7716000incount, not7.716inmillions. Each row keeps what it was recorded as insource.recorded_valueandsource.recorded_unit.SourceProvenanceaccepts the pair.arch/store.pyandtests/test_policyengine_ledger.pybuild it with**source, so without this change they refuse the first row that carries it.fact_to_mappingleaves out an empty pair, so facts with no pair serialize as they did and the bundles don't move.unit_restatementmust repeat the pair of the row it names. The test covers tampered rows too.No gate-surface file changes.
Invariants
Decimal(value) == Decimal(recorded_value) × 10^power, andmeasure.unitis the base unit ofrecorded_unit.unit_restatementnames an earlier row in a scaled unit and repeats that row's value and unit as its recorded pair.fact_to_mappingandfact_from_mapping.Evidence
tests/test_policyengine_ledger.py,test_build_series_catalog.pyandtest_thesis_append_adversarial.pygive 300 passed, 5 xfailed.test_thesis_append_shim_isolation.pyandtest_receipt_shim_transparency.pygive 53 passed.build_series_catalog.py --checkpasses.test_release_chain.pyandtest_arch_facts.pygive 373 passed, 5 xfailed.🤖 Generated with Claude Code