Skip to content

fix(corpus): the workflow has never actually analysed anything - #7

Merged
dennishavermans merged 2 commits into
mainfrom
fix/corpus-sigpipe
Aug 31, 2026
Merged

fix(corpus): the workflow has never actually analysed anything#7
dennishavermans merged 2 commits into
mainfrom
fix/corpus-sigpipe

Conversation

@dennishavermans

Copy link
Copy Markdown
Owner

The scheduled corpus run has failed on every repository since it was added. Two
bugs, both in the shell rather than in agentfile, and the second was hidden
behind the first.

1. A diagnostic listing could fail the job

find . -path ./.git -prune -o -type f -print | head -50

head closes the pipe once it has 50 lines, GNU find reports the write error
and exits non-zero, and set -euo pipefail promotes that into a failed step.
This was the last command in the fetch step, so the job died there, before a
single agentfile command ran.

Reproduced on ubuntu:24.04: the pipeline form exits 141, the file form exits
0. macOS hides it entirely because BSD find swallows EPIPE.

2. Findings are the expected outcome, and -e was killing them

The Analyse step opens with set -uo pipefail and then carefully records each
command's exit code, treating 1 as findings and anything above that as a crash.
None of that logic could ever run. GitHub invokes a run: block as
bash -e {0}, so -e is already on when the script starts and set -uo pipefail does not clear it. The step died on the first command that found
anything, which is precisely the case the code below it exists to allow.

expo/expo passed only because its configuration produces no findings, which
made the bug look repository-specific rather than total.

Verified on ubuntu:24.04 that bash -e plus set -uo pipefail still aborts
on a false, and that set +e restores the intended behaviour. The summary
step carried the same assumption and gets the same fix, because a run that
failed is exactly when its report needs to still be readable.

Verification

Dispatched against this branch: run 33389754989, all three green.

repository files fetched configuration discovered
PostHog/posthog 584 121
vercel/next.js 205 25
expo/expo 171 4

All five commands (doctor, check, lint, audit, adopt) plus context
now run to completion on all three, within the exit-code contract.

No agentfile behaviour changes. Workflow only.

`find | head` was the last command in the fetch step. head closes the pipe
once it has 50 lines, GNU find reports the write error and exits non-zero,
and `set -euo pipefail` promotes that into a failed step. Every corpus job
died there, before a single agentfile command ran, so the workflow has never
actually analysed anything since it was added.

Reproduced on ubuntu:24.04: the pipeline form exits 141, the file form exits
0. macOS hides it because BSD find swallows EPIPE, which is why this survived
local testing.

The list goes to a file and the count is printed, so the diagnostic also now
says whether the sparse checkout brought anything at all.
…d off

The Analyse step opens with `set -uo pipefail` and then carefully records
each command's exit code, treating 1 as findings and anything higher as a
crash. None of that logic could ever run. GitHub invokes a `run:` block as
`bash -e {0}`, so -e is already on when the script starts, and `set -uo
pipefail` does not clear it: the step died on the first command that found
anything, before reaching the code that exists to allow exactly that.

expo/expo passed only because its configuration produces no findings, which
is why the bug looked repository-specific rather than total.

Verified on ubuntu:24.04 that `bash -e` plus `set -uo pipefail` still aborts
on a false, and that `set +e` restores the intended behaviour.

The summary step carried the same assumption and gets the same fix, because
a run that failed is precisely when its report needs to still be readable.
@dennishavermans
dennishavermans merged commit 44dce55 into main Aug 31, 2026
11 checks passed
@dennishavermans
dennishavermans deleted the fix/corpus-sigpipe branch August 31, 2026 12:06
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.

2 participants