Skip to content

Test low counts and digests, and anchors listed second, in later reports - #1513

Merged
MaxGhenis merged 3 commits into
mainfrom
us-feed-ed-fsa-coverage-1104
Nov 4, 2026
Merged

MaxGhenis merged 3 commits into
mainfrom
us-feed-ed-fsa-coverage-1104

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds the later-report cases that three independent reviews asked for: one of #1506 at 212dd72, and one each of this branch's first two commits, 92b1185 and 4b84fbf. #1506 merged as ad67d0b, and _follow_later_repin_report stays the same.

What changes

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

  • Cases put a bad entry between two good ones for the source, anchor, namespace and label checks. Among the added rows, the row from another source, the row in an anchor record set and the row outside the namespace each come second of three. Among the changed fields, the value change comes second of three. The label change in an anchor record set sits in the second of three fields, where the anchor comes second of three record sets. On main each of these cases held its bad entry alone or last, so a check that read only the last entry would still refuse every one.
  • The cases give the helper the pin test's three anchor record sets, and the two cases that touch an anchor record set run once for each of the three. On main the cases gave the helper one anchor, so a check that read only some of the pin test's three would still refuse every case.
  • Four cases test values below the expected one. They join the cases above it: an old feed digest and a listing digest that sort before the expected ones, an old feed one row short (with a new count that still adds up), and a new row count one short. Before, each case for the four checks of a feed's digest or row count held a value above the expected one, so <= in place of == would still refuse them.
  • A new case passes a report that relabels rows and adds none, as microcosm#1343's re-pin did. On main, every later-report case still passed with a helper that refused all reports that add no row, or all dimension value label changes. Only the pin test, which runs the helper over US targets label three dimension values two ways: re-pin the Chronicle feed with one label each #1343's committed report, caught either one.

Tests

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

Change to the helper Tests on main (ad67d0b) Tests here
None 18 of 18 pass 27 of 27 pass
A check reads only the first entry of a list or a mapping (9 changes) 8 leave every case passing each fails a case
A check reads only the last entry (9 changes) all 9 leave every case passing each fails a case
A check passes when any entry passes (5 changes) 4 leave every case passing each fails a case
An anchor check reads only one or two of the three anchor record sets (12 changes) 6 leave every case passing each fails a case
The helper refuses every report that adds no row (1 change) leaves every case passing fails a case
The label check drops one of its three prefixes (3 changes) 1 leaves every case passing each fails a case
<= for each of the four feed digest and row count checks all pass each fails its case below the expected value
>= for each of the four its case above the expected value fails the same case fails

Each set of nine changes limits these readings:

  • the changed fields, for both checks together and for each alone;
  • a changed field's record sets;
  • the anchor set, in each anchor check;
  • the added rows, in the source, anchor and namespace checks.

The any-entry changes cover the label check's fields, the anchor check's record sets, the source check (the declared source among the sources), and the anchor and namespace checks' rows.

The earlier cases catch 18 changes: matching the namespace anywhere in a record set id, the two namespace moves, and deleting each check. Each of them still fails at least one case, and each case that caught a change at ad67d0b, 92b1185 or 4b84fbf still catches it. Three changes still leave every case passing. <= in the source check differs only for a declared listing with no rows, from a report that adds none: the helper refuses it, and the change accepts it. >= in the check that a listing names each key once can't change the result, since a listing never holds more distinct keys than rows. A label check that matches the two layout fields exactly, rather than as prefixes, refuses only a field name that extends one of them. Both reports the pin test reads pass that check: #1343's lists both layout fields by their exact names, and #1506's lists no changed field. ruff check and ruff format --check report nothing new.


🤖 Generated with Claude Code

A third review of #1506, at 212dd72, found six changes to
_follow_later_repin_report that left every later-report test passing.
Two make an anchor check read only the first record set: in the changed
fields, or among the added rows. Four compare with <= in place of ==:
the old feed's digest, the old row count, the listing's digest and the
new row count. Each anchor case held one record set, and each refusing
count or digest sorted above the expected one.

