@tangle-network/agent-runtime 0.348.1 → 0.350.2
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-BEGalhOL.js → activation-CfJMyzEs.js} +12 -14
- package/dist/{activation-BEGalhOL.js.map → activation-CfJMyzEs.js.map} +1 -1
- package/dist/{activation-NQZP_mdI.d.ts → activation-DyiHrTlS.d.ts} +2 -24
- package/dist/agent.d.ts +8 -12
- package/dist/agent.js +9 -12
- package/dist/agent.js.map +1 -1
- package/dist/{analyst-loop-DZw5QWT9.js → analyst-loop-BZvXCDKy.js} +2 -3
- package/dist/{analyst-loop-DZw5QWT9.js.map → analyst-loop-BZvXCDKy.js.map} +1 -1
- package/dist/analyst-loop.d.ts +3 -5
- package/dist/analyst-loop.js +1 -2
- package/dist/{bundle-DKQtOO9d.js → bundle-Ze8pd07a.js} +3 -4
- package/dist/{bundle-DKQtOO9d.js.map → bundle-Ze8pd07a.js.map} +1 -1
- package/dist/candidate-execution/index.d.ts +13 -33
- package/dist/candidate-execution/index.js +16 -18
- package/dist/candidate-execution/index.js.map +1 -1
- package/dist/{coordination-manager-Bm6leXc6.js → coordination-manager-BkVfWlMz.js} +101 -132
- package/dist/coordination-manager-BkVfWlMz.js.map +1 -0
- package/dist/{delegate-Cp5-PsaX.js → delegate-DgEie4ad.js} +19 -21
- package/dist/delegate-DgEie4ad.js.map +1 -0
- package/dist/durable.d.ts +13 -23
- package/dist/durable.js +48 -43
- package/dist/durable.js.map +1 -1
- package/dist/{errors-DodWX-cb.js → errors-wuhGvpE3.js} +2 -3
- package/dist/{errors-DodWX-cb.js.map → errors-wuhGvpE3.js.map} +1 -1
- package/dist/{graph-CE_pzU31.js → graph-Cx0FhKSE.js} +192 -15
- package/dist/graph-Cx0FhKSE.js.map +1 -0
- package/dist/{improve-wT11zteg.js → improve-i0HU1-aa.js} +35 -53
- package/dist/{improve-wT11zteg.js.map → improve-i0HU1-aa.js.map} +1 -1
- package/dist/{improvement-adapter-sIthWkcN.d.ts → improvement-adapter-D5GRU1eY.d.ts} +2 -6
- package/dist/index.d.ts +41 -89
- package/dist/index.js +43 -61
- package/dist/index.js.map +1 -1
- package/dist/intelligence.d.ts +39 -59
- package/dist/intelligence.js +23 -33
- package/dist/intelligence.js.map +1 -1
- package/dist/kernel.d.ts +5 -5
- package/dist/kernel.js +11 -11
- package/dist/{loop-runner-CZzeeJTG.js → loop-runner-BwN9MhdP.js} +5 -6
- package/dist/{loop-runner-CZzeeJTG.js.map → loop-runner-BwN9MhdP.js.map} +1 -1
- package/dist/{loop-runner-CY5HHhtR.d.ts → loop-runner-DvfOXVx9.d.ts} +3 -5
- package/dist/loop-runner-bin.d.ts +5 -8
- package/dist/loop-runner-bin.js +2 -3
- package/dist/mcp/bin.js +6 -8
- package/dist/mcp/bin.js.map +1 -1
- package/dist/mcp/index.d.ts +8 -18
- package/dist/mcp/index.js +17 -25
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/memory-bin.js +4 -6
- package/dist/mcp/memory-bin.js.map +1 -1
- package/dist/{model-policy-CyCUwHed.js → model-policy-GSxWwP-b.js} +11 -13
- package/dist/model-policy-GSxWwP-b.js.map +1 -0
- package/dist/placement.d.ts +12 -14
- package/dist/placement.js +1 -2
- package/dist/platform.d.ts +7 -13
- package/dist/platform.js +3 -6
- package/dist/platform.js.map +1 -1
- package/dist/{prepare-TEEHSJwq.js → prepare-DE8TQnLu.js} +49 -69
- package/dist/{prepare-TEEHSJwq.js.map → prepare-DE8TQnLu.js.map} +1 -1
- package/dist/{profile-6OLpbjvV.js → profile-CAhZDW2T.js} +58 -92
- package/dist/profile-CAhZDW2T.js.map +1 -0
- package/dist/{profile-materialization-bPm0gGLO.d.ts → profile-materialization-BRY22Oh8.d.ts} +1 -3
- package/dist/profiles.d.ts +25 -12
- package/dist/profiles.js +52 -11
- package/dist/profiles.js.map +1 -1
- package/dist/{protected-model-port-DVVh-hEk.d.ts → protected-model-port-IKqhTypD.d.ts} +2 -14
- package/dist/{protected-redaction-DFCeo4vg.js → protected-redaction-DilFZch5.js} +2 -3
- package/dist/{protected-redaction-DFCeo4vg.js.map → protected-redaction-DilFZch5.js.map} +1 -1
- package/dist/{provision-supervisor-CC0HdOHo.js → provision-supervisor-Bde_FF0R.js} +11 -15
- package/dist/{provision-supervisor-CC0HdOHo.js.map → provision-supervisor-Bde_FF0R.js.map} +1 -1
- package/dist/{record-events-D93DkpAx.js → record-events-B2GUgYdz.js} +12 -14
- package/dist/{record-events-D93DkpAx.js.map → record-events-B2GUgYdz.js.map} +1 -1
- package/dist/{run-cancellation-CzFhQGMa.js → run-cancellation-BLy_Zz-w.js} +6 -7
- package/dist/{run-cancellation-CzFhQGMa.js.map → run-cancellation-BLy_Zz-w.js.map} +1 -1
- package/dist/{runtime-B_40dXlF.js → runtime-6Ec9sHRe.js} +833 -215
- package/dist/runtime-6Ec9sHRe.js.map +1 -0
- package/dist/{runtime-hooks-tXpAarhW.js → runtime-hooks-CsW2pfFk.js} +2 -3
- package/dist/{runtime-hooks-tXpAarhW.js.map → runtime-hooks-CsW2pfFk.js.map} +1 -1
- package/dist/{runtime-hooks-nsqxSUFL.d.ts → runtime-hooks-ZQqPw-0g.d.ts} +1 -3
- package/dist/{sandbox-profile-compat-_fEtHPCj.js → sandbox-profile-compat-BxMQ1VXv.js} +62 -44
- package/dist/sandbox-profile-compat-BxMQ1VXv.js.map +1 -0
- package/dist/{search-executor-COd2F2wp.js → search-executor-B7g_5Wjl.js} +12 -17
- package/dist/search-executor-B7g_5Wjl.js.map +1 -0
- package/dist/{server-BGB4R4wQ.js → server-fvEMwGMQ.js} +19 -30
- package/dist/{server-BGB4R4wQ.js.map → server-fvEMwGMQ.js.map} +1 -1
- package/dist/{structural-rollout-Wl_rCuzM.js → structural-rollout-B86bSixU.js} +69 -70
- package/dist/structural-rollout-B86bSixU.js.map +1 -0
- package/dist/{substrate-CGDFTSRh.js → substrate-Db2pp6y3.js} +2 -3
- package/dist/{substrate-CGDFTSRh.js.map → substrate-Db2pp6y3.js.map} +1 -1
- package/dist/{supervise-BUOeThuB.js → supervise-CaeZcgAW.js} +615 -203
- package/dist/supervise-CaeZcgAW.js.map +1 -0
- package/dist/{supervisor-DDy0aEtR.js → supervisor-C1OePYE-.js} +526 -642
- package/dist/supervisor-C1OePYE-.js.map +1 -0
- package/dist/{task-queue-0fKkoweu.d.ts → task-queue-kefGy79U.d.ts} +1 -3
- package/dist/task-queue.d.ts +1 -1
- package/dist/task-queue.js +1 -2
- package/dist/testing.d.ts +8 -16
- package/dist/testing.js +241 -244
- package/dist/testing.js.map +1 -1
- package/dist/tool-loop.d.ts +16 -19
- package/dist/tool-loop.js +2 -3
- package/dist/{tool-server-XV4aJwoQ.js → tool-server-CwuYeW_Z.js} +3 -4
- package/dist/{tool-server-XV4aJwoQ.js.map → tool-server-CwuYeW_Z.js.map} +1 -1
- package/dist/{top-snapshot-CflmaDgk.js → top-snapshot-ChwpTr7A.js} +4 -5
- package/dist/{top-snapshot-CflmaDgk.js.map → top-snapshot-ChwpTr7A.js.map} +1 -1
- package/dist/tui/bin.js +7 -9
- package/dist/tui/bin.js.map +1 -1
- package/dist/tui/index.d.ts +3 -5
- package/dist/tui/index.js +2 -2
- package/dist/{types-hc4cmSc7.d.ts → types-Fowuwdz2.d.ts} +555 -503
- package/dist/{types-Cwrea-bU.d.ts → types-qsqfyQoY.d.ts} +1 -3
- package/dist/workspace-store/index.d.ts +12 -22
- package/dist/workspace-store/index.js +4 -7
- package/dist/workspace-store/index.js.map +1 -1
- package/dist/{workspace-streams-BiS4ABah.d.ts → workspace-streams-Dq2Fzk3c.d.ts} +1 -11
- package/package.json +25 -25
- package/skills/agent-graphs/SKILL.md +19 -4
- package/skills/be-ambitious/SKILL.md +46 -0
- package/skills/graph-designer/SKILL.md +15 -2
- package/skills/profile-authoring/SKILL.md +1 -1
- package/dist/coordination-manager-Bm6leXc6.js.map +0 -1
- package/dist/delegate-Cp5-PsaX.js.map +0 -1
- package/dist/graph-CE_pzU31.js.map +0 -1
- package/dist/model-policy-CyCUwHed.js.map +0 -1
- package/dist/profile-6OLpbjvV.js.map +0 -1
- package/dist/runtime-B_40dXlF.js.map +0 -1
- package/dist/sandbox-profile-compat-_fEtHPCj.js.map +0 -1
- package/dist/search-executor-COd2F2wp.js.map +0 -1
- package/dist/structural-rollout-Wl_rCuzM.js.map +0 -1
- package/dist/supervise-BUOeThuB.js.map +0 -1
- package/dist/supervisor-DDy0aEtR.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as publishExclusiveDurableFile, o as syncDurableDirectory, p as sha256 } from "./record-events-
|
|
2
|
-
import { At as createExecutor,
|
|
3
|
-
import { i as ConfigError } from "./errors-
|
|
4
|
-
import { F as collectAgentTurn, I as streamAgentTurn } from "./structural-rollout-
|
|
5
|
-
import { B as sha256Bytes$1,
|
|
6
|
-
import { a as concreteProfileModel, t as assertExecutableAgentProfile } from "./model-policy-
|
|
7
|
-
import { C as serializeRolloutPolicy, S as normalizeRolloutPolicy, w as structuralRolloutPolicyFromProfile, x as applyRolloutPolicyToProfile } from "./activation-
|
|
8
|
-
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-
|
|
1
|
+
import { a as publishExclusiveDurableFile, o as syncDurableDirectory, p as sha256 } from "./record-events-B2GUgYdz.js";
|
|
2
|
+
import { At as createExecutor, Bi as detachedSnapshot, Nr as linkAbort, Pr as runAbortable, Ur as terminateProcessTreeAndConfirm, zr as runSettledCommand } from "./supervisor-C1OePYE-.js";
|
|
3
|
+
import { i as ConfigError } from "./errors-wuhGvpE3.js";
|
|
4
|
+
import { F as collectAgentTurn, I as streamAgentTurn } from "./structural-rollout-B86bSixU.js";
|
|
5
|
+
import { B as sha256Bytes$1, P as canonicalCandidateDigest$1, R as immutableCandidateValue, wt as armDeadlineTimer } from "./sandbox-profile-compat-BxMQ1VXv.js";
|
|
6
|
+
import { a as concreteProfileModel, t as assertExecutableAgentProfile } from "./model-policy-GSxWwP-b.js";
|
|
7
|
+
import { C as serializeRolloutPolicy, S as normalizeRolloutPolicy, w as structuralRolloutPolicyFromProfile, x as applyRolloutPolicyToProfile } from "./activation-CfJMyzEs.js";
|
|
8
|
+
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-B7g_5Wjl.js";
|
|
9
9
|
import { agentProfileEnvironmentSchema, agentProfileSchema, agentProfileTrainingSchema, agentTrainingDatasetIdentitySchema, agentTrainingParametersSchema, agentTrainingReceiptSchema, agentTrainingTaskKey, agentTrainingTaskSchema, applyAgentProfileDiff, canonicalAgentProfileDigest, canonicalCandidateBytes, diffAgentProfiles, sha256DigestSchema, snapshotAgentProfile, trainedModelIdForArtifact } from "@tangle-network/agent-interface";
|
|
10
10
|
import { canonicalJson, makeProposalFinding } from "@tangle-network/agent-eval";
|
|
11
11
|
import { redact } from "@tangle-network/agent-eval/traces";
|
|
@@ -19,7 +19,7 @@ import { assertProposalFindings } from "@tangle-network/agent-eval/analyst";
|
|
|
19
19
|
import { SearchRecorder, aide, asha, campaignCellSearchResult, campaignScenarioIdentity, campaignSplitDigestFromIdentities, compareOptimizationMethods, createRunCostLedger, fsCampaignStorage, gitWorktreeAdapter, isProposedCandidate, openSearchLedger, renderSearchSummary, resolveRunDir, runCampaign, runSearch, searchClaimReserveUsd, searchNodeId, searchProposalExecution, searchProposerView, searchReceiptAccounting, verifyCodeSurface, verifySearchHistoryArtifact } from "@tangle-network/agent-eval/campaign";
|
|
20
20
|
import { selfImprove } from "@tangle-network/agent-eval/contract";
|
|
21
21
|
import { defineEvaluationClaim, summarizeEvaluationUnits } from "@tangle-network/agent-eval/experiment";
|
|
22
|
-
|
|
22
|
+
// src/runtime-usage.ts
|
|
23
23
|
function createRuntimeUsageTotals() {
|
|
24
24
|
return {
|
|
25
25
|
tokensIn: 0,
|
|
@@ -48,8 +48,7 @@ function addRuntimeUsage(totals, event) {
|
|
|
48
48
|
if (event.usdKnown === false) totals.usdKnown = false;
|
|
49
49
|
if (isUsageAmount(event.estimatedCostUsd)) totals.estimatedCostUsd = (totals.estimatedCostUsd ?? 0) + event.estimatedCostUsd;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
//#region src/improvement/agentic-shot-evidence.ts
|
|
51
|
+
// src/improvement/agentic-shot-evidence.ts
|
|
53
52
|
async function emitShotReceipt(callback, receipt, execution, primaryError) {
|
|
54
53
|
try {
|
|
55
54
|
await callback?.(receipt, execution);
|
|
@@ -150,8 +149,7 @@ function promptCacheReadTokens(usage) {
|
|
|
150
149
|
if (typeof value === "number" && Number.isFinite(value) && value >= 0) return value;
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
|
-
|
|
154
|
-
//#region src/improvement/worktree-tree.ts
|
|
152
|
+
// src/improvement/worktree-tree.ts
|
|
155
153
|
/**
|
|
156
154
|
* The exact content of a candidate worktree, as a Git tree object.
|
|
157
155
|
*
|
|
@@ -242,8 +240,7 @@ function worktreeChangedPaths(worktreePath) {
|
|
|
242
240
|
}
|
|
243
241
|
return paths;
|
|
244
242
|
}
|
|
245
|
-
|
|
246
|
-
//#region src/improvement/agentic-generator.ts
|
|
243
|
+
// src/improvement/agentic-generator.ts
|
|
247
244
|
/**
|
|
248
245
|
*
|
|
249
246
|
* `agenticGenerator` — the full-agentic `CandidateGenerator`. It runs a real
|
|
@@ -718,8 +715,7 @@ function canonicalPath(path) {
|
|
|
718
715
|
function worktreeDirty(worktreePath) {
|
|
719
716
|
return worktreeChangedPaths(worktreePath).length > 0;
|
|
720
717
|
}
|
|
721
|
-
|
|
722
|
-
//#region src/improvement/cleanup.ts
|
|
718
|
+
// src/improvement/cleanup.ts
|
|
723
719
|
async function rethrowAfterCleanup(cause, cleanup, context) {
|
|
724
720
|
const cleanupErrors = [];
|
|
725
721
|
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
@@ -734,8 +730,7 @@ async function rethrowAfterCleanup(cause, cleanup, context) {
|
|
|
734
730
|
}
|
|
735
731
|
throw new AggregateError([cause, ...cleanupErrors], `${context}; cleanup failed`);
|
|
736
732
|
}
|
|
737
|
-
|
|
738
|
-
//#region src/improvement/improve-result.ts
|
|
733
|
+
// src/improvement/improve-result.ts
|
|
739
734
|
function copyImproveCost(cost) {
|
|
740
735
|
return {
|
|
741
736
|
totalCostUsd: cost.totalCostUsd,
|
|
@@ -743,8 +738,7 @@ function copyImproveCost(cost) {
|
|
|
743
738
|
incompleteReasons: [...cost.incompleteReasons]
|
|
744
739
|
};
|
|
745
740
|
}
|
|
746
|
-
|
|
747
|
-
//#region src/improvement/improvement-driver.ts
|
|
741
|
+
// src/improvement/improvement-driver.ts
|
|
748
742
|
/**
|
|
749
743
|
* Code-only candidate driver for Runtime-owned git worktrees.
|
|
750
744
|
*
|
|
@@ -855,8 +849,7 @@ function advanceToIncumbent(worktree, incumbent) {
|
|
|
855
849
|
});
|
|
856
850
|
if (head.error || head.status !== 0 || head.stdout.trim() !== incumbent.candidateCommit) throw new Error("improvementDriver: candidate worktree did not reach the incumbent commit");
|
|
857
851
|
}
|
|
858
|
-
|
|
859
|
-
//#region src/improvement/profile-surface.ts
|
|
852
|
+
// src/improvement/profile-surface.ts
|
|
860
853
|
/** Extract the baseline optimized by a method and retain its structured value
|
|
861
854
|
* so external optimizers can inspect it for private fields before serialization. */
|
|
862
855
|
function prepareProfileSurface(profile, surface, skills, profileComponents) {
|
|
@@ -1070,7 +1063,8 @@ function createProfileCandidateMaterializer(profile, surface, baselineSurface, s
|
|
|
1070
1063
|
const decodedBaseline = decode(baselineSurface);
|
|
1071
1064
|
const baselineDigest = canonicalCandidateDigest$1(baselineSurface);
|
|
1072
1065
|
if (profileComponents) {
|
|
1073
|
-
|
|
1066
|
+
const reappliedBaseline = materializeImprovementProfileCandidate(profile, surface, decodedBaseline, skills, profileComponents);
|
|
1067
|
+
if (canonicalAgentProfileDigest(reappliedBaseline) !== canonicalAgentProfileDigest(profile)) throw new ConfigError("improve(): profileComponents.apply(profile, profileComponents.read(profile)) must reproduce the complete baseline profile exactly");
|
|
1074
1068
|
}
|
|
1075
1069
|
const candidates = /* @__PURE__ */ new Map([[baselineDigest, profile]]);
|
|
1076
1070
|
return (candidateSurface) => {
|
|
@@ -1113,8 +1107,7 @@ function replaceProfileInstructions(profile, content) {
|
|
|
1113
1107
|
function assertFailClosedResources(profile, surface) {
|
|
1114
1108
|
if (profile.resources?.failOnError !== true) throw new ConfigError(`improve(): surface '${surface}' requires profile.resources.failOnError: true`);
|
|
1115
1109
|
}
|
|
1116
|
-
|
|
1117
|
-
//#region src/improvement/raw-trace-distiller.ts
|
|
1110
|
+
// src/improvement/raw-trace-distiller.ts
|
|
1118
1111
|
/**
|
|
1119
1112
|
*
|
|
1120
1113
|
* `rawTraceDistiller` — the meta-harness `analyzeGeneration` producer.
|
|
@@ -1359,8 +1352,7 @@ function dedupeSorted(paths) {
|
|
|
1359
1352
|
function truncate(s, n) {
|
|
1360
1353
|
return s.length <= n ? s : `${s.slice(0, n - 1)}…`;
|
|
1361
1354
|
}
|
|
1362
|
-
|
|
1363
|
-
//#region src/improvement/code-execution.ts
|
|
1355
|
+
// src/improvement/code-execution.ts
|
|
1364
1356
|
/** Slice bound for distilled judge notes: wide enough that a real traceback or
|
|
1365
1357
|
* failing assertion survives intact. */
|
|
1366
1358
|
const distilledNotesMaxChars = 1500;
|
|
@@ -1562,8 +1554,7 @@ async function runCodeImprovement(opts) {
|
|
|
1562
1554
|
dispose
|
|
1563
1555
|
};
|
|
1564
1556
|
}
|
|
1565
|
-
|
|
1566
|
-
//#region src/improvement/method-controls.ts
|
|
1557
|
+
// src/improvement/method-controls.ts
|
|
1567
1558
|
const methodRuntimeControls = Symbol("agent-runtime.improvement.method-runtime-controls");
|
|
1568
1559
|
function withMethodRuntimeControls(method, controls) {
|
|
1569
1560
|
return Object.freeze({
|
|
@@ -1574,8 +1565,7 @@ function withMethodRuntimeControls(method, controls) {
|
|
|
1574
1565
|
function methodRuntimeControlsOf(method) {
|
|
1575
1566
|
return method[methodRuntimeControls];
|
|
1576
1567
|
}
|
|
1577
|
-
|
|
1578
|
-
//#region src/improvement/method-cost.ts
|
|
1568
|
+
// src/improvement/method-cost.ts
|
|
1579
1569
|
const EVALUATION_TAG = "runtimeEvaluationRef";
|
|
1580
1570
|
const INVOCATION_TAG = "runtimeInvocationId";
|
|
1581
1571
|
function methodInputWithScopedCost(input, scope, costAttribution = "invocation") {
|
|
@@ -1657,8 +1647,7 @@ function exceeds(value, limit) {
|
|
|
1657
1647
|
function methodHistoricalReceipts(ledger, optimizerRun, invocationId) {
|
|
1658
1648
|
return ledger.list({ tags: { optimizerRun } }).filter((receipt) => receipt.tags?.[INVOCATION_TAG] !== invocationId);
|
|
1659
1649
|
}
|
|
1660
|
-
|
|
1661
|
-
//#region src/improvement/candidate-validation.ts
|
|
1650
|
+
// src/improvement/candidate-validation.ts
|
|
1662
1651
|
/** One spelling of the execution-identity rule for optimization, training, and the harness. */
|
|
1663
1652
|
function parseExecutionRef(value, label) {
|
|
1664
1653
|
const parsed = sha256DigestSchema.safeParse(value);
|
|
@@ -1700,8 +1689,7 @@ function privateValuePaths(values) {
|
|
|
1700
1689
|
function jsonPathOf(pointer) {
|
|
1701
1690
|
return pointer.split("/").slice(1).map((segment) => segment.replaceAll("~1", "/").replaceAll("~0", "~")).reduce((path, segment) => /^\d+$/.test(segment) ? `${path}[${segment}]` : `${path}.${segment}`, "$");
|
|
1702
1691
|
}
|
|
1703
|
-
|
|
1704
|
-
//#region src/improvement/method-identity.ts
|
|
1692
|
+
// src/improvement/method-identity.ts
|
|
1705
1693
|
function buildMethodEvaluationIdentity(input) {
|
|
1706
1694
|
const optimizationReps = input.optimizationRunOptions?.reps ?? 1;
|
|
1707
1695
|
const finalTestReps = input.reps ?? 1;
|
|
@@ -1766,8 +1754,7 @@ function judgeDescriptor(judge) {
|
|
|
1766
1754
|
appliesToImplementation: judge.appliesTo ? Function.prototype.toString.call(judge.appliesTo) : null
|
|
1767
1755
|
};
|
|
1768
1756
|
}
|
|
1769
|
-
|
|
1770
|
-
//#region src/improvement/profile-improvement.ts
|
|
1757
|
+
// src/improvement/profile-improvement.ts
|
|
1771
1758
|
/**
|
|
1772
1759
|
* What every profile improvement prepares before any optimizer or search runs:
|
|
1773
1760
|
* the exact surface and its baseline, the evaluation identity, identified
|
|
@@ -1884,8 +1871,7 @@ function profileModel(profile) {
|
|
|
1884
1871
|
unknown: "the profile names a model hint, not a snapshot; each cell records the model it resolved"
|
|
1885
1872
|
};
|
|
1886
1873
|
}
|
|
1887
|
-
|
|
1888
|
-
//#region src/improvement/method-execution.ts
|
|
1874
|
+
// src/improvement/method-execution.ts
|
|
1889
1875
|
function resolveOptimizationMethod(source, context) {
|
|
1890
1876
|
const method = typeof source === "function" ? source(context) : source;
|
|
1891
1877
|
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)");
|
|
@@ -2020,11 +2006,11 @@ async function runMethodImprovement(profile, opts) {
|
|
|
2020
2006
|
async dispose() {}
|
|
2021
2007
|
};
|
|
2022
2008
|
}
|
|
2023
|
-
|
|
2024
|
-
//#region src/improvement/search-session.ts
|
|
2009
|
+
// src/improvement/search-session.ts
|
|
2025
2010
|
/** A refusal as the ledger stores it: redacted with the share profile. */
|
|
2026
2011
|
function searchRefusalText(error) {
|
|
2027
|
-
|
|
2012
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
2013
|
+
return redact(message, { profile: "share" }).value;
|
|
2028
2014
|
}
|
|
2029
2015
|
/** The node a candidate surface becomes: materialized, or refused with the reason. */
|
|
2030
2016
|
function profileNodeOf(prepared, candidateSurface) {
|
|
@@ -2135,8 +2121,7 @@ function profileCodec(prepared) {
|
|
|
2135
2121
|
}
|
|
2136
2122
|
};
|
|
2137
2123
|
}
|
|
2138
|
-
|
|
2139
|
-
//#region src/improvement/search-method.ts
|
|
2124
|
+
// src/improvement/search-method.ts
|
|
2140
2125
|
/** Build Runtime's native search for `improve(profile, { method })`. */
|
|
2141
2126
|
function searchMethod(options) {
|
|
2142
2127
|
if (!options || typeof options !== "object") throw new ConfigError("searchMethod(): options are required");
|
|
@@ -2659,8 +2644,7 @@ function faultResult(result, fault) {
|
|
|
2659
2644
|
}
|
|
2660
2645
|
};
|
|
2661
2646
|
}
|
|
2662
|
-
|
|
2663
|
-
//#region src/improvement/training.ts
|
|
2647
|
+
// src/improvement/training.ts
|
|
2664
2648
|
function positiveLimit(value, label) {
|
|
2665
2649
|
if (!Number.isSafeInteger(value) || value <= 0) throw new Error(`invalid ${label}`);
|
|
2666
2650
|
}
|
|
@@ -2886,7 +2870,7 @@ async function runProfileTraining(profile, options) {
|
|
|
2886
2870
|
const parentProfilePath = join(jobDirectory, "parent-profile.json");
|
|
2887
2871
|
const artifactPath = join(jobDirectory, "checkpoint.bin");
|
|
2888
2872
|
stage = "dataset";
|
|
2889
|
-
const source = await hashFile(sourceDataset,
|
|
2873
|
+
const source = await hashFile(sourceDataset, 134217728, signal, true);
|
|
2890
2874
|
if (source.digest !== expectedDatasetDigest) throw new Error("training dataset digest mismatch");
|
|
2891
2875
|
const bytes = source.content;
|
|
2892
2876
|
if (bytes.length !== source.bytes) throw new Error("training dataset snapshot is incomplete");
|
|
@@ -2918,7 +2902,7 @@ async function runProfileTraining(profile, options) {
|
|
|
2918
2902
|
if (trained?.succeeded !== true) throw new Error(trained?.reason ?? "trainer did not report success");
|
|
2919
2903
|
trainingMayExist = false;
|
|
2920
2904
|
stage = "checkpoint";
|
|
2921
|
-
if ((await hashFile(datasetPath,
|
|
2905
|
+
if ((await hashFile(datasetPath, 134217728, signal)).digest !== dataset.digest || (await hashFile(parentProfilePath, parentBytes.byteLength, signal)).digest !== sha256Bytes$1(parentBytes)) throw new Error("trainer changed its pinned inputs");
|
|
2922
2906
|
const artifact = await hashFile(artifactPath, maxCheckpointBytes, signal);
|
|
2923
2907
|
if (artifact.bytes === 0) throw new Error("checkpoint must be nonempty");
|
|
2924
2908
|
await chmod(artifactPath, 256);
|
|
@@ -3027,8 +3011,7 @@ async function runProfileTraining(profile, options) {
|
|
|
3027
3011
|
cancellation.release();
|
|
3028
3012
|
}
|
|
3029
3013
|
}
|
|
3030
|
-
|
|
3031
|
-
//#region src/improvement/improve.ts
|
|
3014
|
+
// src/improvement/improve.ts
|
|
3032
3015
|
async function improve(profileOrCode, opts) {
|
|
3033
3016
|
if (opts === void 0) {
|
|
3034
3017
|
const code = profileOrCode;
|
|
@@ -3047,7 +3030,6 @@ async function improve(profileOrCode, opts) {
|
|
|
3047
3030
|
if (isImproveSearchMethod(opts.method)) return runSearchImprovement(exact, opts);
|
|
3048
3031
|
return runMethodImprovement(exact, opts);
|
|
3049
3032
|
}
|
|
3050
|
-
//#endregion
|
|
3051
3033
|
export { assertProfileTrainingIsHeldOut as a, withMethodRuntimeControls as c, commandVerifier as d, addRuntimeUsage as f, assertCandidateValidator as i, rethrowAfterCleanup as l, isUsageAmount as m, createCommandProfileTrainer as n, parseExecutionRef as o, createRuntimeUsageTotals as p, searchMethod as r, privateValuePaths as s, improve as t, agenticGenerator as u };
|
|
3052
3034
|
|
|
3053
|
-
//# sourceMappingURL=improve-
|
|
3035
|
+
//# sourceMappingURL=improve-i0HU1-aa.js.map
|