pipeline-worker 0.1.7 → 0.1.9
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/README.md +30 -4
- package/dist/agent/claude.d.ts +6 -4
- package/dist/agent/claude.js +9 -4
- package/dist/agent/claude.js.map +1 -1
- package/dist/agent/copilot.d.ts +3 -0
- package/dist/agent/copilot.js +3 -0
- package/dist/agent/copilot.js.map +1 -1
- package/dist/agent/types.d.ts +6 -0
- package/dist/cli.js +3 -2
- package/dist/cli.js.map +1 -1
- package/dist/config/loader.js +16 -0
- package/dist/config/loader.js.map +1 -1
- package/dist/git/branchName.d.ts +17 -0
- package/dist/git/branchName.js +26 -0
- package/dist/git/branchName.js.map +1 -0
- package/dist/git/diff.d.ts +16 -0
- package/dist/git/diff.js +29 -6
- package/dist/git/diff.js.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/workflow/captureIntent.d.ts +12 -1
- package/dist/workflow/captureIntent.js +52 -13
- package/dist/workflow/captureIntent.js.map +1 -1
- package/dist/workflow/orchestrate.d.ts +5 -1
- package/dist/workflow/orchestrate.js +15 -6
- package/dist/workflow/orchestrate.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
Automate the last mile of your local changes: pipeline-worker takes the uncommitted diff in your repo and drives it — unattended to a green merge request.
|
|
8
8
|
|
|
9
|
-
1. Captures your staged + unstaged changes (your working tree is
|
|
9
|
+
1. Captures your staged + unstaged changes (your working tree is only read, not modified, up through this point).
|
|
10
10
|
2. Replays them in a disposable git worktree.
|
|
11
|
-
3. Asks a coding agent (Claude Code or GitHub Copilot CLI) to infer the intent: branch
|
|
11
|
+
3. Asks a coding agent (Claude Code or GitHub Copilot CLI) to infer the intent: change type, branch slug, commit message, summary.
|
|
12
12
|
4. Runs your `build` / `lint` / `test` commands, fail-fast.
|
|
13
|
-
5. Commits, pushes, and opens a GitLab MR or GitHub PR
|
|
13
|
+
5. Commits, pushes, and opens a GitLab MR or GitHub PR — the branch name is composed from the configurable `branchPattern`.
|
|
14
14
|
6. Polls the CI pipeline; on failure it hands the failing job logs to the agent, commits the fix, pushes, and re-polls — capped at `maxFixAttempts` before escalating to a human with an MR comment.
|
|
15
|
+
7. Once the MR/PR is ready to merge, resets your repo's current branch back to HEAD (see `PIPELINE_WORKER_CLEANUP` below) — your changes now live safely on the feature branch instead of sitting uncommitted locally too.
|
|
15
16
|
|
|
16
17
|
Polling is plain REST and costs zero agent tokens; the agent is invoked only when a pipeline actually fails, with truncated logs and a token-efficient [TOON](https://github.com/toon-format/toon)-encoded MCP server for anything more it needs.
|
|
17
18
|
|
|
@@ -63,9 +64,34 @@ pipeline-worker is configured entirely through real environment variables — se
|
|
|
63
64
|
| `PIPELINE_WORKER_GITHUB_REPO` | auto-detected from `origin` | `owner/name` slug — only needed when `origin` isn't a GitHub remote |
|
|
64
65
|
| `PIPELINE_WORKER_GITHUB_TOKEN` | falls back to `GITHUB_TOKEN` | GitHub token |
|
|
65
66
|
| `PIPELINE_WORKER_POLL_INTERVAL_SECONDS` | `15` | pipeline poll cadence; use `60` for slow pipelines |
|
|
67
|
+
| `PIPELINE_WORKER_BRANCH_PATTERN` | `pipeline-worker/{name}` | feature branch naming template — see below |
|
|
68
|
+
| `PIPELINE_WORKER_CLEANUP` | `true` | reset repoRoot to HEAD once the MR/PR is opened and CI is green (`false` to keep your local uncommitted changes as-is) |
|
|
66
69
|
|
|
67
70
|
`build` / `lint` / `test` local check commands and `maxFixAttempts` (default `5`) are not configurable via env var — see auto-detection below.
|
|
68
71
|
|
|
72
|
+
### Branch naming
|
|
73
|
+
|
|
74
|
+
`branchPattern` (env var or `.pipeline-worker.yml`) controls the feature branch name, built from three placeholders:
|
|
75
|
+
|
|
76
|
+
| Placeholder | Filled by |
|
|
77
|
+
| ----------- | ------------------------------------------------------------------- |
|
|
78
|
+
| `{type}` | `feature`, `bugfix`, or `chore` — inferred from the diff by the agent |
|
|
79
|
+
| `{ticket}` | the `--ticket <id>` flag passed to `pipeline-worker run` |
|
|
80
|
+
| `{name}` | a short kebab-case slug describing the change — inferred by the agent |
|
|
81
|
+
|
|
82
|
+
For example, a team using GitLab issue-linked branches would set:
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
export PIPELINE_WORKER_BRANCH_PATTERN='{type}/{ticket}/{name}'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
pipeline-worker run --ticket PROJ-123
|
|
90
|
+
# -> bugfix/PROJ-123/fix-login-redirect
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
A pattern that includes `{ticket}` requires `--ticket` to be passed; the run fails fast at the naming step otherwise.
|
|
94
|
+
|
|
69
95
|
### Check command auto-detection
|
|
70
96
|
|
|
71
97
|
`build` / `lint` / `test` are picked from the repo's toolchain (first marker found wins; mixed-language repos should set the commands explicitly):
|
|
@@ -83,7 +109,7 @@ A stage with no command (`—`) is skipped. If no toolchain is detected and no c
|
|
|
83
109
|
|
|
84
110
|
| Command | What it does |
|
|
85
111
|
| -------------------------------------------- | ------------------------------------------------------------------------- |
|
|
86
|
-
| `pipeline-worker` (or `pipeline-worker run`) | Capture the current diff and drive it to a green MR/PR
|
|
112
|
+
| `pipeline-worker` (or `pipeline-worker run`) `[--ticket <id>]` | Capture the current diff and drive it to a green MR/PR |
|
|
87
113
|
| `pipeline-worker serve` | Start the forge MCP server over stdio (used by the agent during fix runs) |
|
|
88
114
|
| `pipeline-worker resume --branch <name>` | Resume watching/fixing a run after a crash |
|
|
89
115
|
| `pipeline-worker status --branch <name>` | Print the persisted state of a run |
|
package/dist/agent/claude.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Headless Claude Code adapter. Flags verified against the locally installed
|
|
3
3
|
* `claude` CLI: `-p/--print`, `--output-format json`, `--permission-mode`,
|
|
4
|
-
* `--json-schema`, `--mcp-config`. There is no `--cwd`
|
|
5
|
-
* directory is controlled by the spawned process's `cwd`
|
|
4
|
+
* `--json-schema`, `--mcp-config`, `--allowedTools`. There is no `--cwd`
|
|
5
|
+
* flag — working directory is controlled by the spawned process's `cwd`
|
|
6
|
+
* option.
|
|
6
7
|
*
|
|
7
8
|
* The prompt is written to the child's stdin rather than passed as a CLI
|
|
8
|
-
* argument.
|
|
9
|
-
*
|
|
9
|
+
* argument. Some invocations (e.g. watchPipeline.ts's CI-fix prompt, which
|
|
10
|
+
* embeds failing-job logs) can carry many KB of text, and Linux caps a
|
|
11
|
+
* single exec() argument at ~128KB (MAX_ARG_STRLEN); a large enough prompt
|
|
10
12
|
* blows past that and execFile fails with E2BIG before `claude` even starts.
|
|
11
13
|
* Piping via stdin (verified: `echo "..." | claude -p` reads the prompt from
|
|
12
14
|
* stdin when the positional `prompt` argument is omitted) has no such limit.
|
package/dist/agent/claude.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Headless Claude Code adapter. Flags verified against the locally installed
|
|
3
3
|
* `claude` CLI: `-p/--print`, `--output-format json`, `--permission-mode`,
|
|
4
|
-
* `--json-schema`, `--mcp-config`. There is no `--cwd`
|
|
5
|
-
* directory is controlled by the spawned process's `cwd`
|
|
4
|
+
* `--json-schema`, `--mcp-config`, `--allowedTools`. There is no `--cwd`
|
|
5
|
+
* flag — working directory is controlled by the spawned process's `cwd`
|
|
6
|
+
* option.
|
|
6
7
|
*
|
|
7
8
|
* The prompt is written to the child's stdin rather than passed as a CLI
|
|
8
|
-
* argument.
|
|
9
|
-
*
|
|
9
|
+
* argument. Some invocations (e.g. watchPipeline.ts's CI-fix prompt, which
|
|
10
|
+
* embeds failing-job logs) can carry many KB of text, and Linux caps a
|
|
11
|
+
* single exec() argument at ~128KB (MAX_ARG_STRLEN); a large enough prompt
|
|
10
12
|
* blows past that and execFile fails with E2BIG before `claude` even starts.
|
|
11
13
|
* Piping via stdin (verified: `echo "..." | claude -p` reads the prompt from
|
|
12
14
|
* stdin when the positional `prompt` argument is omitted) has no such limit.
|
|
@@ -89,6 +91,9 @@ export const claudeAdapter = {
|
|
|
89
91
|
if (opts.jsonSchema) {
|
|
90
92
|
args.push('--json-schema', JSON.stringify(opts.jsonSchema));
|
|
91
93
|
}
|
|
94
|
+
if (opts.allowedTools?.length) {
|
|
95
|
+
args.push('--allowedTools', ...opts.allowedTools);
|
|
96
|
+
}
|
|
92
97
|
if (opts.mcpConfigPath) {
|
|
93
98
|
args.push('--mcp-config', opts.mcpConfigPath);
|
|
94
99
|
}
|
package/dist/agent/claude.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/agent/claude.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"claude.js","sourceRoot":"","sources":["../../src/agent/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC;;;;;;GAMG;AACH,MAAM,sBAAsB,GAAG,IAAI,CAAC;AAWpC;;;;GAIG;AACH;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,KAAa,EAAE,GAAuB;IAC/D,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IAC3B,IAAI,OAAO,CAAC,MAAM,IAAI,sBAAsB,EAAE,CAAC;QAC7C,OAAO,OAAO,KAAK,SAAS,OAAO,EA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E;gBAC/C,GAAG,EAAE,IAAI,CAAC,GAAG;gBACb,OAAO,EAAE,iBAAiB;gBAC1B,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;aAC5B,CAAC,CAAC;YACH,uFAAuF;YACvF,kBAAkB,CAAC,UAAU,CAAC,KAAK,CAAC,KAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YACzD,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC;YAChC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QACzB,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,MAAM,GAAG,GAAG,MAAwB,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAwB,CAAC;YACzD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,IAAI,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QACxD,CAAC;QAAC,MAAM,CAAC;YACP,uEAAuE;YACvE,iFAAiF;YACjF,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/dist/agent/copilot.d.ts
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* prompt and the JSON object is extracted from the response text;
|
|
9
9
|
* - no per-invocation MCP config flag -> Copilot only reads
|
|
10
10
|
* ~/.copilot/mcp-config.json, so `mcpConfigPath` is ignored with a warning.
|
|
11
|
+
* - no per-invocation tool allowlist -> `--allow-all-tools` is always passed,
|
|
12
|
+
* so `allowedTools` is ignored; a read-only step (e.g. captureIntent.ts)
|
|
13
|
+
* gets full tool access under this adapter instead of being restricted.
|
|
11
14
|
*
|
|
12
15
|
* The prompt is piped over stdin rather than passed via `-p <prompt>`.
|
|
13
16
|
* captureIntent.ts embeds a full git diff in the prompt, and a large diff can
|
package/dist/agent/copilot.js
CHANGED
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
* prompt and the JSON object is extracted from the response text;
|
|
9
9
|
* - no per-invocation MCP config flag -> Copilot only reads
|
|
10
10
|
* ~/.copilot/mcp-config.json, so `mcpConfigPath` is ignored with a warning.
|
|
11
|
+
* - no per-invocation tool allowlist -> `--allow-all-tools` is always passed,
|
|
12
|
+
* so `allowedTools` is ignored; a read-only step (e.g. captureIntent.ts)
|
|
13
|
+
* gets full tool access under this adapter instead of being restricted.
|
|
11
14
|
*
|
|
12
15
|
* The prompt is piped over stdin rather than passed via `-p <prompt>`.
|
|
13
16
|
* captureIntent.ts embeds a full git diff in the prompt, and a large diff can
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../src/agent/copilot.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../src/agent/copilot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAE1C,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC,0FAA0F;AAC1F,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,KAAK,KAAK,CAAC,CAAC,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACzE,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,KAAK,CAAC,MAAM,CAAC,IAAwB;QACnC,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QACzB,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM;gBACJ,oGAAoG;oBACpG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CACX,mFAAmF;gBACjF,iFAAiF,CACpF,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,eAAe,EAAE,mBAAmB,CAAC,EAAE;YACxF,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,iBAAiB;YAC1B,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI;SAC5B,CAAC,CAAC;QACH,uFAAuF;QACvF,kBAAkB,CAAC,UAAU,CAAC,KAAK,CAAC,KAAM,EAAE,MAAM,CAAC,CAAC;QACpD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,UAAU,CAAC;QAEpC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;IAC/E,CAAC;CACF,CAAC"}
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -10,6 +10,12 @@ export interface AgentInvokeOptions {
|
|
|
10
10
|
mcpConfigPath?: string;
|
|
11
11
|
/** Optional permission mode override; adapters default to an auto-accept mode suitable for unattended runs. */
|
|
12
12
|
permissionMode?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional allowlist restricting which tools the agent may use this turn (e.g. `["Read", "Bash(git diff:*)"]`).
|
|
15
|
+
* For adapters that can't scope tool access per invocation (e.g. copilot, which always runs with full tool
|
|
16
|
+
* access), this is ignored — see that adapter's file comment for the implication.
|
|
17
|
+
*/
|
|
18
|
+
allowedTools?: string[];
|
|
13
19
|
/** Optional model override (e.g. "haiku"), for adapters that support per-invocation model selection. */
|
|
14
20
|
model?: string;
|
|
15
21
|
}
|
package/dist/cli.js
CHANGED
|
@@ -19,9 +19,10 @@ program.version(pkg.version, '-v, --version', 'output the installed pipeline-wor
|
|
|
19
19
|
program
|
|
20
20
|
.command('run', { isDefault: true })
|
|
21
21
|
.description('Capture the current diff, validate it, and drive it through to a green MR/PR')
|
|
22
|
-
.
|
|
22
|
+
.option('--ticket <id>', 'ticket/issue id to interpolate into the configured branchPattern\'s {ticket} placeholder')
|
|
23
|
+
.action(async (opts) => {
|
|
23
24
|
try {
|
|
24
|
-
await runWorkflow(process.cwd());
|
|
25
|
+
await runWorkflow(process.cwd(), { ticket: opts.ticket });
|
|
25
26
|
}
|
|
26
27
|
catch (error) {
|
|
27
28
|
console.error('pipeline-worker run failed:', error instanceof Error ? error.message : error);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAA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,CAAC,CAAC;IACpG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/config/loader.js
CHANGED
|
@@ -31,6 +31,8 @@ const DEFAULT_CONFIG = {
|
|
|
31
31
|
},
|
|
32
32
|
maxFixAttempts: 5,
|
|
33
33
|
pollIntervalSeconds: 15,
|
|
34
|
+
branchPattern: 'pipeline-worker/{name}',
|
|
35
|
+
cleanupOnSuccess: true,
|
|
34
36
|
};
|
|
35
37
|
/** Loads <repoRoot>/.env into process.env; already-set variables always win. */
|
|
36
38
|
function loadDotEnv(repoRoot) {
|
|
@@ -57,6 +59,18 @@ function positiveNumber(value, fallback) {
|
|
|
57
59
|
const num = Number(value);
|
|
58
60
|
return Number.isFinite(num) && num > 0 ? num : fallback;
|
|
59
61
|
}
|
|
62
|
+
/** Parses "true"/"false" (case-insensitive), falling back when unset or unrecognized. */
|
|
63
|
+
function boolean(value, fallback) {
|
|
64
|
+
if (typeof value === 'boolean')
|
|
65
|
+
return value;
|
|
66
|
+
if (typeof value === 'string') {
|
|
67
|
+
if (value.toLowerCase() === 'true')
|
|
68
|
+
return true;
|
|
69
|
+
if (value.toLowerCase() === 'false')
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return fallback;
|
|
73
|
+
}
|
|
60
74
|
function resolveConfigPath(repoRoot, override) {
|
|
61
75
|
return override || process.env.PIPELINE_WORKER_CONFIG || join(repoRoot, CONFIG_FILE_NAME);
|
|
62
76
|
}
|
|
@@ -118,6 +132,8 @@ export function loadConfig(repoRoot, override) {
|
|
|
118
132
|
test: parsed.test ?? detected.test,
|
|
119
133
|
maxFixAttempts: parsed.maxFixAttempts ?? DEFAULT_CONFIG.maxFixAttempts,
|
|
120
134
|
pollIntervalSeconds: positiveNumber(process.env.PIPELINE_WORKER_POLL_INTERVAL_SECONDS, positiveNumber(parsed.pollIntervalSeconds, DEFAULT_CONFIG.pollIntervalSeconds)),
|
|
135
|
+
branchPattern: process.env.PIPELINE_WORKER_BRANCH_PATTERN || parsed.branchPattern || DEFAULT_CONFIG.branchPattern,
|
|
136
|
+
cleanupOnSuccess: boolean(process.env.PIPELINE_WORKER_CLEANUP, boolean(parsed.cleanupOnSuccess, DEFAULT_CONFIG.cleanupOnSuccess)),
|
|
121
137
|
};
|
|
122
138
|
}
|
|
123
139
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD,MAAM,WAAW,GAAyB,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;AAChE,MAAM,WAAW,GAAyB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE/D,0EAA0E;AAC1E,MAAM,cAAc,GAA0D;IAC5E,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,CAAC;KACb;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;KACT;IACD,cAAc,EAAE,CAAC;IACjB,mBAAmB,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA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AG,CAAC,2BAA2B,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI;YAClG,SAAS;YACT,QAAQ;SACT;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,IAAI,gBAAgB,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAC,MAAM,CAAC,IAAI;SACjI;QACD,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK;QACrC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI;QAClC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI;QAClC,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,cAAc,CAAC,cAAc;QACtE,mBAAmB,EAAE,cAAc,CACjC,OAAO,CAAC,GAAG,CAAC,qCAAqC,EACjD,cAAc,CAAC,MAAM,CAAC,mBAAmB,EAAE,cAAc,CAAC,mBAAmB,CAAC,CAC/E;QACD,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,MAAM,CAAC,aAAa,IAAI,cAAc,CAAC,aAAa;QACjH,gBAAgB,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;KAClI,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composes the final feature branch name from the team's configured
|
|
3
|
+
* `branchPattern` (see config/loader.ts) and the values captured/passed at
|
|
4
|
+
* run time, so naming conventions like "bugfix/PROJ-123/fix-login" are a
|
|
5
|
+
* config choice instead of hardcoded.
|
|
6
|
+
*/
|
|
7
|
+
export interface BranchNameVars {
|
|
8
|
+
type: string;
|
|
9
|
+
name: string;
|
|
10
|
+
ticket?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Throws when `pattern` references {ticket} but no ticket was supplied —
|
|
14
|
+
* a missing ticket id would otherwise silently collapse into a double slash
|
|
15
|
+
* or trailing separator instead of surfacing the misconfiguration.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildBranchName(pattern: string, vars: BranchNameVars): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composes the final feature branch name from the team's configured
|
|
3
|
+
* `branchPattern` (see config/loader.ts) and the values captured/passed at
|
|
4
|
+
* run time, so naming conventions like "bugfix/PROJ-123/fix-login" are a
|
|
5
|
+
* config choice instead of hardcoded.
|
|
6
|
+
*/
|
|
7
|
+
const PLACEHOLDER = /\{(type|ticket|name)\}/g;
|
|
8
|
+
// A git ref segment: no leading dash/dot, safe punctuation only. Slashes are
|
|
9
|
+
// allowed since patterns like "{type}/{ticket}/{name}" use them as separators.
|
|
10
|
+
const SAFE_BRANCH_NAME = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;
|
|
11
|
+
/**
|
|
12
|
+
* Throws when `pattern` references {ticket} but no ticket was supplied —
|
|
13
|
+
* a missing ticket id would otherwise silently collapse into a double slash
|
|
14
|
+
* or trailing separator instead of surfacing the misconfiguration.
|
|
15
|
+
*/
|
|
16
|
+
export function buildBranchName(pattern, vars) {
|
|
17
|
+
if (pattern.includes('{ticket}') && !vars.ticket) {
|
|
18
|
+
throw new Error(`branchPattern "${pattern}" requires a ticket id — pass one with --ticket <id>, or drop {ticket} from branchPattern.`);
|
|
19
|
+
}
|
|
20
|
+
const branchName = pattern.replace(PLACEHOLDER, (_match, key) => vars[key] ?? '');
|
|
21
|
+
if (!SAFE_BRANCH_NAME.test(branchName)) {
|
|
22
|
+
throw new Error(`composed branch name "${branchName}" (from branchPattern "${pattern}") is not a valid git branch name`);
|
|
23
|
+
}
|
|
24
|
+
return branchName;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=branchName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branchName.js","sourceRoot":"","sources":["../../src/git/branchName.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,WAAW,GAAG,yBAAyB,CAAC;AAC9C,6EAA6E;AAC7E,+EAA+E;AAC/E,MAAM,gBAAgB,GAAG,+BAA+B,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,IAAoB;IACnE,IAAI,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACjD,MAAM,IAAI,KAAK,CACb,kBAAkB,OAAO,4FAA4F,CACtH,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,GAA+B,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAE9G,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CAAC,yBAAyB,UAAU,0BAA0B,OAAO,mCAAmC,CAAC,CAAC;IAC3H,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/git/diff.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Reads the caller's in-progress change set without touching their working tree. */
|
|
2
2
|
export interface CapturedDiff {
|
|
3
3
|
diffText: string;
|
|
4
|
+
changedFiles: string[];
|
|
4
5
|
untrackedFiles: string[];
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
@@ -18,5 +19,20 @@ export interface CapturedDiff {
|
|
|
18
19
|
* actual base64 patch data instead of a `Binary files a/... differ` stub —
|
|
19
20
|
* without it, `git apply` in worktree.ts fails with "missing binary patch
|
|
20
21
|
* data" for any binary file in the change set.
|
|
22
|
+
*
|
|
23
|
+
* `changedFiles` is captured separately via `--name-only` (a plain path
|
|
24
|
+
* list, no patch data) so callers that only need to *name* what changed —
|
|
25
|
+
* e.g. captureIntent.ts, which lets the agent read each file's diff itself
|
|
26
|
+
* rather than having one embedded in its prompt — never have to hold or
|
|
27
|
+
* scan the full (potentially many-MB, base64-laden) `diffText`.
|
|
21
28
|
*/
|
|
22
29
|
export declare function captureDiff(repoRoot: string): Promise<CapturedDiff>;
|
|
30
|
+
/**
|
|
31
|
+
* Discards repoRoot's now-redundant uncommitted changes once they're safely
|
|
32
|
+
* captured on the opened MR/PR: `git reset --hard HEAD` undoes tracked
|
|
33
|
+
* edits (whatever branch repoRoot happens to be on), then `untrackedFiles`
|
|
34
|
+
* — the same list captureDiff recorded at the start of the run — is deleted
|
|
35
|
+
* individually rather than via a blanket `git clean`, so unrelated
|
|
36
|
+
* untracked files (build output, scratch files) are left alone.
|
|
37
|
+
*/
|
|
38
|
+
export declare function resetRepo(repoRoot: string, untrackedFiles: string[]): Promise<void>;
|
package/dist/git/diff.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/** Reads the caller's in-progress change set without touching their working tree. */
|
|
2
2
|
import { execFile } from 'node:child_process';
|
|
3
|
+
import { rmSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
3
5
|
import { promisify } from 'node:util';
|
|
4
6
|
const execFileAsync = promisify(execFile);
|
|
5
7
|
/**
|
|
@@ -17,17 +19,38 @@ const execFileAsync = promisify(execFile);
|
|
|
17
19
|
* actual base64 patch data instead of a `Binary files a/... differ` stub —
|
|
18
20
|
* without it, `git apply` in worktree.ts fails with "missing binary patch
|
|
19
21
|
* data" for any binary file in the change set.
|
|
22
|
+
*
|
|
23
|
+
* `changedFiles` is captured separately via `--name-only` (a plain path
|
|
24
|
+
* list, no patch data) so callers that only need to *name* what changed —
|
|
25
|
+
* e.g. captureIntent.ts, which lets the agent read each file's diff itself
|
|
26
|
+
* rather than having one embedded in its prompt — never have to hold or
|
|
27
|
+
* scan the full (potentially many-MB, base64-laden) `diffText`.
|
|
20
28
|
*/
|
|
21
29
|
export async function captureDiff(repoRoot) {
|
|
22
|
-
const { stdout: diffText }
|
|
23
|
-
cwd: repoRoot,
|
|
24
|
-
maxBuffer: 64 * 1024 * 1024,
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
const [{ stdout: diffText }, { stdout: nameOnlyOut }, { stdout: statusOut }] = await Promise.all([
|
|
31
|
+
execFileAsync('git', ['diff', 'HEAD', '--full-index', '--binary'], { cwd: repoRoot, maxBuffer: 64 * 1024 * 1024 }),
|
|
32
|
+
execFileAsync('git', ['diff', 'HEAD', '--name-only'], { cwd: repoRoot, maxBuffer: 64 * 1024 * 1024 }),
|
|
33
|
+
execFileAsync('git', ['status', '--porcelain'], { cwd: repoRoot }),
|
|
34
|
+
]);
|
|
35
|
+
const changedFiles = nameOnlyOut.split('\n').map((line) => line.trim()).filter((line) => line.length > 0);
|
|
27
36
|
const untrackedFiles = statusOut
|
|
28
37
|
.split('\n')
|
|
29
38
|
.filter((line) => line.startsWith('?? '))
|
|
30
39
|
.map((line) => line.slice(3).trim());
|
|
31
|
-
return { diffText, untrackedFiles };
|
|
40
|
+
return { diffText, changedFiles, untrackedFiles };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Discards repoRoot's now-redundant uncommitted changes once they're safely
|
|
44
|
+
* captured on the opened MR/PR: `git reset --hard HEAD` undoes tracked
|
|
45
|
+
* edits (whatever branch repoRoot happens to be on), then `untrackedFiles`
|
|
46
|
+
* — the same list captureDiff recorded at the start of the run — is deleted
|
|
47
|
+
* individually rather than via a blanket `git clean`, so unrelated
|
|
48
|
+
* untracked files (build output, scratch files) are left alone.
|
|
49
|
+
*/
|
|
50
|
+
export async function resetRepo(repoRoot, untrackedFiles) {
|
|
51
|
+
await execFileAsync('git', ['reset', '--hard', 'HEAD'], { cwd: repoRoot });
|
|
52
|
+
for (const relativePath of untrackedFiles) {
|
|
53
|
+
rmSync(join(repoRoot, relativePath), { recursive: true, force: true });
|
|
54
|
+
}
|
|
32
55
|
}
|
|
33
56
|
//# sourceMappingURL=diff.js.map
|
package/dist/git/diff.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/git/diff.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/git/diff.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,QAAgB;IAChD,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC/F,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC;QAClH,aAAa,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,CAA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 +19,10 @@ export interface PipelineWorkerConfig {
|
|
|
19
19
|
test: string;
|
|
20
20
|
maxFixAttempts: number;
|
|
21
21
|
pollIntervalSeconds: number;
|
|
22
|
+
/** Feature branch naming template. Supports {type}, {ticket}, {name} placeholders; e.g. "{type}/{ticket}/{name}". */
|
|
23
|
+
branchPattern: string;
|
|
24
|
+
/** Once the MR/PR is opened and CI is green, reset repoRoot to HEAD — the captured changes now live safely on the branch. */
|
|
25
|
+
cleanupOnSuccess: boolean;
|
|
22
26
|
}
|
|
23
27
|
export type RunPhase = 'diff' | 'intent' | 'checks' | 'mr' | 'watch' | 'done' | 'escalated';
|
|
24
28
|
export interface RunState {
|
|
@@ -31,6 +35,7 @@ export interface RunState {
|
|
|
31
35
|
phase: RunPhase;
|
|
32
36
|
}
|
|
33
37
|
export type RiskLevel = 'low' | 'medium' | 'high';
|
|
38
|
+
export type ChangeType = 'feature' | 'bugfix' | 'chore';
|
|
34
39
|
export interface FileChangeSummary {
|
|
35
40
|
file: string;
|
|
36
41
|
summary: string;
|
|
@@ -39,7 +44,9 @@ export interface CapturedIntent {
|
|
|
39
44
|
/** One short sentence: why this change exists / what problem it solves. */
|
|
40
45
|
intent: string;
|
|
41
46
|
summary: string;
|
|
42
|
-
|
|
47
|
+
changeType: ChangeType;
|
|
48
|
+
/** Short kebab-case slug describing the change, with no prefix/ticket — the branch pattern supplies those. */
|
|
49
|
+
branchSlug: string;
|
|
43
50
|
commitMessage: string;
|
|
44
51
|
fileChanges: FileChangeSummary[];
|
|
45
52
|
risk: RiskLevel;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
/** Step 3: ask the configured agent what a diff is *for*, in a structured, reusable shape. */
|
|
2
2
|
import type { AgentAdapter } from '../agent/types.js';
|
|
3
3
|
import type { CapturedIntent } from '../types.js';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Rather than embedding the (potentially huge — generated lockfiles, binary
|
|
6
|
+
* assets, etc.) diff text in the prompt, this only lists which files
|
|
7
|
+
* changed and lets the agent read each one's diff itself with its own
|
|
8
|
+
* tools, scoped to `worktreePath` (the isolated worktree the change was
|
|
9
|
+
* already applied into by orchestrate.ts's "Applying your changes" step).
|
|
10
|
+
* That keeps the prompt itself small and constant-size regardless of how
|
|
11
|
+
* large any individual file's diff is, and lets the agent skip files it
|
|
12
|
+
* judges irrelevant to intent (lockfiles, generated assets) instead of
|
|
13
|
+
* paying to read them.
|
|
14
|
+
*/
|
|
15
|
+
export declare function captureIntent(agent: AgentAdapter, files: string[], worktreePath: string): Promise<CapturedIntent>;
|
|
@@ -9,15 +9,28 @@ const COMMIT_MESSAGE_MAX_LENGTH = 72;
|
|
|
9
9
|
* a real failing build needs the stronger default model.
|
|
10
10
|
*/
|
|
11
11
|
const INTENT_MODEL = 'haiku';
|
|
12
|
+
/**
|
|
13
|
+
* Read-only tools the agent may use to inspect the change set itself (see
|
|
14
|
+
* captureIntent below): `Read` for new/untracked files (`git diff` shows
|
|
15
|
+
* nothing for those), `Bash(git diff:*)` for modified tracked files, and
|
|
16
|
+
* `Grep`/`Glob` for broader repo context when judging risk or test
|
|
17
|
+
* scenarios. Deliberately excludes Write/Edit and any git subcommand that
|
|
18
|
+
* can mutate state (commit, checkout, reset, ...) — this step only reports
|
|
19
|
+
* intent, it must not be able to change the worktree the later
|
|
20
|
+
* apply/commit/checkout steps depend on.
|
|
21
|
+
*/
|
|
22
|
+
const READ_ONLY_TOOLS = ['Read', 'Grep', 'Glob', 'Bash(git diff:*)'];
|
|
12
23
|
const RISK_CRITERIA = 'low: the change is isolated to independent components with a small blast radius. ' +
|
|
13
24
|
'medium: the change touches a shared/dependent component, but that component is well covered by existing unit tests. ' +
|
|
14
25
|
"high: the change touches existing/critical code paths and needs a human reviewer's attention before merging.";
|
|
26
|
+
const CHANGE_TYPES = ['feature', 'bugfix', 'chore'];
|
|
15
27
|
const INTENT_SCHEMA = {
|
|
16
28
|
type: 'object',
|
|
17
29
|
properties: {
|
|
18
30
|
intent: { type: 'string', description: 'One short sentence, no line breaks: why this change exists / what problem it solves.' },
|
|
19
31
|
summary: { type: 'string', description: 'One or two sentences (single line, no line breaks) on what this change does and why' },
|
|
20
|
-
|
|
32
|
+
changeType: { type: 'string', enum: [...CHANGE_TYPES], description: 'The kind of change, used to compose the branch name.' },
|
|
33
|
+
branchSlug: { type: 'string', description: 'A short kebab-case slug describing the change — no prefix, path, or ticket id.' },
|
|
21
34
|
commitMessage: {
|
|
22
35
|
type: 'string',
|
|
23
36
|
maxLength: COMMIT_MESSAGE_MAX_LENGTH,
|
|
@@ -44,7 +57,7 @@ const INTENT_SCHEMA = {
|
|
|
44
57
|
description: 'Concrete test scenarios (each a single line) a reviewer should verify before merging.',
|
|
45
58
|
},
|
|
46
59
|
},
|
|
47
|
-
required: ['intent', 'summary', '
|
|
60
|
+
required: ['intent', 'summary', 'changeType', 'branchSlug', 'commitMessage', 'fileChanges', 'risk', 'riskReason', 'testScenarios'],
|
|
48
61
|
};
|
|
49
62
|
/**
|
|
50
63
|
* Every one of these fields is rendered by openMergeRequest.ts's
|
|
@@ -59,15 +72,19 @@ function singleLine(fieldName) {
|
|
|
59
72
|
.refine((s) => !s.includes('\n'), `${fieldName} must be a single line`);
|
|
60
73
|
}
|
|
61
74
|
/**
|
|
62
|
-
* Agent output is untrusted input: validate the shape and constrain
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
75
|
+
* Agent output is untrusted input: validate the shape and constrain
|
|
76
|
+
* branchSlug to characters that are safe as a git ref segment and a URL
|
|
77
|
+
* segment (the full branch name — prefix, ticket, slug — is composed and
|
|
78
|
+
* re-validated by git/branchName.ts once orchestrate.ts knows the
|
|
79
|
+
* configured branchPattern and any --ticket). commitMessage doubles as the
|
|
80
|
+
* MR/PR title (see openMergeRequest.ts), so it must stay a single line
|
|
81
|
+
* short enough to render as one.
|
|
66
82
|
*/
|
|
67
83
|
const IntentShape = z.object({
|
|
68
84
|
intent: singleLine('intent'),
|
|
69
85
|
summary: singleLine('summary'),
|
|
70
|
-
|
|
86
|
+
changeType: z.enum(CHANGE_TYPES),
|
|
87
|
+
branchSlug: z.string().regex(/^[a-z0-9][a-z0-9-]*$/, 'branchSlug must be a kebab-case slug with no prefix, path, or ticket id'),
|
|
71
88
|
commitMessage: z
|
|
72
89
|
.string()
|
|
73
90
|
.min(1)
|
|
@@ -78,15 +95,37 @@ const IntentShape = z.object({
|
|
|
78
95
|
riskReason: singleLine('riskReason'),
|
|
79
96
|
testScenarios: z.array(singleLine('testScenarios[]')).min(1),
|
|
80
97
|
});
|
|
81
|
-
|
|
82
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Rather than embedding the (potentially huge — generated lockfiles, binary
|
|
100
|
+
* assets, etc.) diff text in the prompt, this only lists which files
|
|
101
|
+
* changed and lets the agent read each one's diff itself with its own
|
|
102
|
+
* tools, scoped to `worktreePath` (the isolated worktree the change was
|
|
103
|
+
* already applied into by orchestrate.ts's "Applying your changes" step).
|
|
104
|
+
* That keeps the prompt itself small and constant-size regardless of how
|
|
105
|
+
* large any individual file's diff is, and lets the agent skip files it
|
|
106
|
+
* judges irrelevant to intent (lockfiles, generated assets) instead of
|
|
107
|
+
* paying to read them.
|
|
108
|
+
*/
|
|
109
|
+
export async function captureIntent(agent, files, worktreePath) {
|
|
110
|
+
const prompt = 'The following files changed in this git worktree (which is your current working directory):\n' +
|
|
111
|
+
files.map((file) => `- ${file}`).join('\n') +
|
|
112
|
+
'\n\nUse your tools to inspect what changed: `git diff HEAD -- <file>` (or `git diff HEAD` for everything at ' +
|
|
113
|
+
"once) for a file that already existed, or Read it directly if it's a new file git diff won't show. " +
|
|
114
|
+
'Then determine the intent behind the change as a whole. ' +
|
|
83
115
|
'Respond with a JSON object matching the given schema: why this change exists, a short summary of what changed, ' +
|
|
84
|
-
|
|
116
|
+
`the kind of change (${CHANGE_TYPES.join('/')}), a short kebab-case branch slug describing the change ` +
|
|
117
|
+
'(no prefix, path, or ticket id — those are added separately), a short single-line conventional-commit ' +
|
|
85
118
|
`subject (max ${COMMIT_MESSAGE_MAX_LENGTH} characters, no body or bullet list, used verbatim as the MR/PR title), ` +
|
|
86
119
|
'a one-line summary per changed file, a risk level with a one-line justification ' +
|
|
87
|
-
`(${RISK_CRITERIA}), and the concrete test scenarios a reviewer should check before merging
|
|
88
|
-
|
|
89
|
-
|
|
120
|
+
`(${RISK_CRITERIA}), and the concrete test scenarios a reviewer should check before merging.`;
|
|
121
|
+
const result = await agent.invoke({
|
|
122
|
+
prompt,
|
|
123
|
+
cwd: worktreePath,
|
|
124
|
+
jsonSchema: INTENT_SCHEMA,
|
|
125
|
+
model: INTENT_MODEL,
|
|
126
|
+
permissionMode: 'default',
|
|
127
|
+
allowedTools: READ_ONLY_TOOLS,
|
|
128
|
+
});
|
|
90
129
|
try {
|
|
91
130
|
return IntentShape.parse(JSON.parse(result.text));
|
|
92
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureIntent.js","sourceRoot":"","sources":["../../src/workflow/captureIntent.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAErC;;;;;;GAMG;AACH,MAAM,YAAY,GAAG,OAAO,CAAC;AAE7B,MAAM,aAAa,GACjB,mFAAmF;IACnF,sHAAsH;IACtH,8GAA8G,CAAC;AAEjH,MAAM,aAAa,GAAG;IACpB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sFAAsF,EAAE;QAC/H,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qFAAqF,EAAE;QAC/H,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"captureIntent.js","sourceRoot":"","sources":["../../src/workflow/captureIntent.ts"],"names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KAC9B,CAAC,CAAC;IACH,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,MAAM,IAAI,KAAK,CAAC,8CAA8C,OAAO,2BAA2B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;IAChI,CAAC;AACH,CAAC"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
/** Top-level control flow wiring the user's 8-step workflow together. */
|
|
2
|
-
export
|
|
2
|
+
export interface RunWorkflowOptions {
|
|
3
|
+
/** Ticket/issue id to interpolate into config.branchPattern's {ticket} placeholder, if it has one. */
|
|
4
|
+
ticket?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function runWorkflow(repoRoot: string, options?: RunWorkflowOptions): Promise<void>;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { loadConfig } from '../config/loader.js';
|
|
3
3
|
import { createForge } from '../forge/index.js';
|
|
4
4
|
import { selectAgent } from '../agent/index.js';
|
|
5
|
-
import { captureDiff } from '../git/diff.js';
|
|
5
|
+
import { captureDiff, resetRepo } from '../git/diff.js';
|
|
6
|
+
import { buildBranchName } from '../git/branchName.js';
|
|
6
7
|
import { createWorktree, syncWithOrigin, applyDiffToWorktree, removeWorktree, renameBranch, generateTempBranchName } from '../git/worktree.js';
|
|
7
8
|
import { currentBranch, commit, stageAll, findUnresolvedConflictMarkers } from '../git/commit.js';
|
|
8
9
|
import { captureIntent } from './captureIntent.js';
|
|
@@ -37,12 +38,12 @@ async function resolveApplyConflicts(agent, worktreePath, conflictedFiles) {
|
|
|
37
38
|
}
|
|
38
39
|
await stageAll(worktreePath);
|
|
39
40
|
}
|
|
40
|
-
export async function runWorkflow(repoRoot) {
|
|
41
|
+
export async function runWorkflow(repoRoot, options = {}) {
|
|
41
42
|
const config = loadConfig(repoRoot);
|
|
42
43
|
const forge = createForge(config);
|
|
43
44
|
const agent = selectAgent(config);
|
|
44
45
|
await printWelcome(config, repoRoot);
|
|
45
|
-
const { diffText, untrackedFiles } = await runStep(1, '📸', 'Capturing your changes', 'reading uncommitted edits and untracked files from your repo', () => captureDiff(repoRoot));
|
|
46
|
+
const { diffText, changedFiles, untrackedFiles } = await runStep(1, '📸', 'Capturing your changes', 'reading uncommitted edits and untracked files from your repo', () => captureDiff(repoRoot));
|
|
46
47
|
if (diffText.trim().length === 0 && untrackedFiles.length === 0) {
|
|
47
48
|
console.log('pipeline-worker: no changes to process.');
|
|
48
49
|
return;
|
|
@@ -72,11 +73,12 @@ export async function runWorkflow(repoRoot) {
|
|
|
72
73
|
note(`conflict in: ${applyResult.conflictedFiles.join(', ')}`);
|
|
73
74
|
await resolveApplyConflicts(agent, worktreePath, applyResult.conflictedFiles);
|
|
74
75
|
}
|
|
75
|
-
const intent = await runStep(5, '🧠', 'Understanding your changes', `ask ${config.agent} to infer a branch
|
|
76
|
+
const intent = await runStep(5, '🧠', 'Understanding your changes', `ask ${config.agent} to infer a change type, branch slug, commit message, and summary`, () => captureIntent(agent, [...changedFiles, ...untrackedFiles], worktreePath));
|
|
76
77
|
note(`${config.agent} says: ${intent.summary}`);
|
|
77
78
|
noteRisk(intent.risk, intent.riskReason);
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
const branchName = buildBranchName(config.branchPattern, { type: intent.changeType, ticket: options.ticket, name: intent.branchSlug });
|
|
80
|
+
await runStep(6, '🌿', 'Checkout feature branch', `switch to feature branch ${branchName}`, () => renameBranch(worktreePath, branchName));
|
|
81
|
+
state = { ...state, branch: branchName, phase: 'intent' };
|
|
80
82
|
saveRunState(repoRoot, state);
|
|
81
83
|
const checks = await runStep(7, '✅', 'Running checks', 'build, lint, and test — whichever your repo has configured', () => runChecks(config, worktreePath));
|
|
82
84
|
for (const check of checks)
|
|
@@ -105,6 +107,13 @@ export async function runWorkflow(repoRoot) {
|
|
|
105
107
|
if (finalPhase === 'done') {
|
|
106
108
|
const detail = state.pipelineId !== undefined ? `MR ${mr.webUrl} passed CI` : `MR ${mr.webUrl} opened — no CI pipeline found, nothing to watch`;
|
|
107
109
|
step('🎉', 'Done', detail);
|
|
110
|
+
if (config.cleanupOnSuccess) {
|
|
111
|
+
// The captured changes now live safely on state.branch (pushed and,
|
|
112
|
+
// per finalPhase === 'done', either merged-clean or CI-verified) —
|
|
113
|
+
// repoRoot's copy is redundant, so reset it back to HEAD regardless
|
|
114
|
+
// of what branch it's currently on.
|
|
115
|
+
await runStep(11, '🧹', 'Cleaning up your repo', `reset to HEAD — your changes are now safely on ${state.branch}`, () => resetRepo(repoRoot, untrackedFiles));
|
|
116
|
+
}
|
|
108
117
|
}
|
|
109
118
|
else if (finalPhase === 'escalated') {
|
|
110
119
|
step('🚨', 'Stopped for human review', `see ${mr.webUrl} for what was tried and why`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrate.js","sourceRoot":"","sources":["../../src/workflow/orchestrate.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"orchestrate.js","sourceRoot":"","sources":["../../src/workflow/orchestrate.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA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AAE,CAAC;YACtC,IAAI,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,EAAE,CAAC,MAAM,6BAA6B,CAAC,CAAC;YACtF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pipeline-worker",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Automated git-worktree workflow: captures intent from a diff via Claude Code or GitHub Copilot CLI, runs build/lint/test, opens a GitLab MR or GitHub PR, and auto-fixes failing pipelines — with a companion forge MCP server (TOON-encoded responses).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Mohan TN <mohan.tn100@gmail.com>",
|