@tangle-network/agent-eval 0.190.0 → 0.191.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 +46 -0
- package/dist/adapters/http.d.ts +2 -2
- package/dist/{agent-profile-DNV_U6QR.d.ts → agent-profile-DDfIjdyS.d.ts} +3 -3
- package/dist/{agent-profile-DNV_U6QR.d.ts.map → agent-profile-DDfIjdyS.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +11 -11
- package/dist/analyst/index.d.ts.map +1 -1
- package/dist/analyst/index.js +6 -6
- package/dist/{insight-report-CvPkEIcC.d.ts → analyze-runs-CPiKLJFs.d.ts} +73 -3
- package/dist/analyze-runs-CPiKLJFs.d.ts.map +1 -0
- package/dist/{attribute-vocabulary-DLJ6303h.d.ts → attribute-vocabulary-CcXqHODT.d.ts} +23 -12
- package/dist/attribute-vocabulary-CcXqHODT.d.ts.map +1 -0
- package/dist/{benchmark-command-TZlsuAh9.js → benchmark-command-3tZJnD82.js} +12 -11
- package/dist/benchmark-command-3tZJnD82.js.map +1 -0
- package/dist/benchmarks/index.d.ts +3 -3
- package/dist/benchmarks/index.js +3 -3
- package/dist/campaign/index.d.ts +6 -6
- package/dist/campaign/index.js +9 -7
- package/dist/{campaign-_29Qpc9Z.js → campaign-C8iWEF0M.js} +11 -9
- package/dist/{campaign-_29Qpc9Z.js.map → campaign-C8iWEF0M.js.map} +1 -1
- package/dist/{campaign-evidence-CWF8pEIk.js → campaign-evidence-BqjlTM3P.js} +11 -112
- package/dist/campaign-evidence-BqjlTM3P.js.map +1 -0
- package/dist/{chat-client-DbH06Ek6.js → chat-client-B_ItsSBw.js} +2 -2
- package/dist/{chat-client-DbH06Ek6.js.map → chat-client-B_ItsSBw.js.map} +1 -1
- package/dist/{chat-json-call-B0xTEY0I.js → chat-json-call-CXHBvUz8.js} +2 -2
- package/dist/{chat-json-call-B0xTEY0I.js.map → chat-json-call-CXHBvUz8.js.map} +1 -1
- package/dist/claim-V9Zqbq0J.js +54 -0
- package/dist/claim-V9Zqbq0J.js.map +1 -0
- package/dist/cli.js +101 -4
- package/dist/cli.js.map +1 -1
- package/dist/client-wFyDisxi.d.ts +236 -0
- package/dist/client-wFyDisxi.d.ts.map +1 -0
- package/dist/contract/index.d.ts +10 -11
- package/dist/contract/index.js +11 -141
- package/dist/contract/index.js.map +1 -1
- package/dist/{default-registry-B5HrwrPM.d.ts → default-registry-DK_9aVJf.d.ts} +6 -6
- package/dist/{default-registry-B5HrwrPM.d.ts.map → default-registry-DK_9aVJf.d.ts.map} +1 -1
- package/dist/{default-registry-16I-Bxlf.js → default-registry-xMLX160E.js} +3 -3
- package/dist/{default-registry-16I-Bxlf.js.map → default-registry-xMLX160E.js.map} +1 -1
- package/dist/{define-agent-eval-DrGfrCTZ.js → define-agent-eval-BE43YTm4.js} +27 -109
- package/dist/define-agent-eval-BE43YTm4.js.map +1 -0
- package/dist/{define-agent-eval-BWeyIpny.d.ts → define-agent-eval-P28y7mI1.d.ts} +16 -20
- package/dist/define-agent-eval-P28y7mI1.d.ts.map +1 -0
- package/dist/diagnosis/index.d.ts +16 -4
- package/dist/diagnosis/index.d.ts.map +1 -1
- package/dist/diagnosis/index.js +10 -3
- package/dist/diagnosis/index.js.map +1 -1
- package/dist/{dspy-rlm-engine-CTIGomgr.js → dspy-rlm-engine-MfpwoEaj.js} +3 -3
- package/dist/{dspy-rlm-engine-CTIGomgr.js.map → dspy-rlm-engine-MfpwoEaj.js.map} +1 -1
- package/dist/{engine-BkLCnZQX.d.ts → engine-vNiM02Ub.d.ts} +4 -4
- package/dist/{engine-BkLCnZQX.d.ts.map → engine-vNiM02Ub.d.ts.map} +1 -1
- package/dist/{eval-campaign-CMKRjWl0.js → eval-campaign-CwsBn0Gm.js} +2 -2
- package/dist/{eval-campaign-CMKRjWl0.js.map → eval-campaign-CwsBn0Gm.js.map} +1 -1
- package/dist/evaluation.d.ts +2 -2
- package/dist/{exact-types-CfpP2A4Z.d.ts → exact-types-KGxBWH4b.d.ts} +2 -2
- package/dist/{exact-types-CfpP2A4Z.d.ts.map → exact-types-KGxBWH4b.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +1 -1
- package/dist/experiment/index.js +2 -1
- package/dist/experiment/index.js.map +1 -1
- package/dist/{external-optimizer-process-Mc83UoWl.js → external-optimizer-process-xFTliuiK.js} +3 -3
- package/dist/{external-optimizer-process-Mc83UoWl.js.map → external-optimizer-process-xFTliuiK.js.map} +1 -1
- package/dist/{external-optimizer-subprocess-C0dHXH8e.js → external-optimizer-subprocess-B234V9V0.js} +5 -28
- package/dist/external-optimizer-subprocess-B234V9V0.js.map +1 -0
- package/dist/{extract-usage-BrQ8mCLX.js → extract-usage-DFATEuWW.js} +2 -2
- package/dist/{extract-usage-BrQ8mCLX.js.map → extract-usage-DFATEuWW.js.map} +1 -1
- package/dist/{feedback-trajectory-BYjh7NEM.d.ts → feedback-trajectory-BXCGTRkz.d.ts} +3 -3
- package/dist/{feedback-trajectory-BYjh7NEM.d.ts.map → feedback-trajectory-BXCGTRkz.d.ts.map} +1 -1
- package/dist/hosted/index.d.ts +66 -6
- package/dist/hosted/index.d.ts.map +1 -1
- package/dist/hosted/index.js +2 -2
- package/dist/{index-Ci0-EYzc.d.ts → index-CzfnASj_.d.ts} +18 -11
- package/dist/index-CzfnASj_.d.ts.map +1 -0
- package/dist/{index-2e_MTznj.d.ts → index-D-TN7ZRM.d.ts} +6 -6
- package/dist/{index-2e_MTznj.d.ts.map → index-D-TN7ZRM.d.ts.map} +1 -1
- package/dist/{index-BR_R1eBE.d.ts → index-DH-MWH5f.d.ts} +10 -104
- package/dist/index-DH-MWH5f.d.ts.map +1 -0
- package/dist/{index-BqDJ6fUK.d.ts → index-I4UJGRno.d.ts} +74 -2
- package/dist/index-I4UJGRno.d.ts.map +1 -0
- package/dist/index.d.ts +17 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -17
- package/dist/jev.d.ts +2 -2
- package/dist/{journal-CDP0Vhx_.js → journal-c3qY0SDP.js} +246 -5
- package/dist/journal-c3qY0SDP.js.map +1 -0
- package/dist/{kind-factory-ByZeXDqF.js → kind-factory-CdPPHtGZ.js} +10 -26
- package/dist/kind-factory-CdPPHtGZ.js.map +1 -0
- package/dist/ledger-core/index.d.ts +2 -2
- package/dist/ledger-core/index.js +2 -2
- package/dist/{llm-client-BqmRnibA.js → llm-client-KYQBh9C8.js} +2 -2
- package/dist/{llm-client-BqmRnibA.js.map → llm-client-KYQBh9C8.js.map} +1 -1
- package/dist/{llm-judge-bwbgDMP0.js → llm-judge-NJOHM0iA.js} +11 -1428
- package/dist/llm-judge-NJOHM0iA.js.map +1 -0
- package/dist/{matrix-CNypzP-v.d.ts → matrix-CgqdFm5N.d.ts} +2 -2
- package/dist/{matrix-CNypzP-v.d.ts.map → matrix-CgqdFm5N.d.ts.map} +1 -1
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{otel-spans-CQY1pNiN.js → otel-spans-DS7t1t1J.js} +8 -19
- package/dist/otel-spans-DS7t1t1J.js.map +1 -0
- package/dist/otlp-attributes-D9ptWaIJ.js +53 -0
- package/dist/otlp-attributes-D9ptWaIJ.js.map +1 -0
- package/dist/pipelines/index.d.ts +1 -1
- package/dist/pipelines/index.js +1 -1
- package/dist/pipelines/index.js.map +1 -1
- package/dist/{prime-protocol-Fwvctmhm.d.ts → prime-protocol-T0i6xcAs.d.ts} +2 -2
- package/dist/{prime-protocol-Fwvctmhm.d.ts.map → prime-protocol-T0i6xcAs.d.ts.map} +1 -1
- package/dist/{produced-state-zSaGDC_Q.js → produced-state-CY-L7CqS.js} +4 -4
- package/dist/{produced-state-zSaGDC_Q.js.map → produced-state-CY-L7CqS.js.map} +1 -1
- package/dist/{raw-provider-sink-DIRCZjP_.js → raw-provider-sink-DYh4Bszw.js} +2 -2
- package/dist/{raw-provider-sink-DIRCZjP_.js.map → raw-provider-sink-DYh4Bszw.js.map} +1 -1
- package/dist/{redact-8fX8-uKr.js → redact-B7rt9Zot.js} +117 -6
- package/dist/redact-B7rt9Zot.js.map +1 -0
- package/dist/{redact-Du3WKUOP.d.ts → redact-CopuMxll.d.ts} +2 -2
- package/dist/{redact-Du3WKUOP.d.ts.map → redact-CopuMxll.d.ts.map} +1 -1
- package/dist/{registry-mAQVtuLx.d.ts → registry-Bu3lNole.d.ts} +3 -3
- package/dist/{registry-mAQVtuLx.d.ts.map → registry-Bu3lNole.d.ts.map} +1 -1
- package/dist/rl.d.ts +1 -1
- package/dist/rl.js +2 -2
- package/dist/{run-record-DnMFyg_g.js → run-record-tNnlQIrD.js} +2 -10
- package/dist/{run-record-DnMFyg_g.js.map → run-record-tNnlQIrD.js.map} +1 -1
- package/dist/search-ledger-CQ8Uy4FK.js +1451 -0
- package/dist/search-ledger-CQ8Uy4FK.js.map +1 -0
- package/dist/search-ledger-file-EvdDZRhv.js +27 -0
- package/dist/search-ledger-file-EvdDZRhv.js.map +1 -0
- package/dist/search-shipper-C55V7HE3.js +781 -0
- package/dist/search-shipper-C55V7HE3.js.map +1 -0
- package/dist/{semantic-concept-judge-BY0me-Jq.js → semantic-concept-judge-Bt7bXAAo.js} +6 -6
- package/dist/{semantic-concept-judge-BY0me-Jq.js.map → semantic-concept-judge-Bt7bXAAo.js.map} +1 -1
- package/dist/{server-DnJCDLf8.js → server-DtetGGoA.js} +2 -2
- package/dist/{server-DnJCDLf8.js.map → server-DtetGGoA.js.map} +1 -1
- package/dist/{skillopt-optimization-method-CfnQEjgT.js → skillopt-optimization-method-DwO3TOAV.js} +7 -6
- package/dist/{skillopt-optimization-method-CfnQEjgT.js.map → skillopt-optimization-method-DwO3TOAV.js.map} +1 -1
- package/dist/{spans-D1RftP_w.d.ts → spans-BWtjk_9c.d.ts} +2 -2
- package/dist/{spans-D1RftP_w.d.ts.map → spans-BWtjk_9c.d.ts.map} +1 -1
- package/dist/{statistical-heldout-CLpjYffJ.d.ts → statistical-heldout-BED3wBtX.d.ts} +2 -2
- package/dist/{statistical-heldout-CLpjYffJ.d.ts.map → statistical-heldout-BED3wBtX.d.ts.map} +1 -1
- package/dist/{store-otlp-84DH0OEH.js → store-otlp-BPowgPm6.js} +2 -2
- package/dist/{store-otlp-84DH0OEH.js.map → store-otlp-BPowgPm6.js.map} +1 -1
- package/dist/{store-tool-spans-DSbYpl7f.js → store-tool-spans-BcC_5ef-.js} +6 -6
- package/dist/{store-tool-spans-DSbYpl7f.js.map → store-tool-spans-BcC_5ef-.js.map} +1 -1
- package/dist/{store-tool-spans-BBXs8hDP.d.ts → store-tool-spans-Cfh9XUCm.d.ts} +5 -9
- package/dist/store-tool-spans-Cfh9XUCm.d.ts.map +1 -0
- package/dist/{task-failure-attributes-B34TiMBe.js → task-failure-attributes-CEqEfuIY.js} +17 -9
- package/dist/task-failure-attributes-CEqEfuIY.js.map +1 -0
- package/dist/{tool-groups-W7MJobX_.d.ts → tool-groups-D-mkeN0N.d.ts} +3 -3
- package/dist/tool-groups-D-mkeN0N.d.ts.map +1 -0
- package/dist/trace-attributes.d.ts +1 -1
- package/dist/trace-attributes.js +23 -75
- package/dist/trace-attributes.js.map +1 -1
- package/dist/trace-repair/index.d.ts +1 -1
- package/dist/traces.d.ts +12 -19
- package/dist/traces.d.ts.map +1 -1
- package/dist/traces.js +18 -18
- package/dist/traces.js.map +1 -1
- package/dist/{types-BvmWNjjs.d.ts → types-BmQRs661.d.ts} +2 -2
- package/dist/{types-BvmWNjjs.d.ts.map → types-BmQRs661.d.ts.map} +1 -1
- package/dist/{types-Bay1dh2o.d.ts → types-CeDfCRXp.d.ts} +11 -16
- package/dist/types-CeDfCRXp.d.ts.map +1 -0
- package/dist/{types-Cvqy7asY.d.ts → types-ClK-sHs8.d.ts} +2 -2
- package/dist/{types-Cvqy7asY.d.ts.map → types-ClK-sHs8.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +1 -1
- package/dist/wire/index.js +1 -1
- package/docs/hosted-ingest-spec.md +92 -133
- package/docs/public-api.md +58 -43
- package/docs/search-ledger.md +17 -0
- package/package.json +2 -2
- package/dist/analyze-runs-BvK4-wSs.d.ts +0 -75
- package/dist/analyze-runs-BvK4-wSs.d.ts.map +0 -1
- package/dist/attribute-vocabulary-DLJ6303h.d.ts.map +0 -1
- package/dist/benchmark-command-TZlsuAh9.js.map +0 -1
- package/dist/campaign-evidence-CWF8pEIk.js.map +0 -1
- package/dist/client-BhEyAdfe.d.ts +0 -202
- package/dist/client-BhEyAdfe.d.ts.map +0 -1
- package/dist/client-QwJpsNYU.js +0 -655
- package/dist/client-QwJpsNYU.js.map +0 -1
- package/dist/define-agent-eval-BWeyIpny.d.ts.map +0 -1
- package/dist/define-agent-eval-DrGfrCTZ.js.map +0 -1
- package/dist/external-optimizer-subprocess-C0dHXH8e.js.map +0 -1
- package/dist/index-BR_R1eBE.d.ts.map +0 -1
- package/dist/index-BqDJ6fUK.d.ts.map +0 -1
- package/dist/index-Ci0-EYzc.d.ts.map +0 -1
- package/dist/insight-report-CvPkEIcC.d.ts.map +0 -1
- package/dist/journal-CDP0Vhx_.js.map +0 -1
- package/dist/kind-factory-ByZeXDqF.js.map +0 -1
- package/dist/llm-judge-bwbgDMP0.js.map +0 -1
- package/dist/otel-spans-CQY1pNiN.js.map +0 -1
- package/dist/otlp-attributes-BpC_blLF.js +0 -83
- package/dist/otlp-attributes-BpC_blLF.js.map +0 -1
- package/dist/redact-8fX8-uKr.js.map +0 -1
- package/dist/store-tool-spans-BBXs8hDP.d.ts.map +0 -1
- package/dist/task-failure-attributes-B34TiMBe.js.map +0 -1
- package/dist/tool-groups-W7MJobX_.d.ts.map +0 -1
- package/dist/types-Bay1dh2o.d.ts.map +0 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { D as SearchLedgerHash, E as SearchLedgerEvent, T as SearchLedgerEntry, i as SearchArtifactRef } from "./search-ledger-types-C9anU2DX.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/hosted/search-ledger-wire.d.ts
|
|
4
|
+
/** At most this many lines in one ingest request. */
|
|
5
|
+
declare const SEARCH_LEDGER_BATCH_MAX_LINES = 1000;
|
|
6
|
+
/** At most this many UTF-8 bytes across one request's lines. A single line
|
|
7
|
+
* larger than this cannot be shipped. */
|
|
8
|
+
declare const SEARCH_LEDGER_BATCH_MAX_BYTES = 1048576;
|
|
9
|
+
declare const SEARCH_LEDGER_INGEST_PATH = "/v1/ingest/search-ledger";
|
|
10
|
+
declare function searchLedgerHeadPath(searchId: string): string;
|
|
11
|
+
/** Blobs are addressed by the hex digest alone. */
|
|
12
|
+
declare function searchBlobPath(sha256: SearchLedgerHash): string;
|
|
13
|
+
/** What the run is for: an optimization, or an eval (a one-node search). */
|
|
14
|
+
declare const SearchRunKindSchema: z.ZodEnum<{
|
|
15
|
+
eval: "eval";
|
|
16
|
+
optimization: "optimization";
|
|
17
|
+
}>;
|
|
18
|
+
type SearchRunKind = z.infer<typeof SearchRunKindSchema>;
|
|
19
|
+
/** Where a store's copy of one search's chain ends. `headHash` is null exactly
|
|
20
|
+
* when the store holds no entry. */
|
|
21
|
+
declare const SearchLedgerHeadSchema: z.ZodObject<{
|
|
22
|
+
searchId: z.ZodString;
|
|
23
|
+
nextSequence: z.ZodNumber;
|
|
24
|
+
headHash: z.ZodNullable<z.ZodCustom<`sha256:${string}`, `sha256:${string}`>>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
type SearchLedgerHead = z.infer<typeof SearchLedgerHeadSchema>;
|
|
27
|
+
declare const IngestSearchLedgerRequestSchema: z.ZodObject<{
|
|
28
|
+
wireVersion: z.ZodLiteral<"2026-07-24.v1">;
|
|
29
|
+
searchId: z.ZodString;
|
|
30
|
+
runKind: z.ZodEnum<{
|
|
31
|
+
eval: "eval";
|
|
32
|
+
optimization: "optimization";
|
|
33
|
+
}>;
|
|
34
|
+
fromSequence: z.ZodNumber;
|
|
35
|
+
lines: z.ZodArray<z.ZodString>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
type IngestSearchLedgerRequest = z.infer<typeof IngestSearchLedgerRequestSchema>;
|
|
38
|
+
/** The body of a `409`: a fork or a gap, with the store's head. */
|
|
39
|
+
declare const SearchLedgerConflictSchema: z.ZodObject<{
|
|
40
|
+
error: z.ZodEnum<{
|
|
41
|
+
chain_conflict: "chain_conflict";
|
|
42
|
+
sequence_gap: "sequence_gap";
|
|
43
|
+
}>;
|
|
44
|
+
message: z.ZodString;
|
|
45
|
+
head: z.ZodObject<{
|
|
46
|
+
searchId: z.ZodString;
|
|
47
|
+
nextSequence: z.ZodNumber;
|
|
48
|
+
headHash: z.ZodNullable<z.ZodCustom<`sha256:${string}`, `sha256:${string}`>>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
type SearchLedgerConflict = z.infer<typeof SearchLedgerConflictSchema>;
|
|
52
|
+
/** What a store kept of one blob. `masked` and `withheld` come from the
|
|
53
|
+
* store's own redaction scan or the tenant's content posture. */
|
|
54
|
+
declare const SearchBlobPutResponseSchema: z.ZodObject<{
|
|
55
|
+
sha256: z.ZodCustom<`sha256:${string}`, `sha256:${string}`>;
|
|
56
|
+
byteLength: z.ZodNumber;
|
|
57
|
+
state: z.ZodEnum<{
|
|
58
|
+
masked: "masked";
|
|
59
|
+
stored: "stored";
|
|
60
|
+
withheld: "withheld";
|
|
61
|
+
}>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
type SearchBlobPutResponse = z.infer<typeof SearchBlobPutResponseSchema>;
|
|
64
|
+
/** Every blob an event names, once each. Ship these before the event. */
|
|
65
|
+
declare function searchLedgerArtifactRefs(event: SearchLedgerEvent): SearchArtifactRef[];
|
|
66
|
+
type SearchLedgerBatchAdmission = {
|
|
67
|
+
status: 'accepted';
|
|
68
|
+
/** Entries past the stored head, in order, with their exact lines. */
|
|
69
|
+
entries: SearchLedgerEntry[];
|
|
70
|
+
lines: string[];
|
|
71
|
+
/** The head after storing `entries`. */
|
|
72
|
+
head: SearchLedgerHead;
|
|
73
|
+
} | {
|
|
74
|
+
status: 'conflict';
|
|
75
|
+
conflict: SearchLedgerConflict;
|
|
76
|
+
};
|
|
77
|
+
interface AdmitSearchLedgerBatchInput {
|
|
78
|
+
request: IngestSearchLedgerRequest;
|
|
79
|
+
/** The store's head for `request.searchId` before this batch. */
|
|
80
|
+
head: SearchLedgerHead;
|
|
81
|
+
/** The stored hash at a sequence below the head. */
|
|
82
|
+
storedEntryHash(sequence: number): SearchLedgerHash | undefined;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Apply the wire's chain rule to one batch. Each line is verified in isolation
|
|
86
|
+
* (`parseSearchLedgerLine`) and linked to the stored head. A malformed line
|
|
87
|
+
* throws `SearchLedgerIntegrityError`, which a store answers with 422; the
|
|
88
|
+
* state machine (`SearchState`) runs after admission, on `entries`.
|
|
89
|
+
*/
|
|
90
|
+
declare function admitSearchLedgerBatch(input: AdmitSearchLedgerBatchInput): SearchLedgerBatchAdmission;
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/hosted/types.d.ts
|
|
93
|
+
/**
|
|
94
|
+
* # Hosted-tier wire format: the shapes every orchestrator (ours, a partner's
|
|
95
|
+
* self-hosted one, a future open implementation) must accept.
|
|
96
|
+
*
|
|
97
|
+
* This package implements exactly one wire version. Servers reject every
|
|
98
|
+
* other version instead of translating old payloads.
|
|
99
|
+
*
|
|
100
|
+
* The wire carries two streams in one transport:
|
|
101
|
+
*
|
|
102
|
+
* 1. **Search ledgers** (`/v1/search-blobs/*`, `/v1/ingest/search-ledger`).
|
|
103
|
+
* A producer ships a search's hash-chained ledger lines and the blobs
|
|
104
|
+
* they name; `./search-ledger-wire.ts` owns those shapes.
|
|
105
|
+
*
|
|
106
|
+
* 2. **Trace spans** (`POST /v1/ingest/traces`). Standard OTLP-shaped
|
|
107
|
+
* spans with a few additional attributes so the orchestrator can
|
|
108
|
+
* pivot from a search cell to its underlying execution. Compatible
|
|
109
|
+
* with any OTel collector.
|
|
110
|
+
*
|
|
111
|
+
* Every endpoint is authenticated with a bearer token and a tenant id
|
|
112
|
+
* header. Tenants isolate everything downstream of ingest; no tenant
|
|
113
|
+
* ever sees another tenant's data.
|
|
114
|
+
*/
|
|
115
|
+
declare const HOSTED_WIRE_VERSION: '2026-07-24.v1';
|
|
116
|
+
type HostedWireVersion = typeof HOSTED_WIRE_VERSION;
|
|
117
|
+
/** Every ingest request carries these. */
|
|
118
|
+
interface HostedIngestHeaders {
|
|
119
|
+
/** Bearer token. The orchestrator validates against the tenant key. */
|
|
120
|
+
authorization: `Bearer ${string}`;
|
|
121
|
+
/** Stable tenant id (the orchestrator-side primary key for the tenant). */
|
|
122
|
+
'x-tangle-tenant-id': string;
|
|
123
|
+
/** Wire-version pin so the server can reject incompatible payloads. */
|
|
124
|
+
'x-tangle-wire-version': HostedWireVersion;
|
|
125
|
+
/** Stable request key generated once and reused across retries. */
|
|
126
|
+
'idempotency-key': string;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Canonical unsigned 64-bit integer encoded as a base-10 string.
|
|
130
|
+
* JSON numbers cannot represent OTLP nanosecond timestamps exactly.
|
|
131
|
+
*/
|
|
132
|
+
type UnixNanoTimestamp = string;
|
|
133
|
+
/**
|
|
134
|
+
* OTel-shape span with a few additional attributes for pivoting.
|
|
135
|
+
* Compatible with any OTLP collector — `name`, `traceId`, `spanId`,
|
|
136
|
+
* `startTimeUnixNano`, `endTimeUnixNano`, `attributes` are stock OTel.
|
|
137
|
+
*/
|
|
138
|
+
interface TraceSpanEvent {
|
|
139
|
+
traceId: string;
|
|
140
|
+
spanId: string;
|
|
141
|
+
parentSpanId?: string;
|
|
142
|
+
name: string;
|
|
143
|
+
startTimeUnixNano: UnixNanoTimestamp;
|
|
144
|
+
endTimeUnixNano: UnixNanoTimestamp;
|
|
145
|
+
attributes: Record<string, string | number | boolean>;
|
|
146
|
+
events?: Array<{
|
|
147
|
+
timeUnixNano: UnixNanoTimestamp;
|
|
148
|
+
name: string;
|
|
149
|
+
attributes?: Record<string, string | number | boolean>;
|
|
150
|
+
}>;
|
|
151
|
+
status?: {
|
|
152
|
+
code: 'OK' | 'ERROR' | 'UNSET';
|
|
153
|
+
message?: string;
|
|
154
|
+
};
|
|
155
|
+
/** Pivot to the producing run. */
|
|
156
|
+
'tangle.runId'?: string;
|
|
157
|
+
/** Pivot to the specific generation. */
|
|
158
|
+
'tangle.generation'?: number;
|
|
159
|
+
/** Pivot to the specific cell. */
|
|
160
|
+
'tangle.cellId'?: string;
|
|
161
|
+
/** Pivot to the specific scenario. */
|
|
162
|
+
'tangle.scenarioId'?: string;
|
|
163
|
+
}
|
|
164
|
+
interface IngestTracesRequest {
|
|
165
|
+
wireVersion: HostedWireVersion;
|
|
166
|
+
spans: TraceSpanEvent[];
|
|
167
|
+
}
|
|
168
|
+
interface IngestResponse {
|
|
169
|
+
/** Accepted spans count. */
|
|
170
|
+
accepted: number;
|
|
171
|
+
/** Rejected spans with reasons (validation failures, conflicting identity). */
|
|
172
|
+
rejected: Array<{
|
|
173
|
+
index: number;
|
|
174
|
+
reason: string;
|
|
175
|
+
}>;
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/hosted/client.d.ts
|
|
179
|
+
interface HostedTenant {
|
|
180
|
+
/** Orchestrator endpoint base URL (no trailing slash). Required. */
|
|
181
|
+
endpoint: string;
|
|
182
|
+
/** Bearer token issued by the orchestrator. Required. */
|
|
183
|
+
apiKey: string;
|
|
184
|
+
/** Tenant id — the orchestrator's primary key for this consumer. Required. */
|
|
185
|
+
tenantId: string;
|
|
186
|
+
/** Optional `fetch` override (auth wrappers, custom agent). */
|
|
187
|
+
fetchImpl?: typeof fetch;
|
|
188
|
+
/** Per-attempt timeout in ms. Default 30s. */
|
|
189
|
+
timeoutMs?: number;
|
|
190
|
+
/** Retries on network errors, 408, 429 and 5xx. Default 2. */
|
|
191
|
+
retries?: number;
|
|
192
|
+
}
|
|
193
|
+
/** A search-ledger batch the store accepted, or the fork or gap it refused. */
|
|
194
|
+
type SearchLedgerIngestOutcome = {
|
|
195
|
+
status: 'accepted';
|
|
196
|
+
head: SearchLedgerHead;
|
|
197
|
+
} | {
|
|
198
|
+
status: 'conflict';
|
|
199
|
+
conflict: SearchLedgerConflict;
|
|
200
|
+
};
|
|
201
|
+
interface HostedClient {
|
|
202
|
+
ingestTraces(spans: TraceSpanEvent[], idempotencyKey?: string): Promise<IngestResponse>;
|
|
203
|
+
/** The store's head for one search; `nextSequence` 0 when it holds nothing. */
|
|
204
|
+
searchLedgerHead(searchId: string, signal?: AbortSignal): Promise<SearchLedgerHead>;
|
|
205
|
+
ingestSearchLedger(request: IngestSearchLedgerRequest, signal?: AbortSignal): Promise<SearchLedgerIngestOutcome>;
|
|
206
|
+
putSearchBlob(sha256: `sha256:${string}`, bytes: Uint8Array<ArrayBuffer>, contentType: string, signal?: AbortSignal): Promise<SearchBlobPutResponse>;
|
|
207
|
+
readonly tenant: HostedTenant;
|
|
208
|
+
readonly wireVersion: HostedWireVersion;
|
|
209
|
+
}
|
|
210
|
+
/** A request the server refused, after any retries. */
|
|
211
|
+
declare class HostedRequestError extends Error {
|
|
212
|
+
readonly status: number;
|
|
213
|
+
readonly body: string;
|
|
214
|
+
constructor(url: string, status: number, body: string);
|
|
215
|
+
}
|
|
216
|
+
declare function createHostedClient(tenant: HostedTenant): HostedClient;
|
|
217
|
+
/**
|
|
218
|
+
* Build a {@link HostedTenant} from env, or `undefined` when ingest is not
|
|
219
|
+
* configured, so a product wires it unconditionally and it stays off until the
|
|
220
|
+
* env is set. Env precedence:
|
|
221
|
+
* - endpoint: `TANGLE_INGEST_URL` → `TANGLE_ORCHESTRATOR_URL`
|
|
222
|
+
* - apiKey: `TANGLE_INGEST_API_KEY` → `TANGLE_API_KEY`
|
|
223
|
+
* - tenantId: `TANGLE_TENANT_ID`
|
|
224
|
+
* A trailing slash on the endpoint is stripped. `overrides` win over env.
|
|
225
|
+
*/
|
|
226
|
+
declare function hostedTenantFromEnv(overrides?: Partial<HostedTenant> & {
|
|
227
|
+
env?: Record<string, string | undefined>;
|
|
228
|
+
}): HostedTenant | undefined;
|
|
229
|
+
/** {@link createHostedClient} over {@link hostedTenantFromEnv}; `undefined`
|
|
230
|
+
* when ingest is not configured. */
|
|
231
|
+
declare function hostedClientFromEnv(overrides?: Partial<HostedTenant> & {
|
|
232
|
+
env?: Record<string, string | undefined>;
|
|
233
|
+
}): HostedClient | undefined;
|
|
234
|
+
//#endregion
|
|
235
|
+
export { admitSearchLedgerBatch as A, SearchLedgerBatchAdmission as C, SearchLedgerHeadSchema as D, SearchLedgerHead as E, searchLedgerArtifactRefs as M, searchLedgerHeadPath as N, SearchRunKind as O, SearchBlobPutResponseSchema as S, SearchLedgerConflictSchema as T, IngestSearchLedgerRequestSchema as _, createHostedClient as a, SEARCH_LEDGER_INGEST_PATH as b, HOSTED_WIRE_VERSION as c, IngestResponse as d, IngestTracesRequest as f, IngestSearchLedgerRequest as g, AdmitSearchLedgerBatchInput as h, SearchLedgerIngestOutcome as i, searchBlobPath as j, SearchRunKindSchema as k, HostedIngestHeaders as l, UnixNanoTimestamp as m, HostedRequestError as n, hostedClientFromEnv as o, TraceSpanEvent as p, HostedTenant as r, hostedTenantFromEnv as s, HostedClient as t, HostedWireVersion as u, SEARCH_LEDGER_BATCH_MAX_BYTES as v, SearchLedgerConflict as w, SearchBlobPutResponse as x, SEARCH_LEDGER_BATCH_MAX_LINES as y };
|
|
236
|
+
//# sourceMappingURL=client-wFyDisxi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-wFyDisxi.d.ts","names":[],"sources":["../src/hosted/search-ledger-wire.ts","../src/hosted/types.ts","../src/hosted/client.ts"],"mappings":";;;;cAkCa;;;cAGA;cAEA;iBAEG,qBAAqB;;iBAKrB,eAAe,QAAQ;;cAe1B,qBAAmB,EAAA;;;;KACpB,gBAAgB,EAAE,aAAa;;;cAI9B,wBAAsB,EAAA;;;;GAM/B,EAAA,KAAA;KACQ,mBAAmB,EAAE,aAAa;cAEjC,iCAA+B,EAAA;;;;;;;;;GAkBxC,EAAA,KAAA;KACQ,4BAA4B,EAAE,aAAa;;cAG1C,4BAA0B,EAAA;;;;;;;;;;;GAM5B,EAAA,KAAA;KACC,uBAAuB,EAAE,aAAa;;;cAIrC,6BAA2B,EAAA;;;;;;;;GAM7B,EAAA,KAAA;KACC,wBAAwB,EAAE,aAAa;;iBAWnC,yBAAyB,OAAO,oBAAoB;KAoBxD;EAEN;;EAEA,SAAS;EACT;;EAEA,MAAM;;EAEN;EAAoB,UAAU;;UAEnB;EACf,SAAS;;EAET,MAAM;;EAEN,gBAAgB,mBAAmB;;;;;;;;iBASrB,uBACd,OAAO,8BACN;;;;;;;;;;;;;;;;;;;;;;;;;cCtJU;KACD,2BAA2B;;UAKtB;;EAEf;;EAEA;;EAEA,yBAAyB;;EAEzB;;;;;;KASU;;;;;;UAOK;EACf;EACA;EACA;EACA;EACA,mBAAmB;EACnB,iBAAiB;EACjB,YAAY;EACZ,SAAS;IACP,cAAc;IACd;IACA,aAAa;;EAEf;IAAW;IAAgC;;;EAE3C;;EAEA;;EAEA;;EAEA;;UAKe;EACf,aAAa;EACb,OAAO;;UAGQ;;EAEf;;EAEA,UAAU;IAAQ;IAAe;;;;;UC7ClB;;EAEf;;EAEA;;EAEA;;EAEA,mBAAmB;;EAEnB;;EAEA;;;KAIU;EACN;EAAoB,MAAM;;EAC1B;EAAoB,UAAU;;UAEnB;EACf,aAAa,OAAO,kBAAkB,0BAA0B,QAAQ;;EAExE,iBAAiB,kBAAkB,SAAS,cAAc,QAAQ;EAClE,mBACE,SAAS,2BACT,SAAS,cACR,QAAQ;EACX,cACE,4BACA,OAAO,WAAW,cAClB,qBACA,SAAS,cACR,QAAQ;WACF,QAAQ;WACR,aAAa;;;cAIX,2BAA2B;WAC7B;WACA;EACT,YAAY,aAAa,gBAAgB;;iBAuI3B,mBAAmB,QAAQ,eAAe;;;;;;;;;;iBAqG1C,oBACd,YAAW,QAAQ;EAAkB,MAAM;IAC1C;;;iBAmBa,oBACd,YAAW,QAAQ;EAAkB,MAAM;IAC1C"}
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { c as CostLedgerHandle } from "../cost-ledger-DbQdN3nO.js";
|
|
2
|
-
import { _ as ProposalFinding, i as AnalystFinding, v as ProposalFindingOrigin, x as makeProposalFinding } from "../types-
|
|
2
|
+
import { _ as ProposalFinding, i as AnalystFinding, v as ProposalFindingOrigin, x as makeProposalFinding } from "../types-CeDfCRXp.js";
|
|
3
3
|
import { A as createChatClient, T as CreateChatClientOpts, x as ChatClient } from "../types-C0bWoSKC.js";
|
|
4
|
-
import { $ as paretoSignificanceGate, G as BuildEvidenceVectorOptions, J as ParetoSignificanceGateOptions, K as EvidenceVector, Q as paretoPolicy, U as AxisEvidence, W as AxisVerdict, X as PromotionPolicy, Y as PromotionObjective, Z as buildEvidenceVector, q as ObjectiveSource } from "../statistical-heldout-
|
|
5
|
-
import { C as JudgeDimension, H as SurfaceProposer, M as OptimizerConfig, R as Scenario, S as JudgeConfig, V as SessionScript, _ as GateDecision, a as CampaignResult, b as GenerationRecord, c as CampaignTraceWriter, d as DispatchContext, f as DispatchFn, g as GateContribution, h as GateContext, i as CampaignCostMeter, j as MutableSurface, l as CodeSurface, m as GateCheckStatus, n as CampaignArtifactWriter, p as Gate, r as CampaignCellResult, t as CampaignAggregates, v as GateResult, w as JudgeScore, y as GenerationCandidate } from "../types-
|
|
6
|
-
import { $i as RunImprovementLoopOptions, $r as GepaOptimizationRecipe, Ao as
|
|
4
|
+
import { $ as paretoSignificanceGate, G as BuildEvidenceVectorOptions, J as ParetoSignificanceGateOptions, K as EvidenceVector, Q as paretoPolicy, U as AxisEvidence, W as AxisVerdict, X as PromotionPolicy, Y as PromotionObjective, Z as buildEvidenceVector, q as ObjectiveSource } from "../statistical-heldout-BED3wBtX.js";
|
|
5
|
+
import { C as JudgeDimension, H as SurfaceProposer, M as OptimizerConfig, R as Scenario, S as JudgeConfig, V as SessionScript, _ as GateDecision, a as CampaignResult, b as GenerationRecord, c as CampaignTraceWriter, d as DispatchContext, f as DispatchFn, g as GateContribution, h as GateContext, i as CampaignCostMeter, j as MutableSurface, l as CodeSurface, m as GateCheckStatus, n as CampaignArtifactWriter, p as Gate, r as CampaignCellResult, t as CampaignAggregates, v as GateResult, w as JudgeScore, y as GenerationCandidate } from "../types-BmQRs661.js";
|
|
6
|
+
import { $i as RunImprovementLoopOptions, $r as GepaOptimizationRecipe, Ao as fsCampaignStorage, Bi as ReferenceEquivalenceJudgeInput, Ci as compareOptimizationMethods, Dr as DefaultProductionGateOptions, Er as DefaultProductionGateCheck, Gi as runReferenceEquivalenceJudge, Gr as SkillOptOptimizationMethodConfig, Hi as ReferenceEquivalenceJudgeResult, Ji as llmJudge, Jr as skillOptOptimizationMethod, Ki as LlmJudgeDimension, Kr as SkillOptRunnerCommand, Lo as campaignSplitDigest, Mo as FinalEvidencePolicy, No as FinalEvidenceUse, Oo as CampaignStorage, Or as DefaultProductionRewardHackingOptions, Qi as transientDispatchFailure, Qr as GepaOptimizationMethodConfig, Ri as REFERENCE_EQUIVALENCE_INPUT_LIMITS, Si as OptimizationTokenUsage, Ti as ComparisonCost, Tr as heldOutGate, Ui as ReferenceEquivalenceScenario, Vi as ReferenceEquivalenceJudgeOptions, Wi as createReferenceEquivalenceJudge, Wr as composeGate, Xr as GepaEngineOptions, Yr as GepaAdaptiveEngineRun, Zr as GepaEngineRun, _i as OptimizationMethodProvenance, _o as runCampaign, ai as ExternalTextOptimizationMethodConfig, ci as ExternalOptimizationExample, di as CompareOptimizationMethodsOptions, ea as RunImprovementLoopResult, ei as GepaRunnerCommand, fi as OptimizationMethod, fo as RunEvalOptions, go as RunCampaignOptions, hi as OptimizationMethodInput, ho as CampaignCellRetryPolicy, ii as externalTextOptimizationMethod, jo as inMemoryCampaignStorage, kr as defaultProductionGate, li as ExternalTextEvaluationResponse, mo as CampaignCellFailureReceipt, ni as OpenAICompatibleOptimizerModel, oi as ExternalTextOptimizerContext, pi as OptimizationMethodComparison, po as runEval, qi as LlmJudgeOptions, qr as SkillOptTrainerConfig, ri as OptimizerModelBudget, si as ExternalTextOptimizerResult, ta as runImprovementLoop, ti as gepaOptimizationMethod, vi as OptimizationMethodResult, wr as HeldOutGateOptions, xi as OptimizationPackageSource, zi as REFERENCE_EQUIVALENCE_JUDGE_VERSION } from "../index-CzfnASj_.js";
|
|
7
7
|
import { i as InMemoryOutcomeStore, n as FileSystemOutcomeStore, o as OutcomeStore, r as FileSystemOutcomeStoreOptions, t as DeploymentOutcome } from "../outcome-store-CNt4iZ67.js";
|
|
8
|
-
import {
|
|
9
|
-
import { n as
|
|
10
|
-
import { _ as SelfImproveMethodResult, a as DefinedAgentEval, c as SelfImproveMethodOptions, d as SelfImproveProposerOptions, f as SelfImproveProposerResult, g as SelfImproveMethodProvenance, h as selfImprove, i as DefineAgentEvalOptions, l as SelfImproveOptions, m as SelfImproveRunError, n as AgentEvalEvaluateOptions, o as defineAgentEval, p as SelfImproveResult, r as AgentEvalImproveOptions, s as SelfImproveBudget, t as AgentEvalAgent, u as SelfImproveProgressEvent } from "../define-agent-eval-
|
|
11
|
-
import { $ as
|
|
12
|
-
import { n as buildDefaultAnalystRegistry, t as DefaultAnalystRegistryOptions } from "../default-registry-
|
|
13
|
-
|
|
14
|
-
export { type AgentEvalAgent, type AgentEvalEvaluateOptions, type AgentEvalImproveOptions, type AgentProfileImprovementExperimentExecutionInput, type AgentProfileImprovementExperimentRun, type AgentTraceContributor, type AgentTraceContributorType, type AgentTraceConversation, type AgentTraceFile, type AgentTraceIndex, type AgentTraceRange, type AgentTraceRecord, type AnalystFinding, type AnalyzeRunsOptions, type AuthoringProvenance, type AxisEvidence, type AxisVerdict, type BuildEvidenceVectorOptions, type CampaignAggregates, type CampaignArtifactWriter, type CampaignCellFailureReceipt, type CampaignCellResult, type CampaignCellRetryPolicy, type CampaignCostMeter, type CampaignResult, type CampaignStorage, type CampaignTraceWriter, type CandidateExperimentExecutionInput, type CandidateExperimentRun, type ChatClient, type CodeAgentJsonlLine, type CodeAgentSessionAction, type CodeAgentSessionActionKind, type CodeAgentSessionActionStatus, type CodeAgentSessionActionSurface, type CodeAgentSessionDiagnostic, type CodeAgentSessionExecutionReceipt, type CodeAgentSessionIntakeOptions, type CodeAgentSessionIntakeResult, type CodeAgentSessionMetrics, type CodeAgentSessionObservation, type CodeAgentSessionSource, type CodeAgentSessionTerminalStatus, type CodeAgentStoreObservation, type CodeAgentStoreRejection, type CodeAgentStoreRejections, type CodeAgentStoreScope, type CodeAgentStoreSession, type CodeSurface, type CompareAgentProfileImprovementExperimentOptions, type CompareCandidateExperimentOptions, type CompareOptimizationMethodsOptions, type ComparisonCost, type CostLedgerHandle, type CostProvenanceSummary, type CreateChatClientOpts, type DefaultAnalystRegistryOptions, type DefaultProductionGateCheck, type DefaultProductionGateOptions, type DefaultProductionRewardHackingOptions, type DefineAgentEvalOptions, type DefinedAgentEval, type DeploymentOutcome, type DispatchFn as Dispatch, type DispatchContext, type EvalCellScoreDelta, type EvalDimensionDelta, type EvalGenerationDiff, type EvalReportingSuiteInput, type EvalReportingSuiteOptions, type EvalReportingSuiteResult, type EvalRunDiff, type EvaluatePairedMeasurementsOptions, type EvidenceVector, type ExecutionErrorOutcomeCell, type ExecutionInsight, type ExecutionReport, type ExternalOptimizationExample, type ExternalTextEvaluationResponse, type ExternalTextOptimizationMethodConfig, type ExternalTextOptimizerContext, type ExternalTextOptimizerResult, type FailureClassTally, type FailureClusterInsight, type FeedbackTableMeta, type FeedbackTableRow, FileSystemOutcomeStore, type FileSystemOutcomeStoreOptions, type FinalEvidencePolicy, type FinalEvidenceUse, type FromFeedbackTableOptions, type FromFeedbackTableResult, type FromOtelSpansOptions, type FromRunRecordDirOptions, type FromRunRecordDirResult, type Gate, type GateCheckStatus, type GateContext, type GateContribution, type GateDecision, type GateResult, type GenerationCandidate, type GenerationRecord, type GepaAdaptiveEngineRun, type GepaEngineOptions, type GepaEngineRun, type GepaOptimizationMethodConfig, type GepaOptimizationRecipe, type GepaRunnerCommand, type HeldOutGateOptions, type HostedTenant, InMemoryOutcomeStore, type InsightReport, type InterRaterInsight, type JudgeConfig, type JudgeDimension, type JudgeInsight, type JudgeScore, type LiftInsight, type LlmJudgeDimension, type LlmJudgeOptions, type MutableSurface, type ObjectiveSource, type OpenAICompatibleOptimizerModel, type OptimizationMethod, type OptimizationMethodComparison, type OptimizationMethodInput, type OptimizationMethodProvenance, type OptimizationMethodResult, type OptimizationPackageSource, type OptimizationTokenUsage, type OptimizerConfig, type OptimizerModelBudget, type OutcomeCorrelationInsight, type OutcomeStore, type PairedMeasurement, type PairedMeasurementAdapter, type PairedMeasurementEvaluation, type ParetoSignificanceGateOptions, type ParsedCodeAgentJsonl, type PartitionByAuthoringModelResult, type PromotionObjective, type PromotionPolicy, type ProposalFinding, type ProposalFindingOrigin, REFERENCE_EQUIVALENCE_INPUT_LIMITS, REFERENCE_EQUIVALENCE_JUDGE_VERSION, type Recommendation, type ReferenceEquivalenceJudgeInput, type ReferenceEquivalenceJudgeOptions, type ReferenceEquivalenceJudgeResult, type ReferenceEquivalenceScenario, type ReleaseSummary, type RunAgentProfileImprovementExperimentOptions, type RunCampaignOptions, type RunCandidateExperimentOptions, type RunEvalOptions, type RunImprovementLoopOptions, type RunImprovementLoopResult, type RunRecordRejection, type ScalarDistribution, type Scenario, type SealAgentProfileImprovementSuiteOptions, type SealCandidateBenchmarkSuiteOptions, type SelfImproveBudget, type SelfImproveMethodOptions, type SelfImproveMethodProvenance, type SelfImproveMethodResult, type SelfImproveOptions, type SelfImproveProgressEvent, type SelfImproveProposerOptions, type SelfImproveProposerResult, type SelfImproveResult, SelfImproveRunError, type SessionScript, type SkillOptOptimizationMethodConfig, type SkillOptRunnerCommand, type SkillOptTrainerConfig, type SummarizeExecutionOptions, type SurfaceProposer, type TokenUsageInsight, analyzeRuns, buildDefaultAnalystRegistry, buildEvidenceVector, campaignSplitDigest, compareOptimizationMethods, composeGate, createChatClient, createReferenceEquivalenceJudge, defaultProductionGate, defineAgentEval, diffGenerations, diffRunBaselineToWinner, diffRuns, evalReportingSuite, evaluatePairedMeasurements, externalTextOptimizationMethod, fromClaudeCodeSession, fromCodexSession, fromFeedbackTable, fromKimiCodeSession, fromOpenCodeSession, fromOtelSpans, fromPiSession, fromRunRecordDir, fsCampaignStorage, gepaOptimizationMethod, heldOutGate, inMemoryCampaignStorage, llmJudge, makeProposalFinding, measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, observeCodeAgentSession, observeCodeAgentStore, paretoPolicy, paretoSignificanceGate, parseAgentTrace, parseCodeAgentJsonl, parseCodeAgentJsonlFile, partitionRunsByAuthoringModel, runAgentProfileImprovementExperiment, runCampaign, runCandidateExperiment, runEval, runImprovementLoop, runReferenceEquivalenceJudge, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateBenchmarkSuite, sealCandidateBenchmarkTask, sealCandidateExperiment, selfImprove, skillOptOptimizationMethod, streamCodeAgentJsonlFile, summarizeExecution, transientDispatchFailure, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison };
|
|
8
|
+
import { r as HostedTenant } from "../client-wFyDisxi.js";
|
|
9
|
+
import { _ as ReleaseSummary, a as summarizeExecution, c as ExecutionInsight, d as InsightReport, f as InterRaterInsight, g as Recommendation, h as OutcomeCorrelationInsight, i as analyzeRuns, l as FailureClassTally, m as LiftInsight, n as ExecutionReport, o as CostProvenanceSummary, p as JudgeInsight, r as SummarizeExecutionOptions, s as ExecutionErrorOutcomeCell, t as AnalyzeRunsOptions, u as FailureClusterInsight, v as ScalarDistribution, y as TokenUsageInsight } from "../analyze-runs-CPiKLJFs.js";
|
|
10
|
+
import { _ as SelfImproveMethodResult, a as DefinedAgentEval, c as SelfImproveMethodOptions, d as SelfImproveProposerOptions, f as SelfImproveProposerResult, g as SelfImproveMethodProvenance, h as selfImprove, i as DefineAgentEvalOptions, l as SelfImproveOptions, m as SelfImproveRunError, n as AgentEvalEvaluateOptions, o as defineAgentEval, p as SelfImproveResult, r as AgentEvalImproveOptions, s as SelfImproveBudget, t as AgentEvalAgent, u as SelfImproveProgressEvent } from "../define-agent-eval-P28y7mI1.js";
|
|
11
|
+
import { $ as FromRunRecordDirResult, A as CodeAgentSessionActionStatus, B as AgentTraceFile, C as fromOpenCodeSession, Ct as measuredComparisonFromCandidateExperiment, D as streamCodeAgentJsonlFile, Dt as sealCandidateExperiment, E as parseCodeAgentJsonlFile, Et as sealCandidateBenchmarkTask, F as CodeAgentSessionTerminalStatus, G as PartitionByAuthoringModelResult, H as AgentTraceRange, I as observeCodeAgentSession, J as EvalReportingSuiteInput, K as parseAgentTrace, L as AgentTraceContributor, M as CodeAgentSessionExecutionReceipt, N as CodeAgentSessionObservation, O as CodeAgentSessionAction, Ot as verifyCandidateExperiment, P as CodeAgentSessionSource, Q as FromRunRecordDirOptions, R as AgentTraceContributorType, S as fromKimiCodeSession, St as evaluatePairedMeasurements, T as parseCodeAgentJsonl, Tt as sealCandidateBenchmarkSuite, U as AgentTraceRecord, V as AgentTraceIndex, W as AuthoringProvenance, X as EvalReportingSuiteResult, Y as EvalReportingSuiteOptions, Z as evalReportingSuite, _ as CodeAgentSessionIntakeResult, _t as PairedMeasurement, a as FromFeedbackTableOptions, at as RunAgentProfileImprovementExperimentOptions, b as fromClaudeCodeSession, bt as RunCandidateExperimentOptions, c as CodeAgentStoreObservation, ct as runAgentProfileImprovementExperiment, d as CodeAgentStoreScope, dt as sealAgentProfileImprovementTask, et as RunRecordRejection, f as CodeAgentStoreSession, ft as verifyAgentProfileImprovementExperimentComparison, g as CodeAgentSessionIntakeOptions, gt as EvaluatePairedMeasurementsOptions, h as CodeAgentSessionDiagnostic, ht as CompareCandidateExperimentOptions, i as FeedbackTableRow, it as CompareAgentProfileImprovementExperimentOptions, j as CodeAgentSessionActionSurface, k as CodeAgentSessionActionKind, kt as verifyCandidateExperimentComparison, l as CodeAgentStoreRejection, lt as sealAgentProfileImprovementExperiment, m as CodeAgentJsonlLine, mt as CandidateExperimentRun, n as fromOtelSpans, nt as AgentProfileImprovementExperimentExecutionInput, o as FromFeedbackTableResult, ot as SealAgentProfileImprovementSuiteOptions, p as observeCodeAgentStore, pt as CandidateExperimentExecutionInput, q as partitionRunsByAuthoringModel, r as FeedbackTableMeta, rt as AgentProfileImprovementExperimentRun, s as fromFeedbackTable, st as measuredComparisonFromAgentProfileImprovementExperiment, t as FromOtelSpansOptions, tt as fromRunRecordDir, u as CodeAgentStoreRejections, ut as sealAgentProfileImprovementSuite, v as CodeAgentSessionMetrics, vt as PairedMeasurementAdapter, w as fromPiSession, wt as runCandidateExperiment, x as fromCodexSession, xt as SealCandidateBenchmarkSuiteOptions, y as ParsedCodeAgentJsonl, yt as PairedMeasurementEvaluation, z as AgentTraceConversation } from "../index-DH-MWH5f.js";
|
|
12
|
+
import { n as buildDefaultAnalystRegistry, t as DefaultAnalystRegistryOptions } from "../default-registry-DK_9aVJf.js";
|
|
13
|
+
export { type AgentEvalAgent, type AgentEvalEvaluateOptions, type AgentEvalImproveOptions, type AgentProfileImprovementExperimentExecutionInput, type AgentProfileImprovementExperimentRun, type AgentTraceContributor, type AgentTraceContributorType, type AgentTraceConversation, type AgentTraceFile, type AgentTraceIndex, type AgentTraceRange, type AgentTraceRecord, type AnalystFinding, type AnalyzeRunsOptions, type AuthoringProvenance, type AxisEvidence, type AxisVerdict, type BuildEvidenceVectorOptions, type CampaignAggregates, type CampaignArtifactWriter, type CampaignCellFailureReceipt, type CampaignCellResult, type CampaignCellRetryPolicy, type CampaignCostMeter, type CampaignResult, type CampaignStorage, type CampaignTraceWriter, type CandidateExperimentExecutionInput, type CandidateExperimentRun, type ChatClient, type CodeAgentJsonlLine, type CodeAgentSessionAction, type CodeAgentSessionActionKind, type CodeAgentSessionActionStatus, type CodeAgentSessionActionSurface, type CodeAgentSessionDiagnostic, type CodeAgentSessionExecutionReceipt, type CodeAgentSessionIntakeOptions, type CodeAgentSessionIntakeResult, type CodeAgentSessionMetrics, type CodeAgentSessionObservation, type CodeAgentSessionSource, type CodeAgentSessionTerminalStatus, type CodeAgentStoreObservation, type CodeAgentStoreRejection, type CodeAgentStoreRejections, type CodeAgentStoreScope, type CodeAgentStoreSession, type CodeSurface, type CompareAgentProfileImprovementExperimentOptions, type CompareCandidateExperimentOptions, type CompareOptimizationMethodsOptions, type ComparisonCost, type CostLedgerHandle, type CostProvenanceSummary, type CreateChatClientOpts, type DefaultAnalystRegistryOptions, type DefaultProductionGateCheck, type DefaultProductionGateOptions, type DefaultProductionRewardHackingOptions, type DefineAgentEvalOptions, type DefinedAgentEval, type DeploymentOutcome, type DispatchFn as Dispatch, type DispatchContext, type EvalReportingSuiteInput, type EvalReportingSuiteOptions, type EvalReportingSuiteResult, type EvaluatePairedMeasurementsOptions, type EvidenceVector, type ExecutionErrorOutcomeCell, type ExecutionInsight, type ExecutionReport, type ExternalOptimizationExample, type ExternalTextEvaluationResponse, type ExternalTextOptimizationMethodConfig, type ExternalTextOptimizerContext, type ExternalTextOptimizerResult, type FailureClassTally, type FailureClusterInsight, type FeedbackTableMeta, type FeedbackTableRow, FileSystemOutcomeStore, type FileSystemOutcomeStoreOptions, type FinalEvidencePolicy, type FinalEvidenceUse, type FromFeedbackTableOptions, type FromFeedbackTableResult, type FromOtelSpansOptions, type FromRunRecordDirOptions, type FromRunRecordDirResult, type Gate, type GateCheckStatus, type GateContext, type GateContribution, type GateDecision, type GateResult, type GenerationCandidate, type GenerationRecord, type GepaAdaptiveEngineRun, type GepaEngineOptions, type GepaEngineRun, type GepaOptimizationMethodConfig, type GepaOptimizationRecipe, type GepaRunnerCommand, type HeldOutGateOptions, type HostedTenant, InMemoryOutcomeStore, type InsightReport, type InterRaterInsight, type JudgeConfig, type JudgeDimension, type JudgeInsight, type JudgeScore, type LiftInsight, type LlmJudgeDimension, type LlmJudgeOptions, type MutableSurface, type ObjectiveSource, type OpenAICompatibleOptimizerModel, type OptimizationMethod, type OptimizationMethodComparison, type OptimizationMethodInput, type OptimizationMethodProvenance, type OptimizationMethodResult, type OptimizationPackageSource, type OptimizationTokenUsage, type OptimizerConfig, type OptimizerModelBudget, type OutcomeCorrelationInsight, type OutcomeStore, type PairedMeasurement, type PairedMeasurementAdapter, type PairedMeasurementEvaluation, type ParetoSignificanceGateOptions, type ParsedCodeAgentJsonl, type PartitionByAuthoringModelResult, type PromotionObjective, type PromotionPolicy, type ProposalFinding, type ProposalFindingOrigin, REFERENCE_EQUIVALENCE_INPUT_LIMITS, REFERENCE_EQUIVALENCE_JUDGE_VERSION, type Recommendation, type ReferenceEquivalenceJudgeInput, type ReferenceEquivalenceJudgeOptions, type ReferenceEquivalenceJudgeResult, type ReferenceEquivalenceScenario, type ReleaseSummary, type RunAgentProfileImprovementExperimentOptions, type RunCampaignOptions, type RunCandidateExperimentOptions, type RunEvalOptions, type RunImprovementLoopOptions, type RunImprovementLoopResult, type RunRecordRejection, type ScalarDistribution, type Scenario, type SealAgentProfileImprovementSuiteOptions, type SealCandidateBenchmarkSuiteOptions, type SelfImproveBudget, type SelfImproveMethodOptions, type SelfImproveMethodProvenance, type SelfImproveMethodResult, type SelfImproveOptions, type SelfImproveProgressEvent, type SelfImproveProposerOptions, type SelfImproveProposerResult, type SelfImproveResult, SelfImproveRunError, type SessionScript, type SkillOptOptimizationMethodConfig, type SkillOptRunnerCommand, type SkillOptTrainerConfig, type SummarizeExecutionOptions, type SurfaceProposer, type TokenUsageInsight, analyzeRuns, buildDefaultAnalystRegistry, buildEvidenceVector, campaignSplitDigest, compareOptimizationMethods, composeGate, createChatClient, createReferenceEquivalenceJudge, defaultProductionGate, defineAgentEval, evalReportingSuite, evaluatePairedMeasurements, externalTextOptimizationMethod, fromClaudeCodeSession, fromCodexSession, fromFeedbackTable, fromKimiCodeSession, fromOpenCodeSession, fromOtelSpans, fromPiSession, fromRunRecordDir, fsCampaignStorage, gepaOptimizationMethod, heldOutGate, inMemoryCampaignStorage, llmJudge, makeProposalFinding, measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, observeCodeAgentSession, observeCodeAgentStore, paretoPolicy, paretoSignificanceGate, parseAgentTrace, parseCodeAgentJsonl, parseCodeAgentJsonlFile, partitionRunsByAuthoringModel, runAgentProfileImprovementExperiment, runCampaign, runCandidateExperiment, runEval, runImprovementLoop, runReferenceEquivalenceJudge, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateBenchmarkSuite, sealCandidateBenchmarkTask, sealCandidateExperiment, selfImprove, skillOptOptimizationMethod, streamCodeAgentJsonlFile, summarizeExecution, transientDispatchFailure, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison };
|
package/dist/contract/index.js
CHANGED
|
@@ -4,21 +4,21 @@ import { t as decidePairedPromotion } from "../paired-promotion-decision-6cn3bLc
|
|
|
4
4
|
import { a as heldoutSignificance } from "../statistical-heldout-GcLIPxk4.js";
|
|
5
5
|
import { n as summarizeExecution, t as analyzeRuns } from "../analyze-runs-SCSWYpy0.js";
|
|
6
6
|
import { a as parseRunRecordSafe } from "../run-record-BRlM99rX.js";
|
|
7
|
-
import {
|
|
7
|
+
import { J as runEval, R as defaultProductionGate, Y as runCampaign, a as transientDispatchFailure, c as compareOptimizationMethods, h as runImprovementLoop, t as llmJudge } from "../llm-judge-NJOHM0iA.js";
|
|
8
8
|
import { i as isModelPriced, n as estimateCost } from "../metrics-DOMpkoeb.js";
|
|
9
9
|
import { i as CostLedger } from "../cost-ledger-_IbkejCF.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { C as inMemoryCampaignStorage, S as fsCampaignStorage } from "../external-optimizer-subprocess-
|
|
13
|
-
import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-
|
|
14
|
-
import { t as buildDefaultAnalystRegistry } from "../default-registry-
|
|
15
|
-
import { t as extractUsage } from "../extract-usage-
|
|
10
|
+
import { Y as campaignSplitDigest } from "../campaign-evidence-BqjlTM3P.js";
|
|
11
|
+
import { m as mapConcurrentRange } from "../journal-c3qY0SDP.js";
|
|
12
|
+
import { C as inMemoryCampaignStorage, S as fsCampaignStorage } from "../external-optimizer-subprocess-B234V9V0.js";
|
|
13
|
+
import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-BE43YTm4.js";
|
|
14
|
+
import { t as buildDefaultAnalystRegistry } from "../default-registry-xMLX160E.js";
|
|
15
|
+
import { t as extractUsage } from "../extract-usage-DFATEuWW.js";
|
|
16
16
|
import { i as makeProposalFinding } from "../types-CW5b90JH.js";
|
|
17
|
-
import { t as createChatClient } from "../chat-client-
|
|
17
|
+
import { t as createChatClient } from "../chat-client-B_ItsSBw.js";
|
|
18
18
|
import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "../outcome-store-BXlkwMPR.js";
|
|
19
|
-
import { c as composeGate, f as REFERENCE_EQUIVALENCE_INPUT_LIMITS, h as runReferenceEquivalenceJudge, l as externalTextOptimizationMethod, m as createReferenceEquivalenceJudge, n as gepaOptimizationMethod, p as REFERENCE_EQUIVALENCE_JUDGE_VERSION, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-
|
|
19
|
+
import { c as composeGate, f as REFERENCE_EQUIVALENCE_INPUT_LIMITS, h as runReferenceEquivalenceJudge, l as externalTextOptimizationMethod, m as createReferenceEquivalenceJudge, n as gepaOptimizationMethod, p as REFERENCE_EQUIVALENCE_JUDGE_VERSION, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-DwO3TOAV.js";
|
|
20
20
|
import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-CfMNUro2.js";
|
|
21
|
-
import { t as fromOtelSpans } from "../otel-spans-
|
|
21
|
+
import { t as fromOtelSpans } from "../otel-spans-DS7t1t1J.js";
|
|
22
22
|
import { createHash } from "node:crypto";
|
|
23
23
|
import { agentCandidateBenchmarkSuiteSchema, agentCandidateBenchmarkTaskSchema, agentCandidateBundleSchema, agentCandidateEvaluationPolicySchema, agentCandidateExperimentSchema, agentImprovementMeasuredComparisonSchema, agentProfileImprovementExperimentSchema, agentProfileImprovementMeasuredComparisonSchema, agentProfileImprovementRunCellSchema, agentProfileImprovementRunReceiptSchema, agentProfileImprovementSuiteInputsSchema, agentProfileImprovementSuiteSchema, agentProfileImprovementTaskSchema, candidateExecutionEvidenceSchema, canonicalCandidateDigest, canonicalCandidateJson, numbersApproximatelyEqual, omitTopLevelDigest } from "@tangle-network/agent-interface";
|
|
24
24
|
import { createReadStream } from "node:fs";
|
|
@@ -1318,136 +1318,6 @@ function resolveWriteTarget(write, sourcePath) {
|
|
|
1318
1318
|
return sourcePath.endsWith(".json") || sourcePath.endsWith(".jsonl") ? join(dirname(sourcePath), ANALYSIS_ARTIFACT) : join(sourcePath, ANALYSIS_ARTIFACT);
|
|
1319
1319
|
}
|
|
1320
1320
|
//#endregion
|
|
1321
|
-
//#region src/contract/diff.ts
|
|
1322
|
-
function keyForCell(cell) {
|
|
1323
|
-
return JSON.stringify([cell.scenarioId, cell.rep]);
|
|
1324
|
-
}
|
|
1325
|
-
/** Build the per-dimension delta map for a matched cell. Each judge name +
|
|
1326
|
-
* dimension name encountered on EITHER side appears in the result. */
|
|
1327
|
-
function diffDimensions(before, after) {
|
|
1328
|
-
const out = {};
|
|
1329
|
-
const judges = /* @__PURE__ */ new Set([...Object.keys(before), ...Object.keys(after)]);
|
|
1330
|
-
for (const judge of judges) {
|
|
1331
|
-
const beforeDims = before[judge] ?? {};
|
|
1332
|
-
const afterDims = after[judge] ?? {};
|
|
1333
|
-
const dims = /* @__PURE__ */ new Set([...Object.keys(beforeDims), ...Object.keys(afterDims)]);
|
|
1334
|
-
const judgeOut = {};
|
|
1335
|
-
for (const dim of dims) {
|
|
1336
|
-
const rawBefore = beforeDims[dim];
|
|
1337
|
-
const rawAfter = afterDims[dim];
|
|
1338
|
-
const b = typeof rawBefore === "number" && Number.isFinite(rawBefore) ? rawBefore : null;
|
|
1339
|
-
const a = typeof rawAfter === "number" && Number.isFinite(rawAfter) ? rawAfter : null;
|
|
1340
|
-
judgeOut[dim] = {
|
|
1341
|
-
before: b,
|
|
1342
|
-
after: a,
|
|
1343
|
-
delta: b !== null && a !== null ? a - b : null
|
|
1344
|
-
};
|
|
1345
|
-
}
|
|
1346
|
-
out[judge] = judgeOut;
|
|
1347
|
-
}
|
|
1348
|
-
return out;
|
|
1349
|
-
}
|
|
1350
|
-
/**
|
|
1351
|
-
* Diff two generation snapshots. Cells are matched on `(scenarioId, rep)`;
|
|
1352
|
-
* unmatched cells surface in `added` / `removed`. Aggregate fields are
|
|
1353
|
-
* recomputed from the snapshot's stored fields, not re-derived from cells —
|
|
1354
|
-
* this keeps the diff consistent with whatever aggregation the substrate
|
|
1355
|
-
* actually reported.
|
|
1356
|
-
*/
|
|
1357
|
-
function diffGenerations(before, after) {
|
|
1358
|
-
const beforeMap = new Map(before.cells.map((c) => [keyForCell(c), c]));
|
|
1359
|
-
const afterMap = new Map(after.cells.map((c) => [keyForCell(c), c]));
|
|
1360
|
-
const matched = [];
|
|
1361
|
-
const removed = [];
|
|
1362
|
-
const added = [];
|
|
1363
|
-
for (const [key, beforeCell] of beforeMap) {
|
|
1364
|
-
const afterCell = afterMap.get(key);
|
|
1365
|
-
if (!afterCell) {
|
|
1366
|
-
removed.push(beforeCell);
|
|
1367
|
-
continue;
|
|
1368
|
-
}
|
|
1369
|
-
matched.push({
|
|
1370
|
-
scenarioId: beforeCell.scenarioId,
|
|
1371
|
-
rep: beforeCell.rep,
|
|
1372
|
-
compositeBefore: beforeCell.compositeMean,
|
|
1373
|
-
compositeAfter: afterCell.compositeMean,
|
|
1374
|
-
compositeDelta: beforeCell.compositeMean === null || afterCell.compositeMean === null ? null : afterCell.compositeMean - beforeCell.compositeMean,
|
|
1375
|
-
dimensions: diffDimensions(beforeCell.dimensions, afterCell.dimensions)
|
|
1376
|
-
});
|
|
1377
|
-
}
|
|
1378
|
-
for (const [key, afterCell] of afterMap) if (!beforeMap.has(key)) added.push(afterCell);
|
|
1379
|
-
return {
|
|
1380
|
-
beforeIndex: before.index,
|
|
1381
|
-
afterIndex: after.index,
|
|
1382
|
-
beforeSurfaceHash: before.surfaceHash,
|
|
1383
|
-
afterSurfaceHash: after.surfaceHash,
|
|
1384
|
-
surfaceChanged: before.surfaceHash !== after.surfaceHash,
|
|
1385
|
-
matched,
|
|
1386
|
-
removed,
|
|
1387
|
-
added,
|
|
1388
|
-
compositeBefore: before.compositeMean,
|
|
1389
|
-
compositeAfter: after.compositeMean,
|
|
1390
|
-
compositeDelta: before.compositeMean === null || after.compositeMean === null ? null : after.compositeMean - before.compositeMean,
|
|
1391
|
-
costUsdBefore: before.costUsd,
|
|
1392
|
-
costUsdAfter: after.costUsd,
|
|
1393
|
-
costUsdDelta: after.costUsd - before.costUsd,
|
|
1394
|
-
durationMsBefore: before.durationMs,
|
|
1395
|
-
durationMsAfter: after.durationMs,
|
|
1396
|
-
durationMsDelta: after.durationMs - before.durationMs
|
|
1397
|
-
};
|
|
1398
|
-
}
|
|
1399
|
-
/** Highest-index generation, or null if the run recorded none. */
|
|
1400
|
-
function winnerOf(run) {
|
|
1401
|
-
if (run.generations.length === 0) return null;
|
|
1402
|
-
let winner = run.generations[0];
|
|
1403
|
-
for (const gen of run.generations) if (gen.index > winner.index) winner = gen;
|
|
1404
|
-
return winner;
|
|
1405
|
-
}
|
|
1406
|
-
/**
|
|
1407
|
-
* Diff two full eval-runs. Produces baseline-vs-baseline and
|
|
1408
|
-
* winner-vs-winner generation diffs when both sides expose them, plus
|
|
1409
|
-
* run-level cost / lift / gate-decision deltas.
|
|
1410
|
-
*/
|
|
1411
|
-
function diffRuns(before, after) {
|
|
1412
|
-
const beforeWinner = winnerOf(before);
|
|
1413
|
-
const afterWinner = winnerOf(after);
|
|
1414
|
-
const baselineDiff = before.baseline && after.baseline ? diffGenerations(before.baseline, after.baseline) : null;
|
|
1415
|
-
const winnersDiff = beforeWinner && afterWinner ? diffGenerations(beforeWinner, afterWinner) : null;
|
|
1416
|
-
const beforeLift = before.holdoutLift ?? null;
|
|
1417
|
-
const afterLift = after.holdoutLift ?? null;
|
|
1418
|
-
return {
|
|
1419
|
-
beforeRunId: before.runId,
|
|
1420
|
-
afterRunId: after.runId,
|
|
1421
|
-
beforeTimestamp: before.timestamp,
|
|
1422
|
-
afterTimestamp: after.timestamp,
|
|
1423
|
-
beforeGateDecision: before.gateDecision ?? null,
|
|
1424
|
-
afterGateDecision: after.gateDecision ?? null,
|
|
1425
|
-
beforeHoldoutLift: beforeLift,
|
|
1426
|
-
afterHoldoutLift: afterLift,
|
|
1427
|
-
holdoutLiftDelta: beforeLift !== null && afterLift !== null ? afterLift - beforeLift : null,
|
|
1428
|
-
beforeTotalCostUsd: before.totalCostUsd,
|
|
1429
|
-
afterTotalCostUsd: after.totalCostUsd,
|
|
1430
|
-
totalCostUsdDelta: after.totalCostUsd - before.totalCostUsd,
|
|
1431
|
-
beforeTotalDurationMs: before.totalDurationMs,
|
|
1432
|
-
afterTotalDurationMs: after.totalDurationMs,
|
|
1433
|
-
totalDurationMsDelta: after.totalDurationMs - before.totalDurationMs,
|
|
1434
|
-
baselineDiff,
|
|
1435
|
-
winnersDiff
|
|
1436
|
-
};
|
|
1437
|
-
}
|
|
1438
|
-
/**
|
|
1439
|
-
* Within-run baseline → winning-generation diff. The natural "what did the
|
|
1440
|
-
* improvement loop produce" view for a single run. Returns null when the
|
|
1441
|
-
* run never reached a generation past baseline (errored early, or the gate
|
|
1442
|
-
* shipped the baseline as-is).
|
|
1443
|
-
*/
|
|
1444
|
-
function diffRunBaselineToWinner(run) {
|
|
1445
|
-
if (!run.baseline) return null;
|
|
1446
|
-
const winner = winnerOf(run);
|
|
1447
|
-
if (!winner || winner.index === run.baseline.index) return null;
|
|
1448
|
-
return diffGenerations(run.baseline, winner);
|
|
1449
|
-
}
|
|
1450
|
-
//#endregion
|
|
1451
1321
|
//#region src/contract/intake/agent-trace.ts
|
|
1452
1322
|
function rangeLines(r) {
|
|
1453
1323
|
return Math.max(0, r.end_line - r.start_line + 1);
|
|
@@ -3351,6 +3221,6 @@ function fromFeedbackTable(opts) {
|
|
|
3351
3221
|
};
|
|
3352
3222
|
}
|
|
3353
3223
|
//#endregion
|
|
3354
|
-
export { FileSystemOutcomeStore, InMemoryOutcomeStore, REFERENCE_EQUIVALENCE_INPUT_LIMITS, REFERENCE_EQUIVALENCE_JUDGE_VERSION, SelfImproveRunError, analyzeRuns, buildDefaultAnalystRegistry, buildEvidenceVector, campaignSplitDigest, compareOptimizationMethods, composeGate, createChatClient, createReferenceEquivalenceJudge, defaultProductionGate, defineAgentEval,
|
|
3224
|
+
export { FileSystemOutcomeStore, InMemoryOutcomeStore, REFERENCE_EQUIVALENCE_INPUT_LIMITS, REFERENCE_EQUIVALENCE_JUDGE_VERSION, SelfImproveRunError, analyzeRuns, buildDefaultAnalystRegistry, buildEvidenceVector, campaignSplitDigest, compareOptimizationMethods, composeGate, createChatClient, createReferenceEquivalenceJudge, defaultProductionGate, defineAgentEval, evalReportingSuite, evaluatePairedMeasurements, externalTextOptimizationMethod, fromClaudeCodeSession, fromCodexSession, fromFeedbackTable, fromKimiCodeSession, fromOpenCodeSession, fromOtelSpans, fromPiSession, fromRunRecordDir, fsCampaignStorage, gepaOptimizationMethod, heldOutGate, inMemoryCampaignStorage, llmJudge, makeProposalFinding, measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, observeCodeAgentSession, observeCodeAgentStore, paretoPolicy, paretoSignificanceGate, parseAgentTrace, parseCodeAgentJsonl, parseCodeAgentJsonlFile, partitionRunsByAuthoringModel, runAgentProfileImprovementExperiment, runCampaign, runCandidateExperiment, runEval, runImprovementLoop, runReferenceEquivalenceJudge, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateBenchmarkSuite, sealCandidateBenchmarkTask, sealCandidateExperiment, selfImprove, skillOptOptimizationMethod, streamCodeAgentJsonlFile, summarizeExecution, transientDispatchFailure, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison };
|
|
3355
3225
|
|
|
3356
3226
|
//# sourceMappingURL=index.js.map
|