agentweaver 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile.codex +56 -0
- package/README.md +38 -15
- package/dist/artifacts.js +38 -8
- package/dist/executors/configs/fetch-gitlab-review-config.js +3 -0
- package/dist/executors/fetch-gitlab-review-executor.js +25 -0
- package/dist/flow-state.js +134 -0
- package/dist/gitlab.js +153 -0
- package/dist/index.js +397 -250
- package/dist/interactive-ui.js +170 -42
- package/dist/pipeline/declarative-flow-runner.js +28 -0
- package/dist/pipeline/flow-specs/auto.json +530 -392
- package/dist/pipeline/flow-specs/bug-analyze.json +149 -0
- package/dist/pipeline/flow-specs/gitlab-review.json +347 -0
- package/dist/pipeline/flow-specs/implement.json +0 -9
- package/dist/pipeline/flow-specs/plan.json +133 -0
- package/dist/pipeline/flow-specs/review-fix.json +2 -11
- package/dist/pipeline/flow-specs/review-project.json +243 -0
- package/dist/pipeline/flow-specs/run-go-linter-loop.json +155 -0
- package/dist/pipeline/flow-specs/run-go-tests-loop.json +155 -0
- package/dist/pipeline/flow-specs/run-linter-loop.json +17 -11
- package/dist/pipeline/flow-specs/run-tests-loop.json +17 -11
- package/dist/pipeline/flow-specs/task-describe.json +25 -0
- package/dist/pipeline/node-registry.js +28 -1
- package/dist/pipeline/nodes/fetch-gitlab-review-node.js +34 -0
- package/dist/pipeline/nodes/gitlab-review-artifacts-node.js +105 -0
- package/dist/pipeline/nodes/jira-issue-check-node.js +53 -0
- package/dist/pipeline/nodes/local-script-check-node.js +81 -0
- package/dist/pipeline/nodes/review-findings-form-node.js +14 -14
- package/dist/pipeline/prompt-registry.js +5 -5
- package/dist/pipeline/registry.js +2 -0
- package/dist/pipeline/value-resolver.js +7 -1
- package/dist/prompts.js +11 -4
- package/dist/scope.js +118 -0
- package/dist/structured-artifacts.js +33 -0
- package/docker-compose.yml +445 -0
- package/package.json +8 -3
- package/run_go_coverage.sh +113 -0
- package/run_go_linter.sh +89 -0
- package/run_go_tests.sh +83 -0
- package/verify_build.sh +105 -0
- package/dist/executors/claude-summary-executor.js +0 -31
- package/dist/executors/configs/claude-summary-config.js +0 -8
- package/dist/pipeline/flow-runner.js +0 -13
- package/dist/pipeline/flow-specs/test-fix.json +0 -24
- package/dist/pipeline/flow-specs/test-linter-fix.json +0 -24
- package/dist/pipeline/flow-specs/test.json +0 -19
- package/dist/pipeline/flow-types.js +0 -1
- package/dist/pipeline/flows/implement-flow.js +0 -47
- package/dist/pipeline/flows/plan-flow.js +0 -42
- package/dist/pipeline/flows/review-fix-flow.js +0 -62
- package/dist/pipeline/flows/review-flow.js +0 -124
- package/dist/pipeline/flows/test-fix-flow.js +0 -12
- package/dist/pipeline/flows/test-flow.js +0 -32
- package/dist/pipeline/nodes/claude-summary-node.js +0 -38
- package/dist/pipeline/nodes/implement-codex-node.js +0 -16
- package/dist/pipeline/nodes/task-summary-node.js +0 -42
package/run_go_linter.sh
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT_DIR="${VERIFY_BUILD_ROOT_DIR:-$(pwd)}"
|
|
6
|
+
|
|
7
|
+
log() {
|
|
8
|
+
printf '%s\n' "$*" >&2
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
details_json() {
|
|
12
|
+
local template="${@: -1}"
|
|
13
|
+
local argc=$#
|
|
14
|
+
local jq_args=()
|
|
15
|
+
if (( argc > 1 )); then
|
|
16
|
+
jq_args=("${@:1:argc-1}")
|
|
17
|
+
fi
|
|
18
|
+
if command -v jq >/dev/null 2>&1; then
|
|
19
|
+
jq -cn "${jq_args[@]}" "$template"
|
|
20
|
+
else
|
|
21
|
+
printf '{}'
|
|
22
|
+
fi
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
emit_result() {
|
|
26
|
+
local ok="$1"
|
|
27
|
+
local kind="$2"
|
|
28
|
+
local stage="$3"
|
|
29
|
+
local exit_code="$4"
|
|
30
|
+
local summary="$5"
|
|
31
|
+
local command="$6"
|
|
32
|
+
local details_json="${7:-{}}"
|
|
33
|
+
|
|
34
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
35
|
+
printf '{"ok":%s,"kind":"%s","stage":"%s","exitCode":%s,"summary":"%s","command":"%s","details":{"error":"jq is required for structured output"}}\n' \
|
|
36
|
+
"$ok" "$kind" "$stage" "$exit_code" "$summary" "$command"
|
|
37
|
+
return
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
jq -cn \
|
|
41
|
+
--arg ok "$ok" \
|
|
42
|
+
--arg kind "$kind" \
|
|
43
|
+
--arg stage "$stage" \
|
|
44
|
+
--arg exitCode "$exit_code" \
|
|
45
|
+
--arg summary "$summary" \
|
|
46
|
+
--arg command "$command" \
|
|
47
|
+
--arg details "$details_json" \
|
|
48
|
+
'{
|
|
49
|
+
ok: ($ok == "true"),
|
|
50
|
+
kind: $kind,
|
|
51
|
+
stage: $stage,
|
|
52
|
+
exitCode: ($exitCode | tonumber),
|
|
53
|
+
summary: $summary,
|
|
54
|
+
command: $command,
|
|
55
|
+
details: ($details | fromjson? // {raw: $details})
|
|
56
|
+
}'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
fail() {
|
|
60
|
+
local exit_code="$1"
|
|
61
|
+
local summary="$2"
|
|
62
|
+
local command="$3"
|
|
63
|
+
local details_json="${4:-{}}"
|
|
64
|
+
|
|
65
|
+
emit_result false "linter" "run_go_linter" "$exit_code" "$summary" "$command" "$details_json"
|
|
66
|
+
exit "$exit_code"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
require_cmd() {
|
|
70
|
+
if ! command -v "$1" >/dev/null 2>&1; then
|
|
71
|
+
fail 2 "Missing required command: $1" "$1" "$(details_json --arg failedStep "require_cmd" --arg missingCommand "$1" '{failedStep: $failedStep, missingCommand: $missingCommand}')"
|
|
72
|
+
fi
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
require_cmd go
|
|
76
|
+
require_cmd golangci-lint
|
|
77
|
+
cd "$ROOT_DIR"
|
|
78
|
+
|
|
79
|
+
log "==> Generating code (go generate ./...)"
|
|
80
|
+
if ! go generate ./... >&2; then
|
|
81
|
+
fail 1 "go generate failed" "go generate ./..." '{"failedStep":"go-generate"}'
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
log "==> Running linter (golangci-lint run)"
|
|
85
|
+
if ! golangci-lint run >&2; then
|
|
86
|
+
fail 1 "golangci-lint failed" "golangci-lint run" '{"failedStep":"golangci-lint"}'
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
emit_result true "linter" "run_go_linter" 0 "Linter checks passed" "go generate ./... && golangci-lint run" "$(details_json '{steps:["go-generate","golangci-lint"]}')"
|
package/run_go_tests.sh
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT_DIR="${VERIFY_BUILD_ROOT_DIR:-$(pwd)}"
|
|
6
|
+
|
|
7
|
+
log() {
|
|
8
|
+
printf '%s\n' "$*" >&2
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
details_json() {
|
|
12
|
+
local template="${@: -1}"
|
|
13
|
+
local argc=$#
|
|
14
|
+
local jq_args=()
|
|
15
|
+
if (( argc > 1 )); then
|
|
16
|
+
jq_args=("${@:1:argc-1}")
|
|
17
|
+
fi
|
|
18
|
+
if command -v jq >/dev/null 2>&1; then
|
|
19
|
+
jq -cn "${jq_args[@]}" "$template"
|
|
20
|
+
else
|
|
21
|
+
printf '{}'
|
|
22
|
+
fi
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
emit_result() {
|
|
26
|
+
local ok="$1"
|
|
27
|
+
local kind="$2"
|
|
28
|
+
local stage="$3"
|
|
29
|
+
local exit_code="$4"
|
|
30
|
+
local summary="$5"
|
|
31
|
+
local command="$6"
|
|
32
|
+
local details_json="${7:-{}}"
|
|
33
|
+
|
|
34
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
35
|
+
printf '{"ok":%s,"kind":"%s","stage":"%s","exitCode":%s,"summary":"%s","command":"%s","details":{"error":"jq is required for structured output"}}\n' \
|
|
36
|
+
"$ok" "$kind" "$stage" "$exit_code" "$summary" "$command"
|
|
37
|
+
return
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
jq -cn \
|
|
41
|
+
--arg ok "$ok" \
|
|
42
|
+
--arg kind "$kind" \
|
|
43
|
+
--arg stage "$stage" \
|
|
44
|
+
--arg exitCode "$exit_code" \
|
|
45
|
+
--arg summary "$summary" \
|
|
46
|
+
--arg command "$command" \
|
|
47
|
+
--arg details "$details_json" \
|
|
48
|
+
'{
|
|
49
|
+
ok: ($ok == "true"),
|
|
50
|
+
kind: $kind,
|
|
51
|
+
stage: $stage,
|
|
52
|
+
exitCode: ($exitCode | tonumber),
|
|
53
|
+
summary: $summary,
|
|
54
|
+
command: $command,
|
|
55
|
+
details: ($details | fromjson? // {raw: $details})
|
|
56
|
+
}'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
fail() {
|
|
60
|
+
local exit_code="$1"
|
|
61
|
+
local summary="$2"
|
|
62
|
+
local command="$3"
|
|
63
|
+
local details_json="${4:-{}}"
|
|
64
|
+
|
|
65
|
+
emit_result false "tests" "run_go_tests" "$exit_code" "$summary" "$command" "$details_json"
|
|
66
|
+
exit "$exit_code"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
require_cmd() {
|
|
70
|
+
if ! command -v "$1" >/dev/null 2>&1; then
|
|
71
|
+
fail 2 "Missing required command: $1" "$1" "$(details_json --arg failedStep "require_cmd" --arg missingCommand "$1" '{failedStep: $failedStep, missingCommand: $missingCommand}')"
|
|
72
|
+
fi
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
require_cmd go
|
|
76
|
+
cd "$ROOT_DIR"
|
|
77
|
+
|
|
78
|
+
log "==> Running unit tests (go test -count=1 ./...)"
|
|
79
|
+
if ! go test -count=1 ./... >&2; then
|
|
80
|
+
fail 1 "go test failed" "go test -count=1 ./..." '{"failedStep":"go-test"}'
|
|
81
|
+
fi
|
|
82
|
+
|
|
83
|
+
emit_result true "tests" "run_go_tests" 0 "Tests passed" "go test -count=1 ./..." "$(details_json '{steps:["go-test"]}')"
|
package/verify_build.sh
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
ROOT_DIR="${VERIFY_BUILD_ROOT_DIR:-$(pwd)}"
|
|
6
|
+
BUILD_TARGET="./cmd/user-service"
|
|
7
|
+
BUILD_OUTPUT="$ROOT_DIR/user-service"
|
|
8
|
+
|
|
9
|
+
log() {
|
|
10
|
+
printf '%s\n' "$*" >&2
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
details_json() {
|
|
14
|
+
local template="$1"
|
|
15
|
+
shift
|
|
16
|
+
if command -v jq >/dev/null 2>&1; then
|
|
17
|
+
jq -cn "$@" "$template"
|
|
18
|
+
else
|
|
19
|
+
printf '{}'
|
|
20
|
+
fi
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
emit_result() {
|
|
24
|
+
local ok="$1"
|
|
25
|
+
local kind="$2"
|
|
26
|
+
local stage="$3"
|
|
27
|
+
local exit_code="$4"
|
|
28
|
+
local summary="$5"
|
|
29
|
+
local command="$6"
|
|
30
|
+
local details_json="${7:-{}}"
|
|
31
|
+
|
|
32
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
33
|
+
printf '{"ok":%s,"kind":"%s","stage":"%s","exitCode":%s,"summary":"%s","command":"%s","details":{"error":"jq is required for structured output"}}\n' \
|
|
34
|
+
"$ok" "$kind" "$stage" "$exit_code" "$summary" "$command"
|
|
35
|
+
return
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
jq -cn \
|
|
39
|
+
--arg ok "$ok" \
|
|
40
|
+
--arg kind "$kind" \
|
|
41
|
+
--arg stage "$stage" \
|
|
42
|
+
--arg exitCode "$exit_code" \
|
|
43
|
+
--arg summary "$summary" \
|
|
44
|
+
--arg command "$command" \
|
|
45
|
+
--arg details "$details_json" \
|
|
46
|
+
'{
|
|
47
|
+
ok: ($ok == "true"),
|
|
48
|
+
kind: $kind,
|
|
49
|
+
stage: $stage,
|
|
50
|
+
exitCode: ($exitCode | tonumber),
|
|
51
|
+
summary: $summary,
|
|
52
|
+
command: $command,
|
|
53
|
+
details: ($details | fromjson? // {raw: $details})
|
|
54
|
+
}'
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fail() {
|
|
58
|
+
local exit_code="$1"
|
|
59
|
+
local summary="$2"
|
|
60
|
+
local command="$3"
|
|
61
|
+
local details_json="${4:-{}}"
|
|
62
|
+
|
|
63
|
+
emit_result false "verify-build" "verify_build" "$exit_code" "$summary" "$command" "$details_json"
|
|
64
|
+
exit "$exit_code"
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
require_cmd() {
|
|
68
|
+
if ! command -v "$1" >/dev/null 2>&1; then
|
|
69
|
+
fail 2 "Missing required command: $1" "$1" "$(details_json --arg failedStage "require_cmd" --arg missingCommand "$1" '{failedStage: $failedStage, missingCommand: $missingCommand}')"
|
|
70
|
+
fi
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
run_stage() {
|
|
74
|
+
local stage_name="$1"
|
|
75
|
+
local script_path="$2"
|
|
76
|
+
local output
|
|
77
|
+
local exit_code=0
|
|
78
|
+
|
|
79
|
+
if output=$("$script_path"); then
|
|
80
|
+
:
|
|
81
|
+
else
|
|
82
|
+
exit_code=$?
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
printf '%s\n' "$output" >&2
|
|
86
|
+
|
|
87
|
+
if [[ "$exit_code" -ne 0 ]]; then
|
|
88
|
+
fail "$exit_code" "${stage_name} stage failed" "$script_path" "$(details_json --arg failedStage "$stage_name" --arg rawOutput "$output" '{failedStage: $failedStage, stageResult: ($rawOutput | fromjson? // {raw: $rawOutput})}')"
|
|
89
|
+
fi
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
require_cmd go
|
|
93
|
+
|
|
94
|
+
cd "$ROOT_DIR"
|
|
95
|
+
|
|
96
|
+
run_stage "run_go_linter" "$ROOT_DIR/run_go_linter.sh"
|
|
97
|
+
run_stage "run_go_tests" "$ROOT_DIR/run_go_tests.sh"
|
|
98
|
+
run_stage "run_go_coverage" "$ROOT_DIR/run_go_coverage.sh"
|
|
99
|
+
|
|
100
|
+
log "==> Building binary (go build ${BUILD_TARGET})"
|
|
101
|
+
if ! go build -o "$BUILD_OUTPUT" "$BUILD_TARGET" >&2; then
|
|
102
|
+
fail 1 "go build failed" "go build -o <output> ./cmd/user-service" "$(details_json --arg failedStage "go-build" --arg buildTarget "$BUILD_TARGET" --arg buildOutput "$BUILD_OUTPUT" '{failedStage: $failedStage, buildTarget: $buildTarget, buildOutput: $buildOutput}')"
|
|
103
|
+
fi
|
|
104
|
+
|
|
105
|
+
emit_result true "verify-build" "verify_build" 0 "All verification stages passed" "run_go_linter.sh && run_go_tests.sh && run_go_coverage.sh && go build -o <output> ./cmd/user-service" "$(details_json --arg buildTarget "$BUILD_TARGET" --arg buildOutput "$BUILD_OUTPUT" '{completedStages: ["run_go_linter", "run_go_tests", "run_go_coverage", "go-build"], buildTarget: $buildTarget, buildOutput: $buildOutput}')"
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import { requireArtifacts } from "../artifacts.js";
|
|
3
|
-
import { claudeSummaryExecutorDefaultConfig } from "./configs/claude-summary-config.js";
|
|
4
|
-
import { processExecutor } from "./process-executor.js";
|
|
5
|
-
function resolveModel(config, env) {
|
|
6
|
-
return env[config.modelEnvVar]?.trim() || config.defaultModel;
|
|
7
|
-
}
|
|
8
|
-
export const claudeSummaryExecutor = {
|
|
9
|
-
kind: "claude-summary",
|
|
10
|
-
version: 1,
|
|
11
|
-
defaultConfig: claudeSummaryExecutorDefaultConfig,
|
|
12
|
-
async execute(context, input, config) {
|
|
13
|
-
const env = input.env ?? context.env;
|
|
14
|
-
const command = input.command ?? context.runtime.resolveCmd(config.defaultCommand, config.commandEnvVar);
|
|
15
|
-
const model = input.model?.trim() || resolveModel(config, env);
|
|
16
|
-
const argv = [command, "--model", model, config.promptFlag, `--allowedTools=${config.allowedTools}`, input.prompt];
|
|
17
|
-
const processInput = {
|
|
18
|
-
argv,
|
|
19
|
-
env,
|
|
20
|
-
label: `claude:${model}`,
|
|
21
|
-
};
|
|
22
|
-
const result = await processExecutor.execute(context, input.verbose === undefined ? processInput : { ...processInput, verbose: input.verbose }, processExecutor.defaultConfig);
|
|
23
|
-
requireArtifacts([input.outputFile], `Claude summary did not produce ${input.outputFile}.`);
|
|
24
|
-
return {
|
|
25
|
-
output: result.output,
|
|
26
|
-
artifactText: readFileSync(input.outputFile, "utf8").trim(),
|
|
27
|
-
command,
|
|
28
|
-
model,
|
|
29
|
-
};
|
|
30
|
-
},
|
|
31
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export async function runFlow(definition, context, params, options = {}) {
|
|
2
|
-
const steps = [];
|
|
3
|
-
for (const step of definition.steps) {
|
|
4
|
-
await options.onStepStart?.(step);
|
|
5
|
-
const result = await step.run(context, params);
|
|
6
|
-
await options.onStepComplete?.(step, result);
|
|
7
|
-
steps.push({
|
|
8
|
-
id: step.id,
|
|
9
|
-
result,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
return { steps };
|
|
13
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"kind": "test-fix-flow",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"phases": [
|
|
5
|
-
{
|
|
6
|
-
"id": "test-fix",
|
|
7
|
-
"steps": [
|
|
8
|
-
{
|
|
9
|
-
"id": "run_codex_test_fix",
|
|
10
|
-
"node": "codex-local-prompt",
|
|
11
|
-
"prompt": {
|
|
12
|
-
"templateRef": "test-fix",
|
|
13
|
-
"extraPrompt": { "ref": "params.extraPrompt" },
|
|
14
|
-
"format": "task-prompt"
|
|
15
|
-
},
|
|
16
|
-
"params": {
|
|
17
|
-
"labelText": { "const": "Running Codex test-fix mode locally" },
|
|
18
|
-
"model": { "const": "gpt-5.4" }
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"kind": "test-linter-fix-flow",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"phases": [
|
|
5
|
-
{
|
|
6
|
-
"id": "test-linter-fix",
|
|
7
|
-
"steps": [
|
|
8
|
-
{
|
|
9
|
-
"id": "run_codex_test_linter_fix",
|
|
10
|
-
"node": "codex-local-prompt",
|
|
11
|
-
"prompt": {
|
|
12
|
-
"templateRef": "test-linter-fix",
|
|
13
|
-
"extraPrompt": { "ref": "params.extraPrompt" },
|
|
14
|
-
"format": "task-prompt"
|
|
15
|
-
},
|
|
16
|
-
"params": {
|
|
17
|
-
"labelText": { "const": "Running Codex test-linter-fix mode locally" },
|
|
18
|
-
"model": { "const": "gpt-5.4" }
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"kind": "test-flow",
|
|
3
|
-
"version": 1,
|
|
4
|
-
"phases": [
|
|
5
|
-
{
|
|
6
|
-
"id": "test",
|
|
7
|
-
"steps": [
|
|
8
|
-
{
|
|
9
|
-
"id": "verify_build",
|
|
10
|
-
"node": "verify-build",
|
|
11
|
-
"params": {
|
|
12
|
-
"dockerComposeFile": { "ref": "params.dockerComposeFile" },
|
|
13
|
-
"labelText": { "const": "Running build verification in isolated Docker" }
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { runFlow } from "../flow-runner.js";
|
|
2
|
-
import { runNode } from "../node-runner.js";
|
|
3
|
-
import { codexLocalPromptNode } from "../nodes/codex-local-prompt-node.js";
|
|
4
|
-
import { verifyBuildNode } from "../nodes/verify-build-node.js";
|
|
5
|
-
export const implementFlowDefinition = {
|
|
6
|
-
kind: "implement-flow",
|
|
7
|
-
version: 1,
|
|
8
|
-
steps: [
|
|
9
|
-
{
|
|
10
|
-
id: "run_codex_implement",
|
|
11
|
-
async run(context, params) {
|
|
12
|
-
await runNode(codexLocalPromptNode, context, {
|
|
13
|
-
prompt: params.prompt,
|
|
14
|
-
labelText: "Running Codex implementation mode locally",
|
|
15
|
-
});
|
|
16
|
-
return { completed: true };
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
id: "verify_build_after_implement",
|
|
21
|
-
async run(context, params) {
|
|
22
|
-
if (!params.runFollowupVerify) {
|
|
23
|
-
return {
|
|
24
|
-
completed: true,
|
|
25
|
-
metadata: { skipped: true },
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
await runNode(verifyBuildNode, context, {
|
|
30
|
-
dockerComposeFile: params.dockerComposeFile,
|
|
31
|
-
labelText: "Running build verification in isolated Docker",
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
if (params.onVerifyBuildFailure) {
|
|
36
|
-
await params.onVerifyBuildFailure(String(error.output ?? ""));
|
|
37
|
-
}
|
|
38
|
-
throw error;
|
|
39
|
-
}
|
|
40
|
-
return { completed: true };
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
};
|
|
45
|
-
export async function runImplementFlow(context, params) {
|
|
46
|
-
await runFlow(implementFlowDefinition, context, params);
|
|
47
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { designFile, planArtifacts, planFile, qaFile } from "../../artifacts.js";
|
|
2
|
-
import { PLAN_PROMPT_TEMPLATE, formatPrompt, formatTemplate } from "../../prompts.js";
|
|
3
|
-
import { runFlow } from "../flow-runner.js";
|
|
4
|
-
import { runNode } from "../node-runner.js";
|
|
5
|
-
import { jiraFetchNode } from "../nodes/jira-fetch-node.js";
|
|
6
|
-
import { planCodexNode } from "../nodes/plan-codex-node.js";
|
|
7
|
-
export const planFlowDefinition = {
|
|
8
|
-
kind: "plan-flow",
|
|
9
|
-
version: 1,
|
|
10
|
-
steps: [
|
|
11
|
-
{
|
|
12
|
-
id: "fetch_jira",
|
|
13
|
-
async run(context, params) {
|
|
14
|
-
await runNode(jiraFetchNode, context, {
|
|
15
|
-
jiraApiUrl: params.jiraApiUrl,
|
|
16
|
-
outputFile: params.jiraTaskFile,
|
|
17
|
-
});
|
|
18
|
-
return { completed: true };
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
id: "run_codex_plan",
|
|
23
|
-
async run(context, params) {
|
|
24
|
-
const prompt = formatPrompt(formatTemplate(PLAN_PROMPT_TEMPLATE, {
|
|
25
|
-
jira_task_file: params.jiraTaskFile,
|
|
26
|
-
design_file: designFile(params.taskKey),
|
|
27
|
-
plan_file: planFile(params.taskKey),
|
|
28
|
-
qa_file: qaFile(params.taskKey),
|
|
29
|
-
}), params.extraPrompt);
|
|
30
|
-
await runNode(planCodexNode, context, {
|
|
31
|
-
prompt,
|
|
32
|
-
command: params.codexCmd,
|
|
33
|
-
requiredArtifacts: planArtifacts(params.taskKey),
|
|
34
|
-
});
|
|
35
|
-
return { completed: true };
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
};
|
|
40
|
-
export async function runPlanFlow(context, params) {
|
|
41
|
-
await runFlow(planFlowDefinition, context, params);
|
|
42
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { artifactFile, planArtifacts, requireArtifacts } from "../../artifacts.js";
|
|
2
|
-
import { TaskRunnerError } from "../../errors.js";
|
|
3
|
-
import { REVIEW_FIX_PROMPT_TEMPLATE, formatPrompt, formatTemplate } from "../../prompts.js";
|
|
4
|
-
import { runFlow } from "../flow-runner.js";
|
|
5
|
-
import { runNode } from "../node-runner.js";
|
|
6
|
-
import { codexLocalPromptNode } from "../nodes/codex-local-prompt-node.js";
|
|
7
|
-
import { verifyBuildNode } from "../nodes/verify-build-node.js";
|
|
8
|
-
export function createReviewFixFlowDefinition(iteration) {
|
|
9
|
-
return {
|
|
10
|
-
kind: "review-fix-flow",
|
|
11
|
-
version: 1,
|
|
12
|
-
steps: [
|
|
13
|
-
{
|
|
14
|
-
id: "run_codex_review_fix",
|
|
15
|
-
async run(stepContext, stepParams) {
|
|
16
|
-
const reviewReplyFile = artifactFile("review-reply", stepParams.taskKey, iteration);
|
|
17
|
-
const reviewFixFile = artifactFile("review-fix", stepParams.taskKey, iteration);
|
|
18
|
-
const prompt = formatPrompt(formatTemplate(REVIEW_FIX_PROMPT_TEMPLATE, {
|
|
19
|
-
review_reply_file: reviewReplyFile,
|
|
20
|
-
items: stepParams.reviewFixPoints ?? "",
|
|
21
|
-
review_fix_file: reviewFixFile,
|
|
22
|
-
}), stepParams.extraPrompt);
|
|
23
|
-
await runNode(codexLocalPromptNode, stepContext, {
|
|
24
|
-
prompt,
|
|
25
|
-
labelText: `Running Codex review-fix mode locally (iteration ${iteration})`,
|
|
26
|
-
requiredArtifacts: stepContext.dryRun ? [] : [reviewFixFile],
|
|
27
|
-
missingArtifactsMessage: "Review-fix mode did not produce the required review-fix artifact.",
|
|
28
|
-
});
|
|
29
|
-
return { completed: true, metadata: { iteration } };
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
id: "verify_build_after_review_fix",
|
|
34
|
-
async run(stepContext, stepParams) {
|
|
35
|
-
if (!stepParams.runFollowupVerify) {
|
|
36
|
-
return { completed: true, metadata: { skipped: true } };
|
|
37
|
-
}
|
|
38
|
-
try {
|
|
39
|
-
await runNode(verifyBuildNode, stepContext, {
|
|
40
|
-
dockerComposeFile: stepParams.dockerComposeFile,
|
|
41
|
-
labelText: "Running build verification in isolated Docker",
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
if (stepParams.onVerifyBuildFailure) {
|
|
46
|
-
await stepParams.onVerifyBuildFailure(String(error.output ?? ""));
|
|
47
|
-
}
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
return { completed: true };
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export async function runReviewFixFlow(context, params) {
|
|
57
|
-
requireArtifacts(planArtifacts(params.taskKey), "Review-fix mode requires plan artifacts from the planning phase.");
|
|
58
|
-
if (params.latestIteration === null) {
|
|
59
|
-
throw new TaskRunnerError(`Review-fix mode requires at least one review-reply-${params.taskKey}-N.md artifact.`);
|
|
60
|
-
}
|
|
61
|
-
await runFlow(createReviewFixFlowDefinition(params.latestIteration), context, params);
|
|
62
|
-
}
|