@tangle-network/agent-runtime 0.126.0 → 0.131.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.
Files changed (146) hide show
  1. package/README.md +70 -20
  2. package/dist/{activation-DhWJ3p8N.js → activation-BCzMOTaV.js} +3 -3
  3. package/dist/{activation-DhWJ3p8N.js.map → activation-BCzMOTaV.js.map} +1 -1
  4. package/dist/agent.d.ts +2 -3
  5. package/dist/agent.js +4 -5
  6. package/dist/agent.js.map +1 -1
  7. package/dist/{analyst-loop-DvSciOfB.js → analyst-loop-BE8cDs5Q.js} +2 -2
  8. package/dist/{analyst-loop-DvSciOfB.js.map → analyst-loop-BE8cDs5Q.js.map} +1 -1
  9. package/dist/analyst-loop.d.ts +1 -1
  10. package/dist/analyst-loop.js +1 -1
  11. package/dist/authoring-CvHwo1oW.js +163 -0
  12. package/dist/authoring-CvHwo1oW.js.map +1 -0
  13. package/dist/candidate-execution/index.js +4 -4
  14. package/dist/{candidate-execution-BFpq-Xi6.js → candidate-execution-BNxKr-Bu.js} +5 -5
  15. package/dist/{candidate-execution-BFpq-Xi6.js.map → candidate-execution-BNxKr-Bu.js.map} +1 -1
  16. package/dist/{conversation-BpLQZGPH.js → conversation-DNtxaJ1Z.js} +113 -31
  17. package/dist/conversation-DNtxaJ1Z.js.map +1 -0
  18. package/dist/conversation.d.ts +2 -2
  19. package/dist/conversation.js +2 -2
  20. package/dist/environment-provider-CxvSd1W6.d.ts +86 -0
  21. package/dist/{environment-provider-DqFS6FSZ.js → environment-provider-Dyg8DtLK.js} +8 -4
  22. package/dist/environment-provider-Dyg8DtLK.js.map +1 -0
  23. package/dist/environment-provider.d.ts +1 -1
  24. package/dist/environment-provider.js +1 -1
  25. package/dist/graph-BJTxGOFB.js +471 -0
  26. package/dist/graph-BJTxGOFB.js.map +1 -0
  27. package/dist/{improvement-cycle-IJgCbKWQ.js → improvement-cycle-Csp38cWg.js} +133 -224
  28. package/dist/improvement-cycle-Csp38cWg.js.map +1 -0
  29. package/dist/{index-EdjCQBV9.d.ts → index-CoO7atyo.d.ts} +640 -1184
  30. package/dist/{index-DIV33AF5.d.ts → index-DwGtu9nc.d.ts} +7 -9
  31. package/dist/{index-Efjb3nrQ.d.ts → index-qYHpsmG2.d.ts} +36 -18
  32. package/dist/index.d.ts +353 -11
  33. package/dist/index.js +111 -354
  34. package/dist/index.js.map +1 -1
  35. package/dist/intelligence.d.ts +6 -6
  36. package/dist/intelligence.js +9 -8
  37. package/dist/intelligence.js.map +1 -1
  38. package/dist/kernel.d.ts +7 -5
  39. package/dist/kernel.js +13 -9
  40. package/dist/{knowledge-EnuEqm_Y.js → knowledge-ce0_uKCl.js} +19 -17
  41. package/dist/knowledge-ce0_uKCl.js.map +1 -0
  42. package/dist/knowledge.d.ts +1 -1
  43. package/dist/knowledge.js +1 -1
  44. package/dist/{loop-runner-bin-Bo29_fiD.d.ts → loop-runner-bin-BwgZ8m_7.d.ts} +6 -3
  45. package/dist/{loop-runner-bin-qwT_4F5I.js → loop-runner-bin-DSbuDDqM.js} +5 -27
  46. package/dist/loop-runner-bin-DSbuDDqM.js.map +1 -0
  47. package/dist/loop-runner-bin.d.ts +1 -1
  48. package/dist/loop-runner-bin.js +1 -1
  49. package/dist/materialization-COJ1UYQ-.js +272 -0
  50. package/dist/materialization-COJ1UYQ-.js.map +1 -0
  51. package/dist/mcp/bin.js +39 -47
  52. package/dist/mcp/bin.js.map +1 -1
  53. package/dist/mcp/index.d.ts +24 -30
  54. package/dist/mcp/index.js +66 -83
  55. package/dist/mcp/index.js.map +1 -1
  56. package/dist/mcp/memory-bin.js +1 -1
  57. package/dist/{memory-server-DL6cE2Ag.js → memory-server-5HEJH672.js} +2 -2
  58. package/dist/{memory-server-DL6cE2Ag.js.map → memory-server-5HEJH672.js.map} +1 -1
  59. package/dist/model-policy-CqziaqS1.js +232 -0
  60. package/dist/model-policy-CqziaqS1.js.map +1 -0
  61. package/dist/{openai-tools-B68JaOCx.d.ts → openai-tools-D3oMyVGl.d.ts} +2 -2
  62. package/dist/{openai-tools-Bp1KSkP6.js → openai-tools-ru75mLjq.js} +2 -2
  63. package/dist/openai-tools-ru75mLjq.js.map +1 -0
  64. package/dist/{prepare--8EvLqCr.js → prepare-DYWjVcPx.js} +169 -153
  65. package/dist/prepare-DYWjVcPx.js.map +1 -0
  66. package/dist/primeintellect/index.d.ts +7 -6
  67. package/dist/primeintellect/index.js +9 -11
  68. package/dist/primeintellect/index.js.map +1 -1
  69. package/dist/profiles.d.ts +21 -174
  70. package/dist/profiles.js +67 -276
  71. package/dist/profiles.js.map +1 -1
  72. package/dist/{protected-model-port-CXVfOUu_.js → protected-model-port-48ALLGxT.js} +2 -2
  73. package/dist/{protected-model-port-CXVfOUu_.js.map → protected-model-port-48ALLGxT.js.map} +1 -1
  74. package/dist/{redact-PQzmE1Jn.d.ts → redact-9_Gf-8m3.d.ts} +58 -69
  75. package/dist/{researcher-CoVqNhfI.js → researcher-Skz5-Uc8.js} +50 -26
  76. package/dist/researcher-Skz5-Uc8.js.map +1 -0
  77. package/dist/{run-layout-C2FGmZ3v.js → run-layout-CeJsEAom.js} +2 -2
  78. package/dist/{run-layout-C2FGmZ3v.js.map → run-layout-CeJsEAom.js.map} +1 -1
  79. package/dist/runtime-D-QfLbSd.d.ts +893 -0
  80. package/dist/{runtime-BzXz7OjS.js → runtime-hiAABiTk.js} +329 -854
  81. package/dist/runtime-hiAABiTk.js.map +1 -0
  82. package/dist/{sandbox-events-Yhd1GYWl.js → sandbox-events-CRDwc5WN.js} +42 -5
  83. package/dist/sandbox-events-CRDwc5WN.js.map +1 -0
  84. package/dist/snapshot-CXiiuHhL.js +21 -0
  85. package/dist/snapshot-CXiiuHhL.js.map +1 -0
  86. package/dist/{spawn-journal-DsZKDqeh.js → spawn-journal-saHQzqYi.js} +15 -21
  87. package/dist/spawn-journal-saHQzqYi.js.map +1 -0
  88. package/dist/stream-agent-turn-C852AgMT.d.ts +128 -0
  89. package/dist/stream-agent-turn-rYgaOLO0.js +910 -0
  90. package/dist/stream-agent-turn-rYgaOLO0.js.map +1 -0
  91. package/dist/{structural-rollout-zY0oqQzO.js → structural-rollout-3uxVGcg2.js} +459 -235
  92. package/dist/structural-rollout-3uxVGcg2.js.map +1 -0
  93. package/dist/{supervise-Ds8FtyI9.js → supervise-iPN27pO0.js} +932 -4771
  94. package/dist/supervise-iPN27pO0.js.map +1 -0
  95. package/dist/{supervisor-DpjO0Gmy.js → supervisor-CV6Jh28D.js} +7439 -2897
  96. package/dist/supervisor-CV6Jh28D.js.map +1 -0
  97. package/dist/testing.d.ts +3 -1
  98. package/dist/testing.js +271 -221
  99. package/dist/testing.js.map +1 -1
  100. package/dist/{top-app-5unxqovu.js → top-app-G4M18b6i.js} +3 -3
  101. package/dist/{top-app-5unxqovu.js.map → top-app-G4M18b6i.js.map} +1 -1
  102. package/dist/tui/bin.js +1 -1
  103. package/dist/tui/index.js +1 -1
  104. package/dist/{environment-provider-PM9PeW_J.d.ts → types-C6Q-J0Dt.d.ts} +57 -114
  105. package/dist/{types-DnNGJ5Gz.d.ts → types-ebIY0dMG.d.ts} +556 -30
  106. package/dist/{util-MVgdwuIS.js → util-Bw6srryQ.js} +3 -2
  107. package/dist/{util-MVgdwuIS.js.map → util-Bw6srryQ.js.map} +1 -1
  108. package/dist/{workspace-archive-BQxvkypI.js → workspace-archive-aOfJ47ms.js} +3 -3
  109. package/dist/{workspace-archive-BQxvkypI.js.map → workspace-archive-aOfJ47ms.js.map} +1 -1
  110. package/package.json +12 -15
  111. package/skills/agent-graphs/IMPROVE.md +58 -0
  112. package/skills/agent-graphs/SKILL.md +139 -0
  113. package/skills/agent-graphs/cases/artifact-mission-release-notes.json +10 -0
  114. package/skills/agent-graphs/cases/audited-single-writer.json +9 -0
  115. package/skills/agent-graphs/cases/cap-as-stop-mistake.json +8 -0
  116. package/skills/agent-graphs/cases/mission-in-deliverable.json +8 -0
  117. package/skills/agent-graphs/cases/review-pipeline.json +13 -0
  118. package/skills/agent-graphs/cases/runtime-discovered-fanout.json +8 -0
  119. package/skills/agent-graphs/cases/single-agent-suffices.json +7 -0
  120. package/skills/agent-graphs/cases/steer-heavy-drafting.json +9 -0
  121. package/skills/agent-graphs/cases/unmeasured-harness.json +7 -0
  122. package/skills/agent-graphs/generations/gen1-baseline.json +248 -0
  123. package/skills/agent-graphs/generations/gen2.json +375 -0
  124. package/skills/agent-graphs/generations/gen3.json +702 -0
  125. package/skills/build-with-agent-runtime/SKILL.md +1 -0
  126. package/dist/backends-CiOCyRHb.js +0 -743
  127. package/dist/backends-CiOCyRHb.js.map +0 -1
  128. package/dist/conversation-BpLQZGPH.js.map +0 -1
  129. package/dist/environment-provider-DqFS6FSZ.js.map +0 -1
  130. package/dist/improvement-cycle-IJgCbKWQ.js.map +0 -1
  131. package/dist/index-D_M4d1_B.d.ts +0 -545
  132. package/dist/knowledge-EnuEqm_Y.js.map +0 -1
  133. package/dist/local-harness-BIajef4A.d.ts +0 -465
  134. package/dist/loop-runner-bin-qwT_4F5I.js.map +0 -1
  135. package/dist/model-resolution-Btd9iIKV.js +0 -98
  136. package/dist/model-resolution-Btd9iIKV.js.map +0 -1
  137. package/dist/openai-tools-Bp1KSkP6.js.map +0 -1
  138. package/dist/prepare--8EvLqCr.js.map +0 -1
  139. package/dist/researcher-CoVqNhfI.js.map +0 -1
  140. package/dist/runtime-BzXz7OjS.js.map +0 -1
  141. package/dist/sandbox-events-Yhd1GYWl.js.map +0 -1
  142. package/dist/spawn-journal-DsZKDqeh.js.map +0 -1
  143. package/dist/structural-rollout-zY0oqQzO.js.map +0 -1
  144. package/dist/supervise-Ds8FtyI9.js.map +0 -1
  145. package/dist/supervisor-DpjO0Gmy.js.map +0 -1
  146. package/dist/types-C9j4qg6l.d.ts +0 -500
