Skip to content

Test anchor hash and label changes and rows from another source - #1516

Merged
MaxGhenis merged 2 commits into
mainfrom
us-feed-ed-fsa-survivors-1104
Nov 5, 2026
Merged

MaxGhenis merged 2 commits into
mainfrom
us-feed-ed-fsa-survivors-1104

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds later-report cases for the five changes to _follow_later_repin_report that every case let through at 0997c50, the last commit of #1513, whose merge comment lists them. The helper stays the same.

What changes

In packages/microcosm-build/tests/engine_free/us/test_us_esi_premiums.py:

  • Six cases change an anchor record set's hash or dimension label. For each B4923C record set, one case changes its record-set hash and one a dimension label, between two record sets outside the anchors, in the second of three changed fields. Until now no case changed any field but the group-by label in an anchor record set, so an anchor check that read only that field still refused every case.
  • A passing case adds a row from another source under that source's namespace. It declares bea with the namespace bea_nipa., adds a row in bea_nipa.cy2024.total_wages_salaries, which shares the anchors' namespace outside their record sets, and ends at a new feed digest. Before, the one passing case that adds rows declared ed_fsa with the namespace ed_fsa., and both passing cases ended at the digest new. So a helper that built the namespace from the source name, accepted only ed_fsa or returned a fixed digest still passed both.
  • The relabel case also changes an AGI label, as microcosm#1343's re-pin did. It changed only the age/85_plus label before, so a label check that allowed only that dimension label still passed it. As in that re-pin, the two label changes fall in different record sets, and each record set also changes its group-by label and record-set hash.

Tests

Under real pytest, with assertion rewriting (as CI runs them) and with --assert=plain, the later-report tests give these results against changes to the helper, the same in both modes:

Change to the helper Tests at ad67d0b Tests at 0997c50 Tests here
None 18 of 18 pass 27 of 27 pass 34 of 34 pass
Checks changed fields against the anchors only for the group-by label every case passes every case passes the six new anchor cases fail
Builds the namespace from the declared source every case passes every case passes the new passing case fails
Accepts only ed_fsa as the source every case passes every case passes the new passing case fails
Returns a fixed digest every case passes every case passes the new passing case fails
Allows only the age/85_plus dimension label every case passes every case passes the relabel case fails
The 68 changes #1513 counts 36 leave every case passing 3 leave every case passing the same 3

#1513 explains the three that remain: <= in the source check, >= in the key-count check, and a label check that matches the two layout fields exactly. Each case that caught a change at an earlier commit still catches it. The pin test, which follows the committed re-pin reports to the pinned feed, caught two of the five before, and nothing caught the other three. With a fixed digest, #1506's report starts from another feed, and the age-only label check refuses #1343's report, which changes two AGI labels. ruff check and ruff format --check report nothing new.


🤖 Generated with Claude Code

MaxGhenis and others added 2 commits November 4, 2026 16:54
A review of microcosm#1513 at 0997c50 found five changes to
_follow_later_repin_report that leave every later-report case passing.
An anchor check that reads only the group-by label field lets a hash or
dimension label change in a B4923C record set through. The one passing
case that adds rows declares ed_fsa with the namespace "ed_fsa.", and
both passing cases end at the digest "new". So a helper that builds the
namespace from the declared source, accepts only ed_fsa as the source
or returns a fixed digest passes every case too. So does a label check
that allows only the age/85_plus dimension label, since the relabel
case changes no other dimension label.

For each B4923C record set, one new case changes its record-set hash
and one a dimension label, between two record sets outside the anchors,
in the second of three changed fields. A new passing case declares bea
with the namespace "bea_nipa.", adds a row whose record set shares the
anchors' namespace, and ends at a new digest. The relabel case now also
changes an AGI label, as #1343's re-pin did.

The helper stays the same, and all 34 later-report cases pass with it.
Of 73 changes to the helper, the 68 that #1513 counts and these five, 3
leave every case passing here, against 8 at 0997c50 and 41 at ad67d0b,
in both pytest modes. #1513 explains the three that remain: <= in the
source check, >= in the key-count check, and a label check that matches
the two layout fields exactly. Each case that caught a change at an
earlier commit still catches it. At 0997c50 the pin test caught the
fixed digest and the age-only label check on the committed reports, and
nothing caught the other three.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The relabel case changes an AGI label in record set y, but its group-by
label and record-set hash changes listed only record set x. Its comment
says the hash covers the label changes, and in #1343's report each
relabeled record set changes its group-by label and record-set hash too.
The case now lists y in both, and the comment names both changes.

All 34 later-report cases still pass. Against the 73 changes to the
helper, every case gives the result it gave before, in both pytest
modes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis marked this pull request as ready for review November 5, 2026 01:10
@MaxGhenis
MaxGhenis merged commit b1c1993 into main Nov 5, 2026
10 checks passed
@MaxGhenis

Copy link
Copy Markdown
Contributor Author

Merged 3fa2563 with a merge commit.

  • CI passes at 3fa2563: lint, wheels, select-countries, installed-emitter, and engine-free and engine-us on Python 3.13 and 3.14. engine-uk and integration-uk skip.

  • GPT-6.1 Sol reviewed both commits and approved each. In 2280ecc, the relabel case put its AGI label change in record set y, which neither layout field listed, so the record-set hash didn't cover both label changes as its comment said. 3fa2563 lists y in both fields, as US targets label three dimension values two ways: re-pin the Chronicle feed with one label each #1343's report does for each record set it relabels, and Sol's review of it found nothing new.

  • Sol's first review also ran eight more changes to _follow_later_repin_report, and each leaves all 34 later-report cases passing. The pin test catches two of them on the committed reports: returning new only when a report adds no rows, and allowing only the age/85_plus and AGI all labels. No test catches the other six:

    • checking the source only when the declaration names ed_fsa;
    • checking the namespace only when the declaration names ed_fsa;
    • checking anchor record sets only for layout and age label changes;
    • deriving the namespace from a fixed map of sources;
    • accepting a listing digest that only starts with the new feed's digest;
    • accepting a starting digest that only starts with the expected one.

    The last two differ from the helper only on digests of different lengths, and SHA-256 digests all have the same length.

@MaxGhenis
MaxGhenis deleted the us-feed-ed-fsa-survivors-1104 branch November 5, 2026 01:10
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