Repository navigation
[3726 by Claude Opus 5.5] CI-failure comment: fold an aggregate job under the shard that made it fail - #3731
Conversation
…e aggregate job once as its consequence, with no evidence block of its own. The 15 new tests and the 132 existing CI-failure and comment tests pass, and typecheck and lint on core are clean. I didn't check that a new test fails with the fold logic removed.
How it decides. When a failed check comes in, ProPR reads the job's steps, the run's full list of jobs, and the workflow file at the run's head commit. The file is fetched once per run per comment, and not at all when nothing else in the run failed. An aggregate is folded only if all of these hold:
- the job's reported name maps to exactly one job id in the workflow, and that job `needs` at least one job that failed in this run attempt.
- each failed needed job also maps to exactly one id, including matrix jobs with expanded names.
- every failed step of the aggregate is a gate step: a named step that reads `needs.<id>.result` for one of those failed jobs.
If anything can't be read, parsed or mapped, or the aggregate has another failed step, the job is listed as a separate failure, as before.
In the comment:
- Shard already reported: the existing comment is edited to add a line like *"Also failed: Run Full Test Suite, which only reports the result of the failed job it needs (`Full Test Suite Shard 3/4`); it has no failure of its own."* The title stays the same.
- Aggregate reported first: the new comment lists the shard as the failure, reading the shard's own output and annotations, plus the "Also failed" line. It carries the shard's hidden marker, so the shard's own report later counts as a duplicate.
The follow-up prompt is the comment body without its hidden markers, so it gets the same folded list; a test checks that.
Choices you may want to revisit:
- In this repo's workflow, the coverage step ("Verify shards ran every discovered test exactly once") counts as the aggregate's own failure, so if it fails, the aggregate stays a separate failure.
- An aggregate with no failed step at all is not folded. I left out the issue's alternative condition ("no steps that ran tests/builds of its own") because "test/build step" can't be told from the workflow without guessing.
- If the aggregate's report starts the comment while the shard was judged a runner problem, the posted comment lists the shard as a code failure. Before this change the aggregate would have started a follow-up in that case too.
Files:
- New `packages/core/src/webhook/ciFailureAggregateFold.ts`: workflow parsing, the pure fold decision, and the GitHub reads.
- New `packages/core/src/webhook/ciFailureCommentText.ts`: the comment text helpers, moved out of `ciFailureFollowup.ts` to keep it under the 400-line lint limit. `buildAnnotationExcerpt` is still exported from the old module.
- `ciFailureFollowup.ts` loads the fold and builds the folded comment; `ciFailureCommentGrouping.ts` has the edit for the "Also failed" line.
- New `test/ciFailureAggregateFold.test.ts`, which runs on the real `pr-test-on-label.yml` and covers the four acceptance cases, plus ambiguous names, matrix names, both orders of arrival and the once-per-run file read.
- `docs/docs/features/pr-followup.md` now describes the folding.
To run the suites here I needed `--experimental-test-module-mocks` and writable `GIT_CLONES_BASE_PATH`/`GIT_WORKTREES_BASE_PATH`, because `/tmp/git-processor` is read-only in this container. I made no preview, since the change is comment text and logic rather than a screen.
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds workflow-based aggregate folding and preserves the existing comment format, but needs changes before merge. Three changed paths can hide genuine failure evidence or suppress a later actionable failure. ✅ Conservative read fallback — Unreadable workflows, incomplete job listings, and ambiguous aggregate names retain separate failure reporting. ✅ Focused coverage — Tests cover both arrival orders, multiple failed shards, independent failed steps, and workflow-read failures. The supplied current-head status has no failures, with five checks pending. This review used static analysis only; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Result references do not prove gate-only behavior
F2: 🔴 Existing comments can omit the failed causes
F3: 🔴 Folded infrastructure failures suppress later code failures
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe implementation has useful fallback behavior and focused tests, but its folding proof and comment integration can discard actionable evidence. These correctness issues require localized fixes before merge; pending checks are not the reason for this score. Score: 5/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit ad7463e
Summary of ChangesI fixed F1, F2 and F3, but the F1 fix means this repo's own What the API reports: I checked real runs of this workflow. When a step with F1 – a step only counts as a gate with positive evidence. The new
F2 – a comment started by another failure now gets the shards' evidence. Before editing the existing comment, ProPR checks each failed shard's hidden marker in it. Shards not listed yet are added as failures with their evidence and marker, then the "Also failed" line. Shards already listed aren't added twice. F3 – runner-problem shards are no longer claimed. Each shard the comment doesn't list yet is first checked by the same runner/network classifier its own report uses. If any is a runner or network problem, the aggregate isn't folded and is listed on its own, as before this PR. That shard gets no hidden marker, so a real failure on a manual re-run is still reported. The shard-loading code moved to the new Tests: I added 7 regression tests in
The folding tests now use the workflow with the coverage check removed from the gate. All 22 tests in that file pass; with the fixes reverted, 5 of the new ones fail as expected. The other CI-failure suites (84 tests) and the checkRunHandler and Ultrafix recovery suites (207 tests) pass, and typecheck and lint on core are clean. Something to decide: under F3, if every failed shard was a runner problem, the aggregate is still posted on its own and starts a code follow-up, as it did before this PR. Leaving it unreported would be more accurate, but I left that out because it goes past the minimum correction. I made no preview, since nothing here changes a screen. Review digestRisk-tiered paths
Diff size: 6 files changed, +582/−99 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
… `Run Full Test Suite` aggregate no longer folds. Its gate step also checks a result of the aggregate's own, and GitHub hides when that fails. I fixed F1, F2 and F3, but the F1 fix means this repo's own `Run Full Test Suite` aggregate no longer folds. Its gate step also checks a result of the aggregate's own, and GitHub hides when that fails. **What the API reports:** I checked real runs of this workflow. When a step with `continue-on-error: true` fails, GitHub's jobs API still reports it as `success`. For example, run 44380032434 shows `Run Full Test Suite shard=success` on a shard that failed. The gate step "Enforce shard and docs results" reads `steps.coverage.outcome`, so when coverage verification fails, only the gate shows as failed. Before this fix, that coverage failure would have been folded away. The existing test assumed GitHub would report the coverage step as failed, which it doesn't. So that gate counts as a mix of shard checks and the aggregate's own check, and the aggregate is listed as its own failure, as before this PR. To get folding back here, the coverage check would need its own step. I didn't change the workflow because that's outside these findings. **F1 – a step only counts as a gate with positive evidence.** The new `ciFailureGateStep.ts` accepts a failed step only if all of this holds: - It's a plain bash/sh `run` step: no `uses`, `with` or other keys. - Every expression in its `run`, `env` and `if` reads only the needed jobs' results and outputs, or the `github` context. Reading the job's own steps, `env` or `inputs` disqualifies it. - Its script uses only shell builtins (`echo`, `printf`, `test`, `[`, `exit`, …), variable assignments and functions it defines. Running any program, `$(…)`, backticks, here-documents, `case`, `for` or `eval` disqualifies it. - It reads the result of at least one failed needed job. **F2 – a comment started by another failure now gets the shards' evidence.** Before editing the existing comment, ProPR checks each failed shard's hidden marker in it. Shards not listed yet are added as failures with their evidence and marker, then the "Also failed" line. Shards already listed aren't added twice. **F3 – runner-problem shards are no longer claimed.** Each shard the comment doesn't list yet is first checked by the same runner/network classifier its own report uses. If any is a runner or network problem, the aggregate isn't folded and is listed on its own, as before this PR. That shard gets no hidden marker, so a real failure on a manual re-run is still reported. The shard-loading code moved to the new `ciFailureFoldCauses.ts` to keep `ciFailureFollowup.ts` under the 400-line limit. **Tests:** I added 7 regression tests in `test/ciFailureAggregateFold.test.ts`, covering: - the repo's real gate not folding. - a step that reads the result but also runs its own tests (`npm test`, `$(…)`, a script). - steps that use an action, Python, or read their own job. - an unrelated `Lint` comment followed by the aggregate. - a shard already on the comment. - the runner problem → aggregate → real re-run failure sequence. The folding tests now use the workflow with the coverage check removed from the gate. All 22 tests in that file pass; with the fixes reverted, 5 of the new ones fail as expected. The other CI-failure suites (84 tests) and the checkRunHandler and Ultrafix recovery suites (207 tests) pass, and typecheck and lint on core are clean. `docs/docs/features/pr-followup.md` now describes the stricter rule and both changes. **Something to decide:** under F3, if every failed shard was a runner problem, the aggregate is still posted on its own and starts a code follow-up, as it did before this PR. Leaving it unreported would be more accurate, but I left that out because it goes past the minimum correction. I made no preview, since nothing here changes a screen. PR: #3731 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds aggregate detection and folds dependency failures into shared CI comments. It needs changes before merge: the gate detector can hide an aggregate’s independent failure, and synthesized dependency reports bypass the repository’s non-blocking check policy. ✅ Conservative read fallback — Unreadable workflows, incomplete job listings, and ambiguous aggregate names retain separate failure reporting. ✅ Comment integration — The implementation adds missing causes with evidence and deduplication markers while preserving already-reported causes. The supplied current-head status shows 23 passed, one pending, and no failed checks. This review used static analysis only; no commands were run or files modified. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F4: 🔴 Builtin-only scripts can contain independent failures
F5: 🔴 Folded causes bypass non-blocking filtering
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise folded fallback pathsAdd focused tests for comment-list and comment-edit failures while folding. Existing fallback tests cover ordinary checks, whereas the new folded fallback can fetch already-reported causes through ScoreThe comment integration and fallback handling are useful, but two changed paths violate reporting correctness and require localized fixes. Passing checks do not cover these demonstrated cases. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 92c2b9d
Summary of ChangesI fixed F4 and F5. The CI-failure suites pass (237 tests, including the existing checkRunHandler and non-blocking tests), and typecheck and lint on core are clean. The new tests fail on the previous code and pass with the fix. F4: a gate step must be able to fail only on its dependencies' results. Using only builtins is no longer enough. Your example script (
I tested 10 of the new rejected cases against the previous checker, and it accepted every one. A second test checks that common real gate forms still fold. One example is The shell reading now lives in two new files, F5: non-blocking checks are never listed as the cause. Before folding, I updated Not changed:
No preview, since nothing here is visual. Review digestRisk-tiered paths
Diff size: 7 files changed, +627/−147 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ncluding the existing checkRunHandler and non-blocking tests), and typecheck and lint on core are clean. The new tests fail on the previous code and pass with the fix.
I fixed F4 and F5. The CI-failure suites pass (237 tests, including the existing checkRunHandler and non-blocking tests), and typecheck and lint on core are clean. The new tests fail on the previous code and pass with the fix.
**F4: a gate step must be able to fail only on its dependencies' results.** Using only builtins is no longer enough. Your example script (`echo "${{ needs.build.result }}"` then `test -f dist/bundle.js`) is now treated as the aggregate's own failure, so the aggregate is listed separately with its evidence. A step counts as a gate only if all of these hold:
- **Tests:** every `test`, `[` and `[[` compares only values from the step's `env`, literals, variables set from those, or arguments to the script's own functions. Comparisons must be string or integer, so no `-f`, `-d` or `-s`, and unquoted globs and `~` are rejected.
- **Failure points:** `exit 1`, `return 1`, `false`, a call to a function that always fails, or `exit "$status"` after `status=1` must sit inside an `if` over such tests, or right after one via `&&`/`||`. Something like `echo "$BUILD"; exit 1` is not a gate.
- **Redirects:** output can go only to the step summary, `GITHUB_OUTPUT`, `GITHUB_ENV`, `/dev/null`, the standard streams or `>&N`. Reading input (`<`) is rejected.
- **Unsupported shell:** pipes, `&`, subshells, `set -u` and `shopt` are rejected.
- **Same flaw elsewhere:** a step with `working-directory` no longer counts as a gate, because a missing directory fails the step by itself.
I tested 10 of the new rejected cases against the previous checker, and it accepted every one. A second test checks that common real gate forms still fold. One example is `test "$R" = success || { echo ...; exit 1; }`; another is a `fail()` helper called after a test. The existing fold tests still pass, including the one built on this repo's own `Run Full Test Suite` gate with its coverage check removed.
The shell reading now lives in two new files, `ciFailureGateScript.ts` and `ciFailureShellLexer.ts`, so each file stays within the line and complexity limits.
**F5: non-blocking checks are never listed as the cause.** Before folding, `resolveFoldCauses` now checks each failed dependency against the repository's `nonBlockingChecks` patterns. If any one matches, the aggregate is reported on its own, exactly as before this PR. The filter sits in the one function both paths use, so it covers posting a new comment and adding to an existing one, and there is a test for each. The patterns are loaded only when a fold is possible. If the configuration can't be read, ProPR treats every check as blocking, as the webhook path already does; you can override the loader through a new `loadNonBlockingChecks` dependency.
I updated `docs/docs/features/pr-followup.md` for both rules.
**Not changed:**
- **`github` context in conditions:** tests may still compare `github` context values (for example `github.event_name`). So `[ "$EVENT" = push ] || exit 1` would still be read as a gate, even though it can fail regardless of the dependencies. It reads run metadata, not the job's own work, so I left it as the original design had it. Say if you want gates to require a dependency result in every failing condition.
- **Stricter in two ways:** `set -euo pipefail` and `[[ a && b ]]` with `&&` inside the brackets are now rejected, so such gates are listed separately rather than folded. `set -eo pipefail` still works.
No preview, since nothing here is visual.
PR: #3731
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
|
Scope change for this PR, from the author of issue #3726. It replaces the approach behind review findings F1 and F4 and any pending work on them. The PR now carries a shell lexer and a gate-script analyser ( Please change the PR as follows:
Tests: remove the fold and gate-script tests. Keep or add: one shard fails and the aggregate fails → both listed with evidence, aggregate after the shard with the dependency line; aggregate fails with no failed needed job → no line; unreadable or unparsable workflow → no line, order unchanged; ambiguous matrix mapping → no line; a non-blocking failed shard → not named. Update |
|
✅ Applied the requested follow-up changes in commit 1463976 Summary of ChangesThe PR no longer folds anything. A failed job that directly What changed
Tests (
With the reordering switched off, the two ordering tests fail, so they do test it. Two things you might trip over:
PR description (I couldn't update the PR body from here, so here is replacement text):
I made no preview, since this changes comment text, not a screen. Review digestRisk-tiered paths
Diff size: 12 files changed, +712/−1,739 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
… `needs` other jobs that failed in the same run is still listed with its own evidence. Its section gets one extra line, and it is listed after the jobs it depends on. The new tests and the existing CI-failure, comment and check-run suites pass (377 tests), and typecheck and lint on core are clean. The PR no longer folds anything. A failed job that directly `needs` other jobs that failed in the same run is still listed with its own evidence. Its section gets one extra line, and it is listed after the jobs it depends on. The new tests and the existing CI-failure, comment and check-run suites pass (377 tests), and typecheck and lint on core are clean. **What changed** - **Deleted:** `ciFailureShellLexer.ts`, `ciFailureGateScript.ts`, `ciFailureGateStep.ts`, `ciFailureAggregateFold.ts`, `ciFailureFoldCauses.ts` and `test/ciFailureAggregateFold.test.ts`. Nothing reads a step's `run` script any more, and nothing reports a failure on behalf of another check. - **New `ciFailureJobDependencies.ts`:** reads the job, the run attempt's job list and, only when another job in the run failed, the workflow file at the failing commit. It uses only each job's name, `needs`, matrix and `uses`. It gives up silently, adding no line and changing no order, when: - the workflow file can't be read or parsed. - the job list is incomplete. - the failed job's name doesn't map to exactly one job id. - a failed job that could be one of its `needs` maps to no id or to several (the matrix case). - **The dependency line:** "Depends on the failed job(s) above: `<names>`. It may have failed only because they did; check them first." It sits between the Run line and the failure evidence. Jobs the repository marked non-blocking are left out, and if none remain there is no line. - **Ordering:** if the dependent job is reported first and a job it needs is reported later, the later one is inserted before it in both the title and the sections. The commit line moves with the first section. Otherwise a new check is added at the end, as before. - **Unchanged:** each check keeps its own evidence block, dedupe marker and blocking handling. The follow-up prompt is the comment as first posted, so the agent sees the same order and line. There is a test for this. - **Docs:** `docs/docs/features/pr-followup.md` describes the behaviour above. **Tests** (`test/ciFailureJobDependencies.test.ts`, 17 tests, run on the repo's real `pr-test-on-label.yml`): - Shard fails, then the aggregate: both listed with evidence, the aggregate after the shard, with the line. - Aggregate first: the prompt has the line, and the shard reported later goes before it. - Aggregate fails but none of the jobs it needs failed: no line. When nothing else in the run failed, the workflow file isn't read at all. - Unreadable or unparsable workflow file: no line, order unchanged. - Ambiguous matrix name, or a failed job matching no id: no line. - Non-blocking failed shard: not named, and only blocking shards are named when both kinds failed. With the reordering switched off, the two ordering tests fail, so they do test it. **Two things you might trip over:** - If the aggregate is reported first, its line says "above" before the shard is listed. The follow-up prompt is taken from that first comment, so the agent gets the line naming the shard but not the shard's own section. - A shard ProPR judged to be a runner problem is still named in the aggregate's line, though it never appears in the comment. Only non-blocking checks are filtered, as you specified; I didn't add an infrastructure check for the shards it needs. **PR description** (I couldn't update the PR body from here, so here is replacement text): > Closes #3726. When a failed GitHub Actions job directly `needs` jobs that also failed in the same workflow run (for example `Run Full Test Suite` over a failed `Full Test Suite Shard 3/4`), the CI-failure comment still lists it with its own evidence and adds "Depends on the failed job(s) above: <names>. It may have failed only because they did; check them first." to its section. Dependent jobs are listed after the jobs they need; a needed job reported later is inserted before its dependent. Only job names and `needs` from the workflow file at the failing commit are read; step scripts are never interpreted. Non-blocking jobs are not named. If the workflow can't be read or parsed, or a name doesn't map to exactly one job id (matrix names), there is no line and no reordering. The follow-up prompt is the posted comment, so it gets the same order and line. New `packages/core/src/webhook/ciFailureJobDependencies.ts` and `test/ciFailureJobDependencies.test.ts`; the shell-analysis and fold modules are removed. I made no preview, since this changes comment text, not a screen. PR: #3731 Comment by: @integry (ID: 7003653067) Model: Claude Opus 5.5
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements the requested shift from folding failures to describing dependencies while preserving evidence. It needs a localized ordering correction before merge. ✅ Evidence preserved — Each reported check retains its own evidence section and dedupe marker; the new dependency logic does not interpret step scripts. ✅ Conservative fallback — Unreadable workflows, incomplete job listings, and ambiguous mappings return no relationship. Tests cover workflow failures, matrix ambiguity, and configured non-blocking checks. The supplied current-head status shows 23 passed checks, no failures, and one pending check. This review used static analysis only; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F6: 🔴 Insertion can reverse an existing dependency
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe implementation preserves evidence and handles uncertainty conservatively, but its ordering algorithm violates the requested behavior for a concrete dependency chain in this repository. The remaining correction is localized; current checks report no failures. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 11fec7c
Summary of ChangesI fixed F6. The order of checks in a merged CI-failure comment now follows every dependency between them, not only whether something already listed depends on the check that just arrived. In your example (aggregate, then runner selection, then the shard), the comment now lists runner selection, then the shard, then the aggregate. Each check keeps its evidence, its dependency line and its hidden marker. What changed (
Regression test (
Verification:
I found no other place with the same mistake: this function is the only one that changes the order of an existing comment, and a new comment only ever has one check. Review digestRisk-tiered paths
Diff size: 2 files changed, +80/−33 lines 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
|
On review finding F6 ("Insertion can reverse an existing dependency"): do not add section reordering to fix it. I am withdrawing the ordering requirement from my previous comment instead, because keeping dependency order across checks that arrive at different times means rewriting an existing comment's sections, which is not worth the risk here. Please make this small change and nothing else:
Please treat F6 as resolved by this change in the next review. |
…ent now follows every dependency between them, not only whether something already listed depends on the check that just arrived. In your example (aggregate, then runner selection, then the shard), the comment now lists runner selection, then the shard, then the aggregate. Each check keeps its evidence, its dependency line and its hidden marker. I fixed F6. The order of checks in a merged CI-failure comment now follows every dependency between them, not only whether something already listed depends on the check that just arrived. In your example (aggregate, then runner selection, then the shard), the comment now lists runner selection, then the shard, then the aggregate. Each check keeps its evidence, its dependency line and its hidden marker. **What changed** (`packages/core/src/webhook/ciFailureCommentGrouping.ts`): I replaced the insertion logic with a reorder of the whole comment each time a check is added: - Every listed section is read back, and the new check is added at the end. - For each section, the dependencies are the other listed checks its dependency line names. - Sections are placed one at a time: each step takes the earliest section whose dependencies are all already placed. Checks with no relation between them keep their arrival order. A dependency loop shouldn't happen in a valid workflow, but if it does, the earliest remaining section is taken. - The title is rebuilt in the new order, and the shared commit line moves to whichever section ends up first. - If the comment doesn't have the expected layout, the check is simply added at the end, as before. That includes a section whose check name can't be read back, or a title that doesn't match the listed checks. **Regression test** (`test/ciFailureJobDependencies.test.ts`): it runs on this repo's real workflow file, delivering the aggregate, then runner selection (`Select PR check runners`), then shard 3/4. It checks: - the order of the title and the sections. - that the commit line sits under runner selection, once. - that both dependency lines stay in their own sections. - that all three checks keep their evidence and markers. **Verification:** - The new test fails on the previous code and passes with the fix. - The CI-failure, comment-grouping, checkRunHandler, non-blocking and ultrafix-recovery suites pass (290 tests). - Typecheck and lint on core are clean. I found no other place with the same mistake: this function is the only one that changes the order of an existing comment, and a new comment only ever has one check. PR: #3731 Comment by: @propr-ultrafix (ID: 0) Model: Claude Opus 5.5
|
|
|
✅ Applied the requested follow-up changes in commit a66e6b0 Summary of ChangesI removed the reordering. Sections now stay in the order the checks were reported, the title and commit line are built as before this PR, and the dependency line no longer says "above". The CI-failure and check-run suites pass (226 tests, 0 failures), and typecheck and lint on core are clean.
I couldn't edit the PR description myself (ProPR has refused PR description edits in past sessions), so here is replacement text for its summary section:
F6 is resolved by this change. I made no preview, since only comment text and logic changed. Review digestRisk-tiered paths
Diff size: 5 files changed, +44/−124 lines 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…e checks were reported, the title and commit line are built as before this PR, and the dependency line no longer says "above". The CI-failure and check-run suites pass (226 tests, 0 failures), and typecheck and lint on core are clean. I removed the reordering. Sections now stay in the order the checks were reported, the title and commit line are built as before this PR, and the dependency line no longer says "above". The CI-failure and check-run suites pass (226 tests, 0 failures), and typecheck and lint on core are clean. - **No reordering:** I restored `ciFailureCommentGrouping.ts` to exactly its state before this PR, which removes the reordering in the existing-comment path. The new-comment path builds a single check's content the same way as before, so there was no reordering to remove there. The helper that read dependency lines back out of an existing comment had no other use, so I removed it too. - **Wording:** the line is now "Depends on the failed job(s): <names>. It may have failed only because they did; check them first." The follow-up prompt is the posted comment without its hidden markers, so it gets the same line. One test checks that the prompt doesn't contain "above". - **A dependency reported later:** the dependent section is not edited. One test reports the aggregate first and the shard after, and checks that the aggregate's section is unchanged in the merged comment. - **Tests** (`test/ciFailureJobDependencies.test.ts`): I removed the ordering assertions. The tests now check each section on its own: every failed job keeps its evidence and its hidden marker, and the line is in the dependent job's section and names only failed jobs it needs directly. They still check that a job marked non-blocking is not named, and that no line appears when the workflow file can't be read or parsed. - **Docs** (`docs/docs/features/pr-followup.md`): updated with the new wording, the arrival order, and what happens when a dependency is reported later. I couldn't edit the PR description myself (ProPR has refused PR description edits in past sessions), so here is replacement text for its summary section: > When a failed GitHub Actions job directly `needs` jobs that also failed in the same workflow run (for example the `Run Full Test Suite` aggregate over a failed shard), the job is still listed as a failure with its own evidence and marker. Its section adds one line: "Depends on the failed job(s): <names>. It may have failed only because they did; check them first." Only failed, blocking jobs it needs directly are named. Checks stay in the order they were reported, and the title and commit line are built as before. If a needed job's failure is reported after the dependent job's section already exists, it is added as its own section and the dependent section is not edited. The follow-up prompt carries the same line. ProPR reads only the job names and `needs` from the workflow file at the failing commit. If that file can't be read or parsed, or a name doesn't map to exactly one job, no line is added. F6 is resolved by this change. I made no preview, since only comment text and logic changed. PR: #3731 Comment by: @integry (ID: 7004316668) Model: Claude Opus 5.5
…hing for folding, reordering or step-script reading was added. One part is still open: I couldn't edit the PR description. I changed the wording only for F1. No code changed, and nothing for folding, reordering or step-script reading was added. One part is still open: I couldn't edit the PR description. - **`docs/docs/features/pr-followup.md`:** no change needed. The Auto CI follow-up paragraph already says what you listed: every failed job keeps its own evidence, the "Depends on the failed job(s): …" line, sections stay in reported order, and no line when the workflow can't be read or a name doesn't map to exactly one job. It doesn't claim folding anywhere. - **`CHANGELOG.md`:** the branch had no entry for #3726, so I added one under Unreleased → Fixed. It describes the dependency line with your exact wording. It says nothing is folded, dropped or reordered, that ProPR reads only job names and `needs`, never what the steps run, and that no line appears when the workflow can't be read or parsed or a name maps to more than one job. The line text matches `packages/core/src/webhook/ciFailureCommentText.ts:10-11`. - **PR description:** `gh pr edit` was refused with "Resource not accessible by integration". The #3726 entry still shows the issue's original title ("fold an aggregate job under the shard…"), with nothing saying folding was dropped. You can paste this sub-item under that line: > - Scope decision on #3731: nothing is folded. Every failed job keeps its own evidence section and marker. A failed job that directly `needs` another failed job gets the line "Depends on the failed job(s): <names>. It may have failed only because they did; check them first." Sections stay in the order the checks were reported. When the workflow cannot be read or a job name does not map to exactly one job, no line is added. I didn't make previews because the change is text in the changelog only. PR: #3730 Comment by: @integry (ID: 7008058774) Model: Claude Opus 5.5
AI Implementation Summary
Closes #3726
Branch:
3726/claude-opus-5-5-ci-failure-comment-fold-a-20261119-0646-x8dCommits: ✅ Changes committed (9fd2e25)
AI Processing Completed
Execution Details:
Summary:
The comment now lists the failed shard as the failure and mentions the aggregate job once as its consequence, with no evidence block of its own. The 15 new tests and the 132 existing CI-failure and comment tests pass, and typecheck and lint on core are clean. I didn't check that a new test fails with the fold logic removed.
How it decides. When a failed check comes in, ProPR reads the job's steps, the run's full list of jobs, and the workflow file at the run's head commit. The file is fetched once per run per comment, and not at all when nothing else in the run failed. An aggregate is folded only if all of these hold:
needsat least one job that failed in this run attempt.needs.<id>.resultfor one of those failed jobs.If anything can't be read, parsed or mapped, or the aggregate has another failed step, the job is listed as a separate failure, as before.
In the comment:
Full Test Suite Shard 3/4); it has no failure of its own." The title stays the same.The follow-up prompt is the comment body without its hidden markers, so it gets the same folded list; a test checks that.
Choices you may want to revisit:
Files:
packages/core/src/webhook/ciFailureAggregateFold.ts: workflow parsing, the pure fold decision, and the GitHub reads.packages/core/src/webhook/ciFailureCommentText.ts: the comment text helpers, moved out ofciFailureFollowup.tsto keep it under the 400-line lint limit.buildAnnotationExcerptis still exported from the old module.ciFailureFollowup.tsloads the fold and builds the folded comment;ciFailureCommentGrouping.tshas the edit for the "Also failed" line.test/ciFailureAggregateFold.test.ts, which runs on the realpr-test-on-label.ymland covers the four acceptance cases, plus ambiguous names, matrix names, both orders of arrival and the once-per-run file read.docs/docs/features/pr-followup.mdnow describes the folding.To run the suites here I needed
--experimental-test-module-mocksand writableGIT_CLONES_BASE_PATH/GIT_WORKTREES_BASE_PATH, because/tmp/git-processoris read-only in this container. I made no preview, since the change is comment text and logic rather than a screen.Review digest
Risk-tiered paths
packages/core/src/webhook/ciFailureAggregateFold.ts(added, +291/−0)packages/core/src/webhook/ciFailureCommentGrouping.ts(+13/−0)packages/core/src/webhook/ciFailureCommentText.ts(added, +105/−0)packages/core/src/webhook/ciFailureFollowup.ts(+93/−83)docs/docs/features/pr-followup.md(+1/−1)test/ciFailureAggregateFold.test.ts(added, +322/−0)Diff size: 6 files changed, +825/−84 lines
View task for the run's logs and conversation.
This PR was created automatically by ProPR after processing issue #3726.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!