@@ -1,15 +1,17 @@
1
1
  import { i as ConfigError } from "./errors-DEAvWQPy.js";
2
- import { $ as parseExactAgentProfile, G as agentCandidateProfileAsAgentProfile, J as candidateMaterializerHarness, K as applyExactAgentProfileDiff, Q as parseAgentCandidateProfileActivation, Y as createAgentCandidateProfileActivation, Z as omitUndefinedObjectFields, ct as omitTopLevelDigest, d as verifiedResourceTextByDigest, f as verifyAgentCandidateBundle, it as canonicalCandidateDocument, n as executePreparedAgentCandidate, nt as canonicalCandidateBytes, q as assertCandidateProfileBinding, rt as canonicalCandidateDigest$1, st as immutableCandidateValue, t as prepareAgentCandidateExecution, ut as verifyCanonicalCandidateDocument } from "./prepare--8EvLqCr.js";
3
- import { $t as concreteProfileModel, Jt as runLocalHarness, Wt as harnessInvocation, xt as runSettledCommand } from "./supervisor-DpjO0Gmy.js";
4
- import { E as optimizerMethod, a as defaultStructuralRolloutPolicy } from "./structural-rollout-zY0oqQzO.js";
5
- import { t as runAnalystLoop } from "./analyst-loop-DvSciOfB.js";
2
+ import { n as streamAgentTurn, t as collectAgentTurn } from "./stream-agent-turn-rYgaOLO0.js";
3
+ import { t as detachedSnapshot } from "./snapshot-CXiiuHhL.js";
4
+ import { $ as parseExactAgentProfile, G as agentCandidateProfileAsAgentProfile, J as createAgentCandidateProfileActivation, K as applyExactAgentProfileDiff, Q as parseAgentCandidateProfileActivation, X as materializeAgentCandidateProfilePlan, Z as omitUndefinedObjectFields, ct as omitTopLevelDigest, d as verifiedResourceTextByDigest, f as verifyAgentCandidateBundle, it as canonicalCandidateDocument, n as executePreparedAgentCandidate, nt as canonicalCandidateBytes, q as assertCandidateProfileBinding, rt as canonicalCandidateDigest$1, st as immutableCandidateValue, t as prepareAgentCandidateExecution, ut as verifyCanonicalCandidateDocument } from "./prepare-DYWjVcPx.js";
5
+ import { a as concreteProfileModel, t as assertExecutableAgentProfile } from "./model-policy-CqziaqS1.js";
6
+ import { Et as runSettledCommand, N as createExecutor } from "./supervisor-CV6Jh28D.js";
7
+ import { D as optimizerMethod, a as defaultStructuralRolloutPolicy } from "./structural-rollout-3uxVGcg2.js";
8
+ import { t as runAnalystLoop } from "./analyst-loop-BE8cDs5Q.js";
6
9
  import { CostLedger, canonicalJson, makeProposalFinding } from "@tangle-network/agent-eval";
