@tangle-network/agent-eval 0.209.1 → 0.210.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -1
- package/dist/adapters/http.d.ts +1 -1
- package/dist/analyst/index.d.ts +2 -2
- package/dist/analyst/index.js +1 -1
- package/dist/{analyze-runs-0cdYMgob.js → analyze-runs-3xpby3p2.js} +4 -4
- package/dist/analyze-runs-3xpby3p2.js.map +1 -0
- package/dist/{benchmark-command-Cve7mHNC.js → benchmark-command-S8tCtkxh.js} +3 -3
- package/dist/{benchmark-command-Cve7mHNC.js.map → benchmark-command-S8tCtkxh.js.map} +1 -1
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +2 -2
- package/dist/campaign/index.d.ts +2 -2
- package/dist/campaign/index.js +9 -9
- package/dist/{campaign-evidence-B5qsCHEn.js → campaign-evidence-OcUciD-N.js} +2 -2
- package/dist/campaign-evidence-OcUciD-N.js.map +1 -0
- package/dist/{campaign-CvhmiLKa.js → campaign-wvvJA1ps.js} +10 -10
- package/dist/{campaign-CvhmiLKa.js.map → campaign-wvvJA1ps.js.map} +1 -1
- package/dist/claude-jsonl-dZir12m6.js +86 -0
- package/dist/claude-jsonl-dZir12m6.js.map +1 -0
- package/dist/cli.js +4 -4
- package/dist/contract/index.d.ts +5 -5
- package/dist/contract/index.js +90 -14
- package/dist/contract/index.js.map +1 -1
- package/dist/counterfactual-DtMWvn7D.js.map +1 -1
- package/dist/{define-agent-eval-_nyV5nev.d.ts → define-agent-eval-B_zZY2AZ.d.ts} +3 -3
- package/dist/{define-agent-eval-_nyV5nev.d.ts.map → define-agent-eval-B_zZY2AZ.d.ts.map} +1 -1
- package/dist/{define-agent-eval-Csd47ur_.js → define-agent-eval-CoXXDCMu.js} +4 -4
- package/dist/{define-agent-eval-Csd47ur_.js.map → define-agent-eval-CoXXDCMu.js.map} +1 -1
- package/dist/diagnosis/index.js +1 -1
- package/dist/{eval-campaign-C31Qbv77.js → eval-campaign-4byTtqrf.js} +2 -2
- package/dist/{eval-campaign-C31Qbv77.js.map → eval-campaign-4byTtqrf.js.map} +1 -1
- package/dist/experiment/index.d.ts +1 -1
- package/dist/experiment/index.js +6 -6
- package/dist/feedback-trajectory-CX01700m.d.ts.map +1 -1
- package/dist/{index-H-u7f-w3.d.ts → index-D0_l25We.d.ts} +20 -41
- package/dist/{index-H-u7f-w3.d.ts.map → index-D0_l25We.d.ts.map} +1 -1
- package/dist/{index-BHh9Z9El.d.ts → index-DnZdBxCL.d.ts} +9 -6
- package/dist/{index-BHh9Z9El.d.ts.map → index-DnZdBxCL.d.ts.map} +1 -1
- package/dist/{index-Ddi5M-TQ.d.ts → index-xnhRdqik.d.ts} +3 -14
- package/dist/{index-Ddi5M-TQ.d.ts.map → index-xnhRdqik.d.ts.map} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/judge-gate-C59znGmR.js +638 -0
- package/dist/judge-gate-C59znGmR.js.map +1 -0
- package/dist/judge-gate-D2hCppem.d.ts +439 -0
- package/dist/judge-gate-D2hCppem.d.ts.map +1 -0
- package/dist/{llm-judge-C0256VT_.js → llm-judge-Tr7MBUnf.js} +6 -6
- package/dist/llm-judge-Tr7MBUnf.js.map +1 -0
- package/dist/meta-eval/index.d.ts +2 -132
- package/dist/meta-eval/index.d.ts.map +1 -1
- package/dist/meta-eval/index.js +2 -275
- package/dist/meta-eval/index.js.map +1 -1
- package/dist/openapi.json +1 -1
- package/dist/{paired-arms-B5v-X7No.js → paired-arms-DzKn0TfY.js} +2 -2
- package/dist/{paired-arms-B5v-X7No.js.map → paired-arms-DzKn0TfY.js.map} +1 -1
- package/dist/{paired-binary-b2L3WKqr.js → paired-binary-Q36bhn2R.js} +13 -9
- package/dist/paired-binary-Q36bhn2R.js.map +1 -0
- package/dist/{paired-promotion-decision-2deJ7sDX.js → paired-promotion-decision-BN6IQTiu.js} +2 -2
- package/dist/{paired-promotion-decision-2deJ7sDX.js.map → paired-promotion-decision-BN6IQTiu.js.map} +1 -1
- package/dist/{produced-state-CgB9g0VX.js → produced-state-CKybuR9F.js} +3 -3
- package/dist/produced-state-CKybuR9F.js.map +1 -0
- package/dist/{promotion-policy-CCmyEH_c.js → promotion-policy-CWW35UWq.js} +3 -3
- package/dist/{promotion-policy-CCmyEH_c.js.map → promotion-policy-CWW35UWq.js.map} +1 -1
- package/dist/reporting.js +2 -2
- package/dist/rl.js +3 -3
- package/dist/rollout/index.d.ts +2 -2
- package/dist/rollout/index.js +3 -3
- package/dist/{rollout-BZqQc0YY.js → rollout-D9bKKBnZ.js} +29 -164
- package/dist/rollout-D9bKKBnZ.js.map +1 -0
- package/dist/search/index.js +2 -2
- package/dist/{search-kernel-Bfe3kzRk.js → search-kernel-BIXWM7YV.js} +3 -3
- package/dist/search-kernel-BIXWM7YV.js.map +1 -0
- package/dist/{search-summary-DK1bwTAf.js → search-summary-nwrtXxC_.js} +3 -3
- package/dist/{search-summary-DK1bwTAf.js.map → search-summary-nwrtXxC_.js.map} +1 -1
- package/dist/{sequential-BOzBND4t.js → sequential-D-1PPCmM.js} +2 -2
- package/dist/{sequential-BOzBND4t.js.map → sequential-D-1PPCmM.js.map} +1 -1
- package/dist/{skillopt-optimization-method-BCojvoP1.js → skillopt-optimization-method-DujPOiwD.js} +4 -4
- package/dist/{skillopt-optimization-method-BCojvoP1.js.map → skillopt-optimization-method-DujPOiwD.js.map} +1 -1
- package/dist/{statistical-heldout-BP6iEJvR.js → statistical-heldout-1Gbmex7v.js} +2 -2
- package/dist/{statistical-heldout-BP6iEJvR.js.map → statistical-heldout-1Gbmex7v.js.map} +1 -1
- package/dist/{statistical-heldout-D0rX_IDl.d.ts → statistical-heldout-8RGPIeyo.d.ts} +14 -10
- package/dist/statistical-heldout-8RGPIeyo.d.ts.map +1 -0
- package/dist/{summary-report-BsaEFEwA.js → summary-report-DtdRucM0.js} +2 -2
- package/dist/{summary-report-BsaEFEwA.js.map → summary-report-DtdRucM0.js.map} +1 -1
- package/dist/supervisor-run/index.d.ts.map +1 -1
- package/dist/supervisor-run/index.js +34 -69
- package/dist/supervisor-run/index.js.map +1 -1
- package/dist/{tree-CZ78tiPg.js → tree-kc1d80yF.js} +3 -3
- package/dist/{tree-CZ78tiPg.js.map → tree-kc1d80yF.js.map} +1 -1
- package/docs/concepts.md +13 -0
- package/docs/experiment.md +10 -0
- package/docs/trace-analysis.md +3 -0
- package/package.json +4 -3
- package/dist/analyze-runs-0cdYMgob.js.map +0 -1
- package/dist/campaign-evidence-B5qsCHEn.js.map +0 -1
- package/dist/claude-jsonl-CG3JUbTJ.js +0 -211
- package/dist/claude-jsonl-CG3JUbTJ.js.map +0 -1
- package/dist/llm-judge-C0256VT_.js.map +0 -1
- package/dist/paired-binary-b2L3WKqr.js.map +0 -1
- package/dist/produced-state-CgB9g0VX.js.map +0 -1
- package/dist/rollout-BZqQc0YY.js.map +0 -1
- package/dist/search-kernel-Bfe3kzRk.js.map +0 -1
- package/dist/series-convergence-CjO2QdRW.js +0 -43
- package/dist/series-convergence-CjO2QdRW.js.map +0 -1
- package/dist/series-convergence-hEfKdoi-.d.ts +0 -126
- package/dist/series-convergence-hEfKdoi-.d.ts.map +0 -1
- package/dist/statistical-heldout-D0rX_IDl.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-campaign-C31Qbv77.js","names":[],"sources":["../src/eval-campaign.ts"],"sourcesContent":["/**\n * EvalCampaign — opinionated matrix runner that wires the four\n * capture-integrity directives by construction.\n *\n * The canonical benchmark shape — matrix runner → for each\n * (variant, scenario, seed) → start a TraceEmitter → call LLMs → end the\n * run → analyze — has a bug class at the integration boundary: raw\n * events not captured, route silently wrong, integrity not asserted,\n * analyst never run. The directives in `SKILL.md § Capture integrity`\n * are the mitigations.\n *\n * `EvalCampaign` is the structural fix — consumers don't wire the\n * integrity surface themselves; the campaign owns it. Specifically:\n *\n * - constructs a per-run `TraceStore` and `RawProviderSink` via factories\n * - builds the run's `ChatClient` through `chatFactory`, handing it the\n * run's raw sink and trace context — a transport built any other way has\n * no raw HTTP envelope, and `assertRunCaptured` says so\n * - calls `assertRunCaptured` after every `endRun` and routes failures\n * through a configurable policy (`throw` / `mark_failed` / `log`)\n * - assembles per-run `RunRecord`s and runs `researchReport` at the end\n * so the campaign artifact is launch-decision-grade by default\n * - embeds the campaign fingerprint (a SHA-256 over the canonicalised\n * run set) and optional `preregistrationHash` in the report\n *\n * The runner contract is intentionally narrow: produce a `CampaignRunOutcome`\n * given a fully-wired `CampaignRunContext`. Everything orchestration-shaped\n * lives in the campaign. This is the inversion-of-control point — consumers\n * stop writing matrix runners and start writing scenario-runners.\n *\n * Out of scope for v1 (tracked in `docs/research-report-methodology.md`):\n *\n * - Distributed/cluster execution (concurrency is local async)\n * - Adaptive sampling / sequential interim looks\n * - Resume from partial state across crashes\n * - LLM-call retry beyond what the caller's transport already does\n */\n\nimport {\n type AgentProfileCell,\n type AgentProfileCellInput,\n buildAgentProfileCell,\n verifyAgentProfileCell,\n} from './agent-profile-cell'\nimport type { ChatClient } from './analyst/chat-client'\nimport { hashJson } from './pre-registration'\nimport type {\n JudgeScoresRecord,\n RunCostProvenance,\n RunJudgeMetadata,\n RunOutcome,\n RunRecord,\n RunSplitTag,\n RunTaskFailure,\n RunTokenUsage,\n} from './run-record'\nimport { validateRunRecord } from './run-record'\nimport { type ResearchReport, type ResearchReportOptions, researchReport } from './summary-report'\nimport type { RunCompleteHook } from './trace/emitter'\nimport { TraceEmitter } from './trace/emitter'\nimport {\n assertRunCaptured,\n RunIntegrityError,\n type RunIntegrityExpectations,\n type RunIntegrityReport,\n} from './trace/integrity'\nimport { FileSystemRawProviderSink, type RawProviderSink } from './trace/raw-provider-sink'\nimport type { TraceStore } from './trace/store'\n\n// ── Public types ─────────────────────────────────────────────────────────\n\nexport interface CampaignVariant<V> {\n id: string\n payload: V\n}\n\nexport interface CampaignScenario {\n scenarioId: string\n /** Free-form metadata propagated to runs and reports. */\n tags?: Record<string, string>\n}\n\nexport interface CampaignRunContext<V> {\n /** Stable run id. The campaign generates this; the runner does not. */\n runId: string\n /** Logical experiment id (campaignId by default; overridable per-run via opts). */\n experimentId: string\n variant: V\n variantId: string\n scenarioId: string\n scenarioTags: Record<string, string>\n seed: number\n splitTag: RunSplitTag\n /**\n * The TraceEmitter for this run, with `onRunComplete` hooks pre-wired\n * (analyst auto-execution if configured, plus integrity check). The\n * runner MUST call `emitter.startRun` before doing any work and either\n * `emitter.endRun` or `emitter.abortRun` before returning.\n */\n emitter: TraceEmitter\n store: TraceStore\n rawSink: RawProviderSink\n /**\n * The run's model transport, built by `chatFactory` with this run's\n * `rawSink` and `runId` already bound.\n */\n chat: ChatClient\n}\n\n/** What the campaign binds into the run's transport. */\nexport interface CampaignChatWiring {\n /**\n * Raw provider sink for this run. Bind it into the transport: the campaign's\n * integrity check requires every LLM span to carry a matching raw request\n * event, so a transport built without it fails `assertRunCaptured`.\n */\n rawSink: RawProviderSink\n runId: string\n}\n\ninterface CampaignRunOutcomeFields {\n /** Did the run pass? Mirrors `RunOutcome.pass` semantics. */\n pass: boolean\n /** Score for the run on its split. Maps to `searchScore` or `holdoutScore`. */\n score: number\n /** Cost in USD, or null when the runner could not capture it. */\n costUsd: number | null\n /** Source of the cost amount. */\n costProvenance: RunCostProvenance\n tokenUsage: RunTokenUsage\n /** Snapshot model id (e.g. `claude-sonnet-4-6@2025-04-15`). */\n model: string\n /** sha256 of the effective prompt sent to the model. */\n promptHash: string\n /** sha256 of the effective config (model, temperature, tools, judges, splits). */\n configHash: string\n /** Optional extra numeric metrics to land in `outcome.raw`. */\n raw?: Record<string, number>\n /** Optional judge metadata when a judge was used. */\n judgeMetadata?: RunJudgeMetadata\n /**\n * Optional per-judge / per-dim breakdown for ensemble-judged runs.\n * Propagated to `outcome.judgeScores` on the resulting `RunRecord`.\n * Single-judge or scalar-only runs leave this unset.\n */\n judgeScores?: JudgeScoresRecord\n /**\n * Agent profile cell observed by the runner. When supplied, it overrides\n * `EvalCampaignOptions.agentProfile` for this run and must match the\n * outcome's `model` and `promptHash`.\n */\n agentProfile?: AgentProfileCell | AgentProfileCellInput\n}\n\n/** Campaign result with the same task-failure invariant as `RunRecord`. */\nexport type CampaignRunOutcome = CampaignRunOutcomeFields & RunTaskFailure\n\nexport type CampaignRunner<V> = (ctx: CampaignRunContext<V>) => Promise<CampaignRunOutcome>\n\nexport type CampaignIntegrityPolicy = 'throw' | 'mark_failed' | 'log'\n\nexport interface EvalCampaignOptions<V> {\n /**\n * Stable id for the campaign. Used as the default `experimentId` on\n * every run, and folded into the campaign fingerprint.\n */\n campaignId: string\n variants: CampaignVariant<V>[]\n scenarios: CampaignScenario[]\n /** Default `[0, 1, 2]`. */\n seeds?: number[]\n /** Default `'holdout'` — the split that anchors a launch decision. */\n splitTag?: RunSplitTag\n /** Git SHA the campaign is run against. Mandatory; `RunRecord` rejects unset. */\n commitSha: string\n /**\n * Build the model transport for one run. agent-eval executes no paid model:\n * the caller owns the transport and the credential never enters this\n * package. The campaign calls this once per run and passes the run's raw\n * provider sink and `runId`, so a transport that binds them captures the\n * raw HTTP envelope `assertRunCaptured` checks for.\n */\n chatFactory: (wiring: CampaignChatWiring) => ChatClient\n /**\n * Caller-declared identity of the execution route, folded into the campaign\n * fingerprint so two campaigns run against different endpoints do not share\n * one identity. agent-eval no longer knows the endpoint; the owner of\n * execution names it.\n */\n executionRef?: string\n /**\n * Per-run TraceStore factory. Common shape: a fresh store per run keyed\n * on `runId`. Implementations that share a store across the campaign\n * are valid — the campaign only writes through `emitter`.\n */\n storeFactory: (params: CampaignFactoryParams) => TraceStore\n /**\n * Per-run RawProviderSink factory. Defaults to `FileSystemRawProviderSink`\n * rooted at `${workDir}/raw-events/${runId}` if `workDir` is supplied;\n * otherwise required. Forensic capture is non-negotiable in a campaign\n * run — pass `NoopRawProviderSink` explicitly if you want to opt out.\n */\n rawSinkFactory?: (params: CampaignFactoryParams) => RawProviderSink\n /**\n * Filesystem root for default `rawSinkFactory`. Ignored if\n * `rawSinkFactory` is supplied.\n */\n workDir?: string\n /**\n * Extra `onRunComplete` hooks the campaign appends (after its own\n * integrity-check hook). Pass `traceAnalystOnRunComplete(...)` here.\n */\n onRunComplete?: RunCompleteHook[]\n /**\n * Per-run integrity expectations. Defaults to:\n * `{ llmSpansMin: 1, requireRawCoverageOfLlmSpans: true, requireOutcome: true }`.\n * Override (e.g. `{ llmSpansMin: 0 }`) for runs that don't call LLMs.\n */\n integrity?: RunIntegrityExpectations\n /** Behaviour when integrity fails. Default `'mark_failed'`. */\n onIntegrityFailure?: CampaignIntegrityPolicy\n /**\n * Per-run runner. Receives a fully-wired context; produces an outcome\n * the campaign converts into a `RunRecord`.\n */\n runner: CampaignRunner<V>\n /**\n * If set, the campaign computes `researchReport` at the end. `comparator`\n * is a `variantId`. Other fields are forwarded verbatim.\n */\n report?: { comparator?: string } & Omit<\n ResearchReportOptions,\n 'comparator' | 'preregistrationHash' | 'generatedAt'\n >\n /**\n * Hash of a signed `HypothesisManifest` (see `pre-registration.ts`).\n * Embedded in the campaign fingerprint and the research report.\n */\n preregistrationHash?: string\n /** Local concurrency. Default `1` (sequential). */\n concurrency?: number\n /**\n * Override the time source. Tests pass a mock to make wallMs deterministic.\n */\n now?: () => number\n /** Override the runId generator. Tests pin this. */\n runId?: (params: CampaignFactoryParams) => string\n /**\n * Agent profile cell for campaign runs. Static profiles can pass an object;\n * routers or variant-specific harnesses can pass a factory. The campaign\n * stamps the built cell onto every `RunRecord` and rejects profile/model or\n * profile/prompt contradictions.\n */\n agentProfile?:\n | AgentProfileCell\n | AgentProfileCellInput\n | ((\n params: CampaignFactoryParams & {\n variant: V\n scenarioTags: Record<string, string>\n },\n ) =>\n | AgentProfileCell\n | AgentProfileCellInput\n | Promise<AgentProfileCell | AgentProfileCellInput>)\n}\n\nexport interface CampaignFactoryParams {\n campaignId: string\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n}\n\nexport interface FailedRun {\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n reason: string\n error?: string\n}\n\nexport interface EvalCampaignResult {\n campaignId: string\n /** SHA-256 over canonicalised `(variantIds, scenarioIds, seeds, comparator, splitTag, executionRef, preregistrationHash)`. */\n campaignFingerprint: string\n preregistrationHash: string | null\n /** Successful runs only. Failed runs land in `failedRuns`. */\n runs: RunRecord[]\n /** Integrity reports for every successful run. */\n integrityReports: RunIntegrityReport[]\n failedRuns: FailedRun[]\n /** Computed when `report` is set on options. */\n report?: ResearchReport\n startedAt: string\n endedAt: string\n}\n\n// ── Implementation ───────────────────────────────────────────────────────\n\nconst DEFAULT_INTEGRITY: RunIntegrityExpectations = {\n llmSpansMin: 1,\n requireRawCoverageOfLlmSpans: true,\n requireOutcome: true,\n}\n\nexport async function runEvalCampaign<V>(\n opts: EvalCampaignOptions<V>,\n): Promise<EvalCampaignResult> {\n // ── Preflight ──────────────────────────────────────────────────────\n if (opts.variants.length === 0) {\n throw new Error('runEvalCampaign: variants must be non-empty.')\n }\n if (opts.scenarios.length === 0) {\n throw new Error('runEvalCampaign: scenarios must be non-empty.')\n }\n const variantIds = new Set<string>()\n for (const v of opts.variants) {\n if (variantIds.has(v.id)) {\n throw new Error(`runEvalCampaign: duplicate variant id \"${v.id}\".`)\n }\n variantIds.add(v.id)\n }\n const scenarioIds = new Set<string>()\n for (const s of opts.scenarios) {\n if (scenarioIds.has(s.scenarioId)) {\n throw new Error(`runEvalCampaign: duplicate scenarioId \"${s.scenarioId}\".`)\n }\n scenarioIds.add(s.scenarioId)\n }\n if (opts.report?.comparator && !variantIds.has(opts.report.comparator)) {\n throw new Error(\n `runEvalCampaign: report.comparator \"${opts.report.comparator}\" is not a configured variantId.`,\n )\n }\n if (!opts.commitSha) {\n throw new Error('runEvalCampaign: commitSha is required (every RunRecord needs it).')\n }\n\n const seeds = opts.seeds ?? [0, 1, 2]\n const splitTag: RunSplitTag = opts.splitTag ?? 'holdout'\n const concurrency = Math.max(1, opts.concurrency ?? 1)\n const integrity = { ...DEFAULT_INTEGRITY, ...(opts.integrity ?? {}) }\n const onIntegrityFailure: CampaignIntegrityPolicy = opts.onIntegrityFailure ?? 'mark_failed'\n const now = opts.now ?? (() => Date.now())\n const executionRef = opts.executionRef ?? null\n const preregistrationHash = opts.preregistrationHash ?? null\n\n const rawSinkFactory = opts.rawSinkFactory ?? defaultRawSinkFactory(opts.workDir)\n\n // ── Fingerprint ────────────────────────────────────────────────────\n const campaignFingerprint = await hashJson({\n campaignId: opts.campaignId,\n variants: opts.variants.map((v) => v.id).sort(),\n scenarios: opts.scenarios.map((s) => s.scenarioId).sort(),\n seeds: [...seeds].sort((a, b) => a - b),\n splitTag,\n comparator: opts.report?.comparator ?? null,\n executionRef,\n preregistrationHash,\n })\n\n // ── Plan the matrix ────────────────────────────────────────────────\n type Cell = { variant: CampaignVariant<V>; scenario: CampaignScenario; seed: number }\n const cells: Cell[] = []\n for (const variant of opts.variants) {\n for (const scenario of opts.scenarios) {\n for (const seed of seeds) {\n cells.push({ variant, scenario, seed })\n }\n }\n }\n\n const startedAt = new Date(now()).toISOString()\n const runs: RunRecord[] = []\n const integrityReports: RunIntegrityReport[] = []\n const failedRuns: FailedRun[] = []\n\n // ── Execute (bounded-concurrency worker pool) ──────────────────────\n // A genuine (non-CellExecutionError) error from any worker is a bug, not a\n // run-level failure. We must NOT let `Promise.all` reject mid-flight and\n // orphan the other workers' in-progress runs (emitters never finalized,\n // sinks/handles leak, partial work silently discarded). Instead: capture the\n // first genuine error, stop dispatching new cells so in-flight workers wind\n // down, finalize every still-open run, then re-throw the aggregated error.\n let cursor = 0\n let aborting = false\n const genuineErrors: unknown[] = []\n // Emitters for runs that are currently mid-flight, keyed by runId. A worker\n // registers its emitter before invoking the runner and removes it once the\n // run is finalized (via endRun/abortRun, success or failure). Anything left\n // here after the pool settles is an orphan we must abort.\n const openRuns = new Map<string, TraceEmitter>()\n\n async function worker(): Promise<void> {\n while (!aborting) {\n const i = cursor++\n if (i >= cells.length) return\n const cell = cells[i]!\n try {\n const result = await runOneCell(cell)\n runs.push(result.record)\n integrityReports.push(result.integrity)\n } catch (err) {\n if (err instanceof CellExecutionError) {\n failedRuns.push(err.failed)\n if (err.integrity) integrityReports.push(err.integrity)\n } else {\n // Genuine bug — not a runner failure, not an integrity failure.\n // Capture it and stop dispatching so peers wind down gracefully;\n // re-thrown after the pool settles. Do not surface here — that would\n // reject Promise.all and orphan the other workers' runs.\n genuineErrors.push(err)\n aborting = true\n return\n }\n }\n }\n }\n\n async function runOneCell(\n cell: Cell,\n ): Promise<{ record: RunRecord; integrity: RunIntegrityReport }> {\n const runId = (opts.runId ?? defaultRunId)({\n campaignId: opts.campaignId,\n runId: '', // unused by default generator\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n })\n const factoryParams: CampaignFactoryParams = {\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n }\n const store = opts.storeFactory(factoryParams)\n const rawSink = rawSinkFactory(factoryParams)\n\n const emitter = new TraceEmitter(store, {\n runId,\n now: opts.now,\n onRunComplete: opts.onRunComplete,\n })\n // Track this run as open so a genuine error elsewhere in the pool can\n // finalize it instead of orphaning it. Removed in the finally below.\n openRuns.set(runId, emitter)\n\n const chat = opts.chatFactory({ rawSink, runId })\n\n const ctx: CampaignRunContext<V> = {\n runId,\n experimentId: opts.campaignId,\n variant: cell.variant.payload,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n scenarioTags: cell.scenario.tags ?? {},\n seed: cell.seed,\n splitTag,\n emitter,\n store,\n rawSink,\n chat,\n }\n\n try {\n const wallStart = now()\n let outcome: CampaignRunOutcome\n try {\n outcome = await opts.runner(ctx)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n // The runner threw mid-execution. Abort the run so the emitter\n // finalizes. The only benign abortRun failure is \"the runner never\n // started the run\" (nothing to finalize). A store-write failure (disk\n // full, FS error) is a genuine diagnostic — surface it rather than\n // masking it as a plain runner failure.\n await finalizeAbort(emitter, runId, message)\n throw new CellExecutionError({\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'runner_threw',\n error: message,\n })\n }\n const wallMs = now() - wallStart\n\n const integrityReport = await assertRunCaptured(store, runId, { ...integrity, rawSink })\n if (!integrityReport.ok) {\n switch (onIntegrityFailure) {\n case 'throw':\n throw new RunIntegrityError(integrityReport)\n case 'mark_failed':\n throw new CellExecutionError(\n {\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'integrity_failed',\n error: integrityReport.issues.map((i) => i.code).join(', '),\n },\n integrityReport,\n )\n case 'log':\n // Caller wants the run admitted with a flagged report; fall through.\n break\n }\n }\n\n const recordOutcome: RunOutcome = {\n raw: outcome.raw ?? {},\n }\n if (splitTag === 'holdout') recordOutcome.holdoutScore = outcome.score\n else recordOutcome.searchScore = outcome.score\n if (outcome.judgeScores !== undefined) recordOutcome.judgeScores = outcome.judgeScores\n\n const record: RunRecord = {\n runId,\n experimentId: opts.campaignId,\n candidateId: cell.variant.id,\n seed: cell.seed,\n model: outcome.model,\n promptHash: outcome.promptHash,\n configHash: outcome.configHash,\n commitSha: opts.commitSha,\n wallMs,\n costUsd: outcome.costUsd,\n costProvenance: outcome.costProvenance,\n tokenUsage: outcome.tokenUsage,\n terminalOutcome: 'succeeded',\n judgeMetadata: outcome.judgeMetadata,\n outcome: recordOutcome,\n ...(outcome.failureClass ? { failureClass: outcome.failureClass } : {}),\n failureMode: outcome.failureMode,\n splitTag,\n scenarioId: cell.scenario.scenarioId,\n }\n const profileSource =\n outcome.agentProfile ??\n (typeof opts.agentProfile === 'function'\n ? await opts.agentProfile({\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n variant: cell.variant.payload,\n scenarioTags: cell.scenario.tags ?? {},\n })\n : opts.agentProfile)\n if (profileSource !== undefined) {\n const agentProfile = await resolveAgentProfileCell(profileSource)\n assertAgentProfileMatchesRun(agentProfile, outcome.model, outcome.promptHash)\n record.agentProfile = agentProfile\n }\n return { record: validateRunRecord(record), integrity: integrityReport }\n } finally {\n // This run's worker has finished with it (success, run-level failure, or\n // genuine error). It is no longer the pool's job to finalize — drop it so\n // the post-settle sweep doesn't double-abort a finalized run.\n openRuns.delete(runId)\n }\n }\n\n const workers = Array.from({ length: Math.min(concurrency, cells.length) }, () => worker())\n // allSettled (not all): a genuine error in one worker must not reject the\n // pool mid-flight and orphan the others. Each worker captures its own\n // genuine error into `genuineErrors` and returns; we re-throw below.\n await Promise.allSettled(workers)\n\n // Finalize any run still open after the pool wound down. With the\n // stop-dispatch flag these are the runs that were mid-flight in peer workers\n // when the first genuine error fired — abort them so their emitters finalize\n // (hooks fire, store records a terminal status) instead of leaking.\n for (const [runId, emitter] of openRuns) {\n await finalizeAbort(emitter, runId, 'campaign aborted: genuine error in a sibling run')\n }\n openRuns.clear()\n\n if (genuineErrors.length > 0) {\n throw genuineErrors.length === 1\n ? genuineErrors[0]\n : new AggregateError(\n genuineErrors,\n `runEvalCampaign: ${genuineErrors.length} runs failed with genuine (non-run-level) errors`,\n )\n }\n\n // ── Optional research report ───────────────────────────────────────\n let report: ResearchReport | undefined\n if (opts.report) {\n const reportOpts: ResearchReportOptions = {\n ...opts.report,\n comparator: opts.report.comparator,\n split: splitTag === 'dev' ? 'search' : splitTag,\n generatedAt: new Date(now()).toISOString(),\n preregistrationHash: preregistrationHash ?? undefined,\n }\n report = await researchReport(runs, reportOpts)\n }\n\n const endedAt = new Date(now()).toISOString()\n\n return {\n campaignId: opts.campaignId,\n campaignFingerprint,\n preregistrationHash,\n runs,\n integrityReports,\n failedRuns,\n report,\n startedAt,\n endedAt,\n }\n}\n\n// ── Internal ─────────────────────────────────────────────────────────────\n\nclass CellExecutionError extends Error {\n readonly failed: FailedRun\n readonly integrity?: RunIntegrityReport\n constructor(failed: FailedRun, integrity?: RunIntegrityReport) {\n super(`cell ${failed.variantId}/${failed.scenarioId}@${failed.seed} failed: ${failed.reason}`)\n this.failed = failed\n this.integrity = integrity\n }\n}\n\n/**\n * Abort a run whose owning work threw or was orphaned by a sibling's genuine\n * error, finalizing the emitter so hooks fire and the store records a terminal\n * status. Safe to call unconditionally: it only aborts runs that are still\n * `running`. Two no-op cases are intentional and benign:\n *\n * - the run was never started (absent from the store) — nothing to finalize\n * - the run is already terminal (`completed` / `failed` / `aborted`) —\n * finalizing again would overwrite the real outcome (e.g. flip a passed run\n * to `aborted` with `{ pass: false, notes: reason }`), so we leave it alone\n *\n * Any OTHER failure of the store read or the abort write (disk full, FS fault,\n * backend down) is a genuine diagnostic and propagates rather than being\n * swallowed.\n */\nexport async function finalizeAbort(\n emitter: TraceEmitter,\n runId: string,\n reason: string,\n): Promise<void> {\n const existing = await emitter.traceStore.getRun(runId)\n if (existing === undefined) return // run never started; nothing to abort\n if (existing.status !== 'running') return // already finalized; never overwrite a real outcome\n // The emitter never throws on a failed store write; it counts it. A failed\n // abort write is a genuine diagnostic here, so read the count and surface it.\n const droppedBefore = emitter.captureStats().dropped\n await emitter.abortRun(reason)\n const after = emitter.captureStats()\n if (after.dropped > droppedBefore) {\n throw new Error(`finalizeAbort: run ${runId} could not be finalized: ${after.lastError}`)\n }\n}\n\nfunction defaultRawSinkFactory(workDir: string | undefined) {\n return (params: CampaignFactoryParams): RawProviderSink => {\n if (!workDir) {\n throw new Error(\n 'runEvalCampaign: rawSinkFactory not supplied and workDir not set. Pass either to enable raw provider capture, or pass `new NoopRawProviderSink()` via rawSinkFactory to opt out explicitly.',\n )\n }\n return new FileSystemRawProviderSink({\n dir: `${workDir}/raw-events/${params.runId}`,\n })\n }\n}\n\nasync function resolveAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): Promise<AgentProfileCell> {\n if (isAgentProfileCell(input)) {\n if (!(await verifyAgentProfileCell(input))) {\n throw new Error(`runEvalCampaign: agentProfile.cellId does not match its content`)\n }\n return input\n }\n return buildAgentProfileCell(input)\n}\n\nfunction isAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): input is AgentProfileCell {\n return 'schemaVersion' in input && 'cellId' in input\n}\n\nfunction assertAgentProfileMatchesRun(\n profile: AgentProfileCell,\n model: string,\n promptHash: string,\n): void {\n if (profile.model !== undefined && profile.model !== model) {\n throw new Error(\n `runEvalCampaign: agentProfile.model \"${profile.model}\" does not match outcome.model \"${model}\"`,\n )\n }\n if (profile.promptHash !== undefined && profile.promptHash !== promptHash) {\n throw new Error(\n `runEvalCampaign: agentProfile.promptHash \"${profile.promptHash}\" does not match outcome.promptHash \"${promptHash}\"`,\n )\n }\n}\n\nfunction defaultRunId(params: CampaignFactoryParams): string {\n // Stable across re-runs: fingerprint of (campaignId, variantId, scenarioId, seed).\n // Caller can override via opts.runId for non-deterministic IDs.\n const base = `${params.campaignId}::${params.variantId}::${params.scenarioId}::${params.seed}`\n // TWO 32-bit FNV-1a accumulators with different offsets, concatenated for a\n // 64-bit-wide id. Not crypto-grade; stability and uniqueness are what this\n // needs. Frozen: the value names a persisted cell, and the second\n // accumulator's offset is part of the identity, so no single-accumulator\n // helper can replace it.\n let h1 = 0x811c9dc5\n let h2 = 0x12345678\n for (let i = 0; i < base.length; i++) {\n const c = base.charCodeAt(i)\n h1 = Math.imul(h1 ^ c, 0x01000193) >>> 0\n h2 = Math.imul(h2 ^ c, 0x9e3779b1) >>> 0\n }\n return `run-${h1.toString(16).padStart(8, '0')}${h2.toString(16).padStart(8, '0')}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8SA,MAAM,oBAA8C;CAClD,aAAa;CACb,8BAA8B;CAC9B,gBAAgB;AAClB;AAEA,eAAsB,gBACpB,MAC6B;CAE7B,IAAI,KAAK,SA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C,SACH,MAAM,IAAI,MACR,6LACF;EAEF,OAAO,IAAI,0BAA0B,EACnC,KAAK,GAAG,QAAQ,cAAc,OAAO,QACvC,CAAC;CACH;AACF;AAEA,eAAe,wBACb,OAC2B;CAC3B,IAAI,mBAAmB,KAAK,GAAG;EAC7B,IAAI,CAAE,MAAM,uBAAuB,KAAK,GACtC,MAAM,IAAI,MAAM,iEAAiE;EAEnF,OAAO;CACT;CACA,OAAO,sBAAsB,KAAK;AACpC;AAEA,SAAS,mBACP,OAC2B;CAC3B,OAAO,mBAAmB,SAAS,YAAY;AACjD;AAEA,SAAS,6BACP,SACA,OACA,YACM;CACN,IAAI,QAAQ,UAAU,KAAA,KAAa,QAAQ,UAAU,OACnD,MAAM,IAAI,MACR,wCAAwC,QAAQ,MAAM,kCAAkC,MAAM,EAChG;CAEF,IAAI,QAAQ,eAAe,KAAA,KAAa,QAAQ,eAAe,YAC7D,MAAM,IAAI,MACR,6CAA6C,QAAQ,WAAW,uCAAuC,WAAW,EACpH;AAEJ;AAEA,SAAS,aAAa,QAAuC;CAG3D,MAAM,OAAO,GAAG,OAAO,WAAW,IAAI,OAAO,UAAU,IAAI,OAAO,WAAW,IAAI,OAAO;CAMxF,IAAI,KAAK;CACT,IAAI,KAAK;CACT,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,IAAI,KAAK,WAAW,CAAC;EAC3B,KAAK,KAAK,KAAK,KAAK,GAAG,QAAU,MAAM;EACvC,KAAK,KAAK,KAAK,KAAK,GAAG,UAAU,MAAM;CACzC;CACA,OAAO,OAAO,GAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAClF"}
|
|
1
|
+
{"version":3,"file":"eval-campaign-4byTtqrf.js","names":[],"sources":["../src/eval-campaign.ts"],"sourcesContent":["/**\n * EvalCampaign — opinionated matrix runner that wires the four\n * capture-integrity directives by construction.\n *\n * The canonical benchmark shape — matrix runner → for each\n * (variant, scenario, seed) → start a TraceEmitter → call LLMs → end the\n * run → analyze — has a bug class at the integration boundary: raw\n * events not captured, route silently wrong, integrity not asserted,\n * analyst never run. The directives in `SKILL.md § Capture integrity`\n * are the mitigations.\n *\n * `EvalCampaign` is the structural fix — consumers don't wire the\n * integrity surface themselves; the campaign owns it. Specifically:\n *\n * - constructs a per-run `TraceStore` and `RawProviderSink` via factories\n * - builds the run's `ChatClient` through `chatFactory`, handing it the\n * run's raw sink and trace context — a transport built any other way has\n * no raw HTTP envelope, and `assertRunCaptured` says so\n * - calls `assertRunCaptured` after every `endRun` and routes failures\n * through a configurable policy (`throw` / `mark_failed` / `log`)\n * - assembles per-run `RunRecord`s and runs `researchReport` at the end\n * so the campaign artifact is launch-decision-grade by default\n * - embeds the campaign fingerprint (a SHA-256 over the canonicalised\n * run set) and optional `preregistrationHash` in the report\n *\n * The runner contract is intentionally narrow: produce a `CampaignRunOutcome`\n * given a fully-wired `CampaignRunContext`. Everything orchestration-shaped\n * lives in the campaign. This is the inversion-of-control point — consumers\n * stop writing matrix runners and start writing scenario-runners.\n *\n * Out of scope for v1 (tracked in `docs/research-report-methodology.md`):\n *\n * - Distributed/cluster execution (concurrency is local async)\n * - Adaptive sampling / sequential interim looks\n * - Resume from partial state across crashes\n * - LLM-call retry beyond what the caller's transport already does\n */\n\nimport {\n type AgentProfileCell,\n type AgentProfileCellInput,\n buildAgentProfileCell,\n verifyAgentProfileCell,\n} from './agent-profile-cell'\nimport type { ChatClient } from './analyst/chat-client'\nimport { hashJson } from './pre-registration'\nimport type {\n JudgeScoresRecord,\n RunCostProvenance,\n RunJudgeMetadata,\n RunOutcome,\n RunRecord,\n RunSplitTag,\n RunTaskFailure,\n RunTokenUsage,\n} from './run-record'\nimport { validateRunRecord } from './run-record'\nimport { type ResearchReport, type ResearchReportOptions, researchReport } from './summary-report'\nimport type { RunCompleteHook } from './trace/emitter'\nimport { TraceEmitter } from './trace/emitter'\nimport {\n assertRunCaptured,\n RunIntegrityError,\n type RunIntegrityExpectations,\n type RunIntegrityReport,\n} from './trace/integrity'\nimport { FileSystemRawProviderSink, type RawProviderSink } from './trace/raw-provider-sink'\nimport type { TraceStore } from './trace/store'\n\n// ── Public types ─────────────────────────────────────────────────────────\n\nexport interface CampaignVariant<V> {\n id: string\n payload: V\n}\n\nexport interface CampaignScenario {\n scenarioId: string\n /** Free-form metadata propagated to runs and reports. */\n tags?: Record<string, string>\n}\n\nexport interface CampaignRunContext<V> {\n /** Stable run id. The campaign generates this; the runner does not. */\n runId: string\n /** Logical experiment id (campaignId by default; overridable per-run via opts). */\n experimentId: string\n variant: V\n variantId: string\n scenarioId: string\n scenarioTags: Record<string, string>\n seed: number\n splitTag: RunSplitTag\n /**\n * The TraceEmitter for this run, with `onRunComplete` hooks pre-wired\n * (analyst auto-execution if configured, plus integrity check). The\n * runner MUST call `emitter.startRun` before doing any work and either\n * `emitter.endRun` or `emitter.abortRun` before returning.\n */\n emitter: TraceEmitter\n store: TraceStore\n rawSink: RawProviderSink\n /**\n * The run's model transport, built by `chatFactory` with this run's\n * `rawSink` and `runId` already bound.\n */\n chat: ChatClient\n}\n\n/** What the campaign binds into the run's transport. */\nexport interface CampaignChatWiring {\n /**\n * Raw provider sink for this run. Bind it into the transport: the campaign's\n * integrity check requires every LLM span to carry a matching raw request\n * event, so a transport built without it fails `assertRunCaptured`.\n */\n rawSink: RawProviderSink\n runId: string\n}\n\ninterface CampaignRunOutcomeFields {\n /** Did the run pass? Mirrors `RunOutcome.pass` semantics. */\n pass: boolean\n /** Score for the run on its split. Maps to `searchScore` or `holdoutScore`. */\n score: number\n /** Cost in USD, or null when the runner could not capture it. */\n costUsd: number | null\n /** Source of the cost amount. */\n costProvenance: RunCostProvenance\n tokenUsage: RunTokenUsage\n /** Snapshot model id (e.g. `claude-sonnet-4-6@2025-04-15`). */\n model: string\n /** sha256 of the effective prompt sent to the model. */\n promptHash: string\n /** sha256 of the effective config (model, temperature, tools, judges, splits). */\n configHash: string\n /** Optional extra numeric metrics to land in `outcome.raw`. */\n raw?: Record<string, number>\n /** Optional judge metadata when a judge was used. */\n judgeMetadata?: RunJudgeMetadata\n /**\n * Optional per-judge / per-dim breakdown for ensemble-judged runs.\n * Propagated to `outcome.judgeScores` on the resulting `RunRecord`.\n * Single-judge or scalar-only runs leave this unset.\n */\n judgeScores?: JudgeScoresRecord\n /**\n * Agent profile cell observed by the runner. When supplied, it overrides\n * `EvalCampaignOptions.agentProfile` for this run and must match the\n * outcome's `model` and `promptHash`.\n */\n agentProfile?: AgentProfileCell | AgentProfileCellInput\n}\n\n/** Campaign result with the same task-failure invariant as `RunRecord`. */\nexport type CampaignRunOutcome = CampaignRunOutcomeFields & RunTaskFailure\n\nexport type CampaignRunner<V> = (ctx: CampaignRunContext<V>) => Promise<CampaignRunOutcome>\n\nexport type CampaignIntegrityPolicy = 'throw' | 'mark_failed' | 'log'\n\nexport interface EvalCampaignOptions<V> {\n /**\n * Stable id for the campaign. Used as the default `experimentId` on\n * every run, and folded into the campaign fingerprint.\n */\n campaignId: string\n variants: CampaignVariant<V>[]\n scenarios: CampaignScenario[]\n /** Default `[0, 1, 2]`. */\n seeds?: number[]\n /** Default `'holdout'` — the split that anchors a launch decision. */\n splitTag?: RunSplitTag\n /** Git SHA the campaign is run against. Mandatory; `RunRecord` rejects unset. */\n commitSha: string\n /**\n * Build the model transport for one run. agent-eval executes no paid model:\n * the caller owns the transport and the credential never enters this\n * package. The campaign calls this once per run and passes the run's raw\n * provider sink and `runId`, so a transport that binds them captures the\n * raw HTTP envelope `assertRunCaptured` checks for.\n */\n chatFactory: (wiring: CampaignChatWiring) => ChatClient\n /**\n * Caller-declared identity of the execution route, folded into the campaign\n * fingerprint so two campaigns run against different endpoints do not share\n * one identity. agent-eval no longer knows the endpoint; the owner of\n * execution names it.\n */\n executionRef?: string\n /**\n * Per-run TraceStore factory. Common shape: a fresh store per run keyed\n * on `runId`. Implementations that share a store across the campaign\n * are valid — the campaign only writes through `emitter`.\n */\n storeFactory: (params: CampaignFactoryParams) => TraceStore\n /**\n * Per-run RawProviderSink factory. Defaults to `FileSystemRawProviderSink`\n * rooted at `${workDir}/raw-events/${runId}` if `workDir` is supplied;\n * otherwise required. Forensic capture is non-negotiable in a campaign\n * run — pass `NoopRawProviderSink` explicitly if you want to opt out.\n */\n rawSinkFactory?: (params: CampaignFactoryParams) => RawProviderSink\n /**\n * Filesystem root for default `rawSinkFactory`. Ignored if\n * `rawSinkFactory` is supplied.\n */\n workDir?: string\n /**\n * Extra `onRunComplete` hooks the campaign appends (after its own\n * integrity-check hook). Pass `traceAnalystOnRunComplete(...)` here.\n */\n onRunComplete?: RunCompleteHook[]\n /**\n * Per-run integrity expectations. Defaults to:\n * `{ llmSpansMin: 1, requireRawCoverageOfLlmSpans: true, requireOutcome: true }`.\n * Override (e.g. `{ llmSpansMin: 0 }`) for runs that don't call LLMs.\n */\n integrity?: RunIntegrityExpectations\n /** Behaviour when integrity fails. Default `'mark_failed'`. */\n onIntegrityFailure?: CampaignIntegrityPolicy\n /**\n * Per-run runner. Receives a fully-wired context; produces an outcome\n * the campaign converts into a `RunRecord`.\n */\n runner: CampaignRunner<V>\n /**\n * If set, the campaign computes `researchReport` at the end. `comparator`\n * is a `variantId`. Other fields are forwarded verbatim.\n */\n report?: { comparator?: string } & Omit<\n ResearchReportOptions,\n 'comparator' | 'preregistrationHash' | 'generatedAt'\n >\n /**\n * Hash of a signed `HypothesisManifest` (see `pre-registration.ts`).\n * Embedded in the campaign fingerprint and the research report.\n */\n preregistrationHash?: string\n /** Local concurrency. Default `1` (sequential). */\n concurrency?: number\n /**\n * Override the time source. Tests pass a mock to make wallMs deterministic.\n */\n now?: () => number\n /** Override the runId generator. Tests pin this. */\n runId?: (params: CampaignFactoryParams) => string\n /**\n * Agent profile cell for campaign runs. Static profiles can pass an object;\n * routers or variant-specific harnesses can pass a factory. The campaign\n * stamps the built cell onto every `RunRecord` and rejects profile/model or\n * profile/prompt contradictions.\n */\n agentProfile?:\n | AgentProfileCell\n | AgentProfileCellInput\n | ((\n params: CampaignFactoryParams & {\n variant: V\n scenarioTags: Record<string, string>\n },\n ) =>\n | AgentProfileCell\n | AgentProfileCellInput\n | Promise<AgentProfileCell | AgentProfileCellInput>)\n}\n\nexport interface CampaignFactoryParams {\n campaignId: string\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n}\n\nexport interface FailedRun {\n runId: string\n variantId: string\n scenarioId: string\n seed: number\n reason: string\n error?: string\n}\n\nexport interface EvalCampaignResult {\n campaignId: string\n /** SHA-256 over canonicalised `(variantIds, scenarioIds, seeds, comparator, splitTag, executionRef, preregistrationHash)`. */\n campaignFingerprint: string\n preregistrationHash: string | null\n /** Successful runs only. Failed runs land in `failedRuns`. */\n runs: RunRecord[]\n /** Integrity reports for every successful run. */\n integrityReports: RunIntegrityReport[]\n failedRuns: FailedRun[]\n /** Computed when `report` is set on options. */\n report?: ResearchReport\n startedAt: string\n endedAt: string\n}\n\n// ── Implementation ───────────────────────────────────────────────────────\n\nconst DEFAULT_INTEGRITY: RunIntegrityExpectations = {\n llmSpansMin: 1,\n requireRawCoverageOfLlmSpans: true,\n requireOutcome: true,\n}\n\nexport async function runEvalCampaign<V>(\n opts: EvalCampaignOptions<V>,\n): Promise<EvalCampaignResult> {\n // ── Preflight ──────────────────────────────────────────────────────\n if (opts.variants.length === 0) {\n throw new Error('runEvalCampaign: variants must be non-empty.')\n }\n if (opts.scenarios.length === 0) {\n throw new Error('runEvalCampaign: scenarios must be non-empty.')\n }\n const variantIds = new Set<string>()\n for (const v of opts.variants) {\n if (variantIds.has(v.id)) {\n throw new Error(`runEvalCampaign: duplicate variant id \"${v.id}\".`)\n }\n variantIds.add(v.id)\n }\n const scenarioIds = new Set<string>()\n for (const s of opts.scenarios) {\n if (scenarioIds.has(s.scenarioId)) {\n throw new Error(`runEvalCampaign: duplicate scenarioId \"${s.scenarioId}\".`)\n }\n scenarioIds.add(s.scenarioId)\n }\n if (opts.report?.comparator && !variantIds.has(opts.report.comparator)) {\n throw new Error(\n `runEvalCampaign: report.comparator \"${opts.report.comparator}\" is not a configured variantId.`,\n )\n }\n if (!opts.commitSha) {\n throw new Error('runEvalCampaign: commitSha is required (every RunRecord needs it).')\n }\n\n const seeds = opts.seeds ?? [0, 1, 2]\n const splitTag: RunSplitTag = opts.splitTag ?? 'holdout'\n const concurrency = Math.max(1, opts.concurrency ?? 1)\n const integrity = { ...DEFAULT_INTEGRITY, ...(opts.integrity ?? {}) }\n const onIntegrityFailure: CampaignIntegrityPolicy = opts.onIntegrityFailure ?? 'mark_failed'\n const now = opts.now ?? (() => Date.now())\n const executionRef = opts.executionRef ?? null\n const preregistrationHash = opts.preregistrationHash ?? null\n\n const rawSinkFactory = opts.rawSinkFactory ?? defaultRawSinkFactory(opts.workDir)\n\n // ── Fingerprint ────────────────────────────────────────────────────\n const campaignFingerprint = await hashJson({\n campaignId: opts.campaignId,\n variants: opts.variants.map((v) => v.id).sort(),\n scenarios: opts.scenarios.map((s) => s.scenarioId).sort(),\n seeds: [...seeds].sort((a, b) => a - b),\n splitTag,\n comparator: opts.report?.comparator ?? null,\n executionRef,\n preregistrationHash,\n })\n\n // ── Plan the matrix ────────────────────────────────────────────────\n type Cell = { variant: CampaignVariant<V>; scenario: CampaignScenario; seed: number }\n const cells: Cell[] = []\n for (const variant of opts.variants) {\n for (const scenario of opts.scenarios) {\n for (const seed of seeds) {\n cells.push({ variant, scenario, seed })\n }\n }\n }\n\n const startedAt = new Date(now()).toISOString()\n const runs: RunRecord[] = []\n const integrityReports: RunIntegrityReport[] = []\n const failedRuns: FailedRun[] = []\n\n // ── Execute (bounded-concurrency worker pool) ──────────────────────\n // A genuine (non-CellExecutionError) error from any worker is a bug, not a\n // run-level failure. We must NOT let `Promise.all` reject mid-flight and\n // orphan the other workers' in-progress runs (emitters never finalized,\n // sinks/handles leak, partial work silently discarded). Instead: capture the\n // first genuine error, stop dispatching new cells so in-flight workers wind\n // down, finalize every still-open run, then re-throw the aggregated error.\n let cursor = 0\n let aborting = false\n const genuineErrors: unknown[] = []\n // Emitters for runs that are currently mid-flight, keyed by runId. A worker\n // registers its emitter before invoking the runner and removes it once the\n // run is finalized (via endRun/abortRun, success or failure). Anything left\n // here after the pool settles is an orphan we must abort.\n const openRuns = new Map<string, TraceEmitter>()\n\n async function worker(): Promise<void> {\n while (!aborting) {\n const i = cursor++\n if (i >= cells.length) return\n const cell = cells[i]!\n try {\n const result = await runOneCell(cell)\n runs.push(result.record)\n integrityReports.push(result.integrity)\n } catch (err) {\n if (err instanceof CellExecutionError) {\n failedRuns.push(err.failed)\n if (err.integrity) integrityReports.push(err.integrity)\n } else {\n // Genuine bug — not a runner failure, not an integrity failure.\n // Capture it and stop dispatching so peers wind down gracefully;\n // re-thrown after the pool settles. Do not surface here — that would\n // reject Promise.all and orphan the other workers' runs.\n genuineErrors.push(err)\n aborting = true\n return\n }\n }\n }\n }\n\n async function runOneCell(\n cell: Cell,\n ): Promise<{ record: RunRecord; integrity: RunIntegrityReport }> {\n const runId = (opts.runId ?? defaultRunId)({\n campaignId: opts.campaignId,\n runId: '', // unused by default generator\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n })\n const factoryParams: CampaignFactoryParams = {\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n }\n const store = opts.storeFactory(factoryParams)\n const rawSink = rawSinkFactory(factoryParams)\n\n const emitter = new TraceEmitter(store, {\n runId,\n now: opts.now,\n onRunComplete: opts.onRunComplete,\n })\n // Track this run as open so a genuine error elsewhere in the pool can\n // finalize it instead of orphaning it. Removed in the finally below.\n openRuns.set(runId, emitter)\n\n const chat = opts.chatFactory({ rawSink, runId })\n\n const ctx: CampaignRunContext<V> = {\n runId,\n experimentId: opts.campaignId,\n variant: cell.variant.payload,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n scenarioTags: cell.scenario.tags ?? {},\n seed: cell.seed,\n splitTag,\n emitter,\n store,\n rawSink,\n chat,\n }\n\n try {\n const wallStart = now()\n let outcome: CampaignRunOutcome\n try {\n outcome = await opts.runner(ctx)\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err)\n // The runner threw mid-execution. Abort the run so the emitter\n // finalizes. The only benign abortRun failure is \"the runner never\n // started the run\" (nothing to finalize). A store-write failure (disk\n // full, FS error) is a genuine diagnostic — surface it rather than\n // masking it as a plain runner failure.\n await finalizeAbort(emitter, runId, message)\n throw new CellExecutionError({\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'runner_threw',\n error: message,\n })\n }\n const wallMs = now() - wallStart\n\n const integrityReport = await assertRunCaptured(store, runId, { ...integrity, rawSink })\n if (!integrityReport.ok) {\n switch (onIntegrityFailure) {\n case 'throw':\n throw new RunIntegrityError(integrityReport)\n case 'mark_failed':\n throw new CellExecutionError(\n {\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n reason: 'integrity_failed',\n error: integrityReport.issues.map((i) => i.code).join(', '),\n },\n integrityReport,\n )\n case 'log':\n // Caller wants the run admitted with a flagged report; fall through.\n break\n }\n }\n\n const recordOutcome: RunOutcome = {\n raw: outcome.raw ?? {},\n }\n if (splitTag === 'holdout') recordOutcome.holdoutScore = outcome.score\n else recordOutcome.searchScore = outcome.score\n if (outcome.judgeScores !== undefined) recordOutcome.judgeScores = outcome.judgeScores\n\n const record: RunRecord = {\n runId,\n experimentId: opts.campaignId,\n candidateId: cell.variant.id,\n seed: cell.seed,\n model: outcome.model,\n promptHash: outcome.promptHash,\n configHash: outcome.configHash,\n commitSha: opts.commitSha,\n wallMs,\n costUsd: outcome.costUsd,\n costProvenance: outcome.costProvenance,\n tokenUsage: outcome.tokenUsage,\n terminalOutcome: 'succeeded',\n judgeMetadata: outcome.judgeMetadata,\n outcome: recordOutcome,\n ...(outcome.failureClass ? { failureClass: outcome.failureClass } : {}),\n failureMode: outcome.failureMode,\n splitTag,\n scenarioId: cell.scenario.scenarioId,\n }\n const profileSource =\n outcome.agentProfile ??\n (typeof opts.agentProfile === 'function'\n ? await opts.agentProfile({\n campaignId: opts.campaignId,\n runId,\n variantId: cell.variant.id,\n scenarioId: cell.scenario.scenarioId,\n seed: cell.seed,\n variant: cell.variant.payload,\n scenarioTags: cell.scenario.tags ?? {},\n })\n : opts.agentProfile)\n if (profileSource !== undefined) {\n const agentProfile = await resolveAgentProfileCell(profileSource)\n assertAgentProfileMatchesRun(agentProfile, outcome.model, outcome.promptHash)\n record.agentProfile = agentProfile\n }\n return { record: validateRunRecord(record), integrity: integrityReport }\n } finally {\n // This run's worker has finished with it (success, run-level failure, or\n // genuine error). It is no longer the pool's job to finalize — drop it so\n // the post-settle sweep doesn't double-abort a finalized run.\n openRuns.delete(runId)\n }\n }\n\n const workers = Array.from({ length: Math.min(concurrency, cells.length) }, () => worker())\n // allSettled (not all): a genuine error in one worker must not reject the\n // pool mid-flight and orphan the others. Each worker captures its own\n // genuine error into `genuineErrors` and returns; we re-throw below.\n await Promise.allSettled(workers)\n\n // Finalize any run still open after the pool wound down. With the\n // stop-dispatch flag these are the runs that were mid-flight in peer workers\n // when the first genuine error fired — abort them so their emitters finalize\n // (hooks fire, store records a terminal status) instead of leaking.\n for (const [runId, emitter] of openRuns) {\n await finalizeAbort(emitter, runId, 'campaign aborted: genuine error in a sibling run')\n }\n openRuns.clear()\n\n if (genuineErrors.length > 0) {\n throw genuineErrors.length === 1\n ? genuineErrors[0]\n : new AggregateError(\n genuineErrors,\n `runEvalCampaign: ${genuineErrors.length} runs failed with genuine (non-run-level) errors`,\n )\n }\n\n // ── Optional research report ───────────────────────────────────────\n let report: ResearchReport | undefined\n if (opts.report) {\n const reportOpts: ResearchReportOptions = {\n ...opts.report,\n comparator: opts.report.comparator,\n split: splitTag === 'dev' ? 'search' : splitTag,\n generatedAt: new Date(now()).toISOString(),\n preregistrationHash: preregistrationHash ?? undefined,\n }\n report = await researchReport(runs, reportOpts)\n }\n\n const endedAt = new Date(now()).toISOString()\n\n return {\n campaignId: opts.campaignId,\n campaignFingerprint,\n preregistrationHash,\n runs,\n integrityReports,\n failedRuns,\n report,\n startedAt,\n endedAt,\n }\n}\n\n// ── Internal ─────────────────────────────────────────────────────────────\n\nclass CellExecutionError extends Error {\n readonly failed: FailedRun\n readonly integrity?: RunIntegrityReport\n constructor(failed: FailedRun, integrity?: RunIntegrityReport) {\n super(`cell ${failed.variantId}/${failed.scenarioId}@${failed.seed} failed: ${failed.reason}`)\n this.failed = failed\n this.integrity = integrity\n }\n}\n\n/**\n * Abort a run whose owning work threw or was orphaned by a sibling's genuine\n * error, finalizing the emitter so hooks fire and the store records a terminal\n * status. Safe to call unconditionally: it only aborts runs that are still\n * `running`. Two no-op cases are intentional and benign:\n *\n * - the run was never started (absent from the store) — nothing to finalize\n * - the run is already terminal (`completed` / `failed` / `aborted`) —\n * finalizing again would overwrite the real outcome (e.g. flip a passed run\n * to `aborted` with `{ pass: false, notes: reason }`), so we leave it alone\n *\n * Any OTHER failure of the store read or the abort write (disk full, FS fault,\n * backend down) is a genuine diagnostic and propagates rather than being\n * swallowed.\n */\nexport async function finalizeAbort(\n emitter: TraceEmitter,\n runId: string,\n reason: string,\n): Promise<void> {\n const existing = await emitter.traceStore.getRun(runId)\n if (existing === undefined) return // run never started; nothing to abort\n if (existing.status !== 'running') return // already finalized; never overwrite a real outcome\n // The emitter never throws on a failed store write; it counts it. A failed\n // abort write is a genuine diagnostic here, so read the count and surface it.\n const droppedBefore = emitter.captureStats().dropped\n await emitter.abortRun(reason)\n const after = emitter.captureStats()\n if (after.dropped > droppedBefore) {\n throw new Error(`finalizeAbort: run ${runId} could not be finalized: ${after.lastError}`)\n }\n}\n\nfunction defaultRawSinkFactory(workDir: string | undefined) {\n return (params: CampaignFactoryParams): RawProviderSink => {\n if (!workDir) {\n throw new Error(\n 'runEvalCampaign: rawSinkFactory not supplied and workDir not set. Pass either to enable raw provider capture, or pass `new NoopRawProviderSink()` via rawSinkFactory to opt out explicitly.',\n )\n }\n return new FileSystemRawProviderSink({\n dir: `${workDir}/raw-events/${params.runId}`,\n })\n }\n}\n\nasync function resolveAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): Promise<AgentProfileCell> {\n if (isAgentProfileCell(input)) {\n if (!(await verifyAgentProfileCell(input))) {\n throw new Error(`runEvalCampaign: agentProfile.cellId does not match its content`)\n }\n return input\n }\n return buildAgentProfileCell(input)\n}\n\nfunction isAgentProfileCell(\n input: AgentProfileCell | AgentProfileCellInput,\n): input is AgentProfileCell {\n return 'schemaVersion' in input && 'cellId' in input\n}\n\nfunction assertAgentProfileMatchesRun(\n profile: AgentProfileCell,\n model: string,\n promptHash: string,\n): void {\n if (profile.model !== undefined && profile.model !== model) {\n throw new Error(\n `runEvalCampaign: agentProfile.model \"${profile.model}\" does not match outcome.model \"${model}\"`,\n )\n }\n if (profile.promptHash !== undefined && profile.promptHash !== promptHash) {\n throw new Error(\n `runEvalCampaign: agentProfile.promptHash \"${profile.promptHash}\" does not match outcome.promptHash \"${promptHash}\"`,\n )\n }\n}\n\nfunction defaultRunId(params: CampaignFactoryParams): string {\n // Stable across re-runs: fingerprint of (campaignId, variantId, scenarioId, seed).\n // Caller can override via opts.runId for non-deterministic IDs.\n const base = `${params.campaignId}::${params.variantId}::${params.scenarioId}::${params.seed}`\n // TWO 32-bit FNV-1a accumulators with different offsets, concatenated for a\n // 64-bit-wide id. Not crypto-grade; stability and uniqueness are what this\n // needs. Frozen: the value names a persisted cell, and the second\n // accumulator's offset is part of the identity, so no single-accumulator\n // helper can replace it.\n let h1 = 0x811c9dc5\n let h2 = 0x12345678\n for (let i = 0; i < base.length; i++) {\n const c = base.charCodeAt(i)\n h1 = Math.imul(h1 ^ c, 0x01000193) >>> 0\n h2 = Math.imul(h2 ^ c, 0x9e3779b1) >>> 0\n }\n return `run-${h1.toString(16).padStart(8, '0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AAS,GAAG,GAAG,IAAI,GAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAClF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as ValidationError, r as CaptureIntegrityError } from "../errors-DEE6u6ot.js";
|
|
2
2
|
import { n as bonferroni, r as holm, t as benjaminiHochberg } from "../multiplicity-DIWHvysC.js";
|
|
3
|
-
import { $ as paretoSignificanceGate, A as PairArmsOptions, At as EProcess, B as PowerPreflight, C as hashJson, Ct as FinalEvidenceError, Dt as FinalEvidenceRecord, E as verifyManifest, Et as FinalEvidenceOutcome, Gt as pairedRiskDifferenceScore, H as powerPreflight, K as EvidenceVector, L as comparePairedArms, Lt as ProportionInterval, Mt as EProcessState, N as PairedArmRow, Nt as EProcessStep, O as MatchedPair, Ot as FinalEvidenceReservation, Pt as eProcess, Q as paretoPolicy, R as pairArms, S as evaluateHypothesis, St as FinalEvidenceConflictError, T as signManifest, Tt as FinalEvidenceMeasurement, Ut as pairedRiskDifference, V as PowerPreflightOptions, Vt as mcnemar, Wt as pairedRiskDifferenceExact, X as PromotionPolicy, Z as buildEvidenceVector, _ as sequentialPairedGate, at as createCampaignEvidenceReceipt, b as SignedManifest, c as pairHoldout, ct as EvidenceAuthority, d as SequentialDecision, dt as EvidenceReceipt, f as SequentialObservation, ft as EvidenceReceiptVerification, g as sequentialDecide, ht as verifyEvidenceReceipt, i as PairedHoldout, it as CampaignEvidenceContext, j as PairArmsResult, jt as EProcessOptions, kt as openFinalEvidenceLedger, lt as EvidenceAuthorityKind, m as SequentialPairedGateOptions, mt as isIndependentEvidence, n as HeldoutSignificance, ot as CreateEvidenceReceiptInput, p as SequentialPairedGate, pt as createEvidenceReceipt, qt as wilson, r as HeldoutSignificanceOptions, s as heldoutSignificance, st as EVIDENCE_RECEIPT_VERSION, ut as EvidenceBinding, v as HypothesisManifest, w as manifestContentDigest, wt as FinalEvidenceLedger, x as SignedManifestAlgo, y as HypothesisResult, z as pairRunRecords } from "../statistical-heldout-
|
|
3
|
+
import { $ as paretoSignificanceGate, A as PairArmsOptions, At as EProcess, B as PowerPreflight, C as hashJson, Ct as FinalEvidenceError, Dt as FinalEvidenceRecord, E as verifyManifest, Et as FinalEvidenceOutcome, Gt as pairedRiskDifferenceScore, H as powerPreflight, K as EvidenceVector, L as comparePairedArms, Lt as ProportionInterval, Mt as EProcessState, N as PairedArmRow, Nt as EProcessStep, O as MatchedPair, Ot as FinalEvidenceReservation, Pt as eProcess, Q as paretoPolicy, R as pairArms, S as evaluateHypothesis, St as FinalEvidenceConflictError, T as signManifest, Tt as FinalEvidenceMeasurement, Ut as pairedRiskDifference, V as PowerPreflightOptions, Vt as mcnemar, Wt as pairedRiskDifferenceExact, X as PromotionPolicy, Z as buildEvidenceVector, _ as sequentialPairedGate, at as createCampaignEvidenceReceipt, b as SignedManifest, c as pairHoldout, ct as EvidenceAuthority, d as SequentialDecision, dt as EvidenceReceipt, f as SequentialObservation, ft as EvidenceReceiptVerification, g as sequentialDecide, ht as verifyEvidenceReceipt, i as PairedHoldout, it as CampaignEvidenceContext, j as PairArmsResult, jt as EProcessOptions, kt as openFinalEvidenceLedger, lt as EvidenceAuthorityKind, m as SequentialPairedGateOptions, mt as isIndependentEvidence, n as HeldoutSignificance, ot as CreateEvidenceReceiptInput, p as SequentialPairedGate, pt as createEvidenceReceipt, qt as wilson, r as HeldoutSignificanceOptions, s as heldoutSignificance, st as EVIDENCE_RECEIPT_VERSION, ut as EvidenceBinding, v as HypothesisManifest, w as manifestContentDigest, wt as FinalEvidenceLedger, x as SignedManifestAlgo, y as HypothesisResult, z as pairRunRecords } from "../statistical-heldout-8RGPIeyo.js";
|
|
4
4
|
import { c as BOOTSTRAP_GATE_MIN_N, d as PairedBootstrapResult, h as pairedBootstrap, u as PairedBootstrapOptions } from "../paired-promotion-decision-DPKz8ZnF.js";
|
|
5
5
|
import { a as requiredPairedSampleSize, i as pairedMde, n as mcnemarPower, o as requiredSampleSize, r as mcnemarRequiredN, t as mulberry32 } from "../random-DGEyr3zG.js";
|
|
6
6
|
import { at as summarizeEvaluationUnits, it as defineEvaluationClaim, nt as EvaluationClaim, rt as EvaluationUnitSummary } from "../search-ledger-types-p2xKfiDJ.js";
|
package/dist/experiment/index.js
CHANGED
|
@@ -4,18 +4,18 @@ import { f as evaluateHypothesis, g as verifyManifest, h as signManifest, m as m
|
|
|
4
4
|
import { n as studentTQuantile, t as studentTCdf } from "../student-t-BQeKJx2N.js";
|
|
5
5
|
import { t as mulberry32 } from "../random-Dn5fPWkt.js";
|
|
6
6
|
import { n as bonferroni, r as holm, t as benjaminiHochberg } from "../multiplicity-D9cjmStq.js";
|
|
7
|
-
import { a as pairedRiskDifferenceExact, c as wilson, i as pairedRiskDifference, n as mcnemar, o as pairedRiskDifferenceScore } from "../paired-binary-
|
|
7
|
+
import { a as pairedRiskDifferenceExact, c as wilson, i as pairedRiskDifference, n as mcnemar, o as pairedRiskDifferenceScore } from "../paired-binary-Q36bhn2R.js";
|
|
8
8
|
import { r as pairedBootstrap, t as BOOTSTRAP_GATE_MIN_N } from "../paired-tests-jbwPdSz5.js";
|
|
9
9
|
import { a as requiredSampleSize, i as requiredPairedSampleSize, n as mcnemarRequiredN, r as pairedMde, t as mcnemarPower } from "../power-and-mde-fK5Qocwo.js";
|
|
10
|
-
import { n as pairArms, r as pairRunRecords, t as comparePairedArms } from "../paired-arms-
|
|
10
|
+
import { n as pairArms, r as pairRunRecords, t as comparePairedArms } from "../paired-arms-DzKn0TfY.js";
|
|
11
11
|
import { t as eProcess } from "../sequential-eprocess-D1jKoihe.js";
|
|
12
|
-
import { a as heldoutSignificance, o as pairHoldout } from "../statistical-heldout-
|
|
13
|
-
import { D as FinalEvidenceError, E as FinalEvidenceConflictError, O as openFinalEvidenceLedger, T as powerPreflight, a as verifyEvidenceReceipt, i as isIndependentEvidence, n as EVIDENCE_RECEIPT_VERSION, r as createEvidenceReceipt, t as createCampaignEvidenceReceipt } from "../campaign-evidence-
|
|
12
|
+
import { a as heldoutSignificance, o as pairHoldout } from "../statistical-heldout-1Gbmex7v.js";
|
|
13
|
+
import { D as FinalEvidenceError, E as FinalEvidenceConflictError, O as openFinalEvidenceLedger, T as powerPreflight, a as verifyEvidenceReceipt, i as isIndependentEvidence, n as EVIDENCE_RECEIPT_VERSION, r as createEvidenceReceipt, t as createCampaignEvidenceReceipt } from "../campaign-evidence-OcUciD-N.js";
|
|
14
14
|
import { _ as runSelectionRule, a as evaluateHaltRule, c as evaluatePopulationReproducibilityGate, d as evaluateProvenanceGate, f as executeDecisionRule, g as readField, h as projectNLadderBudget, i as evaluateCondition, l as evaluatePowerFloorGate, m as powerFloorProblems, n as computeEstimand, o as evaluateIdentityGate, p as intervalSpecProblems, r as computeInterval, s as evaluateOracleDeterminismGate, t as classifyReissue, u as evaluatePredicate, v as runUniformPassBudget } from "../ast-DJ6Bc7ab.js";
|
|
15
15
|
import { r as summarizeEvaluationUnits, t as defineEvaluationClaim } from "../claim-BXcZw-jo.js";
|
|
16
16
|
import { n as pairedEvalueSequence, r as sequentialCrossingHorizon } from "../sequential-CzK5DarL.js";
|
|
17
|
-
import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-
|
|
18
|
-
import { n as sequentialPairedGate, t as sequentialDecide } from "../sequential-
|
|
17
|
+
import { n as paretoPolicy, r as paretoSignificanceGate, t as buildEvidenceVector } from "../promotion-policy-CWW35UWq.js";
|
|
18
|
+
import { n as sequentialPairedGate, t as sequentialDecide } from "../sequential-D-1PPCmM.js";
|
|
19
19
|
import { z } from "zod";
|
|
20
20
|
//#region src/experiment/budget.ts
|
|
21
21
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback-trajectory-CX01700m.d.ts","names":[],"sources":["../src/control-runtime.ts","../src/feedback-trajectory-review.ts","../src/feedback-trajectory.ts"],"mappings":";;;;;;;KAkBY;KACA;UAEK;;EAEf;;EAEA;;EAEA;;EAEA,WAAW;;EAEX;;EAEA;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gBAAgB,YAAY,gBAAgB;;EAGzD,MACE,QAAQ,SACR,KAAK,eAAe,QAAQ,SAAS,eAAe,WACjD,QAAQ,iBAAiB;;EAG9B,cACE,KAAK,eAAe,QAAQ,SAAS,eAAe,WACjD,QAAQ,gBAAgB;;EAG7B,UAAU,MAAM,YAAY,QAAQ,SAAS,eAAe,WAAW;;EAGvE,eAAe,oBAAoB,QAAQ;;EAG3C,QAAQ;EACR;EACA;EACA;;iBAQoB,oBACpB,QACA,SACA,eACA,cAAc,oBAAoB,mBAElC,QAAQ,qBAAqB,QAAQ,SAAS,eAAe,SAC5D,QAAQ,iBAAiB,QAAQ,SAAS,eAAe;iBAumB5C,cAAc,OAAO,KAAK,kCAAkC;iBAI5D,eAAe,OAAO,KAAK,kCAAkC;;;KC90BjE,sBAAsB,QAAQ;KAC9B;KACA;UAEK;EACf;EACA;EACA,WAAW;;UAGH;EACR,WAAW;EACX,QAAQ;EACR;EACA;EACA;EACA;;KAGU,yBACP;EACC;EACA,eAAe;EACf;EACA;MAED;EACC;EACA,cAAc;EACd;EACA;;;iBA2BU,qBAAqB,SAAS,iBAAiB;;iBAK/C,iBAAiB,KAAK,mBAAmB;;;
|
|
1
|
+
{"version":3,"file":"feedback-trajectory-CX01700m.d.ts","names":[],"sources":["../src/control-runtime.ts","../src/feedback-trajectory-review.ts","../src/feedback-trajectory.ts"],"mappings":";;;;;;;KAkBY;KACA;UAEK;;EAEf;;EAEA;;EAEA;;EAEA,WAAW;;EAEX;;EAEA;;EAEA;;EAEA,WAAW;;UAGI;EACf;EACA;EACA;;UAGe,oBAAoB,QAAQ;;;;;EAK3C;;;;;EAKA;;EAEA;;EAEA,oBAAoB,OAAO;;EAE3B,qBAAqB,QAAQ;;UAGd,eACf,QACA,SACA,eACA,cAAc,oBAAoB;EAElC;EACA,OAAO;EACP,OAAO;EACP,SAAS,YAAY,QAAQ,SAAS,eAAe;EACrD,QAAQ;EACR;EACA;EACA;EACA;EACA,aAAa;EACb,UAAU;;KAG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|
1
1
|
import { a as MintedRolloutLine, b as RolloutSplit, g as RolloutOutcome, h as RolloutLine, i as GatedEvidence, t as ChatMessage, w as ToolDef } from "./schema-C-ziyJD7.js";
|
|
2
2
|
import "./mint-CDy-brUR.js";
|
|
3
3
|
import { a as SftRow, r as RftItem, s as VerifiersRolloutOutput } from "./exporters-ChTnR90l.js";
|
|
4
|
-
import {
|
|
4
|
+
import { HarnessSession, SessionRef } from "@tangle-network/harness-sessions";
|
|
5
5
|
//#region src/rollout/gate-checks.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Every gate check in the package, in the order they are applied.
|
|
@@ -381,60 +381,39 @@ interface ClaudeUsageTotals {
|
|
|
381
381
|
interface ClaudeTranscript {
|
|
382
382
|
messages: ChatMessage[];
|
|
383
383
|
usage: ClaudeUsageTotals;
|
|
384
|
-
/** Timestamp of the first conversation
|
|
384
|
+
/** Timestamp of the first conversation record; null = empty transcript. */
|
|
385
385
|
startedAt: string | null;
|
|
386
386
|
endedAt: string | null;
|
|
387
|
+
/** The model that answered the last response (never Claude Code's `<synthetic>` error turn). */
|
|
387
388
|
model: string | null;
|
|
388
389
|
/** Every parse or usage gap retained beside this semantic projection. */
|
|
389
390
|
gaps: string[];
|
|
390
391
|
}
|
|
391
392
|
interface ReadClaudeTranscriptOptions {
|
|
392
393
|
/**
|
|
393
|
-
* Read
|
|
394
|
-
*
|
|
395
|
-
* lines end to end, so their usage is invisible without this.
|
|
394
|
+
* Read a subagent's own transcript (`<session>/subagents/agent-<id>.jsonl`), whose records are
|
|
395
|
+
* sidechain end to end, instead of skipping sidechain records.
|
|
396
396
|
*/
|
|
397
397
|
readonly includeSidechain?: boolean;
|
|
398
|
-
/** Parser diagnostics from the retained source; used by the shared reader. */
|
|
399
|
-
readonly sourceGaps?: readonly string[];
|
|
400
398
|
}
|
|
401
|
-
/**
|
|
399
|
+
/**
|
|
400
|
+
* The messages+usage projection of a normalized session. A usage field is null when any answered
|
|
401
|
+
* model call did not report it, so a partial sum is never mistaken for the session's usage.
|
|
402
|
+
*/
|
|
403
|
+
declare function transcriptFromSession(session: HarnessSession): ClaudeTranscript;
|
|
404
|
+
/** Read one transcript file. */
|
|
402
405
|
declare function readClaudeTranscript(path: string, options?: ReadClaudeTranscriptOptions): Promise<ClaudeTranscript>;
|
|
403
|
-
/** Parse retained JSONL without another file or store; source gaps remain explicit. */
|
|
406
|
+
/** Parse retained JSONL text without another file or store; source gaps remain explicit. */
|
|
404
407
|
declare function parseClaudeTranscript(raw: string, options?: ReadClaudeTranscriptOptions): ClaudeTranscript;
|
|
405
408
|
//#endregion
|
|
406
409
|
//#region src/rollout/readers/opencode-sqlite.d.ts
|
|
407
410
|
declare const DEFAULT_OPENCODE_DB: string;
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
model: {
|
|
415
|
-
id?: string;
|
|
416
|
-
providerID?: string;
|
|
417
|
-
} | null;
|
|
418
|
-
costUsd: number | null;
|
|
419
|
-
tokensInput: number | null;
|
|
420
|
-
tokensOutput: number | null;
|
|
421
|
-
tokensReasoning: number | null;
|
|
422
|
-
tokensCacheRead: number | null;
|
|
423
|
-
tokensCacheWrite: number | null;
|
|
424
|
-
timeCreated: number;
|
|
425
|
-
timeUpdated: number;
|
|
426
|
-
}
|
|
427
|
-
/** Open the store read-only; null = unavailable/corrupt (caller records a gap). */
|
|
428
|
-
declare function openOpencodeDb(path?: string): Promise<DatabaseSync | null>;
|
|
429
|
-
/** Sessions whose cwd is `directory` (the worker-clone join key). */
|
|
430
|
-
declare function findOpencodeSessionsByDirectory(db: DatabaseSync, directory: string): OpencodeSessionRow[];
|
|
431
|
-
/**
|
|
432
|
-
* Convert one session's message+part rows into canonical messages.
|
|
433
|
-
* An opencode assistant message row spans several model steps; each step's
|
|
434
|
-
* parts (reasoning → text → tool …) become one assistant message followed by
|
|
435
|
-
* the role:"tool" results of its calls, preserving order.
|
|
436
|
-
*/
|
|
437
|
-
declare function readOpencodeSessionMessages(db: DatabaseSync, sessionId: string): ChatMessage[];
|
|
411
|
+
/** Sessions whose cwd is `directory` (the worker-clone join key), oldest first. */
|
|
412
|
+
declare function findOpencodeSessionsByDirectory(directory: string, db?: string): Promise<SessionRef[]>;
|
|
413
|
+
/** One session, normalized. */
|
|
414
|
+
declare function readOpencodeSession(sessionId: string, db?: string): Promise<HarnessSession>;
|
|
415
|
+
/** One session's canonical messages: each model step, then the results of its tool calls. */
|
|
416
|
+
declare function readOpencodeSessionMessages(sessionId: string, db?: string): Promise<ChatMessage[]>;
|
|
438
417
|
//#endregion
|
|
439
418
|
//#region src/rollout/release/gate-report.d.ts
|
|
440
419
|
/** What a format does with a line the realness gate flagged. */
|
|
@@ -670,5 +649,5 @@ declare function parseRolloutReleaseArgs(argv: string[]): RolloutReleaseCliArgs;
|
|
|
670
649
|
/** CLI driver for `agent-eval rollout-release`. Returns the process exit code. */
|
|
671
650
|
declare function runRolloutReleaseCli(argv: string[]): Promise<number>;
|
|
672
651
|
//#endregion
|
|
673
|
-
export { HarborAgent as $, measureFormatGate as A,
|
|
674
|
-
//# sourceMappingURL=index-
|
|
652
|
+
export { HarborAgent as $, measureFormatGate as A, ReadClaudeTranscriptOptions as B, FORMAT_GATE_DISPOSITION as C, GatePolicy as Ct, ReleaseRowRef as D, GateReport as E, readOpencodeSessionMessages as F, transcriptFromSession as G, findClaudeTranscripts as H, ClaudeTranscript as I, readRolloutLedger as J, appendRolloutLines as K, ClaudeTranscriptRef as L, DEFAULT_OPENCODE_DB as M, findOpencodeSessionsByDirectory as N, assertGateReport as O, readOpencodeSession as P, HARBOR_IMPORT_GAP as Q, ClaudeUsageTotals as R, EmittedEvidence as S, GateEntryPoint as St, GateDisposition as T, gatedEvidenceOf as Tt, parseClaudeTranscript as U, claudeProjectSlug as V, readClaudeTranscript as W, ATIF_SCHEMA_VERSION as X, writeRolloutLedger as Y, FromHarborOptions as Z, defaultRolloutScrubber as _, GATE_POLICIES as _t, buildHfDataset as a, HarborObservationResult as at, scrubRolloutLine as b, GateCheckId as bt, runRolloutReleaseCli as c, HarborSubagentTrajectoryRef as ct, RELEASE_FORMATS as d, fromHarborTrajectory as dt, HarborContentPart as et, ReleaseFormat as f, relabelImportedSplit as ft, addScrubCounts as g, GATE_CHECK_IDS as gt, ScrubRule as h, GATE_CHECKS as ht, ScrubReport as i, HarborObservation as it, releaseRowRefs as j, gatedRolloutIds as k, DatasetCardInputs as l, HarborToolCall as lt, ScrubCounts as m, toHarborTrajectory as mt, BuildSummary as n, HarborImageSource as nt, parseRolloutReleaseArgs as o, HarborStep as ot, buildDatasetCard as p, toHarborTrajectories as pt, readRolloutJournal as q, RolloutReleaseCliArgs as r, HarborMetrics as rt, planPushCommand as s, HarborStepSource as st, BuildOptions as t, HarborFinalMetrics as tt, FORMAT_FILES as u, HarborTrajectory as ut, emptyScrubCounts as v, GateCheck as vt, FormatGateCounts as w, gateErrors as wt, scrubText as x, GateCheckedOutcome as xt, scrubLines as y, GateCheckDisposition as yt, DEFAULT_CLAUDE_PROJECTS_DIR as z };
|
|
653
|
+
//# sourceMappingURL=index-D0_l25We.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-D0_l25We.d.ts","names":[],"sources":["../src/rollout/gate-checks.ts","../src/rollout/interchange/harbor.ts","../src/rollout/ledger.ts","../src/rollout/readers/claude-jsonl.ts","../src/rollout/readers/opencode-sqlite.ts","../src/rollout/release/gate-report.ts","../src/rollout/release/scrub.ts","../src/rollout/release/card.ts","../src/rollout/release/hf-dataset.ts"],"mappings":";;;;;;;;;;;;cA2Ca;KAOD,sBAAsB;;;;;;;;;KAUtB,qBAAqB,QAAQ,kBAAkB,SAAS;;;;;;;;;;;;;;;;;UAkBnD;EACf,SAAS;;EAET;;UAOe;EACf,IAAI;;EAEJ;;EAEA,SAAS,SAAS;;;;;;;;;;;;EAYlB,WAAW;;;;;;;;;;;;;iBA6LG,gBA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;;;;;iBA8BhC,iBAAiB,MAAM,mBAAmB,QAAQ,cAAc;iBAIhE,WAAW,OAAO;EAChC,OAAO;EACP,QAAQ;;;;;;;;;iBAaM,uBAAuB;;;cCrI1B;KACD,wBAAwB;;cAGvB,cAAc,OAAO;UAejB;;EAEf,OAAO;EACP,SAAS;EACT;;EAEA;EACA,aAAa;EACb;IAAY;IAAmB;;EAC/B,cAAc,QAAQ,OAAO;;;;;;;EAO7B,MAAM;;iBA4GQ,iBAAiB,QAAQ;;;UC1HxB;EACf;EACA,SAAS;EACT;;UAGe;;EAEf,OAAO,eAAe;EACtB,QAAQ;EACR;IAAY;IAAmB;;;UAGhB;EACf;EACA;EACA;EACA,OAAO;EACP,cAAc,QAAQ,OAAO;;EAE7B,MAAM;EACN;;iBAGoB,eACpB,kBACA,SAAS,eACR,QAAQ;iBAuGK,gBAAgB,cAAc;UAoB7B,8BAA8B;EAC7C;EACA;;iBAMc,wBAAwB,iBAAiB;;iBA0CnC,qBAAqB,iBAAiB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { c as CostLedgerHandle } from "./cost-ledger-DbQdN3nO.js";
|
|
2
2
|
import { a as RunRecord, c as RunSplitTag, n as RunCostProvenance } from "./run-record-p2AYTrCn.js";
|
|
3
3
|
import "./types-KEkKkETv.js";
|
|
4
|
-
import "./statistical-heldout-
|
|
4
|
+
import "./statistical-heldout-8RGPIeyo.js";
|
|
5
5
|
import "./types-Dv9sYwBB.js";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-xnhRdqik.js";
|
|
7
7
|
import { p as TraceSpanEvent } from "./client-BzL9niqi.js";
|
|
8
8
|
import { d as InsightReport, t as AnalyzeRunsOptions } from "./analyze-runs-BlslTkOJ.js";
|
|
9
|
-
import "./define-agent-eval-
|
|
9
|
+
import "./define-agent-eval-B_zZY2AZ.js";
|
|
10
10
|
import "./default-registry-Crk3QEy1.js";
|
|
11
11
|
import { AgentCandidateBenchmarkCellRef, AgentCandidateBenchmarkSuiteInputs, AgentCandidateBenchmarkTask, AgentCandidateBenchmarkTaskMaterial, AgentCandidateBundle, AgentCandidateEvaluationPolicy, AgentCandidateExperiment, AgentCandidateExperimentMaterial, AgentCandidateExperimentMeasurement, AgentImprovementCost, AgentImprovementMeasuredComparison, AgentProfileImprovementExperiment, AgentProfileImprovementExperimentMaterial, AgentProfileImprovementMeasuredComparison, AgentProfileImprovementMeasurement, AgentProfileImprovementRunCell, AgentProfileImprovementRunReceipt, AgentProfileImprovementSuiteInputs, AgentProfileImprovementTask, AgentProfileImprovementTaskMaterial, CandidateExecutionEvidence, Sha256Digest } from "@tangle-network/agent-interface";
|
|
12
12
|
//#region src/contract/measured-comparison.d.ts
|
|
@@ -354,7 +354,7 @@ interface PartitionByAuthoringModelResult {
|
|
|
354
354
|
declare function partitionRunsByAuthoringModel(runs: RunRecord[], index: AgentTraceIndex): PartitionByAuthoringModelResult;
|
|
355
355
|
//#endregion
|
|
356
356
|
//#region src/contract/intake/code-agent-observation.d.ts
|
|
357
|
-
type CodeAgentSessionSource = 'codex' | 'claude-code' | 'opencode' | 'kimi-code' | 'pi';
|
|
357
|
+
type CodeAgentSessionSource = 'codex' | 'claude-code' | 'opencode' | 'kimi-code' | 'pi' | 'pi-graph';
|
|
358
358
|
type CodeAgentSessionTerminalStatus = 'completed' | 'failed' | 'unknown';
|
|
359
359
|
type CodeAgentSessionActionKind = 'tool' | 'patch' | 'terminal' | 'graph-completion';
|
|
360
360
|
type CodeAgentSessionActionSurface = 'tool' | 'mcp' | 'subagent' | 'skill' | 'hook' | 'web' | 'code';
|
|
@@ -515,7 +515,10 @@ declare function fromCodexSession(options: CodeAgentSessionIntakeOptions): CodeA
|
|
|
515
515
|
declare function fromClaudeCodeSession(options: CodeAgentSessionIntakeOptions): CodeAgentSessionIntakeResult;
|
|
516
516
|
declare function fromOpenCodeSession(options: CodeAgentSessionIntakeOptions): CodeAgentSessionIntakeResult;
|
|
517
517
|
declare function fromKimiCodeSession(options: CodeAgentSessionIntakeOptions): CodeAgentSessionIntakeResult;
|
|
518
|
+
/** A native Pi session (`~/.pi/agent/sessions/<cwd>/<ts>_<id>.jsonl`), parsed entries in order. */
|
|
518
519
|
declare function fromPiSession(options: CodeAgentSessionIntakeOptions): CodeAgentSessionIntakeResult;
|
|
520
|
+
/** The graph IR a Pi graph run exports (`nodes[].ir`), which is not a Pi session. */
|
|
521
|
+
declare function fromPiGraphSession(options: CodeAgentSessionIntakeOptions): CodeAgentSessionIntakeResult;
|
|
519
522
|
//#endregion
|
|
520
523
|
//#region src/contract/intake/code-agent-store.d.ts
|
|
521
524
|
/** Which store to read, and what makes a session in it belong to this run. */
|
|
@@ -686,5 +689,5 @@ interface FromOtelSpansOptions {
|
|
|
686
689
|
}
|
|
687
690
|
declare function fromOtelSpans(opts: FromOtelSpansOptions): RunRecord[];
|
|
688
691
|
//#endregion
|
|
689
|
-
export {
|
|
690
|
-
//# sourceMappingURL=index-
|
|
692
|
+
export { FromRunRecordDirOptions as $, CodeAgentSessionActionKind as A, verifyCandidateExperimentComparison as At, AgentTraceConversation as B, fromOpenCodeSession as C, evaluatePairedMeasurements as Ct, parseCodeAgentJsonlFile as D, sealCandidateBenchmarkTask as Dt, parseCodeAgentJsonl as E, sealCandidateBenchmarkSuite as Et, CodeAgentSessionSource as F, AuthoringProvenance as G, AgentTraceIndex as H, CodeAgentSessionTerminalStatus as I, partitionRunsByAuthoringModel as J, PartitionByAuthoringModelResult as K, observeCodeAgentSession as L, CodeAgentSessionActionSurface as M, CodeAgentSessionExecutionReceipt as N, streamCodeAgentJsonlFile as O, sealCandidateExperiment as Ot, CodeAgentSessionObservation as P, evalReportingSuite as Q, AgentTraceContributor as R, fromKimiCodeSession as S, SealCandidateBenchmarkSuiteOptions as St, fromPiSession as T, runCandidateExperiment as Tt, AgentTraceRange as U, AgentTraceFile as V, AgentTraceRecord as W, EvalReportingSuiteOptions as X, EvalReportingSuiteInput as Y, EvalReportingSuiteResult as Z, CodeAgentSessionIntakeResult as _, EvaluatePairedMeasurementsOptions as _t, FromFeedbackTableOptions as a, CompareAgentProfileImprovementExperimentOptions as at, fromClaudeCodeSession as b, PairedMeasurementEvaluation as bt, CodeAgentStoreObservation as c, measuredComparisonFromAgentProfileImprovementExperiment as ct, CodeAgentStoreScope as d, sealAgentProfileImprovementSuite as dt, FromRunRecordDirResult as et, CodeAgentStoreSession as f, sealAgentProfileImprovementTask as ft, CodeAgentSessionIntakeOptions as g, CompareCandidateExperimentOptions as gt, CodeAgentSessionDiagnostic as h, CandidateExperimentRun as ht, FeedbackTableRow as i, AgentProfileImprovementExperimentRun as it, CodeAgentSessionActionStatus as j, CodeAgentSessionAction as k, verifyCandidateExperiment as kt, CodeAgentStoreRejection as l, runAgentProfileImprovementExperiment as lt, CodeAgentJsonlLine as m, CandidateExperimentExecutionInput as mt, fromOtelSpans as n, fromRunRecordDir as nt, FromFeedbackTableResult as o, RunAgentProfileImprovementExperimentOptions as ot, observeCodeAgentStore as p, verifyAgentProfileImprovementExperimentComparison as pt, parseAgentTrace as q, FeedbackTableMeta as r, AgentProfileImprovementExperimentExecutionInput as rt, fromFeedbackTable as s, SealAgentProfileImprovementSuiteOptions as st, FromOtelSpansOptions as t, RunRecordRejection as tt, CodeAgentStoreRejections as u, sealAgentProfileImprovementExperiment as ut, CodeAgentSessionMetrics as v, PairedMeasurement as vt, fromPiGraphSession as w, measuredComparisonFromCandidateExperiment as wt, fromCodexSession as x, RunCandidateExperimentOptions as xt, ParsedCodeAgentJsonl as y, PairedMeasurementAdapter as yt, AgentTraceContributorType as z };
|
|
693
|
+
//# sourceMappingURL=index-DnZdBxCL.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-DnZdBxCL.d.ts","names":[],"sources":["../src/contract/measured-comparison.ts","../src/contract/profile-measured-comparison.ts","../src/contract/intake/run-record-dir.ts","../src/contract/eval-reporting-suite.ts","../src/contract/intake/agent-trace.ts","../src/contract/intake/code-agent-observation.ts","../src/contract/intake/code-agent-session.ts","../src/contract/intake/code-agent-store.ts","../src/contract/intake/feedback-table.ts","../src/contract/intake/otel-spans.ts"],"mappings":";;;;;;;;;;;;UAiCiB;EACf,QAAQ,gCAAgC;EACxC;EACA;;UAGe;EACf,YAAY;EACZ;EACA,QAAQ;EACR,MAAM;EACN,eAAe;EACf;EACA,SAAS;;UAGM;EACf,YAAY;EACZ,QAAQ,OAAO,oCAAoC,QAAQ;;EAE3D;;EAEA,aAAa;EACb,SAAS;;UAGM;EACf,cAAc;EACd;IACE;IACA,MAAM;;;UAIO;EACf,YAAY;EACZ,cAAc;EACd;IACE;IACA,MAAM;;EAER,aAAa;EACb;EACA,YAAY;EACZ;EACA,WAAW;;;UAII,kBAAkB;EACjC;EACA,UAAU;EACV,WAAW;;;UAII,yBAAyB;EACxC,MAAM,KAAK;EACX,WAAW,KAAK;IAAkB;IAAc;;EAChD,QAAQ,KAAK;EACb,eAAe,KAAK,OAAO;EAC3B,UAAU,KAAK;EACf,UAAU,KAAK;EACf,OAAO,KAAK;;UAGG,kCAAkC;EACjD,uBAAuB,kBAAkB;EACzC,QAAQ;EACR,SAAS,yBAAyB;;EAElC;;EAEA,kBAAkB;;EAElB,kBAAkB;;;KAIR,8BAA8B,KACxC;EAGA,iBAAiB;EACjB,WAAW;EACX;;;iBAIc,2BACd,UAAU,sCACT;;iBAQa,4BACd,SAAS,qCACR;;iBAiBa,wBACd,UAAU,mCACT;iBAQa,0BAA0B,iBAAiB;;iBAarC,uBACpB,SAAS,gCACR,QAAQ;;;;;;;;iBAkEK,2BAA2B,MACzC,SAAS,kCAAkC,QAC1C;;iBA8Ya,0CACd,SAAS,oCACR;;iBAuEa,oCACd,iBACC;;;UCjrBc;EACf,aAAa;EACb,QAAQ,gCAAgC;EACxC;EACA;;UAGe;EACf,YAAY;EACZ;EACA,aAAa;EACb,MAAM;EACN,SAAS;EACT;EACA,SAAS;;UAGM;EACf,YAAY;EACZ,QACE,OAAO,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N,SAAS;EACT;EACA,QAAQ;EACR;EACA;EACA,UAAU;;UAGK;EACf,QAAQ;EACR;EACA;EACA;IACE,QAAQ;IACR;;EAEF,SAAS;;UAGM;EACf,QAAQ;EACR;EACA;EACA,YAAY;;;;;;;iBAeE,wBACd,SAAS,iCACR;;;UC7Cc;EACf;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,QAAQ;EACR;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;;UAGe;EACf,MAAM;EACN,aAAa;EACb,SAAS;EACT,cAAc;;UAGC;EACf;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;;;EAGA,iBAAiB;;;EAGjB,YAAY;;;;KAKF;EACN;EAAe;EAAoB;;EACnC;EAAmB;;iBAcT,oBAAoB,gBAAgB;;;;;;;;;;iBAuB7B,yBAAyB,eAAe,eAAe;;;;;iBA6BxD,wBAAwB,eAAe,QAAQ;iBAUrD,iBACd,SAAS,gCACR;iBAIa,sBACd,SAAS,gCACR;iBAIa,oBACd,SAAS,gCACR;iBAIa,oBACd,SAAS,gCACR;;iBAKa,cACd,SAAS,gCACR;;iBAKa,mBACd,SAAS,gCACR;;;;UCxMc;;;;;WAKN;;WAEA,QAAQ;;;;;WAKR;;;;;WAKA;aACE;;aAEA;;;;KAKD;;UAUK;WACN;WACA;WACA;WACA;WACA,aAAa;;;UAIP;WACN;WACA,UAAU,SAAS,QAAQ,OAAO;;WAElC,QAAQ;aACN;aACA,QAAQ;;;;;;;;;KAUT;WAEG;WACA,OAAO;WACP;WACA,mBAAmB;;WAEnB;;WAEA;;WAEA;WACA,WAAW,SAAS,QAAQ,OAAO;WACnC,YAAY;;WAGZ;WACA,OAAO;WACP;;WAEA;WACA,YAAY;;;;;;;;;iBAaL,sBACpB,OAAO,sBACN,QAAQ;;;UCtHM;;;EAGf;;EAEA;;;EAGA;;;EAGA,WAAW;;UAGI;EACf;;;EAGA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;EAEA;;;EAGA,WAAW;;;EAGX,SAAS;;UAGM;;EAEf,SAAS;;;EAGT,OAAO;;;;EAIP;IAAU;IAAa;;;;;EAIvB;;UAGe;EACf,MAAM;;;EAGN,aAAa;IAAQ;IAAe;IAAe;;;iBAGrC,kBAAkB,MAAM,2BAA2B;;;UC3BlD;EACf,OAAO;;EAEP,eAAe;;EAEf;;;;;;EAMA,eAAe,eAAe,gBAAgB;;iBAGhC,cAAc,MAAM,uBAAuB"}
|
|
@@ -3,7 +3,7 @@ import { T as RunPaidCallInput, c as CostLedgerHandle, f as CostLedgerSummary, m
|
|
|
3
3
|
import { a as RunRecord, c as RunSplitTag } from "./run-record-p2AYTrCn.js";
|
|
4
4
|
import { O as TraceAnalysisStore, _ as ProposalFinding, f as AnalystUsageReceipt, i as AnalystFinding, l as AnalystRunResult } from "./types-KEkKkETv.js";
|
|
5
5
|
import { M as LlmCallMetadata, ft as ServedModelPolicy, rt as RawProviderSink, x as ChatClient } from "./types-Lub7o6bN.js";
|
|
6
|
-
import { Dt as FinalEvidenceRecord, P as PairedArmsComparison, dt as EvidenceReceipt, it as CampaignEvidenceContext, wt as FinalEvidenceLedger } from "./statistical-heldout-
|
|
6
|
+
import { Dt as FinalEvidenceRecord, P as PairedArmsComparison, dt as EvidenceReceipt, it as CampaignEvidenceContext, wt as FinalEvidenceLedger } from "./statistical-heldout-8RGPIeyo.js";
|
|
7
7
|
import { a as PairedPromotionDecision, d as PairedBootstrapResult } from "./paired-promotion-decision-DPKz8ZnF.js";
|
|
8
8
|
import { E as SearchExecutionIdentity, G as SearchSplit, V as SearchProposer, a as SearchAttemptAccounting, i as SearchArtifactRef, j as SearchModelIdentity, nt as EvaluationClaim, rt as EvaluationUnitSummary, tt as SearchUnknown, z as SearchOperationRecordedEvent } from "./search-ledger-types-p2xKfiDJ.js";
|
|
9
9
|
import { r as LedgerHash } from "./canonical-CFpojCN5.js";
|
|
@@ -2470,18 +2470,7 @@ declare function sequentialOptimizationMethod<S extends Scenario, A>(options: {
|
|
|
2470
2470
|
}): OptimizationMethod<S, A>;
|
|
2471
2471
|
//#endregion
|
|
2472
2472
|
//#region src/artifact-validator.d.ts
|
|
2473
|
-
/**
|
|
2474
|
-
* Artifact validators.
|
|
2475
|
-
*
|
|
2476
|
-
* Generic "score a produced artifact" primitive. Tax uses it for PDF form
|
|
2477
|
-
* correctness, research for sourced briefs, browser for task assertions, coding
|
|
2478
|
-
* for social posts. One interface, many validators.
|
|
2479
|
-
*
|
|
2480
|
-
* A validator receives an `Artifact` (file on disk, JSON blob, text, binary)
|
|
2481
|
-
* plus a `ValidationContext` (scenario id, the turns that produced it) and
|
|
2482
|
-
* returns a `ValidationResult` with pass/fail + 0..1 score + structured
|
|
2483
|
-
* issues.
|
|
2484
|
-
*/
|
|
2473
|
+
/** An artifact an agent produced, as completion and produced-state checks read it. */
|
|
2485
2474
|
interface Artifact {
|
|
2486
2475
|
/** Logical kind — validators type-guard on this */
|
|
2487
2476
|
kind: 'file' | 'json' | 'text' | 'binary' | string;
|
|
@@ -3390,4 +3379,4 @@ declare function verifyCodeSurface(surface: CodeSurface, worktreeDir?: string):
|
|
|
3390
3379
|
declare function resolveWorktreePath(surface: CodeSurface, worktreeDir?: string): string;
|
|
3391
3380
|
//#endregion
|
|
3392
3381
|
export { ScoreboardRow as $, RunImprovementLoopOptions as $i, TraceAnalystScenario as $n, GepaOptimizationRecipe as $r, importExternalEvaluations as $t, ScenarioSignal as A, CampaignCoverage as Aa, GepaCandidatePopulationSummary as Ai, CrossSurfaceComponentEvidence as An, DEFAULT_RED_TEAM_CORPUS as Ar, RequirementCheck as At, FinalizedProfileMatrixResult as B, ReferenceEquivalenceJudgeInput as Bi, CrossSurfaceInteractionTask as Bn, CanaryKind as Br, FsLabeledScenarioStoreOptions as Bt, SingleRunLockOptions as C, CacheRead as Ca, compareOptimizationMethods as Ci, CrossSurfaceBootstrapPolicy as Cn, campaignMeanComposite as Cr, extractProducedState as Ct, searchProposalExecution as D, cellCachePath as Da, costFromLedgerSummary as Di, CrossSurfaceCandidateOutcome as Dn, DefaultProductionGateOptions as Dr, LlmCorrectnessCheckerOpts as Dt, searchModelIdentity as E, buildCellSchedule as Ea, combineComparisonCosts as Ei, CrossSurfaceCandidateEvidence as En, DefaultProductionGateCheck as Er, CorrectnessChecker as Et, RetainedDispatchOptions as F, campaignSplitDigest as Fa, ExternalOptimizerObservationSummary as Fi, CrossSurfaceIneligibilityReason as Fn, redTeamDataset as Fr, verifyCompletion as Ft, RunProfileMatrixSegmentOptions as G, runReferenceEquivalenceJudge as Gi, CrossSurfacePairwiseEntry as Gn, SkillOptOptimizationMethodConfig as Gr, ScoredRollout as Gt, ProfileMatrixPlan as H, ReferenceEquivalenceJudgeResult as Hi, CrossSurfacePairCompatibility as Hn, CanaryReport as Hr, RolloutArgumentDiff as Ht, RetainedDispatchOutcome as I, campaignSplitDigestFromIdentities as Ia, ExternalOptimizerSubmittedCandidate as Ii, CrossSurfaceInteractionAwareSelection as In, redTeamReport as Ir, scopedOptimizationMethod as It, runProfileMatrixSegment as J, llmJudge as Ji, CrossSurfaceSelectionPolicy as Jn, skillOptOptimizationMethod as Jr, rolloutArgumentDiff as Jt, createProfileMatrixPlan as K, LlmJudgeDimension as Ki, CrossSurfaceRankedSingle as Kn, SkillOptRunnerCommand as Kr, UngroundedLiteralReport as Kt, createRetainedDispatch as L, readExternalOptimizerObservationArtifact as Li, CrossSurfaceInteractionEffect as Ln, scoreRedTeamOutput as Lr, sequentialOptimizationMethod as Lt, selectDiscriminative as M, assertCampaignSplitIdentity as Ma, readGepaCandidatePopulationArtifact as Mi, CrossSurfaceDistribution as Mn, RedTeamCategory as Mr, TaskGold as Mt, resolveRunDir as N, campaignCoverage as Na, ExternalOptimizerExecutionSummary as Ni, CrossSurfaceEligibility as Nn, RedTeamFinding as Nr, completionVerdict as Nt, searchReceiptAccounting as O, FinalEvidencePolicy as Oa, GepaCandidatePopulationArtifact as Oi, CrossSurfaceCandidateSummary as On, DefaultProductionRewardHackingOptions as Or, ProducedProposal as Ot, tangleTracesRoot as P, campaignScenarioIdentity as Pa, ExternalOptimizerObservationArtifact as Pi, CrossSurfaceEvidenceBreakdown as Pn, RedTeamReport as Pr, createLlmCorrectnessChecker as Pt, ScoreboardRenderOptions as Q, transientDispatchFailure as Qi, TraceAnalystArtifact as Qn, GepaOptimizationMethodConfig as Qr, externalSurface as Qt, CreateProfileMatrixPlanOptions as R, REFERENCE_EQUIVALENCE_INPUT_LIMITS as Ri, CrossSurfaceInteractionPath as Rn, CanaryAlert as Rr, neutralizeText as Rt, SingleRunLock as S, CacheIssueReason as Sa, OptimizationTokenUsage as Si, CrossSurfaceBestSingleSelection as Sn, campaignBreakdown as Sr, ToolCallEventLike as St, campaignCellSearchResult as T, CellScheduleSlot as Ta, ComparisonCost as Ti, CrossSurfaceCandidateComparison as Tn, heldOutGate as Tr, CompletionVerdict as Tt, ProfileMatrixRow as U, ReferenceEquivalenceScenario as Ui, CrossSurfacePairEvidence as Un, runCanaries as Ur, RolloutArgumentDiffOptions as Ut, ProfileMatrixCoverage as V, ReferenceEquivalenceJudgeOptions as Vi, CrossSurfaceNaiveStackSelection as Vn, CanaryOptions as Vr, LabeledScenarioStoreError as Vt, ProfileMatrixSegmentResult as W, createReferenceEquivalenceJudge as Wi, CrossSurfacePairIncompatibilityReason as Wn, composeGate as Wr, RolloutCall as Wt, PlaybackDriver as X, isTransientTransportFailure as Xi, CrossSurfaceTaskRow as Xn, GepaEngineOptions as Xr, GepaEvaluationImport as Xt, PlaybackContext as Y, TransientFailureOptions as Yi, CrossSurfaceSelections as Yn, GepaAdaptiveEngineRun as Yr, ExternalSearchOptimizer as Yt, PlaybackStep as Z, quotaExhaustedUntil as Zi, BuildTraceAnalystSurfaceDispatchOptions as Zn, GepaEngineRun as Zr, GepaPopulationImport as Zt, componentSurfaceIdentityMaterial as _, runCampaign as _a, OptimizationMethodProvenance as _i, analyzeCrossSurfaceInteractions as _n, provenanceRecordPath as _r, assertRealBackend as _t, WorktreeAdapterError as a, runOptimization as aa, ExternalTextOptimizationMethodConfig as ai, EvalFixture as an, LoopProvenanceArgsFromResult as ar, scoreUserStory as at, surfaceDispatchRef as b, PlanCampaignRunOptions as ba, OptimizationMethodScore as bi, CrossSurfaceAdditionRejectionReason as bn, CampaignBreakdown as br, ProposalEventLike as bt, verifyCodeSurface as c, SearchLedgerIntegrityError as ca, ExternalOptimizationExample as ci, EvalFixtureRunPlan as cn, LoopProvenanceEvidence as cr, ProfileDispatchFn as ct, PhoenixEvaluationResultLike as d, openAutoPr as da, CompareOptimizationMethodsOptions as di, LoadEvalFixtureScenariosOptions as dn, buildLoopProvenanceRecord as dr, RunProfileMatrixOptions as dt, RunImprovementLoopResult as ea, GepaRunnerCommand as ei, importGepaPopulation as en, buildTraceAnalystSurfaceDispatch as er, ScoreboardSummary as et, PhoenixEvaluatorLike as f, RunEvalOptions as fa, OptimizationMethod as fi, PlanEvalFixtureRunOptions as fn, campaignMeasurementDigest as fr, RunProfileMatrixResult as ft, codeSurfaceIdentityMaterial as g, RunCampaignOptions as ga, OptimizationMethodPairwise as gi, planEvalFixtureRun as gn, loopProvenanceSpans as gr, BackendIntegrityReport as gt, assertCodeSurfaceIdentity as h, CampaignCellRetryPolicy as ha, OptimizationMethodInput as hi, loadEvalFixtureScenarios as hn, loopProvenanceArgsFromResult as hr, BackendIntegrityError as ht, WorktreeAdapter as i, RunOptimizationResult as ia, externalTextOptimizationMethod as ii, neutralizationGate as in, EmitLoopProvenanceResult as ir, renderScoreboardMarkdown as it, scoreDiscrimination as j, assertCampaignDesign as ja, GepaCandidateSelectionScore as ji, CrossSurfaceCompositionStep as jn, RedTeamCase as jr, SatisfiedBy as jt, DiscriminationScore as k, FinalEvidenceUse as ka, GepaCandidatePopulationCandidate as ki, CrossSurfaceComponent as kn, defaultProductionGate as kr, ProducedState as kt, AutoevalsScoreLike as l, OpenAutoPrOptions as la, ExternalTextEvaluationResponse as li, EvalFixtureScenario as ln, LoopProvenanceOptimizationMethod as lr, ProfileMatrixError as lt, phoenixEvaluatorJudge as m, CampaignCellFailureReceipt as ma, OptimizationMethodComposition as mi, loadEvalFixture as mn, emitLoopProvenance as mr, runProfileMatrix as mt, GitWorktreeAdapterOptions as n, PremeasuredOptimizationBaseline as na, OpenAICompatibleOptimizerModel as ni, recordSkillOptSearch as nn, BuildLoopProvenanceArgs as nr, UserStoryVerdict as nt, gitWorktreeAdapter as o, SearchLedgerConflictError as oa, ExternalTextOptimizerContext as oi, EvalFixtureFile as on, LoopProvenanceBackend as or, scoreboardSummary as ot, autoevalsScorerJudge as p, runEval as pa, OptimizationMethodComparison as pi, discoverEvalFixtures as pn, canonicalDigest as pr, ScenarioRollup as pt, finalizeProfileMatrix as q, LlmJudgeOptions as qi, CrossSurfaceRelativeCost as qn, SkillOptTrainerConfig as qr, classifyUngroundedLiterals as qt, Worktree as r, RunOptimizationOptions as ra, OptimizerModelBudget as ri, NeutralizationGateOptions as rn, EmitLoopProvenanceArgs as rr, makePlaybackDispatch as rt, resolveWorktreePath as s, SearchLedgerError as sa, ExternalTextOptimizerResult as si, EvalFixtureLoadOptions as sn, LoopProvenanceCandidate as sr, userStoryScoreboard as st, CodeSurfaceVerification as t, runImprovementLoop as ta, gepaOptimizationMethod as ti, recordGepaSearch as tn, traceAnalystQualityJudge as tr, UserStory as tt, AutoevalsScorerLike as u, OpenAutoPrResult as ua, decodeExternalTextCandidate as ui, EvalFixtureValidationMode as un, LoopProvenanceRecord as ur, ProfileSummary as ut, renderSurfaceDiff as v, CampaignRunPlan as va, OptimizationMethodResult as vi, AnalyzeCrossSurfaceInteractionsInput as vn, provenanceSpansPath as vr, summarizeBackendIntegrity as vt, acquireSingleRunLock as w, readCachedCell as wa, optimizationTokenUsageFromSummary as wi, CrossSurfaceCandidate as wn, HeldOutGateOptions as wr, CompletionRequirement as wt, surfaceHash as x, planCampaignRun as xa, OptimizationPackageSource as xi, CrossSurfaceAttemptCompleteness as xn, CampaignComparisonUnits as xr, RuntimeEventLike as xt, surfaceContentHash as y, CampaignRunPlanCell as ya, OptimizationMethodRunOptions as yi, CrossSurfaceAdditionDecision as yn, verifyLoopProvenanceRecord as yr, ArtifactEventLike as yt, FinalizeProfileMatrixOptions as z, REFERENCE_EQUIVALENCE_JUDGE_VERSION as zi, CrossSurfaceInteractionReport as zn, CanaryEvaluation as zr, FsLabeledScenarioStore as zt };
|
|
3393
|
-
//# sourceMappingURL=index-
|
|
3382
|
+
//# sourceMappingURL=index-xnhRdqik.d.ts.map
|