Skip to content

[3726 by Claude Opus 5.5] CI-failure comment: fold an aggregate job under the shard that made it fail - #3731

Merged
integry merged 6 commits into
3725-epic-0-9-0wsfrom
3726/claude-opus-5-5-ci-failure-comment-fold-a-20261119-0646-x8d
Nov 19, 2026
Merged

integry merged 6 commits into
3725-epic-0-9-0wsfrom
3726/claude-opus-5-5-ci-failure-comment-fold-a-20261119-0646-x8d

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3726

Branch: 3726/claude-opus-5-5-ci-failure-comment-fold-a-20261119-0646-x8d
Commits: ✅ 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:

  • 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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (4 files)
    • 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)
  • Low risk (2 files)
    • 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!

…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.
@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=3
Triggered automatically by the requested execution settings.

@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 3)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Result references do not prove gate-only behavior

  • Category: correctness

  • Required behavior: Folding must preserve failures originating in the aggregate itself and only remove evidence when the job solely reports dependency failures.

  • Evidence: packages/core/src/webhook/ciFailureAggregateFold.ts:onlyGateStepsFailed, readsNeededResult

    1. A job needs a failed build job and runs under always().
    2. Its named step has env: { BUILD_RESULT: "${{ needs.build.result }}" } and runs its own tests, which fail.
    3. readsNeededResult matches the environment expression. Because that named step is the only failed step, onlyGateStepsFailed approves folding.
    4. The comment removes the job’s test evidence and asserts that it “has no failure of its own,” leaving the agent without the independent failure.

    static trace: The predicate searches the serialized definition for any result reference; it never distinguishes result enforcement from test execution, logging, or conditional execution. Unique step names and successful workflow parsing do not establish that distinction. Existing tests cover an independent failure in a separate step, not within a result-referencing step.

  • Minimum fix: Require positive evidence that the failed step only enforces dependency results; retain separate reporting for mixed or unrecognized steps. Add a regression for a result-referencing step that runs and fails its own tests.

F2: 🔴 Existing comments can omit the failed causes

  • Category: correctness

  • Required behavior: A folded comment must list the failed dependencies as failures with their evidence, regardless of which other check first created the same-head comment.

  • Evidence: packages/core/src/webhook/ciFailureFollowup.ts:reportClaimedFailure, packages/core/src/webhook/ciFailureCommentGrouping.ts:appendAggregateToCiFailureComment

    1. An unrelated Lint failure creates the same-head comment.
    2. The aggregate arrives before its failed shard’s delivery, or recovery processes the aggregate after finding that comment.
    3. scan.sameHead selects the existing comment. The folding branch appends only the consequence line and aggregate marker; it never calls loadCauseChecks or checks whether the shard is already reported.
    4. The resulting title and evidence contain only Lint; the shard appears solely as a name in the consequence sentence, with no failure output or run link.

    static trace: Same-head matching proves only that some failure was reported for the commit. It does not establish that the fold’s causes were reported. A later shard delivery can repair the omission, but the aggregate handling itself finishes successfully without the evidence already available to it. Existing arrival-order tests use either the actual shard’s comment or no comment, so neither exercises this branch with an unrelated existing failure.

  • Minimum fix: Check each cause’s dedupe marker and append missing cause sections and markers before adding the aggregate consequence line. Preserve already-reported causes without duplicating them.

F3: 🔴 Folded infrastructure failures suppress later code failures

  • Category: correctness

  • Required behavior: Infrastructure-only failures must remain unclaimed so a genuine failure of the same check on a later attempt can trigger follow-up.

  • Evidence: packages/core/src/webhook/ciFailureFollowup.ts:loadCauseChecks, buildFoldedCiFailureComment

    1. A shard fails solely because its runner disappears; its own delivery returns infrastructure without claiming it.
    2. Its aggregate fails the result gate and is folded while no same-head comment exists.
    3. loadCauseChecks loads the shard’s evidence without applying infrastructure classification. buildFoldedCiFailureComment writes the shard’s durable dedupe marker into the new comment.
    4. A manual rerun on the same commit now fails a real test. Its delivery passes infrastructure classification, but the comment scan finds that shard marker and returns duplicate, suppressing the new code-failure report.

    static trace: Dedupe keys contain the commit and source name, not the attempt. The infrastructure guard runs only for the incoming aggregate; it does not protect synthesized causes. Before this change, reporting the aggregate did not create a marker for the infrastructure-only shard. The existing aggregate-first test asserts unconditional cause deduplication and does not cover this classification transition.

  • Minimum fix: Classify synthesized causes before treating them as reported code failures. Do not write a code-failure dedupe marker for an infrastructure-only cause; preserve reporting eligibility for a later genuine failure. Test the infrastructure-failure → aggregate → genuine-rerun sequence.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 52s
  • Tokens: 61,349 (59,891 in / 1,458 out)
  • Cost: $0.56

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 F3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit ad7463e