7
10
  import { campaignScenarioIdentity, campaignSplitDigestFromIdentities, compareOptimizationMethods, gitWorktreeAdapter, verifyCodeSurface } from "@tangle-network/agent-eval/campaign";
8
- import { AGENT_IMPROVEMENT_SOURCE_METADATA_KEY, agentCandidateMaterializationReceiptSchema, agentCandidateRunReceiptSchema, agentImprovementActivationSchema, agentImprovementProposalSchema, agentImprovementReviewSchema, agentImprovementSourceMetadata, agentImprovementSourceSchema, agentProfileDiffSchema, agentProfileImprovementArmSchema, agentProfileImprovementExecutionRefSchema, agentProfileModelHintsSchema, agentProfileSchema, candidateExecutionEvidenceSchema, changedProfileImprovementSurfaces, defineAgentProfileDiff, numbersApproximatelyEqual, sha256DigestSchema } from "@tangle-network/agent-interface";
11
+ import { AGENT_IMPROVEMENT_SOURCE_METADATA_KEY, agentCandidateMaterializationReceiptSchema, agentCandidateRunReceiptSchema, agentImprovementActivationSchema, agentImprovementProposalSchema, agentImprovementReviewSchema, agentImprovementSourceMetadata, agentImprovementSourceSchema, agentProfileDiffSchema, agentProfileImprovementArmSchema, agentProfileImprovementExecutionRefSchema, agentProfileModelHintsSchema, agentProfileSchema, candidateExecutionEvidenceSchema, canonicalAgentProfileDigest, changedProfileImprovementSurfaces, defineAgentProfileDiff, numbersApproximatelyEqual, sha256DigestSchema } from "@tangle-network/agent-interface";
9
12
  import { createHash, randomUUID } from "node:crypto";
10
- import { applyWorkspacePlan, materializeCandidateProfile, materializeProfile } from "@tangle-network/agent-profile-materialize";
11
- import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs";
12
- import { basename, join, resolve, sep } from "node:path";
13
+ import { basename, join, resolve } from "node:path";
14
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
13
15
  import { spawnSync } from "node:child_process";
14
16
  import { assertProposalFindings } from "@tangle-network/agent-eval/analyst";
15
17
  import { measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, runAgentProfileImprovementExperiment, runCandidateExperiment, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateExperiment, selfImprove, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison } from "@tangle-network/agent-eval/contract";
