@tangle-network/agent-eval 1.0.24 → 1.0.25
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 +43 -0
- package/dist/adapters/http.d.ts +2 -2
- package/dist/{agent-profile-DC_v4p1f.d.ts → agent-profile-BF1WLMco.d.ts} +3 -3
- package/dist/{agent-profile-DC_v4p1f.d.ts.map → agent-profile-BF1WLMco.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +14 -14
- package/dist/analyst/index.js +1 -1
- package/dist/{analyze-runs-DGr7mpC3.d.ts → analyze-runs-BaziIw93.d.ts} +4 -4
- package/dist/{analyze-runs-DGr7mpC3.d.ts.map → analyze-runs-BaziIw93.d.ts.map} +1 -1
- package/dist/app-grade/index.d.ts +4 -4
- package/dist/benchmarks/index.d.ts +4 -4
- package/dist/benchmarks/index.js +1 -1
- package/dist/campaign/index.d.ts +7 -7
- package/dist/campaign/index.js +1 -1
- package/dist/{campaign-C9QC27C2.js → campaign-Cqz2vk2p.js} +2 -2
- package/dist/{campaign-C9QC27C2.js.map → campaign-Cqz2vk2p.js.map} +1 -1
- package/dist/{chat-client-9XLgWrQ7.js → chat-client-PJEzoot9.js} +3 -3
- package/dist/chat-client-PJEzoot9.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{cluster-CkzP4h3T.d.ts → cluster-CSd0LE_M.d.ts} +3 -3
- package/dist/{cluster-CkzP4h3T.d.ts.map → cluster-CSd0LE_M.d.ts.map} +1 -1
- package/dist/{completion-verifier-BYLOcQt7.js → completion-verifier-DVZx0x6x.js} +3 -3
- package/dist/{completion-verifier-BYLOcQt7.js.map → completion-verifier-DVZx0x6x.js.map} +1 -1
- package/dist/{completion-verifier-CJVDPv2T.d.ts → completion-verifier-oAgSwdFe.d.ts} +3 -3
- package/dist/{completion-verifier-CJVDPv2T.d.ts.map → completion-verifier-oAgSwdFe.d.ts.map} +1 -1
- package/dist/contract/index.d.ts +10 -10
- package/dist/contract/index.js +1 -1
- package/dist/{default-registry-C_Akmpui.d.ts → default-registry-DoIBhuS-.d.ts} +7 -7
- package/dist/{default-registry-C_Akmpui.d.ts.map → default-registry-DoIBhuS-.d.ts.map} +1 -1
- package/dist/{define-agent-eval-nNPC7cD5.d.ts → define-agent-eval-Be2Ser8j.d.ts} +7 -7
- package/dist/{define-agent-eval-nNPC7cD5.d.ts.map → define-agent-eval-Be2Ser8j.d.ts.map} +1 -1
- package/dist/diagnosis/index.d.ts +2 -2
- package/dist/{engine-B0gr15-l.d.ts → engine-CPBhCLJR.d.ts} +2 -2
- package/dist/{engine-B0gr15-l.d.ts.map → engine-CPBhCLJR.d.ts.map} +1 -1
- package/dist/{evaluation-mk3u_ZJC.d.ts → evaluation-BjRgUyst.d.ts} +4 -4
- package/dist/{evaluation-mk3u_ZJC.d.ts.map → evaluation-BjRgUyst.d.ts.map} +1 -1
- package/dist/evaluation.d.ts +1 -1
- package/dist/{exact-types-Blq7YvsK.d.ts → exact-types-DEnrf7NX.d.ts} +2 -2
- package/dist/{exact-types-Blq7YvsK.d.ts.map → exact-types-DEnrf7NX.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +3 -3
- package/dist/{feedback-trajectory-D3oISeGl.d.ts → feedback-trajectory-DxkG5EPi.d.ts} +3 -3
- package/dist/{feedback-trajectory-D3oISeGl.d.ts.map → feedback-trajectory-DxkG5EPi.d.ts.map} +1 -1
- package/dist/{index-CxuK3sxA.d.ts → index-AjfEHHA8.d.ts} +8 -8
- package/dist/{index-CxuK3sxA.d.ts.map → index-AjfEHHA8.d.ts.map} +1 -1
- package/dist/{index-cp5gkylN.d.ts → index-BI9ecONy.d.ts} +10 -10
- package/dist/{index-cp5gkylN.d.ts.map → index-BI9ecONy.d.ts.map} +1 -1
- package/dist/{index-BdFlQP54.d.ts → index-BriU7rfL.d.ts} +3 -3
- package/dist/{index-BdFlQP54.d.ts.map → index-BriU7rfL.d.ts.map} +1 -1
- package/dist/{index-IE8O0HNr.d.ts → index-D-0mg-eu.d.ts} +8 -8
- package/dist/{index-IE8O0HNr.d.ts.map → index-D-0mg-eu.d.ts.map} +1 -1
- package/dist/{index-BN6htPVi.d.ts → index-DHWFYUVW.d.ts} +2 -2
- package/dist/{index-BN6htPVi.d.ts.map → index-DHWFYUVW.d.ts.map} +1 -1
- package/dist/{index-Dodw93oW.d.ts → index-JPI2spOx.d.ts} +23 -23
- package/dist/{index-Dodw93oW.d.ts.map → index-JPI2spOx.d.ts.map} +1 -1
- package/dist/{index-KAYaJtMA.d.ts → index-VSN1IZQp.d.ts} +3 -3
- package/dist/{index-KAYaJtMA.d.ts.map → index-VSN1IZQp.d.ts.map} +1 -1
- package/dist/index.d.ts +27 -27
- package/dist/index.js +5 -5
- package/dist/{integrity-zeWMeTQt.d.ts → integrity-BMyCpnZ8.d.ts} +2 -2
- package/dist/{integrity-zeWMeTQt.d.ts.map → integrity-BMyCpnZ8.d.ts.map} +1 -1
- package/dist/{matrix-Diw3yJCG.d.ts → matrix-DdniPG_M.d.ts} +2 -2
- package/dist/{matrix-Diw3yJCG.d.ts.map → matrix-DdniPG_M.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +2 -2
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +3 -3
- package/dist/multishot/index.js +2 -2
- package/dist/openapi.json +1 -1
- package/dist/{paired-promotion-decision-COeOgNHG.d.ts → paired-promotion-decision-DawN2o0G.d.ts} +2 -2
- package/dist/{paired-promotion-decision-COeOgNHG.d.ts.map → paired-promotion-decision-DawN2o0G.d.ts.map} +1 -1
- package/dist/{prime-protocol-bRbh6dqd.d.ts → prime-protocol-RUPtoYiI.d.ts} +2 -2
- package/dist/{prime-protocol-bRbh6dqd.d.ts.map → prime-protocol-RUPtoYiI.d.ts.map} +1 -1
- package/dist/{promotion-gate-XglbDCNo.d.ts → promotion-gate-DG_PSJx_.d.ts} +2 -2
- package/dist/{promotion-gate-XglbDCNo.d.ts.map → promotion-gate-DG_PSJx_.d.ts.map} +1 -1
- package/dist/{registry-Pfeqsr5k.d.ts → registry-BqoX13FD.d.ts} +4 -4
- package/dist/{registry-Pfeqsr5k.d.ts.map → registry-BqoX13FD.d.ts.map} +1 -1
- package/dist/reporting.d.ts +4 -4
- package/dist/{researcher-DlyjP5uq.d.ts → researcher-BuojS14L.d.ts} +4 -4
- package/dist/{researcher-DlyjP5uq.d.ts.map → researcher-BuojS14L.d.ts.map} +1 -1
- package/dist/rl.d.ts +7 -7
- package/dist/rollout/index.d.ts +2 -2
- package/dist/rollout/index.js +1 -1
- package/dist/{rollout-Dh5q6CPA.js → rollout-B86tqluQ.js} +2 -2
- package/dist/{rollout-Dh5q6CPA.js.map → rollout-B86tqluQ.js.map} +1 -1
- package/dist/search/index.d.ts +2 -2
- package/dist/{search-kernel-6P1dRpJ4.d.ts → search-kernel-C4XnLKIW.d.ts} +3 -3
- package/dist/{search-kernel-6P1dRpJ4.d.ts.map → search-kernel-C4XnLKIW.d.ts.map} +1 -1
- package/dist/{sequential-OeSwJ2uG.d.ts → sequential-1-T2oi1_.d.ts} +2 -2
- package/dist/{sequential-OeSwJ2uG.d.ts.map → sequential-1-T2oi1_.d.ts.map} +1 -1
- package/dist/{server-BorE0Y3O.js → server-BQbd__Hr.js} +3 -3
- package/dist/{server-BorE0Y3O.js.map → server-BQbd__Hr.js.map} +1 -1
- package/dist/{statistical-heldout-vjrs8iyO.d.ts → statistical-heldout-Bx1QUDNy.d.ts} +5 -5
- package/dist/{statistical-heldout-vjrs8iyO.d.ts.map → statistical-heldout-Bx1QUDNy.d.ts.map} +1 -1
- package/dist/statistics.d.ts +2 -2
- package/dist/{store-tool-spans-BemsQEhd.d.ts → store-tool-spans-kCDPEwjL.d.ts} +5 -5
- package/dist/{store-tool-spans-BemsQEhd.d.ts.map → store-tool-spans-kCDPEwjL.d.ts.map} +1 -1
- package/dist/{summary-report-vdhE20Zf.d.ts → summary-report-9kwI6jFQ.d.ts} +2 -2
- package/dist/{summary-report-vdhE20Zf.d.ts.map → summary-report-9kwI6jFQ.d.ts.map} +1 -1
- package/dist/supervisor-run/index.d.ts +1 -1
- package/dist/{systemone-DFUN9DL1.d.ts → systemone-CSwi1hp-.d.ts} +7 -7
- package/dist/{systemone-DFUN9DL1.d.ts.map → systemone-CSwi1hp-.d.ts.map} +1 -1
- package/dist/{systemone-review-4CKmHvr5.d.ts → systemone-review-WpWosn3a.d.ts} +2 -2
- package/dist/{systemone-review-4CKmHvr5.d.ts.map → systemone-review-WpWosn3a.d.ts.map} +1 -1
- package/dist/systemone.d.ts +3 -3
- package/dist/{tool-groups-Dpl3picW.d.ts → tool-groups-Bcasvncd.d.ts} +3 -3
- package/dist/tool-groups-Bcasvncd.d.ts.map +1 -0
- package/dist/{trace-questions-oT2fZWJ8.d.ts → trace-questions-DI42jXPj.d.ts} +3 -3
- package/dist/{trace-questions-oT2fZWJ8.d.ts.map → trace-questions-DI42jXPj.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +1 -1
- package/dist/traces.d.ts +5 -5
- package/dist/{types-C9yEqDjQ.d.ts → types-ByrbgALT.d.ts} +4 -4
- package/dist/{types-C9yEqDjQ.d.ts.map → types-ByrbgALT.d.ts.map} +1 -1
- package/dist/{types-CwHU7U9J.d.ts → types-CLGrB4Sv.d.ts} +2 -2
- package/dist/{types-CwHU7U9J.d.ts.map → types-CLGrB4Sv.d.ts.map} +1 -1
- package/dist/{types-CP3rkpir.d.ts → types-D7g2XFTc.d.ts} +2 -2
- package/dist/{types-CP3rkpir.d.ts.map → types-D7g2XFTc.d.ts.map} +1 -1
- package/dist/{types-6GuPL-Vt.d.ts → types-DbGSC2No.d.ts} +2 -2
- package/dist/{types-6GuPL-Vt.d.ts.map → types-DbGSC2No.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +4 -4
- package/dist/wire/index.js +1 -1
- package/docs/wire-protocol.md +1 -1
- package/package.json +1 -1
- package/dist/chat-client-9XLgWrQ7.js.map +0 -1
- package/dist/tool-groups-Dpl3picW.d.ts.map +0 -1
|
@@ -30,8 +30,8 @@ import { t as LlmClient } from "./llm-client-Bj-TooRS.js";
|
|
|
30
30
|
* misconfigured caller gets a refusal at construction, never a call to an
|
|
31
31
|
* endpoint it did not name.
|
|
32
32
|
*/
|
|
33
|
-
/** Judge model when neither caller nor client names one:
|
|
34
|
-
const DEFAULT_JUDGE_MODEL = "
|
|
33
|
+
/** Judge model when neither caller nor client names one: one every model-restricted Router key may call. */
|
|
34
|
+
const DEFAULT_JUDGE_MODEL = "zai/glm-5.3";
|
|
35
35
|
/**
|
|
36
36
|
* Build a ChatClient bound to a specific transport. The returned client
|
|
37
37
|
* is safe to share across analysts in a single registry run.
|
|
@@ -115,4 +115,4 @@ function openAiCompatibleClient(opts) {
|
|
|
115
115
|
}
|
|
116
116
|
export { createChatClient as n, DEFAULT_JUDGE_MODEL as t };
|
|
117
117
|
|
|
118
|
-
//# sourceMappingURL=chat-client-
|
|
118
|
+
//# sourceMappingURL=chat-client-PJEzoot9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-client-PJEzoot9.js","names":[],"sources":["../src/analyst/chat-client.ts"],"sourcesContent":["/**\n * Provider-neutral chat contract for every model call made by agent-eval.\n *\n * The caller owns model execution. Evaluation code receives canonical requests\n * and results without importing a provider SDK, and agent-eval reads no\n * environment variable to find a provider credential: every transport is bound\n * at the call site.\n *\n * Two ways to bind one. `custom` and `sandbox-sdk` take a `chat` function the\n * caller wrote. `openai-compatible` takes an endpoint and a credential the\n * caller passes as values, and agent-eval issues the HTTP request itself.\n *\n * WHY THE THIRD ONE EXISTS. Every consumer that wanted a plain OpenAI-style\n * endpoint had to hand-write the same fetch loop — retry on 429 and 5xx,\n * `json_schema` degrade, fenced-JSON stripping, and, load-bearing here, the\n * `servedModel` echo that `assertServedModel` and `assertCrossFamilyServed`\n * read. A hand-written transport that omits `servedModel` makes both identity\n * checks read `unreported`, so the two-vendor judge rule they enforce silently\n * measures nothing. Measured motive: agent-eval 0.172.1 exported no such\n * transport, so a two-model judge panel in discovery-lab reached\n * `createChatClient({ transport: 'custom', baseUrl, apiKey })` — fields that\n * exist on no transport option — and every call threw\n * `TypeError: opts.chat is not a function`, which surfaced as\n * `aggregateJudgeVerdicts: all 2 judges failed`.\n *\n * The credential still never comes from agent-eval's environment. `baseUrl`\n * and the bearer are required arguments with no default and no fallback, so a\n * misconfigured caller gets a refusal at construction, never a call to an\n * endpoint it did not name.\n */\n\nimport {\n type LlmCallRequest,\n type LlmCallResult,\n LlmClient,\n type LlmClientOptions,\n} from '../llm-client'\n\n/**\n * Unified chat interface using the package's canonical LLM request and result.\n */\nexport interface ChatClient {\n /** Display name of the bound transport, included in telemetry. */\n readonly transport: ChatTransport\n /** Default model when the caller omits one. */\n readonly defaultModel?: string\n /** Total provider attempts this transport can make for one chat call. */\n readonly maximumAttempts?: number\n\n /** Implementations must enforce `req.maxTokens` when it is present. */\n chat(req: ChatRequest, opts?: ChatCallOpts): Promise<ChatResponse>\n}\n\n/** Judge model when neither caller nor client names one: one every model-restricted Router key may call. */\nexport const DEFAULT_JUDGE_MODEL = 'zai/glm-5.3'\n\nexport type ChatTransport =\n | 'sandbox-sdk' // box.streamPrompt() — chat completion via sandbox SDK\n | 'custom' // caller-adapted SDK or transport\n | 'openai-compatible' // caller-named /v1 endpoint, driven by this package\n | 'mock' // test-time injection\n\nexport interface ChatRequest extends Omit<LlmCallRequest, 'model'> {\n /** Optional — falls back to ChatClient.defaultModel. */\n model?: string\n}\n\nexport type ChatResponse = LlmCallResult\n\nexport interface ChatCallOpts {\n /** Cancel the in-flight request. */\n signal?: AbortSignal\n /** Hard USD ceiling for this single call (informational; the underlying transport may not enforce). */\n maxCostUsd?: number\n /** Correlation tag carried into request headers when the transport allows. */\n correlationId?: string\n /** Stable provider idempotency key for retries/redrives of one paid call. */\n idempotencyKey?: string\n}\n\n// ── Factory ─────────────────────────────────────────────────────────\n\nexport type CreateChatClientOpts =\n | SandboxSdkTransportOpts\n | CustomTransportOpts\n | OpenAiCompatibleTransportOpts\n | MockTransportOpts\n\ninterface BaseTransportOpts {\n defaultModel?: string\n /** Total provider attempts. Required for opaque transports used in capped runs. */\n maximumAttempts?: number\n}\n\n/**\n * Sandbox-SDK transport. The caller supplies a canonical chat function for an\n * already-configured Sandbox handle, so agent-eval does not import the SDK.\n */\nexport interface SandboxSdkTransportOpts extends BaseTransportOpts {\n transport: 'sandbox-sdk'\n chat: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>\n}\n\n/** Caller-adapted SDK or transport returning the canonical ChatResponse shape. */\nexport interface CustomTransportOpts extends BaseTransportOpts {\n transport: 'custom'\n chat: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>\n}\n\n/**\n * OpenAI-compatible HTTP transport: the caller names a `/v1` endpoint and\n * hands over a bearer, and this package drives `POST {baseUrl}/chat/completions`.\n *\n * Use this instead of hand-rolling a `custom` transport around `fetch`. The\n * result carries `servedModel` — the model id the provider echoed, verbatim —\n * which is the only field `assertServedModel` and `assertCrossFamilyServed`\n * can read to witness a gateway answering from a different model than the one\n * requested.\n *\n * `baseUrl` ends at the `/v1` prefix; the `/chat/completions` path is this\n * package's to append. A `baseUrl` that already carries the path is a\n * construction error, not a request to a doubled URL.\n *\n * Exactly one credential form is required — `apiKey`, `bearer`, or\n * `authHeader`. There is no environment fallback: agent-eval never goes\n * looking for a key.\n */\nexport interface OpenAiCompatibleTransportOpts\n extends BaseTransportOpts,\n Pick<\n LlmClientOptions,\n | 'assertServedModel'\n | 'customTokenPricing'\n | 'deadlineMs'\n | 'defaultTimeoutMs'\n | 'fetch'\n | 'jsonPayloadMode'\n | 'jsonSchemaTransport'\n | 'minIntervalMs'\n | 'provider'\n | 'rawSink'\n | 'signal'\n | 'thinking'\n > {\n transport: 'openai-compatible'\n /** Endpoint ending at the `/v1` prefix. Required — there is no default endpoint. */\n baseUrl: string\n /** Bearer credential. One of `apiKey`, `bearer`, or `authHeader` is required. */\n apiKey?: string\n /** Bearer credential, alternate spelling. */\n bearer?: string\n /** Non-bearer authorization header, for endpoints that want their own scheme. */\n authHeader?: { name: string; value: string }\n}\n\n/**\n * Mock transport for tests. The handler receives the request and returns\n * whatever the test wants. No retries, no JSON-schema degrade.\n */\nexport interface MockTransportOpts extends BaseTransportOpts {\n transport: 'mock'\n handler: (req: ChatRequest, opts?: ChatCallOpts) => Promise<ChatResponse>\n}\n\n/**\n * Build a ChatClient bound to a specific transport. The returned client\n * is safe to share across analysts in a single registry run.\n */\nexport function createChatClient(opts: CreateChatClientOpts): ChatClient {\n switch (opts.transport) {\n case 'sandbox-sdk':\n return {\n transport: 'sandbox-sdk',\n defaultModel: opts.defaultModel,\n maximumAttempts: opts.maximumAttempts,\n chat: async (req, callOpts) => opts.chat(resolveModel(req, opts.defaultModel), callOpts),\n }\n case 'custom':\n return {\n transport: 'custom',\n defaultModel: opts.defaultModel,\n maximumAttempts: opts.maximumAttempts,\n chat: async (req, callOpts) => opts.chat(resolveModel(req, opts.defaultModel), callOpts),\n }\n case 'openai-compatible':\n return openAiCompatibleClient(opts)\n case 'mock':\n return {\n transport: 'mock',\n defaultModel: opts.defaultModel,\n maximumAttempts: 1,\n chat: async (req, callOpts) => opts.handler(resolveModel(req, opts.defaultModel), callOpts),\n }\n }\n}\n\nfunction resolveModel(req: ChatRequest, defaultModel: string | undefined): ChatRequest {\n if (req.model) return req\n if (!defaultModel) {\n throw new Error(\n 'ChatClient.chat: no model on request and no defaultModel on the client. ' +\n 'Either pass req.model or bind defaultModel at createChatClient().',\n )\n }\n return { ...req, model: defaultModel }\n}\n\n/**\n * Build the OpenAI-compatible client, refusing a half-configured one first.\n *\n * Both refusals are construction-time on purpose. A missing credential or a\n * doubled path is a caller mistake that a request would turn into a 401 or a\n * 404 from an endpoint the caller did not intend to reach — the failure then\n * reads as a provider problem instead of a configuration one.\n */\nfunction openAiCompatibleClient(opts: OpenAiCompatibleTransportOpts): ChatClient {\n const baseUrl = opts.baseUrl?.trim().replace(/\\/+$/, '') ?? ''\n if (!baseUrl) {\n throw new Error(\n \"createChatClient({ transport: 'openai-compatible' }): baseUrl is required and has no default.\",\n )\n }\n if (/\\/chat\\/completions$/.test(baseUrl)) {\n throw new Error(\n \"createChatClient({ transport: 'openai-compatible' }): baseUrl ends at the /v1 prefix; \" +\n `this package appends /chat/completions. Got ${baseUrl}`,\n )\n }\n if (!opts.apiKey?.trim() && !opts.bearer?.trim() && !opts.authHeader) {\n throw new Error(\n \"createChatClient({ transport: 'openai-compatible' }): one of apiKey, bearer, or authHeader \" +\n 'is required. agent-eval reads no environment variable for a credential.',\n )\n }\n\n const clientOptions: LlmClientOptions = {\n baseUrl,\n ...(opts.apiKey ? { apiKey: opts.apiKey } : {}),\n ...(opts.bearer ? { bearer: opts.bearer } : {}),\n ...(opts.authHeader ? { authHeader: opts.authHeader } : {}),\n ...(opts.maximumAttempts === undefined ? {} : { maximumAttempts: opts.maximumAttempts }),\n ...(opts.assertServedModel === undefined ? {} : { assertServedModel: opts.assertServedModel }),\n ...(opts.customTokenPricing === undefined\n ? {}\n : { customTokenPricing: opts.customTokenPricing }),\n ...(opts.deadlineMs === undefined ? {} : { deadlineMs: opts.deadlineMs }),\n ...(opts.defaultTimeoutMs === undefined ? {} : { defaultTimeoutMs: opts.defaultTimeoutMs }),\n ...(opts.fetch === undefined ? {} : { fetch: opts.fetch }),\n ...(opts.jsonPayloadMode === undefined ? {} : { jsonPayloadMode: opts.jsonPayloadMode }),\n ...(opts.jsonSchemaTransport === undefined\n ? {}\n : { jsonSchemaTransport: opts.jsonSchemaTransport }),\n ...(opts.minIntervalMs === undefined ? {} : { minIntervalMs: opts.minIntervalMs }),\n ...(opts.provider === undefined ? {} : { provider: opts.provider }),\n ...(opts.rawSink === undefined ? {} : { rawSink: opts.rawSink }),\n ...(opts.signal === undefined ? {} : { signal: opts.signal }),\n ...(opts.thinking === undefined ? {} : { thinking: opts.thinking }),\n }\n const client = new LlmClient(clientOptions)\n\n return {\n transport: 'openai-compatible',\n ...(opts.defaultModel ? { defaultModel: opts.defaultModel } : {}),\n maximumAttempts: client.maximumAttempts,\n chat: async (req, callOpts) => {\n const resolved = resolveModel(req, opts.defaultModel)\n return client.call(resolved as LlmCallRequest, {\n ...(callOpts?.signal ? { signal: callOpts.signal } : {}),\n ...(callOpts?.idempotencyKey ? { idempotencyKey: callOpts.idempotencyKey } : {}),\n })\n },\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAa,sBAAsB;;;;;AAkHnC,SAAgB,iBAAiB,MAAwC;CACvE,QAAQ,KAAK,WAAb;EACE,KAAK,eACH,OAAO;GACL,WAAW;GACX,cAAc,KAAK;GACnB,iBAAiB,KAAK;GACtB,MAAM,OAAO,KAAK,aAAa,KAAK,KAAK,aAAa,KAAK,KAAK,YAAY,GAAG,QAAQ;EACzF;EACF,KAAK,UACH,OAAO;GACL,WAAW;GACX,cAAc,KAAK;GACnB,iBAAiB,KAAK;GACtB,MAAM,OAAO,KAAK,aAAa,KAAK,KAAK,aAAa,KAAK,KAAK,YAAY,GAAG,QAAQ;EACzF;EACF,KAAK,qBACH,OAAO,uBAAuB,IAAI;EACpC,KAAK,QACH,OAAO;GACL,WAAW;GACX,cAAc,KAAK;GACnB,iBAAiB;GACjB,MAAM,OAAO,KAAK,aAAa,KAAK,QAAQ,aAAa,KAAK,KAAK,YAAY,GAAG,QAAQ;EAC5F;CACJ;AACF;AAEA,SAAS,aAAa,KAAkB,cAA+C;CACrF,IAAI,IAAI,OAAO,OAAO;CACtB,IAAI,CAAC,cACH,MAAM,IAAI,MACR,2IAEF;CAEF,OAAO;EAAE,GAAG;EAAK,OAAO;CAAa;AACvC;;;;;;;;;AAUA,SAAS,uBAAuB,MAAiD;CAC/E,MAAM,UAAU,KAAK,SAAS,KAAK,CAAC,CAAC,QAAQ,QAAQ,EAAE,KAAK;CAC5D,IAAI,CAAC,SACH,MAAM,IAAI,MACR,+FACF;CAEF,IAA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9D,GAAI,KAAK,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ,KAAK,OAAO;EAC3D,GAAI,KAAK,aAAa,KAAA,IAAY,CAAC,IAAI,EAAE,UAAU,KAAK,SAAS;CACnE;CACA,MAAM,SAAS,IAAI,UAAU,aAAa;CAE1C,OAAO;EACL,WAAW;EACX,GAAI,KAAK,eAAe,EAAE,cAAc,KAAK,aAAa,IAAI,CAAC;EAC/D,iBAAiB,OAAO;EACxB,MAAM,OAAO,KAAK,aAAa;GAC7B,MAAM,WAAW,aAAa,KAAK,KAAK,YAAY;GACpD,OAAO,OAAO,KAAK,UAA4B;IAC7C,GAAI,UAAU,SAAS,EAAE,QAAQ,SAAS,OAAO,IAAI,CAAC;IACtD,GAAI,UAAU,iBAAiB,EAAE,gBAAgB,SAAS,eAAe,IAAI,CAAC;GAChF,CAAC;EACH;CACF;AACF"}
|
package/dist/cli.js
CHANGED
|
@@ -4,10 +4,10 @@ import { l as operatorYield, u as INSUFFICIENT_FROM } from "./pareto-UzjB3ZBk.js
|
|
|
4
4
|
import { i as replaySearchLedgerText } from "./search-ledger-9liYyZf5.js";
|
|
5
5
|
import { t as renderSearchSummary } from "./search-summary-CISbbxyr.js";
|
|
6
6
|
import { l as SEARCH_LEDGER_BATCH_MAX_BYTES, m as SearchRunKindSchema, r as shipSearchLedger, s as hostedTenantFromEnv, t as SearchShipConflictError } from "./search-shipper-B6tMNx1I.js";
|
|
7
|
-
import { n as createChatClient } from "./chat-client-
|
|
7
|
+
import { n as createChatClient } from "./chat-client-PJEzoot9.js";
|
|
8
8
|
import { a as privacyHit, f as harnessSessionRolloutLines, m as appendRolloutLines, n as runRolloutReleaseCli, p as gateReceiptRolloutLines, r as PRIVACY_RULE_NAMES, u as harnessSessionRefs } from "./hf-dataset-Bv114tzB.js";
|
|
9
9
|
import { t as runAnalystBenchmarkCommand } from "./benchmark-command-DRAHkn4D.js";
|
|
10
|
-
import { i as buildOpenApi, l as handleVersion, o as runRpcBatch, r as startServerAsync, s as runRpcOnce } from "./server-
|
|
10
|
+
import { i as buildOpenApi, l as handleVersion, o as runRpcBatch, r as startServerAsync, s as runRpcOnce } from "./server-BQbd__Hr.js";
|
|
11
11
|
import { b as editCreditText, f as landscape, g as surfaceTextEdits, l as metaSearch, m as formatLandscape, n as taskMatrix, o as skillManifold, r as formatSkillManifold, s as renderMetaSearchText, t as tree, v as front, y as editCredit } from "./tree-D2cNtu9m.js";
|
|
12
12
|
import { a as analyzeSupervisorRun, i as renderSupervisorRunMarkdown, r as renderSupervisorRunHeadline, t as runtimeRunRolloutLines } from "./runtime-rollouts-BNrm5nC_.js";
|
|
13
13
|
import { createHash } from "node:crypto";
|
|
@@ -528,8 +528,8 @@ interface ChatClient {
|
|
|
528
528
|
/** Implementations must enforce `req.maxTokens` when it is present. */
|
|
529
529
|
chat(req: ChatRequest, opts?: ChatCallOpts): Promise<ChatResponse>;
|
|
530
530
|
}
|
|
531
|
-
/** Judge model when neither caller nor client names one:
|
|
532
|
-
declare const DEFAULT_JUDGE_MODEL = "
|
|
531
|
+
/** Judge model when neither caller nor client names one: one every model-restricted Router key may call. */
|
|
532
|
+
declare const DEFAULT_JUDGE_MODEL = "zai/glm-5.3";
|
|
533
533
|
type ChatTransport = 'sandbox-sdk' | 'custom' | 'openai-compatible' | 'mock';
|
|
534
534
|
interface ChatRequest extends Omit<LlmCallRequest, 'model'> {
|
|
535
535
|
/** Optional — falls back to ChatClient.defaultModel. */
|
|
@@ -848,4 +848,4 @@ interface PlaceboBandResult {
|
|
|
848
848
|
}
|
|
849
849
|
declare function placeboBand<T>(history: readonly T[], options: PlaceboBandOptions<T>): PlaceboBandResult;
|
|
850
850
|
export { InMemoryRawProviderSink as $, ChatResponse as A, LlmCallRequest as B, ScenarioFile as C, ChatCallOpts as D, TurnResult as E, MockTransportOpts as F, LlmThinkingMode as G, LlmChargeBounds as H, OpenAiCompatibleTransportOpts as I, LlmToolChoice as J, LlmTokenLogprob as K, SandboxSdkTransportOpts as L, CreateChatClientOpts as M, CustomTransportOpts as N, ChatClient as O, DEFAULT_JUDGE_MODEL as P, FileSystemRawProviderSinkOptions as Q, createChatClient as R, RubricDimension as S, judgeFamily as St, Turn as T, LlmClientOptions as U, LlmCallResult as V, LlmMessage as W, LlmUsage as X, LlmToolDefinition as Y, FileSystemRawProviderSink as Z, JudgeRubric as _, describeServedModelCheck as _t, PlaceboBandResult as a, RawProviderSink as at, ProductScenario as b, JudgeFamily as bt, ArtifactCheck as c, AssertServedModelOptions as ct, CollectedArtifacts as d, ServedModelPolicy as dt, InMemoryRawProviderSinkOptions as et, CompletionCriterion as f, ServedModelVerdict as ft, JudgeInput as g, checkServedModel as gt, JudgeFn as h, assertServedModels as ht, PlaceboBandOptions as i, RawProviderEvent as it, ChatTransport as j, ChatRequest as k, ArtifactResult as l, ModelSubstitutionError as lt, DriverState as m, assertServedModel as mt, ClusterResampleOptions as n, ProviderRedactor as nt, clusterBootstrap as o, RawProviderSinkFilter as ot, DimensionJudgeScore as p, assertCrossFamilyServed as pt, LlmToolCall as q, DEFAULT_BOOTSTRAP_SEED as r, RawProviderDirection as rt, placeboBand as s, AssertCrossFamilyServedOptions as st, BootstrapInterval as t, NoopRawProviderSink as tt, CheckResult as u, ServedModelCheck as ut, PersonaConfig as v, AssertCrossFamilyOptions as vt, ScenarioResult as w, RouteMap as x, assertCrossFamily as xt, ProductClientConfig as y, CrossFamilyError as yt, LlmCallMetadata as z };
|
|
851
|
-
//# sourceMappingURL=cluster-
|
|
851
|
+
//# sourceMappingURL=cluster-CSd0LE_M.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cluster-
|
|
1
|
+
{"version":3,"file":"cluster-CSd0LE_M.d.ts","names":[],"sources":["../src/judge-families.ts","../src/integrity/served-model.ts","../src/trace/raw-provider-sink.ts","../src/llm-client/contract.ts","../src/analyst/chat-client.ts","../src/types.ts","../src/statistics/cluster.ts"],"mappings":";;;;;;;;;;;;KAWY;;;;;;;iB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;EACV,OAAO;EACP,WAAW;;EAEX,aAAa;EACb;EACA,WAAW;EACX,SAAS;;KAGC,WAAW,MAAM,YAAY,OAAO,eAAe,QAAQ;UAMtD;EACf;EACA;EACA;EACA;;cC5NW;KACD;EAAsB;EAAa;EAAc;EAAmB;;UAC/D,uBAAuB;EACtC;EACA;EACA;;EAEA,UAAU,MAAM,GAAG;;;iBAIL,iBAAiB,GAC/B,gBAAgB,KAChB,UAAU,MAAM,GAAG,0BACnB,YAAY,QAAQ,kBAElB,WACA,MACA,OACA,WACC,uBAAuB,KACzB;UA2Cc,mBAAmB;;EAElC,YAAY,KAAK;EACjB,UAAU,KAAK;;EAEf,YAAY,QAAQ,KAAK,OAAO;EAChC;EACA;;EAEA;;EAEA;;UAEe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;iBAGc,YAAY,GAC1B,kBAAkB,KAClB,SAAS,mBAAmB,KAC3B"}
|
|
@@ -2,7 +2,7 @@ import { t as CostLedger } from "./cost-ledger-1CwUnVOd.js";
|
|
|
2
2
|
import { n as recoverTruncatedJson } from "./json-recovery-DK4MDm5r.js";
|
|
3
3
|
import { t as certificationEvidenceDigest } from "./verdict-C8TcdwfD.js";
|
|
4
4
|
import { a as maximumChargeForLlmRequest, c as ModelSubstitutionError, i as costReceiptFromLlmError, r as costReceiptFromLlm, u as assertServedModel } from "./llm-client-Bj-TooRS.js";
|
|
5
|
-
import "./chat-client-
|
|
5
|
+
import "./chat-client-PJEzoot9.js";
|
|
6
6
|
import { t as JudgeParseError } from "./judges-BLxg5p8E.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
// src/completion-verifier.ts
|
|
@@ -275,7 +275,7 @@ function parseCorrectnessResponse(raw) {
|
|
|
275
275
|
* fulfil a requirement — the artifact must BE the deliverable.
|
|
276
276
|
*/
|
|
277
277
|
function createLlmCorrectnessChecker(chat, opts = {}) {
|
|
278
|
-
const model = opts.model ?? "
|
|
278
|
+
const model = opts.model ?? "zai/glm-5.3";
|
|
279
279
|
const maxContentChars = opts.maxContentChars ?? 8e3;
|
|
280
280
|
const maxAttempts = opts.maxAttempts ?? 2;
|
|
281
281
|
const costLedger = opts.costLedger ?? new CostLedger();
|
|
@@ -386,4 +386,4 @@ function createLlmCorrectnessChecker(chat, opts = {}) {
|
|
|
386
386
|
}
|
|
387
387
|
export { createLlmCorrectnessChecker as n, verifyCompletion as r, completionVerdict as t };
|
|
388
388
|
|
|
389
|
-
//# sourceMappingURL=completion-verifier-
|
|
389
|
+
//# sourceMappingURL=completion-verifier-DVZx0x6x.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion-verifier-BYLOcQt7.js","names":[],"sources":["../src/completion-verifier.ts"],"sourcesContent":["/**\n * Completion verifier — the task-completion oracle.\n *\n * Answers the only eval question that is not a proxy: did the agent actually\n * COMPLETE the task — produce every required deliverable, persisted and\n * correct — rather than describe what should be done. A fluent transcript\n * that never produces the artifact scores zero here.\n *\n * Per requirement, a two-stage check:\n * 1. Structural — a produced item (vault artifact / approved proposal /\n * tool call) of the right kind is matched against the requirement and\n * carries non-empty content. Deterministic; no LLM.\n * 2. Correctness — only if structurally present AND the matched item\n * carries content, one targeted check decides whether that item\n * actually fulfils the requirement. A hallucinated artifact fails here;\n * an absent one already failed stage 1.\n *\n * `completionRate` is satisfied / MEASURABLE requirements (unmeasured rows —\n * checker failures — are excluded from the denominator, never scored as\n * zeros). Quality dimensions are meaningless on an incomplete task — callers\n * gate on `fullyComplete` / `completionRate` before scoring quality.\n */\n\nimport { randomUUID } from 'node:crypto'\nimport { type ChatClient, type ChatRequest, DEFAULT_JUDGE_MODEL } from './analyst/chat-client'\nimport type { ValidatedArtifact } from './artifact-validator'\nimport { CostLedger, type CostLedgerHandle } from './cost-ledger'\nimport { assertServedModel, ModelSubstitutionError } from './integrity/served-model'\nimport { recoverTruncatedJson } from './json-recovery'\nimport { JudgeParseError } from './judges'\nimport {\n costReceiptFromLlm,\n costReceiptFromLlmError,\n maximumChargeForLlmRequest,\n} from './llm-client'\nimport type { RawProviderEvent, RawProviderSink } from './trace/raw-provider-sink'\nimport {\n certificationEvidenceDigest,\n type DefaultVerdict,\n type VerdictCertification,\n} from './verdict'\nimport type { CheckerIdentity, VerificationStrategySource } from './verification-strategy'\n\n/** What kind of produced state can satisfy a requirement structurally. */\nexport type SatisfiedBy = 'artifact' | 'proposal' | 'tool-call' | 'any'\n\nexport interface CompletionRequirement {\n /** Stable id from the task gold (e.g. a persona's `expected_requirements[].req_id`). */\n reqId: string\n /** Human-readable description of the required deliverable. */\n title: string\n /** Optional kind/category hint, matched against a produced item's kind. */\n category?: string\n /** What produced state satisfies this requirement. Defaults to 'any'. */\n satisfiedBy?: SatisfiedBy\n}\n\nexport interface TaskGold {\n taskId: string\n requirements: CompletionRequirement[]\n}\n\nexport interface ProducedProposal {\n id: string\n title: string\n status: 'pending' | 'approved' | 'rejected'\n /** Optional persisted body — when present, enables a correctness check. */\n content?: string\n}\n\n/** Everything observable about what a run actually produced. */\nexport interface ProducedState {\n /** Persisted vault artifacts. Reuses the shared `ValidatedArtifact` shape. */\n artifacts: ValidatedArtifact[]\n /** Proposals / filings the agent created. */\n proposals: ProducedProposal[]\n /** Names of tools the agent invoked. */\n toolCalls: string[]\n}\n\nexport interface RequirementCheck {\n reqId: string\n title: string\n /** A produced item of the right kind matched the requirement, non-empty. */\n structurallyPresent: boolean\n /**\n * Whether the matched item actually fulfils the requirement. `null` when\n * not structurally present, when the matched item carries no content\n * to assess, or when the correctness check itself failed (`unmeasured`).\n */\n correct: boolean | null\n /** structurallyPresent && !unmeasured && correct !== false. */\n satisfied: boolean\n /**\n * Set when the correctness check itself errored (LLM call failure or an\n * unparseable response after retry). The requirement's fulfilment is\n * UNKNOWN — `correct` stays null, `satisfied` is false, and\n * `completionVerdict` excludes the row from `completionRate`'s\n * denominator. Never folded into a zero: a synthetic zero is\n * indistinguishable from a real failure (see `JudgeParseError`).\n */\n unmeasured?: true\n /** Why the correctness check could not be measured (present iff `unmeasured`). */\n unmeasuredReason?: string\n /** Human-readable evidence for the verdict. */\n evidence: string[]\n}\n\n/** Extends the substrate verdict spine: `valid` = `fullyComplete` and\n * `score` = `completionRate` — derived in `completionVerdict()`, the one\n * place those equalities hold by construction. */\nexport interface CompletionVerdict extends DefaultVerdict {\n taskId: string\n requirements: RequirementCheck[]\n /** satisfied / MEASURABLE requirements (unmeasured rows leave the denominator). */\n completionRate: number\n /** Every measurable requirement satisfied (false when anything is unmeasured). */\n fullyComplete: boolean\n /** Requirements whose correctness check errored — reported, never scored as zero. */\n unmeasuredCount: number\n}\n\n/**\n * Construct a `CompletionVerdict` from the per-requirement checks, deriving\n * `completionRate` / `fullyComplete` and the spine fields (`valid` =\n * `fullyComplete`, `score` = `completionRate`) in one place. Throws on zero\n * requirements — a verdict over nothing is a misconfiguration, mirroring\n * `verifyCompletion`'s gold-spec guard.\n */\nexport function completionVerdict(input: {\n taskId: string\n requirements: RequirementCheck[]\n /** What certified the correctness stage, when anything did. Omitted =\n * an uncertified verdict — the honest default for a bare checker. */\n certification?: VerdictCertification\n}): CompletionVerdict {\n if (input.requirements.length === 0) {\n throw new Error(\n `completionVerdict: task '${input.taskId}' has no requirement checks — nothing to derive a verdict from`,\n )\n }\n const measurable = input.requirements.filter((r) => !r.unmeasured)\n const unmeasuredCount = input.requirements.length - measurable.length\n if (measurable.length === 0) {\n // Every check errored: this is an infrastructure failure, not a scored\n // run. A 0-rate verdict here would be a fabricated measurement.\n throw new Error(\n `completionVerdict: task '${input.taskId}' has no measurable requirements — all ${input.requirements.length} correctness checks failed (${input.requirements[0]?.unmeasuredReason ?? 'unknown reason'})`,\n )\n }\n const satisfiedCount = measurable.filter((r) => r.satisfied).length\n const completionRate = satisfiedCount / measurable.length\n // A run with unmeasured rows can still report a rate over what WAS\n // measured, but must not claim full completion.\n const fullyComplete = unmeasuredCount === 0 && satisfiedCount === measurable.length\n return {\n taskId: input.taskId,\n requirements: input.requirements,\n completionRate,\n fullyComplete,\n unmeasuredCount,\n valid: fullyComplete,\n score: completionRate,\n ...(input.certification === undefined ? {} : { certification: input.certification }),\n }\n}\n\n/**\n * What a correctness checker declares about itself so the completion\n * verdict can carry a certification: which strategy member it discharges,\n * its exact identity, and the steps its answers rest on unverified.\n */\nexport interface CorrectnessCheckerAttestation {\n strategy: VerificationStrategySource\n checker: CheckerIdentity\n assumptions: string[]\n}\n\n/**\n * Decides whether a produced item's content actually fulfils a requirement.\n * Injected so the structural verifier stays pure and unit-testable; the\n * production implementation is `createLlmCorrectnessChecker`.\n *\n * `attestation` is optional metadata on the function value: a checker that\n * carries one yields certified completion verdicts; a bare function yields\n * the same verdict uncertified. A plain arrow function remains a valid\n * checker.\n */\nexport interface CorrectnessChecker {\n (\n requirement: CompletionRequirement,\n content: string,\n ): Promise<{ correct: boolean; reason: string }>\n attestation?: CorrectnessCheckerAttestation\n}\n\nconst STOPWORDS = new Set([\n 'the',\n 'a',\n 'an',\n 'of',\n 'for',\n 'and',\n 'or',\n 'to',\n 'in',\n 'on',\n 'with',\n 'by',\n])\n\n// Deliverable-FORM vocabulary — words that name the SHAPE of an output, not its\n// domain content. A correct \"swap-comparison view persisted as a ui/** artifact\"\n// is an OpenUI JSON whose body says nothing about \"artifact\" / \"persisted\" /\n// \"view\"; the discriminative tokens are the domain nouns (swap, comparison).\n// Stripped from the REQUIREMENT side of structural recall so a deliverable is\n// matched on what it IS about, not on the boilerplate describing its form. The\n// correctness checker strips the same class via TITLE_STOPWORDS. Anti-game holds:\n// the distinctive domain tokens remain, so an off-topic item still fails.\nconst REQUIREMENT_FORM_STOPWORDS = new Set([\n 'generated',\n 'generate',\n 'view',\n 'render',\n 'rendered',\n 'persisted',\n 'persist',\n 'artifact',\n 'file',\n 'document',\n 'note',\n 'proposal',\n 'deliverable',\n 'output',\n 'created',\n 'create',\n 'produce',\n 'produced',\n 'flag',\n])\n\nconst MATCH_THRESHOLD = 0.5\nconst MIN_CONTENT_CHARS = 50\n\nfunction tokens(s: string, extraStop?: Set<string>): Set<string> {\n return new Set(\n s\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter((t) => t.length > 1 && !STOPWORDS.has(t) && !extraStop?.has(t)),\n )\n}\n\n/**\n * Recall of the requirement's tokens within a candidate's identifying text.\n * Recall, not Jaccard — a candidate's path/id legitimately carries extra\n * tokens the requirement does not name. The requirement side drops\n * deliverable-FORM vocabulary so recall keys on the distinctive domain tokens.\n */\nfunction tokenRecall(requirementText: string, candidateText: string): number {\n const req = tokens(requirementText, REQUIREMENT_FORM_STOPWORDS)\n if (req.size === 0) return 0\n const cand = tokens(candidateText)\n let hit = 0\n for (const t of req) if (cand.has(t)) hit++\n return hit / req.size\n}\n\ninterface Candidate {\n reqIndex: number\n /** Unique key for a produced item — each item satisfies at most one requirement. */\n itemKey: string\n score: number\n evidence: string\n /** Content to correctness-check, or null when the matched item has none. */\n content: string | null\n}\n\nfunction artifactCandidates(\n req: CompletionRequirement,\n reqIndex: number,\n artifacts: ValidatedArtifact[],\n): Candidate[] {\n const reqText = `${req.title} ${req.category ?? ''}`\n const out: Candidate[] = []\n artifacts.forEach((a, i) => {\n if ((a.content ?? '').trim().length < MIN_CONTENT_CHARS) return\n // Match against the artifact CONTENT too, not just its path + kind — a\n // generated view / note whose path is generic still satisfies a requirement\n // when its body covers it (e.g. an OpenUI comparison grounded in the on-file\n // figures). Bounded slice keeps the recall text cheap; MATCH_THRESHOLD holds.\n let score = tokenRecall(\n reqText,\n `${a.path ?? ''} ${a.kind} ${(a.content ?? '').slice(0, 4000)}`,\n )\n if (req.category && a.kind && req.category.toLowerCase() === a.kind.toLowerCase()) {\n score = Math.max(score, 1)\n }\n if (score < MATCH_THRESHOLD) return\n out.push({\n reqIndex,\n itemKey: `artifact:${i}`,\n score,\n evidence: `artifact '${a.path ?? a.kind}' matched (token recall ${score.toFixed(2)})`,\n content: a.content ?? null,\n })\n })\n return out\n}\n\nfunction proposalCandidates(\n req: CompletionRequirement,\n reqIndex: number,\n proposals: ProducedProposal[],\n): Candidate[] {\n const reqText = `${req.title} ${req.category ?? ''}`\n const out: Candidate[] = []\n for (const p of proposals) {\n // Pending or rejected work is not a completed deliverable.\n if (p.status !== 'approved') continue\n // A proposal needs an assessable BODY to be a deliverable. A bare title is\n // not completion: correctness cannot be judged on it, so a title-only match\n // would auto-pass the oracle (structurallyPresent && correct===null →\n // satisfied) with no verifiable content. Tool calls are the only\n // legitimately content-less deliverable (`toolCallCandidates`).\n const body = (p.content ?? '').trim()\n if (body.length < MIN_CONTENT_CHARS) continue\n // Match against the body as well as the (often short) title — a refusal /\n // flag / analysis proposal whose title is a label still satisfies a\n // descriptively-worded requirement when its content covers it. MATCH_THRESHOLD\n // + the requirement's distinctive tokens keep an off-topic proposal out;\n // correctness (a SEMANTIC checker, NOT this lexical pass) then judges\n // polarity/fulfilment, so a negation that merely contains the tokens fails.\n // Structural and correctness must use different evidence or the two-stage\n // check collapses to one lexical gate.\n const score = tokenRecall(reqText, `${p.title} ${body}`)\n if (score < MATCH_THRESHOLD) continue\n out.push({\n reqIndex,\n itemKey: `proposal:${p.id}`,\n score,\n evidence: `approved proposal '${p.title}' matched (token recall ${score.toFixed(2)})`,\n content: body,\n })\n }\n return out\n}\n\nfunction toolCallCandidates(\n req: CompletionRequirement,\n reqIndex: number,\n toolCalls: string[],\n): Candidate[] {\n const out: Candidate[] = []\n toolCalls.forEach((name, i) => {\n const score = tokenRecall(req.title, name)\n if (score < MATCH_THRESHOLD) return\n out.push({\n reqIndex,\n itemKey: `tool:${i}`,\n score,\n evidence: `tool call '${name}' matched (token recall ${score.toFixed(2)})`,\n content: null,\n })\n })\n return out\n}\n\n/**\n * Verify whether a run completed the task. `checkCorrectness` is injected —\n * `createLlmCorrectnessChecker` for production, a deterministic stub in tests.\n *\n * Throws on a gold spec with no requirements: an eval task that requires\n * nothing is a misconfiguration, not a vacuously-complete task.\n */\nexport async function verifyCompletion(\n gold: TaskGold,\n state: ProducedState,\n checkCorrectness: CorrectnessChecker,\n): Promise<CompletionVerdict> {\n if (gold.requirements.length === 0) {\n throw new Error(\n `verifyCompletion: task '${gold.taskId}' has no requirements — malformed gold spec`,\n )\n }\n\n // Collect every above-threshold (requirement, produced-item) candidate, then\n // assign greedily by descending score: each requirement and each produced\n // item is used at most once. One deliverable fulfils one requirement.\n const candidates: Candidate[] = []\n gold.requirements.forEach((req, i) => {\n const by = req.satisfiedBy ?? 'any'\n if (by === 'artifact' || by === 'any') {\n candidates.push(...artifactCandidates(req, i, state.artifacts))\n }\n if (by === 'proposal' || by === 'any') {\n candidates.push(...proposalCandidates(req, i, state.proposals))\n }\n if (by === 'tool-call' || by === 'any') {\n candidates.push(...toolCallCandidates(req, i, state.toolCalls))\n }\n })\n candidates.sort((a, b) => b.score - a.score)\n\n const assigned = new Map<number, Candidate>()\n const itemTaken = new Set<string>()\n for (const c of candidates) {\n if (assigned.has(c.reqIndex) || itemTaken.has(c.itemKey)) continue\n assigned.set(c.reqIndex, c)\n itemTaken.add(c.itemKey)\n }\n\n const requirements: RequirementCheck[] = []\n for (let i = 0; i < gold.requirements.length; i++) {\n const req = gold.requirements[i]!\n const match = assigned.get(i)\n const evidence: string[] = []\n let correct: boolean | null = null\n let unmeasuredReason: string | undefined\n\n if (match) {\n evidence.push(match.evidence)\n if (match.content !== null) {\n try {\n const r = await checkCorrectness(req, match.content)\n correct = r.correct\n evidence.push(`correctness: ${r.correct ? 'pass' : 'fail'} — ${r.reason}`)\n } catch (err) {\n // The CHECKER failed, not the requirement. Recording this as a\n // zero would fabricate a model failure out of an infrastructure\n // one; the requirement is unmeasured and leaves the denominator.\n unmeasuredReason =\n err instanceof JudgeParseError\n ? `checker response unparseable after retry: ${err.raw.slice(0, 200)}`\n : `checker call failed: ${err instanceof Error ? err.message : String(err)}`\n evidence.push(`correctness: UNMEASURED — ${unmeasuredReason}`)\n }\n } else {\n evidence.push('correctness: not assessed — matched item carries no content')\n }\n } else {\n const by = req.satisfiedBy ?? 'any'\n const kind = by === 'any' ? 'artifact/proposal/tool-call' : by\n evidence.push(`no produced ${kind} matched this requirement`)\n }\n\n const structurallyPresent = match !== undefined\n const unmeasured = unmeasuredReason !== undefined\n const satisfied = structurallyPresent && !unmeasured && correct !== false\n requirements.push({\n reqId: req.reqId,\n title: req.title,\n structurallyPresent,\n correct,\n satisfied,\n ...(unmeasured ? { unmeasured: true as const, unmeasuredReason } : {}),\n evidence,\n })\n }\n\n // The verdict blends the deterministic structural stage with the injected\n // correctness stage, so the certification names the checker's own member\n // and carries the structural stage's lexical nature as an assumption. A\n // checker without an attestation yields an uncertified verdict.\n const attestation = checkCorrectness.attestation\n const certification: VerdictCertification | undefined = attestation\n ? {\n strategy: attestation.strategy,\n checker: attestation.checker,\n assumptions: [\n 'structural matching is lexical token recall over produced items — the correctness stage only sees items it matched',\n ...attestation.assumptions,\n ],\n evidenceDigest: certificationEvidenceDigest({ taskId: gold.taskId, requirements }),\n }\n : undefined\n\n return completionVerdict({\n taskId: gold.taskId,\n requirements,\n ...(certification === undefined ? {} : { certification }),\n })\n}\n\nexport interface LlmCorrectnessCheckerOpts {\n /** Judge model. Default `DEFAULT_JUDGE_MODEL`, never the client's default, which may be the agent under test. */\n model?: string\n /** Optional ledger for direct use. */\n costLedger?: CostLedgerHandle\n costPhase?: string\n costTags?: Record<string, string>\n signal?: AbortSignal\n /** Max chars of artifact content sent to the checker. */\n maxContentChars?: number\n /**\n * Checker LLM calls per requirement before giving up (parse failures and\n * call errors both consume attempts). The failure then surfaces as an\n * `unmeasured` requirement, never a zero.\n */\n maxAttempts?: number\n /**\n * Forensic capture of every checker request/response/error — without it a\n * checker failure is unauditable (the agent-turn raws never contain the\n * checker's own calls). Same sink contract as `LlmClient`.\n */\n rawSink?: RawProviderSink\n}\n\n/**\n * Parse the correctness checker's model response. Tolerates a response\n * truncated mid-JSON (max_tokens cap) by auto-closing the prefix — the\n * verdict boolean usually lands in the first few tokens, so a recovered\n * prefix with a boolean `correct` is a real measurement, not a guess.\n * Fails loud (JudgeParseError) when no boolean verdict is recoverable.\n */\nfunction parseCorrectnessResponse(raw: string): { correct: boolean; reason: string } {\n const readVerdict = (candidate: unknown): { correct: boolean; reason: string } | null => {\n if (candidate === null || typeof candidate !== 'object') return null\n const { correct, reason } = candidate as { correct?: unknown; reason?: unknown }\n if (typeof correct !== 'boolean') return null\n return { correct, reason: typeof reason === 'string' ? reason : '' }\n }\n\n const match = raw.match(/\\{[\\s\\S]*\\}/)\n if (match) {\n try {\n const strict = readVerdict(JSON.parse(match[0]))\n if (strict) return strict\n } catch {\n // fall through to truncation recovery\n }\n }\n // The strict path needs a closing `}`; a cap-hit response has none. Take\n // everything from the first `{` and auto-close it.\n const start = raw.indexOf('{')\n if (start !== -1) {\n const recovered = readVerdict(recoverTruncatedJson(raw.slice(start)))\n if (recovered) return recovered\n }\n throw new JudgeParseError('correctness-checker', raw)\n}\n\n/**\n * Production `CorrectnessChecker` — one LLM call per matched artifact,\n * deterministic (temperature 0), structured JSON out. Judges fulfilment\n * only: a plan, a gesture, or a description of what should be done does not\n * fulfil a requirement — the artifact must BE the deliverable.\n */\nexport function createLlmCorrectnessChecker(\n chat: ChatClient,\n opts: LlmCorrectnessCheckerOpts = {},\n): CorrectnessChecker {\n const model = opts.model ?? DEFAULT_JUDGE_MODEL\n const maxContentChars = opts.maxContentChars ?? 8000\n const maxAttempts = opts.maxAttempts ?? 2\n const costLedger = opts.costLedger ?? new CostLedger()\n const sink = opts.rawSink\n const record = async (event: RawProviderEvent): Promise<void> => {\n // Forensic capture is best-effort; the verdict is the system of record.\n try {\n await sink?.record(event)\n } catch {\n // Intentionally swallowed.\n }\n }\n const checker: CorrectnessChecker = async (requirement, content) => {\n const request = {\n model,\n messages: [\n {\n role: 'system' as const,\n content:\n 'You verify whether a produced work artifact actually fulfils a stated requirement. Judge fulfilment only — is the deliverable substantively present and on-point — not polish. A plan to do it later, a vague gesture, or a description of what should be done does NOT fulfil a requirement; the artifact must BE the deliverable. Respond with a single JSON object: {\"correct\": boolean, \"reason\": string (<= 30 words)}.',\n },\n {\n role: 'user' as const,\n content: `Requirement: ${requirement.title}\\n${\n requirement.category ? `Category: ${requirement.category}\\n` : ''\n }\\nProduced artifact:\\n${content.slice(0, maxContentChars)}`,\n },\n ],\n temperature: 0,\n maxTokens: 200,\n } satisfies ChatRequest\n let lastErr: unknown\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n const started = Date.now()\n await record({\n eventId: randomUUID(),\n provider: chat.transport,\n model,\n endpoint: '/chat',\n baseUrl: '',\n attemptIndex: attempt,\n direction: 'request',\n timestamp: started,\n requestBody: request,\n redactedFields: [],\n })\n try {\n const paid = await costLedger.runPaidCall({\n channel: 'verifier',\n phase: opts.costPhase ?? 'completion.correctness',\n actor: 'correctness-checker',\n model,\n maximumCharge:\n chat.maximumAttempts === undefined\n ? undefined\n : maximumChargeForLlmRequest(request, { maximumAttempts: chat.maximumAttempts }),\n tags: {\n ...opts.costTags,\n requirementId: requirement.reqId,\n attempt: String(attempt),\n },\n signal: opts.signal,\n execute: (signal, callId) => chat.chat(request, { signal, idempotencyKey: callId }),\n receipt: costReceiptFromLlm,\n receiptFromError: costReceiptFromLlmError,\n })\n if (!paid.succeeded) throw paid.error\n const resp = paid.value\n // Hold the transport to its own word: a verdict produced by a model\n // other than the one requested is not this model's verdict. A\n // transport that echoes no id cannot be made to prove identity here —\n // callers needing that proof enable it at the client\n // (`LlmClientOptions.assertServedModel`) or gate on `assertModelsServed`.\n assertServedModel(model, resp.servedModel, {\n allowUnreported: true,\n context: `correctness checker for requirement ${requirement.reqId}`,\n })\n const raw = resp.content\n await record({\n eventId: randomUUID(),\n provider: chat.transport,\n model,\n endpoint: '/chat',\n baseUrl: '',\n attemptIndex: attempt,\n direction: 'response',\n timestamp: Date.now(),\n durationMs: Date.now() - started,\n responseBody: resp,\n redactedFields: [],\n })\n return parseCorrectnessResponse(raw)\n } catch (err) {\n lastErr = err\n await record({\n eventId: randomUUID(),\n provider: chat.transport,\n model,\n endpoint: '/chat',\n baseUrl: '',\n attemptIndex: attempt,\n direction: 'error',\n timestamp: Date.now(),\n durationMs: Date.now() - started,\n errorMessage: err instanceof Error ? err.message : String(err),\n redactedFields: [],\n })\n // Substitution is a verdict about identity, not a transient fault:\n // another attempt reaches the same wrong model and spends more tokens.\n if (err instanceof ModelSubstitutionError) throw err\n }\n }\n throw lastErr instanceof Error ? lastErr : new Error(String(lastErr))\n }\n checker.attestation = {\n strategy: 'judge',\n checker: { name: 'llm-correctness-checker', version: model },\n assumptions: [\n 'served-model identity is accepted when the transport reports none (assertServedModel allowUnreported)',\n ],\n }\n return checker\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiIA,SAAgB,kBAAkB,OAMZ;CACpB,IAAI,MAAM,aAAa,WAAW,GAChC,MAAM,IAAI,MACR,4BAA4B,MAAM,OAAO,+DAC3C;CAEF,MAAM,aAAa,MAAM,aAAa,QAAQ,MAAM,CAAC,EAAE,UAAU;CACjE,MAAM,kBAAkB,MAAM,aAAa,SAAS,WAAW;CAC/D,IAAI,WAAW,WAAW,GAGxB,MAAM,IAAI,MACR,4BAA4B,MAAM,OAAO,yCAAyC,MAAM,aAAa,OAAO,8BAA8B,MAAM,aAAa,EAAE,EAAE,oBAAoB,iBAAiB,EACxM;CAEF,MAAM,iBAAiB,WAAW,QAAQ,MAAM,EAAE,SAAS,CAAC,CAAC;CAC7D,MAAM,iBAAiB,iBAAiB,WAAW;CAGnD,MAAM,gBAAgB,oBAAoB,KAAK,mBAAmB,WAAW;CAC7E,OAAO;EACL,QAAQ,MAAM;EACd,cAAc,MAAM;EACpB;EACA;EACA;EACA,OAAO;EACP,OAAO;EACP,GAAI,MAAM,kBAAkB,KAAA,IAAY,CAAC,IAAI,EAAE,eAAe,MAAM,cAAc;CACpF;AACF;AA+BA,MAAM,4BAAY,IAAI,IAAI;CACxB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAUD,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AAK;IAChC,MAAM,OAAO,KAAK;IAMlB,kBAAkB,OAAO,KAAK,aAAa;KACzC,iBAAiB;KACjB,SAAS,uCAAuC,YAAY;IAC9D,CAAC;IACD,MAAM,MAAM,KAAK;IACjB,MAAM,OAAO;KACX,SAAS,WAAW;KACpB,UAAU,KAAK;KACf;KACA,UAAU;KACV,SAAS;KACT,cAAc;KACd,WAAW;KACX,WAAW,KAAK,IAAI;KACpB,YAAY,KAAK,IAAI,IAAI;KACzB,cAAc;KACd,gBAAgB,CAAC;IACnB,CAAC;IACD,OAAO,yBAAyB,GAAG;GACrC,SAAS,KAAK;IACZ,UAAU;IACV,MAAM,OAAO;KACX,SAAS,WAAW;KACpB,UAAU,KAAK;KACf;KACA,UAAU;KACV,SAAS;KACT,cAAc;KACd,WAAW;KACX,WAAW,KAAK,IAAI;KACpB,YAAY,KAAK,IAAI,IAAI;KACzB,cAAc,eAAe,QAAQ,IAAI,UAAU,OAAO,GAAG;KAC7D,gBAAgB,CAAC;IACnB,CAAC;IAGD,IAAI,eAAe,wBAAwB,MAAM;GACnD;EACF;EACA,MAAM,mBAAmB,QAAQ,UAAU,IAAI,MAAM,OAAO,OAAO,CAAC;CACtE;CACA,QAAQ,cAAc;EACpB,UAAU;EACV,SAAS;GAAE,MAAM;GAA2B,SAAS;EAAM;EAC3D,aAAa,CACX,uGACF;CACF;CACA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"completion-verifier-DVZx0x6x.js","names":[],"sources":["../src/completion-verifier.ts"],"sourcesContent":["/**\n * Completion verifier — the task-completion oracle.\n *\n * Answers the only eval question that is not a proxy: did the agent actually\n * COMPLETE the task — produce every required deliverable, persisted and\n * correct — rather than describe what should be done. A fluent transcript\n * that never produces the artifact scores zero here.\n *\n * Per requirement, a two-stage check:\n * 1. Structural — a produced item (vault artifact / approved proposal /\n * tool call) of the right kind is matched against the requirement and\n * carries non-empty content. Deterministic; no LLM.\n * 2. Correctness — only if structurally present AND the matched item\n * carries content, one targeted check decides whether that item\n * actually fulfils the requirement. A hallucinated artifact fails here;\n * an absent one already failed stage 1.\n *\n * `completionRate` is satisfied / MEASURABLE requirements (unmeasured rows —\n * checker failures — are excluded from the denominator, never scored as\n * zeros). Quality dimensions are meaningless on an incomplete task — callers\n * gate on `fullyComplete` / `completionRate` before scoring quality.\n */\n\nimport { randomUUID } from 'node:crypto'\nimport { type ChatClient, type ChatRequest, DEFAULT_JUDGE_MODEL } from './analyst/chat-client'\nimport type { ValidatedArtifact } from './artifact-validator'\nimport { CostLedger, type CostLedgerHandle } from './cost-ledger'\nimport { assertServedModel, ModelSubstitutionError } from './integrity/served-model'\nimport { recoverTruncatedJson } from './json-recovery'\nimport { JudgeParseError } from './judges'\nimport {\n costReceiptFromLlm,\n costReceiptFromLlmError,\n maximumChargeForLlmRequest,\n} from './llm-client'\nimport type { RawProviderEvent, RawProviderSink } from './trace/raw-provider-sink'\nimport {\n certificationEvidenceDigest,\n type DefaultVerdict,\n type VerdictCertification,\n} from './verdict'\nimport type { CheckerIdentity, VerificationStrategySource } from './verification-strategy'\n\n/** What kind of produced state can satisfy a requirement structurally. */\nexport type SatisfiedBy = 'artifact' | 'proposal' | 'tool-call' | 'any'\n\nexport interface CompletionRequirement {\n /** Stable id from the task gold (e.g. a persona's `expected_requirements[].req_id`). */\n reqId: string\n /** Human-readable description of the required deliverable. */\n title: string\n /** Optional kind/category hint, matched against a produced item's kind. */\n category?: string\n /** What produced state satisfies this requirement. Defaults to 'any'. */\n satisfiedBy?: SatisfiedBy\n}\n\nexport interface TaskGold {\n taskId: string\n requirements: CompletionRequirement[]\n}\n\nexport interface ProducedProposal {\n id: string\n title: string\n status: 'pending' | 'approved' | 'rejected'\n /** Optional persisted body — when present, enables a correctness check. */\n content?: string\n}\n\n/** Everything observable about what a run actually produced. */\nexport interface ProducedState {\n /** Persisted vault artifacts. Reuses the shared `ValidatedArtifact` shape. */\n artifacts: ValidatedArtifact[]\n /** Proposals / filings the agent created. */\n proposals: ProducedProposal[]\n /** Names of tools the agent invoked. */\n toolCalls: string[]\n}\n\nexport interface RequirementCheck {\n reqId: string\n title: string\n /** A produced item of the right kind matched the requirement, non-empty. */\n structurallyPresent: boolean\n /**\n * Whether the matched item actually fulfils the requirement. `null` when\n * not structurally present, when the matched item carries no content\n * to assess, or when the correctness check itself failed (`unmeasured`).\n */\n correct: boolean | null\n /** structurallyPresent && !unmeasured && correct !== false. */\n satisfied: boolean\n /**\n * Set when the correctness check itself errored (LLM call failure or an\n * unparseable response after retry). The requirement's fulfilment is\n * UNKNOWN — `correct` stays null, `satisfied` is false, and\n * `completionVerdict` excludes the row from `completionRate`'s\n * denominator. Never folded into a zero: a synthetic zero is\n * indistinguishable from a real failure (see `JudgeParseError`).\n */\n unmeasured?: true\n /** Why the correctness check could not be measured (present iff `unmeasured`). */\n unmeasuredReason?: string\n /** Human-readable evidence for the verdict. */\n evidence: string[]\n}\n\n/** Extends the substrate verdict spine: `valid` = `fullyComplete` and\n * `score` = `completionRate` — derived in `completionVerdict()`, the one\n * place those equalities hold by construction. */\nexport interface CompletionVerdict extends DefaultVerdict {\n taskId: string\n requirements: RequirementCheck[]\n /** satisfied / MEASURABLE requirements (unmeasured rows leave the denominator). */\n completionRate: number\n /** Every measurable requirement satisfied (false when anything is unmeasured). */\n fullyComplete: boolean\n /** Requirements whose correctness check errored — reported, never scored as zero. */\n unmeasuredCount: number\n}\n\n/**\n * Construct a `CompletionVerdict` from the per-requirement checks, deriving\n * `completionRate` / `fullyComplete` and the spine fields (`valid` =\n * `fullyComplete`, `score` = `completionRate`) in one place. Throws on zero\n * requirements — a verdict over nothing is a misconfiguration, mirroring\n * `verifyCompletion`'s gold-spec guard.\n */\nexport function completionVerdict(input: {\n taskId: string\n requirements: RequirementCheck[]\n /** What certified the correctness stage, when anything did. Omitted =\n * an uncertified verdict — the honest default for a bare checker. */\n certification?: VerdictCertification\n}): CompletionVerdict {\n if (input.requirements.length === 0) {\n throw new Error(\n `completionVerdict: task '${input.taskId}' has no requirement checks — nothing to derive a verdict from`,\n )\n }\n const measurable = input.requirements.filter((r) => !r.unmeasured)\n const unmeasuredCount = input.requirements.length - measurable.length\n if (measurable.length === 0) {\n // Every check errored: this is an infrastructure failure, not a scored\n // run. A 0-rate verdict here would be a fabricated measurement.\n throw new Error(\n `completionVerdict: task '${input.taskId}' has no measurable requirements — all ${input.requirements.length} correctness checks failed (${input.requirements[0]?.unmeasuredReason ?? 'unknown reason'})`,\n )\n }\n const satisfiedCount = measurable.filter((r) => r.satisfied).length\n const completionRate = satisfiedCount / measurable.length\n // A run with unmeasured rows can still report a rate over what WAS\n // measured, but must not claim full completion.\n const fullyComplete = unmeasuredCount === 0 && satisfiedCount === measurable.length\n return {\n taskId: input.taskId,\n requirements: input.requirements,\n completionRate,\n fullyComplete,\n unmeasuredCount,\n valid: fullyComplete,\n score: completionRate,\n ...(input.certification === undefined ? {} : { certification: input.certification }),\n }\n}\n\n/**\n * What a correctness checker declares about itself so the completion\n * verdict can carry a certification: which strategy member it discharges,\n * its exact identity, and the steps its answers rest on unverified.\n */\nexport interface CorrectnessCheckerAttestation {\n strategy: VerificationStrategySource\n checker: CheckerIdentity\n assumptions: string[]\n}\n\n/**\n * Decides whether a produced item's content actually fulfils a requirement.\n * Injected so the structural verifier stays pure and unit-testable; the\n * production implementation is `createLlmCorrectnessChecker`.\n *\n * `attestation` is optional metadata on the function value: a checker that\n * carries one yields certified completion verdicts; a bare function yields\n * the same verdict uncertified. A plain arrow function remains a valid\n * checker.\n */\nexport interface CorrectnessChecker {\n (\n requirement: CompletionRequirement,\n content: string,\n ): Promise<{ correct: boolean; reason: string }>\n attestation?: CorrectnessCheckerAttestation\n}\n\nconst STOPWORDS = new Set([\n 'the',\n 'a',\n 'an',\n 'of',\n 'for',\n 'and',\n 'or',\n 'to',\n 'in',\n 'on',\n 'with',\n 'by',\n])\n\n// Deliverable-FORM vocabulary — words that name the SHAPE of an output, not its\n// domain content. A correct \"swap-comparison view persisted as a ui/** artifact\"\n// is an OpenUI JSON whose body says nothing about \"artifact\" / \"persisted\" /\n// \"view\"; the discriminative tokens are the domain nouns (swap, comparison).\n// Stripped from the REQUIREMENT side of structural recall so a deliverable is\n// matched on what it IS about, not on the boilerplate describing its form. The\n// correctness checker strips the same class via TITLE_STOPWORDS. Anti-game holds:\n// the distinctive domain tokens remain, so an off-topic item still fails.\nconst REQUIREMENT_FORM_STOPWORDS = new Set([\n 'generated',\n 'generate',\n 'view',\n 'render',\n 'rendered',\n 'persisted',\n 'persist',\n 'artifact',\n 'file',\n 'document',\n 'note',\n 'proposal',\n 'deliverable',\n 'output',\n 'created',\n 'create',\n 'produce',\n 'produced',\n 'flag',\n])\n\nconst MATCH_THRESHOLD = 0.5\nconst MIN_CONTENT_CHARS = 50\n\nfunction tokens(s: string, extraStop?: Set<string>): Set<string> {\n return new Set(\n s\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter((t) => t.length > 1 && !STOPWORDS.has(t) && !extraStop?.has(t)),\n )\n}\n\n/**\n * Recall of the requirement's tokens within a candidate's identifying text.\n * Recall, not Jaccard — a candidate's path/id legitimately carries extra\n * tokens the requirement does not name. The requirement side drops\n * deliverable-FORM vocabulary so recall keys on the distinctive domain tokens.\n */\nfunction tokenRecall(requirementText: string, candidateText: string): number {\n const req = tokens(requirementText, REQUIREMENT_FORM_STOPWORDS)\n if (req.size === 0) return 0\n const cand = tokens(candidateText)\n let hit = 0\n for (const t of req) if (cand.has(t)) hit++\n return hit / req.size\n}\n\ninterface Candidate {\n reqIndex: number\n /** Unique key for a produced item — each item satisfies at most one requirement. */\n itemKey: string\n score: number\n evidence: string\n /** Content to correctness-check, or null when the matched item has none. */\n content: string | null\n}\n\nfunction artifactCandidates(\n req: CompletionRequirement,\n reqIndex: number,\n artifacts: ValidatedArtifact[],\n): Candidate[] {\n const reqText = `${req.title} ${req.category ?? ''}`\n const out: Candidate[] = []\n artifacts.forEach((a, i) => {\n if ((a.content ?? '').trim().length < MIN_CONTENT_CHARS) return\n // Match against the artifact CONTENT too, not just its path + kind — a\n // generated view / note whose path is generic still satisfies a requirement\n // when its body covers it (e.g. an OpenUI comparison grounded in the on-file\n // figures). Bounded slice keeps the recall text cheap; MATCH_THRESHOLD holds.\n let score = tokenRecall(\n reqText,\n `${a.path ?? ''} ${a.kind} ${(a.content ?? '').slice(0, 4000)}`,\n )\n if (req.category && a.kind && req.category.toLowerCase() === a.kind.toLowerCase()) {\n score = Math.max(score, 1)\n }\n if (score < MATCH_THRESHOLD) return\n out.push({\n reqIndex,\n itemKey: `artifact:${i}`,\n score,\n evidence: `artifact '${a.path ?? a.kind}' matched (token recall ${score.toFixed(2)})`,\n content: a.content ?? null,\n })\n })\n return out\n}\n\nfunction proposalCandidates(\n req: CompletionRequirement,\n reqIndex: number,\n proposals: ProducedProposal[],\n): Candidate[] {\n const reqText = `${req.title} ${req.category ?? ''}`\n const out: Candidate[] = []\n for (const p of proposals) {\n // Pending or rejected work is not a completed deliverable.\n if (p.status !== 'approved') continue\n // A proposal needs an assessable BODY to be a deliverable. A bare title is\n // not completion: correctness cannot be judged on it, so a title-only match\n // would auto-pass the oracle (structurallyPresent && correct===null →\n // satisfied) with no verifiable content. Tool calls are the only\n // legitimately content-less deliverable (`toolCallCandidates`).\n const body = (p.content ?? '').trim()\n if (body.length < MIN_CONTENT_CHARS) continue\n // Match against the body as well as the (often short) title — a refusal /\n // flag / analysis proposal whose title is a label still satisfies a\n // descriptively-worded requirement when its content covers it. MATCH_THRESHOLD\n // + the requirement's distinctive tokens keep an off-topic proposal out;\n // correctness (a SEMANTIC checker, NOT this lexical pass) then judges\n // polarity/fulfilment, so a negation that merely contains the tokens fails.\n // Structural and correctness must use different evidence or the two-stage\n // check collapses to one lexical gate.\n const score = tokenRecall(reqText, `${p.title} ${body}`)\n if (score < MATCH_THRESHOLD) continue\n out.push({\n reqIndex,\n itemKey: `proposal:${p.id}`,\n score,\n evidence: `approved proposal '${p.title}' matched (token recall ${score.toFixed(2)})`,\n content: body,\n })\n }\n return out\n}\n\nfunction toolCallCandidates(\n req: CompletionRequirement,\n reqIndex: number,\n toolCalls: string[],\n): Candidate[] {\n const out: Candidate[] = []\n toolCalls.forEach((name, i) => {\n const score = tokenRecall(req.title, name)\n if (score < MATCH_THRESHOLD) return\n out.push({\n reqIndex,\n itemKey: `tool:${i}`,\n score,\n evidence: `tool call '${name}' matched (token recall ${score.toFixed(2)})`,\n content: null,\n })\n })\n return out\n}\n\n/**\n * Verify whether a run completed the task. `checkCorrectness` is injected —\n * `createLlmCorrectnessChecker` for production, a deterministic stub in tests.\n *\n * Throws on a gold spec with no requirements: an eval task that requires\n * nothing is a misconfiguration, not a vacuously-complete task.\n */\nexport async function verifyCompletion(\n gold: TaskGold,\n state: ProducedState,\n checkCorrectness: CorrectnessChecker,\n): Promise<CompletionVerdict> {\n if (gold.requirements.length === 0) {\n throw new Error(\n `verifyCompletion: task '${gold.taskId}' has no requirements — malformed gold spec`,\n )\n }\n\n // Collect every above-threshold (requirement, produced-item) candidate, then\n // assign greedily by descending score: each requirement and each produced\n // item is used at most once. One deliverable fulfils one requirement.\n const candidates: Candidate[] = []\n gold.requirements.forEach((req, i) => {\n const by = req.satisfiedBy ?? 'any'\n if (by === 'artifact' || by === 'any') {\n candidates.push(...artifactCandidates(req, i, state.artifacts))\n }\n if (by === 'proposal' || by === 'any') {\n candidates.push(...proposalCandidates(req, i, state.proposals))\n }\n if (by === 'tool-call' || by === 'any') {\n candidates.push(...toolCallCandidates(req, i, state.toolCalls))\n }\n })\n candidates.sort((a, b) => b.score - a.score)\n\n const assigned = new Map<number, Candidate>()\n const itemTaken = new Set<string>()\n for (const c of candidates) {\n if (assigned.has(c.reqIndex) || itemTaken.has(c.itemKey)) continue\n assigned.set(c.reqIndex, c)\n itemTaken.add(c.itemKey)\n }\n\n const requirements: RequirementCheck[] = []\n for (let i = 0; i < gold.requirements.length; i++) {\n const req = gold.requirements[i]!\n const match = assigned.get(i)\n const evidence: string[] = []\n let correct: boolean | null = null\n let unmeasuredReason: string | undefined\n\n if (match) {\n evidence.push(match.evidence)\n if (match.content !== null) {\n try {\n const r = await checkCorrectness(req, match.content)\n correct = r.correct\n evidence.push(`correctness: ${r.correct ? 'pass' : 'fail'} — ${r.reason}`)\n } catch (err) {\n // The CHECKER failed, not the requirement. Recording this as a\n // zero would fabricate a model failure out of an infrastructure\n // one; the requirement is unmeasured and leaves the denominator.\n unmeasuredReason =\n err instanceof JudgeParseError\n ? `checker response unparseable after retry: ${err.raw.slice(0, 200)}`\n : `checker call failed: ${err instanceof Error ? err.message : String(err)}`\n evidence.push(`correctness: UNMEASURED — ${unmeasuredReason}`)\n }\n } else {\n evidence.push('correctness: not assessed — matched item carries no content')\n }\n } else {\n const by = req.satisfiedBy ?? 'any'\n const kind = by === 'any' ? 'artifact/proposal/tool-call' : by\n evidence.push(`no produced ${kind} matched this requirement`)\n }\n\n const structurallyPresent = match !== undefined\n const unmeasured = unmeasuredReason !== undefined\n const satisfied = structurallyPresent && !unmeasured && correct !== false\n requirements.push({\n reqId: req.reqId,\n title: req.title,\n structurallyPresent,\n correct,\n satisfied,\n ...(unmeasured ? { unmeasured: true as const, unmeasuredReason } : {}),\n evidence,\n })\n }\n\n // The verdict blends the deterministic structural stage with the injected\n // correctness stage, so the certification names the checker's own member\n // and carries the structural stage's lexical nature as an assumption. A\n // checker without an attestation yields an uncertified verdict.\n const attestation = checkCorrectness.attestation\n const certification: VerdictCertification | undefined = attestation\n ? {\n strategy: attestation.strategy,\n checker: attestation.checker,\n assumptions: [\n 'structural matching is lexical token recall over produced items — the correctness stage only sees items it matched',\n ...attestation.assumptions,\n ],\n evidenceDigest: certificationEvidenceDigest({ taskId: gold.taskId, requirements }),\n }\n : undefined\n\n return completionVerdict({\n taskId: gold.taskId,\n requirements,\n ...(certification === undefined ? {} : { certification }),\n })\n}\n\nexport interface LlmCorrectnessCheckerOpts {\n /** Judge model. Default `DEFAULT_JUDGE_MODEL`, never the client's default, which may be the user simulator or the agent under test. */\n model?: string\n /** Optional ledger for direct use. */\n costLedger?: CostLedgerHandle\n costPhase?: string\n costTags?: Record<string, string>\n signal?: AbortSignal\n /** Max chars of artifact content sent to the checker. */\n maxContentChars?: number\n /**\n * Checker LLM calls per requirement before giving up (parse failures and\n * call errors both consume attempts). The failure then surfaces as an\n * `unmeasured` requirement, never a zero.\n */\n maxAttempts?: number\n /**\n * Forensic capture of every checker request/response/error — without it a\n * checker failure is unauditable (the agent-turn raws never contain the\n * checker's own calls). Same sink contract as `LlmClient`.\n */\n rawSink?: RawProviderSink\n}\n\n/**\n * Parse the correctness checker's model response. Tolerates a response\n * truncated mid-JSON (max_tokens cap) by auto-closing the prefix — the\n * verdict boolean usually lands in the first few tokens, so a recovered\n * prefix with a boolean `correct` is a real measurement, not a guess.\n * Fails loud (JudgeParseError) when no boolean verdict is recoverable.\n */\nfunction parseCorrectnessResponse(raw: string): { correct: boolean; reason: string } {\n const readVerdict = (candidate: unknown): { correct: boolean; reason: string } | null => {\n if (candidate === null || typeof candidate !== 'object') return null\n const { correct, reason } = candidate as { correct?: unknown; reason?: unknown }\n if (typeof correct !== 'boolean') return null\n return { correct, reason: typeof reason === 'string' ? reason : '' }\n }\n\n const match = raw.match(/\\{[\\s\\S]*\\}/)\n if (match) {\n try {\n const strict = readVerdict(JSON.parse(match[0]))\n if (strict) return strict\n } catch {\n // fall through to truncation recovery\n }\n }\n // The strict path needs a closing `}`; a cap-hit response has none. Take\n // everything from the first `{` and auto-close it.\n const start = raw.indexOf('{')\n if (start !== -1) {\n const recovered = readVerdict(recoverTruncatedJson(raw.slice(start)))\n if (recovered) return recovered\n }\n throw new JudgeParseError('correctness-checker', raw)\n}\n\n/**\n * Production `CorrectnessChecker` — one LLM call per matched artifact,\n * deterministic (temperature 0), structured JSON out. Judges fulfilment\n * only: a plan, a gesture, or a description of what should be done does not\n * fulfil a requirement — the artifact must BE the deliverable.\n */\nexport function createLlmCorrectnessChecker(\n chat: ChatClient,\n opts: LlmCorrectnessCheckerOpts = {},\n): CorrectnessChecker {\n const model = opts.model ?? DEFAULT_JUDGE_MODEL\n const maxContentChars = opts.maxContentChars ?? 8000\n const maxAttempts = opts.maxAttempts ?? 2\n const costLedger = opts.costLedger ?? new CostLedger()\n const sink = opts.rawSink\n const record = async (event: RawProviderEvent): Promise<void> => {\n // Forensic capture is best-effort; the verdict is the system of record.\n try {\n await sink?.record(event)\n } catch {\n // Intentionally swallowed.\n }\n }\n const checker: CorrectnessChecker = async (requirement, content) => {\n const request = {\n model,\n messages: [\n {\n role: 'system' as const,\n content:\n 'You verify whether a produced work artifact actually fulfils a stated requirement. Judge fulfilment only — is the deliverable substantively present and on-point — not polish. A plan to do it later, a vague gesture, or a description of what should be done does NOT fulfil a requirement; the artifact must BE the deliverable. Respond with a single JSON object: {\"correct\": boolean, \"reason\": string (<= 30 words)}.',\n },\n {\n role: 'user' as const,\n content: `Requirement: ${requirement.title}\\n${\n requirement.category ? `Category: ${requirement.category}\\n` : ''\n }\\nProduced artifact:\\n${content.slice(0, maxContentChars)}`,\n },\n ],\n temperature: 0,\n maxTokens: 200,\n } satisfies ChatRequest\n let lastErr: unknown\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n const started = Date.now()\n await record({\n eventId: randomUUID(),\n provider: chat.transport,\n model,\n endpoint: '/chat',\n baseUrl: '',\n attemptIndex: attempt,\n direction: 'request',\n timestamp: started,\n requestBody: request,\n redactedFields: [],\n })\n try {\n const paid = await costLedger.runPaidCall({\n channel: 'verifier',\n phase: opts.costPhase ?? 'completion.correctness',\n actor: 'correctness-checker',\n model,\n maximumCharge:\n chat.maximumAttempts === undefined\n ? undefined\n : maximumChargeForLlmRequest(request, { maximumAttempts: chat.maximumAttempts }),\n tags: {\n ...opts.costTags,\n requirementId: requirement.reqId,\n attempt: String(attempt),\n },\n signal: opts.signal,\n execute: (signal, callId) => chat.chat(request, { signal, idempotencyKey: callId }),\n receipt: costReceiptFromLlm,\n receiptFromError: costReceiptFromLlmError,\n })\n if (!paid.succeeded) throw paid.error\n const resp = paid.value\n // Hold the transport to its own word: a verdict produced by a model\n // other than the one requested is not this model's verdict. A\n // transport that echoes no id cannot be made to prove identity here —\n // callers needing that proof enable it at the client\n // (`LlmClientOptions.assertServedModel`) or gate on `assertModelsServed`.\n assertServedModel(model, resp.servedModel, {\n allowUnreported: true,\n context: `correctness checker for requirement ${requirement.reqId}`,\n })\n const raw = resp.content\n await record({\n eventId: randomUUID(),\n provider: chat.transport,\n model,\n endpoint: '/chat',\n baseUrl: '',\n attemptIndex: attempt,\n direction: 'response',\n timestamp: Date.now(),\n durationMs: Date.now() - started,\n responseBody: resp,\n redactedFields: [],\n })\n return parseCorrectnessResponse(raw)\n } catch (err) {\n lastErr = err\n await record({\n eventId: randomUUID(),\n provider: chat.transport,\n model,\n endpoint: '/chat',\n baseUrl: '',\n attemptIndex: attempt,\n direction: 'error',\n timestamp: Date.now(),\n durationMs: Date.now() - started,\n errorMessage: err instanceof Error ? err.message : String(err),\n redactedFields: [],\n })\n // Substitution is a verdict about identity, not a transient fault:\n // another attempt reaches the same wrong model and spends more tokens.\n if (err instanceof ModelSubstitutionError) throw err\n }\n }\n throw lastErr instanceof Error ? lastErr : new Error(String(lastErr))\n }\n checker.attestation = {\n strategy: 'judge',\n checker: { name: 'llm-correctness-checker', version: model },\n assumptions: [\n 'served-model identity is accepted when the transport reports none (assertServedModel allowUnreported)',\n ],\n }\n return checker\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiIA,SAAgB,kBAAkB,OAMZ;CACpB,IAAI,MAAM,aAAa,WAAW,GAChC,MAAM,IAAI,MACR,4BAA4B,MAAM,OAAO,+DAC3C;CAEF,MAAM,aAAa,MAAM,aAAa,QAAQ,MAAM,CAAC,EAAE,UAAU;CACjE,MAAM,kBAAkB,MAAM,aAAa,SAAS,WAAW;CAC/D,IAAI,WAAW,WAAW,GAGxB,MAAM,IAAI,MACR,4BAA4B,MAAM,OAAO,yCAAyC,MAAM,aAAa,OAAO,8BAA8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Ac;EACpB,UAAU;EACV,SAAS;GAAE,MAAM;GAA2B,SAAS;EAAM;EAC3D,aAAa,CACX,uGACF;CACF;CACA,OAAO;AACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as CostLedgerHandle } from "./cost-ledger-Czro9wmo.js";
|
|
2
|
-
import { O as ChatClient, at as RawProviderSink } from "./cluster-
|
|
2
|
+
import { O as ChatClient, at as RawProviderSink } from "./cluster-CSd0LE_M.js";
|
|
3
3
|
import { a as CheckerIdentity, n as VerdictCertification, t as DefaultVerdict, x as VerificationStrategySource } from "./verdict-D_qiBQ6_.js";
|
|
4
4
|
/** An artifact an agent produced, as completion and produced-state checks read it. */
|
|
5
5
|
interface ValidatedArtifact {
|
|
@@ -136,7 +136,7 @@ interface CorrectnessChecker {
|
|
|
136
136
|
*/
|
|
137
137
|
declare function verifyCompletion(gold: TaskGold, state: ProducedState, checkCorrectness: CorrectnessChecker): Promise<CompletionVerdict>;
|
|
138
138
|
interface LlmCorrectnessCheckerOpts {
|
|
139
|
-
/** Judge model. Default `DEFAULT_JUDGE_MODEL`, never the client's default, which may be the agent under test. */
|
|
139
|
+
/** Judge model. Default `DEFAULT_JUDGE_MODEL`, never the client's default, which may be the user simulator or the agent under test. */
|
|
140
140
|
model?: string;
|
|
141
141
|
/** Optional ledger for direct use. */
|
|
142
142
|
costLedger?: CostLedgerHandle;
|
|
@@ -166,4 +166,4 @@ interface LlmCorrectnessCheckerOpts {
|
|
|
166
166
|
*/
|
|
167
167
|
declare function createLlmCorrectnessChecker(chat: ChatClient, opts?: LlmCorrectnessCheckerOpts): CorrectnessChecker;
|
|
168
168
|
export { ProducedProposal as a, SatisfiedBy as c, createLlmCorrectnessChecker as d, verifyCompletion as f, LlmCorrectnessCheckerOpts as i, TaskGold as l, CompletionVerdict as n, ProducedState as o, CorrectnessChecker as r, RequirementCheck as s, CompletionRequirement as t, completionVerdict as u };
|
|
169
|
-
//# sourceMappingURL=completion-verifier-
|
|
169
|
+
//# sourceMappingURL=completion-verifier-oAgSwdFe.d.ts.map
|
package/dist/{completion-verifier-CJVDPv2T.d.ts.map → completion-verifier-oAgSwdFe.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completion-verifier-
|
|
1
|
+
{"version":3,"file":"completion-verifier-oAgSwdFe.d.ts","names":[],"sources":["../src/artifact-validator.ts","../src/completion-verifier.ts"],"mappings":";;;;UACiB;;EAEf;;EAEA;;EAEA;;EAEA,QAAQ;;EAER,WAAW;;;KCiCD;UAEK;;EAEf;;EAEA;;EAEA;;EAEA,cAAc;;UAGC;EACf;EACA,cAAc;;UAGC;EACf;EACA;EACA;;EAEA;;;UAIe;;EAEf,WAAW;;EAEX,WAAW;;EAEX;;UAGe;EACf;EACA;;EAEA;;;;;;EAMA;;EAEA;;;;;;;;;EASA;;EAEA;;EAEA;;;;;UAMe,0BAA0B;EACzC;EACA,cAAc;;EAEd;;EAEA;;EAEA;;;;;;;;;iBAUc,kBAAkB;EAChC;EACA,cAAc;;;EAGd,gBAAgB;IACd;;;;;;UAqCa;EACf,UAAU;EACV,SAAS;EACT;;;;;;;;;;;;UAae;GAEb,aAAa,uBACb,kBACC;IAAU;IAAkB;;EAC/B,cAAc;;;;;;;;;iBAsLM,iBACpB,MAAM,UACN,OAAO,eACP,kBAAkB,qBACjB,QAAQ;UAyGM;;EAEf;;EAEA,aAAa;EACb;EACA,WAAW;EACX,SAAS;;EAET;;;;;;EAMA;;;;;;EAMA,UAAU;;;;;;;;iBA2CI,4BACd,MAAM,YACN,OAAM,4BACL"}
|
package/dist/contract/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { o as CostLedgerHandle } from "../cost-ledger-Czro9wmo.js";
|
|
2
|
-
import { S as makeProposalFinding, i as AnalystFinding, v as ProposalFinding, y as ProposalFindingOrigin } from "../types-
|
|
3
|
-
import { M as CreateChatClientOpts, O as ChatClient, R as createChatClient } from "../cluster-
|
|
4
|
-
import { Ar as externalTextOptimizationMethod, Br as OptimizationMethodProvenance, Ci as RunEvalOptions, Cr as GepaEngineRun, Di as RunCampaignOptions, Dr as gepaOptimizationMethod, Ei as CampaignCellRetryPolicy, Er as GepaRunnerCommand, Fr as ExternalTextEvaluationResponse, Gn as HeldOutGateOptions, Gr as OptimizationTokenUsage, Jn as DefaultProductionGateOptions, Kn as heldOutGate, Lr as OptimizationMethod, Mr as ExternalTextOptimizerContext, Nr as ExternalTextOptimizerResult, Oi as runCampaign, Or as OpenAICompatibleOptimizerModel, Pr as ExternalOptimizationExample, Ri as FinalEvidencePolicy, Sr as GepaEngineOptions, Ti as CampaignCellFailureReceipt, Tr as GepaOptimizationRecipe, Ur as OptimizationPackageSource, Vr as OptimizationMethodResult, Wi as campaignSplitDigest, Wr as ComparisonCost, Xn as defaultProductionGate, Yn as DefaultProductionRewardHackingOptions, _r as OptimizationMethodComparison, ai as ReferenceEquivalenceJudgeResult, br as compareOptimizationMethods, ci as LlmJudgeOptions, dr as composeGate, fi as transientDispatchFailure, fr as SkillOptOptimizationMethodConfig, gr as CompareOptimizationMethodsOptions, hi as runImprovementLoop, hr as skillOptOptimizationMethod, ii as ReferenceEquivalenceJudgeOptions, jr as ExternalTextOptimizationMethodConfig, kr as OptimizerModelBudget, li as llmJudge, mi as RunImprovementLoopResult, mr as SkillOptTrainerConfig, oi as ReferenceEquivalenceScenario, pi as RunImprovementLoopOptions, pr as SkillOptRunnerCommand, qn as DefaultProductionGateCheck, ri as ReferenceEquivalenceJudgeInput, si as LlmJudgeDimension, wi as runEval, wr as GepaOptimizationMethodConfig, xr as GepaAdaptiveEngineRun, zi as FinalEvidenceUse, zr as OptimizationMethodInput } from "../index-
|
|
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 { $ as paretoPolicy, G as AxisVerdict, J as ObjectiveSource, K as BuildEvidenceVectorOptions, Q as buildEvidenceVector, W as AxisEvidence, X as PromotionObjective, Y as ParetoSignificanceGateOptions, Z as PromotionPolicy, et as paretoSignificanceGate, q as EvidenceVector } from "../statistical-heldout-
|
|
7
|
-
import { Kt as fsCampaignStorage, Wt as CampaignStorage, qt as inMemoryCampaignStorage } from "../search-kernel-
|
|
2
|
+
import { S as makeProposalFinding, i as AnalystFinding, v as ProposalFinding, y as ProposalFindingOrigin } from "../types-DbGSC2No.js";
|
|
3
|
+
import { M as CreateChatClientOpts, O as ChatClient, R as createChatClient } from "../cluster-CSd0LE_M.js";
|
|
4
|
+
import { Ar as externalTextOptimizationMethod, Br as OptimizationMethodProvenance, Ci as RunEvalOptions, Cr as GepaEngineRun, Di as RunCampaignOptions, Dr as gepaOptimizationMethod, Ei as CampaignCellRetryPolicy, Er as GepaRunnerCommand, Fr as ExternalTextEvaluationResponse, Gn as HeldOutGateOptions, Gr as OptimizationTokenUsage, Jn as DefaultProductionGateOptions, Kn as heldOutGate, Lr as OptimizationMethod, Mr as ExternalTextOptimizerContext, Nr as ExternalTextOptimizerResult, Oi as runCampaign, Or as OpenAICompatibleOptimizerModel, Pr as ExternalOptimizationExample, Ri as FinalEvidencePolicy, Sr as GepaEngineOptions, Ti as CampaignCellFailureReceipt, Tr as GepaOptimizationRecipe, Ur as OptimizationPackageSource, Vr as OptimizationMethodResult, Wi as campaignSplitDigest, Wr as ComparisonCost, Xn as defaultProductionGate, Yn as DefaultProductionRewardHackingOptions, _r as OptimizationMethodComparison, ai as ReferenceEquivalenceJudgeResult, br as compareOptimizationMethods, ci as LlmJudgeOptions, dr as composeGate, fi as transientDispatchFailure, fr as SkillOptOptimizationMethodConfig, gr as CompareOptimizationMethodsOptions, hi as runImprovementLoop, hr as skillOptOptimizationMethod, ii as ReferenceEquivalenceJudgeOptions, jr as ExternalTextOptimizationMethodConfig, kr as OptimizerModelBudget, li as llmJudge, mi as RunImprovementLoopResult, mr as SkillOptTrainerConfig, oi as ReferenceEquivalenceScenario, pi as RunImprovementLoopOptions, pr as SkillOptRunnerCommand, qn as DefaultProductionGateCheck, ri as ReferenceEquivalenceJudgeInput, si as LlmJudgeDimension, wi as runEval, wr as GepaOptimizationMethodConfig, xr as GepaAdaptiveEngineRun, zi as FinalEvidenceUse, zr as OptimizationMethodInput } from "../index-BI9ecONy.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-ByrbgALT.js";
|
|
6
|
+
import { $ as paretoPolicy, G as AxisVerdict, J as ObjectiveSource, K as BuildEvidenceVectorOptions, Q as buildEvidenceVector, W as AxisEvidence, X as PromotionObjective, Y as ParetoSignificanceGateOptions, Z as PromotionPolicy, et as paretoSignificanceGate, q as EvidenceVector } from "../statistical-heldout-Bx1QUDNy.js";
|
|
7
|
+
import { Kt as fsCampaignStorage, Wt as CampaignStorage, qt as inMemoryCampaignStorage } from "../search-kernel-C4XnLKIW.js";
|
|
8
8
|
import { d as FileSystemOutcomeStore, f as FileSystemOutcomeStoreOptions, h as OutcomeStore, p as InMemoryOutcomeStore, u as DeploymentOutcome } from "../rubric-predictive-validity-Bbi88Aut.js";
|
|
9
9
|
import { n as HostedTenant } from "../client-BIFwUg7I.js";
|
|
10
|
-
import { _ as ReleaseSummary, a as summarizeExecution, c as ExecutionInsight, d as InsightReport, f as InterRaterInsight, g as Recommendation, h as OutcomeCorrelationInsight, i as SummarizeExecutionOptions, l as FailureClassTally, m as LiftInsight, n as analyzeRuns, o as CostProvenanceSummary, p as JudgeInsight, r as ExecutionReport, s as ExecutionErrorOutcomeCell, t as AnalyzeRunsOptions, u as FailureClusterInsight, v as ScalarDistribution, y as TokenUsageInsight } from "../analyze-runs-
|
|
11
|
-
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-
|
|
12
|
-
import { $ as AgentProfileImprovementExperimentExecutionInput, A as CodeAgentSessionActionSurface, B as AgentTraceIndex, C as CodeAgentSessionIntakeOptions, Ct as PairedMeasurementAdapter, D as CodeAgentSessionAction, E as ParsedCodeAgentJsonl, Et as SealCandidateBenchmarkSuiteOptions, F as observeCodeAgentSession, G as parseAgentTrace, H as AgentTraceRecord, I as AgentTraceContributor, J as EvalReportingSuiteOptions, K as partitionRunsByAuthoringModel, L as AgentTraceContributorType, M as CodeAgentSessionObservation, N as CodeAgentSessionSource, O as CodeAgentSessionActionKind, P as CodeAgentSessionTerminalStatus, Q as RunRecordRejection, R as AgentTraceConversation, S as CodeAgentSessionDiagnostic, St as PairedMeasurement, T as CodeAgentSessionMetrics, Tt as RunCandidateExperimentOptions, U as AuthoringProvenance, V as AgentTraceRange, W as PartitionByAuthoringModelResult, X as FromRunRecordDirOptions, Y as EvalReportingSuiteResult, Z as FromRunRecordDirResult, _ as fromPiSession, _t as verifyCandidateExperimentComparison, a as FromFeedbackTableOptions, at as runAgentProfileImprovementExperiment, b as streamCodeAgentJsonlFile, bt as CompareCandidateExperimentOptions, c as CodeAgentStoreObservation, ct as sealAgentProfileImprovementTask, d as CodeAgentStoreScope, dt as measuredComparisonFromCandidateExperiment, et as AgentProfileImprovementExperimentRun, f as CodeAgentStoreSession, ft as runCandidateExperiment, g as fromOpenCodeSession, gt as verifyCandidateExperiment, h as fromKimiCodeSession, ht as sealCandidateExperiment, i as FeedbackTableRow, it as measuredComparisonFromAgentProfileImprovementExperiment, j as CodeAgentSessionExecutionReceipt, k as CodeAgentSessionActionStatus, l as CodeAgentStoreRejection, lt as verifyAgentProfileImprovementExperimentComparison, m as fromCodexSession, mt as sealCandidateBenchmarkTask, n as fromOtelSpans, nt as RunAgentProfileImprovementExperimentOptions, o as FromFeedbackTableResult, ot as sealAgentProfileImprovementExperiment, p as fromClaudeCodeSession, pt as sealCandidateBenchmarkSuite, q as EvalReportingSuiteInput, r as FeedbackTableMeta, rt as SealAgentProfileImprovementSuiteOptions, s as fromFeedbackTable, st as sealAgentProfileImprovementSuite, t as FromOtelSpansOptions, tt as CompareAgentProfileImprovementExperimentOptions, u as CodeAgentStoreRejections, ut as evaluatePairedMeasurements, v as parseCodeAgentJsonl, vt as CandidateExperimentExecutionInput, w as CodeAgentSessionIntakeResult, wt as PairedMeasurementEvaluation, x as CodeAgentJsonlLine, xt as EvaluatePairedMeasurementsOptions, y as parseCodeAgentJsonlFile, yt as CandidateExperimentRun, z as AgentTraceFile } from "../index-
|
|
13
|
-
import { n as buildDefaultAnalystRegistry, t as DefaultAnalystRegistryOptions } from "../default-registry-
|
|
10
|
+
import { _ as ReleaseSummary, a as summarizeExecution, c as ExecutionInsight, d as InsightReport, f as InterRaterInsight, g as Recommendation, h as OutcomeCorrelationInsight, i as SummarizeExecutionOptions, l as FailureClassTally, m as LiftInsight, n as analyzeRuns, o as CostProvenanceSummary, p as JudgeInsight, r as ExecutionReport, s as ExecutionErrorOutcomeCell, t as AnalyzeRunsOptions, u as FailureClusterInsight, v as ScalarDistribution, y as TokenUsageInsight } from "../analyze-runs-BaziIw93.js";
|
|
11
|
+
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-Be2Ser8j.js";
|
|
12
|
+
import { $ as AgentProfileImprovementExperimentExecutionInput, A as CodeAgentSessionActionSurface, B as AgentTraceIndex, C as CodeAgentSessionIntakeOptions, Ct as PairedMeasurementAdapter, D as CodeAgentSessionAction, E as ParsedCodeAgentJsonl, Et as SealCandidateBenchmarkSuiteOptions, F as observeCodeAgentSession, G as parseAgentTrace, H as AgentTraceRecord, I as AgentTraceContributor, J as EvalReportingSuiteOptions, K as partitionRunsByAuthoringModel, L as AgentTraceContributorType, M as CodeAgentSessionObservation, N as CodeAgentSessionSource, O as CodeAgentSessionActionKind, P as CodeAgentSessionTerminalStatus, Q as RunRecordRejection, R as AgentTraceConversation, S as CodeAgentSessionDiagnostic, St as PairedMeasurement, T as CodeAgentSessionMetrics, Tt as RunCandidateExperimentOptions, U as AuthoringProvenance, V as AgentTraceRange, W as PartitionByAuthoringModelResult, X as FromRunRecordDirOptions, Y as EvalReportingSuiteResult, Z as FromRunRecordDirResult, _ as fromPiSession, _t as verifyCandidateExperimentComparison, a as FromFeedbackTableOptions, at as runAgentProfileImprovementExperiment, b as streamCodeAgentJsonlFile, bt as CompareCandidateExperimentOptions, c as CodeAgentStoreObservation, ct as sealAgentProfileImprovementTask, d as CodeAgentStoreScope, dt as measuredComparisonFromCandidateExperiment, et as AgentProfileImprovementExperimentRun, f as CodeAgentStoreSession, ft as runCandidateExperiment, g as fromOpenCodeSession, gt as verifyCandidateExperiment, h as fromKimiCodeSession, ht as sealCandidateExperiment, i as FeedbackTableRow, it as measuredComparisonFromAgentProfileImprovementExperiment, j as CodeAgentSessionExecutionReceipt, k as CodeAgentSessionActionStatus, l as CodeAgentStoreRejection, lt as verifyAgentProfileImprovementExperimentComparison, m as fromCodexSession, mt as sealCandidateBenchmarkTask, n as fromOtelSpans, nt as RunAgentProfileImprovementExperimentOptions, o as FromFeedbackTableResult, ot as sealAgentProfileImprovementExperiment, p as fromClaudeCodeSession, pt as sealCandidateBenchmarkSuite, q as EvalReportingSuiteInput, r as FeedbackTableMeta, rt as SealAgentProfileImprovementSuiteOptions, s as fromFeedbackTable, st as sealAgentProfileImprovementSuite, t as FromOtelSpansOptions, tt as CompareAgentProfileImprovementExperimentOptions, u as CodeAgentStoreRejections, ut as evaluatePairedMeasurements, v as parseCodeAgentJsonl, vt as CandidateExperimentExecutionInput, w as CodeAgentSessionIntakeResult, wt as PairedMeasurementEvaluation, x as CodeAgentJsonlLine, xt as EvaluatePairedMeasurementsOptions, y as parseCodeAgentJsonlFile, yt as CandidateExperimentRun, z as AgentTraceFile } from "../index-D-0mg-eu.js";
|
|
13
|
+
import { n as buildDefaultAnalystRegistry, t as DefaultAnalystRegistryOptions } from "../default-registry-DoIBhuS-.js";
|
|
14
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 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, 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, defaultProductionGate, defineAgentEval, evaluatePairedMeasurements, externalTextOptimizationMethod, fromClaudeCodeSession, fromCodexSession, fromFeedbackTable, fromKimiCodeSession, fromOpenCodeSession, fromOtelSpans, fromPiSession, fsCampaignStorage, gepaOptimizationMethod, heldOutGate, inMemoryCampaignStorage, llmJudge, makeProposalFinding, measuredComparisonFromAgentProfileImprovementExperiment, measuredComparisonFromCandidateExperiment, observeCodeAgentSession, paretoPolicy, paretoSignificanceGate, parseAgentTrace, parseCodeAgentJsonl, parseCodeAgentJsonlFile, partitionRunsByAuthoringModel, runAgentProfileImprovementExperiment, runCampaign, runCandidateExperiment, runEval, runImprovementLoop, sealAgentProfileImprovementExperiment, sealAgentProfileImprovementSuite, sealAgentProfileImprovementTask, sealCandidateBenchmarkSuite, sealCandidateBenchmarkTask, sealCandidateExperiment, selfImprove, skillOptOptimizationMethod, streamCodeAgentJsonlFile, summarizeExecution, transientDispatchFailure, verifyAgentProfileImprovementExperimentComparison, verifyCandidateExperiment, verifyCandidateExperimentComparison };
|
package/dist/contract/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { n as isRecord } from "../json-DtvZNAU9.js";
|
|
|
14
14
|
import { n as SelfImproveRunError, r as selfImprove, t as defineAgentEval } from "../define-agent-eval-BLVewqJm.js";
|
|
15
15
|
import { t as buildDefaultAnalystRegistry } from "../default-registry-D-xd7KxV.js";
|
|
16
16
|
import { t as extractUsage } from "../extract-usage-ISFqhfDz.js";
|
|
17
|
-
import { n as createChatClient } from "../chat-client-
|
|
17
|
+
import { n as createChatClient } from "../chat-client-PJEzoot9.js";
|
|
18
18
|
import { n as InMemoryOutcomeStore, t as FileSystemOutcomeStore } from "../outcome-store-TarrcfHG.js";
|
|
19
19
|
import { c as composeGate, l as externalTextOptimizationMethod, n as compareOptimizationMethods, r as gepaOptimizationMethod, s as heldOutGate, t as skillOptOptimizationMethod } from "../skillopt-optimization-method-BtX7xXDd.js";
|
|
20
20
|
import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-DCgftbnd.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { o as FailureClass } from "./schema-CkIvnmLU.js";
|
|
2
|
-
import { C as CalibrationInterval, T as FindingCalibration, Y as TraceAnalysisStore, i as AnalystFinding, m as EvidenceRef, n as AnalystContext } from "./types-
|
|
3
|
-
import { l as ExactCapableAnalyst, u as ExactExecutionComponentIdentity } from "./exact-types-
|
|
2
|
+
import { C as CalibrationInterval, T as FindingCalibration, Y as TraceAnalysisStore, i as AnalystFinding, m as EvidenceRef, n as AnalystContext } from "./types-DbGSC2No.js";
|
|
3
|
+
import { l as ExactCapableAnalyst, u as ExactExecutionComponentIdentity } from "./exact-types-DEnrf7NX.js";
|
|
4
4
|
import { g as SystemOneState } from "./systemone-protocol-C4t7JH4Y.js";
|
|
5
|
-
import { j as FindingsLedger, r as SystemOneEvaluatorOptions } from "./systemone-
|
|
6
|
-
import { i as TraceAnalystLimits, r as TraceAnalysisEngineResult, s as RawAnalystFinding, t as TraceAnalysisEngine } from "./engine-
|
|
7
|
-
import { t as TraceToolGroupName } from "./tool-groups-
|
|
8
|
-
import { i as AnalystRegistryOptions, t as AnalystRegistry } from "./registry-
|
|
5
|
+
import { j as FindingsLedger, r as SystemOneEvaluatorOptions } from "./systemone-CSwi1hp-.js";
|
|
6
|
+
import { i as TraceAnalystLimits, r as TraceAnalysisEngineResult, s as RawAnalystFinding, t as TraceAnalysisEngine } from "./engine-CPBhCLJR.js";
|
|
7
|
+
import { t as TraceToolGroupName } from "./tool-groups-Bcasvncd.js";
|
|
8
|
+
import { i as AnalystRegistryOptions, t as AnalystRegistry } from "./registry-BqoX13FD.js";
|
|
9
9
|
type SuboptimalCode = 'monotonic-input-growth' | 'output-length-decay' | 'single-tool-dependency' | 'no-self-verification';
|
|
10
10
|
declare const BEHAVIORAL_TRACE_QUESTIONS_VERSION = "2";
|
|
11
11
|
/** Questions are independent observations; none is an acceptance ruler. */
|
|
@@ -265,4 +265,4 @@ interface DefaultAnalystRegistryOptions {
|
|
|
265
265
|
}
|
|
266
266
|
declare function buildDefaultAnalystRegistry(options?: DefaultAnalystRegistryOptions): AnalystRegistry;
|
|
267
267
|
export { BehavioralWindowPolicy as C, BehavioralTraceWindow as S, BehavioralTraceEventMap as _, createTraceAnalyst as a, BehavioralTraceQuestionsOptions as b, BehavioralAnalystOptions as c, pinBehavioralFailureClass as d, BEHAVIORAL_TRACE_QUESTIONS as f, BehavioralTraceEvent as g, BehavioralTraceAnswer as h, TraceAnalystDefinition as i, assertFailureClasses as l, BehavioralQuestionCalibration as m, buildDefaultAnalystRegistry as n, runTraceAnalyst as o, BEHAVIORAL_TRACE_QUESTIONS_VERSION as p, CreateTraceAnalystOptions as r, BEHAVIORAL_FAILURE_CLASS as s, DefaultAnalystRegistryOptions as t, behavioralAnalyst as u, BehavioralTraceLayer as v, behavioralTraceQuestionDigest as w, BehavioralTraceSupport as x, BehavioralTraceQuestionId as y };
|
|
268
|
-
//# sourceMappingURL=default-registry-
|
|
268
|
+
//# sourceMappingURL=default-registry-DoIBhuS-.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-registry-
|
|
1
|
+
{"version":3,"file":"default-registry-DoIBhuS-.d.ts","names":[],"sources":["../src/trace-analyst/behavioral-metrics.ts","../src/analyst/behavioral-trace-questions.ts","../src/analyst/behavioral-analyst.ts","../src/analyst/kind-factory.ts","../src/analyst/default-registry.ts"],"mappings":";;;;;;;;KAoBY;cCRC;;cAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6FD,yCAAyC;KACzC;KACA;UACK;EACf;EACA;;EAEA,SAAS;;;UAIM;EACf;EACA,SAAS;EACT,cAAc;;UAEC;EACf;EACA;EACA,QAAQ;IAAQ;IAAY;IAAuB,cAAc;;;;UAGlD;EACf;EACA;EACA;EACA;EACA;EACA,KAAK;EACL,eAAe;;UAGA;EACf;EACA;EACA;EACA,OAAO;EACP;EACA;;EAEA,OAAO;;EAEP,QAAQ;;EAER;IAAW;IAAmB;;EAC9B,cAAc;;EAEd;IACE;IACA,UAAU;MAAQ;MAAY;MAAiB;MAAc;;;;UAIhD,sCAAsC;EACrD;;EAEA;EACA,cAAc;;EAEd;EACA,IAAI;;UAGW;;EAEf;EACA;EACA,WAAW;;EAEX,mBAAmB;EACnB,QAAQ;;EAER,kBAAkB;EAClB,cAAc;EACd,eAAe,QACb,OACE,sBACA,QAAQ,OAAO,2BAA2B;EAG9C;EACA;;EAEA;EACA;EACA;;;iBAiBc,8BAA8B;EAC5C,YAAY;EACZ,OAAO;EACP,cAAc;EACd;EACA;EACA,mBAAmB;;;;;;;cCpLR,0BAA0B,SAAS,OAAO,gBAAgB;;iBAQvD,qBAAqB,KAAK,SAAS;;;;;;iBAkBnC,0BAA0B,SAAS;UAUlC;;EAEf;;EAEA;;EAEA,iBAAiB;;;iBAoGH,kBACd,UAAS,2BACR,oBAAoB;;UChKN;EACf;EACA;EACA;EACA;;EAEA,sBAAsB,SAAS;;EAE/B;;EAEA,WAAW;;EAEX,kBACE,OAAO,oBACP,SAAS,wCACe;EAC1B,SAAS,QAAQ;EACjB,eAAe,KAAK,mBAAmB,SAAS,mBAAmB;EACnE;EACA;;UAGe;EACf,QAAQ;;EAER;EACA;;;iBAIoB,gBAAgB;EACpC,YAAY;EACZ,QAAQ;EACR,OAAO;EACP,SAAS;EACT;IACE,QAAQ;;iBAgHI,mBACd,YAAY,wBACZ,SAAS,4BACR,oBAAoB;UCrKN;;;;;;EAMf,SAAS;EACT,uBAAuB;;EAEvB;EACA,aAAa;EACb,WAAW;;iBAGG,4BACd,UAAS,gCACR"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { d as CostReceipt, l as CostLedgerSummary, o as CostLedgerHandle } from "./cost-ledger-Czro9wmo.js";
|
|
2
|
-
import { v as ProposalFinding } from "./types-
|
|
2
|
+
import { v as ProposalFinding } from "./types-DbGSC2No.js";
|
|
3
3
|
import { nt as EvaluationClaim } from "./search-ledger-types-qiYRUo_N.js";
|
|
4
|
-
import { Br as OptimizationMethodProvenance, Ci as RunEvalOptions, Di as RunCampaignOptions, Ei as CampaignCellRetryPolicy, Hn as CampaignComparisonUnits, Lr as OptimizationMethod, Ri as FinalEvidencePolicy, Rn as LoopProvenanceRecord, Si as openAutoPr, Vr as OptimizationMethodResult, Wr as ComparisonCost, _i as RunOptimizationOptions, gi as PremeasuredOptimizationBaseline, mi as RunImprovementLoopResult, zi as FinalEvidenceUse } from "./index-
|
|
5
|
-
import { H as SurfaceProposer, R as Scenario, S as JudgeConfig, a as CampaignResult, d as DispatchContext, j as MutableSurface, k as LabeledScenarioStore, p as Gate, v as GateResult } from "./types-
|
|
6
|
-
import { V as PowerPreflight, at as CampaignEvidenceContext, dt as EvidenceReceipt } from "./statistical-heldout-
|
|
7
|
-
import { At as SearchHistoryReceipt, Ot as SearchHistoryCoverageRow, Tt as SearchHistoryAdmissionOptions, Wt as CampaignStorage } from "./search-kernel-
|
|
4
|
+
import { Br as OptimizationMethodProvenance, Ci as RunEvalOptions, Di as RunCampaignOptions, Ei as CampaignCellRetryPolicy, Hn as CampaignComparisonUnits, Lr as OptimizationMethod, Ri as FinalEvidencePolicy, Rn as LoopProvenanceRecord, Si as openAutoPr, Vr as OptimizationMethodResult, Wr as ComparisonCost, _i as RunOptimizationOptions, gi as PremeasuredOptimizationBaseline, mi as RunImprovementLoopResult, zi as FinalEvidenceUse } from "./index-BI9ecONy.js";
|
|
5
|
+
import { H as SurfaceProposer, R as Scenario, S as JudgeConfig, a as CampaignResult, d as DispatchContext, j as MutableSurface, k as LabeledScenarioStore, p as Gate, v as GateResult } from "./types-ByrbgALT.js";
|
|
6
|
+
import { V as PowerPreflight, at as CampaignEvidenceContext, dt as EvidenceReceipt } from "./statistical-heldout-Bx1QUDNy.js";
|
|
7
|
+
import { At as SearchHistoryReceipt, Ot as SearchHistoryCoverageRow, Tt as SearchHistoryAdmissionOptions, Wt as CampaignStorage } from "./search-kernel-C4XnLKIW.js";
|
|
8
8
|
import { n as HostedTenant } from "./client-BIFwUg7I.js";
|
|
9
|
-
import { d as InsightReport } from "./analyze-runs-
|
|
9
|
+
import { d as InsightReport } from "./analyze-runs-BaziIw93.js";
|
|
10
10
|
interface FinalComparisonOptions<TScenario extends Scenario, TArtifact> extends Omit<RunCampaignOptions<TScenario, TArtifact>, 'dispatch'> {
|
|
11
11
|
baselineSurface: MutableSurface;
|
|
12
12
|
winnerSurface: MutableSurface;
|
|
@@ -504,4 +504,4 @@ interface DefinedAgentEval<TScenario extends Scenario, TArtifact> {
|
|
|
504
504
|
*/
|
|
505
505
|
declare function defineAgentEval<TScenario extends Scenario, TArtifact>(defaults: DefineAgentEvalOptions<TScenario, TArtifact>): DefinedAgentEval<TScenario, TArtifact>;
|
|
506
506
|
export { SelfImproveMethodResult as _, DefinedAgentEval as a, SelfImproveMethodOptions as c, SelfImproveProposerOptions as d, SelfImproveProposerResult as f, SelfImproveMethodProvenance as g, selfImprove as h, DefineAgentEvalOptions as i, SelfImproveOptions as l, SelfImproveRunError as m, AgentEvalEvaluateOptions as n, defineAgentEval as o, SelfImproveResult as p, AgentEvalImproveOptions as r, SelfImproveBudget as s, AgentEvalAgent as t, SelfImproveProgressEvent as u };
|
|
507
|
-
//# sourceMappingURL=define-agent-eval-
|
|
507
|
+
//# sourceMappingURL=define-agent-eval-Be2Ser8j.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-agent-eval-
|
|
1
|
+
{"version":3,"file":"define-agent-eval-Be2Ser8j.d.ts","names":["_$__0.GateResult","_$__0.FinalEvidenceUse"],"sources":["../src/campaign/presets/run-final-comparison.ts","../src/contract/self-improve-method.ts","../src/contract/self-improve.ts","../src/contract/define-agent-eval.ts"],"mappings":";;;;;;;;;UAaU,uBAAuB,kBAAkB,UAAU,mBACnD,KAAK,mBAAmB,WAAW;EAC3C,iBAAiB;EACjB,eAAe;EACf,sBACE,SAAS,gBACT,UAAU,WACV,KAAK,WAAW,mBAAmB,WAAW,+BAC3C,QAAQ;EACb,MAAM,KAAK,WAAW;EACtB,QAAQ;EACR,gBAAgB;EAChB;EACA;E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ACA,gBAAgB,QAAQ;;;cAIb,4BAA4B;WAC9B,MAAM;WACN,UAAU;EAEP,YAAA,gBAAgB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0NtB,YAAY,kBAAkB,UAAU,WACtD,MAAM,yBAAyB,WAAW,aACzC,QAAQ,wBAAwB,WAAW;iBAC9B,YAAY,kBAAkB,UAAU,WACtD,MAAM,2BAA2B,WAAW,aAC3C,QAAQ,0BAA0B,WAAW;iBAChC,YAAY,kBAAkB,UAAU,WACtD,MAAM,mBAAmB,WAAW,aACnC,QAAQ,kBAAkB,WAAW;KC9nB5B,eAAe,kBAAkB,UAAU,cACrD,SAAS,gBACT,UAAU,WACV,KAAK,oBACF,QAAQ;KAED,uBAAuB,kBAAkB,UAAU,aAAa,mBAC1E,WACA;UAGe,yBAAyB,kBAAkB,UAAU,mBAC5D,KACN,eAAe,WAAW;;EAI5B,YAAY;;EAEZ,UAAU;;EAEV,QAAQ,eAAe,WAAW;;EAElC,QAAQ,YAAY,WAAW;;EAE/B,SAAS,YAAY,WAAW;;EAEhC;;KAGU,wBAAwB,kBAAkB,UAAU,aAAa,KAC3E,QAAQ,mBAAmB,WAAW;EAGtC,SAAS,QAAQ;EACjB,eAAe,QAAQ;;UAGR,iBAAiB,kBAAkB,UAAU;;WAEnD,oBAAoB;;WAEpB,iBAAiB;;;;;EAK1B,SACE,OAAO,yBAAyB,WAAW,aAC1C,QAAQ,eAAe,WAAW;;;;;;;EAOrC,QACE,OAAO,wBAAwB,WAAW,aACzC,QAAQ,kBAAkB,WAAW;;;;;;;;;iBAU1B,gBAAgB,kBAAkB,UAAU,WAC1D,UAAU,uBAAuB,WAAW,aAC3C,iBAAiB,WAAW"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as FailureClassification, i as FailureBlame } from "../failure-cluster-DOoa7CBg.js";
|
|
2
|
-
import { r as ExecutionReport } from "../analyze-runs-
|
|
3
|
-
import { l as PrimeRawUsage } from "../prime-protocol-
|
|
2
|
+
import { r as ExecutionReport } from "../analyze-runs-BaziIw93.js";
|
|
3
|
+
import { l as PrimeRawUsage } from "../prime-protocol-RUPtoYiI.js";
|
|
4
4
|
import { i as nodeHttpPrimeBridgeTransport, n as PrimeBridgeTransportRequest, r as PrimeBridgeTransportResult, t as PrimeBridgeTransport } from "../prime-bridge-transport-Cfqir_Im.js";
|
|
5
5
|
import { a as isContentAttribute, i as ingestSpans, n as IngestReport, r as epochMillis, t as DiagnosisSpan } from "../spans-CGjHouKM.js";
|
|
6
6
|
import { SpanKind, TraceValidation } from "@tangle-network/agent-trace-contract";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as CostLedgerHandle } from "./cost-ledger-Czro9wmo.js";
|
|
2
|
-
import { W as BoundedTraceAnalysisStoreOptions, Y as TraceAnalysisStore, m as EvidenceRef } from "./types-
|
|
2
|
+
import { W as BoundedTraceAnalysisStoreOptions, Y as TraceAnalysisStore, m as EvidenceRef } from "./types-DbGSC2No.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
/**
|
|
5
5
|
* Eval primitives as agent tools — `makeEvalTools` packages the substrate's
|
|
@@ -149,4 +149,4 @@ interface TraceAnalysisEngine {
|
|
|
149
149
|
analyze(request: TraceAnalysisEngineRequest): Promise<TraceAnalysisEngineResult>;
|
|
150
150
|
}
|
|
151
151
|
export { RAW_FINDING_SCHEMA_PROMPT as a, RawAnalystFindingSchema as c, BuildTraceAnalysisToolsOptions as d, TRACE_ANALYST_TOOL_NAMESPACE as f, buildTraceAnalysisToolDescriptors as h, TraceAnalystLimits as i, evidenceRefsFromRawFinding as l, UNTRUSTED_TRACE_TEXT as m, TraceAnalysisEngineRequest as n, RawAnalystEvidence as o, TraceAnalysisToolDescriptor as p, TraceAnalysisEngineResult as r, RawAnalystFinding as s, TraceAnalysisEngine as t, parseRawFinding as u };
|
|
152
|
-
//# sourceMappingURL=engine-
|
|
152
|
+
//# sourceMappingURL=engine-CPBhCLJR.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-
|
|
1
|
+
{"version":3,"file":"engine-CPBhCLJR.d.ts","names":[],"sources":["../src/eval-tools.ts","../src/trace-analyst/tools.ts","../src/analyst/finding-signature.ts","../src/analyst/engine.ts"],"mappings":";;;;;;;;;;;;;;;;;;UAsBiB;EACf;EACA;EACA,YAAY;EACZ,UAAU,eAAe;IAAQ,SAAS;QAAkB;;cCZjD;;;;;;cAOA;UAGI,uCAAuC;EACtD,OAAO;;UAGQ,oCAAoC;EACnD,kBAAkB;;EAElB;;EAEA;;;iBAMc,kCACd,SAAS,iCACR;cC7BG,0BAAwB,EAAA;;;GAKnB,EAAA,KAAA;KAEC,qBAAqB,EAAE,aAAa;cAiBnC,yBAAuB,EAAA;;;;;;;;;;;;;;;;;GAKzB,EAAA,KAAA;KAEC,oBAAoB,EAAE,aAAa;;;;;;cAOlC;;iBAYG,2BAA2B,SAAS,oBAAoB;iBAQxD,gBACd,cACA,OAAO,aAAa,SAAS,mCAC5B;;UCpEc;;EAEf;;EAEA;;EAEA;;EAEA;;UA0Be;EACf;EACA;EACA;EACA,gBAAgB;;;;;;;;;;;EAWhB,aAAa,SAAS;EACtB,QAAQ;EACR,YAAY;EACZ;EACA,WAAW;EACX,SAAS;EACT,OAAO,iBAAiB,SAAS;;;UAIlB;EACf;EACA,UAAU;;EAEV;;;;;EAKA;;EAEA;EACA,SAAS;;;;;;;;;UAUM;WACN;WACA;WACA;;WAEA;;;;;;;;WAQA,iBAAiB,SAAS;EACnC,QAAQ,SAAS,6BAA6B,QAAQ"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d as CostReceipt, f as CostReceiptInput, h as MaximumCharge, i as CostChannel, o as CostLedgerHandle } from "./cost-ledger-Czro9wmo.js";
|
|
2
|
-
import { i as AnalystFinding, n as AnalystContext, t as Analyst } from "./types-
|
|
3
|
-
import { R as Scenario, S as JudgeConfig, w as JudgeScore } from "./types-
|
|
4
|
-
import { l as ExactCapableAnalyst } from "./exact-types-
|
|
2
|
+
import { i as AnalystFinding, n as AnalystContext, t as Analyst } from "./types-DbGSC2No.js";
|
|
3
|
+
import { R as Scenario, S as JudgeConfig, w as JudgeScore } from "./types-ByrbgALT.js";
|
|
4
|
+
import { l as ExactCapableAnalyst } from "./exact-types-DEnrf7NX.js";
|
|
5
5
|
interface EvaluationResult<T> {
|
|
6
6
|
value: T;
|
|
7
7
|
receipt: CostReceipt;
|
|
@@ -72,4 +72,4 @@ interface EvaluationAnalystOptions<I, O> {
|
|
|
72
72
|
/** Registry, graph, and trace consumers keep the same Analyst interface. */
|
|
73
73
|
declare function asAnalyst<I, O>(options: EvaluationAnalystOptions<I, O>): Analyst<I>;
|
|
74
74
|
export { EvaluationResult as a, asJudge as c, EvaluationJudgeOptions as i, createEvaluator as l, EvaluationAnalystOptions as n, EvaluatorOptions as o, EvaluationContext as r, asAnalyst as s, CostedEvaluator as t };
|
|
75
|
-
//# sourceMappingURL=evaluation-
|
|
75
|
+
//# sourceMappingURL=evaluation-BjRgUyst.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluation-
|
|
1
|
+
{"version":3,"file":"evaluation-BjRgUyst.d.ts","names":[],"sources":["../src/evaluation.ts"],"mappings":";;;;UAaiB,iBAAiB;EAChC,OAAO;EACP,SAAS;EACT;;UAGe;;;EAGf;EACA,SAAS;EACT,aAAa;EACb;EACA,UAAU;EACV;EACA,WAAW;EACX,gBAAgB;;EAEhB,aAAa,SAAS,uBAAuB;;KAGnC,gBAAgB,GAAG,MAC7B,OAAO,GACP,UAAU,sBACP,QAAQ,iBAAiB;UAEb,iBAAiB,GAAG;EACnC,UAAU,OAAO,GAAG;IAAW,QAAQ;IAAa;QAA6B,QAAQ;EACzF,UAAU,OAAO,MAAM;EACvB,oBAAoB,OAAO,UAAU;EACrC,mBAAmB,OAAO;EAC1B,aAAa;EACb,gBAAgB;;EAEhB,YAAY,OAAO,GAAG,OAAO,aAAa;;;iBAI5B,gBAAgB,GAAG,GAAG,SAAS,iBAAiB,GAAG,KAAK,gBAAgB,GAAG;UA6B1E,uBAAuB,GAAG,UAAU,UAAU;EAC7D;EACA;EACA,YAAY,YAAY,GAAG;EAC3B,UAAU;IAAkB,UAAU;IAAG,UAAU;KAAK;EACxD,MAAM,OAAO,GAAG;IAAS,UAAU;IAAG,UAAU;QAAQ,aAAa,QAAQ;;EAE7E,UACE,QAAQ,iBAAiB,IACzB;IAAS,UAAU;IAAG,UAAU;eACtB;EACZ,aAAa,UAAU;;;iBAIT,QAAQ,GAAG,UAAU,UAAU,GAC7C,SAAS,uBAAuB,GAAG,GAAG,KACrC,YAAY,GAAG;UA4BD,yBAAyB,GAAG;EAC3C;EACA;EACA;EACA,WAAW,QAAQ;EACnB,MAAM,QAAQ;EACd,kBAAkB,oBAAoB;EACtC,WACE,OAAO,GACP,SAAS,mBACT,gBAAgB,mBACb,QAAQ,iBAAiB;EAC9B,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,mBAAmB,mBAAmB,QAAQ;EACjF,UAAU,QAAQ,iBAAiB,IAAI,OAAO,GAAG,SAAS,0BAA0B;;;iBAItE,UAAU,GAAG,GAAG,SAAS,yBAAyB,GAAG,KAAK,QAAQ"}
|
package/dist/evaluation.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as EvaluationResult, c as asJudge, i as EvaluationJudgeOptions, l as createEvaluator, n as EvaluationAnalystOptions, o as EvaluatorOptions, r as EvaluationContext, s as asAnalyst, t as CostedEvaluator } from "./evaluation-
|
|
1
|
+
import { a as EvaluationResult, c as asJudge, i as EvaluationJudgeOptions, l as createEvaluator, n as EvaluationAnalystOptions, o as EvaluatorOptions, r as EvaluationContext, s as asAnalyst, t as CostedEvaluator } from "./evaluation-BjRgUyst.js";
|
|
2
2
|
export { CostedEvaluator, EvaluationAnalystOptions, EvaluationContext, EvaluationJudgeOptions, EvaluationResult, EvaluatorOptions, asAnalyst, asJudge, createEvaluator };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as AnalystRunEvent, d as AnalystRunSummary, t as Analyst, u as AnalystRunResult } from "./types-
|
|
1
|
+
import { c as AnalystRunEvent, d as AnalystRunSummary, t as Analyst, u as AnalystRunResult } from "./types-DbGSC2No.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
/** Analyst metadata required before the exact registry path will execute it. */
|
|
4
4
|
interface ExactCapableAnalyst<TInput = unknown> extends Analyst<TInput> {
|
|
@@ -229,4 +229,4 @@ declare const exactExecutionPlanSchema: z.ZodObject<{
|
|
|
229
229
|
digest: z.ZodString;
|
|
230
230
|
}, z.core.$strict>;
|
|
231
231
|
export { ExactAnalystRunPolicySnapshot as a, ExactAnalystSnapshot as c, ExactExecutionComponentSnapshot as d, ExactAnalystRunEvent as i, ExactCapableAnalyst as l, ExactAnalystExecutionPlanSnapshot as n, ExactAnalystRunResult as o, ExactAnalystRunCompletion as r, ExactAnalystRunSummary as s, ExactAnalystBudgetSnapshot as t, ExactExecutionComponentIdentity as u };
|
|
232
|
-
//# sourceMappingURL=exact-types-
|
|
232
|
+
//# sourceMappingURL=exact-types-DEnrf7NX.d.ts.map
|