Addressed 1 AI review comment (IDs: 7002268894)

Addressed findings F1, F2, F3

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (4 files)
    • packages/core/src/webhook/ciFailureAggregateFold.ts (+9/−12)
    • packages/core/src/webhook/ciFailureFoldCauses.ts (added, +155/−0)
    • packages/core/src/webhook/ciFailureFollowup.ts (+35/−83)
    • packages/core/src/webhook/ciFailureGateStep.ts (added, +222/−0)
  • Low risk (2 files)
    • docs/docs/features/pr-followup.md (+1/−1)
    • test/ciFailureAggregateFold.test.ts (+160/−3)

Diff size: 6 files changed, +582/−99 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 13m 24s
  • Tokens: 4,595,603 (4,548,977 in / 46,626 out)
  • Cost: $2.47

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 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
@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F4: 🔴 Builtin-only scripts can contain independent failures

  • Category: correctness

  • Required behavior: Fold an aggregate only when its failed steps exclusively enforce needed-job results; preserve its independent failures and evidence.

  • Evidence: packages/core/src/webhook/ciFailureGateStep.ts:isGateStep, runsNoProgram, and commandIsBuiltin; packages/core/src/webhook/ciFailureAggregateFold.ts:onlyGateStepsFailed

    1. A job needs a failed build job and runs a named validation step containing echo "${{ needs.build.result }}" followed by test -f dist/bundle.js.
    2. The file is missing, so this step fails its own artifact validation. Its reference to the dependency merely prints that dependency’s result.
    3. expressionReferences finds the failed dependency, and runsNoProgram accepts both echo and test. Consequently, isGateStep returns true.
    4. When this is the only failed step, the aggregate is folded. Its evidence disappears, and the comment asserts that it “has no failure of its own,” concealing the missing artifact.

    static trace: The supplied implementation checks command names and the presence of a dependency reference, but never establishes that the failing condition depends exclusively on those results. Unique step-name matching and complete job listings do not close this gap. The new mixed-step tests reject external programs and steps.* expressions, but do not cover independent validations performed with allowed builtins.

  • Minimum fix: Restrict folding to recognized result-enforcement patterns whose failure conditions are attributable to needed-job results; reject independent file checks and other unproven conditions. Add a regression for the script above.

F5: 🔴 Folded causes bypass non-blocking filtering

  • Category: correctness

  • Required behavior: Checks configured as non-blocking must not be promoted into automatic code-failure instructions through the new folding path.

  • Evidence: packages/core/src/webhook/ciFailureFoldCauses.ts:resolveFoldCauses; packages/core/src/webhook/ciFailureFollowup.ts:reportClaimedFailure and buildFoldedCiFailureComment

    1. A repository marks a dependency check as non-blocking but leaves its aggregate check blocking. That dependency fails, followed by the aggregate’s result-enforcement step.
    2. The dependency’s own webhook and recovery paths exclude it through their existing non-blocking filters. The aggregate remains eligible for reporting.
    3. Aggregate detection returns the excluded dependency as a cause. resolveFoldCauses checks only existing markers and infrastructure classification; it never applies the repository’s non-blocking configuration.
    4. With no existing comment, buildFoldedCiFailureComment posts “Please investigate and fix this CI failure” naming the excluded dependency and includes its evidence. The comment starts follow-up work targeting the check the user excluded. The existing-comment path similarly adds it as an actionable failure.

    static trace: Both supplied callers filter only the incoming check before invoking postCiFailureFollowup; neither can filter causes discovered afterward. Infrastructure classification does not implement the non-blocking policy. Previously, this delivery reported the eligible aggregate itself; the PR newly substitutes an excluded check into the repair instruction.

  • Minimum fix: Apply the repository’s existing non-blocking matcher to discovered causes before constructing reports. If folding would require reporting an excluded cause, retain the aggregate’s standalone report. Cover both new-comment and existing-comment paths.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise folded fallback paths

