@tangle-network/agent-runtime 10.0.10 → 10.0.12

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 (46) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/{activation-D9ENOWud.d.ts → activation-BmdINnh5.d.ts} +12 -4
  3. package/dist/{activation-s2z6kO2P.js → activation-zUNFNlNv.js} +2 -2
  4. package/dist/{activation-s2z6kO2P.js.map → activation-zUNFNlNv.js.map} +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{delegate-4KpqPGv3.js → delegate--YvqtF0p.js} +2 -2
  7. package/dist/{delegate-4KpqPGv3.js.map → delegate--YvqtF0p.js.map} +1 -1
  8. package/dist/{driver-control-acknowledgers-Bnbn34Mp.js → driver-control-acknowledgers-o88fvQcq.js} +2 -2
  9. package/dist/{driver-control-acknowledgers-Bnbn34Mp.js.map → driver-control-acknowledgers-o88fvQcq.js.map} +1 -1
  10. package/dist/durable.js +4 -4
  11. package/dist/{graph-CDZWVNys.js → graph-5b9UtR5E.js} +4 -4
  12. package/dist/{graph-CDZWVNys.js.map → graph-5b9UtR5E.js.map} +1 -1
  13. package/dist/{improve-D_HT75pe.js → improve-DNO2U69i.js} +40 -14
  14. package/dist/{improve-D_HT75pe.js.map → improve-DNO2U69i.js.map} +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +8 -8
  17. package/dist/intelligence.d.ts +1 -1
  18. package/dist/intelligence.js +3 -3
  19. package/dist/kernel.js +10 -10
  20. package/dist/{loop-runner-C_ruSZRz.js → loop-runner-D-oI6FUI.js} +2 -2
  21. package/dist/{loop-runner-C_ruSZRz.js.map → loop-runner-D-oI6FUI.js.map} +1 -1
  22. package/dist/loop-runner-bin.js +1 -1
  23. package/dist/mcp/bin.js +2 -2
  24. package/dist/mcp/index.js +4 -4
  25. package/dist/{provision-supervisor-Cv5X_ITd.js → provision-supervisor-C_sePBrX.js} +3 -3
  26. package/dist/{provision-supervisor-Cv5X_ITd.js.map → provision-supervisor-C_sePBrX.js.map} +1 -1
  27. package/dist/{run-state-BWWardB0.js → run-state-BjM79-9H.js} +2 -2
  28. package/dist/{run-state-BWWardB0.js.map → run-state-BjM79-9H.js.map} +1 -1
  29. package/dist/{runtime-vv3D3bx6.js → runtime-C4hWti_g.js} +10 -10
  30. package/dist/{runtime-vv3D3bx6.js.map → runtime-C4hWti_g.js.map} +1 -1
  31. package/dist/{search-executor-C-kp1eg-.js → search-executor-B_xLH8Yq.js} +2 -2
  32. package/dist/{search-executor-C-kp1eg-.js.map → search-executor-B_xLH8Yq.js.map} +1 -1
  33. package/dist/{server-CqADHr2f.js → server-BzBOnewO.js} +2 -2
  34. package/dist/{server-CqADHr2f.js.map → server-BzBOnewO.js.map} +1 -1
  35. package/dist/{structural-rollout-Ct_uQtGw.js → structural-rollout-mKdhfxlJ.js} +20 -4
  36. package/dist/structural-rollout-mKdhfxlJ.js.map +1 -0
  37. package/dist/{supervise-CRz9bjPA.js → supervise-C-mQSV-1.js} +6 -4
  38. package/dist/supervise-C-mQSV-1.js.map +1 -0
  39. package/dist/{supervisor-B9A_Cnxo.js → supervisor-1csecp8d.js} +31 -8
  40. package/dist/supervisor-1csecp8d.js.map +1 -0
  41. package/dist/testing.js +11 -11
  42. package/dist/tui/index.js +1 -1
  43. package/package.json +1 -1
  44. package/dist/structural-rollout-Ct_uQtGw.js.map +0 -1
  45. package/dist/supervise-CRz9bjPA.js.map +0 -1
  46. package/dist/supervisor-B9A_Cnxo.js.map +0 -1
@@ -1,14 +1,14 @@
1
1
  import { i as ConfigError } from "./errors-DG8yufqX.js";
