Skip to content

feat(capture): pick the long-build specs the server has not built - #28

Merged
jm-rivera merged 1 commit into
devfrom
feat/unbuilt-build-years
Oct 26, 2026
Merged

jm-rivera merged 1 commit into
devfrom
feat/unbuilt-build-years

Conversation

@jm-rivera

@jm-rivera jm-rivera commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

tools/capture_client_contract.py chooses the two long-build specs itself. mint-async-build and operation-resume need a 202, which only a spec the server has not built gives, and each live record builds both specs for good. The constants ASYNC (1964) and ASYNC_RESUMED (1965) therefore had to move by hand before every record.

LONG_BUILD is one question over the donor group and start year. Context.async_spec(donors) walks LONG_BUILD_YEARS, 1960 to 2000, without recording those requests. It skips a year whose answer is not one definite part, whose row estimate falls outside 100,000 to 200,000, or whose spec_id an earlier year or the other donor group already gave (a start year before the source's first year clips to the same spec). It takes the first spec that GET /datasets/{id}/versions reports with no version, and raises ShapeError naming the range when none is left. The probe calls _newest, since newest_version reads a refused request as no version. The mint uses the DAC donors and the resumed operation the OECD donors, as before. The README paragraph states the rule in place of the years.

The recorded scenarios keep 1964 and 1965, which stay valid because the validator replays each recorded question. The next live record takes new years and rewrites the 12 scenarios derived from the two long builds.

Testing: tools/tests passes 533 tests, including two new ones that drive the walk with stubbed search and versions answers (skips an out-of-band year, a built spec and a repeated spec_id, caches each pick, refuses an exhausted range). python/client-contract passes 93. Ruff is clean on both files. A read-only run of the picking against dev, limited to search and versions requests, chose 1960 for both groups (110,084 and 114,442 rows, no version); the probe on the built 1964 DAC spec returned its version as a control.

Co-authored-by: Claude noreply@anthropic.com

@jm-rivera
jm-rivera marked this pull request as ready for review October 26, 2026 09:09
mint-async-build and operation-resume need a 202, which only an unbuilt
spec gives, and each live record builds its two specs for good. The tool
named their start years as constants, so every record needed new years
by hand. Context.async_spec now walks start years 1960 to 2000 for the
DAC and OECD donor questions and takes the first spec that is one
definite part, sits just above the sync budget, repeats no earlier pick,
and has no version on the versions route. It refuses when the range is
used up.

The party-totals scenarios narrow a built DAC spec and need no unbuilt
one, so they keep their own question, PARTY_TOTALS_FLOW.

Co-authored-by: Claude <noreply@anthropic.com>
@jm-rivera
jm-rivera force-pushed the feat/unbuilt-build-years branch from e5fa192 to bd9a9ab Compare October 26, 2026 12:58
@jm-rivera
jm-rivera merged commit b2987de into dev Oct 26, 2026
19 checks passed
@jm-rivera
jm-rivera deleted the feat/unbuilt-build-years branch October 26, 2026 14:23
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