Add 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 foldCauseCheck. This is optional additional coverage; no defect in that fallback was established.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 51s
  • Tokens: 68,508 (67,030 in / 1,478 out)
  • Cost: $0.64

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F4 F5 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 92c2b9d

Addressed 1 AI review comment (IDs: 7002963168)

Addressed findings F4, F5

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (5 files)
    • packages/core/src/webhook/ciFailureFoldCauses.ts (+15/−4)
    • packages/core/src/webhook/ciFailureFollowup.ts (+10/−4)
    • packages/core/src/webhook/ciFailureGateScript.ts (added, +379/−0)
    • packages/core/src/webhook/ciFailureGateStep.ts (+10/−137)
    • packages/core/src/webhook/ciFailureShellLexer.ts (added, +127/−0)
  • Low risk (2 files)
    • docs/docs/features/pr-followup.md (+1/−1)
    • test/ciFailureAggregateFold.test.ts (+85/−1)

Diff size: 7 files changed, +627/−147 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 12m 59s
  • Tokens: 3,164,032 (3,106,338 in / 57,694 out)
  • Cost: $2.41

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 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
@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

integry commented Nov 19, 2026

Copy link
Copy Markdown
Owner

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 (ciFailureShellLexer.ts, ciFailureGateScript.ts, ciFailureGateStep.ts, about 600 lines) to prove that an aggregate job's failed step only checks its needs results, so that the aggregate's evidence can be dropped. Analysing arbitrary shell in the webhook path is more risk and maintenance than this comment improvement is worth, and each review finds another script shape it misjudges. Stop trying to prove it. Never drop evidence.

Please change the PR as follows:

  1. Delete the shell analysis. Remove ciFailureShellLexer.ts, ciFailureGateScript.ts, ciFailureGateStep.ts and their tests. Nothing in the PR may parse or interpret a step's run script.
  2. Relate, do not fold. Keep reading the workflow file at the failing commit and its jobs.<id>.needs. When a failed job needs (directly) one or more jobs that also failed in the same workflow run, the comment still lists that job as a failure with its own evidence, exactly as today, and adds one line to its section: "Depends on the failed job(s) above: . It may have failed only because they did; check them first." List such dependent jobs after the jobs they depend on.
  3. Same information for the follow-up agent. The CI-failure follow-up prompt gets the same ordering and the same line, so the agent starts with the shards.
  4. Nothing else changes. Each failed check keeps its own evidence block, its own dedupe marker and its own blocking/non-blocking handling; a non-blocking cause is only named in the dependency line if it would have been reported anyway, otherwise leave the line out for that cause (this is what F5 asked for). No cause is "synthesised" or reported on behalf of another check, so the paths behind F2 and F3 go away: remove ciFailureFoldCauses.ts if nothing else needs it.
  5. Fall back silently. If the workflow file cannot be read or parsed, or a job name cannot be mapped to a job id unambiguously (matrix names), add no dependency line and change no ordering.

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 docs/docs/features/pr-followup.md and the PR description to describe this behaviour.

@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 1463976

Summary of Changes

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: . 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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (9 files)
    • packages/core/src/webhook/ciFailureAggregateFold.ts (deleted, +0/−288)
    • packages/core/src/webhook/ciFailureCommentGrouping.ts (+62/−22)
    • packages/core/src/webhook/ciFailureCommentText.ts (+31/−13)
    • packages/core/src/webhook/ciFailureFoldCauses.ts (deleted, +0/−166)
    • packages/core/src/webhook/ciFailureFollowup.ts (+76/−85)
    • packages/core/src/webhook/ciFailureGateScript.ts (deleted, +0/−379)
    • packages/core/src/webhook/ciFailureGateStep.ts (deleted, +0/−95)
    • packages/core/src/webhook/ciFailureJobDependencies.ts (added, +208/−0)
    • packages/core/src/webhook/ciFailureShellLexer.ts (deleted, +0/−127)
  • Low risk (3 files)
    • docs/docs/features/pr-followup.md (+1/−1)
    • test/ciFailureAggregateFold.test.ts (deleted, +0/−563)
    • test/ciFailureJobDependencies.test.ts (added, +334/−0)

Diff size: 12 files changed, +712/−1,739 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 9m 6s
  • Tokens: 2,681,119 (2,645,891 in / 35,228 out)
  • Cost: $1.82

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7003653067✓

