Skip to content

Refuse a current observation whose unit carries a scale word - #422

Merged
MaxGhenis merged 7 commits into
codex/thesis-ledger-factsfrom
feat/refuse-scaled-units
Nov 9, 2026
Merged

MaxGhenis merged 7 commits into
codex/thesis-ledger-factsfrom
feat/refuse-scaled-units

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Part of the migration Max ruled on 2026-10-21. It follows chronicle#404 and the restatement run (42526506760), which left no current row in a scaled unit.

What this does

scripts/build_series_catalog.py refuses a current observation whose measure.unit carries a scale word: thousand, million, billion or trillion, in any case. Thesis's catalog preflight then reports such a row as CATALOG REFUSED and appends the rest.

  • A superseded row keeps the unit it was written in, because the check reads the current view.
  • A docket-only row keeps its scaled targetUnit, because a contract registers in that unit. Its first observation stores the base unit.

No gate-surface file changes.

Invariant

A scale word in the current view always stops the build, and one in a superseded row never does, wherever the row sits. test_a_catalog_builds_exactly_when_no_current_unit_is_scaled checks this with Hypothesis, on journals valid in every other respect, against a literal list of units rather than the regex under test.

The word list stays coarse on purpose. It would refuse a rate unit such as per_thousand, which holds no scaled figure, and it misses MMBtu. No current unit falls in either group, and a series in a refused unit fails closed with CATALOG REFUSED.

The test this also fixes

Chronicle's CI has failed on this branch since the 12 Table A-19 rows landed (chronicle#433): test_correction_of_a_prefix_row_is_accepted_like_the_gate moved only June's record to a new unit, and the later months put each series in two units. The test now corrects every current record of the six series and carries each synthetic digest and unit into the row's projection.

It also corrects a prefix row again. The restatement had moved June's active version, so the test's corrections named restatement rows. The test now drops the later versions of those six records and asserts that all six June corrections name a prefix address.

This fixes the failure chronicle#433 reports. GitHub acts on closing keywords only for merges into the default branch, and this PR targets codex/thesis-ledger-facts, so this session closes the issue by hand at merge.

Evidence

  • tests/test_build_series_catalog.py passes on the ledger at 810b8c7 (284 passed), and --check reports the catalog current (221 series).
  • Mutants, each run against the whole test file: all 17 fail, 13 on the refusal and 4 on the changed test. That includes the two that survived the first version of this PR: a regex that ignores case only for trillion, and a refusal that reads only the last row.

🤖 Generated with Claude Code

MaxGhenis and others added 7 commits November 6, 2026 07:31
Chronicle stores plain numbers since Max's 2026-10-21 ruling, and the base-unit
restatement leaves no current row in a scaled unit. This turns any new one into a
catalog refusal, which Thesis's preflight reports as CATALOG REFUSED.

It reads current observations only. A superseded row keeps the unit it was
written in, and a docket-only row keeps the unit its contract registers in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Its synthetic corrections moved six series to millions, which the catalog now
refuses. A plain unit that Chronicle stores for none of them moves their unit on
any ledger, before or after the base-unit restatement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test

The 12 Table A-19 rows gave each of the six series later months in count, so a
correction that moved only June's record to persons put the series in two units
and turned Arch checks red on the ledger branch (chronicle#433). The test now
corrects every current record of the six series, and it carries each synthetic
digest and unit into the row's projection, which the append gate holds to the
row's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review of this PR found two mutants that survived: a case-sensitive
regex and a refusal that read only the last row. Three more unit parameters
and a Hypothesis property now kill both. The property spells out its scaled
units, so its answer doesn't come from the regex under test.

The prefix-correction test had stopped correcting a prefix row: the
restatement moved June's active version, so its corrections named the
restatement rows. It now drops the later versions of those six records and
asserts that all six June corrections name a prefix address.

The refusal moves below the unit's validity check, which drops a second read
of the unit and a guard that check makes redundant. Every row it refuses
stays refused, and a period error now reports first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The move below the validity check left the null-unit guard with no test, and
the property's comment claimed every journal when it holds for otherwise
valid ones: a unit conflict stops a build with no scale word in it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 9, 2026 09:53
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merge audit, at head 1e7466d.

  • Independent review: an Opus 5.5 reviewer agent (the Subfleet lanes stayed held for disk) reviewed the PR, its findings were fixed, and it agreed at this head: "I agree it should merge at 1e7466d once CI is green."
  • Mutants: all 17 fail. The property test_a_catalog_builds_exactly_when_no_current_unit_is_scaled pins the refusal against the units the catalog accepts.
  • CI: Append gate, Trusted base append gate, Arch checks and Arch bundle drift all pass at this head. gh pr checks exits 0.
  • Scope: carries out Max's 2026-10-21 ruling on base units. No gate-surface file changes.
  • chronicle#433: this PR fixes the failing test that issue reports. GitHub skips closing keywords on a non-default base, so this session closes the issue by hand.

@MaxGhenis
MaxGhenis merged commit b83c86f into codex/thesis-ledger-facts Nov 9, 2026
8 checks passed
@MaxGhenis
MaxGhenis deleted the feat/refuse-scaled-units branch November 9, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant