@tangle-network/agent-eval 0.146.0 → 0.148.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 +36 -0
- package/README.md +7 -0
- package/dist/analyst/index.d.ts +13 -13
- package/dist/analyst/index.js +6 -6
- package/dist/{backend-integrity-HVmWyOaX.d.ts → backend-integrity-Bz8nSrRE.d.ts} +2 -2
- package/dist/{backend-integrity-HVmWyOaX.d.ts.map → backend-integrity-Bz8nSrRE.d.ts.map} +1 -1
- package/dist/{benchmark-DTQ1RApl.d.ts → benchmark-Cn7ZMFNW.d.ts} +3 -3
- package/dist/{benchmark-DTQ1RApl.d.ts.map → benchmark-Cn7ZMFNW.d.ts.map} +1 -1
- package/dist/{benchmark-command-CxLJljS1.js → benchmark-command-Cz4fDmsk.js} +11 -11
- package/dist/{benchmark-command-CxLJljS1.js.map → benchmark-command-Cz4fDmsk.js.map} +1 -1
- package/dist/benchmarks/index.d.ts +4 -4
- package/dist/benchmarks/index.js +3 -3
- package/dist/campaign/index.d.ts +9 -9
- package/dist/campaign/index.js +6 -6
- package/dist/{campaign-CbQXcARJ.js → campaign-BcfXzmPM.js} +7 -7
- package/dist/{campaign-CbQXcARJ.js.map → campaign-BcfXzmPM.js.map} +1 -1
- package/dist/{capture-fetch-BZiO2cEH.d.ts → capture-fetch-BAx3Gntt.d.ts} +2 -2
- package/dist/{capture-fetch-BZiO2cEH.d.ts.map → capture-fetch-BAx3Gntt.d.ts.map} +1 -1
- package/dist/{chat-client-BJmwfnjN.js → chat-client-BX8Wh3fn.js} +3 -3
- package/dist/{chat-client-BJmwfnjN.js.map → chat-client-BX8Wh3fn.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{client-YDkU5QST.d.ts → client-BV7icIfy.d.ts} +2 -2
- package/dist/{client-YDkU5QST.d.ts.map → client-BV7icIfy.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +10 -10
- package/dist/contract/index.js +9 -9
- package/dist/{cost-ledger-BSe92yAV.js → cost-ledger-B1qx30B4.js} +2 -2
- package/dist/{cost-ledger-BSe92yAV.js.map → cost-ledger-B1qx30B4.js.map} +1 -1
- package/dist/{default-registry-DONui3mA.d.ts → default-registry-BUtRMRKk.d.ts} +6 -6
- package/dist/{default-registry-DONui3mA.d.ts.map → default-registry-BUtRMRKk.d.ts.map} +1 -1
- package/dist/{define-agent-eval-BGxmy4W6.js → define-agent-eval-CvZQW4u9.js} +3 -3
- package/dist/{define-agent-eval-BGxmy4W6.js.map → define-agent-eval-CvZQW4u9.js.map} +1 -1
- package/dist/{define-agent-eval-DrpgTVPp.d.ts → define-agent-eval-hXLUBKtb.d.ts} +5 -5
- package/dist/{define-agent-eval-DrpgTVPp.d.ts.map → define-agent-eval-hXLUBKtb.d.ts.map} +1 -1
- package/dist/{dspy-rlm-engine-B2nst4NR.js → dspy-rlm-engine-BmtOl_kP.js} +4 -4
- package/dist/{dspy-rlm-engine-B2nst4NR.js.map → dspy-rlm-engine-BmtOl_kP.js.map} +1 -1
- package/dist/{engine-Bc3seRPe.d.ts → engine-CIy18RTX.d.ts} +4 -4
- package/dist/{engine-Bc3seRPe.d.ts.map → engine-CIy18RTX.d.ts.map} +1 -1
- package/dist/{eval-campaign-DeGLwACc.js → eval-campaign-bmZ6NIIP.js} +2 -2
- package/dist/{eval-campaign-DeGLwACc.js.map → eval-campaign-bmZ6NIIP.js.map} +1 -1
- package/dist/{exact-types-CYFbvA5U.d.ts → exact-types-rdKFzEnK.d.ts} +2 -2
- package/dist/{exact-types-CYFbvA5U.d.ts.map → exact-types-rdKFzEnK.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +121 -5
- package/dist/experiment/index.d.ts.map +1 -1
- package/dist/experiment/index.js +219 -3
- package/dist/experiment/index.js.map +1 -1
- package/dist/{experiment-tracker-DWHZBAYL.d.ts → experiment-tracker-D9VHwRm-.d.ts} +6 -24
- package/dist/experiment-tracker-D9VHwRm-.d.ts.map +1 -0
- package/dist/{experiment-tracker-C29gXM4B.js → experiment-tracker-Ym6rEQT1.js} +15 -4
- package/dist/experiment-tracker-Ym6rEQT1.js.map +1 -0
- package/dist/{external-optimizer-contracts-CKEY98bK.d.ts → external-optimizer-contracts-CSjDLLmr.d.ts} +2 -2
- package/dist/{external-optimizer-contracts-CKEY98bK.d.ts.map → external-optimizer-contracts-CSjDLLmr.d.ts.map} +1 -1
- package/dist/{external-optimizer-process-DYNizz8W.js → external-optimizer-process-C4AyCcQd.js} +2 -2
- package/dist/{external-optimizer-process-DYNizz8W.js.map → external-optimizer-process-C4AyCcQd.js.map} +1 -1
- package/dist/{external-optimizer-subprocess-r6dP9DAj.js → external-optimizer-subprocess-DU1KM8yV.js} +3 -3
- package/dist/{external-optimizer-subprocess-r6dP9DAj.js.map → external-optimizer-subprocess-DU1KM8yV.js.map} +1 -1
- package/dist/{feedback-trajectory-Cg9EDxKB.d.ts → feedback-trajectory-niGeR6uJ.d.ts} +3 -3
- package/dist/{feedback-trajectory-Cg9EDxKB.d.ts.map → feedback-trajectory-niGeR6uJ.d.ts.map} +1 -1
- package/dist/fuzz.js +1 -1
- package/dist/hosted/index.d.ts +2 -2
- package/dist/index-CKblBxtr.d.ts +1 -0
- package/dist/{index-DGrcBMbC.d.ts → index-Dzn8Q3C2.d.ts} +18 -364
- package/dist/index-Dzn8Q3C2.d.ts.map +1 -0
- package/dist/{index-CevPFhDT.d.ts → index-gtjtfLEJ.d.ts} +7 -7
- package/dist/{index-CevPFhDT.d.ts.map → index-gtjtfLEJ.d.ts.map} +1 -1
- package/dist/index.d.ts +21 -51
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -125
- package/dist/index.js.map +1 -1
- package/dist/{integrity-DDoeWibF.d.ts → integrity-CGfpTE5-.d.ts} +2 -2
- package/dist/{integrity-DDoeWibF.d.ts.map → integrity-CGfpTE5-.d.ts.map} +1 -1
- package/dist/{kind-factory-CPmSd58s.js → kind-factory-DmAa0h3K.js} +7 -7
- package/dist/kind-factory-DmAa0h3K.js.map +1 -0
- package/dist/{llm-client-_UE4fU7Z.js → llm-client-BMuxYoZy.js} +2 -2
- package/dist/{llm-client-_UE4fU7Z.js.map → llm-client-BMuxYoZy.js.map} +1 -1
- package/dist/{llm-judge-B7ffRF8w.js → llm-judge-DWq1Ptco.js} +262 -8
- package/dist/llm-judge-DWq1Ptco.js.map +1 -0
- package/dist/{matrix-su7mIfbB.d.ts → matrix-Bc111FKv.d.ts} +18 -2
- package/dist/{matrix-su7mIfbB.d.ts.map → matrix-Bc111FKv.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +1 -1
- package/dist/{metrics-Cl0L1KUy.js → metrics-Qv-cpptD.js} +15 -8
- package/dist/metrics-Qv-cpptD.js.map +1 -0
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/multishot/index.js +17 -1
- package/dist/multishot/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{produced-state-D3k45S9a.js → produced-state-C0oJ4vr-.js} +4 -4
- package/dist/{produced-state-D3k45S9a.js.map → produced-state-C0oJ4vr-.js.map} +1 -1
- package/dist/{promotion-policy-BKi5OK5l.d.ts → promotion-policy-CewdjfCJ.d.ts} +2 -2
- package/dist/{promotion-policy-BKi5OK5l.d.ts.map → promotion-policy-CewdjfCJ.d.ts.map} +1 -1
- package/dist/{provenance-Bb7Zmyj2.d.ts → provenance-DA-Pmyfv.d.ts} +446 -7
- package/dist/provenance-DA-Pmyfv.d.ts.map +1 -0
- package/dist/{registry-CZgEmVXb.d.ts → registry-CaqJIDdN.d.ts} +4 -4
- package/dist/{registry-CZgEmVXb.d.ts.map → registry-CaqJIDdN.d.ts.map} +1 -1
- package/dist/reporting.d.ts +1 -1
- package/dist/reporting.js +1 -1
- package/dist/{researcher-CC305Ed-.d.ts → researcher-BySlpla_.d.ts} +3 -3
- package/dist/{researcher-CC305Ed-.d.ts.map → researcher-BySlpla_.d.ts.map} +1 -1
- package/dist/rl.d.ts +3 -3
- package/dist/rl.js +2 -2
- package/dist/{semantic-concept-judge-BsY2Q0Oq.js → semantic-concept-judge-BI7Rrl5-.js} +3 -3
- package/dist/{semantic-concept-judge-BsY2Q0Oq.js.map → semantic-concept-judge-BI7Rrl5-.js.map} +1 -1
- package/dist/{sequential-CYwq6Ff_.d.ts → sequential-BhsrMupG.d.ts} +31 -2
- package/dist/sequential-BhsrMupG.d.ts.map +1 -0
- package/dist/{sequential-Br0mAPHA.js → sequential-CzK5DarL.js} +48 -6
- package/dist/sequential-CzK5DarL.js.map +1 -0
- package/dist/series-convergence-CjO2QdRW.js.map +1 -1
- package/dist/{series-convergence-C9G-GNYK.d.ts → series-convergence-D2fsoJ2w.d.ts} +4 -7
- package/dist/{series-convergence-C9G-GNYK.d.ts.map → series-convergence-D2fsoJ2w.d.ts.map} +1 -1
- package/dist/{server-cQXve8i4.js → server-D9wQclzG.js} +3 -3
- package/dist/{server-cQXve8i4.js.map → server-D9wQclzG.js.map} +1 -1
- package/dist/{skillopt-optimization-method-C9MrMgW9.d.ts → skillopt-optimization-method-CrY0OG17.d.ts} +5 -5
- package/dist/{skillopt-optimization-method-C9MrMgW9.d.ts.map → skillopt-optimization-method-CrY0OG17.d.ts.map} +1 -1
- package/dist/{skillopt-optimization-method-Cv3K4DaS.js → skillopt-optimization-method-Donmq4sq.js} +4 -4
- package/dist/{skillopt-optimization-method-Cv3K4DaS.js.map → skillopt-optimization-method-Donmq4sq.js.map} +1 -1
- package/dist/{statistical-heldout-fvxtHnKQ.d.ts → statistical-heldout-uxSpFEjm.d.ts} +2 -2
- package/dist/{statistical-heldout-fvxtHnKQ.d.ts.map → statistical-heldout-uxSpFEjm.d.ts.map} +1 -1
- package/dist/{store-otlp-CsptLYpN.js → store-otlp-CDYWW_8N.js} +2 -2
- package/dist/{store-otlp-CsptLYpN.js.map → store-otlp-CDYWW_8N.js.map} +1 -1
- package/dist/{store-tool-spans-Cq9mFd-q.js → store-tool-spans-CykkbOlv.js} +3 -3
- package/dist/{store-tool-spans-Cq9mFd-q.js.map → store-tool-spans-CykkbOlv.js.map} +1 -1
- package/dist/{store-tool-spans-CV0hRsUp.d.ts → store-tool-spans-D5FhM0_A.d.ts} +4 -4
- package/dist/{store-tool-spans-CV0hRsUp.d.ts.map → store-tool-spans-D5FhM0_A.d.ts.map} +1 -1
- package/dist/{task-failure-attributes-CpQ4y5RD.js → task-failure-attributes--ZTP3tYO.js} +2 -2
- package/dist/{task-failure-attributes-CpQ4y5RD.js.map → task-failure-attributes--ZTP3tYO.js.map} +1 -1
- package/dist/{tool-groups-CDDXNKhd.d.ts → tool-groups-zpufabP8.d.ts} +3 -3
- package/dist/tool-groups-zpufabP8.d.ts.map +1 -0
- package/dist/trace-repair/index.d.ts +1 -1
- package/dist/traces.d.ts +7 -7
- package/dist/traces.js +4 -4
- package/dist/{types-oAsa-fs4.d.ts → types-BohHewKK.d.ts} +2 -2
- package/dist/{types-oAsa-fs4.d.ts.map → types-BohHewKK.d.ts.map} +1 -1
- package/dist/{types-DABZgDGV.d.ts → types-C1Bmeb8X.d.ts} +3 -3
- package/dist/{types-DABZgDGV.d.ts.map → types-C1Bmeb8X.d.ts.map} +1 -1
- package/dist/{types-CWcPguwd.d.ts → types-ColZlZtc.d.ts} +2 -2
- package/dist/{types-CWcPguwd.d.ts.map → types-ColZlZtc.d.ts.map} +1 -1
- package/dist/{types-XBRdmbj8.d.ts → types-DOhGq4S1.d.ts} +1 -7
- package/dist/{types-XBRdmbj8.d.ts.map → types-DOhGq4S1.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +2 -2
- package/dist/wire/index.js +1 -1
- package/docs/multishot-golden-records.md +12 -1
- package/docs/search-history-receipts.md +139 -0
- package/package.json +3 -3
- package/dist/experiment-tracker-C29gXM4B.js.map +0 -1
- package/dist/experiment-tracker-DWHZBAYL.d.ts.map +0 -1
- package/dist/index-BgHYx1QG.d.ts +0 -1
- package/dist/index-DGrcBMbC.d.ts.map +0 -1
- package/dist/kind-factory-CPmSd58s.js.map +0 -1
- package/dist/llm-judge-B7ffRF8w.js.map +0 -1
- package/dist/metrics-Cl0L1KUy.js.map +0 -1
- package/dist/provenance-Bb7Zmyj2.d.ts.map +0 -1
- package/dist/sequential-Br0mAPHA.js.map +0 -1
- package/dist/sequential-CYwq6Ff_.d.ts.map +0 -1
- package/dist/tool-groups-CDDXNKhd.d.ts.map +0 -1
|
@@ -3,14 +3,15 @@ import { o as weightedComposite, t as confidenceInterval } from "./descriptive-B
|
|
|
3
3
|
import { r as pairedBootstrap } from "./paired-tests-BHIhYVdu.js";
|
|
4
4
|
import { n as contentHash, t as canonicalJson } from "./verdict-cache-mZf5FEiY.js";
|
|
5
5
|
import { a as campaignCellCostProvenance, o as campaignCellExecutionEvidence, t as detectRewardHacking, u as projectCampaignCellQuality } from "./reward-hacking-DFo2FU5J.js";
|
|
6
|
-
import { i as CostLedger, t as CostAccountingIncompleteError } from "./cost-ledger-
|
|
6
|
+
import { i as CostLedger, t as CostAccountingIncompleteError } from "./cost-ledger-B1qx30B4.js";
|
|
7
7
|
import { u as mapConcurrent } from "./ledger-core-DTae9rv_.js";
|
|
8
|
-
import {
|
|
8
|
+
import { i as hashCanonical } from "./canonical-D-XsTQ6_.js";
|
|
9
|
+
import { b as createRunCostLedger, h as isRecord, m as isExternalTextCandidate, x as fsCampaignStorage } from "./external-optimizer-subprocess-DU1KM8yV.js";
|
|
9
10
|
import { t as DEFAULT_REDACTION_RULES } from "./redact-7Aq1ukl-.js";
|
|
10
11
|
import { a as heldoutSignificance, i as dimensionRegressions, o as pairHoldout } from "./power-preflight-DEw-uC7q.js";
|
|
11
12
|
import { a as combineAbortSignals, n as clamp01, r as assertProposalFindings } from "./run-score-lDzV0X8j.js";
|
|
12
13
|
import { c as deepFreezeCanonicalJson } from "./types-BI4fT3HN.js";
|
|
13
|
-
import { f as maximumChargeForLlmRequest, l as costReceiptFromLlm, m as stripFencedJson, u as costReceiptFromLlmError } from "./llm-client-
|
|
14
|
+
import { f as maximumChargeForLlmRequest, l as costReceiptFromLlm, m as stripFencedJson, u as costReceiptFromLlmError } from "./llm-client-BMuxYoZy.js";
|
|
14
15
|
import { createHash } from "node:crypto";
|
|
15
16
|
import { writeFileSync } from "node:fs";
|
|
16
17
|
import { z } from "zod";
|
|
@@ -2848,6 +2849,249 @@ function campaignBreakdown(campaign) {
|
|
|
2848
2849
|
};
|
|
2849
2850
|
}
|
|
2850
2851
|
//#endregion
|
|
2852
|
+
//#region src/campaign/search-history-receipt.ts
|
|
2853
|
+
const SEARCH_HISTORY_RECEIPT_SCHEMA_VERSION = "1.0.0";
|
|
2854
|
+
const SEARCH_HISTORY_RECEIPT_DIGEST_ALGORITHM = "rfc8785-sha256";
|
|
2855
|
+
var SearchHistoryRequiredError = class extends Error {
|
|
2856
|
+
producerId;
|
|
2857
|
+
reasons;
|
|
2858
|
+
constructor(producerId, reasons) {
|
|
2859
|
+
const normalized = reasons.length > 0 ? reasons : ["search history receipt is missing"];
|
|
2860
|
+
super(`search producer '${producerId}' lacks complete history: ${normalized.join("; ")}`);
|
|
2861
|
+
this.name = "SearchHistoryRequiredError";
|
|
2862
|
+
this.producerId = producerId;
|
|
2863
|
+
this.reasons = Object.freeze([...normalized]);
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
/** Build a bounded receipt from the projection returned by canonical ledger replay. */
|
|
2867
|
+
function createSearchHistoryReceipt(input) {
|
|
2868
|
+
if (!input || typeof input !== "object") throw new TypeError("search history input is required");
|
|
2869
|
+
const producerId = nonEmpty(input.producerId, "search history producerId");
|
|
2870
|
+
const runId = nonEmpty(input.runId, "search history runId");
|
|
2871
|
+
const ledger = normalizeArtifactRef(input.ledger);
|
|
2872
|
+
const replay = validateReplayProjection(input.replay);
|
|
2873
|
+
const auditDigest = ledgerHash(hashCanonical(replay.audit), "search history auditDigest");
|
|
2874
|
+
const summary = summarizeReplay(replay);
|
|
2875
|
+
const incompleteReasons = Object.freeze(historyIncompleteReasons(summary));
|
|
2876
|
+
const material = Object.freeze({
|
|
2877
|
+
schemaVersion: SEARCH_HISTORY_RECEIPT_SCHEMA_VERSION,
|
|
2878
|
+
kind: "search-history-receipt",
|
|
2879
|
+
digestAlgorithm: SEARCH_HISTORY_RECEIPT_DIGEST_ALGORITHM,
|
|
2880
|
+
producerId,
|
|
2881
|
+
runId,
|
|
2882
|
+
ledger,
|
|
2883
|
+
auditDigest,
|
|
2884
|
+
summary,
|
|
2885
|
+
complete: incompleteReasons.length === 0,
|
|
2886
|
+
incompleteReasons
|
|
2887
|
+
});
|
|
2888
|
+
return Object.freeze({
|
|
2889
|
+
...material,
|
|
2890
|
+
receiptDigest: hashCanonical(material)
|
|
2891
|
+
});
|
|
2892
|
+
}
|
|
2893
|
+
/** Verify the bounded receipt. Full ledger bytes are verified by SearchLedger. */
|
|
2894
|
+
function verifySearchHistoryReceipt(receipt) {
|
|
2895
|
+
if (!receipt || typeof receipt !== "object") throw new TypeError("search history receipt is required");
|
|
2896
|
+
if (receipt.schemaVersion !== "1.0.0") throw new Error(`unsupported search history schemaVersion '${receipt.schemaVersion}'`);
|
|
2897
|
+
if (receipt.kind !== "search-history-receipt") throw new Error(`search history kind must be 'search-history-receipt'`);
|
|
2898
|
+
if (receipt.digestAlgorithm !== "rfc8785-sha256") throw new Error(`unsupported search history digestAlgorithm '${receipt.digestAlgorithm}'`);
|
|
2899
|
+
const producerId = nonEmpty(receipt.producerId, "search history producerId");
|
|
2900
|
+
const runId = nonEmpty(receipt.runId, "search history runId");
|
|
2901
|
+
const ledger = normalizeArtifactRef(receipt.ledger);
|
|
2902
|
+
const auditDigest = ledgerHash(receipt.auditDigest, "search history auditDigest");
|
|
2903
|
+
const summary = normalizeSummary(receipt.summary);
|
|
2904
|
+
const incompleteReasons = normalizeReasons(receipt.incompleteReasons);
|
|
2905
|
+
const expectedReasons = historyIncompleteReasons(summary);
|
|
2906
|
+
if (!sameStrings(incompleteReasons, expectedReasons)) throw new Error("search history incompleteReasons disagree with its summary");
|
|
2907
|
+
if (receipt.complete !== (expectedReasons.length === 0)) throw new Error("search history complete disagrees with its summary");
|
|
2908
|
+
if (hashCanonical({
|
|
2909
|
+
schemaVersion: receipt.schemaVersion,
|
|
2910
|
+
kind: receipt.kind,
|
|
2911
|
+
digestAlgorithm: receipt.digestAlgorithm,
|
|
2912
|
+
producerId,
|
|
2913
|
+
runId,
|
|
2914
|
+
ledger,
|
|
2915
|
+
auditDigest,
|
|
2916
|
+
summary,
|
|
2917
|
+
complete: receipt.complete,
|
|
2918
|
+
incompleteReasons
|
|
2919
|
+
}) !== receipt.receiptDigest) throw new Error("search history receipt digest mismatch");
|
|
2920
|
+
return receipt;
|
|
2921
|
+
}
|
|
2922
|
+
/** Prove that a receipt still describes the exact canonical replay supplied. */
|
|
2923
|
+
function assertSearchHistoryMatchesReplay(receipt, replay) {
|
|
2924
|
+
verifySearchHistoryReceipt(receipt);
|
|
2925
|
+
if (createSearchHistoryReceipt({
|
|
2926
|
+
producerId: receipt.producerId,
|
|
2927
|
+
runId: receipt.runId,
|
|
2928
|
+
ledger: receipt.ledger,
|
|
2929
|
+
replay
|
|
2930
|
+
}).receiptDigest !== receipt.receiptDigest) throw new Error("search history receipt does not match the supplied SearchLedger replay");
|
|
2931
|
+
}
|
|
2932
|
+
/** Require a receipt owned by this producer and a terminal, denominator-complete history. */
|
|
2933
|
+
function assertCompleteSearchHistory(producerId, receipt) {
|
|
2934
|
+
if (receipt === void 0) throw new SearchHistoryRequiredError(producerId, []);
|
|
2935
|
+
verifySearchHistoryReceipt(receipt);
|
|
2936
|
+
if (receipt.producerId !== producerId) throw new SearchHistoryRequiredError(producerId, [`receipt belongs to producer '${receipt.producerId}'`]);
|
|
2937
|
+
if (!receipt.complete) throw new SearchHistoryRequiredError(producerId, receipt.incompleteReasons);
|
|
2938
|
+
}
|
|
2939
|
+
/** Classify one producer's history without treating malformed evidence as absence. */
|
|
2940
|
+
function searchHistoryCoverageRow(producerId, receipt) {
|
|
2941
|
+
if (receipt === void 0) return Object.freeze({
|
|
2942
|
+
producerId,
|
|
2943
|
+
status: "missing",
|
|
2944
|
+
reasons: Object.freeze(["search history receipt is missing"])
|
|
2945
|
+
});
|
|
2946
|
+
verifySearchHistoryReceipt(receipt);
|
|
2947
|
+
if (receipt.producerId !== producerId) throw new SearchHistoryRequiredError(producerId, [`receipt belongs to producer '${receipt.producerId}'`]);
|
|
2948
|
+
return Object.freeze({
|
|
2949
|
+
producerId,
|
|
2950
|
+
status: receipt.complete ? "complete" : "incomplete",
|
|
2951
|
+
reasons: Object.freeze([...receipt.incompleteReasons]),
|
|
2952
|
+
receipt
|
|
2953
|
+
});
|
|
2954
|
+
}
|
|
2955
|
+
function validateReplayProjection(replay) {
|
|
2956
|
+
if (!replay || typeof replay !== "object") throw new TypeError("search history replay is required");
|
|
2957
|
+
if (!Array.isArray(replay.entries)) throw new TypeError("search history replay.entries must be an array");
|
|
2958
|
+
if (!replay.audit || typeof replay.audit !== "object") throw new TypeError("search history replay.audit is required");
|
|
2959
|
+
if (replay.plan !== null && (!replay.plan || typeof replay.plan !== "object")) throw new TypeError("search history replay.plan must be an event or null");
|
|
2960
|
+
if (replay.completion !== null && (!replay.completion || typeof replay.completion !== "object")) throw new TypeError("search history replay.completion must be an event or null");
|
|
2961
|
+
if (replay.audit.eventCount !== replay.entries.length) throw new Error(`search history audit eventCount ${replay.audit.eventCount} does not match ${replay.entries.length} entries`);
|
|
2962
|
+
const observedHead = replay.entries.at(-1)?.entryHash ?? null;
|
|
2963
|
+
if (replay.audit.headHash !== observedHead) throw new Error("search history audit headHash does not match the final ledger entry");
|
|
2964
|
+
return replay;
|
|
2965
|
+
}
|
|
2966
|
+
function summarizeReplay(replay) {
|
|
2967
|
+
const audit = replay.audit;
|
|
2968
|
+
return normalizeSummary({
|
|
2969
|
+
campaignId: audit.campaignId,
|
|
2970
|
+
headHash: audit.headHash,
|
|
2971
|
+
status: audit.status,
|
|
2972
|
+
selectedCandidateId: audit.selectedCandidateId,
|
|
2973
|
+
eventCount: audit.eventCount,
|
|
2974
|
+
candidateCount: audit.candidateCount,
|
|
2975
|
+
closedCandidateSlotCount: audit.closedCandidateSlotCount,
|
|
2976
|
+
attemptCount: audit.attemptCount,
|
|
2977
|
+
operationCount: audit.operationCount,
|
|
2978
|
+
expectedCandidateSlots: audit.expected.candidateSlots,
|
|
2979
|
+
expectedTaskOutcomes: audit.expected.taskOutcomes,
|
|
2980
|
+
expectedOperations: audit.expected.operations,
|
|
2981
|
+
missingCandidateSlots: audit.expected.missingCandidateSlots.length,
|
|
2982
|
+
missingTaskOutcomes: audit.expected.missingTaskOutcomes.length,
|
|
2983
|
+
missingOperations: audit.expected.missingOperations.length,
|
|
2984
|
+
pendingDecisions: audit.decisions.pending,
|
|
2985
|
+
hasPlan: replay.plan !== null,
|
|
2986
|
+
hasCompletion: replay.completion !== null
|
|
2987
|
+
});
|
|
2988
|
+
}
|
|
2989
|
+
function normalizeSummary(value) {
|
|
2990
|
+
if (!value || typeof value !== "object") throw new TypeError("search history summary is required");
|
|
2991
|
+
const campaignId = nonEmpty(value.campaignId, "search history summary.campaignId");
|
|
2992
|
+
const headHash = nullableLedgerHash(value.headHash, "search history summary.headHash");
|
|
2993
|
+
const status = searchStatus(value.status);
|
|
2994
|
+
const selectedCandidateId = optionalNullableText(value.selectedCandidateId, "search history summary.selectedCandidateId");
|
|
2995
|
+
const eventCount = nonNegativeSafeInteger(value.eventCount, "search history summary.eventCount");
|
|
2996
|
+
const candidateCount = nonNegativeSafeInteger(value.candidateCount, "search history summary.candidateCount");
|
|
2997
|
+
const closedCandidateSlotCount = nonNegativeSafeInteger(value.closedCandidateSlotCount, "search history summary.closedCandidateSlotCount");
|
|
2998
|
+
const attemptCount = nonNegativeSafeInteger(value.attemptCount, "search history summary.attemptCount");
|
|
2999
|
+
const operationCount = nonNegativeSafeInteger(value.operationCount, "search history summary.operationCount");
|
|
3000
|
+
const expectedCandidateSlots = nonNegativeSafeInteger(value.expectedCandidateSlots, "search history summary.expectedCandidateSlots");
|
|
3001
|
+
const expectedTaskOutcomes = nonNegativeSafeInteger(value.expectedTaskOutcomes, "search history summary.expectedTaskOutcomes");
|
|
3002
|
+
const expectedOperations = nonNegativeSafeInteger(value.expectedOperations, "search history summary.expectedOperations");
|
|
3003
|
+
const missingCandidateSlots = nonNegativeSafeInteger(value.missingCandidateSlots, "search history summary.missingCandidateSlots");
|
|
3004
|
+
const missingTaskOutcomes = nonNegativeSafeInteger(value.missingTaskOutcomes, "search history summary.missingTaskOutcomes");
|
|
3005
|
+
const missingOperations = nonNegativeSafeInteger(value.missingOperations, "search history summary.missingOperations");
|
|
3006
|
+
const pendingDecisions = nonNegativeSafeInteger(value.pendingDecisions, "search history summary.pendingDecisions");
|
|
3007
|
+
const hasPlan = boolean(value.hasPlan, "search history summary.hasPlan");
|
|
3008
|
+
const hasCompletion = boolean(value.hasCompletion, "search history summary.hasCompletion");
|
|
3009
|
+
if (missingCandidateSlots > expectedCandidateSlots) throw new Error("search history missingCandidateSlots exceeds expectedCandidateSlots");
|
|
3010
|
+
if (missingTaskOutcomes > expectedTaskOutcomes) throw new Error("search history missingTaskOutcomes exceeds expectedTaskOutcomes");
|
|
3011
|
+
if (missingOperations > expectedOperations) throw new Error("search history missingOperations exceeds expectedOperations");
|
|
3012
|
+
if (pendingDecisions > candidateCount) throw new Error("search history pendingDecisions exceeds candidateCount");
|
|
3013
|
+
if (eventCount === 0 !== (headHash === null)) throw new Error("search history eventCount and headHash disagree");
|
|
3014
|
+
if (status === "in-progress" === hasCompletion) throw new Error("search history status and hasCompletion disagree");
|
|
3015
|
+
if (status === "selected" && selectedCandidateId === null) throw new Error("selected search history requires selectedCandidateId");
|
|
3016
|
+
if (status !== "selected" && selectedCandidateId !== null) throw new Error("non-selected search history cannot name selectedCandidateId");
|
|
3017
|
+
return Object.freeze({
|
|
3018
|
+
campaignId,
|
|
3019
|
+
headHash,
|
|
3020
|
+
status,
|
|
3021
|
+
selectedCandidateId,
|
|
3022
|
+
eventCount,
|
|
3023
|
+
candidateCount,
|
|
3024
|
+
closedCandidateSlotCount,
|
|
3025
|
+
attemptCount,
|
|
3026
|
+
operationCount,
|
|
3027
|
+
expectedCandidateSlots,
|
|
3028
|
+
expectedTaskOutcomes,
|
|
3029
|
+
expectedOperations,
|
|
3030
|
+
missingCandidateSlots,
|
|
3031
|
+
missingTaskOutcomes,
|
|
3032
|
+
missingOperations,
|
|
3033
|
+
pendingDecisions,
|
|
3034
|
+
hasPlan,
|
|
3035
|
+
hasCompletion
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
function historyIncompleteReasons(summary) {
|
|
3039
|
+
const reasons = [];
|
|
3040
|
+
if (!summary.hasPlan) reasons.push("search plan is missing");
|
|
3041
|
+
if (!summary.hasCompletion) reasons.push("terminal search-completed event is missing");
|
|
3042
|
+
if (summary.status === "in-progress") reasons.push("search status is in-progress");
|
|
3043
|
+
if (summary.missingCandidateSlots > 0) reasons.push(countReason(summary.missingCandidateSlots, "candidate slot", "candidate slots"));
|
|
3044
|
+
if (summary.missingTaskOutcomes > 0) reasons.push(countReason(summary.missingTaskOutcomes, "task outcome", "task outcomes"));
|
|
3045
|
+
if (summary.missingOperations > 0) reasons.push(countReason(summary.missingOperations, "operation", "operations"));
|
|
3046
|
+
if (summary.pendingDecisions > 0) reasons.push(countReason(summary.pendingDecisions, "candidate decision", "candidate decisions", "pending"));
|
|
3047
|
+
return reasons;
|
|
3048
|
+
}
|
|
3049
|
+
function countReason(count, singular, plural, adjective = "unresolved") {
|
|
3050
|
+
return `${count} ${count === 1 ? singular : plural} ${count === 1 ? "is" : "are"} ${adjective}`;
|
|
3051
|
+
}
|
|
3052
|
+
function normalizeArtifactRef(value) {
|
|
3053
|
+
if (!value || typeof value !== "object") throw new TypeError("search history ledger artifact is required");
|
|
3054
|
+
return Object.freeze({
|
|
3055
|
+
role: nonEmpty(value.role, "search history ledger role"),
|
|
3056
|
+
uri: nonEmpty(value.uri, "search history ledger uri"),
|
|
3057
|
+
sha256: ledgerHash(value.sha256, "search history ledger sha256"),
|
|
3058
|
+
byteLength: nonNegativeSafeInteger(value.byteLength, "search history ledger byteLength")
|
|
3059
|
+
});
|
|
3060
|
+
}
|
|
3061
|
+
function normalizeReasons(value) {
|
|
3062
|
+
if (!Array.isArray(value)) throw new TypeError("search history incompleteReasons must be an array");
|
|
3063
|
+
return Object.freeze(value.map((reason, index) => nonEmpty(reason, `search history incompleteReasons[${index}]`)));
|
|
3064
|
+
}
|
|
3065
|
+
function sameStrings(left, right) {
|
|
3066
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
3067
|
+
}
|
|
3068
|
+
function searchStatus(value) {
|
|
3069
|
+
if (value !== "in-progress" && value !== "selected" && value !== "all-rejected") throw new TypeError(`search history summary.status is invalid: ${String(value)}`);
|
|
3070
|
+
return value;
|
|
3071
|
+
}
|
|
3072
|
+
function nullableLedgerHash(value, label) {
|
|
3073
|
+
return value === null ? null : ledgerHash(value, label);
|
|
3074
|
+
}
|
|
3075
|
+
function optionalNullableText(value, label) {
|
|
3076
|
+
return value === null ? null : nonEmpty(value, label);
|
|
3077
|
+
}
|
|
3078
|
+
function ledgerHash(value, label) {
|
|
3079
|
+
if (typeof value !== "string" || !/^sha256:[a-f0-9]{64}$/.test(value)) throw new TypeError(`${label} must be a lowercase sha256 digest`);
|
|
3080
|
+
return value;
|
|
3081
|
+
}
|
|
3082
|
+
function nonEmpty(value, label) {
|
|
3083
|
+
if (typeof value !== "string" || value.length === 0 || value.trim() !== value) throw new TypeError(`${label} must be a trimmed non-empty string`);
|
|
3084
|
+
return value;
|
|
3085
|
+
}
|
|
3086
|
+
function nonNegativeSafeInteger(value, label) {
|
|
3087
|
+
if (!Number.isSafeInteger(value) || value < 0) throw new TypeError(`${label} must be a non-negative safe integer`);
|
|
3088
|
+
return value;
|
|
3089
|
+
}
|
|
3090
|
+
function boolean(value, label) {
|
|
3091
|
+
if (typeof value !== "boolean") throw new TypeError(`${label} must be a boolean`);
|
|
3092
|
+
return value;
|
|
3093
|
+
}
|
|
3094
|
+
//#endregion
|
|
2851
3095
|
//#region src/campaign/surface-identity.ts
|
|
2852
3096
|
const GIT_OBJECT_ID = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/;
|
|
2853
3097
|
const SHA256 = /^sha256:[a-f0-9]{64}$/;
|
|
@@ -2957,6 +3201,8 @@ function renderSurfaceDiff(winnerSurface, baselineSurface) {
|
|
|
2957
3201
|
async function compareOptimizationMethods(opts) {
|
|
2958
3202
|
assertOptimizationMethods(opts.methods);
|
|
2959
3203
|
assertComparisonPartitions(opts);
|
|
3204
|
+
const searchHistoryPolicy = opts.searchHistoryPolicy ?? "allow-missing";
|
|
3205
|
+
if (searchHistoryPolicy !== "allow-missing" && searchHistoryPolicy !== "require-complete") throw new TypeError(`compareOptimizationMethods: unknown searchHistoryPolicy '${String(searchHistoryPolicy)}'`);
|
|
2960
3206
|
const seed = opts.seed ?? 42;
|
|
2961
3207
|
const confidence = opts.confidence ?? .95;
|
|
2962
3208
|
assertConfidence(confidence);
|
|
@@ -3001,13 +3247,16 @@ async function compareOptimizationMethods(opts) {
|
|
|
3001
3247
|
try {
|
|
3002
3248
|
const out = await method.optimize(createOptimizationMethodInput(opts, method.name, resolvedRunDir, seed, baselineSurface, costLedger, optimizationOwner.signal));
|
|
3003
3249
|
assertOptimizationResult(method.name, out);
|
|
3250
|
+
const searchHistoryCoverage = searchHistoryCoverageRow(method.name, out.searchHistory);
|
|
3251
|
+
if (searchHistoryPolicy === "require-complete") assertCompleteSearchHistory(method.name, out.searchHistory);
|
|
3004
3252
|
const winnerSurface = structuredClone(out.winnerSurface);
|
|
3005
3253
|
return {
|
|
3006
3254
|
name: method.name,
|
|
3007
3255
|
winnerSurface,
|
|
3008
3256
|
cost: out.cost,
|
|
3009
|
-
durationMs: out.durationMs,
|
|
3010
|
-
provenance: out.provenance
|
|
3257
|
+
...out.durationMs === void 0 ? {} : { durationMs: out.durationMs },
|
|
3258
|
+
...out.provenance === void 0 ? {} : { provenance: out.provenance },
|
|
3259
|
+
searchHistoryCoverage
|
|
3011
3260
|
};
|
|
3012
3261
|
} catch (error) {
|
|
3013
3262
|
if (!optimizationOwner.signal.aborted) optimizationOwner.abort(error);
|
|
@@ -3125,7 +3374,12 @@ async function compareOptimizationMethods(opts) {
|
|
|
3125
3374
|
comparisonCount,
|
|
3126
3375
|
seed,
|
|
3127
3376
|
resamples,
|
|
3128
|
-
reps: opts.reps ?? 1
|
|
3377
|
+
reps: opts.reps ?? 1,
|
|
3378
|
+
searchHistory: Object.freeze({
|
|
3379
|
+
policy: searchHistoryPolicy,
|
|
3380
|
+
allComplete: optimized.every((result) => result.searchHistoryCoverage.status === "complete"),
|
|
3381
|
+
producers: Object.freeze(optimized.map((result) => result.searchHistoryCoverage))
|
|
3382
|
+
})
|
|
3129
3383
|
};
|
|
3130
3384
|
}
|
|
3131
3385
|
function assertReportedCostWithinCeiling(totalCostUsd, costCeiling, phase) {
|
|
@@ -4860,6 +5114,6 @@ function firstString(value) {
|
|
|
4860
5114
|
return typeof value === "string" && value.trim() ? value : void 0;
|
|
4861
5115
|
}
|
|
4862
5116
|
//#endregion
|
|
4863
|
-
export {
|
|
5117
|
+
export { runEval as $, surfaceHash as A, campaignMeanComposite as B, optimizationTokenUsageFromSummary as C, componentSurfaceIdentityMaterial as D, codeSurfaceIdentityMaterial as E, assertSearchHistoryMatchesReplay as F, assertGepaCandidatePopulationSummary as G, buildReflectionPrompt as H, createSearchHistoryReceipt as I, DEFAULT_RED_TEAM_CORPUS as J, readGepaCandidatePopulationArtifact as K, searchHistoryCoverageRow as L, SEARCH_HISTORY_RECEIPT_SCHEMA_VERSION as M, SearchHistoryRequiredError as N, renderSurfaceDiff as O, assertCompleteSearchHistory as P, runCanaries as Q, verifySearchHistoryReceipt as R, costFromLedgerSummary as S, assertComponentSurface as T, parseReflectionResponse as U, compareRankKeys as V, recoverTruncatedJson as W, redTeamReport as X, redTeamDataset as Y, scoreRedTeamOutput as Z, paretoFrontier as _, canonicalDigest as a, assertRealBackend as at, combineComparisonCosts as b, loopProvenanceSpans as c, assertCampaignSplitIdentity as ct, verifyLoopProvenanceRecord as d, campaignSplitDigestFromIdentities as dt, runCampaign as et, runImprovementLoop as f, readCachedCell as ft, dominates as g, labelTrustRank as h, campaignMeasurementDigest as i, BackendIntegrityError as it, SEARCH_HISTORY_RECEIPT_DIGEST_ALGORITHM as j, surfaceContentHash as k, provenanceRecordPath as l, campaignScenarioIdentity as lt, isProposedCandidate as m, computeManifestHash as mt, JudgeParseError as n, resolveRunDir as nt, emitLoopProvenance as o, summarizeBackendIntegrity as ot, runOptimization as p, cellCachePath as pt, defaultProductionGate as q, buildLoopProvenanceRecord as r, tangleTracesRoot as rt, loopProvenanceArgsFromResult as s, assertCampaignDesign as st, llmJudge as t, planCampaignRun as tt, provenanceSpansPath as u, campaignSplitDigest as ut, openAutoPr as v, assertCodeSurfaceIdentity as w, compareOptimizationMethods as x, assertOptimizationResult as y, campaignBreakdown as z };
|
|
4864
5118
|
|
|
4865
|
-
//# sourceMappingURL=llm-judge-
|
|
5119
|
+
//# sourceMappingURL=llm-judge-DWq1Ptco.js.map
|