… `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
@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The 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 blockers

Every finding below was introduced by this PR and must be resolved before merging.

F6: 🔴 Insertion can reverse an existing dependency

  • Category: correctness

  • Required behavior: “List such dependent jobs after the jobs they depend on.” This must hold across all reported dependencies, including chains delivered out of order.

  • Evidence: packages/core/src/webhook/ciFailureCommentGrouping.ts, insertBeforeDependent — insertion considers existing dependents of the arriving check but ignores its own prerequisites.

    1. In the supplied workflow, runner selection (route), a shard, and the aggregate all fail. The shard directly needs runner selection; the aggregate directly needs the shard.
    2. The aggregate webhook arrives first. Its section names the shard as a dependency, but correctly does not name runner selection because that dependency is indirect.
    3. Runner selection arrives second. No existing section directly names it, so it is appended: aggregate, runner selection.
    4. The shard arrives third, carrying a dependency line naming runner selection. insertBeforeDependent finds the aggregate and inserts the shard before it without examining the shard’s own dependency line.
    5. The resulting title and sections are ordered shard, aggregate, runner selection. The shard now tells readers to inspect a failed job “above” that is actually below it.

    static trace: This follows directly from sections.findIndex(...), sections.splice(dependentAt, 0, section), and the append fallback. The supplied workflow establishes both dependency edges. Existing tests exercise independent shards and two-job ordering, but not this three-job chain. Dedupe and mapping checks do not repair section ordering.

  • Minimum fix: Reorder the reported sections using all their known dependency relationships, preserving unrelated arrival order where possible, and rebuild the title and shared commit-line placement accordingly. Add a regression for aggregate → runner selection → shard arrival, asserting runner selection → shard → aggregate with all evidence and markers retained.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The 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

  • Model: GPT-6 Astra
  • Time: 42s
  • Tokens: 63,160 (62,140 in / 1,020 out)
  • Cost: $0.56

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F6

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 11fec7c

Addressed 1 AI review comment (IDs: 7004310485)

Addressed finding F6

Summary of Changes

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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/core/src/webhook/ciFailureCommentGrouping.ts (+51/−33)
  • Low risk (1 file)
    • test/ciFailureJobDependencies.test.ts (+29/−0)

Diff size: 2 files changed, +80/−33 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 22s
  • Tokens: 594,468 (587,793 in / 6,675 out)
  • Cost: $0.52

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

integry commented Nov 19, 2026

Copy link
Copy Markdown
Owner

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:

  1. No reordering at all. Remove the code that places a dependent job's section after the jobs it depends on, in both the new-comment and the existing-comment paths. Sections stay in the order the checks were reported, exactly as before this PR. The title and the shared commit line are built as before this PR.
  2. Wording. The dependency line must not say "above". Use: "Depends on the failed job(s): . It may have failed only because they did; check them first." The same line goes into the follow-up prompt.
  3. A dependency reported later. When a needed job's failure is reported after the dependent job's section already exists, the dependent section is not edited; it simply has no line, or keeps the line it had. That is acceptable.
  4. Tests: remove ordering assertions; keep the assertions that every failed job keeps its evidence and marker and that the line names only failed needed jobs. Update docs/docs/features/pr-followup.md and the PR description to match.

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
@propr-dev

propr-dev Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

⚠️ Ultrafix stopped before reaching its goal. Requested goal: 8/10. Last score: 6/10. Stopped in cycle 3 of 3. Max cycles were exhausted, so manual review and merge are now required.

@propr-dev propr-dev Bot removed the ultrafix label Nov 19, 2026
@propr-dev

propr-dev Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit a66e6b0

Summary of Changes

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): . 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): . 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.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (3 files)
    • packages/core/src/webhook/ciFailureCommentGrouping.ts (+13/−84)
    • packages/core/src/webhook/ciFailureCommentText.ts (+1/−9)
    • packages/core/src/webhook/ciFailureFollowup.ts (+0/−1)
  • Low risk (2 files)
    • docs/docs/features/pr-followup.md (+1/−1)
    • test/ciFailureJobDependencies.test.ts (+29/−29)

Diff size: 5 files changed, +44/−124 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 5m 5s
  • Tokens: 916,202 (907,930 in / 8,272 out)
  • Cost: $0.66

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 7004316668✓

…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
@integry
integry merged commit ddb0a5e into 3725-epic-0-9-0ws Nov 19, 2026
41 checks passed
@propr-dev propr-dev Bot changed the title 🔨 [3726 by Claude Opus 5.5] CI-failure comment: fold an aggregate job under the shard that made it fail [3726 by Claude Opus 5.5] CI-failure comment: fold an aggregate job under the shard that made it fail Nov 19, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 19, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant