Report exit 5, not 4, when the content was never obtained - #6
Merged
Merged
Conversation
…inish Exit 4 is a claim about the CATALOGUE — "we asked, and the answer was nothing" — so handing it to a run that never reached the site tells a pipeline the listing is empty when nothing was read at all. Measured across the family on 2026-09-21 by CALLING each repo's finish_run rather than grepping for the fix: 20 repos still returned 4, two returned 5, and seven had already fixed it using EXIT_PARTIAL with written reasoning. Three camps, none aware of the other two. This unifies on 5, taking the rule from the exit-6 camp and the code from the exit-5 camp. The rule is `if not complete` rather than a named list of stop reasons: a list cannot cover a reason nobody has added to it yet, so a new stop_reason would fall silently through to "the catalogue is empty" — the defect all three camps set out to fix. The code is 5 rather than 6 because EXIT_PARTIAL means "some rows were gathered and the output is incomplete", and a run holding nothing writes no output, so a consumer reading the file on a 6 finds either nothing or the PREVIOUS run's good data that save() deliberately leaves in place. 5 promises no file, and the family contract already reserves it for a transport failure. Rows gathered and THEN a failure is still exit 6, unchanged. Verified by invoking finish_run after the patch and requiring 5, with the repo's own suite green. Checks that pinned the old answer were rewritten in the same commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A run that never obtained its pages used to report exit 4 — the code
this family documents as "ran fine, found nothing". So a dead proxy and an
empty catalogue were one value to anything branching on the exit code, which
is what this family says exit codes are for.
That much was already known. What a family-wide measurement on 2026-09-21
found is that three different repos had fixed it three different ways,
none aware of the others. Measured by importing each repo's
output_writerand CALLING
finish_run([], …, stop_reason="page_load_timeout"):farfetch,amazonEXIT_PARTIALstockx, not built on this coreThis unifies all 30 on exit 5, and takes the better half from each camp.
The rule comes from the exit-6 camp
They keyed on
if not complete. The exit-5 camp keyed on a named list ofstop reasons. A list cannot cover a reason nobody has added to it yet, so
a new
stop_reasonfalls silently through to "the catalogue is empty" — theexact defect all three camps set out to fix. So the list was the hole, and
the repos that shipped the fix first are the ones being simplified here.
The code comes from the exit-5 camp
EXIT_PARTIAL(6) means "some rows were gathered and the output isincomplete". A run holding nothing writes no output at all, so a consumer
that reads the file on a 6 finds either nothing or the previous run's
good data — which
savedeliberately does not overwrite. Exit 5 promises nofile, and this family's contract already reserves 5 for a transport failure
(
scraper_api_clienthas used it for a remote API error since it waswritten). No new code, and no per-repo table for a caller driving more than
one of these scrapers.
A run that gathered rows and THEN failed is still exit 6, unchanged.
Verified by calling, not by reading
Every repo's
finish_runwas invoked after the patch and required to return5 before the change was kept, and each repo's own suite had to stay green.
Where a repo's suite pinned the old answer by name, that check was
rewritten in the same commit — a test asserting
exit 6is that repostating its position, and changing the code while leaving the test would
make the suite red and read like a regression rather than a decision.
🤖 Generated with Claude Code