aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/aflow/flow
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2026-01-22 14:36:25 +0100
committerDmitry Vyukov <dvyukov@google.com>2026-01-23 09:36:05 +0000
commit1aa92270bc0672eed4beb2d8d4556e9ee61d2cf2 (patch)
tree5b0f20ccf1b57dc9acaefa1eedb3e660ddb13c40 /pkg/aflow/flow
parent8fb0f8fb04f74e0c849fb8e2ae236419ceae6fcf (diff)
pkg/aflow: unexport Pipeline type
I've added NewPipeline constructor for a bit nicer syntax, but failed to use it in actual workflows. Unexport Pipeline and rename NewPipeline to Pipeline. This slightly improves workflows definition syntax.
Diffstat (limited to 'pkg/aflow/flow')
-rw-r--r--pkg/aflow/flow/assessment/kcsan.go36
-rw-r--r--pkg/aflow/flow/assessment/moderation.go38
-rw-r--r--pkg/aflow/flow/patching/patching.go68
3 files changed, 68 insertions, 74 deletions
diff --git a/pkg/aflow/flow/assessment/kcsan.go b/pkg/aflow/flow/assessment/kcsan.go
index 6bfc7bb12..27ef7e907 100644
--- a/pkg/aflow/flow/assessment/kcsan.go
+++ b/pkg/aflow/flow/assessment/kcsan.go
@@ -23,26 +23,24 @@ func init() {
ai.WorkflowAssessmentKCSAN,
"assess if a KCSAN report is about a benign race that only needs annotations or not",
&aflow.Flow{
- Root: &aflow.Pipeline{
- Actions: []aflow.Action{
- kernel.Checkout,
- kernel.Build,
- codesearcher.PrepareIndex,
- &aflow.LLMAgent{
- Name: "expert",
- Model: aflow.GoodBalancedModel,
- Reply: "Explanation",
- Outputs: aflow.LLMOutputs[struct {
- Confident bool `jsonschema:"If you are confident in the verdict of the analysis or not."`
- Benign bool `jsonschema:"If the data race is benign or not."`
- }](),
- Temperature: 1,
- Instruction: kcsanInstruction,
- Prompt: kcsanPrompt,
- Tools: codesearcher.Tools,
- },
+ Root: aflow.Pipeline(
+ kernel.Checkout,
+ kernel.Build,
+ codesearcher.PrepareIndex,
+ &aflow.LLMAgent{
+ Name: "expert",
+ Model: aflow.GoodBalancedModel,
+ Reply: "Explanation",
+ Outputs: aflow.LLMOutputs[struct {
+ Confident bool `jsonschema:"If you are confident in the verdict of the analysis or not."`
+ Benign bool `jsonschema:"If the data race is benign or not."`
+ }](),
+ Temperature: 1,
+ Instruction: kcsanInstruction,
+ Prompt: kcsanPrompt,
+ Tools: codesearcher.Tools,
},
- },
+ ),
},
)
}
diff --git a/pkg/aflow/flow/assessment/moderation.go b/pkg/aflow/flow/assessment/moderation.go
index b13ee1e7d..f5b7a4bfb 100644
--- a/pkg/aflow/flow/assessment/moderation.go
+++ b/pkg/aflow/flow/assessment/moderation.go
@@ -33,27 +33,25 @@ func init() {
ai.WorkflowModeration,
"assess if a bug report is consistent and actionable or not",
&aflow.Flow{
- Root: &aflow.Pipeline{
- Actions: []aflow.Action{
- aflow.NewFuncAction("extract-crash-type", extractCrashType),
- kernel.Checkout,
- kernel.Build,
- codesearcher.PrepareIndex,
- &aflow.LLMAgent{
- Name: "expert",
- Model: aflow.GoodBalancedModel,
- Reply: "Explanation",
- Outputs: aflow.LLMOutputs[struct {
- Confident bool `jsonschema:"If you are confident in the verdict of the analysis or not."`
- Actionable bool `jsonschema:"If the report is actionable or not."`
- }](),
- Temperature: 1,
- Instruction: moderationInstruction,
- Prompt: moderationPrompt,
- Tools: codesearcher.Tools,
- },
+ Root: aflow.Pipeline(
+ aflow.NewFuncAction("extract-crash-type", extractCrashType),
+ kernel.Checkout,
+ kernel.Build,
+ codesearcher.PrepareIndex,
+ &aflow.LLMAgent{
+ Name: "expert",
+ Model: aflow.GoodBalancedModel,
+ Reply: "Explanation",
+ Outputs: aflow.LLMOutputs[struct {
+ Confident bool `jsonschema:"If you are confident in the verdict of the analysis or not."`
+ Actionable bool `jsonschema:"If the report is actionable or not."`
+ }](),
+ Temperature: 1,
+ Instruction: moderationInstruction,
+ Prompt: moderationPrompt,
+ Tools: codesearcher.Tools,
},
- },
+ ),
},
)
}
diff --git a/pkg/aflow/flow/patching/patching.go b/pkg/aflow/flow/patching/patching.go
index a0b8d4a6c..9959e0bdb 100644
--- a/pkg/aflow/flow/patching/patching.go
+++ b/pkg/aflow/flow/patching/patching.go
@@ -45,42 +45,40 @@ func init() {
ai.WorkflowPatching,
"generate a kernel patch fixing a provided bug reproducer",
&aflow.Flow{
- Root: &aflow.Pipeline{
- Actions: []aflow.Action{
- baseCommitPicker,
- kernel.Checkout,
- kernel.Build,
- // Ensure we can reproduce the crash (and the build boots).
- crash.Reproduce,
- codesearcher.PrepareIndex,
- &aflow.LLMAgent{
- Name: "debugger",
- Model: aflow.BestExpensiveModel,
- Reply: "BugExplanation",
- Temperature: 1,
- Instruction: debuggingInstruction,
- Prompt: debuggingPrompt,
- Tools: tools,
- },
- &aflow.LLMAgent{
- Name: "diff-generator",
- Model: aflow.BestExpensiveModel,
- Reply: "PatchDiff",
- Temperature: 1,
- Instruction: diffInstruction,
- Prompt: diffPrompt,
- Tools: tools,
- },
- &aflow.LLMAgent{
- Name: "description-generator",
- Model: aflow.BestExpensiveModel,
- Reply: "PatchDescription",
- Temperature: 1,
- Instruction: descriptionInstruction,
- Prompt: descriptionPrompt,
- },
+ Root: aflow.Pipeline(
+ baseCommitPicker,
+ kernel.Checkout,
+ kernel.Build,
+ // Ensure we can reproduce the crash (and the build boots).
+ crash.Reproduce,
+ codesearcher.PrepareIndex,
+ &aflow.LLMAgent{
+ Name: "debugger",
+ Model: aflow.BestExpensiveModel,
+ Reply: "BugExplanation",
+ Temperature: 1,
+ Instruction: debuggingInstruction,
+ Prompt: debuggingPrompt,
+ Tools: tools,
},
- },
+ &aflow.LLMAgent{
+ Name: "diff-generator",
+ Model: aflow.BestExpensiveModel,
+ Reply: "PatchDiff",
+ Temperature: 1,
+ Instruction: diffInstruction,
+ Prompt: diffPrompt,
+ Tools: tools,
+ },
+ &aflow.LLMAgent{
+ Name: "description-generator",
+ Model: aflow.BestExpensiveModel,
+ Reply: "PatchDescription",
+ Temperature: 1,
+ Instruction: descriptionInstruction,
+ Prompt: descriptionPrompt,
+ },
+ ),
},
)
}