Skip to content

Stop the US post-export merged baseline pass from catching a refused batch file - #1774

Closed
anth-volk wants to merge 5 commits into
mainfrom
claude/post-export-merged-pass-batch-refusal
Closed

anth-volk wants to merge 5 commits into
mainfrom
claude/post-export-merged-pass-batch-refusal

Conversation

@anth-volk

Copy link
Copy Markdown
Contributor

Summary

#1751 made post-export scoring keep each household batch in its own file, and raise PostExportBatchFileError when a batch file's bytes changed or it cannot be read. #1725 added the merged baseline pass: one pass over every stage's baseline keys. If that pass raises, _HouseholdBatchedPostExportScorer._baseline_for lets each stage score its own plan, so that a key only one stage asked for fails that stage alone.

#1751 merged after #1725 without changing that handler, so the handler also caught PostExportBatchFileError. When that happened:

  • The scorer printed "Post-export merged baseline plan failed (...); each consumer scores its own baseline plan instead."
  • The first stage's own pass then read the same batch file again.
  • A changed file raised the same error one pass later.
  • A read error that did not happen again on that second read let certification go on.

_baseline_for now re-raises PostExportBatchFileError before its broad handler. A refused batch file stops certification in the merged pass, as it does in every other post-export stage. Every other error still falls back as before, including one raised from a batch-file error and an exception group holding one; the reviewer ran both cases.

Scored values are unchanged whenever certification completes. POST_EXPORT_SCORING_METHOD is unchanged.

Tests

Red-green:

  • 10fa8507e adds test_the_merged_baseline_pass_raises_a_refused_batch_file_at_once. It fails on main: positions read were [0, 0], and the fall-back message was printed.
  • dcb82eb03 makes it pass.
  • 23d6030f2 adds a missing-file case to the same test, so a fix that re-raised only on a digest mismatch would fail.

I ran both cases of the test locally by node ID. Other tests were not run locally; CI runs them.

Review

One adversarial review round, which found nothing serious:

  • It confirmed that only _PostExportBatchFiles.__getitem__ raises the error, and that no other handler between it and certify_main turns it into a fall-back or an "unavailable" report.
  • It found that the changelog misdescribed the read-error case, now corrected.
  • It found that the test lacked the missing-file case, now added.

Deployment and environment variables

No CI workflow, Dockerfile, Terraform or Modal code changes, and no environment variable is read or added.

🤖 Generated with Claude Code

anth-volk and others added 5 commits November 26, 2026 23:57
Fails on main: when a batch file changed, the merged baseline pass (#1725)
catches PostExportBatchFileError like any other error, prints that each
consumer will score its own baseline plan, and the consumer's own pass then
reads the same changed file and raises the same error. The merged pass must
raise it after one read, with no fall-back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_baseline_for re-raises PostExportBatchFileError before its broad handler,
which makes every consumer fall back to scoring its own baseline plan. A key
only one consumer planned still fails that consumer alone; a refused batch
file now stops certification in the merged pass, since every consumer's own
pass would read the same files. Scored values are unchanged.

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

Review found that the test covered only a batch file whose bytes changed,
so a fix that re-raised only on a digest mismatch would pass. The test now
also deletes the file and expects the "cannot be read" refusal after one
attempt, with no fall-back.

The changelog (and the previous commit's message) said the fall-back pass
always raised the same error. That holds for a changed file. A read error
that did not happen again on the fall-back's second read used to let
certification go on; it now stops certification, as a refused batch file
does in every other post-export stage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main already holds the same fix (#1772, 0678d1d): _baseline_for
re-raises PostExportBatchFileError before its broad handler, with its own
docstring, release-rule sentence and changelog fragment. The conflicts in
tools/build_us_fiscal_refresh_release.py and docs/us-release-build-rule.md
were wording only, and take main's text. This branch's changelog fragment
repeated main's and is removed. What remains of this branch is
test_the_merged_baseline_pass_raises_a_refused_batch_file_at_once, whose
missing-file case main's tests do not cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@anth-volk

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #1772, which put the same fix on main: _baseline_for re-raises PostExportBatchFileError before its broad handler, with tests for a changed batch file and for one that fails a read. After merging main, this branch added only one test, whose cases repeat those tests' coverage.

@anth-volk anth-volk closed this Nov 27, 2026
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