@@ -17,18 +19,16 @@ import { measuredComparisonFromAgentProfileImprovementExperiment, measuredCompar
17
19
  /**
18
20
  *
19
21
  * `agenticGenerator` — the full-agentic `CandidateGenerator`. It runs a real
20
- * coding harness (claude / codex / opencode) inside the candidate worktree the
21
- * driver already created, letting the agent read the codebase + the research
22
- * proposal findings and make the change in place. The driver then commits the worktree
23
- * into a `CodeSurface`.
22
+ * authored profile inside the candidate worktree the driver already created,
23
+ * letting the agent read the codebase + the research proposal findings and
24
+ * make the change in place. The driver then commits the worktree into a
25
+ * `CodeSurface`.
24
26
  *
25
- * Mechanism: identical to the proven Phase-2.8 in-process executor — spawn the
26
- * harness as a subprocess with `cwd` = the worktree, on the same filesystem,
27
- * so edits land in place (no sandbox-mount round-trip). `runLocalHarness` is
28
- * the verified primitive. The OUTER sandbox is the improvement loop's own
29
- * execution context; the generator does not nest a second sandbox per
30
- * candidate (which would reintroduce a host↔sandbox worktree-transport
31
- * problem that does not need solving here).
27
+ * Every paid shot enters Runtime through `createExecutor` + `streamAgentTurn`.
28
+ * The caller supplies the exact `AgentProfile` and a worktree-aware executor
29
+ * placement; Runtime validates and records the profile that actually ran. A
30
+ * cli-bridge placement sets `cwd` to the supplied worktree so Pi and other
31
+ * supported harnesses edit the existing candidate directly.
32
32
  *
33
33
  * `maxShots` is the DEPTH dial — a multi-shot verify-in-session loop, NOT the
34
34
  * kernel `runAgentRounds`. Each shot runs one full harness session in the (persistent)
@@ -36,32 +36,25 @@ import { measuredComparisonFromAgentProfileImprovementExperiment, measuredCompar
36
36
  * - empty tree → "you changed nothing, make the edits" → retry
37
37
  * - dirty + `verify` fails → feed the verifier's failure into the next shot
38
38
  * (the worktree persists, so the harness RESUMES atop its own failing
39
- * edits with the error in hand — no `--resume` session plumbing needed,
40
- * and harness-agnostic across claude/codex/opencode)
39
+ * edits with the error in hand — no session-specific retry path needed)
41
40
  * - dirty + `verify` ok (or no verifier configured) → return the candidate
42
41
  * A candidate that never verifies within `maxShots` is discarded (`applied:
43
42
  * false`), never shipped — if you configured a verifier, a non-passing tree is
44
- * not a candidate. With no verifier the legacy behavior holds: first dirty shot
45
- * is the candidate.
43
+ * not a candidate. With no verifier, the first dirty shot is the candidate.
46
44
  *
47
- * @experimental
45
+ * @stable
48
46
  */
49
47
  const RAW_TRACE_ANALYST_ID = "raw-trace-distiller";
50
48
  const RAW_TRACE_AREA = "raw-trace-context";
51
49
  const RAW_TRACE_DIAGNOSIS_PATH = ".improve/raw-trace-diagnosis.md";
52
- /** Dedicated ephemeral root for generic author-profile files. Every declared
53
- * file must live below this root so cleanup cannot alter candidate-owned files. */
54
- const AGENTIC_PROFILE_RESOURCE_ROOT = ".agent-runtime-profile-resources";
55
- /** Full-agentic `CandidateGenerator` (the `shots=N, sandbox=on` setting): run a real coding harness inside the candidate worktree so the agent makes the change in place. */
56
- function agenticGenerator(opts = {}) {
57
- const harness = opts.harness ?? "claude-code";
58
- if (opts.codexReproducible && harness !== "codex") throw new Error("agenticGenerator: codexReproducible requires harness 'codex'");
59
- if (opts.codexReproducible && !opts.profile) throw new Error("agenticGenerator: codexReproducible requires an explicit author profile");
60
- if (opts.codexReadDeniedPaths && !opts.codexReproducible) throw new Error("agenticGenerator: codexReadDeniedPaths requires codexReproducible");
61
- if (opts.maximumCharge && !opts.codexReproducible) throw new Error("agenticGenerator: maximumCharge requires codexReproducible");
62
- const profileResourcePlan = opts.codexReproducible ? authorProfileResourcePlan(opts.profile) : null;
63
- const buildPrompt = opts.buildPrompt ?? defaultBuildPrompt;
64
- const run = opts.runHarness ?? runLocalHarness;
50
+ /** Full-agentic `CandidateGenerator`: run an exact profiled author inside the existing candidate worktree. */
51
+ function agenticGenerator(opts) {
52
+ const profile = detachedSnapshot(agentProfileSchema.parse(opts.profile), "agenticGenerator profile");
53
+ assertExecutableAgentProfile(profile, "agenticGenerator");
54
+ const harness = profile.harness;
55
+ const provider = profile.model.provider.trim();
56
+ const model = concreteProfileModel(profile);
57
+ const profileDigest = canonicalAgentProfileDigest(profile);
65
58
  const dirty = opts.isDirty ?? worktreeDirty;
66
59
  const verify = opts.verify;
67
60
  return {
@@ -69,59 +62,40 @@ function agenticGenerator(opts = {}) {
69
62
  proposesWithoutFindings: true,
70
63
  async generate({ worktreePath, findings, maxShots, signal, generation, candidateIndex, costLedger, costPhase }) {
71
64
  signal.throwIfAborted();
72
- let reproducibleCostLedger;
73
- if (opts.codexReproducible) {
74
- if (!costLedger) throw new Error("agenticGenerator: reproducible Codex requires the run-wide CostLedger supplied by agent-eval");
75
- reproducibleCostLedger = costLedger;
76
- }
77
- const basePrompt = appendProfileResourcePaths(buildPrompt({ findings }), profileResourcePlan);
65
+ if (opts.maximumCharge && !costLedger) throw new Error("agenticGenerator: maximumCharge requires the run-wide CostLedger supplied by agent-eval");
66
+ const basePrompt = opts.buildPrompt({ findings });
67
+ if (typeof basePrompt !== "string" || basePrompt.trim().length === 0) throw new Error("agenticGenerator: buildPrompt must return a non-empty string");
68
+ const executorConfig = opts.executorForWorktree(worktreePath);
69
+ if (executorConfig.backend === "bridge" && executorConfig.cwd !== worktreePath) throw new Error("agenticGenerator: bridge executor cwd must equal the candidate worktree path");
70
+ const factory = createExecutor(executorConfig);
78
71
  const needsRawTraceEvidence = requiresRawTraceEvidence(findings);
79
72
  const shots = Math.max(1, maxShots);
80
73
  let attemptNote = "";
81
74
  for (let shot = 0; shot < shots; shot++) {
82
75
  signal.throwIfAborted();
83
76
  const taskPrompt = attemptNote ? `${basePrompt}\n\n${attemptNote}` : basePrompt;
84
- const invocation = opts.profile ? harnessInvocation(harness, opts.profile, taskPrompt, {
85
- dangerouslySkipPermissions: true,
86
- ...opts.codexReproducible ? { codexReproducible: true } : {}
87
- }) : void 0;
88
- const exactPrompt = invocation?.prompt ?? taskPrompt;
89
- const readDeniedPaths = typeof opts.codexReadDeniedPaths === "function" ? opts.codexReadDeniedPaths(worktreePath) : opts.codexReadDeniedPaths;
90
77
  const startedAt = /* @__PURE__ */ new Date();
91
- let harnessResult = null;
92
- let profileWorkspaceReceipt = null;
78
+ let turn = null;
93
79
  let costReceipt = null;
94
80
  let costCallId = null;
95
81
  let shotError = null;
96
82
  try {
97
- const execute = async (executionSignal) => {
98
- harnessResult = await withAuthorProfileResources(profileResourcePlan, worktreePath, async (receipt) => {
99
- profileWorkspaceReceipt = receipt;
100
- const result = await run({
101
- harness,
102
- cwd: worktreePath,
103
- taskPrompt,
104
- ...invocation ? { invocation: {
105
- command: invocation.command,
106
- args: invocation.args
107
- } } : {},
108
- dangerouslySkipPermissions: true,
109
- ...opts.codexReproducible ? { codexReproducible: true } : {},
110
- ...readDeniedPaths ? { codexReadDeniedPaths: readDeniedPaths } : {},
111
- timeoutMs: opts.timeoutMs,
112
- signal: executionSignal
113
- });
114
- harnessResult = result;
115
- return result;
116
- });
117
- const failure = shotFailure(harnessResult, exactPrompt, opts.codexReproducible === true);
83
+ const execute = async (executionSignal, callId) => {
84
+ turn = await collectAgentTurn(streamAgentTurn({
85
+ kind: "executor",
86
+ profile,
87
+ factory
88
+ }, taskPrompt, {
89
+ signal: executionSignal,
90
+ ...opts.timeoutMs !== void 0 ? { timeoutMs: opts.timeoutMs } : {},
91
+ ...callId ? { callId } : {}
92
+ }));
93
+ const failure = shotFailure(turn);
118
94
  if (failure) throw failure;
119
- return harnessResult;
95
+ return turn;
120
96
  };
121
- if (reproducibleCostLedger) {
122
- const model = opts.profile ? concreteProfileModel(opts.profile) : void 0;
123
- if (!model) throw new Error("agenticGenerator: reproducible Codex requires profile.model.default");
124
- const paid = await reproducibleCostLedger.runPaidCall({
97
+ if (costLedger) {
98
+ const paid = await costLedger.runPaidCall({
125
99
  channel: "driver",
126
100
  phase: costPhase ?? "search.proposal",
127
101
  actor: `agentic-generator:${harness}`,
@@ -133,38 +107,40 @@ function agenticGenerator(opts = {}) {
133
107
  },
134
108
  signal,
135
109
  ...opts.maximumCharge ? { maximumCharge: opts.maximumCharge } : {},
136
- execute,
137
- receipt: (result) => costReceiptFromHarness(result, model),
138
- receiptFromError: () => harnessResult?.usage ? costReceiptFromHarness(harnessResult, model) : void 0
110
+ execute: (executionSignal, callId) => execute(executionSignal, callId),
111
+ receipt: (result) => costReceiptFromTurn(result, model),
112
+ receiptFromError: () => turn ? costReceiptFromTurn(turn, model) : void 0
139
113
  });
140
114
  costCallId = paid.callId ?? null;
141
115
  costReceipt = paid.receipt ?? null;
142
116
  if (!paid.succeeded) throw paid.error;
143
- harnessResult = paid.value;
144
- } else harnessResult = await execute(signal);
117
+ turn = paid.value;
118
+ } else turn = await execute(signal);
145
119
  } catch (cause) {
146
120
  shotError = cause instanceof Error ? cause : new Error(String(cause));
147
121
  }
148
- const execution = shotExecutionSnapshot(harnessResult);
122
+ const execution = turn ? detachedSnapshot(turn, "agenticGenerator shot execution") : null;
149
123
  const receipt = shotReceipt({
150
124
  generation,
151
125
  candidateIndex,
152
126
  shot,
153
127
  maxShots: shots,
154
128
  harness,
155
- profile: opts.profile,
156
- prompt: exactPrompt,
129
+ provider,
130
+ model,
131
+ profile,
132
+ profileDigest,
133
+ prompt: taskPrompt,
157
134
  startedAt,
158
135
  completedAt: /* @__PURE__ */ new Date(),
159
136
  result: execution,
160
- profileWorkspaceReceipt,
161
137
  costCallId,
162
138
  costReceipt,
163
139
  error: shotError
164
140
  });
165
141
  await emitShotReceipt(opts.onShotCompleted, receipt, execution, shotError);
166
142
  signal.throwIfAborted();
167
- if (!execution) throw new Error("agenticGenerator: author shot completed without a harness result");
143
+ if (!execution) throw new Error("agenticGenerator: author shot completed without a Runtime turn");
168
144
  let worktreeChanged;
169
145
  try {
170
146
  worktreeChanged = dirty(worktreePath);
@@ -249,67 +225,6 @@ function agenticGenerator(opts = {}) {
249
225
  }
250
226
  };
251
227
  }
252
- function authorProfileResourcePlan(profile) {
253
- const resources = profile.resources;
254
- if (!resources) return null;
255
- const unsupportedKinds = [
256
- resources.tools?.length ? "tools" : null,
257
- resources.skills?.length ? "skills" : null,
258
- resources.agents?.length ? "agents" : null
259
- ].filter((kind) => kind !== null);
260
- if (unsupportedKinds.length > 0) throw new Error(`agenticGenerator: reproducible Codex author resources support files only; unsupported: ${unsupportedKinds.join(", ")}`);
261
- if (!resources.files || resources.files.length === 0) return null;
262
- const plan = materializeProfile({
263
- name: profile.name,
264
- resources: { files: resources.files }
265
- }, "codex");
266
- if (plan.unsupported.length > 0) throw new Error(`agenticGenerator: author profile files could not be materialized: ${plan.unsupported.map((item) => item.reason).join("; ")}`);
267
- if (Object.keys(plan.env).length > 0 || plan.flags.length > 0) throw new Error("agenticGenerator: generic author profile files unexpectedly changed spawn values");
268
- const virtualRoot = resolve("/", AGENTIC_PROFILE_RESOURCE_ROOT);
269
- const seen = /* @__PURE__ */ new Set();
270
- for (const file of plan.files) {
271
- const target = resolve("/", file.relPath);
272
- if (!target.startsWith(`${virtualRoot}${sep}`)) throw new Error(`agenticGenerator: author profile file must be below ${AGENTIC_PROFILE_RESOURCE_ROOT}: ${file.relPath}`);
273
- if (seen.has(target)) throw new Error(`agenticGenerator: duplicate author profile file path: ${file.relPath}`);
274
- seen.add(target);
275
- }
276
- return plan;
277
- }
278
- function appendProfileResourcePaths(prompt, plan) {
279
- if (!plan) return prompt;
280
- return [
281
- prompt,
282
- "",
283
- "Profile resource files available for this shot:",
284
- ...plan.files.map((file) => `- ${file.relPath}`)
285
- ].join("\n");
286
- }
287
- async function withAuthorProfileResources(plan, worktreePath, run) {
288
- if (!plan) return run(null);
289
- const rootPath = resolve(worktreePath, AGENTIC_PROFILE_RESOURCE_ROOT);
290
- if (existsSync(rootPath)) throw new Error(`agenticGenerator: ephemeral author profile root already exists: ${AGENTIC_PROFILE_RESOURCE_ROOT}`);
291
- let value;
292
- let primaryError;
293
- try {
294
- value = await run(applyWorkspacePlan(plan, worktreePath));
295
- } catch (cause) {
296
- primaryError = cause;
297
- }
298
- let cleanupError;
299
- try {
300
- rmSync(rootPath, {
301
- recursive: true,
302
- force: true
303
- });
304
- if (existsSync(rootPath)) throw new Error(`agenticGenerator: ephemeral author profile root survived cleanup: ${AGENTIC_PROFILE_RESOURCE_ROOT}`);
305
- } catch (cause) {
306
- cleanupError = cause;
307
- }
308
- if (primaryError !== void 0 && cleanupError !== void 0) throw new AggregateError([primaryError, cleanupError], "agenticGenerator: author shot and profile resource cleanup both failed");
309
- if (primaryError !== void 0) throw primaryError;
310
- if (cleanupError !== void 0) throw cleanupError;
311
- return value;
312
- }
313
228
  async function emitShotReceipt(callback, receipt, execution, primaryError) {
314
229
  try {
315
230
  await callback?.(receipt, execution);
@@ -339,92 +254,77 @@ async function rethrowShotSetupError(callback, receipt, worktreePath, stage, cau
339
254
  }
340
255
  throw cause;
341
256
  }
342
- function shotExecutionSnapshot(result) {
343
- if (result === null) return null;
344
- const usage = result.usage ? Object.freeze({ ...result.usage }) : void 0;
345
- const evidence = result.evidence ? Object.freeze({
346
- ...result.evidence,
347
- readDeniedPaths: Object.freeze([...result.evidence.readDeniedPaths]),
348
- policy: Object.freeze({ ...result.evidence.policy })
349
- }) : void 0;
350
- return Object.freeze({
351
- exitCode: result.exitCode,
352
- stdout: result.stdout,
353
- stderr: result.stderr,
354
- killedBySignal: result.killedBySignal,
355
- durationMs: result.durationMs,
356
- timedOut: result.timedOut,
357
- ...result.aborted !== void 0 ? { aborted: result.aborted } : {},
358
- ...usage ? { usage } : {},
359
- ...evidence ? { evidence } : {}
360
- });
361
- }
362
257
  function shotReceipt(input) {
363
258
  const error = input.error ? {
364
259
  name: input.error instanceof Error ? input.error.name : "Error",
365
260
  message: input.error instanceof Error ? input.error.message : String(input.error)
366
261
  } : null;
367
262
  const result = input.result;
368
- const costBasis = costBasisFor(input.costReceipt);
263
+ const costBasis = costBasisFor(input.costReceipt, result);
264
+ const costUsd = input.costReceipt?.costUsd ?? result?.usage.costUsd ?? result?.usage.estimatedCostUsd ?? null;
369
265
  return {
370
266
  generation: input.generation ?? null,
371
267
  candidateIndex: input.candidateIndex ?? null,
372
268
  shot: input.shot + 1,
373
269
  maxShots: input.maxShots,
270
+ profileDigest: input.profileDigest,
374
271
  harness: input.harness,
375
- model: input.profile ? concreteProfileModel(input.profile) ?? null : null,
376
- reasoningEffort: input.profile?.model?.reasoningEffort ?? null,
272
+ provider: input.provider,
273
+ model: input.model,
274
+ reasoningEffort: input.profile.model?.reasoningEffort ?? null,
377
275
  promptSha256: sha256(input.prompt),
378
276
  startedAt: input.startedAt.toISOString(),
379
277
  completedAt: input.completedAt.toISOString(),
380
- durationMs: result?.durationMs ?? input.completedAt.getTime() - input.startedAt.getTime(),
381
- exitCode: result?.exitCode ?? null,
382
- timedOut: result?.timedOut ?? false,
383
- aborted: result?.aborted ?? false,
384
- killedBySignal: result?.killedBySignal ?? null,
385
- stdoutBytes: result ? Buffer.byteLength(result.stdout) : null,
386
- stdoutSha256: result ? sha256(result.stdout) : null,
387
- stderrBytes: result ? Buffer.byteLength(result.stderr) : null,
388
- stderrSha256: result ? sha256(result.stderr) : null,
389
- usage: result?.usage ? { ...result.usage } : null,
390
- profileWorkspacePlanDigest: input.profileWorkspaceReceipt?.workspacePlanDigest ?? null,
391
- profileWorkspaceFileCount: input.profileWorkspaceReceipt?.written.length ?? 0,
278
+ durationMs: input.completedAt.getTime() - input.startedAt.getTime(),
279
+ status: result?.status ?? null,
280
+ usage: result ? { ...result.usage } : null,
281
+ transportAttempts: result?.transportAttempts ?? null,
392
282
  costCallId: input.costCallId,
393
283
  costBasis,
394
- costUsd: costBasis === "unknown" ? null : input.costReceipt?.costUsd ?? null,
284
+ costUsd: costBasis === "unknown" ? null : costUsd,
395
285
  costUsdKnown: costBasis === "provider-reported",
396
- evidence: result?.evidence ? {
397
- ...result.evidence,
398
- readDeniedPaths: [...result.evidence.readDeniedPaths],
399
- policy: { ...result.evidence.policy }
400
- } : null,
401
286
  error
402
287
  };
403
288
  }
404
- function costBasisFor(receipt) {
405
- if (receipt === null || receipt.costUnknown) return "unknown";
406
- return receipt.actualCostUsd === void 0 ? "estimated-pricing" : "provider-reported";
407
- }
408
- function shotFailure(result, exactPrompt, codexReproducible) {
409
- if (result.timedOut) return /* @__PURE__ */ new Error("agenticGenerator: author shot timed out");
410
- if (result.aborted) return /* @__PURE__ */ new Error("agenticGenerator: author shot was cancelled by the caller");
411
- if (result.killedBySignal) return /* @__PURE__ */ new Error(`agenticGenerator: author shot was killed by ${result.killedBySignal}`);
412
- if (result.exitCode !== 0) return /* @__PURE__ */ new Error(`agenticGenerator: author shot exited with code ${String(result.exitCode)}`);
413
- if (!codexReproducible) return null;
414
- if (!result.usage || !result.evidence) return /* @__PURE__ */ new Error("agenticGenerator: reproducible Codex shot completed without usage or execution evidence");
415
- const expectedPromptSha256 = sha256(exactPrompt).slice(7);
416
- if (result.evidence.requestedPromptSha256 !== expectedPromptSha256) return /* @__PURE__ */ new Error("agenticGenerator: reproducible Codex prompt evidence does not match the exact authored prompt");
417
- return null;
418
- }
419
- function costReceiptFromHarness(result, model) {
420
- if (!result.usage) throw new Error("agenticGenerator: author shot did not report terminal token usage");
289
+ function costBasisFor(receipt, turn) {
290
+ if (receipt) {
291
+ if (receipt.costUnknown) return "unknown";
292
+ return receipt.actualCostUsd === void 0 ? "estimated-pricing" : "provider-reported";
293
+ }
294
+ if (turn?.usage.usdKnown !== false && turn?.usage.costUsd !== void 0) return "provider-reported";
295
+ return turn?.usage.estimatedCostUsd !== void 0 ? "estimated-pricing" : "unknown";
296
+ }
297
+ function shotFailure(result) {
298
+ if (result.status === "completed") return null;
299
+ if (result.status === "aborted") return /* @__PURE__ */ new Error("agenticGenerator: author shot was cancelled by the caller");
300
+ return /* @__PURE__ */ new Error(`agenticGenerator: author shot failed${result.error?.message ? `: ${result.error.message}` : ""}`);
301
+ }
302
+ function costReceiptFromTurn(result, model) {
303
+ const tokensKnown = result.usage.tokensKnown !== false;
304
+ const actualCostUsd = result.usage.usdKnown === false ? void 0 : result.usage.costUsd;
305
+ const cachedTokens = promptCacheReadTokens(result.usage);
421
306
  return {
422
307
  model,
423
- inputTokens: result.usage.inputTokens - result.usage.cachedInputTokens,
424
- outputTokens: result.usage.outputTokens,
425
- ...result.usage.cachedInputTokens > 0 ? { cachedTokens: result.usage.cachedInputTokens } : {}
308
+ inputTokens: tokensKnown ? Math.max(0, result.usage.input - (cachedTokens ?? 0)) : 0,
309
+ outputTokens: tokensKnown ? result.usage.output : 0,
310
+ ...tokensKnown ? {} : { usageUnknown: true },
311
+ ...cachedTokens !== void 0 ? { cachedTokens } : {},
312
+ ...result.usage.reasoningTokens !== void 0 ? { reasoningTokens: result.usage.reasoningTokens } : {},
313
+ ...actualCostUsd !== void 0 ? { actualCostUsd } : result.usage.estimatedCostUsd !== void 0 ? { estimatedCostUsd: result.usage.estimatedCostUsd } : { costUnknown: true }
426
314
  };
427
315
  }
316
+ function promptCacheReadTokens(usage) {
317
+ const cache = usage.promptCache;
318
+ if (!cache) return void 0;
319
+ for (const field of [
320
+ "readTokens",
321
+ "cachedInputTokens",
322
+ "cacheReadInputTokens"
323
+ ]) {
324
+ const value = cache[field];
325
+ if (typeof value === "number" && Number.isFinite(value) && value >= 0) return value;
326
+ }
327
+ }
428
328
  function sha256(value) {
429
329
  return `sha256:${createHash("sha256").update(value).digest("hex")}`;
430
330
  }
@@ -618,7 +518,7 @@ function copyImproveCost(cost) {
618
518
  * A `CandidateGenerator` edits an isolated checkout. This driver finalizes each
619
519
  * accepted edit as a `CodeSurface` and disposes rejected worktrees.
620
520
  *
621
- * @experimental
521
+ * @stable
622
522
  */
623
523
  /** Build the code-only proposer used internally by `improve({ surface: 'code' })`. */
624
524
  function improvementDriver(opts) {
@@ -756,8 +656,7 @@ function normalizeRolloutPolicy(raw) {
756
656
  k,
757
657
  repairRounds,
758
658
  testgen,
759
- ...typeof bag.diverse === "boolean" ? { diverse: bag.diverse } : {},
760
- ...typeof bag.temperature === "number" ? { temperature: bag.temperature } : {}
659
+ ...typeof bag.diverse === "boolean" ? { diverse: bag.diverse } : {}
761
660
  };
762
661
  }
763
662
  /** Stable serialization with fixed field order. */
@@ -766,8 +665,7 @@ function serializeRolloutPolicy(policy) {
766
665
  k: policy.k,
767
666
  repairRounds: policy.repairRounds,
768
667
  testgen: policy.testgen,
769
- ...policy.diverse !== void 0 ? { diverse: policy.diverse } : {},
770
- ...policy.temperature !== void 0 ? { temperature: policy.temperature } : {}
668
+ ...policy.diverse !== void 0 ? { diverse: policy.diverse } : {}
771
669
  });
772
670
  }
773
671
  /** Read the persisted policy off the profile. `undefined` when the profile does
@@ -784,8 +682,7 @@ function applyRolloutPolicyToProfile(profile, policy) {
784
682
  k: policy.k,
785
683
  repairRounds: policy.repairRounds,
786
684
  testgen: policy.testgen,
787
- ...policy.diverse !== void 0 ? { diverse: policy.diverse } : {},
788
- ...policy.temperature !== void 0 ? { temperature: policy.temperature } : {}
685
+ ...policy.diverse !== void 0 ? { diverse: policy.diverse } : {}
789
686
  };
790
687
  return {
791
688
  ...candidate,
@@ -1075,7 +972,7 @@ function assertFailClosedResources(profile, surface) {
1075
972
  * cached-result.json ← the cell's score + artifact ref
1076
973
  * <artifacts…> ← whatever the dispatch wrote
1077
974
  *
1078
- * @experimental
975
+ * @stable
1079
976
  */
1080
977
  const ANALYST_ID = "raw-trace-distiller";
1081
978
  /** A cell counts as "failing" below this mean composite (matches the default
@@ -1091,7 +988,7 @@ const PASS_THRESHOLD = .999;
1091
988
  * await improve({
1092
989
  * surface: 'code',
1093
990
  * findings: seedFindings,
1094
- * code: { repoRoot },
991
+ * code: { repoRoot, profile, executorForWorktree, buildPrompt },
1095
992
  * runDir: '/abs/run', // MUST be a real path — the traces live here
1096
993
  * analyzeGeneration: rawTraceDistiller(),
1097
994
  * scenarios, judge, agent,
@@ -1350,6 +1247,8 @@ async function discardPreparedBaseline(worktree, baselineWorktree, cause) {
1350
1247
  }
1351
1248
  /** Create a clean incumbent checkout and the candidate producer for a code run. */
1352
1249
  async function prepareCodeRun(code) {
1250
+ const authorProfile = agentProfileSchema.parse(code.profile);
1251
+ assertExecutableAgentProfile(authorProfile, "improve(code) author");
1353
1252
  const baseRef = code.baseRef ?? "main";
1354
1253
  const worktree = code.worktree ?? gitWorktreeAdapter({
1355
1254
  repoRoot: code.repoRoot,
@@ -1364,10 +1263,13 @@ async function prepareCodeRun(code) {
1364
1263
  let baselineDiscarded = false;
1365
1264
  const managed = improvementDriver({
1366
1265
  worktree,
1367
- generator: code.generator ?? agenticGenerator({
1368
- ...code.harness ? { harness: code.harness } : {},
1266
+ generator: code.generator ? code.generator : agenticGenerator({
1267
+ profile: authorProfile,
1268
+ executorForWorktree: code.executorForWorktree,
1269
+ buildPrompt: code.buildPrompt,
1369
1270
  ...code.verify ? { verify: code.verify } : {},
1370
- ...code.timeoutMs ? { timeoutMs: code.timeoutMs } : {}
1271
+ ...code.timeoutMs !== void 0 ? { timeoutMs: code.timeoutMs } : {},
1272
+ ...code.maximumCharge ? { maximumCharge: code.maximumCharge } : {}
1371
1273
  }),
1372
1274
  baseRef
1373
1275
  });
@@ -2960,7 +2862,14 @@ function verifyCandidateExecutionEvidence(input, options) {
2960
2862
  assertCapturedInput(materialization.benchmark.task, task, "benchmark task");
2961
2863
  assertEvidenceMaterialDigest(plan, "candidate execution plan");
2962
2864
  assertEvidenceMaterialDigest(materialization.profileActivation.profilePlan, "candidate profile plan");
2963
- const expectedProfilePlan = materializeCandidateProfile(bundle.profile, candidateMaterializerHarness(materialization.harness), { resolvedResources: options.resolvedResources });
2865
+ const expectedProfilePlan = materializeAgentCandidateProfilePlan({
2866
+ profile: bundle.profile,
2867
+ harness: bundle.execution.harness,
2868
+ launch: bundle.execution.launch,
2869
+ workspace: bundle.execution.cwd.workspace,
2870
+ workspaces: plan.material.workspaces,
2871
+ resolvedResources: options.resolvedResources
2872
+ });
2964
2873
  const activation = parseAgentCandidateProfileActivation(materialization.profileActivation, materialization.profileActivation.profilePlan.digest);
2965
2874
  const regeneratedActivation = createAgentCandidateProfileActivation(expectedProfilePlan, materialization.profileActivation.profilePlan);
2966
2875
  if (activation.digest !== regeneratedActivation.digest) throw new Error("candidate profile activation does not match the experiment bundle");
@@ -2987,6 +2896,6 @@ function sameOrderedValues(left, right) {
2987
2896
  return left.length === right.length && left.every((value, index) => value === right[index]);
2988
2897
  }
2989
2898
  //#endregion
2990
- export { improve as A, agenticGenerator as B, agentImprovementTargetInput as C, buildAgentImprovementActivationTargets as D, assertProfileImprovementTargetsShareIdentity as E, normalizeRolloutPolicy as F, summarizeFindings as G, defaultBuildPrompt as H, parseRolloutPolicy as I, worktreeChangedPaths as K, serializeRolloutPolicy as L, rawTraceDistiller as M, ROLLOUT_POLICY_EXTENSION as N, isAgentImprovementProfileSurface as O, applyRolloutPolicyToProfile as P, structuralRolloutPolicyFromProfile as R, agentImprovementTargetDigest as S, agentProfileImprovementStateDigest as T, rawTraceEvidenceProblem as U, commandVerifier as V, requiresRawTraceEvidence as W, AGENT_IMPROVEMENT_PROFILE_SURFACES as _, executeAgentCandidateExperimentCell as a, agentImprovementProfileSurfaceDigest as b, requireSealedCandidateExperiment as c, verifyAgentImprovementActivation as d, verifyAgentImprovementProposal as f, optimizationActivationReceiptFromMetadata as g, createOptimizationActivationReceipt as h, createAgentImprovementProposal as i, withMethodRuntimeControls as j, isAgentProfileMeasuredSurface as k, reviewAgentImprovementProposal as l, verifyCandidateExecutionEvidence as m, createAgentImprovementActivation as n, proposeAgentImprovement as o, verifyAgentImprovementReview as p, createAgentImprovementMeasuredComparison as r, proposeAgentProfileImprovement as s, AgentCandidateExperimentCellExecutionError as t, runAgentCandidateExperiment as u, AGENT_PROFILE_MEASURED_SURFACES as v, agentImprovementTargetProfileDiffs as w, agentImprovementProfileSurfaceInput as x, agentImprovementProfileDiffs as y, AGENTIC_PROFILE_RESOURCE_ROOT as z };
2899
+ export { improve as A, commandVerifier as B, agentImprovementTargetInput as C, buildAgentImprovementActivationTargets as D, assertProfileImprovementTargetsShareIdentity as E, normalizeRolloutPolicy as F, parseRolloutPolicy as I, serializeRolloutPolicy as L, rawTraceDistiller as M, ROLLOUT_POLICY_EXTENSION as N, isAgentImprovementProfileSurface as O, applyRolloutPolicyToProfile as P, structuralRolloutPolicyFromProfile as R, agentImprovementTargetDigest as S, agentProfileImprovementStateDigest as T, defaultBuildPrompt as V, AGENT_IMPROVEMENT_PROFILE_SURFACES as _, executeAgentCandidateExperimentCell as a, agentImprovementProfileSurfaceDigest as b, requireSealedCandidateExperiment as c, verifyAgentImprovementActivation as d, verifyAgentImprovementProposal as f, optimizationActivationReceiptFromMetadata as g, createOptimizationActivationReceipt as h, createAgentImprovementProposal as i, withMethodRuntimeControls as j, isAgentProfileMeasuredSurface as k, reviewAgentImprovementProposal as l, verifyCandidateExecutionEvidence as m, createAgentImprovementActivation as n, proposeAgentImprovement as o, verifyAgentImprovementReview as p, createAgentImprovementMeasuredComparison as r, proposeAgentProfileImprovement as s, AgentCandidateExperimentCellExecutionError as t, runAgentCandidateExperiment as u, AGENT_PROFILE_MEASURED_SURFACES as v, agentImprovementTargetProfileDiffs as w, agentImprovementProfileSurfaceInput as x, agentImprovementProfileDiffs as y, agenticGenerator as z };
2991
2900
 
2992
- //# sourceMappingURL=improvement-cycle-IJgCbKWQ.js.map
2901
+ //# sourceMappingURL=improvement-cycle-Csp38cWg.js.map