2
- import { F as collectAgentTurn, I as streamAgentTurn } from "./structural-rollout-Ct_uQtGw.js";
2
+ import { F as collectAgentTurn, I as streamAgentTurn } from "./structural-rollout-mKdhfxlJ.js";
3
3
  import { _ as runAbortable, f as sha256, g as linkAbort } from "./jsonl-file-vE9H9UXa.js";
4
4
  import { o as armDeadlineTimer } from "./deadline-CySmJ_0S.js";
5
5
  import { n as detachedSnapshot } from "./snapshot-BKI_w3JD.js";
6
- import { Bt as terminateProcessTreeAndConfirm, It as runSettledCommand, w as createExecutor } from "./supervisor-B9A_Cnxo.js";
6
+ import { Bt as terminateProcessTreeAndConfirm, It as runSettledCommand, w as createExecutor } from "./supervisor-1csecp8d.js";
7
7
  import { a as concreteProfileModel, t as assertExecutableAgentProfile } from "./model-policy-DTbTFyOG.js";
8
8
  import { l as syncDurableDirectory, o as publishExclusiveDurableFile } from "./durable-file-pao7FijS.js";
9
9
  import { b as sha256Bytes$1, m as canonicalCandidateDigest$1, v as immutableCandidateValue } from "./output-artifacts-AqkZ8lO2.js";
10
- import { C as serializeRolloutPolicy, S as normalizeRolloutPolicy, w as structuralRolloutPolicyFromProfile, x as applyRolloutPolicyToProfile } from "./activation-s2z6kO2P.js";
11
- import { a as reconcileInterruptedSearchCalls, b as improveSearchCost, c as searchExecutor, d as taggedLedger, i as isSearchEnvironmentFault, n as assertSearchLanes, s as searchCallTags, v as decideClosedSearch } from "./search-executor-C-kp1eg-.js";
10
+ import { C as serializeRolloutPolicy, S as normalizeRolloutPolicy, w as structuralRolloutPolicyFromProfile, x as applyRolloutPolicyToProfile } from "./activation-zUNFNlNv.js";
11
+ import { a as reconcileInterruptedSearchCalls, b as improveSearchCost, c as searchExecutor, d as taggedLedger, i as isSearchEnvironmentFault, n as assertSearchLanes, s as searchCallTags, v as decideClosedSearch } from "./search-executor-B_xLH8Yq.js";
12
12
  import { agentProfileEnvironmentSchema, agentProfileSchema, agentProfileTrainingSchema, agentTrainingDatasetIdentitySchema, agentTrainingParametersSchema, agentTrainingReceiptSchema, agentTrainingTaskKey, agentTrainingTaskSchema, applyAgentProfileDiff, canonicalAgentProfileDigest, canonicalCandidateBytes, diffAgentProfiles, sha256DigestSchema, snapshotAgentProfile, trainedModelIdForArtifact } from "@tangle-network/agent-interface";
13
13
  import { canonicalJson, makeProposalFinding } from "@tangle-network/agent-eval";
14
14
  import { redact } from "@tangle-network/agent-eval/traces";
@@ -1864,12 +1864,42 @@ function resolveOptimizationMethod(source, context) {
1864
1864
  if (!method || typeof method !== "object" || typeof method.name !== "string" || method.name.trim() !== method.name || method.name.length === 0 || typeof method.optimize !== "function") throw new ConfigError("improve(): method must be a complete OptimizationMethod with a trimmed name and optimize(input)");
1865
1865
  return method;
1866
1866
  }
