@tangle-network/agent-eval 1.0.22 → 1.0.23
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 +37 -0
- package/dist/adapters/http.d.ts +2 -2
- package/dist/{agent-profile-DU5InUT9.d.ts → agent-profile-C80hNPYb.d.ts} +2 -2
- package/dist/{agent-profile-DU5InUT9.d.ts.map → agent-profile-C80hNPYb.d.ts.map} +1 -1
- package/dist/analyst/index.d.ts +11 -11
- package/dist/{analyze-runs-jLTRKuoK.js → analyze-runs-BCSHzqna.js} +2 -2
- package/dist/{analyze-runs-jLTRKuoK.js.map → analyze-runs-BCSHzqna.js.map} +1 -1
- package/dist/{analyze-runs-DYYe18Gw.d.ts → analyze-runs-DbHQHvDC.d.ts} +4 -4
- package/dist/{analyze-runs-DYYe18Gw.d.ts.map → analyze-runs-DbHQHvDC.d.ts.map} +1 -1
- package/dist/app-grade/index.d.ts +3 -3
- package/dist/benchmarks/index.d.ts +5 -5
- package/dist/benchmarks/index.js +2 -2
- package/dist/campaign/index.d.ts +6 -6
- package/dist/campaign/index.js +7 -7
- package/dist/{campaign-C2mmydmx.js → campaign-D00Tbey-.js} +9 -9
- package/dist/{campaign-C2mmydmx.js.map → campaign-D00Tbey-.js.map} +1 -1
- package/dist/{campaign-evidence-NtH29ctt.js → campaign-evidence-CVNKiK0q.js} +2 -2
- package/dist/{campaign-evidence-NtH29ctt.js.map → campaign-evidence-CVNKiK0q.js.map} +1 -1
- package/dist/cli.js +5 -5
- package/dist/contract/index.d.ts +10 -10
- package/dist/contract/index.js +7 -8
- package/dist/contract/index.js.map +1 -1
- package/dist/{default-registry-aPvwtzEM.d.ts → default-registry-CjgRr-l7.d.ts} +7 -7
- package/dist/{default-registry-aPvwtzEM.d.ts.map → default-registry-CjgRr-l7.d.ts.map} +1 -1
- package/dist/{define-agent-eval-DGWBgCid.d.ts → define-agent-eval-BQBwKHwF.d.ts} +7 -7
- package/dist/{define-agent-eval-DGWBgCid.d.ts.map → define-agent-eval-BQBwKHwF.d.ts.map} +1 -1
- package/dist/{define-agent-eval-BROmIwn1.js → define-agent-eval-BV16x8C0.js} +7 -7
- package/dist/{define-agent-eval-BROmIwn1.js.map → define-agent-eval-BV16x8C0.js.map} +1 -1
- package/dist/diagnosis/index.d.ts +2 -2
- package/dist/diagnosis/index.js +1 -1
- package/dist/{engine-BF8naBn7.d.ts → engine-s3t6uYH9.d.ts} +2 -2
- package/dist/{engine-BF8naBn7.d.ts.map → engine-s3t6uYH9.d.ts.map} +1 -1
- package/dist/{eval-campaign-Dq8DEKmy.js → eval-campaign-DpkToY_w.js} +2 -2
- package/dist/eval-campaign-DpkToY_w.js.map +1 -0
- package/dist/{evaluation-CFKj_IlJ.d.ts → evaluation-DRgHKEVV.d.ts} +4 -4
- package/dist/{evaluation-CFKj_IlJ.d.ts.map → evaluation-DRgHKEVV.d.ts.map} +1 -1
- package/dist/evaluation.d.ts +1 -1
- package/dist/{exact-types-VAFjtOQN.d.ts → exact-types-DTlZSygs.d.ts} +2 -2
- package/dist/{exact-types-VAFjtOQN.d.ts.map → exact-types-DTlZSygs.d.ts.map} +1 -1
- package/dist/experiment/index.d.ts +2 -2
- package/dist/experiment/index.js +2 -2
- package/dist/{feedback-trajectory-DTj8eVTR.d.ts → feedback-trajectory-DrKk79NU.d.ts} +3 -3
- package/dist/{feedback-trajectory-DTj8eVTR.d.ts.map → feedback-trajectory-DrKk79NU.d.ts.map} +1 -1
- package/dist/hosted/index.js +1 -1
- package/dist/{index-BlTbxHlY.d.ts → index-DAnkXnwF.d.ts} +3 -3
- package/dist/{index-BlTbxHlY.d.ts.map → index-DAnkXnwF.d.ts.map} +1 -1
- package/dist/{index-Bp3w4fWc.d.ts → index-DLZp90hM.d.ts} +8 -8
- package/dist/{index-Bp3w4fWc.d.ts.map → index-DLZp90hM.d.ts.map} +1 -1
- package/dist/{index-YS58LHlx.d.ts → index-DZ_aqB7v.d.ts} +23 -179
- package/dist/index-DZ_aqB7v.d.ts.map +1 -0
- package/dist/{index-DX87wzX3.d.ts → index-DjrXBogW.d.ts} +9 -9
- package/dist/{index-DX87wzX3.d.ts.map → index-DjrXBogW.d.ts.map} +1 -1
- package/dist/{index-QLDWZTxI.d.ts → index-DtX456kD.d.ts} +6 -6
- package/dist/{index-QLDWZTxI.d.ts.map → index-DtX456kD.d.ts.map} +1 -1
- package/dist/{index-B62BaRzH.d.ts → index-DwscLCQX.d.ts} +2 -2
- package/dist/{index-B62BaRzH.d.ts.map → index-DwscLCQX.d.ts.map} +1 -1
- package/dist/index.d.ts +25 -25
- package/dist/index.js +13 -12
- package/dist/index.js.map +1 -1
- package/dist/{llm-judge-C813vmpc.js → llm-judge-Cbh7OHaO.js} +7 -7
- package/dist/{llm-judge-C813vmpc.js.map → llm-judge-Cbh7OHaO.js.map} +1 -1
- package/dist/{matrix-C-GxIgeJ.d.ts → matrix-8NhGDcmi.d.ts} +2 -2
- package/dist/{matrix-C-GxIgeJ.d.ts.map → matrix-8NhGDcmi.d.ts.map} +1 -1
- package/dist/meta-eval/index.d.ts +2 -2
- package/dist/{mint-yF51iBgY.js → mint-Ck92efNo.js} +2 -2
- package/dist/{mint-yF51iBgY.js.map → mint-Ck92efNo.js.map} +1 -1
- package/dist/multishot/golden/index.d.ts +1 -1
- package/dist/multishot/index.d.ts +2 -2
- package/dist/openapi.json +1 -1
- package/dist/paired-promotion-power-D03cUj9E.js +289 -0
- package/dist/paired-promotion-power-D03cUj9E.js.map +1 -0
- package/dist/{pareto-fJZg8pXm.js → pareto-UzjB3ZBk.js} +5 -288
- package/dist/pareto-UzjB3ZBk.js.map +1 -0
- package/dist/{prime-protocol-D1NkJRuD.d.ts → prime-protocol-CKxq_-cx.d.ts} +2 -2
- package/dist/{prime-protocol-D1NkJRuD.d.ts.map → prime-protocol-CKxq_-cx.d.ts.map} +1 -1
- package/dist/{promotion-gate-Da0xV4sa.d.ts → promotion-gate-HDtliGsh.d.ts} +3 -3
- package/dist/{promotion-gate-Da0xV4sa.d.ts.map → promotion-gate-HDtliGsh.d.ts.map} +1 -1
- package/dist/{registry-BAcEbzKm.d.ts → registry-BnenKvxM.d.ts} +3 -3
- package/dist/{registry-BAcEbzKm.d.ts.map → registry-BnenKvxM.d.ts.map} +1 -1
- package/dist/{release-confidence-DGtuPDxJ.js → release-confidence-B4Xxdpmn.js} +2 -2
- package/dist/{release-confidence-DGtuPDxJ.js.map → release-confidence-B4Xxdpmn.js.map} +1 -1
- package/dist/reporting.d.ts +4 -4
- package/dist/reporting.js +2 -2
- package/dist/{researcher-CSlc84Bp.d.ts → researcher-DEpedkOZ.d.ts} +4 -4
- package/dist/{researcher-CSlc84Bp.d.ts.map → researcher-DEpedkOZ.d.ts.map} +1 -1
- package/dist/{reward-ST4PXNXF.d.ts → reward-ap_R9mCH.d.ts} +2 -2
- package/dist/{reward-ST4PXNXF.d.ts.map → reward-ap_R9mCH.d.ts.map} +1 -1
- package/dist/{reward-hacking-C9hPVT0Q.d.ts → reward-hacking-CIdVwVe4.d.ts} +2 -2
- package/dist/{reward-hacking-C9hPVT0Q.d.ts.map → reward-hacking-CIdVwVe4.d.ts.map} +1 -1
- package/dist/rl.d.ts +8 -8
- package/dist/rl.js +5 -5
- package/dist/rollout/index.d.ts +3 -3
- package/dist/rollout/index.js +2 -2
- package/dist/{rollout-DKa54qer.js → rollout-DWl3Gg6A.js} +2 -2
- package/dist/{rollout-DKa54qer.js.map → rollout-DWl3Gg6A.js.map} +1 -1
- package/dist/{rubric-predictive-validity-B3RzbwOx.d.ts → rubric-predictive-validity-Bbi88Aut.d.ts} +2 -2
- package/dist/{rubric-predictive-validity-B3RzbwOx.d.ts.map → rubric-predictive-validity-Bbi88Aut.d.ts.map} +1 -1
- package/dist/{run-record-CFbnkE1K.js → run-record-DTTx9Ktr.js} +2 -2
- package/dist/{run-record-CFbnkE1K.js.map → run-record-DTTx9Ktr.js.map} +1 -1
- package/dist/{run-record-CpLS4Uid.js → run-record-DmX_ESC5.js} +7 -5
- package/dist/run-record-DmX_ESC5.js.map +1 -0
- package/dist/{run-record-D2BFMPGl.d.ts → run-record-pBlhZizT.d.ts} +8 -8
- package/dist/{run-record-D2BFMPGl.d.ts.map → run-record-pBlhZizT.d.ts.map} +1 -1
- package/dist/search/index.d.ts +2 -2
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +2 -2
- package/dist/{search-kernel-CQGLbmgn.d.ts → search-kernel-CoDJ21q9.d.ts} +3 -3
- package/dist/{search-kernel-CQGLbmgn.d.ts.map → search-kernel-CoDJ21q9.d.ts.map} +1 -1
- package/dist/{search-ledger-Dk-yk5Li.js → search-ledger-9liYyZf5.js} +2 -2
- package/dist/{search-ledger-Dk-yk5Li.js.map → search-ledger-9liYyZf5.js.map} +1 -1
- package/dist/{search-shipper-Dm-_Dtvy.js → search-shipper-B6tMNx1I.js} +2 -2
- package/dist/{search-shipper-Dm-_Dtvy.js.map → search-shipper-B6tMNx1I.js.map} +1 -1
- package/dist/{search-summary-sPWiYtSl.js → search-summary-CISbbxyr.js} +2 -2
- package/dist/{search-summary-sPWiYtSl.js.map → search-summary-CISbbxyr.js.map} +1 -1
- package/dist/sequential-BCzXKQab.d.ts +246 -0
- package/dist/sequential-BCzXKQab.d.ts.map +1 -0
- package/dist/{sequential-CAksw6EU.js → sequential-Ko7T-zvu.js} +65 -28
- package/dist/sequential-Ko7T-zvu.js.map +1 -0
- package/dist/{skillopt-optimization-method-QO1nU8Kz.js → skillopt-optimization-method-B1Hkfexf.js} +4 -4
- package/dist/{skillopt-optimization-method-QO1nU8Kz.js.map → skillopt-optimization-method-B1Hkfexf.js.map} +1 -1
- package/dist/{statistical-heldout-CvOwNqt9.d.ts → statistical-heldout-e2hbqDui.d.ts} +4 -4
- package/dist/{statistical-heldout-CvOwNqt9.d.ts.map → statistical-heldout-e2hbqDui.d.ts.map} +1 -1
- package/dist/{store-tool-spans-B3z_Qb5u.d.ts → store-tool-spans-mlmGj6n3.d.ts} +5 -5
- package/dist/{store-tool-spans-B3z_Qb5u.d.ts.map → store-tool-spans-mlmGj6n3.d.ts.map} +1 -1
- package/dist/{summary-report-DyZquTaH.d.ts → summary-report-DsiORzPc.d.ts} +3 -3
- package/dist/{summary-report-DyZquTaH.d.ts.map → summary-report-DsiORzPc.d.ts.map} +1 -1
- package/dist/{systemone-DVk-Crtu.d.ts → systemone-B93onE_a.d.ts} +7 -7
- package/dist/{systemone-DVk-Crtu.d.ts.map → systemone-B93onE_a.d.ts.map} +1 -1
- package/dist/{systemone-review-CToBl1oa.d.ts → systemone-review-BIggseLt.d.ts} +2 -2
- package/dist/{systemone-review-CToBl1oa.d.ts.map → systemone-review-BIggseLt.d.ts.map} +1 -1
- package/dist/systemone.d.ts +3 -3
- package/dist/{tool-groups-R5RO9OHn.d.ts → tool-groups-CCiATVZw.d.ts} +3 -3
- package/dist/tool-groups-CCiATVZw.d.ts.map +1 -0
- package/dist/{trace-questions-BY6taxnl.d.ts → trace-questions-B7lkyOlo.d.ts} +3 -3
- package/dist/{trace-questions-BY6taxnl.d.ts.map → trace-questions-B7lkyOlo.d.ts.map} +1 -1
- package/dist/trace-repair/index.d.ts +2 -2
- package/dist/traces.d.ts +4 -4
- package/dist/traces.js +2 -8
- package/dist/traces.js.map +1 -1
- package/dist/{tree-C-N2kP-8.js → tree-D2cNtu9m.js} +10 -10
- package/dist/tree-D2cNtu9m.js.map +1 -0
- package/dist/{types-BsdcSWnf.d.ts → types-3uX8odDK.d.ts} +3 -3
- package/dist/{types-BsdcSWnf.d.ts.map → types-3uX8odDK.d.ts.map} +1 -1
- package/dist/{types-kBMNdo1X.d.ts → types-Ob1blgI2.d.ts} +2 -2
- package/dist/{types-kBMNdo1X.d.ts.map → types-Ob1blgI2.d.ts.map} +1 -1
- package/dist/{types-ip2D3-Ib.d.ts → types-efIQ03Uo.d.ts} +4 -4
- package/dist/{types-ip2D3-Ib.d.ts.map → types-efIQ03Uo.d.ts.map} +1 -1
- package/dist/wire/index.d.ts +5 -5
- package/docs/adopt-stack.md +9 -0
- package/docs/eval-fixtures.md +2 -2
- package/docs/search-ledger.md +1 -0
- package/package.json +1 -1
- package/dist/eval-campaign-Dq8DEKmy.js.map +0 -1
- package/dist/index-YS58LHlx.d.ts.map +0 -1
- package/dist/pareto-fJZg8pXm.js.map +0 -1
- package/dist/run-record-CpLS4Uid.js.map +0 -1
- package/dist/sequential-B9p6uoV8.d.ts +0 -168
- package/dist/sequential-B9p6uoV8.d.ts.map +0 -1
- package/dist/sequential-CAksw6EU.js.map +0 -1
- package/dist/tool-groups-R5RO9OHn.d.ts.map +0 -1
- package/dist/tree-C-N2kP-8.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-record-CpLS4Uid.js","names":[],"sources":["../src/run-record.ts"],"sourcesContent":["/**\n * Paper-grade RunRecord schema + runtime validator.\n *\n * Every run that participates in a promotion gate, paper table, or\n * researcher loop SHOULD be recorded as a `RunRecord`. The mandatory\n * fields are exactly those the paper \"Two Loops, Three Roles\" requires\n * for reproducibility: who/what/when/cost/seed/hash, plus the search vs\n * holdout split tag. A task score is optional because execution-only records\n * must preserve missing labels instead of converting errors into zero quality.\n *\n * This is intentionally NOT a replacement for the rich `Run` /\n * `ProposeReviewReport` / `ScenarioResult` types already in the\n * package. Those are runtime structures with full provenance. A\n * `RunRecord` is the analysis-time projection — the JSON-friendly\n * row you'd put in a parquet file or paste into a notebook.\n *\n * Validate at the boundary:\n *\n * const rec = validateRunRecord(rawJson) // throws on missing\n * const ok = isRunRecord(rawJson) // boolean check\n * const rec = parseRunRecordSafe(rawJson) // { ok, value | error }\n *\n * The validator runs in pure TS — zod is intentionally NOT a\n * dependency.\n */\n\nimport type { AgentProfileCell } from './agent-profile-cell'\nimport { validateAgentProfileCell } from './agent-profile-cell'\nimport type { CostProvenance } from './cost-ledger'\nimport { ValidationError } from './errors'\n// Value import of a leaf module that itself imports only this file's TYPES —\n// no runtime cycle. It keeps the raw split-score derivation spelled in exactly\n// one place (see `rollout/score-derivation-guard`).\nimport { observedScore } from './rollout/reward'\nimport { FAILURE_CLASSES, type FailureClass } from './trace/schema'\n\n/** Search/dev/holdout split tag. 'search' is the paper-grade alias for the\n * combined train+test pool that the optimizer is allowed to read. */\nexport type RunSplitTag = 'search' | 'dev' | 'holdout'\n\n/**\n * Explicit execution-lifecycle result for a run.\n *\n * This is separate from task quality (`outcome`) and failure classification.\n * Producers set it only from root-run or process evidence.\n */\nexport type RunTerminalOutcome = 'succeeded' | 'failed' | 'cancelled' | 'incomplete' | 'unknown'\n\n/** Explicit model value for a row that never produced a served model snapshot. */\nexport const UNKNOWN_MODEL = 'unknown'\n\nexport interface RunTokenUsage {\n input: number\n /** All generated tokens charged as output, including reasoning tokens. */\n output: number\n /** Present only when one or more paid calls did not report token usage.\n * In that case, every numeric field is a known subtotal, not a measured total. */\n tokensKnown?: false\n /** Reasoning-token subset of `output`, when the provider reports it. */\n reasoning?: number\n /** Prompt tokens served from a provider cache. */\n cached?: number\n /** Prompt tokens written into a provider cache. */\n cacheWrite?: number\n}\n\n/**\n * How a run's USD amount was obtained.\n *\n * `costUsd` is the run's total, or null when the total is unknown. A run whose\n * receipts prove only part of its spend is a `lower-bound`: its total is\n * unknown, so `costUsd` and `usd` stay null, and the proven part is\n * `knownLowerBoundUsd`. A reader of the total therefore never takes a floor\n * for a total. A floor of $0 proves nothing, so it is written `uncaptured`.\n *\n * Only a RunRecord needs this kind. Every other cost shape keeps a known\n * subtotal beside `CostProvenance`, where `uncaptured` already means \"at\n * least the subtotal\"; a RunRecord's nullable `costUsd` cannot hold one.\n */\nexport type RunCostProvenance =\n | CostProvenance\n | { kind: 'lower-bound'; usd: null; knownLowerBoundUsd: number }\n\n/**\n * The run's place in a search: one attempt at one cell. The search ledger\n * holds the lineage (the node's parents, depth and order); a RunRecord only\n * points at it.\n */\nexport interface RunSearchCoordinates {\n searchId: string\n nodeId: string\n /** The cell id hashes the search, node, task, split and repeat, so it is\n * unique across candidates. */\n cellId: string\n /** Attempt number within the cell, counted from 1. */\n attempt: number\n}\n\n/** Where the run's execution record lives. */\nexport interface RunTraceRef {\n /** Trace id shared by every span of the run. */\n traceId: string\n /** Root run of the execution tree the run spawned, when one exists. */\n execRunId?: string\n}\n\n/**\n * The run id of one attempt at a search cell. It is unique across candidates\n * and attempts, unlike a `${scenario}:${rep}` id, which every candidate that\n * ran the same scenario shares.\n */\nexport function searchCellRunId(search: Pick<RunSearchCoordinates, 'cellId' | 'attempt'>): string {\n return `${search.cellId}:${search.attempt}`\n}\n\nexport interface RunJudgeMetadata {\n model: string\n promptVersion: string\n /** [0,1] confidence the judge declared. Constant judge confidence\n * across many runs is a fallback signal (see `canary.ts`). */\n confidence: number\n /** True if the judge degraded to a fallback path (rules-only,\n * prior-call cache, etc.). The canary uses this to alert. */\n fallback: boolean\n}\n\n/**\n * Per-judge / per-dimension breakdown for runs scored by an ensemble of\n * judges over a multi-dimensional rubric.\n *\n * The collapsed `outcome.searchScore` / `holdoutScore` carries the\n * composite the gate uses. The full breakdown belongs here so consumers\n * can answer \"which judge disagreed?\", \"which dimension dragged the\n * composite down?\", and \"did half the panel fail?\" without re-running.\n *\n * `perJudge[judgeId][dim]` is the canonical source; `perDimMean` and\n * `composite` are convenience projections — derivable but precomputed so\n * downstream IRR primitives (`interRaterReliability`,\n * `corpusInterRaterAgreement`) and reporters don't pay the same\n * aggregation twice.\n *\n * Fail-loud discipline: judges that errored out land in `failedJudges`\n * by id. A missing key in `perJudge` is ambiguous (silent zero vs not\n * run); the explicit list makes a partial-failure recorded as such.\n */\nexport interface JudgeScoresRecord {\n /** Per-judge per-dimension scores. `{ \"kimi-k2.6\": { helpfulness: 0.8, clarity: 0.7 }, ... }`. */\n perJudge: Record<string, Record<string, number>>\n /** Per-dim mean across judges. Convenience — derivable from `perJudge`. */\n perDimMean: Record<string, number>\n /** Composite mean across successful judges. Mirrors the task score only\n * when `failedJudges` is empty. */\n composite: number\n /** Judges that errored or returned an unparseable verdict. Recorded\n * by id (e.g. `['glm-5.1']`) so a partial-failure case is explicit,\n * not inferred from missing keys in `perJudge`. */\n failedJudges?: string[]\n /** Free-form notes the judges emitted (joined across judges or\n * first-judge only — consumer's choice). */\n notes?: string\n}\n\nexport interface RunOutcome {\n /** Score on the search/optimization split. Optional for holdout-only and\n * execution-only records. */\n searchScore?: number\n /** Score on the held-out split. Optional for search-only and execution-only\n * records. When both scores are absent, the run is explicitly unlabeled. */\n holdoutScore?: number\n /** Bag of any other metric the run produced — judge dimensions,\n * pass/fail counters, latency stats, etc. Numeric only — keeps\n * reporters honest. */\n raw: Record<string, number>\n /** Per-judge / per-dim breakdown. Consumers writing ensemble\n * judgements populate this; substrate primitives like\n * `interRaterReliability` and `corpusInterRaterAgreement` accept\n * these records as input. Optional — single-judge or scalar-only\n * runs leave it unset. */\n judgeScores?: JudgeScoresRecord\n /** Authenticity / realness verdict — did the run build the REAL thing on the\n * intended infra, or fake it (see `./authenticity`)? Optional: only domains\n * with an authenticity config populate it. Carried in the corpus so the\n * flywheel / off-policy learning can optimize for real completion, not gamed\n * pass-rate. `score` is 0-1; `gated` is the anti-Goodhart flag — a gated run\n * must not count as a real success regardless of `score`. */\n realness?: { score: number; gated: boolean; reason?: string }\n}\n\n/**\n * Mandatory paper-grade fields for a single evaluation run. Optional\n * fields are extension points; mandatory fields throw if missing.\n *\n * Hash discipline:\n * - `promptHash` is the sha256 of the EFFECTIVE prompt sent to the\n * model (after any steering bundle merge).\n * - `configHash` is the sha256 of the effective run config (model,\n * temperature, tools, judges, splits). The pair (promptHash,\n * configHash) uniquely identifies an experiment cell.\n *\n * Model snapshot discipline:\n * - successful rows MUST encode a snapshot version. Bare aliases like\n * `claude-sonnet-4` or `gpt-4o` are banned — they remap silently.\n * Use `claude-sonnet-4-6@2025-04-15` or `gpt-4o-2024-11-20`.\n * - a failed, cancelled, incomplete, or otherwise unknown row may use\n * `UNKNOWN_MODEL` when no served model was observed. This is an explicit\n * absence marker, not a fabricated snapshot.\n */\nexport interface RunRecord {\n /** UUID for the run. */\n runId: string\n /** Logical experiment grouping (a treatment vs a baseline within\n * the same sweep should share `experimentId`). */\n experimentId: string\n /** Stable identifier for the candidate (variant) being run. The\n * promotion gate compares two `candidateId`s on matched items. */\n candidateId: string\n /** RNG seed for the run. Always recorded — silent re-seeding is\n * the most common cause of non-reproducible numbers. */\n seed: number\n /** Model identifier WITH snapshot version. */\n model: string\n /** sha256 of the effective prompt (post-steering). */\n promptHash: string\n /** sha256 of the effective config. */\n configHash: string\n /** Git SHA the harness was run from. */\n commitSha: string\n /** End-to-end wall-clock duration in milliseconds. */\n wallMs: number\n /** Time spent queued before execution started, if known. */\n queueMs?: number\n /** Total USD cost, or null when the total is unknown. */\n costUsd: number | null\n /** Whether `costUsd` came from billing data or a price calculation, is only\n * proven down to a floor, or is unavailable. */\n costProvenance: RunCostProvenance\n /** Token usage breakdown. */\n tokenUsage: RunTokenUsage\n /** Root-run or process terminal result. Never inferred from a child span. */\n terminalOutcome: RunTerminalOutcome\n /** Root-run or process failure reason. Valid only for a failed, cancelled,\n * or incomplete terminal result; never populated from a child span. */\n terminalFailureReason?: string\n /** Judge-side metadata, if a judge was used. */\n judgeMetadata?: RunJudgeMetadata\n /** Per-split scores + raw bag. */\n outcome: RunOutcome\n /** Canonical task-failure class drawn from the shared\n * `FAILURE_CLASSES` taxonomy. Producers set it only from task-result\n * evidence. Execution errors belong in\n * `outcome.raw.execution_error_count`. */\n failureClass?: FailureClass\n /** Free-form task-failure detail scoped under a non-success\n * `failureClass`. It is invalid without that class. */\n failureMode?: string\n /** Which split this run was drawn from. */\n splitTag: RunSplitTag\n /**\n * Stable scenario identifier the run observed or was scored against.\n * Comparison primitives match this identity rather than input order.\n */\n scenarioId: string\n /**\n * Canonical identity for the agent profile cell that produced this row:\n * profile artifact hash plus optional harness/model/prompt/reporting\n * dimensions. Use `agentProfile.cellId` to group persona sweeps and\n * longitudinal reports by the complete source profile, not by a loose\n * candidate label or opaque config hash.\n */\n agentProfile?: AgentProfileCell\n /** The search cell this run settled. When present, `runId` is\n * `searchCellRunId(search)`. */\n search?: RunSearchCoordinates\n /** The run's trace and execution tree. Absent means the producer did not\n * record where they are. */\n traceRef?: RunTraceRef\n}\n\n/**\n * Canonical task-result classification.\n *\n * A producer may omit classification, record explicit success, or attach\n * domain-specific detail to a non-success class. Detail can never stand alone.\n * Execution errors belong in `outcome.raw.execution_error_count`.\n */\nexport type RunTaskFailure =\n | { failureClass?: undefined; failureMode?: undefined }\n | { failureClass: 'success'; failureMode?: undefined }\n | {\n failureClass: Exclude<FailureClass, 'success'>\n failureMode?: string\n }\n\n/**\n * Return task quality, preferring held-out evidence when both scores exist.\n *\n * RAW: no realness protection is applied. Built on `observedScore` rather\n * than repeating the split derivation, so only `rollout/reward.ts` reads the\n * raw fields. Anything that becomes training data must use `trainingScore` or\n * `trainingReward` instead.\n */\nexport function runTaskScore(record: RunRecord): number | undefined {\n const score = observedScore(record)\n return typeof score === 'number' && Number.isFinite(score) ? score : undefined\n}\n\n// ── Validation ───────────────────────────────────────────────────────\n\nconst MANDATORY_TOP_LEVEL = [\n 'runId',\n 'experimentId',\n 'candidateId',\n 'seed',\n 'model',\n 'promptHash',\n 'configHash',\n 'commitSha',\n 'wallMs',\n 'costUsd',\n 'costProvenance',\n 'tokenUsage',\n 'terminalOutcome',\n 'outcome',\n 'splitTag',\n 'scenarioId',\n] as const\n\nconst SPLIT_TAGS: ReadonlyArray<RunSplitTag> = ['search', 'dev', 'holdout']\nconst TERMINAL_OUTCOMES: ReadonlyArray<RunTerminalOutcome> = [\n 'succeeded',\n 'failed',\n 'cancelled',\n 'incomplete',\n 'unknown',\n]\n\nexport class RunRecordValidationError extends ValidationError {\n readonly path: string\n constructor(message: string, path = '') {\n super(path ? `${message} (at ${path})` : message)\n this.path = path\n }\n}\n\n/**\n * Strict validator. Throws `RunRecordValidationError` on the first\n * missing or wrongly-typed field. Returns the input cast to\n * `RunRecord` on success — the validator does not coerce.\n */\nexport function validateRunRecord(input: unknown): RunRecord {\n if (input === null || typeof input !== 'object') {\n throw new RunRecordValidationError('expected object')\n }\n const obj = input as Record<string, unknown>\n\n for (const key of MANDATORY_TOP_LEVEL) {\n if (!(key in obj)) {\n throw new RunRecordValidationError(`missing mandatory field \"${key}\"`)\n }\n }\n\n expectString(obj.runId, 'runId')\n expectString(obj.experimentId, 'experimentId')\n expectString(obj.candidateId, 'candidateId')\n expectFiniteNumber(obj.seed, 'seed')\n expectString(obj.model, 'model')\n expectString(obj.promptHash, 'promptHash')\n expectString(obj.configHash, 'configHash')\n expectString(obj.commitSha, 'commitSha')\n expectNonNegativeNumber(obj.wallMs, 'wallMs')\n if (obj.queueMs !== undefined) expectNonNegativeNumber(obj.queueMs, 'queueMs')\n validateCost(obj.costUsd, obj.costProvenance)\n\n // Snapshot discipline: successful rows require a served model snapshot.\n // Non-success rows may carry the explicit absence marker when execution\n // stopped before a model identity was observed.\n if (\n !modelHasSnapshot(obj.model as string) &&\n !(obj.model === UNKNOWN_MODEL && obj.terminalOutcome !== 'succeeded')\n ) {\n throw new RunRecordValidationError(\n `model \"${obj.model}\" lacks a snapshot version (use 'name@YYYY-MM-DD' or 'name-YYYYMMDD', or '${UNKNOWN_MODEL}' for a non-success row without a served model)`,\n 'model',\n )\n }\n\n // Token usage.\n const tu = obj.tokenUsage\n if (tu === null || typeof tu !== 'object') {\n throw new RunRecordValidationError('tokenUsage must be an object', 'tokenUsage')\n }\n const tuRec = tu as Record<string, unknown>\n expectNonNegativeNumber(tuRec.input, 'tokenUsage.input')\n expectNonNegativeNumber(tuRec.output, 'tokenUsage.output')\n if (tuRec.tokensKnown !== undefined && tuRec.tokensKnown !== false) {\n throw new RunRecordValidationError(\n 'tokensKnown must be false when present; omit it when token usage is complete',\n 'tokenUsage.tokensKnown',\n )\n }\n if (tuRec.reasoning !== undefined) {\n expectNonNegativeNumber(tuRec.reasoning, 'tokenUsage.reasoning')\n if ((tuRec.reasoning as number) > (tuRec.output as number)) {\n throw new RunRecordValidationError(\n 'reasoning tokens must be a subset of output tokens',\n 'tokenUsage.reasoning',\n )\n }\n }\n if (tuRec.cached !== undefined) expectNonNegativeNumber(tuRec.cached, 'tokenUsage.cached')\n if (tuRec.cacheWrite !== undefined) {\n expectNonNegativeNumber(tuRec.cacheWrite, 'tokenUsage.cacheWrite')\n }\n\n // Judge metadata, optional.\n if (obj.judgeMetadata !== undefined) {\n const jm = obj.judgeMetadata\n if (jm === null || typeof jm !== 'object') {\n throw new RunRecordValidationError('judgeMetadata must be an object', 'judgeMetadata')\n }\n const jmRec = jm as Record<string, unknown>\n expectString(jmRec.model, 'judgeMetadata.model')\n expectString(jmRec.promptVersion, 'judgeMetadata.promptVersion')\n expectFiniteNumber(jmRec.confidence, 'judgeMetadata.confidence')\n if (typeof jmRec.fallback !== 'boolean') {\n throw new RunRecordValidationError(\n 'judgeMetadata.fallback must be boolean',\n 'judgeMetadata.fallback',\n )\n }\n }\n\n // Outcome.\n const out = obj.outcome\n if (out === null || typeof out !== 'object') {\n throw new RunRecordValidationError('outcome must be an object', 'outcome')\n }\n const outRec = out as Record<string, unknown>\n if (outRec.searchScore !== undefined)\n expectFiniteNumber(outRec.searchScore, 'outcome.searchScore')\n if (outRec.holdoutScore !== undefined)\n expectFiniteNumber(outRec.holdoutScore, 'outcome.holdoutScore')\n const raw = outRec.raw\n if (raw === null || typeof raw !== 'object') {\n throw new RunRecordValidationError('outcome.raw must be an object', 'outcome.raw')\n }\n for (const [k, v] of Object.entries(raw as Record<string, unknown>)) {\n expectFiniteNumber(v, `outcome.raw.${k}`)\n }\n // Realness verdict, optional.\n if (outRec.realness !== undefined) {\n const r = outRec.realness\n if (r === null || typeof r !== 'object') {\n throw new RunRecordValidationError('outcome.realness must be an object', 'outcome.realness')\n }\n const rr = r as Record<string, unknown>\n expectFiniteNumber(rr.score, 'outcome.realness.score')\n if (typeof rr.gated !== 'boolean') {\n throw new RunRecordValidationError(\n 'outcome.realness.gated must be a boolean',\n 'outcome.realness.gated',\n )\n }\n }\n\n // Per-judge / per-dim breakdown, optional.\n if (outRec.judgeScores !== undefined) {\n validateJudgeScores(outRec.judgeScores, 'outcome.judgeScores')\n }\n\n // Failure mode optional.\n if (\n obj.failureClass !== undefined &&\n (typeof obj.failureClass !== 'string' ||\n !FAILURE_CLASSES.includes(obj.failureClass as FailureClass))\n ) {\n throw new RunRecordValidationError(\n `failureClass must be one of ${FAILURE_CLASSES.join(', ')}`,\n 'failureClass',\n )\n }\n if (obj.failureMode !== undefined) {\n expectString(obj.failureMode, 'failureMode')\n if (obj.failureClass === undefined || obj.failureClass === 'success') {\n throw new RunRecordValidationError(\n 'failureMode requires a non-success failureClass',\n 'failureMode',\n )\n }\n }\n\n if (\n typeof obj.terminalOutcome !== 'string' ||\n !TERMINAL_OUTCOMES.includes(obj.terminalOutcome as RunTerminalOutcome)\n ) {\n throw new RunRecordValidationError(\n `terminalOutcome must be one of ${TERMINAL_OUTCOMES.join(', ')}`,\n 'terminalOutcome',\n )\n }\n if (obj.terminalFailureReason !== undefined) {\n expectString(obj.terminalFailureReason, 'terminalFailureReason')\n if (\n obj.terminalOutcome !== 'failed' &&\n obj.terminalOutcome !== 'cancelled' &&\n obj.terminalOutcome !== 'incomplete'\n ) {\n throw new RunRecordValidationError(\n 'terminalFailureReason requires terminalOutcome failed, cancelled, or incomplete',\n 'terminalFailureReason',\n )\n }\n }\n\n if (obj.agentProfile !== undefined) {\n try {\n const profile = validateAgentProfileCell(obj.agentProfile)\n if (profile.model !== undefined && profile.model !== obj.model) {\n throw new RunRecordValidationError(\n `agentProfile.model \"${profile.model}\" does not match model \"${obj.model}\"`,\n 'agentProfile.model',\n )\n }\n if (profile.promptHash !== undefined && profile.promptHash !== obj.promptHash) {\n throw new RunRecordValidationError(\n `agentProfile.promptHash \"${profile.promptHash}\" does not match promptHash \"${obj.promptHash}\"`,\n 'agentProfile.promptHash',\n )\n }\n } catch (error) {\n if (error instanceof RunRecordValidationError) throw error\n if (error instanceof Error) {\n throw new RunRecordValidationError(error.message, 'agentProfile')\n }\n throw error\n }\n }\n\n expectString(obj.scenarioId, 'scenarioId')\n\n if (obj.search !== undefined) validateSearchCoordinates(obj.search, obj.runId as string)\n if (obj.traceRef !== undefined) validateTraceRef(obj.traceRef)\n\n // Split tag.\n if (typeof obj.splitTag !== 'string' || !SPLIT_TAGS.includes(obj.splitTag as RunSplitTag)) {\n throw new RunRecordValidationError(\n `splitTag must be one of ${SPLIT_TAGS.join(', ')}, got ${String(obj.splitTag)}`,\n 'splitTag',\n )\n }\n\n return input as RunRecord\n}\n\nfunction validateCost(costUsd: unknown, provenance: unknown): void {\n if (provenance === null || typeof provenance !== 'object') {\n throw new RunRecordValidationError('costProvenance must be an object', 'costProvenance')\n }\n const value = provenance as Record<string, unknown>\n if (\n value.kind !== 'observed' &&\n value.kind !== 'estimated' &&\n value.kind !== 'lower-bound' &&\n value.kind !== 'uncaptured'\n ) {\n throw new RunRecordValidationError(\n 'costProvenance.kind must be observed, estimated, lower-bound, or uncaptured',\n 'costProvenance.kind',\n )\n }\n if (value.kind === 'lower-bound') {\n if (value.usd !== null) {\n throw new RunRecordValidationError(\n 'lower-bound costProvenance.usd must be null; the floor is knownLowerBoundUsd',\n 'costProvenance.usd',\n )\n }\n if (costUsd !== null) {\n throw new RunRecordValidationError(\n 'lower-bound cost requires costUsd to be null; a floor is not a total',\n 'costUsd',\n )\n }\n expectFiniteNumber(value.knownLowerBoundUsd, 'costProvenance.knownLowerBoundUsd')\n if ((value.knownLowerBoundUsd as number) <= 0) {\n throw new RunRecordValidationError(\n \"a lower bound must be positive; write a $0 floor as { kind: 'uncaptured', usd: null }\",\n 'costProvenance.knownLowerBoundUsd',\n )\n }\n return\n }\n // A record must never read as a total it cannot support, so an uncaptured\n // cost carries no number at all. A matrix `CellResult` keeps its known\n // subtotal instead, because a cost ceiling must charge the part it can see;\n // converting one to the other drops that subtotal.\n if (value.kind === 'uncaptured') {\n if (value.usd !== null) {\n throw new RunRecordValidationError(\n 'uncaptured costProvenance.usd must be null',\n 'costProvenance.usd',\n )\n }\n if (costUsd !== null) {\n throw new RunRecordValidationError('uncaptured cost requires costUsd to be null', 'costUsd')\n }\n return\n }\n expectNonNegativeNumber(costUsd, 'costUsd')\n expectNonNegativeNumber(value.usd, 'costProvenance.usd')\n if (value.usd !== costUsd) {\n throw new RunRecordValidationError(\n 'costProvenance.usd must equal costUsd',\n 'costProvenance.usd',\n )\n }\n}\n\nfunction validateSearchCoordinates(value: unknown, runId: string): void {\n if (value === null || typeof value !== 'object') {\n throw new RunRecordValidationError('search must be an object', 'search')\n }\n const search = value as Record<string, unknown>\n expectString(search.searchId, 'search.searchId')\n expectString(search.nodeId, 'search.nodeId')\n expectString(search.cellId, 'search.cellId')\n if (!Number.isSafeInteger(search.attempt) || (search.attempt as number) < 1) {\n throw new RunRecordValidationError('expected an integer from 1', 'search.attempt')\n }\n const expected = searchCellRunId(search as unknown as RunSearchCoordinates)\n if (runId !== expected) {\n throw new RunRecordValidationError(\n `runId \"${runId}\" must be \"${expected}\", the search cell and attempt it settled`,\n 'runId',\n )\n }\n}\n\nfunction validateTraceRef(value: unknown): void {\n if (value === null || typeof value !== 'object') {\n throw new RunRecordValidationError('traceRef must be an object', 'traceRef')\n }\n const ref = value as Record<string, unknown>\n expectString(ref.traceId, 'traceRef.traceId')\n if (ref.execRunId !== undefined) expectString(ref.execRunId, 'traceRef.execRunId')\n}\n\n/** Boolean validator — convenience for filtering arrays. */\nexport function isRunRecord(input: unknown): input is RunRecord {\n try {\n validateRunRecord(input)\n return true\n } catch {\n return false\n }\n}\n\n/** Non-throwing validator — returns a discriminated union. */\nexport function parseRunRecordSafe(\n input: unknown,\n): { ok: true; value: RunRecord } | { ok: false; error: RunRecordValidationError } {\n try {\n return { ok: true, value: validateRunRecord(input) }\n } catch (e) {\n if (e instanceof RunRecordValidationError) return { ok: false, error: e }\n throw e\n }\n}\n\n// ── Internals ────────────────────────────────────────────────────────\n\nfunction expectString(value: unknown, path: string): void {\n if (typeof value !== 'string' || value.length === 0) {\n throw new RunRecordValidationError(`expected non-empty string`, path)\n }\n}\n\nfunction expectFiniteNumber(value: unknown, path: string): void {\n if (typeof value !== 'number' || !Number.isFinite(value)) {\n throw new RunRecordValidationError(`expected finite number`, path)\n }\n}\n\nfunction expectNonNegativeNumber(value: unknown, path: string): void {\n expectFiniteNumber(value, path)\n if ((value as number) < 0) {\n throw new RunRecordValidationError('expected non-negative number', path)\n }\n}\n\nfunction validateJudgeScores(value: unknown, path: string): void {\n if (value === null || typeof value !== 'object') {\n throw new RunRecordValidationError('judgeScores must be an object', path)\n }\n const rec = value as Record<string, unknown>\n\n const perJudge = rec.perJudge\n if (perJudge === null || typeof perJudge !== 'object') {\n throw new RunRecordValidationError('perJudge must be an object', `${path}.perJudge`)\n }\n for (const [judgeId, dims] of Object.entries(perJudge as Record<string, unknown>)) {\n if (dims === null || typeof dims !== 'object') {\n throw new RunRecordValidationError(\n 'per-judge entry must be an object of dimension scores',\n `${path}.perJudge.${judgeId}`,\n )\n }\n for (const [dim, score] of Object.entries(dims as Record<string, unknown>)) {\n expectFiniteNumber(score, `${path}.perJudge.${judgeId}.${dim}`)\n }\n }\n\n const perDimMean = rec.perDimMean\n if (perDimMean === null || typeof perDimMean !== 'object') {\n throw new RunRecordValidationError('perDimMean must be an object', `${path}.perDimMean`)\n }\n for (const [dim, mean] of Object.entries(perDimMean as Record<string, unknown>)) {\n expectFiniteNumber(mean, `${path}.perDimMean.${dim}`)\n }\n\n expectFiniteNumber(rec.composite, `${path}.composite`)\n\n if (rec.failedJudges !== undefined) {\n if (!Array.isArray(rec.failedJudges)) {\n throw new RunRecordValidationError(\n 'failedJudges must be an array of strings',\n `${path}.failedJudges`,\n )\n }\n for (let i = 0; i < rec.failedJudges.length; i++) {\n const id = rec.failedJudges[i]\n if (typeof id !== 'string' || id.length === 0) {\n throw new RunRecordValidationError(\n 'failedJudges entry must be a non-empty string',\n `${path}.failedJudges[${i}]`,\n )\n }\n }\n }\n\n if (rec.notes !== undefined && typeof rec.notes !== 'string') {\n throw new RunRecordValidationError('notes must be a string', `${path}.notes`)\n }\n}\n\n/**\n * Snapshot check for provider model identifiers. Accepts ISO and compact\n * dates, Router's `-MMDD` snapshots, one opaque `@token`, and Vertex-style\n * `:date-token` suffixes. Routing selectors such as `@preset/name` are not\n * immutable model identities.\n */\nexport function modelHasSnapshot(model: string): boolean {\n if (model.length === 0 || model.trim() !== model) return false\n\n const opaqueAt = model.lastIndexOf('@')\n if (opaqueAt > 0) {\n const base = model.slice(0, opaqueAt)\n const token = model.slice(opaqueAt + 1)\n if (!base.includes('@') && /^[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/u.test(token)) {\n return true\n }\n }\n\n const isoDate = model.match(/-(\\d{4})-(\\d{2})-(\\d{2})$/u)\n if (isoDate && validSnapshotDate(isoDate[1]!, isoDate[2]!, isoDate[3]!)) return true\n\n const compactDate = model.match(/-(\\d{4})(\\d{2})(\\d{2})$/u)\n if (compactDate && validSnapshotDate(compactDate[1]!, compactDate[2]!, compactDate[3]!)) {\n return true\n }\n\n const routerDate = model.match(/-(\\d{2})(\\d{2})$/u)\n if (routerDate && validSnapshotDate(undefined, routerDate[1]!, routerDate[2]!)) return true\n\n return /:date-[A-Za-z0-9](?:[A-Za-z0-9._-]*[A-Za-z0-9])?$/u.test(model)\n}\n\nfunction validSnapshotDate(year: string | undefined, month: string, day: string): boolean {\n const monthNumber = Number(month)\n const dayNumber = Number(day)\n if (!Number.isInteger(monthNumber) || monthNumber < 1 || monthNumber > 12) return false\n\n const yearNumber = year === undefined ? undefined : Number(year)\n const leapYear =\n yearNumber === undefined ||\n (yearNumber % 4 === 0 && (yearNumber % 100 !== 0 || yearNumber % 400 === 0))\n const daysInMonth = [31, leapYear ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]\n return Number.isInteger(dayNumber) && dayNumber >= 1 && dayNumber <= daysInMonth[monthNumber - 1]!\n}\n"],"mappings":";;;;;;AAiDA,MAAa,gB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KAAK,KAAK;AACxE;AAEA,SAAS,kBAAkB,MAA0B,OAAe,KAAsB;CACxF,MAAM,cAAc,OAAO,KAAK;CAChC,MAAM,YAAY,OAAO,GAAG;CAC5B,IAAI,CAAC,OAAO,UAAU,WAAW,KAAK,cAAc,KAAK,cAAc,IAAI,OAAO;CAElF,MAAM,aAAa,SAAS,KAAA,IAAY,KAAA,IAAY,OAAO,IAAI;CAI/D,MAAM,cAAc;EAAC;EAFnB,eAAe,KAAA,KACd,aAAa,MAAM,MAAM,aAAa,QAAQ,KAAK,aAAa,QAAQ,KACvC,KAAK;EAAI;EAAI;EAAI;EAAI;EAAI;EAAI;EAAI;EAAI;EAAI;EAAI;CAAE;CACnF,OAAO,OAAO,UAAU,SAAS,KAAK,aAAa,KAAK,aAAa,YAAY,cAAc;AACjG"}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Always-valid sequential evaluation.
|
|
3
|
-
*
|
|
4
|
-
* `researchReport` assumes a single pre-specified analysis. Real
|
|
5
|
-
* consumers run campaigns weekly / nightly / per-PR; each new run silently
|
|
6
|
-
* inflates the false-discovery rate, because the BH-FDR guarantee is for
|
|
7
|
-
* the *first* look, not the 47th. Without time-uniform inference,
|
|
8
|
-
* launch-decision teams either (a) don't peek, which forfeits the cost
|
|
9
|
-
* advantage of stop-when-decisive, or (b) peek and pretend they didn't,
|
|
10
|
-
* which forfeits scientific validity.
|
|
11
|
-
*
|
|
12
|
-
* This module ships **e-value-based confidence sequences** for paired
|
|
13
|
-
* bounded outcomes. The methodology is the predictable plug-in betting
|
|
14
|
-
* martingale of Waudby-Smith & Ramdas (2024) — provably valid at *any*
|
|
15
|
-
* stopping time. Concretely:
|
|
16
|
-
*
|
|
17
|
-
* For paired deltas D_1, D_2, … ∈ [-c, c] with the null H_0: E[D] ≤ 0,
|
|
18
|
-
* a betting fraction λ_i is chosen using only D_{1..i-1} (predictable
|
|
19
|
-
* plug-in), and the running e-value is
|
|
20
|
-
*
|
|
21
|
-
* E_t = ∏_{i=1}^{t} (1 + λ_i · D_i)
|
|
22
|
-
*
|
|
23
|
-
* E_t is a non-negative martingale under H_0 with E[E_t] ≤ 1, so by
|
|
24
|
-
* Ville's inequality, P(∃ t : E_t ≥ 1/α) ≤ α — we can reject the null
|
|
25
|
-
* at any time without inflating the type-I error.
|
|
26
|
-
*
|
|
27
|
-
* Combined with `runEvalCampaign`, every consumer running rolling
|
|
28
|
-
* campaigns gains the ability to ship the moment evidence is decisive,
|
|
29
|
-
* stop-early on dead-on-arrival variants, and accumulate evidence across
|
|
30
|
-
* partial runs without spending the FDR budget. No new sweep is wasted.
|
|
31
|
-
*
|
|
32
|
-
* References:
|
|
33
|
-
* - Howard, S. R., Ramdas, A., McAuliffe, J., Sekhon, J. (2021).
|
|
34
|
-
* Time-uniform, nonparametric, nonasymptotic confidence sequences.
|
|
35
|
-
* Annals of Statistics, 49(2), 1055–1080.
|
|
36
|
-
* - Waudby-Smith, I., Ramdas, A. (2024). Estimating means of bounded
|
|
37
|
-
* random variables by betting. JRSS B, 86(1), 1–27.
|
|
38
|
-
*/
|
|
39
|
-
type SequentialDecision = 'promote_now' | 'continue' | 'reject_now' | 'equivalent';
|
|
40
|
-
interface PairedEvalueOptions {
|
|
41
|
-
/**
|
|
42
|
-
* Bound on |delta|. Default 1 (matching most score scales). Must satisfy
|
|
43
|
-
* c > 0; deltas outside [-c, c] are clipped with a warning attached to
|
|
44
|
-
* the return value.
|
|
45
|
-
*/
|
|
46
|
-
bound?: number;
|
|
47
|
-
/** Target Type-I error. Default 0.05. */
|
|
48
|
-
alpha?: number;
|
|
49
|
-
/**
|
|
50
|
-
* Region of Practical Equivalence on the *mean* paired delta. When
|
|
51
|
-
* supplied, the verdict can return `'equivalent'` once the running
|
|
52
|
-
* confidence sequence on the mean is fully contained in [low, high].
|
|
53
|
-
*/
|
|
54
|
-
rope?: {
|
|
55
|
-
low: number;
|
|
56
|
-
high: number;
|
|
57
|
-
};
|
|
58
|
-
/** Initial bet shrinkage (0 < scale ≤ 1). Default 0.5 — empirically robust. */
|
|
59
|
-
initialBetShrinkage?: number;
|
|
60
|
-
}
|
|
61
|
-
interface PairedEvalueStep {
|
|
62
|
-
/** 1-indexed observation count. */
|
|
63
|
-
t: number;
|
|
64
|
-
delta: number;
|
|
65
|
-
/** Running e-value E_t = ∏ (1 + λ_i · D_i). */
|
|
66
|
-
evalue: number;
|
|
67
|
-
/** Time-uniform p-value at stopping time t. */
|
|
68
|
-
pValue: number;
|
|
69
|
-
/** Lower bound of the empirical Bernstein confidence sequence at level 1-α. */
|
|
70
|
-
csLow: number;
|
|
71
|
-
csHigh: number;
|
|
72
|
-
/** Verdict at this stopping time. */
|
|
73
|
-
decision: SequentialDecision;
|
|
74
|
-
}
|
|
75
|
-
interface PairedEvalueSequence {
|
|
76
|
-
steps: PairedEvalueStep[];
|
|
77
|
-
/** The decision at the final step. */
|
|
78
|
-
finalDecision: SequentialDecision;
|
|
79
|
-
/** Index (1-based) at which a non-`continue` decision first fired, or null. */
|
|
80
|
-
decisionFiredAt: number | null;
|
|
81
|
-
/** True if any deltas were clipped to [-bound, bound]. */
|
|
82
|
-
clipped: boolean;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Run the paired e-value sequence over an in-order delta stream.
|
|
86
|
-
*
|
|
87
|
-
* Use for *streaming* / interim analyses: pass the deltas you have so
|
|
88
|
-
* far, get the verdict at every prefix length. The decision is
|
|
89
|
-
* monotone-stable in the sense that once `'reject_now'` or `'promote_now'`
|
|
90
|
-
* fires, the verdict at later steps remains decisive (the e-value is a
|
|
91
|
-
* non-negative martingale; once it crosses the threshold, it's crossed).
|
|
92
|
-
*/
|
|
93
|
-
declare function pairedEvalueSequence(deltas: number[], opts?: PairedEvalueOptions): PairedEvalueSequence;
|
|
94
|
-
/** Configuration for the best-case reachability preflight. */
|
|
95
|
-
interface SequentialCrossingHorizonOptions extends Pick<PairedEvalueOptions, 'alpha' | 'bound' | 'initialBetShrinkage'> {
|
|
96
|
-
/** Maximum pairs to simulate before returning `null`. Default 10,000. */
|
|
97
|
-
maxPairs?: number;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Best-case horizons under the exact betting policy used by
|
|
101
|
-
* {@link pairedEvalueSequence}.
|
|
102
|
-
*
|
|
103
|
-
* `evidencePairs` is the first all-at-bound pair count whose e-value reaches
|
|
104
|
-
* `1/alpha`. `decisionPairs` is the first count whose actual two-sided
|
|
105
|
-
* sequence verdict fires (`2/alpha` in the current policy). A design whose
|
|
106
|
-
* pair cap is below either relevant horizon is undecidable by construction and
|
|
107
|
-
* should be refused before model spend.
|
|
108
|
-
*/
|
|
109
|
-
interface SequentialCrossingHorizon {
|
|
110
|
-
readonly evidencePairs: number | null;
|
|
111
|
-
readonly decisionPairs: number | null;
|
|
112
|
-
readonly evidenceThreshold: number;
|
|
113
|
-
readonly decisionThreshold: number;
|
|
114
|
-
readonly maxPairs: number;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Compute the minimum pair count at which even perfect, all-at-bound data can
|
|
118
|
-
* reach the evidence and decision thresholds. The calculation intentionally
|
|
119
|
-
* calls the canonical sequence implementation rather than maintaining a
|
|
120
|
-
* second approximation that can drift from its bet schedule.
|
|
121
|
-
*/
|
|
122
|
-
declare function sequentialCrossingHorizon(opts?: SequentialCrossingHorizonOptions): SequentialCrossingHorizon;
|
|
123
|
-
interface InterimReleaseConfidenceInput {
|
|
124
|
-
/**
|
|
125
|
-
* One delta series per candidate (paired deltas vs comparator). Order
|
|
126
|
-
* within a series is the order the campaigns were run.
|
|
127
|
-
*/
|
|
128
|
-
deltaSeries: Array<{
|
|
129
|
-
candidateId: string;
|
|
130
|
-
deltas: number[];
|
|
131
|
-
}>;
|
|
132
|
-
alpha?: number;
|
|
133
|
-
bound?: number;
|
|
134
|
-
rope?: {
|
|
135
|
-
low: number;
|
|
136
|
-
high: number;
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
interface InterimReleaseConfidence {
|
|
140
|
-
candidates: Array<{
|
|
141
|
-
candidateId: string;
|
|
142
|
-
decision: SequentialDecision;
|
|
143
|
-
decisionFiredAt: number | null;
|
|
144
|
-
finalEvalue: number;
|
|
145
|
-
finalPValue: number;
|
|
146
|
-
pairs: number;
|
|
147
|
-
csLow: number;
|
|
148
|
-
csHigh: number;
|
|
149
|
-
}>;
|
|
150
|
-
/**
|
|
151
|
-
* Campaign-level recommendation: pick the strongest 'promote_now', else
|
|
152
|
-
* 'continue' if any candidate is still live, else 'reject_now' if every
|
|
153
|
-
* candidate is dead, else 'equivalent'.
|
|
154
|
-
*/
|
|
155
|
-
recommendation: {
|
|
156
|
-
decision: SequentialDecision;
|
|
157
|
-
candidateId: string | null;
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Run interim sequential analyses across many candidates at once,
|
|
162
|
-
* preserving the time-uniform α guarantee for each candidate's series and
|
|
163
|
-
* synthesising a campaign-level recommendation. Designed to be called on
|
|
164
|
-
* every campaign tick — the recommendation is anytime-valid.
|
|
165
|
-
*/
|
|
166
|
-
declare function evaluateInterimReleaseConfidence(input: InterimReleaseConfidenceInput): InterimReleaseConfidence;
|
|
167
|
-
export { PairedEvalueStep as a, SequentialDecision as c, sequentialCrossingHorizon as d, PairedEvalueSequence as i, evaluateInterimReleaseConfidence as l, InterimReleaseConfidenceInput as n, SequentialCrossingHorizon as o, PairedEvalueOptions as r, SequentialCrossingHorizonOptions as s, InterimReleaseConfidence as t, pairedEvalueSequence as u };
|
|
168
|
-
//# sourceMappingURL=sequential-B9p6uoV8.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sequential-B9p6uoV8.d.ts","names":[],"sources":["../src/sequential.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCY;UAEK;;;;;;EAMf;;EAEA;;;;;;EAMA;IAAS;IAAa;;;EAEtB;;UAGe;;EAEf;EACA;;EAEA;;EAEA;;EAEA;EACA;;EAEA,UAAU;;UAGK;EACf,OAAO;;EAEP,eAAe;;EAEf;;EAEA;;;;;;;;;;;iBAYc,qBACd,kBACA,OAAM,sBACL;;UA0Ec,yCACP,KAAK;;EAEb;;;;;;;;;;;;UAae;WACN;WACA;WACA;WACA;WACA;;;;;;;;iBAWK,0BACd,OAAM,mCACL;UAmCc;;;;;EAKf,aAAa;IAAQ;IAAqB;;EAC1C;EACA;EACA;IAAS;IAAa;;;UAGP;EACf,YAAY;IACV;IACA,UAAU;IACV;IACA;IACA;IACA;IACA;IACA;;;;;;;EAOF;IAAkB,UAAU;IAAoB;;;;;;;;;iBASlC,iCACd,OAAO,gCACN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sequential-CAksw6EU.js","names":[],"sources":["../src/sequential.ts"],"sourcesContent":["/**\n * Always-valid sequential evaluation.\n *\n * `researchReport` assumes a single pre-specified analysis. Real\n * consumers run campaigns weekly / nightly / per-PR; each new run silently\n * inflates the false-discovery rate, because the BH-FDR guarantee is for\n * the *first* look, not the 47th. Without time-uniform inference,\n * launch-decision teams either (a) don't peek, which forfeits the cost\n * advantage of stop-when-decisive, or (b) peek and pretend they didn't,\n * which forfeits scientific validity.\n *\n * This module ships **e-value-based confidence sequences** for paired\n * bounded outcomes. The methodology is the predictable plug-in betting\n * martingale of Waudby-Smith & Ramdas (2024) — provably valid at *any*\n * stopping time. Concretely:\n *\n * For paired deltas D_1, D_2, … ∈ [-c, c] with the null H_0: E[D] ≤ 0,\n * a betting fraction λ_i is chosen using only D_{1..i-1} (predictable\n * plug-in), and the running e-value is\n *\n * E_t = ∏_{i=1}^{t} (1 + λ_i · D_i)\n *\n * E_t is a non-negative martingale under H_0 with E[E_t] ≤ 1, so by\n * Ville's inequality, P(∃ t : E_t ≥ 1/α) ≤ α — we can reject the null\n * at any time without inflating the type-I error.\n *\n * Combined with `runEvalCampaign`, every consumer running rolling\n * campaigns gains the ability to ship the moment evidence is decisive,\n * stop-early on dead-on-arrival variants, and accumulate evidence across\n * partial runs without spending the FDR budget. No new sweep is wasted.\n *\n * References:\n * - Howard, S. R., Ramdas, A., McAuliffe, J., Sekhon, J. (2021).\n * Time-uniform, nonparametric, nonasymptotic confidence sequences.\n * Annals of Statistics, 49(2), 1055–1080.\n * - Waudby-Smith, I., Ramdas, A. (2024). Estimating means of bounded\n * random variables by betting. JRSS B, 86(1), 1–27.\n */\n\nexport type SequentialDecision = 'promote_now' | 'continue' | 'reject_now' | 'equivalent'\n\nexport interface PairedEvalueOptions {\n /**\n * Bound on |delta|. Default 1 (matching most score scales). Must satisfy\n * c > 0; deltas outside [-c, c] are clipped with a warning attached to\n * the return value.\n */\n bound?: number\n /** Target Type-I error. Default 0.05. */\n alpha?: number\n /**\n * Region of Practical Equivalence on the *mean* paired delta. When\n * supplied, the verdict can return `'equivalent'` once the running\n * confidence sequence on the mean is fully contained in [low, high].\n */\n rope?: { low: number; high: number }\n /** Initial bet shrinkage (0 < scale ≤ 1). Default 0.5 — empirically robust. */\n initialBetShrinkage?: number\n}\n\nexport interface PairedEvalueStep {\n /** 1-indexed observation count. */\n t: number\n delta: number\n /** Running e-value E_t = ∏ (1 + λ_i · D_i). */\n evalue: number\n /** Time-uniform p-value at stopping time t. */\n pValue: number\n /** Lower bound of the empirical Bernstein confidence sequence at level 1-α. */\n csLow: number\n csHigh: number\n /** Verdict at this stopping time. */\n decision: SequentialDecision\n}\n\nexport interface PairedEvalueSequence {\n steps: PairedEvalueStep[]\n /** The decision at the final step. */\n finalDecision: SequentialDecision\n /** Index (1-based) at which a non-`continue` decision first fired, or null. */\n decisionFiredAt: number | null\n /** True if any deltas were clipped to [-bound, bound]. */\n clipped: boolean\n}\n\n/**\n * Run the paired e-value sequence over an in-order delta stream.\n *\n * Use for *streaming* / interim analyses: pass the deltas you have so\n * far, get the verdict at every prefix length. The decision is\n * monotone-stable in the sense that once `'reject_now'` or `'promote_now'`\n * fires, the verdict at later steps remains decisive (the e-value is a\n * non-negative martingale; once it crosses the threshold, it's crossed).\n */\nexport function pairedEvalueSequence(\n deltas: number[],\n opts: PairedEvalueOptions = {},\n): PairedEvalueSequence {\n const c = opts.bound ?? 1\n const alpha = opts.alpha ?? 0.05\n const initialShrink = opts.initialBetShrinkage ?? 0.5\n const rope = opts.rope ?? null\n assertSequentialScalarConfiguration(c, alpha, initialShrink, 'pairedEvalueSequence')\n if (rope && !(Number.isFinite(rope.low) && Number.isFinite(rope.high) && rope.low <= rope.high)) {\n throw new Error('pairedEvalueSequence: rope must satisfy low ≤ high')\n }\n const { decisionThreshold } = sequentialThresholds(alpha)\n\n const steps: PairedEvalueStep[] = []\n let clipped = false\n let evalue = 1\n let decisionFiredAt: number | null = null\n\n // Running statistics (using only D_{1..i-1} for the bet → predictable plug-in).\n let sum = 0\n let sumSq = 0\n let count = 0\n\n for (let i = 0; i < deltas.length; i++) {\n let d = deltas[i]!\n if (!Number.isFinite(d)) {\n throw new Error(`pairedEvalueSequence: delta[${i}] must be finite`)\n }\n if (d < -c || d > c) {\n d = Math.max(-c, Math.min(c, d))\n clipped = true\n }\n\n // Predictable plug-in bet (positive λ tests for E[D] > 0; we run a two-sided\n // test by tracking the symmetric e-value via |bet|).\n // λ_i ∝ mean / (variance + bound^2). Shrink early to avoid overbetting.\n const muHat = count === 0 ? 0 : sum / count\n const varHat = count === 0 ? c * c : Math.max(1e-12, sumSq / count - muHat * muHat)\n const t = i + 1\n const shrink = initialShrink * Math.min(1, count / 32) // anneal toward 1\n let lambda = (muHat / (varHat + c * c)) * shrink\n // Clip to ensure 1 + λ·D > 0 for all |D| ≤ c (so the e-value stays non-negative).\n const lambdaMax = 0.99 / c\n if (lambda > lambdaMax) lambda = lambdaMax\n if (lambda < -lambdaMax) lambda = -lambdaMax\n\n evalue = evalue * (1 + lambda * d)\n if (!Number.isFinite(evalue) || evalue < 0) evalue = 0\n\n sum += d\n sumSq += d * d\n count += 1\n\n const pValue = Math.min(1, 1 / Math.max(evalue, 1e-300))\n\n // Empirical Bernstein confidence sequence on the mean. Howard et al.\n // (2021), Theorem 4.4 with σ̂² the running sample variance and a\n // calibration constant tuned for two-sided coverage at level 1 - α.\n const cs = empiricalBernsteinCs(sum, sumSq, count, c, alpha)\n\n let decision: SequentialDecision = 'continue'\n if (rope && cs.low >= rope.low && cs.high <= rope.high) decision = 'equivalent'\n else if (evalue >= decisionThreshold && muHat > 0) decision = 'promote_now'\n else if (evalue >= decisionThreshold && muHat < 0) decision = 'reject_now'\n else if (rope && cs.high < rope.low) decision = 'reject_now'\n\n if (decision !== 'continue' && decisionFiredAt === null) decisionFiredAt = t\n\n steps.push({ t, delta: d, evalue, pValue, csLow: cs.low, csHigh: cs.high, decision })\n }\n\n const finalDecision = steps.length === 0 ? 'continue' : steps[steps.length - 1]!.decision\n return { steps, finalDecision, decisionFiredAt, clipped }\n}\n\n/** Configuration for the best-case reachability preflight. */\nexport interface SequentialCrossingHorizonOptions\n extends Pick<PairedEvalueOptions, 'alpha' | 'bound' | 'initialBetShrinkage'> {\n /** Maximum pairs to simulate before returning `null`. Default 10,000. */\n maxPairs?: number\n}\n\n/**\n * Best-case horizons under the exact betting policy used by\n * {@link pairedEvalueSequence}.\n *\n * `evidencePairs` is the first all-at-bound pair count whose e-value reaches\n * `1/alpha`. `decisionPairs` is the first count whose actual two-sided\n * sequence verdict fires (`2/alpha` in the current policy). A design whose\n * pair cap is below either relevant horizon is undecidable by construction and\n * should be refused before model spend.\n */\nexport interface SequentialCrossingHorizon {\n readonly evidencePairs: number | null\n readonly decisionPairs: number | null\n readonly evidenceThreshold: number\n readonly decisionThreshold: number\n readonly maxPairs: number\n}\n\nconst MAX_SEQUENTIAL_CROSSING_PAIRS = 1_000_000\n\n/**\n * Compute the minimum pair count at which even perfect, all-at-bound data can\n * reach the evidence and decision thresholds. The calculation intentionally\n * calls the canonical sequence implementation rather than maintaining a\n * second approximation that can drift from its bet schedule.\n */\nexport function sequentialCrossingHorizon(\n opts: SequentialCrossingHorizonOptions = {},\n): SequentialCrossingHorizon {\n const bound = opts.bound ?? 1\n const alpha = opts.alpha ?? 0.05\n const initialBetShrinkage = opts.initialBetShrinkage ?? 0.5\n const maxPairs = opts.maxPairs ?? 10_000\n assertSequentialScalarConfiguration(\n bound,\n alpha,\n initialBetShrinkage,\n 'sequentialCrossingHorizon',\n )\n if (!Number.isSafeInteger(maxPairs) || maxPairs < 1) {\n throw new Error('sequentialCrossingHorizon: maxPairs must be a positive safe integer')\n }\n if (maxPairs > MAX_SEQUENTIAL_CROSSING_PAIRS) {\n throw new Error(\n `sequentialCrossingHorizon: maxPairs must be <= ${MAX_SEQUENTIAL_CROSSING_PAIRS}`,\n )\n }\n const sequence = pairedEvalueSequence(Array<number>(maxPairs).fill(bound), {\n bound,\n alpha,\n initialBetShrinkage,\n })\n const { evidenceThreshold, decisionThreshold } = sequentialThresholds(alpha)\n const evidencePairs = sequence.steps.find((step) => step.evalue >= evidenceThreshold)?.t ?? null\n return Object.freeze({\n evidencePairs,\n decisionPairs: sequence.decisionFiredAt,\n evidenceThreshold,\n decisionThreshold,\n maxPairs,\n })\n}\n\nexport interface InterimReleaseConfidenceInput {\n /**\n * One delta series per candidate (paired deltas vs comparator). Order\n * within a series is the order the campaigns were run.\n */\n deltaSeries: Array<{ candidateId: string; deltas: number[] }>\n alpha?: number\n bound?: number\n rope?: { low: number; high: number }\n}\n\nexport interface InterimReleaseConfidence {\n candidates: Array<{\n candidateId: string\n decision: SequentialDecision\n decisionFiredAt: number | null\n finalEvalue: number\n finalPValue: number\n pairs: number\n csLow: number\n csHigh: number\n }>\n /**\n * Campaign-level recommendation: pick the strongest 'promote_now', else\n * 'continue' if any candidate is still live, else 'reject_now' if every\n * candidate is dead, else 'equivalent'.\n */\n recommendation: { decision: SequentialDecision; candidateId: string | null }\n}\n\n/**\n * Run interim sequential analyses across many candidates at once,\n * preserving the time-uniform α guarantee for each candidate's series and\n * synthesising a campaign-level recommendation. Designed to be called on\n * every campaign tick — the recommendation is anytime-valid.\n */\nexport function evaluateInterimReleaseConfidence(\n input: InterimReleaseConfidenceInput,\n): InterimReleaseConfidence {\n const candidates = input.deltaSeries.map((s) => {\n const seq = pairedEvalueSequence(s.deltas, {\n alpha: input.alpha,\n bound: input.bound,\n rope: input.rope,\n })\n const last = seq.steps[seq.steps.length - 1]\n return {\n candidateId: s.candidateId,\n decision: seq.finalDecision,\n decisionFiredAt: seq.decisionFiredAt,\n finalEvalue: last?.evalue ?? 1,\n finalPValue: last?.pValue ?? 1,\n pairs: seq.steps.length,\n csLow: last?.csLow ?? Number.NEGATIVE_INFINITY,\n csHigh: last?.csHigh ?? Number.POSITIVE_INFINITY,\n }\n })\n\n const promote = candidates.find((c) => c.decision === 'promote_now')\n if (promote)\n return {\n candidates,\n recommendation: { decision: 'promote_now', candidateId: promote.candidateId },\n }\n const live = candidates.find((c) => c.decision === 'continue')\n if (live) return { candidates, recommendation: { decision: 'continue', candidateId: null } }\n const equiv = candidates.find((c) => c.decision === 'equivalent')\n if (equiv)\n return {\n candidates,\n recommendation: { decision: 'equivalent', candidateId: equiv.candidateId },\n }\n return { candidates, recommendation: { decision: 'reject_now', candidateId: null } }\n}\n\n// ── Internals ────────────────────────────────────────────────────────────\n\nfunction assertSequentialScalarConfiguration(\n bound: number,\n alpha: number,\n initialBetShrinkage: number,\n context: string,\n): void {\n if (!Number.isFinite(bound) || bound <= 0) {\n throw new Error(`${context}: bound must be a finite number > 0`)\n }\n if (!Number.isFinite(alpha) || alpha <= 0 || alpha >= 1) {\n throw new Error(`${context}: alpha must be a finite number in (0,1)`)\n }\n if (\n !Number.isFinite(initialBetShrinkage) ||\n initialBetShrinkage <= 0 ||\n initialBetShrinkage > 1\n ) {\n throw new Error(`${context}: initialBetShrinkage must be a finite number in (0,1]`)\n }\n}\n\nfunction sequentialThresholds(alpha: number): {\n evidenceThreshold: number\n decisionThreshold: number\n} {\n return { evidenceThreshold: 1 / alpha, decisionThreshold: 2 / alpha }\n}\n\n/**\n * Empirical Bernstein confidence sequence on the mean of bounded variables.\n * Adapted from Howard et al. (2021) §4.4. Provides a time-uniform CI on\n * the running mean; valid at every stopping time.\n */\nfunction empiricalBernsteinCs(\n sum: number,\n sumSq: number,\n n: number,\n bound: number,\n alpha: number,\n): { low: number; high: number } {\n if (n === 0) return { low: -bound, high: bound }\n const mean = sum / n\n const variance = Math.max(0, sumSq / n - mean * mean)\n // Iterated-log calibration constant. The 1.7 exponent matches the\n // recommended choice in Howard et al. for two-sided coverage at level\n // 1 - α with mild log-corrections; tightening further requires a\n // tuned mixture and is out of scope.\n const psi = Math.log(2 / alpha) + 1.7 * Math.log(Math.log(Math.max(Math.E, n)) + 1)\n const radius = Math.sqrt((2 * variance * psi) / n) + (3 * bound * psi) / n\n return { low: mean - radius, high: mean + radius }\n}\n"],"mappings":";;;;;;;;;;AA8FA,SAAgB,qBACd,QACA,OAA4B,CAAC,GACP;CACtB,MAAM,IAAI,KAAK,SAAS;CACxB,MAAM,QAAQ,KAAK,SAAS;CAC5B,MAAM,gBAAgB,KAAK,uBAAuB;CAClD,MAAM,OAAO,KAAK,QAAQ;CAC1B,oCAAoC,GAAG,OAAO,eAAe,sBAAsB;CACnF,IAAI,QAAQ,EAAE,OAAO,SAAS,KAAK,GAAG,KAAK,OAAO,SAAS,KAAK,IAAI,KAAK,KAAK,OAAO,KAAK,OACxF,MAAM,IAAI,MAAM,oDAAoD;CAEtE,MAAM,EAAE,sBAAsB,qBAAqB,KAAK;CAExD,MAAM,QAA4B,CAAC;CACnC,IAAI,UAAU;CACd,IAAI,SAAS;CACb,IAAI,kBAAiC;CAGrC,IAAI,MAAM;CACV,IAAI,QAAQ;CACZ,IAAI,QAAQ;CAEZ,KAAK,IAAI,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;EACtC,IAAI,IAAI,OAAO;EACf,IAAI,CAAC,OAAO,SAAS,CAAC,GACpB,MAAM,IAAI,MAAM,+BAA+B,EAAE,iBAAiB;EAEpE,IAAI,IAAI,CAAC,KAAK,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