@urateam/core 0.1.8 → 0.1.10
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/dist/__tests__/agent-profiles.test.d.ts +2 -0
- package/dist/__tests__/agent-profiles.test.d.ts.map +1 -0
- package/dist/__tests__/agent-profiles.test.js +120 -0
- package/dist/__tests__/agent-profiles.test.js.map +1 -0
- package/dist/__tests__/executor.test.js +3 -1
- package/dist/__tests__/executor.test.js.map +1 -1
- package/dist/__tests__/extract-handoff.test.js +202 -0
- package/dist/__tests__/extract-handoff.test.js.map +1 -1
- package/dist/__tests__/stage-models.test.js.map +1 -1
- package/dist/executor/executor.d.ts.map +1 -1
- package/dist/executor/executor.js +9 -3
- package/dist/executor/executor.js.map +1 -1
- package/dist/executor/extract-handoff.d.ts +18 -2
- package/dist/executor/extract-handoff.d.ts.map +1 -1
- package/dist/executor/extract-handoff.js +106 -18
- package/dist/executor/extract-handoff.js.map +1 -1
- package/dist/executor/handoff.d.ts.map +1 -1
- package/dist/executor/handoff.js +6 -0
- package/dist/executor/handoff.js.map +1 -1
- package/dist/executor/index.d.ts +1 -1
- package/dist/executor/index.d.ts.map +1 -1
- package/dist/executor/index.js +1 -1
- package/dist/executor/index.js.map +1 -1
- package/dist/executor/profiles.d.ts +42 -0
- package/dist/executor/profiles.d.ts.map +1 -1
- package/dist/executor/profiles.js +147 -2
- package/dist/executor/profiles.js.map +1 -1
- package/dist/pipeline/runner.d.ts.map +1 -1
- package/dist/pipeline/runner.js +6 -2
- package/dist/pipeline/runner.js.map +1 -1
- package/dist/webhook/handler.d.ts.map +1 -1
- package/dist/webhook/handler.js +6 -1
- package/dist/webhook/handler.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,21 +2,111 @@ import { parseHandoffArtifact, buildFallback } from "./handoff.js";
|
|
|
2
2
|
import { gitExecSafe, gitExecRaw } from "../repo/git.js";
|
|
3
3
|
import { createLogger } from "../logger.js";
|
|
4
4
|
const log = createLogger({ component: "ExtractHandoff" });
|
|
5
|
+
/**
|
|
6
|
+
* Parse `git status --porcelain` output into a list of changed file paths.
|
|
7
|
+
* Handles renames ("XY old -> new" — emit `new`).
|
|
8
|
+
*/
|
|
9
|
+
function parseGitPorcelain(statusOutput) {
|
|
10
|
+
if (!statusOutput)
|
|
11
|
+
return [];
|
|
12
|
+
return statusOutput
|
|
13
|
+
.split("\n")
|
|
14
|
+
.filter(Boolean)
|
|
15
|
+
.map((line) => {
|
|
16
|
+
const path = line.substring(3);
|
|
17
|
+
const arrowIdx = path.indexOf(" -> ");
|
|
18
|
+
return arrowIdx >= 0 ? path.substring(arrowIdx + 4) : path;
|
|
19
|
+
})
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Parse `git diff --name-only` output into a list of changed file paths.
|
|
24
|
+
* Newline-separated; one path per line.
|
|
25
|
+
*/
|
|
26
|
+
function parseGitDiffNames(output) {
|
|
27
|
+
if (!output)
|
|
28
|
+
return [];
|
|
29
|
+
return output.split("\n").map((p) => p.trim()).filter(Boolean);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Compute "what did the agent change in this branch" by combining the
|
|
33
|
+
* uncommitted worktree state (`git status --porcelain`) with the
|
|
34
|
+
* already-committed-on-the-branch diff against `baseRef` (`git diff
|
|
35
|
+
* --name-only baseRef...HEAD`).
|
|
36
|
+
*
|
|
37
|
+
* Both signals are needed because the runner runs `autoCommitChanges`
|
|
38
|
+
* between stages — which means a review-stage handoff sees a clean
|
|
39
|
+
* worktree, even though the implement stage just modified 15 files. Status
|
|
40
|
+
* alone misses those committed-then-rewound changes.
|
|
41
|
+
*
|
|
42
|
+
* fail-open: gitExecRaw resolves to "" on error, so a missing baseRef
|
|
43
|
+
* (e.g., no `origin/main` configured in a test repo) is silent.
|
|
44
|
+
*/
|
|
45
|
+
async function gitChangedFilesAcross(workdir, baseRef) {
|
|
46
|
+
const statusOutput = await gitExecRaw(["status", "--porcelain"], workdir);
|
|
47
|
+
const fromStatus = parseGitPorcelain(statusOutput);
|
|
48
|
+
if (!baseRef)
|
|
49
|
+
return fromStatus;
|
|
50
|
+
const diffOutput = await gitExecRaw(["diff", "--name-only", `${baseRef}...HEAD`], workdir);
|
|
51
|
+
const fromDiff = parseGitDiffNames(diffOutput);
|
|
52
|
+
// Dedupe in case a file shows up in both (unlikely but possible if the
|
|
53
|
+
// agent partially committed and then made more edits).
|
|
54
|
+
return Array.from(new Set([...fromStatus, ...fromDiff]));
|
|
55
|
+
}
|
|
5
56
|
/**
|
|
6
57
|
* Extract a structured handoff artifact from the stage agent's raw output
|
|
7
58
|
* and the actual worktree state.
|
|
8
59
|
*
|
|
9
60
|
* Strategy:
|
|
10
|
-
* 1. Fast path: if the agent already produced valid JSON, use it
|
|
61
|
+
* 1. Fast path: if the agent already produced valid JSON, use it — but
|
|
62
|
+
* cross-check against the union of `git status --porcelain` (uncommitted)
|
|
63
|
+
* and `git diff --name-only baseRef...HEAD` (committed on this branch
|
|
64
|
+
* since it diverged from baseRef). Override an empty `filesChanged`
|
|
65
|
+
* list when git shows real changes (urateam#35). The committed-half
|
|
66
|
+
* of that union is load-bearing: the runner runs autoCommitChanges
|
|
67
|
+
* between stages, so by review-stage time the worktree is clean even
|
|
68
|
+
* though the implement stage modified N files. Status alone misses
|
|
69
|
+
* that case (gap from PR #95).
|
|
11
70
|
* 2. Otherwise, run git commands to get actual file changes and build the
|
|
12
71
|
* handoff programmatically from the diff + agent's raw text output
|
|
13
72
|
*
|
|
14
73
|
* No agent subprocess needed — this is fast and deterministic.
|
|
15
74
|
*/
|
|
16
|
-
export async function extractHandoff(agentOutput, runId, issueId, stage, workdir
|
|
75
|
+
export async function extractHandoff(agentOutput, runId, issueId, stage, workdir,
|
|
76
|
+
/**
|
|
77
|
+
* Optional base ref (e.g., "origin/main") to compare HEAD against for the
|
|
78
|
+
* "agent committed work on the branch" portion of the empty-filesChanged
|
|
79
|
+
* override. When absent, only the worktree (`git status --porcelain`) is
|
|
80
|
+
* consulted — i.e., the PR #95 behavior. Pass the full ref form including
|
|
81
|
+
* any `origin/` prefix the caller wants.
|
|
82
|
+
*/
|
|
83
|
+
baseRef) {
|
|
17
84
|
// Fast path: if the agent already produced valid structured JSON, use it
|
|
18
85
|
const fastResult = parseHandoffArtifact(agentOutput, runId, issueId, stage);
|
|
19
86
|
if (fastResult.structured) {
|
|
87
|
+
// Sanity check against git: an empty `filesChanged` from the agent is
|
|
88
|
+
// the symptom of urateam#35 — the agent's structured output can be
|
|
89
|
+
// malformed (e.g., self-critique JSON leaks into `summary` and
|
|
90
|
+
// `filesChanged: []` is emitted alongside) while the diff is real.
|
|
91
|
+
// Trust git as the authoritative source only when the agent says
|
|
92
|
+
// nothing changed.
|
|
93
|
+
//
|
|
94
|
+
// We deliberately do NOT override a non-empty agent list, even when it
|
|
95
|
+
// disagrees with git — agents may legitimately filter their list (e.g.,
|
|
96
|
+
// exclude generated files), and the rotulus PR #7 symptom that drives
|
|
97
|
+
// this fix is specifically the empty-on-multi-file case.
|
|
98
|
+
//
|
|
99
|
+
// gitExecRaw fails-open to "" on error rather than rejecting, so a
|
|
100
|
+
// missing remote/baseRef is silent. Mutation of fastResult.artifact
|
|
101
|
+
// is safe — fastResult is a local var produced by parseHandoffArtifact
|
|
102
|
+
// and not aliased anywhere else before we return it.
|
|
103
|
+
if (fastResult.artifact.filesChanged.length === 0) {
|
|
104
|
+
const gitFilesChanged = await gitChangedFilesAcross(workdir, baseRef);
|
|
105
|
+
if (gitFilesChanged.length > 0) {
|
|
106
|
+
log.warn({ stage, gitFilesChanged: gitFilesChanged.length, baseRef: baseRef ?? "(worktree only)" }, "agent reported empty filesChanged but git shows real changes — overriding (urateam#35)");
|
|
107
|
+
fastResult.artifact.filesChanged = gitFilesChanged;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
20
110
|
return fastResult;
|
|
21
111
|
}
|
|
22
112
|
log.info({ stage }, "building handoff from git diff");
|
|
@@ -27,23 +117,21 @@ export async function extractHandoff(agentOutput, runId, issueId, stage, workdir
|
|
|
27
117
|
timestamp: new Date().toISOString(),
|
|
28
118
|
};
|
|
29
119
|
try {
|
|
30
|
-
//
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
120
|
+
// Slow path uses the same union helper. Necessary for the RALPH call
|
|
121
|
+
// sites in pipeline/runner.ts which always take the slow path
|
|
122
|
+
// (they invoke extractHandoff with agentOutput="" so parseJsonBlock
|
|
123
|
+
// returns null). The fast-path override in PR #95 + this PR's widening
|
|
124
|
+
// were the load-bearing fix for the rotulus#16 PR-body bug; the slow
|
|
125
|
+
// path benefits incidentally.
|
|
126
|
+
//
|
|
127
|
+
// diffStat must scan the same range as filesChanged or the "Modified
|
|
128
|
+
// N files: <stat tail>" approach string can be misleading (empty stat
|
|
129
|
+
// alongside non-empty files when the worktree is autoCommit-clean).
|
|
130
|
+
const statRange = baseRef ? `${baseRef}...HEAD` : "HEAD";
|
|
131
|
+
const [filesChanged, diffStat] = await Promise.all([
|
|
132
|
+
gitChangedFilesAcross(workdir, baseRef),
|
|
133
|
+
gitExecSafe(["diff", "--stat", statRange], workdir),
|
|
34
134
|
]);
|
|
35
|
-
// Parse porcelain output: "XY filename" — 2 status chars + 1 space + path
|
|
36
|
-
// For renames: "XY old -> new"
|
|
37
|
-
const filesChanged = statusOutput
|
|
38
|
-
? statusOutput.split("\n")
|
|
39
|
-
.filter(Boolean)
|
|
40
|
-
.map((line) => {
|
|
41
|
-
const path = line.substring(3);
|
|
42
|
-
const arrowIdx = path.indexOf(" -> ");
|
|
43
|
-
return arrowIdx >= 0 ? path.substring(arrowIdx + 4) : path;
|
|
44
|
-
})
|
|
45
|
-
.filter(Boolean)
|
|
46
|
-
: [];
|
|
47
135
|
// Best-effort summary from agent output. The last few lines often contain
|
|
48
136
|
// tool noise rather than meaningful prose. filesChanged is the reliable signal.
|
|
49
137
|
const lines = agentOutput.split("\n").filter((l) => l.trim().length > 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract-handoff.js","sourceRoot":"","sources":["../../src/executor/extract-handoff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"extract-handoff.js","sourceRoot":"","sources":["../../src/executor/extract-handoff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAE1D;;;GAGG;AACH,SAAS,iBAAiB,CAAC,YAAoB;IAC7C,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAC7B,OAAO,YAAY;SAChB,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC,CAAC;AACrB,CAA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E;SACrF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,mBAAmB,CAAC,CAAC;IACtD,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,kDAAkD,KAAK,IAAI,CAAC;QAC9F,UAAU,EAAE,KAAK;KAClB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../../src/executor/handoff.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAMnD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,eAAe,CAAC;IAC1B,0EAA0E;IAC1E,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAC9E,OAAO,EAAE,MAAM,GACd,eAAe,
|
|
1
|
+
{"version":3,"file":"handoff.d.ts","sourceRoot":"","sources":["../../src/executor/handoff.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAMnD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,eAAe,CAAC;IAC1B,0EAA0E;IAC1E,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAC9E,OAAO,EAAE,MAAM,GACd,eAAe,CAsBjB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GACZ,kBAAkB,CAqCpB"}
|
package/dist/executor/handoff.js
CHANGED
|
@@ -3,6 +3,12 @@ import { parseJsonBlock } from "./agent-stream.js";
|
|
|
3
3
|
import { createLogger } from "../logger.js";
|
|
4
4
|
const log = createLogger({ component: "Handoff" });
|
|
5
5
|
export function buildFallback(metadata, summary) {
|
|
6
|
+
// Note (urateam#35 Bug 1): if `summary` here is the agent's raw output
|
|
7
|
+
// truncated to 500 chars, it may contain JSON fragments from a self-
|
|
8
|
+
// critique block the agent leaked instead of structured prose. The fix
|
|
9
|
+
// for that is upstream prompt engineering (constraining the agent's
|
|
10
|
+
// structured-output instructions) — not summary sanitization here, which
|
|
11
|
+
// would be fragile regex hacks.
|
|
6
12
|
return {
|
|
7
13
|
...metadata,
|
|
8
14
|
summary: summary || `Stage ${metadata.stage} completed without structured output`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handoff.js","sourceRoot":"","sources":["../../src/executor/handoff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;AAQnD,MAAM,UAAU,aAAa,CAC3B,QAA8E,EAC9E,OAAe;IAEf,OAAO;QACL,GAAG,QAAQ;QACX,OAAO,EAAE,OAAO,IAAI,SAAS,QAAQ,CAA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1,4 +1,4 @@
|
|
|
1
|
-
export { agentProfiles } from "./profiles.js";
|
|
1
|
+
export { agentProfiles, getAgentProfiles, DEFAULT_AGENT_PROFILES } from "./profiles.js";
|
|
2
2
|
export { checkTestQuality, analyzeTestFile, isTestFile, extractTestBlocks, TRIVIAL_MATCHERS, BEHAVIORAL_MATCHERS, TRIVIAL_THRESHOLD, type TestFileAnalysis, type TestQualityResult, } from "./test-quality.js";
|
|
3
3
|
export { parseHandoffArtifact } from "./handoff.js";
|
|
4
4
|
export { executeStage, type ExecuteStageContext } from "./executor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,sBAAsB,EACtB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC"}
|
package/dist/executor/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { agentProfiles } from "./profiles.js";
|
|
1
|
+
export { agentProfiles, getAgentProfiles, DEFAULT_AGENT_PROFILES } from "./profiles.js";
|
|
2
2
|
export { checkTestQuality, analyzeTestFile, isTestFile, extractTestBlocks, TRIVIAL_MATCHERS, BEHAVIORAL_MATCHERS, TRIVIAL_THRESHOLD, } from "./test-quality.js";
|
|
3
3
|
export { parseHandoffArtifact } from "./handoff.js";
|
|
4
4
|
export { executeStage } from "./executor.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,GAGlB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,YAAY,EAA4B,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,aAAa,EACb,4BAA4B,EAC5B,sBAAsB,GAGvB,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
import type { AgentProfile } from "../types.js";
|
|
2
2
|
export declare const DEFAULT_MODEL = "claude-sonnet-4-6";
|
|
3
3
|
export declare const HAIKU_MODEL = "claude-haiku-4-5";
|
|
4
|
+
/**
|
|
5
|
+
* Default budget + tool surface for each pipeline stage. The defaults are
|
|
6
|
+
* sized for a "mature repo" — implement stage does real work, test stage
|
|
7
|
+
* runs an existing test suite, etc. They are intentionally NOT sized for
|
|
8
|
+
* bootstrapping new infrastructure (e.g., adding vitest + RN test setup
|
|
9
|
+
* from scratch in the test stage), which can blow through the default
|
|
10
|
+
* budget; see urateam#38.
|
|
11
|
+
*
|
|
12
|
+
* Operators with bootstrapping needs can override individual fields per
|
|
13
|
+
* stage via the URATEAM_AGENT_PROFILES env var (see `getAgentProfiles`).
|
|
14
|
+
*
|
|
15
|
+
* Deep-frozen so accidental mutation by a caller (e.g., a test that does
|
|
16
|
+
* `getAgentProfiles().test.maxTurns = 999`) throws instead of silently
|
|
17
|
+
* corrupting the shared defaults for the rest of process lifetime.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_AGENT_PROFILES: Record<string, AgentProfile>;
|
|
20
|
+
/**
|
|
21
|
+
* Backward-compat re-export. Prefer `getAgentProfiles()` so per-process
|
|
22
|
+
* env-var overrides are honored.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Use `getAgentProfiles()` for active profiles (env-var-merged).
|
|
25
|
+
* This alias only ever returns the unmerged defaults — useful for
|
|
26
|
+
* asserting the default shape in tests, but wrong for any consumer
|
|
27
|
+
* that wants the runtime-effective values.
|
|
28
|
+
*/
|
|
4
29
|
export declare const agentProfiles: Record<string, AgentProfile>;
|
|
30
|
+
/**
|
|
31
|
+
* Return the active per-stage agent profiles. Defaults can be overridden
|
|
32
|
+
* for the current process via the `URATEAM_AGENT_PROFILES` env var, which
|
|
33
|
+
* is parsed as JSON and merged on top of the defaults stage-by-stage:
|
|
34
|
+
*
|
|
35
|
+
* URATEAM_AGENT_PROFILES='{"test":{"maxTurns":50,"maxInputTokens":80000}}'
|
|
36
|
+
*
|
|
37
|
+
* Only the fields named in the override are changed; everything else keeps
|
|
38
|
+
* its default. Unknown stage names log a warn and are ignored. Malformed
|
|
39
|
+
* fields log a warn and are ignored without dropping the rest of the stage.
|
|
40
|
+
*
|
|
41
|
+
* Result is cached for process lifetime. Call `_resetAgentProfilesCache()`
|
|
42
|
+
* (test-only) to re-read the env var.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getAgentProfiles(): Record<string, AgentProfile>;
|
|
45
|
+
/** Test-only: reset the cached profiles so a new env var value takes effect. */
|
|
46
|
+
export declare function _resetAgentProfilesCache(): void;
|
|
5
47
|
//# sourceMappingURL=profiles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/executor/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/executor/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,eAAO,MAAM,aAAa,sBAAsB,CAAC;AACjD,eAAO,MAAM,WAAW,qBAAqB,CAAC;AAgB9C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CA+B9D,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,8BAAyB,CAAC;AAwEpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAuD/D;AAED,gFAAgF;AAChF,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C"}
|
|
@@ -1,6 +1,37 @@
|
|
|
1
|
+
import { createLogger } from "../logger.js";
|
|
2
|
+
const log = createLogger({ component: "executor.profiles" });
|
|
1
3
|
export const DEFAULT_MODEL = "claude-sonnet-4-6";
|
|
2
4
|
export const HAIKU_MODEL = "claude-haiku-4-5";
|
|
3
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Recursively freeze an object so accidental mutation by callers throws
|
|
7
|
+
* (in strict mode) rather than silently corrupting the shared defaults.
|
|
8
|
+
*/
|
|
9
|
+
function deepFreeze(o) {
|
|
10
|
+
if (o === null || typeof o !== "object")
|
|
11
|
+
return o;
|
|
12
|
+
for (const v of Object.values(o))
|
|
13
|
+
deepFreeze(v);
|
|
14
|
+
return Object.freeze(o);
|
|
15
|
+
}
|
|
16
|
+
/** Upper bounds for env-var overrides — protect against fat-finger like {"maxTurns": 999999}. */
|
|
17
|
+
const MAX_TURNS_CEILING = 500;
|
|
18
|
+
const MAX_INPUT_TOKENS_CEILING = 500_000;
|
|
19
|
+
/**
|
|
20
|
+
* Default budget + tool surface for each pipeline stage. The defaults are
|
|
21
|
+
* sized for a "mature repo" — implement stage does real work, test stage
|
|
22
|
+
* runs an existing test suite, etc. They are intentionally NOT sized for
|
|
23
|
+
* bootstrapping new infrastructure (e.g., adding vitest + RN test setup
|
|
24
|
+
* from scratch in the test stage), which can blow through the default
|
|
25
|
+
* budget; see urateam#38.
|
|
26
|
+
*
|
|
27
|
+
* Operators with bootstrapping needs can override individual fields per
|
|
28
|
+
* stage via the URATEAM_AGENT_PROFILES env var (see `getAgentProfiles`).
|
|
29
|
+
*
|
|
30
|
+
* Deep-frozen so accidental mutation by a caller (e.g., a test that does
|
|
31
|
+
* `getAgentProfiles().test.maxTurns = 999`) throws instead of silently
|
|
32
|
+
* corrupting the shared defaults for the rest of process lifetime.
|
|
33
|
+
*/
|
|
34
|
+
export const DEFAULT_AGENT_PROFILES = deepFreeze({
|
|
4
35
|
triage: {
|
|
5
36
|
tools: ["Read", "Glob", "Grep", "WebSearch"],
|
|
6
37
|
maxInputTokens: 30_000,
|
|
@@ -31,5 +62,119 @@ export const agentProfiles = {
|
|
|
31
62
|
maxTurns: 20,
|
|
32
63
|
model: DEFAULT_MODEL,
|
|
33
64
|
},
|
|
34
|
-
};
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Backward-compat re-export. Prefer `getAgentProfiles()` so per-process
|
|
68
|
+
* env-var overrides are honored.
|
|
69
|
+
*
|
|
70
|
+
* @deprecated Use `getAgentProfiles()` for active profiles (env-var-merged).
|
|
71
|
+
* This alias only ever returns the unmerged defaults — useful for
|
|
72
|
+
* asserting the default shape in tests, but wrong for any consumer
|
|
73
|
+
* that wants the runtime-effective values.
|
|
74
|
+
*/
|
|
75
|
+
export const agentProfiles = DEFAULT_AGENT_PROFILES;
|
|
76
|
+
let cachedProfiles = null;
|
|
77
|
+
function isStringArray(v) {
|
|
78
|
+
return Array.isArray(v) && v.every((x) => typeof x === "string");
|
|
79
|
+
}
|
|
80
|
+
function isPositiveIntegerWithin(v, max) {
|
|
81
|
+
return typeof v === "number" && Number.isInteger(v) && v > 0 && v <= max;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Apply a single override object on top of a base profile. Unknown stages
|
|
85
|
+
* are dropped with a warn (op-side typo protection). Known stages with
|
|
86
|
+
* malformed fields are dropped field-by-field (don't let one bad field
|
|
87
|
+
* tank the whole stage). The stage name is included in every warn payload
|
|
88
|
+
* so operators can pinpoint which stage triggered each warning.
|
|
89
|
+
*
|
|
90
|
+
* Returns a fresh object — never mutates `base`. The `tools` array is
|
|
91
|
+
* copied either from the override or from a fresh `[...base.tools]` copy
|
|
92
|
+
* so callers cannot reach back into DEFAULT_AGENT_PROFILES via the
|
|
93
|
+
* returned reference.
|
|
94
|
+
*/
|
|
95
|
+
function mergeOverride(base, override, stage) {
|
|
96
|
+
const merged = { ...base, tools: [...base.tools] };
|
|
97
|
+
if (isStringArray(override.tools)) {
|
|
98
|
+
merged.tools = override.tools.slice();
|
|
99
|
+
}
|
|
100
|
+
else if (override.tools !== undefined) {
|
|
101
|
+
log.warn({ stage, field: "tools", got: typeof override.tools }, "URATEAM_AGENT_PROFILES override: tools must be a string array — ignoring this field");
|
|
102
|
+
}
|
|
103
|
+
if (isPositiveIntegerWithin(override.maxInputTokens, MAX_INPUT_TOKENS_CEILING)) {
|
|
104
|
+
merged.maxInputTokens = override.maxInputTokens;
|
|
105
|
+
}
|
|
106
|
+
else if (override.maxInputTokens !== undefined) {
|
|
107
|
+
log.warn({ stage, field: "maxInputTokens", got: override.maxInputTokens, ceiling: MAX_INPUT_TOKENS_CEILING }, "URATEAM_AGENT_PROFILES override: maxInputTokens must be a positive integer ≤ ceiling — ignoring this field");
|
|
108
|
+
}
|
|
109
|
+
if (isPositiveIntegerWithin(override.maxTurns, MAX_TURNS_CEILING)) {
|
|
110
|
+
merged.maxTurns = override.maxTurns;
|
|
111
|
+
}
|
|
112
|
+
else if (override.maxTurns !== undefined) {
|
|
113
|
+
log.warn({ stage, field: "maxTurns", got: override.maxTurns, ceiling: MAX_TURNS_CEILING }, "URATEAM_AGENT_PROFILES override: maxTurns must be a positive integer ≤ ceiling — ignoring this field");
|
|
114
|
+
}
|
|
115
|
+
if (typeof override.model === "string" && override.model.length > 0) {
|
|
116
|
+
merged.model = override.model;
|
|
117
|
+
}
|
|
118
|
+
else if (override.model !== undefined) {
|
|
119
|
+
log.warn({ stage, field: "model", got: override.model }, "URATEAM_AGENT_PROFILES override: model must be a non-empty string — ignoring this field");
|
|
120
|
+
}
|
|
121
|
+
return merged;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Return the active per-stage agent profiles. Defaults can be overridden
|
|
125
|
+
* for the current process via the `URATEAM_AGENT_PROFILES` env var, which
|
|
126
|
+
* is parsed as JSON and merged on top of the defaults stage-by-stage:
|
|
127
|
+
*
|
|
128
|
+
* URATEAM_AGENT_PROFILES='{"test":{"maxTurns":50,"maxInputTokens":80000}}'
|
|
129
|
+
*
|
|
130
|
+
* Only the fields named in the override are changed; everything else keeps
|
|
131
|
+
* its default. Unknown stage names log a warn and are ignored. Malformed
|
|
132
|
+
* fields log a warn and are ignored without dropping the rest of the stage.
|
|
133
|
+
*
|
|
134
|
+
* Result is cached for process lifetime. Call `_resetAgentProfilesCache()`
|
|
135
|
+
* (test-only) to re-read the env var.
|
|
136
|
+
*/
|
|
137
|
+
export function getAgentProfiles() {
|
|
138
|
+
if (cachedProfiles)
|
|
139
|
+
return cachedProfiles;
|
|
140
|
+
const raw = process.env.URATEAM_AGENT_PROFILES;
|
|
141
|
+
if (!raw) {
|
|
142
|
+
cachedProfiles = DEFAULT_AGENT_PROFILES;
|
|
143
|
+
return cachedProfiles;
|
|
144
|
+
}
|
|
145
|
+
let parsed;
|
|
146
|
+
try {
|
|
147
|
+
parsed = JSON.parse(raw);
|
|
148
|
+
}
|
|
149
|
+
catch (err) {
|
|
150
|
+
log.warn({ err: err.message }, "URATEAM_AGENT_PROFILES is not valid JSON — falling back to defaults");
|
|
151
|
+
cachedProfiles = DEFAULT_AGENT_PROFILES;
|
|
152
|
+
return cachedProfiles;
|
|
153
|
+
}
|
|
154
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
155
|
+
log.warn("URATEAM_AGENT_PROFILES must be a JSON object keyed by stage name — falling back to defaults");
|
|
156
|
+
cachedProfiles = DEFAULT_AGENT_PROFILES;
|
|
157
|
+
return cachedProfiles;
|
|
158
|
+
}
|
|
159
|
+
const overrides = parsed;
|
|
160
|
+
const result = { ...DEFAULT_AGENT_PROFILES };
|
|
161
|
+
for (const [stage, override] of Object.entries(overrides)) {
|
|
162
|
+
if (!(stage in DEFAULT_AGENT_PROFILES)) {
|
|
163
|
+
log.warn({ stage, knownStages: Object.keys(DEFAULT_AGENT_PROFILES) }, "URATEAM_AGENT_PROFILES override targets unknown stage — ignoring");
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (!override || typeof override !== "object" || Array.isArray(override)) {
|
|
167
|
+
log.warn({ stage, got: typeof override }, "URATEAM_AGENT_PROFILES per-stage value must be an object — ignoring");
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
result[stage] = mergeOverride(DEFAULT_AGENT_PROFILES[stage], override, stage);
|
|
171
|
+
log.info({ stage, profile: result[stage] }, "URATEAM_AGENT_PROFILES override applied");
|
|
172
|
+
}
|
|
173
|
+
cachedProfiles = result;
|
|
174
|
+
return cachedProfiles;
|
|
175
|
+
}
|
|
176
|
+
/** Test-only: reset the cached profiles so a new env var value takes effect. */
|
|
177
|
+
export function _resetAgentProfilesCache() {
|
|
178
|
+
cachedProfiles = null;
|
|
179
|
+
}
|
|
35
180
|
//# sourceMappingURL=profiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/executor/profiles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/executor/profiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,GAAG,GAAG,YAAY,CAAC,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAE7D,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC;AACjD,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAE9C;;;GAGG;AACH,SAAS,UAAU,CAAI,CAAI;IACzB,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,CAAC,CAAC;IAClD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAW,CAAC;QAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC1D,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAC1B,CAAC;AAED,iGAAiG;AACjG,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAC9B,MAAM,wBAAwB,GAAG,OAAO,CAAC;AAEzC;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAiC,UAAU,CAAC;IAC7E,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC;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AAW,CAAC,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,qBAAqB,EAAE,CAAC;QAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;KAC3B,GAAG,OAAO,CAAC,IAAI,CAAC;IAmGjB;;;;OAIG;YACW,iBAAiB;YAajB,eAAe;YA44Cf,YAAY;IAiF1B;;;OAGG;YACW,gBAAgB;IAoC9B;;;;;;;;;;;;;;;;;OAiBG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAyEvC;;;;OAIG;YACW,oBAAoB;IAiBlC;;;OAGG;IACG,qBAAqB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAqCvD;;;;;;;;;OASG;YACW,uBAAuB;IA2UrC,OAAO,CAAC,gBAAgB;CAoBzB"}
|
package/dist/pipeline/runner.js
CHANGED
|
@@ -587,7 +587,9 @@ export class PipelineRunner {
|
|
|
587
587
|
run.totalOutputTokens += result.outputTokens;
|
|
588
588
|
for (let iteration = 1; iteration <= ralphIterations; iteration++) {
|
|
589
589
|
const handoffResult = await extractHandoff("", // extractHandoff reads git diff from worktree, no agent output needed
|
|
590
|
-
runId, sanitizedIssue.id, stage, worktreePath
|
|
590
|
+
runId, sanitizedIssue.id, stage, worktreePath,
|
|
591
|
+
// Full ref form (extractHandoff doesn't prepend `origin/`).
|
|
592
|
+
`origin/${repoConfig.defaultBranch}`);
|
|
591
593
|
runLog.info({ iteration, maxIterations: ralphIterations }, "RALPH: checking requirements");
|
|
592
594
|
const check = await checkRequirements(sanitizedIssue, handoffResult, worktreePath);
|
|
593
595
|
if (check.satisfied) {
|
|
@@ -882,7 +884,9 @@ export class PipelineRunner {
|
|
|
882
884
|
// (b) unnecessary draft when re-implement actually fixes the gaps.
|
|
883
885
|
if (fixStage === "implement" && ralphIterations > 0 && fixResult.status === "completed" && fixResult.handoffArtifact) {
|
|
884
886
|
const rfHandoffResult = await extractHandoff("", // extractHandoff reads git diff from worktree, no agent output needed
|
|
885
|
-
runId, sanitizedIssue.id, fixStage, worktreePath
|
|
887
|
+
runId, sanitizedIssue.id, fixStage, worktreePath,
|
|
888
|
+
// Full ref form (extractHandoff doesn't prepend `origin/`).
|
|
889
|
+
`origin/${repoConfig.defaultBranch}`);
|
|
886
890
|
runLog.info({ rfIteration }, "RALPH: re-checking requirements after review-fix implement");
|
|
887
891
|
const rfCheck = await checkRequirements(sanitizedIssue, rfHandoffResult, worktreePath);
|
|
888
892
|
ralphSatisfied = rfCheck.satisfied;
|