The anchor-label and anchor-record-set cases now list a record set
outside the anchors first and the anchor second. Four cases join them,
each below the expected value: an old feed digest and a listing digest
that sort first, an old feed one row short with a new count that still
adds up, and a new row count one short. The helper stays the same, so
every case passes at once. Each of the six changes now fails one of
these cases, under pytest's assertion rewriting and with --assert=plain.
Using >= in place of == already fails the cases above the expected
value, and each of the 18 changes the earlier cases catch still fails at
least one case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaxGhenis and others added 2 commits November 4, 2026 13:41
A review of 92b1185 found that every later-report case still passed
when an anchor check read only the last record set or row, since each
anchor case put the anchor last. Other checks that read a list or a
mapping had the same gap. Of 23 changes that make such a check read
only its first entry or only its last, or pass when any entry passes,
17 left every case passing at 92b1185. Four of them read one of the
three anchor record sets that the pin test gives the helper, while the
cases gave it only one.

Each case for such a check now puts its one bad entry between two good
ones. Among the added rows, the row from another source, the row in an
anchor record set and the row outside the namespace each come second
of three. Among the changed fields, the value change comes second of
three. The label change in an anchor record set sits in the second of
three fields, where the anchor comes second of three record sets. The
cases now give the helper the pin test's three B4923C record sets and
touch cy2024, which sorts between the other two.

The helper stays the same, and every case passes with it. Each of the
23 changes now fails a case, under pytest's assertion rewriting and
with --assert=plain, and each earlier change still fails the cases it
failed before.

The new row count comment said every count and digest a check compares
had a case on each side of the expected value, as this branch's first
commit message did. The check that a listing names each key once
compares its key count with its row count, and the key count can't
exceed the row count. The comment now names the four checks of a
feed's digest or row count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A review of 4b84fbf found that the comment above the refusing cases
claimed more than they show. It said each case for a check that reads
a list or a mapping puts its one bad entry between two good ones, but
namespace-not-leading holds a single row. The comment now says a check
that reads only the first entry, or only the last, lets through each
case whose own comment puts its bad entry between two good ones.

The review also found two gaps in the cases. Both cases that touch an
anchor record set used only cy2024, so an anchor check that read
cy2024 alone, or with one of the other two record sets, let every case
through. And no case passed a report that adds no row or changes a
dimension value label, so every case still passed with a helper that
refused either kind. Only the pin test, which runs the helper over the
committed report of microcosm#1343, caught such a helper. Both anchor
cases now run once for each of the three B4923C record sets, and a new
case passes a report that relabels rows and adds none, as #1343's
re-pin did.

The helper stays the same, and all 27 later-report cases pass with it.
Of 68 changes to the helper, 3 leave every case passing here, against
11 at 4b84fbf, 28 at 92b1185 and 36 on main. Both pytest modes,
assertion rewriting and --assert=plain, give the same results. Each
case that caught a change at an earlier commit still catches it. As at
4b84fbf, <= in the source check and >= in the key-count check leave
every case passing. So does a label check that matches the two layout
fields exactly rather than as prefixes, and it accepts both committed
reports, which name those fields exactly.

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

Copy link
Copy Markdown
Contributor Author

Merged 0997c50 with a merge commit.

  • CI passes at 0997c50: 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 the branch at each of its three commits, 92b1185, 4b84fbf and 0997c50, and approved each with follow-ups. The second and third commits answer the first two reviews.

  • The third review found one wrong sentence. The commit message and the body said that both committed reports the pin test reads name the two layout fields exactly, but Re-pin the US Chronicle feed to add Federal Student Aid's loan portfolio tables #1506's report lists no changed field. The body now says so. The commit message keeps the old sentence, since changing it would take a force push.

  • The third review also found five changes to _follow_later_repin_report that leave every case passing, outside the 68 the body counts:

    • checking changed fields against the anchors only for group-by labels, which lets through a hash or dimension label change in an anchor record set;
    • deriving the namespace from the declared source;
    • hard-coding ed_fsa as the source;
    • returning a fixed digest;
    • allowing only the age/85_plus dimension label.

    The pin test catches the last one on US targets label three dimension values two ways: re-pin the Chronicle feed with one label each #1343's committed report.

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