@tangle-network/agent-runtime 0.172.0 → 0.174.0
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/{activation-DTleO7Fl.js → activation-DQo7-oIF.js} +2 -2
- package/dist/{activation-DTleO7Fl.js.map → activation-DQo7-oIF.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{authoring-c9yTIa3G.js → authoring-B4aR-Tea.js} +2 -2
- package/dist/{authoring-c9yTIa3G.js.map → authoring-B4aR-Tea.js.map} +1 -1
- package/dist/durable.d.ts +1 -1
- package/dist/durable.js +1 -1
- package/dist/{graph-CtMnqYYC.js → graph-CoSt0kup.js} +2 -2
- package/dist/{graph-CtMnqYYC.js.map → graph-CoSt0kup.js.map} +1 -1
- package/dist/graph.d.ts +2 -2
- package/dist/graph.js +3 -3
- package/dist/{improvement-cycle-ipnDcl3P.js → improvement-cycle-BZH9dewp.js} +181 -12
- package/dist/improvement-cycle-BZH9dewp.js.map +1 -0
- package/dist/{index-cFm21prV.d.ts → index-CIhkH7mq.d.ts} +40 -3
- package/dist/{index-DEEN055X.d.ts → index-Dk5X9eKg.d.ts} +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +7 -7
- package/dist/intelligence.d.ts +2 -2
- package/dist/intelligence.js +3 -3
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +7 -7
- package/dist/{knowledge-BHfAAu6C.js → knowledge-DjWWfbfX.js} +3 -3
- package/dist/{knowledge-BHfAAu6C.js.map → knowledge-DjWWfbfX.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-B3ju0qWS.js → loop-runner-bin-CTCi_rSV.js} +3 -3
- package/dist/{loop-runner-bin-B3ju0qWS.js.map → loop-runner-bin-CTCi_rSV.js.map} +1 -1
- package/dist/{loop-runner-bin-BGcW6Gm7.d.ts → loop-runner-bin-DRYApMiu.d.ts} +2 -2
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-CfsSJ2sn.js → openai-tools-B4BPplKi.js} +2 -2
- package/dist/{openai-tools-CfsSJ2sn.js.map → openai-tools-B4BPplKi.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{redact-DkObldQP.d.ts → redact-DvLf4x1m.d.ts} +53 -7
- package/dist/{runtime-B0HZbuEv.d.ts → runtime-D5u1M6T5.d.ts} +150 -94
- package/dist/{runtime-ckAefgVV.js → runtime-l9Q9-Dal.js} +6 -6
- package/dist/{runtime-ckAefgVV.js.map → runtime-l9Q9-Dal.js.map} +1 -1
- package/dist/{structural-rollout-DjUoh2aA.js → structural-rollout-CIK7nvSH.js} +2 -2
- package/dist/{structural-rollout-DjUoh2aA.js.map → structural-rollout-CIK7nvSH.js.map} +1 -1
- package/dist/{supervise-CnHd8x54.js → supervise-Dq_D3QbE.js} +5 -3
- package/dist/{supervise-CnHd8x54.js.map → supervise-Dq_D3QbE.js.map} +1 -1
- package/dist/{supervisor-Dw-5mGKr.js → supervisor-cAFpYJWF.js} +363 -68
- package/dist/supervisor-cAFpYJWF.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +11 -11
- package/package.json +1 -1
- package/dist/improvement-cycle-ipnDcl3P.js.map +0 -1
- package/dist/supervisor-Dw-5mGKr.js.map +0 -1
|
@@ -3,8 +3,8 @@ import { n as streamAgentTurn, t as collectAgentTurn } from "./stream-agent-turn
|
|
|
3
3
|
import { n as detachedSnapshot } from "./snapshot-CTAf4uuA.js";
|
|
4
4
|
import { $ as parseAgentCandidateProfileActivation, J as assertCandidateProfileBinding, K as agentCandidateProfileAsAgentProfile, Q as omitUndefinedObjectFields, Y as createAgentCandidateProfileActivation, Z as materializeAgentCandidateProfilePlan, at as canonicalCandidateDocument, ct as immutableCandidateValue, d as verifiedResourceTextByDigest, dt as verifyCanonicalCandidateDocument, et as parseExactAgentProfile, f as verifyAgentCandidateBundle, it as canonicalCandidateDigest$1, lt as omitTopLevelDigest, n as executePreparedAgentCandidate, q as applyExactAgentProfileDiff, rt as canonicalCandidateBytes, t as prepareAgentCandidateExecution } from "./prepare-BAyaNoZu.js";
|
|
5
5
|
import { a as concreteProfileModel, t as assertExecutableAgentProfile } from "./model-policy-Sw4ywhtL.js";
|
|
6
|
-
import {
|
|
7
|
-
import { D as optimizerMethod, a as defaultStructuralRolloutPolicy } from "./structural-rollout-
|
|
6
|
+
import { Qt as runSettledCommand, U as createExecutor } from "./supervisor-cAFpYJWF.js";
|
|
7
|
+
import { D as optimizerMethod, a as defaultStructuralRolloutPolicy } from "./structural-rollout-CIK7nvSH.js";
|
|
8
8
|
import { t as runAnalystLoop } from "./analyst-loop-Bouu53-l.js";
|
|
9
9
|
import { AGENT_IMPROVEMENT_SOURCE_METADATA_KEY, agentCandidateMaterializationReceiptSchema, agentCandidateRunReceiptSchema, agentImprovementActivationSchema, agentImprovementProposalSchema, agentImprovementReviewSchema, agentImprovementSourceMetadata, agentImprovementSourceSchema, agentProfileDiffSchema, agentProfileImprovementArmSchema, agentProfileImprovementExecutionRefSchema, agentProfileModelHintsSchema, agentProfileSchema, applyAgentProfileDiff, candidateExecutionEvidenceSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, changedProfileImprovementSurfaces, defineAgentProfileDiff, diffAgentProfiles, numbersApproximatelyEqual, sha256DigestSchema } from "@tangle-network/agent-interface";
|
|
10
10
|
import { CostLedger, canonicalJson, makeProposalFinding } from "@tangle-network/agent-eval";
|
|
@@ -12,11 +12,78 @@ import { campaignScenarioIdentity, campaignSplitDigestFromIdentities, compareOpt
|
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
13
|
import { basename, join, resolve } from "node:path";
|
|
14
14
|
import { realpath } from "node:fs/promises";
|
|
15
|
-
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
15
|
+
import { existsSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync } from "node:fs";
|
|
16
16
|
import { spawnSync } from "node:child_process";
|
|
17
|
+
import { tmpdir } from "node:os";
|
|
17
18
|
import { isDeepStrictEqual } from "node:util";
|
|
18
19
|
import { assertProposalFindings } from "@tangle-network/agent-eval/analyst";
|
|
19
20
|
import { measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, runAgentProfileImprovementExperiment, runCandidateExperiment, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateExperiment, selfImprove, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison } from "@tangle-network/agent-eval/contract";
|
|
21
|
+
//#region src/improvement/worktree-tree.ts
|
|
22
|
+
/**
|
|
23
|
+
* The exact content of a candidate worktree, as a Git tree object.
|
|
24
|
+
*
|
|
25
|
+
* A multi-shot candidate edits ONE directory in place, so the tree a shot
|
|
26
|
+
* produced is gone as soon as the next shot writes over it. Writing that
|
|
27
|
+
* content into the object store is what makes an earlier tree recoverable:
|
|
28
|
+
* `agenticGenerator` snapshots a tree that verified, and puts it back when a
|
|
29
|
+
* later shot ends the budget on a worse one.
|
|
30
|
+
*
|
|
31
|
+
* The snapshot stages into a PRIVATE index file, so the index the driver later
|
|
32
|
+
* commits from is untouched.
|
|
33
|
+
*/
|
|
34
|
+
/** Write the worktree's current content into the object store and return its tree id. */
|
|
35
|
+
function snapshotWorktreeTree(worktreePath) {
|
|
36
|
+
const scratch = mkdtempSync(join(tmpdir(), "agentic-generator-tree-"));
|
|
37
|
+
const indexFile = join(scratch, "index");
|
|
38
|
+
try {
|
|
39
|
+
git(worktreePath, ["read-tree", "HEAD"], indexFile);
|
|
40
|
+
git(worktreePath, ["add", "--all"], indexFile);
|
|
41
|
+
return git(worktreePath, ["write-tree"], indexFile);
|
|
42
|
+
} finally {
|
|
43
|
+
rmSync(scratch, {
|
|
44
|
+
recursive: true,
|
|
45
|
+
force: true
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Put a snapshotted tree back into the worktree, then prove the directory
|
|
51
|
+
* holds exactly that tree.
|
|
52
|
+
*
|
|
53
|
+
* The proof is not ceremony: a restore that lands the wrong bytes ships the
|
|
54
|
+
* wrong candidate, and every artifact downstream still reads as though the
|
|
55
|
+
* best tree shipped.
|
|
56
|
+
*/
|
|
57
|
+
function restoreWorktreeTree(worktreePath, tree) {
|
|
58
|
+
git(worktreePath, [
|
|
59
|
+
"read-tree",
|
|
60
|
+
"-u",
|
|
61
|
+
"--reset",
|
|
62
|
+
tree
|
|
63
|
+
]);
|
|
64
|
+
git(worktreePath, [
|
|
65
|
+
"clean",
|
|
66
|
+
"--force",
|
|
67
|
+
"-d",
|
|
68
|
+
"--quiet"
|
|
69
|
+
]);
|
|
70
|
+
const restored = snapshotWorktreeTree(worktreePath);
|
|
71
|
+
if (restored !== tree) throw new Error(`agenticGenerator: restoring tree ${tree} into ${worktreePath} produced ${restored}`);
|
|
72
|
+
}
|
|
73
|
+
function git(cwd, args, indexFile) {
|
|
74
|
+
const env = { ...process.env };
|
|
75
|
+
if (indexFile) env.GIT_INDEX_FILE = indexFile;
|
|
76
|
+
else delete env.GIT_INDEX_FILE;
|
|
77
|
+
const result = spawnSync("git", args, {
|
|
78
|
+
cwd,
|
|
79
|
+
encoding: "utf-8",
|
|
80
|
+
env
|
|
81
|
+
});
|
|
82
|
+
if (result.error) throw new Error(`agenticGenerator: git ${args[0]} failed to spawn in ${cwd}: ${result.error.message}`);
|
|
83
|
+
if (result.status !== 0) throw new Error(`agenticGenerator: git ${args[0]} exited ${result.status} in ${cwd}: ${result.stderr.trim()}`);
|
|
84
|
+
return result.stdout.trim();
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
20
87
|
//#region src/improvement/agentic-generator.ts
|
|
21
88
|
/**
|
|
22
89
|
*
|
|
@@ -28,9 +95,12 @@ import { measuredComparisonFromAgentProfileImprovementExperiment, measuredCompar
|
|
|
28
95
|
*
|
|
29
96
|
* Every paid shot enters Runtime through `createExecutor` + `streamAgentTurn`.
|
|
30
97
|
* The caller supplies the exact `AgentProfile` and a worktree-aware executor
|
|
31
|
-
* placement; Runtime validates and records the profile that actually ran.
|
|
32
|
-
*
|
|
33
|
-
*
|
|
98
|
+
* placement; Runtime validates and records the profile that actually ran. Two
|
|
99
|
+
* built-in placements edit the supplied worktree itself: `{ backend:'cli-in-place',
|
|
100
|
+
* workspacePath: worktreePath }` runs a local coding CLI (claude-code / codex /
|
|
101
|
+
* opencode / pi) in that directory, and `{ backend:'bridge', cwd: worktreePath }`
|
|
102
|
+
* runs a cli-bridge session there. `cli-worktree` is NOT one of them — it cuts a
|
|
103
|
+
* worktree of its own, so every shot would read as an empty tree.
|
|
34
104
|
*
|
|
35
105
|
* `maxShots` is the DEPTH dial — a multi-shot verify-in-session loop, NOT the
|
|
36
106
|
* kernel `runAgentRounds`. Each shot runs one full harness session in the (persistent)
|
|
@@ -40,10 +110,20 @@ import { measuredComparisonFromAgentProfileImprovementExperiment, measuredCompar
|
|
|
40
110
|
* (the worktree persists, so the harness RESUMES atop its own failing
|
|
41
111
|
* edits with the error in hand — no session-specific retry path needed)
|
|
42
112
|
* - dirty + `verify` ok (or no verifier configured) → return the candidate
|
|
113
|
+
* - dirty + `verify` ok + `keepGoing` → bank the tree and spend the next shot
|
|
43
114
|
* A candidate that never verifies within `maxShots` is discarded (`applied:
|
|
44
115
|
* false`), never shipped — if you configured a verifier, a non-passing tree is
|
|
45
116
|
* not a candidate. With no verifier, the first dirty shot is the candidate.
|
|
46
117
|
*
|
|
118
|
+
* BEST-OF-N is the `keepGoing` path, and the loop owns it end to end. A
|
|
119
|
+
* verifier that passes a tree and asks for another shot has its tree
|
|
120
|
+
* snapshotted as a Git tree object; when the budget ends, the highest-`score`
|
|
121
|
+
* tree is RESTORED into the worktree and returned as the candidate. So the
|
|
122
|
+
* caller ranks and the loop moves the bytes — a caller never has to write a
|
|
123
|
+
* passing tree back itself. The budget ends on the last shot, or earlier on a
|
|
124
|
+
* `keepGoing`-less pass, and a last shot that broke or reverted the change does
|
|
125
|
+
* not cost the candidate the verified tree an earlier shot produced.
|
|
126
|
+
*
|
|
47
127
|
* @stable
|
|
48
128
|
*/
|
|
49
129
|
const RAW_TRACE_ANALYST_ID = "raw-trace-distiller";
|
|
@@ -68,13 +148,37 @@ function agenticGenerator(opts) {
|
|
|
68
148
|
const basePrompt = opts.buildPrompt({ findings });
|
|
69
149
|
if (typeof basePrompt !== "string" || basePrompt.trim().length === 0) throw new Error("agenticGenerator: buildPrompt must return a non-empty string");
|
|
70
150
|
const executorConfig = opts.executorForWorktree(worktreePath);
|
|
71
|
-
if (executorConfig.backend === "bridge" && executorConfig.cwd
|
|
151
|
+
if (executorConfig.backend === "bridge" && !samePath(executorConfig.cwd, worktreePath)) throw new Error("agenticGenerator: bridge executor cwd must equal the candidate worktree path");
|
|
152
|
+
if (executorConfig.backend === "cli-in-place" && !samePath(executorConfig.workspacePath, worktreePath)) throw new Error("agenticGenerator: cli-in-place executor workspacePath must equal the candidate worktree path");
|
|
72
153
|
const factory = createExecutor(executorConfig);
|
|
73
154
|
const needsRawTraceEvidence = requiresRawTraceEvidence(findings);
|
|
74
155
|
const shots = Math.max(1, maxShots);
|
|
75
156
|
let attemptNote = "";
|
|
157
|
+
let best = null;
|
|
158
|
+
let scored = null;
|
|
159
|
+
let lastReceipt = null;
|
|
160
|
+
/** Ship the best tree this candidate produced, restoring it when a later
|
|
161
|
+
* shot wrote over it. */
|
|
162
|
+
const shipBankedTree = async (receipt, banked) => {
|
|
163
|
+
const restoredFromShot = banked.onDisk ? null : banked.shot;
|
|
164
|
+
if (!banked.onDisk) {
|
|
165
|
+
if (banked.tree === null) throw new Error(`agenticGenerator: shot ${banked.shot} produced the best tree but it was never snapshotted`);
|
|
166
|
+
restoreWorktreeTree(worktreePath, banked.tree);
|
|
167
|
+
banked.onDisk = true;
|
|
168
|
+
}
|
|
169
|
+
signal.throwIfAborted();
|
|
170
|
+
await emitShotDisposition(opts.onShotDisposition, receipt, {
|
|
171
|
+
kind: "accepted",
|
|
172
|
+
worktreePath,
|
|
173
|
+
verified: true,
|
|
174
|
+
restoredFromShot
|
|
175
|
+
});
|
|
176
|
+
signal.throwIfAborted();
|
|
177
|
+
return acceptedCandidate(findings);
|
|
178
|
+
};
|
|
76
179
|
for (let shot = 0; shot < shots; shot++) {
|
|
77
180
|
signal.throwIfAborted();
|
|
181
|
+
if (best) best.onDisk = false;
|
|
78
182
|
const taskPrompt = attemptNote ? `${basePrompt}\n\n${attemptNote}` : basePrompt;
|
|
79
183
|
const startedAt = /* @__PURE__ */ new Date();
|
|
80
184
|
let turn = null;
|
|
@@ -140,6 +244,7 @@ function agenticGenerator(opts) {
|
|
|
140
244
|
costReceipt,
|
|
141
245
|
error: shotError
|
|
142
246
|
});
|
|
247
|
+
lastReceipt = receipt;
|
|
143
248
|
await emitShotReceipt(opts.onShotCompleted, receipt, execution, shotError);
|
|
144
249
|
signal.throwIfAborted();
|
|
145
250
|
if (!execution) throw new Error("agenticGenerator: author shot completed without a Runtime turn");
|
|
@@ -186,7 +291,8 @@ function agenticGenerator(opts) {
|
|
|
186
291
|
await emitShotDisposition(opts.onShotDisposition, receipt, {
|
|
187
292
|
kind: "accepted",
|
|
188
293
|
worktreePath,
|
|
189
|
-
verified: false
|
|
294
|
+
verified: false,
|
|
295
|
+
restoredFromShot: null
|
|
190
296
|
});
|
|
191
297
|
signal.throwIfAborted();
|
|
192
298
|
return acceptedCandidate(findings);
|
|
@@ -201,14 +307,35 @@ function agenticGenerator(opts) {
|
|
|
201
307
|
return rethrowShotSetupError(opts.onShotDisposition, receipt, worktreePath, "verification", cause);
|
|
202
308
|
}
|
|
203
309
|
if (result.ok) {
|
|
310
|
+
const score = admittedScore(result, scored, shot);
|
|
311
|
+
scored = score !== null;
|
|
312
|
+
const previousBest = best;
|
|
313
|
+
let banked;
|
|
314
|
+
if (previousBest === null || (score ?? 0) >= (previousBest.score ?? 0)) banked = {
|
|
315
|
+
shot: shot + 1,
|
|
316
|
+
score,
|
|
317
|
+
tree: null,
|
|
318
|
+
onDisk: true
|
|
319
|
+
};
|
|
320
|
+
else banked = previousBest;
|
|
321
|
+
const becomesBest = banked !== previousBest;
|
|
322
|
+
best = banked;
|
|
323
|
+
if (result.keepGoing !== true) {
|
|
324
|
+
signal.throwIfAborted();
|
|
325
|
+
return await shipBankedTree(receipt, banked);
|
|
326
|
+
}
|
|
327
|
+
if (becomesBest && shot < shots - 1) banked.tree = snapshotWorktreeTree(worktreePath);
|
|
204
328
|
signal.throwIfAborted();
|
|
205
329
|
await emitShotDisposition(opts.onShotDisposition, receipt, {
|
|
206
|
-
kind: "
|
|
330
|
+
kind: "kept",
|
|
207
331
|
worktreePath,
|
|
208
|
-
|
|
332
|
+
score,
|
|
333
|
+
best: becomesBest,
|
|
334
|
+
feedback: result.feedback ?? null
|
|
209
335
|
});
|
|
210
336
|
signal.throwIfAborted();
|
|
211
|
-
|
|
337
|
+
attemptNote = keptNote(result.feedback);
|
|
338
|
+
continue;
|
|
212
339
|
}
|
|
213
340
|
signal.throwIfAborted();
|
|
214
341
|
await emitShotDisposition(opts.onShotDisposition, receipt, {
|
|
@@ -220,6 +347,10 @@ function agenticGenerator(opts) {
|
|
|
220
347
|
signal.throwIfAborted();
|
|
221
348
|
attemptNote = failureNote(result.feedback);
|
|
222
349
|
}
|
|
350
|
+
if (best !== null) {
|
|
351
|
+
if (!lastReceipt) throw new Error("agenticGenerator: a tree was banked without a shot receipt");
|
|
352
|
+
return await shipBankedTree(lastReceipt, best);
|
|
353
|
+
}
|
|
223
354
|
return {
|
|
224
355
|
applied: false,
|
|
225
356
|
summary: ""
|
|
@@ -227,6 +358,14 @@ function agenticGenerator(opts) {
|
|
|
227
358
|
}
|
|
228
359
|
};
|
|
229
360
|
}
|
|
361
|
+
/** The rank a passing tree carries, refusing a set of trees that cannot be ordered. */
|
|
362
|
+
function admittedScore(result, scored, shot) {
|
|
363
|
+
const has = result.score !== void 0;
|
|
364
|
+
if (scored !== null && has !== scored) throw new Error(`agenticGenerator: verify ${has ? "scored" : "did not score"} the tree from shot ${shot + 1} and ${scored ? "scored" : "did not score"} an earlier passing tree; a scored tree cannot be ranked against an unscored one`);
|
|
365
|
+
if (!has) return null;
|
|
366
|
+
if (typeof result.score !== "number" || !Number.isFinite(result.score)) throw new Error(`agenticGenerator: verify returned a non-finite score (${String(result.score)}) for shot ${shot + 1}`);
|
|
367
|
+
return result.score;
|
|
368
|
+
}
|
|
230
369
|
async function emitShotReceipt(callback, receipt, execution, primaryError) {
|
|
231
370
|
try {
|
|
232
371
|
await callback?.(receipt, execution);
|
|
@@ -369,6 +508,18 @@ function failureNote(feedback) {
|
|
|
369
508
|
detail ? `Verifier output:\n${truncate$1(detail, 4e3)}` : "No verifier detail was captured."
|
|
370
509
|
].join("\n");
|
|
371
510
|
}
|
|
511
|
+
/** Next-shot feedback when the worktree PASSED and the verifier asked for
|
|
512
|
+
* another shot. The passing tree is banked, so the author is told to improve
|
|
513
|
+
* it rather than protect it — a worse tree cannot cost it the candidate. */
|
|
514
|
+
function keptNote(feedback) {
|
|
515
|
+
const detail = feedback?.trim();
|
|
516
|
+
return [
|
|
517
|
+
"NOTE: your edits are in the working tree and verification PASSED.",
|
|
518
|
+
"Shots remain in this budget — keep improving the change in place, do not revert it.",
|
|
519
|
+
"The best version you produce is the one that ships.",
|
|
520
|
+
detail ? `Verifier output:\n${truncate$1(detail, 4e3)}` : "No verifier detail was captured."
|
|
521
|
+
].join("\n");
|
|
522
|
+
}
|
|
372
523
|
function rawTraceEvidenceProblem(worktreePath, findings) {
|
|
373
524
|
if (worktreeChangedPaths(worktreePath).filter((path) => path !== RAW_TRACE_DIAGNOSIS_PATH).length === 0) return [`NOTE: raw-trace mode requires a real code/config edit in addition to ${RAW_TRACE_DIAGNOSIS_PATH}.`, "Your previous attempt only changed the diagnosis artifact. Inspect the cited traces and make the causal code change."].join("\n");
|
|
374
525
|
const diagnosisPath = join(worktreePath, RAW_TRACE_DIAGNOSIS_PATH);
|
|
@@ -471,6 +622,24 @@ function truncate$1(s, n) {
|
|
|
471
622
|
* something is genuinely broken (git missing, corrupt index, killed mid-run).
|
|
472
623
|
* Folding that into `false` would silently discard a candidate and mask the
|
|
473
624
|
* real failure — forbidden by the no-silent-fallbacks doctrine. */
|
|
625
|
+
/** Do two names address the same directory? An in-place placement is only in-place if it names the
|
|
626
|
+
* worktree the driver created, and a byte comparison answers that wrongly on a platform whose
|
|
627
|
+
* temporary directory is a symlink: macOS reports `/var/folders/...` where the resolved path is
|
|
628
|
+
* `/private/var/folders/...`, and both are the same directory. */
|
|
629
|
+
function samePath(candidate, worktreePath) {
|
|
630
|
+
if (typeof candidate !== "string" || candidate.length === 0) return false;
|
|
631
|
+
if (candidate === worktreePath) return true;
|
|
632
|
+
return canonicalPath(candidate) === canonicalPath(worktreePath);
|
|
633
|
+
}
|
|
634
|
+
/** The resolved path, or the lexically absolute one when the name does not exist — a name that
|
|
635
|
+
* cannot be resolved is a mismatch the caller is told about, not an error to swallow. */
|
|
636
|
+
function canonicalPath(path) {
|
|
637
|
+
try {
|
|
638
|
+
return realpathSync(path);
|
|
639
|
+
} catch {
|
|
640
|
+
return resolve(path);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
474
643
|
function worktreeDirty(worktreePath) {
|
|
475
644
|
return worktreeChangedPaths(worktreePath).length > 0;
|
|
476
645
|
}
|
|
@@ -3058,4 +3227,4 @@ function sameOrderedValues(left, right) {
|
|
|
3058
3227
|
//#endregion
|
|
3059
3228
|
export { agentImprovementTargetInput as A, ROLLOUT_POLICY_EXTENSION as B, optimizationActivationReceiptFromMetadata as C, agentImprovementProfileSurfaceDigest as D, agentImprovementProfileDiffs as E, isAgentImprovementProfileSurface as F, structuralRolloutPolicyFromProfile as G, normalizeRolloutPolicy as H, isAgentProfileMeasuredSurface as I, defaultBuildPrompt as J, agenticGenerator as K, improve as L, agentProfileImprovementStateDigest as M, assertProfileImprovementTargetsShareIdentity as N, agentImprovementProfileSurfaceInput as O, buildAgentImprovementActivationTargets as P, withMethodRuntimeControls as R, createOptimizationActivationReceipt as S, AGENT_PROFILE_MEASURED_SURFACES as T, parseRolloutPolicy as U, applyRolloutPolicyToProfile as V, serializeRolloutPolicy as W, profilePolicyWithBudget as _, executeAgentCandidateExperimentCell as a, profileTaskScenarioIdentity as b, requireSealedCandidateExperiment as c, verifyAgentImprovementActivation as d, verifyAgentImprovementProposal as f, profileImprovementMetadata as g, createProfileImprovementCostLedger as h, createAgentImprovementProposal as i, agentImprovementTargetProfileDiffs as j, agentImprovementTargetDigest as k, reviewAgentImprovementProposal as l, verifyCandidateExecutionEvidence as m, createAgentImprovementActivation as n, proposeAgentImprovement as o, verifyAgentImprovementReview as p, commandVerifier as q, createAgentImprovementMeasuredComparison as r, proposeAgentProfileImprovement as s, AgentCandidateExperimentCellExecutionError as t, runAgentCandidateExperiment as u, profilePreparationAccounting as v, AGENT_IMPROVEMENT_PROFILE_SURFACES as w, sealProfileImprovementBenchmark as x, profileStateDigest as y, rawTraceDistiller as z };
|
|
3060
3229
|
|
|
3061
|
-
//# sourceMappingURL=improvement-cycle-
|
|
3230
|
+
//# sourceMappingURL=improvement-cycle-BZH9dewp.js.map
|