1867
+ /** Read the comparison's one producer row and its composed stages depth first:
1868
+ * refuse an open ledger, naming its stage, and replay each closed one from its bytes. */
1869
+ function closedSearchHistories(methodName, producers, storage) {
1870
+ const [row] = producers;
1871
+ if (producers.length !== 1 || row?.producerId !== methodName) {
1872
+ const reported = producers.map((producer) => `'${producer.producerId}'`).join(", ");
1873
+ throw new ConfigError(`improve(): method '${methodName}' needs exactly its own search history row; the comparison reported [${reported}]`);
1874
+ }
1875
+ const receipts = [];
1876
+ let lineageKnown = true;
1877
+ const read = (current, stagePath) => {
1878
+ const { receipt, stages = [] } = current;
1879
+ if (receipt) {
1880
+ if (!receipt.complete) {
1881
+ const stage = stagePath.length > 0 ? ` stage '${stagePath.join(" > ")}'` : "";
1882
+ throw new ConfigError(`improve(): method '${methodName}'${stage} returned an open search ledger: ${receipt.incompleteReasons.join("; ")}`);
1883
+ }
1884
+ verifySearchHistoryArtifact(receipt, storage);
1885
+ receipts.push(receipt);
1886
+ } else if (stages.length === 0) lineageKnown = false;
1887
+ for (const stage of stages) read(stage, [...stagePath, stage.producerId]);
1888
+ };
1889
+ read(row, []);
1890
+ return {
1891
+ searchHistory: row.receipt ?? null,
1892
+ ...lineageKnown ? { searchHistories: Object.freeze(receipts) } : {}
1893
+ };
1894
+ }
1867
1895
  /**
1868
1896
  * Run one complete method, then compare its winner with the baseline on the
1869
1897
  * held-out test split. A method that records its search (GEPA and SkillOpt do
1870
- * through `officialGepa` and `officialSkillOpt`) must close its ledger; Runtime
1871
- * replays the bytes and returns the receipt. A method that records none
1872
- * returns `searchHistory: null`: its lineage is unknown, not empty.
1898
+ * through `officialGepa` and `officialSkillOpt`) must close its ledger, and so
1899
+ * must every stage of a method Eval composed; Runtime replays the bytes and
1900
+ * returns the receipts. `searchHistory` is the method's own ledger and is
1901
+ * `null` when the method recorded none itself; `searchHistories` holds every
1902
+ * ledger behind the winner and is absent when any search recorded none.
1873
1903
  */
1874
1904
  async function runMethodImprovement(profile, opts) {
1875
1905
  assertNoCallerArtifactDescriptor(opts, "improve()");
@@ -1956,11 +1986,7 @@ async function runMethodImprovement(profile, opts) {
1956
1986
  dispatchWithSurface: (candidateSurface, scenario, ctx) => agent(materializeProfile(candidateSurface), scenario, ctx)
1957
1987
  });
1958
1988
  if (comparisonOptions.costCeiling !== void 0 && raw.totalCost.totalCostUsd > comparisonOptions.costCeiling) throw new ConfigError(`improve(): reported total cost $${raw.totalCost.totalCostUsd} exceeds costCeiling $${comparisonOptions.costCeiling}`);
1959
- const searchHistory = raw.searchHistory.producers[0]?.receipt ?? null;
1960
- if (searchHistory) {
1961
- if (!searchHistory.complete) throw new ConfigError(`improve(): method '${method.name}' returned an open search ledger: ${searchHistory.incompleteReasons.join("; ")}`);
1962
- verifySearchHistoryArtifact(searchHistory, methodStorage);
1963
- }
1989
+ const histories = closedSearchHistories(method.name, raw.searchHistory.producers, methodStorage);
1964
1990
  const score = raw.best;
1965
1991
  const winnerSurface = immutableCandidateValue(score.winnerSurface);
1966
1992
  assertCandidateSurfaceKind(surface, baselineSurface, winnerSurface);
@@ -1978,7 +2004,7 @@ async function runMethodImprovement(profile, opts) {
1978
2004
  decision: cost.accountingComplete && score.decision.promote && score.decision.low > minimumLift ? "ship" : "hold",
1979
2005
  lift: score.lift,
1980
2006
  liftInterval: { ...score.liftCi },
1981
- searchHistory,
2007
+ ...histories,
1982
2008
  cost,
1983
2009
  durationMs: Date.now() - startedAt,
1984
2010
  lineage: Object.freeze({
@@ -3036,4 +3062,4 @@ async function improve(profileOrCode, opts) {
3036
3062
  }
3037
3063
  export { assertProfileTrainingIsHeldOut as a, assertNoCallerArtifactDescriptor as c, agenticGenerator as d, commandVerifier as f, isUsageAmount as h, assertCandidateValidator as i, withMethodRuntimeControls as l, createRuntimeUsageTotals as m, createCommandProfileTrainer as n, parseExecutionRef as o, addRuntimeUsage as p, searchMethod as r, privateValuePaths as s, improve as t, rethrowAfterCleanup as u };
3038
3064
 
3039
- //# sourceMappingURL=improve-D_HT75pe.js.map
3065
+ //# sourceMappingURL=improve-DNO2U69i.js.map