Skip to content

pkg/aflow: initial version of patch-iteration agent#7081

Merged
a-nogikh merged 6 commits intogoogle:masterfrom
a-nogikh:features/patching-iteration-workflow
Apr 28, 2026
Merged

pkg/aflow: initial version of patch-iteration agent#7081
a-nogikh merged 6 commits intogoogle:masterfrom
a-nogikh:features/patching-iteration-workflow

Conversation

@a-nogikh
Copy link
Copy Markdown
Collaborator

This PR follows up on #7047, but the code changes are independent from it.

Add a workflow to iterate on the patch candidate.

The workflow executes the following high-level pipeline:

  1. Verdict: Analyzes the new comments to decide if they require a new code revision or just a textual reply.
  2. Patch Generation: If a code change is needed, reapplies the previous patch to a clean kernel tree, instructs the LLM to modify it to address the feedback, and generates a new changelog.
  3. Triage: Evaluates each individual comment to decide whether it requires a direct reply.
  4. Aggregation: Aggregates the generated replies and outputs them along with the V+1 patch.

Note The input/output data of this workflow are more complex than in other cases, so the PR also includes the changes to the pkg/aflow framework, specifically to permit nested structures and arrays in the input.

One limitation of the current implementation: it does not track the usage of nested fields. It probably should?

@a-nogikh a-nogikh force-pushed the features/patching-iteration-workflow branch 2 times, most recently from 7d68450 to adfb0cd Compare April 16, 2026 14:58
@a-nogikh a-nogikh added the AI patching Feature requests and bugs related to AI-based kernel bug fix generation. label Apr 16, 2026
@a-nogikh a-nogikh force-pushed the features/patching-iteration-workflow branch 4 times, most recently from 6f64d62 to 8378939 Compare April 16, 2026 20:29
@a-nogikh a-nogikh marked this pull request as ready for review April 17, 2026 06:20
@a-nogikh a-nogikh requested a review from dvyukov April 17, 2026 06:20
@a-nogikh a-nogikh force-pushed the features/patching-iteration-workflow branch 2 times, most recently from a9dcf84 to cd173a8 Compare April 17, 2026 09:35
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
Comment thread pkg/aflow/ai/ai.go Outdated
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
Comment thread pkg/aflow/flow/patching/iteration.go
Comment thread pkg/aflow/flow/patching/iteration.go
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
Comment thread pkg/aflow/ai/ai.go
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
@a-nogikh a-nogikh force-pushed the features/patching-iteration-workflow branch 2 times, most recently from db1fe1a to f37a2be Compare April 20, 2026 11:57
@a-nogikh
Copy link
Copy Markdown
Collaborator Author

PTAL

@a-nogikh a-nogikh requested a review from dvyukov April 20, 2026 14:28
@tarasmadan tarasmadan force-pushed the features/patching-iteration-workflow branch from f37a2be to 2d5da18 Compare April 24, 2026 08:13
Comment thread pkg/aflow/cond.go Outdated
Comment thread pkg/aflow/loop_test.go
Comment thread pkg/aflow/cond_test.go Outdated
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
Comment thread pkg/aflow/flow/patching/iteration.go Outdated
@a-nogikh a-nogikh force-pushed the features/patching-iteration-workflow branch from 2d5da18 to b885f50 Compare April 27, 2026 20:06
Log trajectory.
Fill in variables in the false path.
Improve verification.
The operator will let workflows iterate over an array and do processing
for each item separately.
This will be necessary to let workflows take / produce more complex
inputs.
The patching workflow was previously only capable of generating the initial
V1 patch. Add a new `patch-iteration` workflow that automatically addresses
reviewer feedback on generated patches.

The workflow executes the following high-level pipeline:
1. Verdict: Analyzes the new comments to decide if they require a new code
   revision, or just a textual reply.
2. Patch Generation: If a code change is needed, reapplies the previous
   patch to a clean kernel tree, instructs the LLM to modify it to
   address the feedback, and generates a new changelog.
3. Triage: Evaluates each individual comment to decide whether it requires
   a direct reply.
4. Aggregation: Aggregates the generated replies and outputs them along
   with the (possible) V+1 patch.
@a-nogikh a-nogikh force-pushed the features/patching-iteration-workflow branch from b885f50 to 6d0af67 Compare April 28, 2026 07:39
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

❌ Patch coverage is 73.10127% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.6%. Comparing base (ce74135) to head (0ef560b).
⚠️ Report is 18 commits behind head on master.

Files with missing lines Patch % Lines
pkg/aflow/flow/patching/iteration.go 70.2% 31 Missing ⚠️
pkg/aflow/schema.go 73.2% 8 Missing and 7 partials ⚠️
pkg/aflow/flow/patching/actions.go 0.0% 12 Missing ⚠️
pkg/aflow/loop.go 81.8% 6 Missing and 6 partials ⚠️
pkg/aflow/template.go 20.0% 8 Missing ⚠️
pkg/aflow/if.go 80.6% 5 Missing and 2 partials ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
pkg/aflow/execute.go 41.7% <100.0%> (+0.8%) ⬆️
pkg/aflow/flow.go 75.7% <100.0%> (+0.7%) ⬆️
pkg/aflow/flow/patching/patching.go 100.0% <100.0%> (ø)
pkg/aflow/flow/reproc/reproc.go 84.7% <100.0%> (ø)
pkg/aflow/if.go 78.4% <80.6%> (+78.4%) ⬆️
pkg/aflow/template.go 72.2% <20.0%> (-5.9%) ⬇️
pkg/aflow/flow/patching/actions.go 0.0% <0.0%> (ø)
pkg/aflow/loop.go 82.3% <81.8%> (-0.7%) ⬇️
pkg/aflow/schema.go 78.8% <73.2%> (-6.5%) ⬇️
pkg/aflow/flow/patching/iteration.go 70.2% <70.2%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

It should not distort comments as much as html escaping does.
@a-nogikh
Copy link
Copy Markdown
Collaborator Author

Pushed JSON escaping as a separate commit so that it's easier to see the diff.

@a-nogikh a-nogikh requested a review from dvyukov April 28, 2026 08:21
@a-nogikh a-nogikh enabled auto-merge April 28, 2026 11:44
@a-nogikh a-nogikh added this pull request to the merge queue Apr 28, 2026
Merged via the queue into google:master with commit 15d8aa1 Apr 28, 2026
19 checks passed
@a-nogikh a-nogikh deleted the features/patching-iteration-workflow branch April 28, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI patching Feature requests and bugs related to AI-based kernel bug fix generation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants