@tangle-network/agent-eval 0.137.0 → 0.138.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/CHANGELOG.md +48 -0
- package/README.md +33 -0
- package/dist/analyst/index.d.ts +473 -39
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +11 -593
- package/dist/analyst/index.js.map +1 -1
- package/dist/{analyze-runs-PVtnfjvA.d.ts → analyze-runs-CPYxfPWT.d.ts} +5 -5
- package/dist/{analyze-runs-PVtnfjvA.d.ts.map → analyze-runs-CPYxfPWT.d.ts.map} +1 -1
- package/dist/{benchmark-YDrpumqB.js → benchmark-D8dkki-J.js} +299 -159
- package/dist/benchmark-D8dkki-J.js.map +1 -0
- package/dist/{benchmark-CHX4orG7.d.ts → benchmark-DlQgU_XI.d.ts} +67 -15
- package/dist/benchmark-DlQgU_XI.d.ts.map +1 -0
- package/dist/benchmark-command-CMqVqReF.js +4332 -0
- package/dist/benchmark-command-CMqVqReF.js.map +1 -0
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +1 -1
- package/dist/{benchmarks-DCLkQOmc.js → benchmarks-BJ_xK5rQ.js} +4 -3
- package/dist/{benchmarks-DCLkQOmc.js.map → benchmarks-BJ_xK5rQ.js.map} +1 -1
- package/dist/campaign/index.d.ts +5 -5
- package/dist/campaign/index.js +3 -3
- package/dist/{campaign-lgObcHFC.js → campaign-BIBS-NHV.js} +16 -9
- package/dist/campaign-BIBS-NHV.js.map +1 -0
- package/dist/cli.js +9 -2
- package/dist/cli.js.map +1 -1
- package/dist/{client-C8L6h6Wf.d.ts → client-BwPKohkJ.d.ts} +4 -4
- package/dist/{client-C8L6h6Wf.d.ts.map → client-BwPKohkJ.d.ts.map} +1 -1
- package/dist/{completion-verifier-DSyRNVzU.d.ts → completion-verifier-B4-IMYcS.d.ts} +3 -3
- package/dist/{completion-verifier-DSyRNVzU.d.ts.map → completion-verifier-B4-IMYcS.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +10 -10
- package/dist/contract/index.js +8 -8
- package/dist/control.d.ts +2 -2
- package/dist/{cost-ledger-D2o6JOrL.d.ts → cost-ledger-B1D3COAc.d.ts} +5 -4
- package/dist/{cost-ledger-D2o6JOrL.d.ts.map → cost-ledger-B1D3COAc.d.ts.map} +1 -1
- package/dist/{cost-ledger-D-5_-dhi.js → cost-ledger-CHDLA0Ss.js} +90 -45
- package/dist/cost-ledger-CHDLA0Ss.js.map +1 -0
- package/dist/{default-registry-Dc5D_Loc.d.ts → default-registry-PUhIVRWz.d.ts} +18 -5
- package/dist/default-registry-PUhIVRWz.d.ts.map +1 -0
- package/dist/{default-registry-CLXbRt0f.js → default-registry-lp5R0lve.js} +1503 -258
- package/dist/default-registry-lp5R0lve.js.map +1 -0
- package/dist/{eval-campaign-CHqfLnff.js → eval-campaign-9MozgKL7.js} +2 -2
- package/dist/{eval-campaign-CHqfLnff.js.map → eval-campaign-9MozgKL7.js.map} +1 -1
- package/dist/exact-types-Dpw2LeHA.d.ts +234 -0
- package/dist/exact-types-Dpw2LeHA.d.ts.map +1 -0
- package/dist/{extract-usage-p-56bh8q.js → extract-usage-CS391dOE.js} +2 -2
- package/dist/{extract-usage-p-56bh8q.js.map → extract-usage-CS391dOE.js.map} +1 -1
- package/dist/{feedback-trajectory-N_F0PwHz.d.ts → feedback-trajectory-CoNep7rl.d.ts} +3 -2
- package/dist/feedback-trajectory-CoNep7rl.d.ts.map +1 -0
- package/dist/fuzz.d.ts +1 -1
- package/dist/fuzz.js +1 -1
- package/dist/hosted/index.d.ts +3 -3
- package/dist/{index-U3RHOShi.d.ts → index-B2-IxCMB.d.ts} +2 -2
- package/dist/{index-U3RHOShi.d.ts.map → index-B2-IxCMB.d.ts.map} +1 -1
- package/dist/{index-BnP1QJUv.d.ts → index-CjVYlVBK.d.ts} +5 -5
- package/dist/{index-BnP1QJUv.d.ts.map → index-CjVYlVBK.d.ts.map} +1 -1
- package/dist/{index-C-Pr4OWg.d.ts → index-D0cxAdaV.d.ts} +11 -10
- package/dist/index-D0cxAdaV.d.ts.map +1 -0
- package/dist/index-DEb46kc6.d.ts.map +1 -1
- package/dist/{index-DRNl6g_N.d.ts → index-sMN_hI4E.d.ts} +3 -3
- package/dist/{index-DRNl6g_N.d.ts.map → index-sMN_hI4E.d.ts.map} +1 -1
- package/dist/index.d.ts +24 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -353
- package/dist/index.js.map +1 -1
- package/dist/{insight-report-B9ooYH_g.d.ts → insight-report-CXd8VBDR.d.ts} +4 -4
- package/dist/{insight-report-B9ooYH_g.d.ts.map → insight-report-CXd8VBDR.d.ts.map} +1 -1
- package/dist/{integrity-CKxosZ5Z.d.ts → integrity-B-MLFz0I.d.ts} +2 -2
- package/dist/{integrity-CKxosZ5Z.d.ts.map → integrity-B-MLFz0I.d.ts.map} +1 -1
- package/dist/ledger-core/index.js +1 -1
- package/dist/{ledger-core-t6sItivm.js → ledger-core-C0Yx1I14.js} +220 -27
- package/dist/ledger-core-C0Yx1I14.js.map +1 -0
- package/dist/{llm-client-DKB25jV8.js → llm-client-Cj3c7PEm.js} +5 -5
- package/dist/llm-client-Cj3c7PEm.js.map +1 -0
- package/dist/meta-eval/index.d.ts +2 -2
- package/dist/multishot/index.d.ts +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{proposal-findings-DCawte-y.js → proposal-findings-2GIUo1et.js} +2 -68
- package/dist/proposal-findings-2GIUo1et.js.map +1 -0
- package/dist/{registry-BdM7SuTr.d.ts → registry-C4yJTza7.d.ts} +60 -6
- package/dist/registry-C4yJTza7.d.ts.map +1 -0
- package/dist/{release-report-CofgVNZt.d.ts → release-report-CoyvyLBs.d.ts} +3 -3
- package/dist/{release-report-CofgVNZt.d.ts.map → release-report-CoyvyLBs.d.ts.map} +1 -1
- package/dist/{replay-Bju0T8Ls.js → replay-Cb-4Vf0k.js} +8 -7
- package/dist/replay-Cb-4Vf0k.js.map +1 -0
- package/dist/{replay-K8FaC0CB.d.ts → replay-DbIYwso6.d.ts} +7 -7
- package/dist/{replay-K8FaC0CB.d.ts.map → replay-DbIYwso6.d.ts.map} +1 -1
- package/dist/reporting.d.ts +4 -4
- package/dist/{researcher-Da0Wj-bt.d.ts → researcher-BCeOEjtR.d.ts} +5 -5
- package/dist/{researcher-Da0Wj-bt.d.ts.map → researcher-BCeOEjtR.d.ts.map} +1 -1
- package/dist/{reward-hacking-CQ3hTCO3.d.ts → reward-hacking-sE2l_NV6.d.ts} +2 -2
- package/dist/{reward-hacking-CQ3hTCO3.d.ts.map → reward-hacking-sE2l_NV6.d.ts.map} +1 -1
- package/dist/rl.d.ts +5 -5
- package/dist/rl.js +1 -1
- package/dist/rollout/index.d.ts +1 -1
- package/dist/{rubric-predictive-validity-C4sztLR3.d.ts → rubric-predictive-validity-w2klGv1u.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-C4sztLR3.d.ts.map → rubric-predictive-validity-w2klGv1u.d.ts.map} +1 -1
- package/dist/{run-evidence-BDIircdA.d.ts → run-evidence-CbE0A8Xg.d.ts} +3 -3
- package/dist/{run-evidence-BDIircdA.d.ts.map → run-evidence-CbE0A8Xg.d.ts.map} +1 -1
- package/dist/{run-record-BPCa2rQ8.d.ts → run-record-DwHMk1Ai.d.ts} +2 -2
- package/dist/{run-record-BPCa2rQ8.d.ts.map → run-record-DwHMk1Ai.d.ts.map} +1 -1
- package/dist/{semantic-concept-judge-Bz64IckK.js → semantic-concept-judge-DYXDPZW0.js} +11 -5
- package/dist/semantic-concept-judge-DYXDPZW0.js.map +1 -0
- package/dist/{server-KjXZZUDX.js → server-DLEvyW2z.js} +3 -3
- package/dist/{server-KjXZZUDX.js.map → server-DLEvyW2z.js.map} +1 -1
- package/dist/single-run-lock-D_bS5xhj.js +318 -0
- package/dist/single-run-lock-D_bS5xhj.js.map +1 -0
- package/dist/{skill-usage-CFDLLlhF.d.ts → skill-usage-Bv3G4VkA.d.ts} +18 -8
- package/dist/skill-usage-Bv3G4VkA.d.ts.map +1 -0
- package/dist/{skillopt-optimization-method-f4o9sUT4.js → skillopt-optimization-method-CjKMZy0d.js} +7 -182
- package/dist/skillopt-optimization-method-CjKMZy0d.js.map +1 -0
- package/dist/{skillopt-optimization-method-BpbnlvAZ.d.ts → skillopt-optimization-method-CzfnA8O-.d.ts} +10 -10
- package/dist/{skillopt-optimization-method-BpbnlvAZ.d.ts.map → skillopt-optimization-method-CzfnA8O-.d.ts.map} +1 -1
- package/dist/{statistics-_7P642CN.d.ts → statistics-mf70aXKp.d.ts} +2 -2
- package/dist/{statistics-_7P642CN.d.ts.map → statistics-mf70aXKp.d.ts.map} +1 -1
- package/dist/{tools-DZk2Jn64.js → store-otlp-BenKynPE.js} +4 -192
- package/dist/store-otlp-BenKynPE.js.map +1 -0
- package/dist/{summary-report-DHipz9Kx.d.ts → summary-report-BKinV4yD.d.ts} +3 -3
- package/dist/{summary-report-DHipz9Kx.d.ts.map → summary-report-BKinV4yD.d.ts.map} +1 -1
- package/dist/tools-DZGdROtG.js +255 -0
- package/dist/tools-DZGdROtG.js.map +1 -0
- package/dist/traces.d.ts +5 -5
- package/dist/traces.js +4 -3
- package/dist/{types-CTvKfr5F.d.ts → types-5q2T25iW.d.ts} +2 -2
- package/dist/{types-CTvKfr5F.d.ts.map → types-5q2T25iW.d.ts.map} +1 -1
- package/dist/{types-CKswbJGO.d.ts → types-BtJhn8v6.d.ts} +4 -4
- package/dist/{types-CKswbJGO.d.ts.map → types-BtJhn8v6.d.ts.map} +1 -1
- package/dist/{types-CTGbIm57.d.ts → types-zFYez3PK.d.ts} +5 -5
- package/dist/{types-CTGbIm57.d.ts.map → types-zFYez3PK.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +3 -3
- package/dist/wire/index.js +1 -1
- package/docs/trace-analysis.md +123 -3
- package/package.json +5 -3
- package/dist/benchmark-CHX4orG7.d.ts.map +0 -1
- package/dist/benchmark-YDrpumqB.js.map +0 -1
- package/dist/campaign-lgObcHFC.js.map +0 -1
- package/dist/concurrency-MUjT7VjM.js +0 -109
- package/dist/concurrency-MUjT7VjM.js.map +0 -1
- package/dist/cost-ledger-D-5_-dhi.js.map +0 -1
- package/dist/default-registry-CLXbRt0f.js.map +0 -1
- package/dist/default-registry-Dc5D_Loc.d.ts.map +0 -1
- package/dist/feedback-trajectory-N_F0PwHz.d.ts.map +0 -1
- package/dist/index-C-Pr4OWg.d.ts.map +0 -1
- package/dist/ledger-core-t6sItivm.js.map +0 -1
- package/dist/llm-client-DKB25jV8.js.map +0 -1
- package/dist/proposal-findings-DCawte-y.js.map +0 -1
- package/dist/registry-BdM7SuTr.d.ts.map +0 -1
- package/dist/replay-Bju0T8Ls.js.map +0 -1
- package/dist/semantic-concept-judge-Bz64IckK.js.map +0 -1
- package/dist/skill-usage-CFDLLlhF.d.ts.map +0 -1
- package/dist/skillopt-optimization-method-f4o9sUT4.js.map +0 -1
- package/dist/tools-DZk2Jn64.js.map +0 -1
package/dist/{skillopt-optimization-method-f4o9sUT4.js → skillopt-optimization-method-CjKMZy0d.js}
RENAMED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { c as ValidationError, i as JudgeError, t as AgentEvalError } from "./errors-D-LKuDhb.js";
|
|
2
|
-
import { c as costForTokenPricing, i as CostLedger, t as CostAccountingIncompleteError } from "./cost-ledger-
|
|
3
|
-
import { f as maximumChargeForLlmRequest, l as costReceiptFromLlm, m as stripFencedJson, u as costReceiptFromLlmError } from "./llm-client-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { c as costForTokenPricing, i as CostLedger, t as CostAccountingIncompleteError } from "./cost-ledger-CHDLA0Ss.js";
|
|
3
|
+
import { f as maximumChargeForLlmRequest, l as costReceiptFromLlm, m as stripFencedJson, u as costReceiptFromLlmError } from "./llm-client-Cj3c7PEm.js";
|
|
4
|
+
import { n as createRunCostLedger, r as fsCampaignStorage, t as acquireSingleRunLock } from "./single-run-lock-D_bS5xhj.js";
|
|
5
|
+
import { p as mapConcurrent } from "./ledger-core-C0Yx1I14.js";
|
|
6
|
+
import { a as clamp01, o as combineAbortSignals, t as assertProposalFindings } from "./proposal-findings-2GIUo1et.js";
|
|
6
7
|
import { E as pairedBootstrap, H as weightedComposite, M as pairedRiskDifferenceScore, N as pairedSignTest, O as pairedDeltaTieFraction, T as pairedBinaryScale, d as confidenceInterval, j as pairedRiskDifferenceExact } from "./statistics-ByxzSiOM.js";
|
|
7
|
-
import { a as appendLedgerLine, d as tryAcquireAtomicFileLock, o as tryWithLedgerFileLock, u as probeAtomicFileLock } from "./ledger-core-t6sItivm.js";
|
|
8
8
|
import { t as DEFAULT_REDACTION_RULES } from "./redact-7Aq1ukl-.js";
|
|
9
9
|
import { a as campaignCellExecutionEvidence, l as projectCampaignCellQuality, t as detectRewardHacking } from "./reward-hacking-GyN0kMd8.js";
|
|
10
|
-
import { createRequire } from "node:module";
|
|
11
10
|
import { z } from "zod";
|
|
12
11
|
import { appendFileSync, existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
13
12
|
import { basename, isAbsolute, join } from "node:path";
|
|
@@ -2806,127 +2805,6 @@ function resolveRunDir(runDir, repo) {
|
|
|
2806
2805
|
return join(tangleTracesRoot(), r, "runs", runDir);
|
|
2807
2806
|
}
|
|
2808
2807
|
//#endregion
|
|
2809
|
-
//#region src/campaign/search-ledger-errors.ts
|
|
2810
|
-
/** Base error for invalid search-ledger input or operations. */
|
|
2811
|
-
var SearchLedgerError = class extends ValidationError {};
|
|
2812
|
-
/** Error raised when durable search-ledger data fails an integrity check. */
|
|
2813
|
-
var SearchLedgerIntegrityError = class extends SearchLedgerError {};
|
|
2814
|
-
/** Error raised when an event identifier is reused with different content. */
|
|
2815
|
-
var SearchLedgerConflictError = class extends SearchLedgerError {};
|
|
2816
|
-
//#endregion
|
|
2817
|
-
//#region src/campaign/search-ledger-file.ts
|
|
2818
|
-
/** Campaign binding of the generic journal file layer to search-ledger errors. */
|
|
2819
|
-
const SEARCH_LEDGER_FILE_CONTEXT = {
|
|
2820
|
-
subject: "search ledger",
|
|
2821
|
-
integrityError: (message, options) => new SearchLedgerIntegrityError(message, options)
|
|
2822
|
-
};
|
|
2823
|
-
function appendSearchLedgerLine(path, line) {
|
|
2824
|
-
appendLedgerLine(path, line, SEARCH_LEDGER_FILE_CONTEXT);
|
|
2825
|
-
}
|
|
2826
|
-
function tryWithSearchLedgerFileLock(ledgerPath, run) {
|
|
2827
|
-
return tryWithLedgerFileLock(ledgerPath, SEARCH_LEDGER_FILE_CONTEXT, run);
|
|
2828
|
-
}
|
|
2829
|
-
//#endregion
|
|
2830
|
-
//#region src/campaign/storage.ts
|
|
2831
|
-
/** Node-filesystem storage — the default. Lazily requires `node:fs` so the
|
|
2832
|
-
* module imports cleanly in non-Node runtimes (where the caller passes
|
|
2833
|
-
* `inMemoryCampaignStorage` instead and never constructs this).
|
|
2834
|
-
*
|
|
2835
|
-
* `createRequire(import.meta.url)` is the ESM-native lazy require — a bare
|
|
2836
|
-
* `require` is a ReferenceError under `"type": "module"`, which is exactly
|
|
2837
|
-
* the shape this package publishes. */
|
|
2838
|
-
function fsCampaignStorage() {
|
|
2839
|
-
const { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } = createRequire(import.meta.url)("node:fs");
|
|
2840
|
-
return {
|
|
2841
|
-
ensureDir(dir) {
|
|
2842
|
-
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
2843
|
-
},
|
|
2844
|
-
exists(path) {
|
|
2845
|
-
return existsSync(path);
|
|
2846
|
-
},
|
|
2847
|
-
read(path) {
|
|
2848
|
-
try {
|
|
2849
|
-
return readFileSync(path, "utf8");
|
|
2850
|
-
} catch {
|
|
2851
|
-
return;
|
|
2852
|
-
}
|
|
2853
|
-
},
|
|
2854
|
-
write(path, content) {
|
|
2855
|
-
writeFileSync(path, content);
|
|
2856
|
-
},
|
|
2857
|
-
append(path, content, expectedBytes) {
|
|
2858
|
-
const result = tryWithSearchLedgerFileLock(path, () => {
|
|
2859
|
-
let actualBytes = 0;
|
|
2860
|
-
try {
|
|
2861
|
-
actualBytes = statSync(path).size;
|
|
2862
|
-
} catch (error) {
|
|
2863
|
-
if (error.code !== "ENOENT") throw error;
|
|
2864
|
-
}
|
|
2865
|
-
if (actualBytes !== expectedBytes) return void 0;
|
|
2866
|
-
appendSearchLedgerLine(path, content);
|
|
2867
|
-
return expectedBytes + Buffer.byteLength(content);
|
|
2868
|
-
});
|
|
2869
|
-
return result.acquired ? result.value : void 0;
|
|
2870
|
-
}
|
|
2871
|
-
};
|
|
2872
|
-
}
|
|
2873
|
-
/** In-memory storage for filesystem-less runtimes. Artifacts + trace spans
|
|
2874
|
-
* live in a `Map` for the duration of the run; the `CampaignResult` is
|
|
2875
|
-
* fully populated, but nothing is persisted to disk. */
|
|
2876
|
-
function inMemoryCampaignStorage() {
|
|
2877
|
-
const files = /* @__PURE__ */ new Map();
|
|
2878
|
-
const dirs = /* @__PURE__ */ new Set();
|
|
2879
|
-
return {
|
|
2880
|
-
ensureDir(dir) {
|
|
2881
|
-
dirs.add(dir);
|
|
2882
|
-
},
|
|
2883
|
-
exists(path) {
|
|
2884
|
-
return files.has(path) || dirs.has(path);
|
|
2885
|
-
},
|
|
2886
|
-
read(path) {
|
|
2887
|
-
const value = files.get(path);
|
|
2888
|
-
if (value === void 0) return void 0;
|
|
2889
|
-
return typeof value === "string" ? value : new TextDecoder().decode(value);
|
|
2890
|
-
},
|
|
2891
|
-
write(path, content) {
|
|
2892
|
-
files.set(path, content);
|
|
2893
|
-
},
|
|
2894
|
-
append(path, content, expectedBytes) {
|
|
2895
|
-
const current = files.get(path);
|
|
2896
|
-
const currentText = current === void 0 ? "" : typeof current === "string" ? current : new TextDecoder().decode(current);
|
|
2897
|
-
const currentBytes = new TextEncoder().encode(currentText).byteLength;
|
|
2898
|
-
if (currentBytes !== expectedBytes) return void 0;
|
|
2899
|
-
files.set(path, `${currentText}${content}`);
|
|
2900
|
-
return currentBytes + new TextEncoder().encode(content).byteLength;
|
|
2901
|
-
}
|
|
2902
|
-
};
|
|
2903
|
-
}
|
|
2904
|
-
/** Open the durable spend account stored beside a logical run. */
|
|
2905
|
-
function createRunCostLedger(input) {
|
|
2906
|
-
const path = join(input.runDir, "cost-ledger.jsonl");
|
|
2907
|
-
input.storage.ensureDir(input.runDir);
|
|
2908
|
-
return new CostLedger({
|
|
2909
|
-
costCeilingUsd: input.costCeilingUsd,
|
|
2910
|
-
persistence: {
|
|
2911
|
-
read: () => {
|
|
2912
|
-
const stored = input.storage.read(path);
|
|
2913
|
-
if (stored === void 0 && input.storage.exists(path)) throw new Error(`CostLedger: cannot read existing event log '${path}'`);
|
|
2914
|
-
const events = stored ?? "";
|
|
2915
|
-
return {
|
|
2916
|
-
revision: String(new TextEncoder().encode(events).byteLength),
|
|
2917
|
-
events
|
|
2918
|
-
};
|
|
2919
|
-
},
|
|
2920
|
-
append: (expectedRevision, event) => {
|
|
2921
|
-
const expectedBytes = Number(expectedRevision);
|
|
2922
|
-
if (!Number.isSafeInteger(expectedBytes) || expectedBytes < 0) throw new Error(`CostLedger: invalid storage revision '${expectedRevision}'`);
|
|
2923
|
-
const next = input.storage.append(path, event, expectedBytes);
|
|
2924
|
-
return next === void 0 ? void 0 : String(next);
|
|
2925
|
-
}
|
|
2926
|
-
}
|
|
2927
|
-
});
|
|
2928
|
-
}
|
|
2929
|
-
//#endregion
|
|
2930
2808
|
//#region src/campaign/run-campaign.ts
|
|
2931
2809
|
/**
|
|
2932
2810
|
* `runCampaign` — Pass A substrate primitive. ONE function that orchestrates
|
|
@@ -4654,59 +4532,6 @@ function assertComparisonCost(cost, label) {
|
|
|
4654
4532
|
if (cost.accountingComplete !== (cost.incompleteReasons.length === 0)) throw new Error(`compareOptimizationMethods: ${label} returned inconsistent cost completeness and reasons`);
|
|
4655
4533
|
}
|
|
4656
4534
|
//#endregion
|
|
4657
|
-
//#region src/campaign/single-run-lock.ts
|
|
4658
|
-
/**
|
|
4659
|
-
* Single-run lock for evaluations that share one mutable environment.
|
|
4660
|
-
*
|
|
4661
|
-
* Two concurrent runs against a shared stateful gym silently corrupt each
|
|
4662
|
-
* other: each resets/mutates environment state mid-cell of the other, and
|
|
4663
|
-
* every score from both becomes garbage that LOOKS like worker variance
|
|
4664
|
-
* (agent-lab R357 burned hours on flip-flopping scores before tracing them
|
|
4665
|
-
* to exactly this). The fix is a pid lockfile: refuse to start while a live
|
|
4666
|
-
* holder exists, reclaim stale locks whose pid is gone, release only if the
|
|
4667
|
-
* lock is still ours.
|
|
4668
|
-
*
|
|
4669
|
-
* `alsoCheck` exists because independent runners can guard the same shared
|
|
4670
|
-
* resource with differently named lockfiles; a runner must respect all of
|
|
4671
|
-
* them even though it writes only its own.
|
|
4672
|
-
*/
|
|
4673
|
-
function assertAvailable(path) {
|
|
4674
|
-
const unavailable = probeAtomicFileLock({ lockPath: path });
|
|
4675
|
-
if (unavailable) throw unavailableError(path, unavailable);
|
|
4676
|
-
}
|
|
4677
|
-
function unavailableError(path, unavailable) {
|
|
4678
|
-
if (unavailable.reason === "recovery") return /* @__PURE__ */ new Error(`single-run lock recovery is already in progress (${path}); refusing a concurrent run`);
|
|
4679
|
-
return /* @__PURE__ */ new Error(`single-run lock held by live pid ${unavailable.holder.pid} (${path}); refusing a concurrent run on the shared resource`);
|
|
4680
|
-
}
|
|
4681
|
-
/**
|
|
4682
|
-
* Acquire the lock or throw naming the live holder. A stale lock (holder pid
|
|
4683
|
-
* no longer running) is reclaimed by one contender. An interrupted reclaim
|
|
4684
|
-
* leaves a marker that fails closed instead of admitting overlapping runs.
|
|
4685
|
-
*/
|
|
4686
|
-
function acquireSingleRunLock(opts) {
|
|
4687
|
-
const pid = opts.pid ?? process.pid;
|
|
4688
|
-
if (!Number.isSafeInteger(pid) || pid <= 0) throw new Error("single-run lock pid must be a positive integer");
|
|
4689
|
-
for (const path of opts.alsoCheck ?? []) assertAvailable(path);
|
|
4690
|
-
const acquisition = tryAcquireAtomicFileLock({
|
|
4691
|
-
lockPath: opts.lockPath,
|
|
4692
|
-
pid
|
|
4693
|
-
});
|
|
4694
|
-
if (!acquisition.acquired) throw unavailableError(opts.lockPath, acquisition);
|
|
4695
|
-
const release = () => {
|
|
4696
|
-
try {
|
|
4697
|
-
acquisition.lock.release();
|
|
4698
|
-
} catch {}
|
|
4699
|
-
};
|
|
4700
|
-
try {
|
|
4701
|
-
for (const path of opts.alsoCheck ?? []) assertAvailable(path);
|
|
4702
|
-
} catch (error) {
|
|
4703
|
-
release();
|
|
4704
|
-
throw error;
|
|
4705
|
-
}
|
|
4706
|
-
if (opts.releaseOnExit ?? true) process.on("exit", release);
|
|
4707
|
-
return { release };
|
|
4708
|
-
}
|
|
4709
|
-
//#endregion
|
|
4710
4535
|
//#region src/campaign/external-text-optimization.ts
|
|
4711
4536
|
const DEFAULT_MAX_CANDIDATE_CHARS = 2e5;
|
|
4712
4537
|
const DEFAULT_MAX_EVIDENCE_CHARS = 1e5;
|
|
@@ -8119,6 +7944,6 @@ function skillOptOptimizationMethod(config) {
|
|
|
8119
7944
|
};
|
|
8120
7945
|
}
|
|
8121
7946
|
//#endregion
|
|
8122
|
-
export {
|
|
7947
|
+
export { campaignScenarioIdentity as $, assertOptimizationResult as A, pairedDeltaTest as At, surfaceHash as B, detectScale as C, paretoFrontier as Ct, runCanaries as D, decidePairedPromotion as Dt, pairHoldout as E, recoverTruncatedJson as Et, assertComponentSurface as F, summarizeBackendIntegrity as Ft, buildReflectionPrompt as G, campaignMeanComposite as H, codeSurfaceIdentityMaterial as I, JudgeParseError as It, runCampaign as J, parseReflectionResponse as K, componentSurfaceIdentityMaterial as L, costFromLedgerSummary as M, assertRealAgentReceipts as Mt, optimizationTokenUsageFromSummary as N, assertRealBackend as Nt, composeGate as O, pairedDecisionShape as Ot, assertCodeSurfaceIdentity as P, summarizeAgentReceiptIntegrity as Pt, assertCampaignSplitIdentity as Q, renderSurfaceDiff as R, defaultProductionGate as S, dominates as St, heldoutSignificance as T, scalarScore as Tt, compareRankKeys as U, campaignBreakdown as V, DEFAULT_MUTATION_PRIMITIVES as W, tangleTracesRoot as X, resolveRunDir as Y, assertCampaignDesign as Z, buildEvidenceVector as _, canonicalJson as _t, emitLoopProvenance as a, createReferenceEquivalenceJudge as at, powerPreflight as b, inMemoryVerdictCache as bt, provenanceRecordPath as c, redTeamDataset as ct, runImprovementLoop as d, toolNamesForRun as dt, campaignSplitDigest as et, runOptimization as f, Dataset as ft, gepaOptimizationMethod as g, cachedJudge as gt, labelTrustRank as h, llmJudge as ht, canonicalDigest as i, REFERENCE_EQUIVALENCE_JUDGE_VERSION as it, compareOptimizationMethods as j, BackendIntegrityError as jt, externalTextOptimizationMethod as k, minimumPairsForPairedDeltaTest as kt, provenanceSpansPath as l, redTeamReport as lt, isProposedCandidate as m, hashScenarios as mt, buildLoopProvenanceRecord as n, openAutoPr as nt, loopProvenanceArgsFromResult as o, runReferenceEquivalenceJudge as ot, runEval as p, HoldoutLockedError as pt, planCampaignRun as q, campaignMeasurementDigest as r, REFERENCE_EQUIVALENCE_INPUT_LIMITS as rt, loopProvenanceSpans as s, DEFAULT_RED_TEAM_CORPUS as st, skillOptOptimizationMethod as t, campaignSplitDigestFromIdentities as tt, verifyLoopProvenanceRecord as u, scoreRedTeamOutput as ut, paretoPolicy as v, contentHash as vt, dimensionRegressions as w, paretoFrontierWithCrowding as wt, heldOutGate as x, crowdingDistance as xt, paretoSignificanceGate as y, fileVerdictCache as yt, surfaceContentHash as z };
|
|
8123
7948
|
|
|
8124
|
-
//# sourceMappingURL=skillopt-optimization-method-
|
|
7949
|
+
//# sourceMappingURL=skillopt-optimization-method-CjKMZy0d.js.map
|