@tangle-network/agent-eval 0.197.0 → 0.198.1

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.
Files changed (150) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +3 -1
  3. package/dist/active-curriculum-B_Lc9kfO.js +61 -0
  4. package/dist/active-curriculum-B_Lc9kfO.js.map +1 -0
  5. package/dist/adapters/http.d.ts +2 -2
  6. package/dist/analyst/index.d.ts +5 -5
  7. package/dist/analyst/index.js +3 -3
  8. package/dist/{analyze-runs-B6gv7vAT.js → analyze-runs-DFbp2gB8.js} +5 -5
  9. package/dist/{analyze-runs-B6gv7vAT.js.map → analyze-runs-DFbp2gB8.js.map} +1 -1
  10. package/dist/{benchmark-command-DB7pxlks.js → benchmark-command-DKQuLrrD.js} +6 -5
  11. package/dist/{benchmark-command-DB7pxlks.js.map → benchmark-command-DKQuLrrD.js.map} +1 -1
  12. package/dist/benchmarks/index.d.ts +4 -3
  13. package/dist/benchmarks/index.d.ts.map +1 -1
  14. package/dist/benchmarks/index.js +3 -3
  15. package/dist/campaign/index.d.ts +5 -4
  16. package/dist/campaign/index.js +13 -11
  17. package/dist/{campaign-BUFSOI36.js → campaign-DRdKwxm-.js} +13 -12
  18. package/dist/{campaign-BUFSOI36.js.map → campaign-DRdKwxm-.js.map} +1 -1
  19. package/dist/{campaign-evidence-DJc60F9C.js → campaign-evidence-jL_U7Ikv.js} +2 -2
  20. package/dist/{campaign-evidence-DJc60F9C.js.map → campaign-evidence-jL_U7Ikv.js.map} +1 -1
  21. package/dist/cli.js +247 -13
  22. package/dist/cli.js.map +1 -1
  23. package/dist/contract/index.d.ts +7 -6
  24. package/dist/contract/index.js +9 -9
  25. package/dist/{default-registry-D2csUBBQ.d.ts → default-registry-oK9hHfX_.d.ts} +3 -3
  26. package/dist/{default-registry-D2csUBBQ.d.ts.map → default-registry-oK9hHfX_.d.ts.map} +1 -1
  27. package/dist/{define-agent-eval-ulRlLvse.d.ts → define-agent-eval-9JYoCkDI.d.ts} +5 -4
  28. package/dist/define-agent-eval-9JYoCkDI.d.ts.map +1 -0
  29. package/dist/{define-agent-eval-4J02MdF7.js → define-agent-eval-DkfcqaCF.js} +6 -6
  30. package/dist/{define-agent-eval-4J02MdF7.js.map → define-agent-eval-DkfcqaCF.js.map} +1 -1
  31. package/dist/diagnosis/index.js +1 -1
  32. package/dist/{dspy-rlm-engine-k_QdEBZo.js → dspy-rlm-engine-B5T43BkZ.js} +2 -2
  33. package/dist/{dspy-rlm-engine-k_QdEBZo.js.map → dspy-rlm-engine-B5T43BkZ.js.map} +1 -1
  34. package/dist/{engine-De2hfuiQ.d.ts → engine-Dc996kAg.d.ts} +2 -2
  35. package/dist/{engine-De2hfuiQ.d.ts.map → engine-Dc996kAg.d.ts.map} +1 -1
  36. package/dist/{eval-campaign-CXT2WYUe.js → eval-campaign-GapmPHIA.js} +2 -2
  37. package/dist/{eval-campaign-CXT2WYUe.js.map → eval-campaign-GapmPHIA.js.map} +1 -1
  38. package/dist/evaluation.d.ts +1 -1
  39. package/dist/experiment/index.d.ts +1 -1
  40. package/dist/experiment/index.js +8 -6
  41. package/dist/experiment/index.js.map +1 -1
  42. package/dist/{external-optimizer-process-_YIECYJ7.js → external-optimizer-process-CEXcCKqd.js} +2 -2
  43. package/dist/{external-optimizer-process-_YIECYJ7.js.map → external-optimizer-process-CEXcCKqd.js.map} +1 -1
  44. package/dist/{external-optimizer-subprocess-BrghTvEp.js → external-optimizer-subprocess-laM1-UDV.js} +2 -61
  45. package/dist/external-optimizer-subprocess-laM1-UDV.js.map +1 -0
  46. package/dist/fuzz.d.ts.map +1 -1
  47. package/dist/fuzz.js +2 -3
  48. package/dist/fuzz.js.map +1 -1
  49. package/dist/hosted/index.js +1 -1
  50. package/dist/{index-DJKZEldg.d.ts → index-BXJHJ_jE.d.ts} +12 -947
  51. package/dist/index-BXJHJ_jE.d.ts.map +1 -0
  52. package/dist/{index-CRsmcAGl.d.ts → index-DzQ6T34s.d.ts} +6 -6
  53. package/dist/{index-CRsmcAGl.d.ts.map → index-DzQ6T34s.d.ts.map} +1 -1
  54. package/dist/{index-kKECJfib.d.ts → index-lbwvO9vJ.d.ts} +3 -3
  55. package/dist/{index-kKECJfib.d.ts.map → index-lbwvO9vJ.d.ts.map} +1 -1
  56. package/dist/index.d.ts +9 -9
  57. package/dist/index.js +15 -13
  58. package/dist/index.js.map +1 -1
  59. package/dist/jev.d.ts +1 -1
  60. package/dist/{llm-judge-fhkFQL1N.js → llm-judge-3ncNcWNT.js} +415 -1981
  61. package/dist/llm-judge-3ncNcWNT.js.map +1 -0
  62. package/dist/{matrix-C1X-fIVX.d.ts → matrix-BnksRaDD.d.ts} +2 -2
  63. package/dist/{matrix-C1X-fIVX.d.ts.map → matrix-BnksRaDD.d.ts.map} +1 -1
  64. package/dist/multiplicity-D9cjmStq.js +101 -0
  65. package/dist/multiplicity-D9cjmStq.js.map +1 -0
  66. package/dist/multishot/golden/index.d.ts +1 -1
  67. package/dist/multishot/golden/index.js +1 -1
  68. package/dist/multishot/index.d.ts +2 -2
  69. package/dist/multishot/index.js +1 -1
  70. package/dist/openapi.json +1 -1
  71. package/dist/{paired-arms-JSDcs2zx.js → paired-arms-DKZFVPt8.js} +4 -398
  72. package/dist/paired-arms-DKZFVPt8.js.map +1 -0
  73. package/dist/paired-binary-fzkwENI4.js +399 -0
  74. package/dist/paired-binary-fzkwENI4.js.map +1 -0
  75. package/dist/{paired-promotion-decision-DTKl6-G8.js → paired-promotion-decision-D5B1Cxc2.js} +78 -5
  76. package/dist/paired-promotion-decision-D5B1Cxc2.js.map +1 -0
  77. package/dist/{power-and-mde-BJOpt6pq.js → power-and-mde-K_CmO3dc.js} +3 -101
  78. package/dist/power-and-mde-K_CmO3dc.js.map +1 -0
  79. package/dist/{produced-state-1RnbLrSa.js → produced-state-qIhqN3V5.js} +3 -3
  80. package/dist/{produced-state-1RnbLrSa.js.map → produced-state-qIhqN3V5.js.map} +1 -1
  81. package/dist/{promotion-policy-Cy5OV8BV.js → promotion-policy-C6FAJvmZ.js} +3 -3
  82. package/dist/{promotion-policy-Cy5OV8BV.js.map → promotion-policy-C6FAJvmZ.js.map} +1 -1
  83. package/dist/reporting.js +3 -3
  84. package/dist/rl.d.ts +17 -39
  85. package/dist/rl.d.ts.map +1 -1
  86. package/dist/rl.js +5 -5
  87. package/dist/search/index.d.ts +1187 -0
  88. package/dist/search/index.d.ts.map +1 -0
  89. package/dist/search/index.js +187 -0
  90. package/dist/search/index.js.map +1 -0
  91. package/dist/search-kernel-CumYAjA3.js +2427 -0
  92. package/dist/search-kernel-CumYAjA3.js.map +1 -0
  93. package/dist/search-kernel-TLoiMMcq.d.ts +1185 -0
  94. package/dist/search-kernel-TLoiMMcq.d.ts.map +1 -0
  95. package/dist/{search-ledger-9W0g5FP6.js → search-ledger-BnUytR8X.js} +3 -1
  96. package/dist/search-ledger-BnUytR8X.js.map +1 -0
  97. package/dist/{search-shipper-CYbmJQx8.js → search-shipper-Cn8cxcyp.js} +2 -2
  98. package/dist/{search-shipper-CYbmJQx8.js.map → search-shipper-Cn8cxcyp.js.map} +1 -1
  99. package/dist/search-summary-dJOaZ3Dw.js +133 -0
  100. package/dist/search-summary-dJOaZ3Dw.js.map +1 -0
  101. package/dist/{semantic-concept-judge-Bh5lvKGg.js → semantic-concept-judge-2SE_kXGF.js} +2 -2
  102. package/dist/{semantic-concept-judge-Bh5lvKGg.js.map → semantic-concept-judge-2SE_kXGF.js.map} +1 -1
  103. package/dist/{sequential-C21_PP7F.js → sequential-Yz3OSskl.js} +2 -2
  104. package/dist/{sequential-C21_PP7F.js.map → sequential-Yz3OSskl.js.map} +1 -1
  105. package/dist/single-run-lock-fVu3MZWH.js +62 -0
  106. package/dist/single-run-lock-fVu3MZWH.js.map +1 -0
  107. package/dist/{skillopt-optimization-method-CHUcZ8w6.js → skillopt-optimization-method-BL_j6mX8.js} +8 -7
  108. package/dist/{skillopt-optimization-method-CHUcZ8w6.js.map → skillopt-optimization-method-BL_j6mX8.js.map} +1 -1
  109. package/dist/{statistical-heldout-DANVmyug.js → statistical-heldout-BAFDCo07.js} +2 -2
  110. package/dist/{statistical-heldout-DANVmyug.js.map → statistical-heldout-BAFDCo07.js.map} +1 -1
  111. package/dist/{statistical-heldout-BedVSZb2.d.ts → statistical-heldout-CMpxMjlQ.d.ts} +2 -2
  112. package/dist/{statistical-heldout-BedVSZb2.d.ts.map → statistical-heldout-CMpxMjlQ.d.ts.map} +1 -1
  113. package/dist/{store-tool-spans-CawP-WxM.d.ts → store-tool-spans-CUwWSXoj.d.ts} +3 -3
  114. package/dist/{store-tool-spans-CawP-WxM.d.ts.map → store-tool-spans-CUwWSXoj.d.ts.map} +1 -1
  115. package/dist/{summary-report-BMvou2oZ.js → summary-report-BeYnvddy.js} +4 -3
  116. package/dist/{summary-report-BMvou2oZ.js.map → summary-report-BeYnvddy.js.map} +1 -1
  117. package/dist/{tool-groups-B4JVrH3g.d.ts → tool-groups-DVJAR1GE.d.ts} +2 -2
  118. package/dist/tool-groups-DVJAR1GE.d.ts.map +1 -0
  119. package/dist/trace-repair/index.d.ts +1 -1
  120. package/dist/traces.d.ts +2 -2
  121. package/dist/tree-DxGfhISA.js +4100 -0
  122. package/dist/tree-DxGfhISA.js.map +1 -0
  123. package/dist/{types-B3jzCp0p.js → types-B3jzCp0p2.js} +1 -1
  124. package/dist/types-B3jzCp0p2.js.map +1 -0
  125. package/dist/{types-CjFDKMDe.d.ts → types-D94EanDL.d.ts} +2 -2
  126. package/dist/{types-CjFDKMDe.d.ts.map → types-D94EanDL.d.ts.map} +1 -1
  127. package/dist/{types-B2673PBj.d.ts → types-EBUav9Bu.d.ts} +8 -4
  128. package/dist/types-EBUav9Bu.d.ts.map +1 -0
  129. package/docs/campaign-proposers.md +2 -0
  130. package/docs/design/statistics-decisions.md +1 -1
  131. package/docs/search-ledger.md +145 -8
  132. package/docs/trace-contracts.md +1 -3
  133. package/package.json +6 -1
  134. package/dist/active-curriculum-OjIWgrUJ.js +0 -204
  135. package/dist/active-curriculum-OjIWgrUJ.js.map +0 -1
  136. package/dist/define-agent-eval-ulRlLvse.d.ts.map +0 -1
  137. package/dist/external-optimizer-subprocess-BrghTvEp.js.map +0 -1
  138. package/dist/index-DJKZEldg.d.ts.map +0 -1
  139. package/dist/llm-judge-fhkFQL1N.js.map +0 -1
  140. package/dist/paired-arms-JSDcs2zx.js.map +0 -1
  141. package/dist/paired-delta-test-BF-FEP8V.js +0 -78
  142. package/dist/paired-delta-test-BF-FEP8V.js.map +0 -1
  143. package/dist/paired-promotion-decision-DTKl6-G8.js.map +0 -1
  144. package/dist/power-and-mde-BJOpt6pq.js.map +0 -1
  145. package/dist/search-ledger-9W0g5FP6.js.map +0 -1
  146. package/dist/search-summary-CcavvYLe.js +0 -378
  147. package/dist/search-summary-CcavvYLe.js.map +0 -1
  148. package/dist/tool-groups-B4JVrH3g.d.ts.map +0 -1
  149. package/dist/types-B2673PBj.d.ts.map +0 -1
  150. package/dist/types-B3jzCp0p.js.map +0 -1
@@ -105,4 +105,4 @@ function describeValue(value) {
105
105
  //#endregion
106
106
  export { assertMultishotShotResult as i, MultishotFatalToolError as n, MultishotShotResultError as r, MultishotDriverEmptyError as t };
107
107
 
108
- //# sourceMappingURL=types-B3jzCp0p.js.map
108
+ //# sourceMappingURL=types-B3jzCp0p2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-B3jzCp0p2.js","names":[],"sources":["../src/multishot/types.ts"],"sourcesContent":["// Public types for the multishot substrate.\n\nimport type { CostProvenance } from '../cost-ledger'\n\nexport interface MultishotMessage {\n role: 'user' | 'assistant' | 'tool'\n content: string\n toolCallId?: string\n toolCalls?: Array<{ id: string; name: string; args: Record<string, unknown> }>\n}\n\nexport interface MultishotArtifact {\n type: string\n turn: number\n invocation: { name: string; args: Record<string, unknown> }\n content: string\n}\n\nexport interface MultishotResult {\n transcript: MultishotMessage[]\n artifacts: MultishotArtifact[]\n toolCalls: number\n durationMs: number\n /** Known spend. A subtotal, not a total, when `costProvenance.kind` is\n * `uncaptured`. */\n costUsd: number\n /** Origin of `costUsd`. A shot that priced every call reports `estimated`\n * or `observed`; a shot with a call the router priced at nothing reports\n * `uncaptured`, and the matrix records the cell as under-counted instead of\n * presenting the subtotal as a complete estimate.\n *\n * Optional so an engine written before this field keeps working; the matrix\n * then judges the cell on judge receipts alone, as it did before. */\n costProvenance?: CostProvenance\n}\n\nexport interface MultishotToolDefinition {\n type: 'function'\n function: {\n name: string\n description: string\n parameters: Record<string, unknown>\n }\n}\n\n/** One chat-completion request the multishot loop issues for a single agent\n * (or driver) inference step. Mirrors the OpenAI-compat body the loop would\n * otherwise POST to the Tangle router. */\nexport interface MultishotTransportRequest {\n model: string\n messages: Array<Record<string, unknown>>\n tools?: MultishotToolDefinition[]\n temperature?: number\n maxTokens?: number\n signal?: AbortSignal\n}\n\nexport interface MultishotTransportToolCall {\n id: string\n type: 'function'\n function: { name: string; arguments: string }\n}\n\nexport interface MultishotTransportResponse {\n message: { content?: string | null; tool_calls?: MultishotTransportToolCall[] }\n usage?: { prompt_tokens?: number; completion_tokens?: number }\n /** Actual spend for this call. When omitted, the loop meters cost from\n * `usage` via the per-model estimator (estimateMultishotCost). */\n costUsd?: number\n /** Model identity the provider reported, when the transport observed one.\n * Omitted means unreported, and the requested model is used for\n * attribution — which is not proof that model answered. */\n model?: string\n}\n\n/** Execution seam for one leg of the multishot loop. The caller owns model\n * execution: agent-eval issues no provider request and holds no credential.\n * The loop still owns turn scheduling, tool dispatch, transcript capture, and\n * cost metering. agent-eval has no dependency on agent-runtime; adapt\n * agent-runtime's `profileChatClient` (or any sandbox, bridge, or router\n * client) into this signature product-side. */\nexport type MultishotTransport = (\n req: MultishotTransportRequest,\n) => Promise<MultishotTransportResponse>\n\nexport type MultishotToolExecutor = (\n args: Record<string, unknown>,\n ctx: {\n /** Caller-owned execution seam for the specialist leg this tool runs. */\n transport: MultishotTransport\n signal?: AbortSignal\n },\n) => Promise<{ content: string; costUsd: number }>\n\nexport interface MultishotPersona {\n /** Stable identifier — used for per-cell artifact paths + matrix axis keys. */\n id: string\n /** Per-domain payload (income/profile/voice/etc.) shaped by the consumer. */\n [k: string]: unknown\n}\n\n/**\n * Persona-shaping callbacks. Both are OPTIONAL: when omitted, the loop derives\n * them from the `AgentProfile` + persona payload (see `defaultShapeFromProfile`)\n * so a pure-profile call — `runMultishot({ profile, persona })` — works with no\n * role-builder functions. Provide callbacks only to override the derived shape.\n */\nexport interface MultishotShape<TPersona extends MultishotPersona> {\n /** Opening user message (turn 0) — the persona's first ask. */\n buildOpener?: (persona: TPersona) => string\n /** System prompt the driver LLM uses to roleplay the persona. Should set\n * voice, goals, constraints, time-pressure, and the \"never go silent\" rule. */\n buildDriverSystemPrompt?: (persona: TPersona) => string\n}\n\nexport class MultishotDriverEmptyError extends Error {\n constructor(public readonly turn: number) {\n super(`multishot: driver returned empty content twice at turn ${turn} — failing loud`)\n this.name = 'MultishotDriverEmptyError'\n }\n}\n\nexport class MultishotFatalToolError extends Error {\n constructor(message: string) {\n super(message)\n this.name = 'MultishotFatalToolError'\n }\n}\n\nexport class MultishotShotResultError extends Error {\n constructor(reason: string) {\n super(`multishot: shot returned an invalid MultishotResult — ${reason}`)\n this.name = 'MultishotShotResultError'\n }\n}\n\nconst MULTISHOT_ROLES = new Set(['user', 'assistant', 'tool'])\n\n/** Contract guard for the value a caller-supplied shot resolves with. The\n * matrix writes per-cell artifacts, builds judge inputs, and meters cost from\n * this value, so a malformed result must stop the cell instead of scoring a\n * degraded one. Two silent degradations this closes: an artifact with no\n * `type` matches neither the code nor the content artifact set, so the cell\n * scores as though the artifact was never produced; a non-finite `costUsd`\n * reaches `summary.totalCostUsd` and makes every cost number NaN.\n *\n * A rejected cell is still billed: the matrix cell reads the shot's own\n * `costUsd` when it is a usable amount and declares that spend on the throw,\n * so money the shot spent before returning a malformed result stays in the\n * cumulative sum the cost ceiling reads. A result whose `costUsd` is itself\n * malformed carries no usable amount, and the cell records as `uncaptured`.\n *\n * Every required field of `MultishotMessage` and `MultishotArtifact` is\n * checked, including `toolCalls` elements and `invocation.args`. Optional\n * fields are checked only when present. */\nexport function assertMultishotShotResult(value: unknown): asserts value is MultishotResult {\n if (typeof value !== 'object' || value === null) {\n throw new MultishotShotResultError(`expected an object, received ${describeValue(value)}`)\n }\n const result = value as Record<string, unknown>\n if (!Array.isArray(result.transcript)) {\n throw new MultishotShotResultError(\n `transcript must be an array, received ${describeValue(result.transcript)}`,\n )\n }\n if (!Array.isArray(result.artifacts)) {\n throw new MultishotShotResultError(\n `artifacts must be an array, received ${describeValue(result.artifacts)}`,\n )\n }\n result.transcript.forEach(assertMessage)\n result.artifacts.forEach(assertArtifact)\n assertFiniteCount(result.toolCalls, 'toolCalls')\n assertFiniteCount(result.durationMs, 'durationMs')\n assertFiniteCount(result.costUsd, 'costUsd')\n if (result.costProvenance !== undefined) assertCostProvenance(result.costProvenance)\n}\n\nfunction assertCostProvenance(value: unknown): void {\n const row = requireRow(value, 'costProvenance')\n if (row.kind !== 'observed' && row.kind !== 'estimated' && row.kind !== 'uncaptured') {\n throw new MultishotShotResultError(\n `costProvenance.kind must be observed, estimated or uncaptured, received ${describeValue(row.kind)}`,\n )\n }\n // The matrix reads the amount from `costUsd`; `usd` only has to agree with\n // the kind, so an uncaptured provenance cannot smuggle in a total.\n if (row.kind === 'uncaptured') {\n if (row.usd !== null) {\n throw new MultishotShotResultError(\n `uncaptured costProvenance.usd must be null, received ${describeValue(row.usd)}`,\n )\n }\n return\n }\n assertFiniteCount(row.usd, 'costProvenance.usd')\n}\n\nfunction assertMessage(value: unknown, index: number): void {\n const row = requireRow(value, `transcript[${index}]`)\n if (typeof row.role !== 'string' || !MULTISHOT_ROLES.has(row.role)) {\n throw new MultishotShotResultError(\n `transcript[${index}].role must be user, assistant or tool, received ${describeValue(row.role)}`,\n )\n }\n assertString(row.content, `transcript[${index}].content`)\n if (row.toolCallId !== undefined) {\n assertString(row.toolCallId, `transcript[${index}].toolCallId`)\n }\n if (row.toolCalls === undefined) return\n if (!Array.isArray(row.toolCalls)) {\n throw new MultishotShotResultError(\n `transcript[${index}].toolCalls must be an array when present, received ${describeValue(row.toolCalls)}`,\n )\n }\n row.toolCalls.forEach((call, callIndex) => {\n const field = `transcript[${index}].toolCalls[${callIndex}]`\n const row = requireRow(call, field)\n assertString(row.id, `${field}.id`)\n assertString(row.name, `${field}.name`)\n requireRow(row.args, `${field}.args`)\n })\n}\n\nfunction assertArtifact(value: unknown, index: number): void {\n const row = requireRow(value, `artifacts[${index}]`)\n assertString(row.type, `artifacts[${index}].type`)\n assertString(row.content, `artifacts[${index}].content`)\n assertFiniteCount(row.turn, `artifacts[${index}].turn`)\n const invocation = requireRow(row.invocation, `artifacts[${index}].invocation`)\n assertString(invocation.name, `artifacts[${index}].invocation.name`)\n requireRow(invocation.args, `artifacts[${index}].invocation.args`)\n}\n\nfunction requireRow(value: unknown, field: string): Record<string, unknown> {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new MultishotShotResultError(\n `${field} must be an object, received ${describeValue(value)}`,\n )\n }\n return value as Record<string, unknown>\n}\n\nfunction assertString(value: unknown, field: string): void {\n if (typeof value !== 'string') {\n throw new MultishotShotResultError(\n `${field} must be a string, received ${describeValue(value)}`,\n )\n }\n}\n\nfunction assertFiniteCount(value: unknown, field: string): void {\n if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {\n throw new MultishotShotResultError(\n `${field} must be a finite number >= 0, received ${describeValue(value)}`,\n )\n }\n}\n\nfunction describeValue(value: unknown): string {\n if (value === null) return 'null'\n if (Array.isArray(value)) return 'an array'\n if (typeof value === 'object') return 'an object'\n return `${typeof value} ${String(value)}`\n}\n"],"mappings":";AAmHA,IAAa,4BAAb,cAA+C,MAAM;CACvB;CAA5B,YAAY,MAA8B;EACxC,MAAM,0DAA0D,KAAK,gBAAgB;EAD3D,KAAA,OAAA;EAE1B,KAAK,OAAO;CACd;AACF;AAEA,IAAa,0BAAb,c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AACT;AAEA,SAAS,aAAa,OAAgB,OAAqB;CACzD,IAAI,OAAO,UAAU,UACnB,MAAM,IAAI,yBACR,GAAG,MAAM,8BAA8B,cAAc,KAAK,GAC5D;AAEJ;AAEA,SAAS,kBAAkB,OAAgB,OAAqB;CAC9D,IAAI,OAAO,UAAU,YAAY,CAAC,OAAO,SAAS,KAAK,KAAK,QAAQ,GAClE,MAAM,IAAI,yBACR,GAAG,MAAM,0CAA0C,cAAc,KAAK,GACxE;AAEJ;AAEA,SAAS,cAAc,OAAwB;CAC7C,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO;CACjC,IAAI,OAAO,UAAU,UAAU,OAAO;CACtC,OAAO,GAAG,OAAO,MAAM,GAAG,OAAO,KAAK;AACxC"}
@@ -1,5 +1,5 @@
1
1
  import { c as RunSplitTag } from "./run-record-DF-fuu31.js";
2
- import { R as Scenario, d as DispatchContext } from "./types-B2673PBj.js";
2
+ import { R as Scenario, d as DispatchContext } from "./types-EBUav9Bu.js";
3
3
  //#region src/benchmarks/types.d.ts
4
4
  type BenchmarkTaskKind = 'retrieval' | 'rag-answer' | 'hallucination' | 'kb-improvement' | 'routing' | 'custom';
5
5
  type BenchmarkFamily = 'beir' | 'mteb-retrieval' | 'msmarco' | 'trec-dl' | 'miracl' | 'lotte' | 'bright' | 'crag' | 'hotpotqa' | 'kilt' | 'ragtruth' | 'faithbench' | 'first-party' | 'custom';
@@ -99,4 +99,4 @@ declare const BENCHMARK_SPLIT_SEED = "agent-eval-v1";
99
99
  declare function deterministicSplit(itemId: string, seed?: string): RunSplitTag;
100
100
  //#endregion
101
101
  export { BenchmarkFamily as a, BenchmarkSource as c, BenchmarkEvaluation as i, BenchmarkTaskKind as l, BenchmarkAdapter as n, BenchmarkResponder as o, BenchmarkDatasetItem as r, BenchmarkScenario as s, BENCHMARK_SPLIT_SEED as t, deterministicSplit as u };
102
- //# sourceMappingURL=types-CjFDKMDe.d.ts.map
102
+ //# sourceMappingURL=types-D94EanDL.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types-CjFDKMDe.d.ts","names":[],"sources":["../src/benchmarks/types.ts"],"mappings":";;;KASY;KAQA;UAgBK,qBAAqB;;;EAGpC;;EAEA,SAAS;;EAET,QAAQ;;EAER,SAAS;;EAET,WAAW;;EAEX;;EAEA,SAAS;EACT,WAAW;;UAGI;;;;EAIf;;EAEA;;EAEA,aAAa;;;EAGb,KAAK;EACL;;UAGe;EACf;EACA;EACA;;EAEA;EACA;EACA;;EAEA;;;;;EAKA;;;UAQe,iBAAiB,kBAAkB,oBAAoB;;EAEtE;EACA,SAAS;EACT,WAAW;EACX;EACA,SAAS;EACT;;;;;EAKA,YAAY,OAAO,cAAc,QAAQ,qBAAqB;;EAE9D,SAAS,MAAM,qBAAqB,WAAW,UAAU,YAAY,QAAQ;;;;EAI7E,YAAY,iBAAiB;;UAGd,kBAAkB,4BAA4B;EAC7D;EACA;EACA,QAAQ;EACR,UAAU;EACV,UAAU;EACV,MAAM,qBAAqB;;KAGjB,mBAAmB,oBAAoB,uBAAuB;EACxE,UAAU,kBAAkB;EAC5B,MAAM,qBAAqB;EAC3B,SAAS;MACL,QAAQ,aAAa;;;cAoBd;;;;;;;;;iBAUG,mBACd,gBACA,gBACC"}
1
+ {"version":3,"file":"types-D94EanDL.d.ts","names":[],"sources":["../src/benchmarks/types.ts"],"mappings":";;;KASY;KAQA;UAgBK,qBAAqB;;;EAGpC;;EAEA,SAAS;;EAET,QAAQ;;EAER,SAAS;;EAET,WAAW;;EAEX;;EAEA,SAAS;EACT,WAAW;;UAGI;;;;EAIf;;EAEA;;EAEA,aAAa;;;EAGb,KAAK;EACL;;UAGe;EACf;EACA;EACA;;EAEA;EACA;EACA;;EAEA;;;;;EAKA;;;UAQe,iBAAiB,kBAAkB,oBAAoB;;EAEtE;EACA,SAAS;EACT,WAAW;EACX;EACA,SAAS;EACT;;;;;EAKA,YAAY,OAAO,cAAc,QAAQ,qBAAqB;;EAE9D,SAAS,MAAM,qBAAqB,WAAW,UAAU,YAAY,QAAQ;;;;EAI7E,YAAY,iBAAiB;;UAGd,kBAAkB,4BAA4B;EAC7D;EACA;EACA,QAAQ;EACR,UAAU;EACV,UAAU;EACV,MAAM,qBAAqB;;KAGjB,mBAAmB,oBAAoB,uBAAuB;EACxE,UAAU,kBAAkB;EAC5B,MAAM,qBAAqB;EAC3B,SAAS;MACL,QAAQ,aAAa;;;cAoBd;;;;;;;;;iBAUG,mBACd,gBACA,gBACC"}
@@ -110,6 +110,9 @@ interface SearchOperation {
110
110
  recorded: boolean;
111
111
  /** The recorded outcome; null until the operation is recorded. */
112
112
  outcome: SearchOperationRecordedEvent['outcome']['status'] | null;
113
+ /** What ran the operation, for example a proposer's model; null until the
114
+ * operation is recorded. */
115
+ execution: SearchOperationRecordedEvent['execution'] | null;
113
116
  /** Artifacts the started event bound, then those the recorded event bound,
114
117
  * for example a claim's plan or a proposal's output. */
115
118
  artifacts: readonly SearchArtifactRef[];
@@ -588,9 +591,10 @@ interface ProposeContext<TFindings = ProposalFinding> {
588
591
  * chose (the incumbent by default). Equal to `parents[0].artifact` when
589
592
  * `parents` is present. */
590
593
  readonly currentSurface: MutableSurface;
591
- /** How the child should derive from the parent: `improve` for a hill-climb
592
- * step; other policies ask for `draft`, `debug` or `merge`. Absent outside
593
- * a search. */
594
+ /** How the child should derive from the parent: `improve` edits it;
595
+ * `draft` writes a whole alternative to it (`aide` drafts from the root);
596
+ * `debug` fixes a parent whose cells failed as defects, such as a crash or
597
+ * a broken build; `merge` combines every parent. Absent outside a search. */
594
598
  readonly operator?: 'draft' | 'improve' | 'debug' | 'merge';
595
599
  /** Every parent the policy chose, primary first, with its artifact. A
596
600
  * `merge` proposal needs every parent; other operators name exactly one.
@@ -1002,4 +1006,4 @@ interface CampaignResult<TArtifact = unknown, TScenario extends Scenario = Scena
1002
1006
  }
1003
1007
  //#endregion
1004
1008
  export { SearchNode as $, LabeledScenarioWrite as A, ScoredSurfaceOutcome as B, JudgeDimension as C, LabeledScenarioSampleArgs as D, LabeledScenarioRecord as E, ProposeContext as F, labelTrustRank as G, SurfaceProposer as H, ProposedCandidate as I, renderSearchSummary as J, SearchProposerView as K, RedactionStatus as L, OptimizerConfig as M, ParetoParent as N, LabeledScenarioSource as O, ProposalTrackContext as P, SearchDecisionRecord as Q, Scenario as R, JudgeConfig as S, LabelTrust as T, TraceSpan as U, SessionScript as V, isProposedCandidate as W, SearchCell as X, searchProposerView as Y, SearchCompletion as Z, GateDecision as _, CampaignResult as a, SearchUnitScore as at, GenerationRecord as b, CampaignTraceWriter as c, searchTaskSetDigest as ct, DispatchContext as d, SearchOperation as et, DispatchFn as f, GateContribution as g, GateContext as h, CampaignCostMeter as i, SearchStateView as it, MutableSurface as j, LabeledScenarioStore as k, CodeSurface as l, searchUnitScores as lt, GateCheckStatus as m, CampaignArtifactWriter as n, SearchSpend as nt, CampaignScenarioIdentity as o, searchCellId as ot, Gate as p, SearchSummaryOptions as q, CampaignCellResult as r, SearchState as rt, CampaignTokenUsage as s, searchNodeId as st, CampaignAggregates as t, SearchScoredCell as tt, ComponentSurface as u, GateResult as v, JudgeScore as w, JudgeAggregate as x, GenerationCandidate as y, ScenarioAggregate as z };
1005
- //# sourceMappingURL=types-B2673PBj.d.ts.map
1009
+ //# sourceMappingURL=types-EBUav9Bu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-EBUav9Bu.d.ts","names":[],"sources":["../src/campaign/search-state.ts","../src/campaign/search-summary.ts","../src/campaign/types.ts"],"mappings":";;;;;;;;;;iBAwDgB,aAAa,kBAAkB;;iBAK/B,aACd,kBACA,gBACA,gBACA,OAAO,aACP;;iBAMc,oBAAoB,gBAAgB,eAAe;UAkBlD;EACf;EACA,UAAU;EACV,OAAO;EACP;EACA;;UAGe;EACf;EACA;EACA;EACA;;;;UAKe;EACf;EACA;EACA;EACA;;;UAIe;EACf;EACA;;EAEA;EACA;;;;;;;;iBASc,iBAAiB,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;;EAIA;;;;EAIA;;;;EAIA;IACE;IACA;IACA,iBAAiB;MAAQ;MAAgB;;;;;EAI3C,YAAY;;;;;;;;;;EAUZ,WAAW;IAAQ;IAAoB;IAAmB;IAAgB;;;;EAG1E;;;;EAIA;;;;EAIA,cAAc,SAAS;;UAGR;EACf,SAAS,eAAe;EACxB,YAAY,eAAe;;EAE3B,MAAM;;EAEN;EACA;EACA;;EAEA;;EAEA;;EAEA;;EAEA;;UAGe,eAAe,qBAAqB,kBAAkB,WAAW;;EAEhF;;EAEA;EACA;;EAEA;EACA;EACA;EACA;EACA,OAAO,MAAM,mBAAmB;EAChC,YAAY;EACZ;IACE,aAAa;IACb;;EAEF,OAAO;EACP;EACA;EACA,iBAAiB;;;EAGjB,WAAW,MAAM,2BAA2B,KAAK"}
@@ -611,6 +611,8 @@ Lineage lives in the ledger: read a node's parents from its edges and its paired
611
611
  `runOptimization()` runs on the search kernel with a `SearchPolicy` ([search ledger](./search-ledger.md#run-a-search-the-kernel)).
612
612
  The default, `incumbent()`, is the hill climb: each proposal extends the leader once every earlier candidate is measured, and a candidate that scored every scenario leads when it beats the leader on the scenarios they share.
613
613
  Pass `policy: crowdedFrontierParent({ seed })` to draw the parent from the Pareto frontier instead: a seeded NSGA-II crowded tournament that prefers isolated frontier members.
614
+ `aide()` and `beam({ width })` also run here; they rank on the scenarios, because `runOptimization` has no private selection split, and it keeps the `uniform` allocator, because its proposer reads every candidate's score on every scenario.
615
+ Under `aide`, `ctx.operator` says what to write: `draft` a whole alternative from the parent, `debug` a parent whose cells failed as defects, or `improve` it.
614
616
  The proposer receives that parent as `ctx.currentSurface` and `ctx.parentOutcome`; `ctx.incumbentOutcome` stays the leader, and only a candidate that beats the leader leads.
615
617
  `selfImprove({ policy })` forwards the same policy in proposer mode.
616
618
 
@@ -299,7 +299,7 @@ That is why the option stays optional — a required seed would push the caller
299
299
  | `summary-report.ts` `bayesianBootstrapMeanSamples` | Dirichlet-weight bootstrap | reported posterior and gain histogram | `makeRng(seed, deltas)` |
300
300
  | `meta-eval/rubric-predictive-validity.ts` `bootstrapCi` | percentile bootstrap of Pearson r | rubric verdict (`load_bearing` / `informative`) | `makeRng(input.seed, xs, ys)` |
301
301
  | `meta-eval/correlation-study.ts` `bootstrapPearsonCi` | percentile bootstrap of Pearson r | reported correlation CI | `makeRng(options.seed, xs, ys)` |
302
- | `rl/active-curriculum.ts` `thompsonCurriculum` | Beta posterior sampling | sample-budget allocation | `makeRng(opts.seed, scores)` |
302
+ | `campaign/search-policy.ts` `aide` | Thompson draw over node posteriors, the debug coin, the debug and uniform draws | the parent an expansion extends (spends budget, claims nothing) | `mulberry32(seed ^ imul(completed expansions + 1, 0x9e3779b1) ^ salt)`, a pure function of the ledger |
303
303
  | `rl/adaptation-eval.ts` `compareAdaptationCurves` | bootstrap of per-k mean deltas | per-k CI and AUC delta | `makeRng(opts.seed, a-means, b-means)` |
304
304
  | `campaign/gates/sequential.ts` | seeded Fisher-Yates over paired deltas | exchangeability guard before the e-process | `shuffleSeed`, default 1337, data-independent by construction |
305
305
 
@@ -139,6 +139,58 @@ renderSearchSummary(state, { split: 'train' })
139
139
  `searchProposerView(state)` has no parameter that can select another split: its `scoredCells`/`unitScores` always read `'train'`, so a proposer built on it cannot reach the sealed selection or test split even by mistake.
140
140
  `ProposeContext.parents` carries every parent the policy chose, primary first, with its artifact — `currentSurface` is `parents[0].artifact`; a `merge` proposal needs every parent, and the built-in `incumbent`/`crowdedFrontierParent` policies always choose one.
141
141
 
142
+ ## Lenses
143
+
144
+ A lens (`@tangle-network/agent-eval/search`, search-tree-design §12) is a pure function of a `SearchStateView`: it reads no other record type and does no I/O.
145
+ Each returns `{ data, signal }` — `data` is JSON a view or `agent-eval search show` renders, and `signal` is exactly one named, quantitative value a `SearchPolicy` can read, so what a person sees and what the climber uses come from the same computation.
146
+ No lens imputes a value below the design's honesty thresholds: an unknown cost or an unpaired sample stays excluded, reported as `insufficient` or `no measured children` rather than folded into a number.
147
+ Every sample a lens summarizes is staged by `estimateNode`'s own `searchEstimateMethod`: `none` below 2 (no mean; one observation is no estimate), `insufficient` below 6 (a mean, no interval), `descriptive` below 20 and `bootstrap` from 20, each interval naming its method and n.
148
+ Every order a lens reports, such as a cluster id, sorts by UTF-16 code unit, so a fixed ledger gives the same JSON on every host.
149
+
150
+ | Lens | Reports | Signal |
151
+ |---|---|---|
152
+ | `tree(state)` | a tidy tree of nodes and edges — the base view every other lens sits beside; a node with unknown-cost cells shows its known spend, its proven floor and how many cells are unknown, never a total | `tree.nodeCount` (drives no policy) |
153
+ | `operatorYield(state, { split? })` | each edge operator's proposals, re-proposals, outcome counts and improvement-per-known-dollar yield, from `searchPosterior` (`estimateNode`'s tree-wide contrast); a node counts once, under the operator of the edge that registered it, and a re-proposal adds a proposal but no outcome or sample; a node is excluded from yield when it was decided invalid, shares fewer than 2 units with the root, or any of its cells has an unknown cost | `operatorYield.weights`: an operator's yield mean once it has 6 or more yield-eligible nodes (`MIN_OUTCOMES_FOR_WEIGHT`), else `null` |
154
+ | `front(state, { split?, axes? })` | the Pareto frontier over per-unit mean score and known cost per attempted cell on the split (reusing `paretoFrontier`), with room for caller-declared extra axes; a node's total spend depends on how far the allocator measured it, so it is shown but is not an axis; a node decided invalid, scored on fewer than 2 units, with an unknown-cost cell on the split, or with a non-finite extra axis is excluded from every frontier pass, with the reason | `front.membership`: 1 for a node on the frontier, 0 otherwise (including an excluded node) |
155
+ | `taskMatrix(state, { split? })` | nodes and units, each single-linkage clustered on the root-mean-square difference over their shared scores, cutoff at the data's own median pairwise distance | `taskMatrix.specialistGain`: per unit cluster, the best node's mean minus the mean of node means, in the objective's direction, among nodes not decided invalid that scored every unit of the cluster; `null` with the reason, and omitted from the signal, below 2 such nodes or 6 units |
156
+
157
+ `agent-eval search show <ledger> [--tree] [--operator-yield] [--front] [--task-matrix]` prints each lens's text form below the search summary, so an agent reading the CLI sees the same numbers Intelligence, discovery lab, VerticalBench and agent-runtime `improve()` would render from the same JSON.
158
+
159
+ `incumbentWithOperatorBandit({ seed, fixedWeights? })` (`/campaign`) is the one built-in policy that reads a lens signal: a hill climb, like `incumbent`, whose expansion operator is a weighted draw over `operatorYield`'s weights.
160
+ An operator without 6 measured outcomes yet draws on `fixedWeights` (uniform by default) instead of being starved until every operator clears the gate; a measured operator's weight is `fixedWeights[operator] + yield`, floored just above zero, because yield (dollars) and the fixed prior (an arbitrary share) are not on the same scale and a small positive yield should not draw less than an untested operator's default prior.
161
+
162
+ ## Edit credit: which edits earned their score
163
+
164
+ `editCredit(state, { readArtifact })` (`@tangle-network/agent-eval/search`) treats the edits of a search as genes and follows them down its lineage.
165
+ It diffs each lineage parent and child line by line, with whitespace normalized, and cuts every changed run into paragraphs.
166
+ An added paragraph is an `insert` gene and a removed paragraph is a `delete` gene.
167
+ A gene's id hashes its kind, its location in the artifact and its normalized lines, so the same edit has the same id wherever a proposer makes it.
168
+ The lens computes these ids; the ledger records no hunk ids.
169
+ A node carries a gene when its content holds the paragraph (or, for a delete, lacks it), so carrying follows merges, re-proposals and reverts.
170
+ `readArtifact` returns a node's parsed artifact, and the caller verifies its bytes against the reference's digest.
171
+ A node whose artifact is unreadable, or a code surface whose patch is not in the ledger, has unknown content, and its steps yield no genes.
172
+
173
+ Credit pairs, on each clean lineage step, the side that carries the gene against the side that lacks it, on the units both scored.
174
+ A step is clean for a gene when every change on it belongs to one edit that introduced the gene, so a merge that also brings in other edits credits none of them.
175
+ Per unit, both sides average over the gene's clean steps, and `pairedDeltaTest` decides on the per-unit contrasts, staged like `NodeEstimate.method`: `none` below 2 units, `insufficient` below 6, `descriptive` below 20, `bootstrap` from 20.
176
+ The verdict is `pairedDeltaTest`'s own decision in each direction: `reusable`, `harmful`, `unresolved`, or `insufficient` below 6 units.
177
+ Genes with the same clean steps are linked: they have one credit, and they count as one edit.
178
+ Credit is not adjusted for the number of edits, because it steers what to reuse and test next and claims nothing.
179
+ `data.chance.expectedReusable` states how many reusable edits the verdict would call if no edit had an effect, so read the count against it.
180
+ A policy chooses a parent for its scores, so a parent is high by chance on the units it was chosen on.
181
+ On a step where the child gained a gene, that parent is the lacking side, and credit is biased toward `harmful`; where the child lost the gene, credit is biased toward `reusable`.
182
+ With no true effect, the generator below measured `harmful` on 4.3 % of measured edits under `uniform` (103 of 2,396, 40 searches) and 1.3 % under `asha` (31 of 2,412), and `reusable` on 0.8 % and 1.0 %.
183
+ Only the sealed test split is free of this bias, so a reusable edit still needs a held-out test before it ships.
184
+
185
+ Interactions compare a gene's step contrasts where another gene is present on both ends against where it is absent on both ends, in both directions.
186
+ The pairs with 6 or more units are tested with an exact two-sided sign test and flagged after a Holm correction; a flag is a reason for a factorial test, not a claim.
187
+ A flag says that a gene's credit depends on its context; the named partner can be a gene that travels with the true partner.
188
+
189
+ The signal `reusableHunks` counts the reusable edits, and `signal.top` names the first gene of each, best first; it is null until some gene has 6 units on clean steps.
190
+ `data.skillCandidates` turns each reusable insert edit into an inline skill resource with the `improve()` options that select it, for agent-runtime's SkillOpt (`surface: 'skills'`).
191
+ `agent-eval search show <ledger> --edit-credit [--json]` prints the lens, reading artifacts from the blobs the ledger names.
192
+ `scripts/synthetic-search-ledger.ts` writes a seeded search with planted edit effects through the real kernel and scores the lens against the planted truth.
193
+
142
194
  ## Record a search
143
195
 
144
196
  `SearchRecorder` writes each fact the moment it exists.
@@ -199,11 +251,22 @@ The ports:
199
251
  Its output is stored as a `proposal` blob on `operation-recorded` before any child is registered.
200
252
  - **Codec:** `node(recorder, artifact)` content-addresses an artifact, `diff` stores the parent-to-child diff, and `load` reads a node's artifact back.
201
253
  - **Policy:** `expand(view)` returns parents and an operator, or null to wait; `leader(view)` names the node the search keeps.
202
- The view holds the policy split (selection, or train when a search has none) and no test cell.
203
- `incumbent({ patience })` is the hill climb: it expands the leader once every earlier child is screened.
204
- A node leads when it dodged no unit (no cell ran and ended unscored), scored every unit the leader scored, and beats the leader's mean on them.
254
+ The view holds the policy split (selection, or train when a search has none) and no test cell: per-unit scores, paired estimates, every node's lineage, status and defect count (`nodes()`), and each node's posterior on its improvement over the root (`posterior`, from `searchPosterior`, computed once per ledger state).
255
+ The kernel refuses an expansion without a parent or with a parent whose screen has not finished; an invalid node is never screened, so it is never a parent.
256
+ Every built-in policy keeps the same leader: a node leads when it dodged no unit (no cell ran and ended unscored), scored every unit the leader scored, and beats the leader's mean on them.
205
257
  A node measured on fewer units than the leader, such as one an allocator has only screened, cannot take the lead on less evidence.
206
- `crowdedFrontierParent({ seed })` draws the parent from the Pareto frontier by a seeded crowded tournament and keeps the incumbent's leader rule.
258
+ `incumbent({ patience })` is the hill climb: it expands the leader once every earlier child is screened.
259
+ `crowdedFrontierParent({ seed })` draws the parent from the Pareto frontier by a seeded crowded tournament.
260
+ `aide({ drafts, debugProbability, maxDebugDepth, stallAfter })` (defaults 5, 0.5, 3, 4) is AIDE's policy with three changes for noisy scores.
261
+ It drafts whole alternatives from the root until `drafts` nodes were drafted.
262
+ Then, with probability `debugProbability`, it debugs a buggy leaf whose chain holds fewer than `maxDebugDepth` debug edges; a node is buggy when at least half of its final cells outside the test split `failed`, and an `errored` cell never makes it buggy.
263
+ Otherwise it improves a parent drawn by Thompson sampling from every screened node that is not buggy: the root at 0, every other node from a normal with its mean improvement over the root and the pooled between-unit variance divided by its shared units.
264
+ Until some node shares 2 units with the root the variance is unknown and the draw is uniform.
265
+ When the drawn parent's lineage (the nodes under its nearest draft, or under the root) has had `stallAfter` improve children in a row that did not raise its best posterior mean, the improve forks from the node with the best posterior mean instead.
266
+ A fork's children restart the run of the lineage they join, so a stalled lineage that holds the global best forks once, not on every later expansion.
267
+ `beam({ width })` expands the top `width` nodes by posterior mean, the member with the fewest children first; a member is the root, a node an allocator advanced, or a node that scored every unit the root scored.
268
+ Each edge records the rule and evidence that chose its parent (`aide:draft`, `aide:debug`, `aide:thompson`, `aide:uniform-draw`, `aide:stall-fork`, `beam(width=k)`).
269
+ Pair `incumbent` and `crowdedFrontierParent` with `uniform`, and `aide` and `beam` with `asha`: a hill climb expands only the leader, and under `asha` the root keeps the lead until a child finishes the top rung, while a posterior stays honest about a node measured only on the first rung.
207
270
  - **Allocator:** `plan(state, nodeId, rung)` lists the cells a node needs through its rung; the kernel allocates the ones the ledger lacks.
208
271
  `advance(view)` names the nodes the evidence moves to a further rung, and `prune(view, keep)` names, at close, the nodes left waiting.
209
272
  The kernel records each `advanced` decision only once the cap admits its rung's cells, then allocates them.
@@ -248,14 +311,59 @@ Aborting the `signal` pauses the search: in-flight cells are aborted, a scored r
248
311
  One kernel runs a ledger file at a time on a host: a second one is refused by a pid lock beside the ledger, and a killed holder's lock is reclaimed.
249
312
  A closed ledger returns its result; more work on a closed search is a new search.
250
313
 
251
- An `asha` search ranks a node when it finishes a rung, so a restart that changes the order cells finish in can change a promotion.
252
- Its resumed ledger holds only rank decisions that its own evidence supports.
314
+ A node an allocator advanced stays a possible parent while its rung cells run, after a restart too.
315
+ An `asha` search ranks a node when it finishes a rung, and `aide` and `beam` expand while other screens run.
316
+ A restart that changes the order cells finish in can therefore change a promotion or a parent.
317
+ The resumed ledger holds only decisions that its own evidence supports.
318
+ A hill climb under `uniform` waits for every screen, so its resumed search equals the uninterrupted one.
253
319
 
254
320
  `scripts/search-sim.ts` runs the real kernel, ledger, policies and claim over a seeded synthetic objective, proposer and executor.
255
321
  `kill-resume` SIGKILLs it at random ledger positions and compares the resumed search with an uninterrupted one.
256
322
  `claims --searches 200 --null` runs 200 searches in which no node differs from the root and reports how often the claim ships, with Wilson and Clopper-Pearson intervals; `--plant-gain X` plants a real gain to measure how often the claim finds it.
257
- `compare --seeds 200` runs one search per seed under `uniform` and under `asha` and reports the cells each allocated, the node each kept, and the units each edge pairs on; `--pool-gap X` swaps the hill climb for a fixed pool with one planted best candidate.
323
+ `compare --seeds 200 --arms incumbent+uniform,aide+asha` runs one search per seed under each `policy+allocation` arm and reports the cells each allocated, the node each kept, how often it kept the planted node and how often it kept a node at least half the planted gain above the root (each with a Wilson interval), and the units each edge pairs on; every later arm is paired with the first by seed, with an exact sign test.
324
+ `--max-cells N` caps the cells a search allocates, so arms compare at equal cells.
325
+ `--pool-gap X` swaps the hill climb for a fixed pool with one planted best candidate; `--deep-gain X` plants a gain at depth `--deep-depth` (default 3) of one lineage, behind neutral path nodes (or a gradient with `--deep-ramp`), with every other edit a loss.
326
+ `--defect-rate X` makes a share of children fail every cell as a defect, which `aide` debugs.
258
327
  Every simulated run re-derives each `advanced` and `pruned` decision from the ledger just before it.
328
+ It also rebuilds the policy's view from the ledger just before each proposal started and checks that the policy returns the recorded parents, operator and selection evidence.
329
+
330
+ ## Geometry lenses: `landscape` and `skillManifold`
331
+
332
+ A lens is a pure function of a `SearchStateView` from `@tangle-network/agent-eval/search`.
333
+ It returns `data` for a view and one `signal` that a policy or an allocator reads, so a person and the climber read the same number.
334
+ A geometry lens signal states its `method`, its sample `n`, and, when its value is null, the reason in `insufficient`.
335
+ A lens never imputes a score or a cost.
336
+
337
+ `landscape(state, embed?, options?)` places every node in two dimensions by landmark classical multidimensional scaling of a distance between profiles.
338
+ The default distance, `lineageEdits()`, counts the improve, debug and merge edges between two nodes.
339
+ A draft is written afresh, so the lineage distance leaves a draft's lineage unplaced; `surfaceTextEdits(read)` places it by line edits between the surface texts.
340
+ `vectorEmbedding(name, vector)` takes a caller's vectors, for example a model embedding of each profile.
341
+ A node's score is its improvement over the root on shared units, with the standard error that `searchPosterior` gives it.
342
+ The surface is ordinary kriging with each node's own noise; a grid cell is null where the nodes leave more than half the prior variance unexplained.
343
+ No surface is drawn unless distance predicts score: the fitted length scale must raise the log-likelihood by 1 or more over independent node scores.
344
+ Basins are peaks of the node scores on the 6-nearest-neighbour graph that stand above their saddle by z standard errors.
345
+ z is the Bonferroni normal quantile at 5% over the graph's local maxima, so a flat landscape of noisy nodes counts one basin at least 95% of the time.
346
+ The surface and the basins need 6 nodes that share 2 or more units with the root.
347
+ The signal `plateau` is the rise of the best improvement over the root across the last 6 accepted nodes, divided by that node's standard error.
348
+ An accepted node is screened, dodged no unit, and shares 6 or more units with the root.
349
+ `draftOnPlateau(base, { window, below })` wraps any policy: on every `window`-th expansion, when `plateau` is below `below` (default 1), it drafts from the root; otherwise `base` expands.
350
+ A draft pays off only when `base` expands drafts that trail its leader, as `aide` does; `incumbent` expands only its leader.
351
+ The trigger adds drafts to `aide`'s own; it does not replace them.
352
+ In `scripts/search-sim.ts plateau` (30 seeds, 24 expansions, root lineage capped at 0.62), `draftOnPlateau(aide({ drafts: 0 }))` kept 0.198 less true quality than `aide()` (95% paired bootstrap [−0.230, −0.163]; 25 of 30 seeds worse).
353
+ With the cap removed, the difference was not detectable (−0.012 [−0.049, +0.026]).
354
+
355
+ `skillManifold(state, k?, options?)` factors the node × unit matrix of per-unit means as `b_u + P_i · Q_u` on standardized scores.
356
+ Alternating ridge least squares reads only observed cells; a missing cell is masked, never filled.
357
+ Five-fold cross-validation over held-out cells picks the intrinsic dimension by the one-standard-error rule.
358
+ With fewer than 6 nodes and 6 units the dimension is insufficient, and `k: 'auto'` fits one descriptive axis.
359
+ The signal `nextUnit` names the unit whose next cell removes the largest expected share of the variance of the leaders' contrasts.
360
+ It needs 2 leaders with 6 or more modelled units and a cross-validated cell noise.
361
+ `skillCalibration(lens)` keeps the unit loadings of a fit whose cross-validation found an axis.
362
+ `asha({ extend: nextUnitExtension(calibration) })` fills each rung it opens with the units that best separate the leaders, read from the ledger at the decision that opened the rung.
363
+ The extension is off by default.
364
+
365
+ `agent-eval search show <ledger> --landscape --skill-manifold` prints both lenses as text; `--landscape` reads surface texts from `blobs/` beside the ledger and checks each digest.
366
+ `scripts/search-sim.ts plateau` compares `incumbent` with `draftOnPlateau(incumbent)` by seed, and `scripts/search-sim.ts adaptive` compares `asha` with the extension.
259
367
 
260
368
  ## The claim
261
369
 
@@ -292,6 +400,31 @@ A judge change is a changed `search-opened` header, which `SearchRecorder.open`
292
400
  `compareOptimizationMethods` keeps its own held-out comparison for black-box methods such as GEPA, which return one winner and never see the test split.
293
401
  A method's search ledger closes before the comparison starts, so the comparison cannot add claim cells to it.
294
402
 
403
+ ## A search of searches: `metaSearch` and nested searches
404
+
405
+ `metaSearch(searches, { objective? })` (`@tangle-network/agent-eval/search`) treats each search as one node.
406
+ Its genome is the configuration its ledger records: expansion policy, allocator, budget, proposer and the proposer's model.
407
+ A policy parameter equal to the search's own seed reads `seed=<search>`, so one configuration run on different seeds is one genome.
408
+ Its score is `metaSearchScore(state)`: the claim's held-out lift per known dollar of the whole search.
409
+ The lift is `estimateNode` of the shipped node, or on `hold` of the first finalist the claim fixed before test, against the root on the test split.
410
+ A search that is open, has no claim, cannot resolve its test, held with no finalist tested, pairs fewer than 2 test units, or has a claim its ledger contradicts is unscored with that reason, never 0.
411
+ A search with an unknown-cost cell has only a floor, so its lift per dollar is a bound that enters no estimate.
412
+
413
+ Searches form a forest by derivation (`derivedFrom`) and containment (`containment`).
414
+ Configurations group searches of one genome within one objective.
415
+ A configuration's estimate is the mean over its scored searches with a percentile bootstrap interval, staged like `NodeEstimate.method` by the number of searches; one scored search carries its own paired interval over its test units.
416
+ Every configuration reports how many of its searches were scored.
417
+ The signal `metaSearch.bestPolicyConfiguration` names the configuration with the largest estimate within one objective, with its interval, method, n and coverage; it is a point ranking, not a test.
418
+ `agent-eval search show <ledger> [<ledger> ...] --meta [--objective <key>] [--json]` prints the lens as text, or as JSON with `--json`.
419
+
420
+ `runNestedSearch` runs an outer search whose cells are inner searches, on the same kernel.
421
+ An outer node is a configuration (`runtime-config`), an outer task is a problem, and each outer cell runs one inner search of its node's configuration on its task's problem.
422
+ The inner search records the outer cell attempt as its `containment`, and its id is a digest of that attempt, so a rerun resumes the inner ledger instead of starting again.
423
+ The outer cell scores `metaSearchScore` of the closed inner search, costs what the inner search spent, and binds the inner head hash.
424
+ An inner search without a known lift per dollar settles its cell `errored` and not retryable, so its configuration cannot lead on missing evidence.
425
+ The outer search's judge is `META_SEARCH_SCORE_SOURCE`, and with a test split it claims once, on held-out problems, whether a configuration beats the root configuration.
426
+ `scripts/search-meta-sim.ts` runs one over simulator configurations with no model spend.
427
+
295
428
  ## Ship a search
296
429
 
297
430
  A hosted store (Intelligence, or the reference receiver in `examples/hosted-ingest-server/`) receives a search through the [hosted ingest wire](./hosted-ingest-spec.md).
@@ -337,12 +470,16 @@ Those claims need the sealed test split, the claim's power check, and held-out e
337
470
  - `src/campaign/search-state.ts`: `SearchState`, the invariants and read model, and the id functions.
338
471
  - `src/campaign/estimate-node.ts`: `estimateNode`, `estimateNodeFromCells` and `searchPosterior`.
339
472
  - `src/campaign/search-summary.ts`: `renderSearchSummary` and `searchProposerView`.
473
+ - `src/search/lenses/edit-credit.ts`: `editCredit` and `editCreditText`.
340
474
  - `src/campaign/search-ledger-recording.ts`: `SearchRecorder` and the surface helpers.
341
475
  - `src/campaign/search-kernel.ts`: `runSearch`, the executor, proposer and codec ports, `searchPolicyView` and `searchDivergence`.
342
476
  - `src/campaign/search-claim.ts`: `planSearchClaim`, `decideSearchClaim`, `verifySearchClaim` and `searchClaimReserveUsd`.
343
- - `src/campaign/search-policy.ts`: `SearchPolicy`, `incumbent` and `crowdedFrontierParent`.
477
+ - `src/search/lenses/landscape.ts`, `plateau.ts` and `skill-manifold.ts`: the geometry lenses, the plateau score and the unit extension.
478
+ - `src/campaign/search-policy.ts`: `SearchPolicy`, `incumbent`, `incumbentWithOperatorBandit`, `crowdedFrontierParent`, `aide` and `beam`.
344
479
  - `src/campaign/allocation.ts`: `SearchAllocator`, `uniform` and `asha`.
345
480
  - `src/campaign/presets/run-optimization.ts`: `runOptimization` as a search on the kernel.
346
481
  - `src/campaign/gepa-search-import.ts`: the GEPA population and evaluation importers.
347
482
  - `src/campaign/search-history-receipt.ts`: receipts and admission.
483
+ - `src/search/lenses/meta-search.ts`: `metaSearch`, `metaSearchScore`, `searchPolicyGenome` and `renderMetaSearchText`.
484
+ - `src/search/nested-search.ts`: `runNestedSearch`, `nestedSearchId` and `searchConfigCodec`.
348
485
  - `src/ledger-core/`: hashing, locking, durable appends, chain verification, and the trusted-head pin.
@@ -149,9 +149,7 @@ const result = checkTraceContracts(await store.spans({ runId }), [contract])
149
149
 
150
150
  ## Gate CI on a contract
151
151
 
152
- **Unreleased.** `traces check` lives on `feat/traces-check` in `/traces` (PR #128), proven against this package but not yet mergeable: it needs the traces/agent-runtime redaction-core migration first, so a `/traces` build on this package's contract API does not crash at load. Until then, call `evaluateTraceContract` / `checkTraceContracts` directly, as shown above.
153
-
154
- `traces check` runs a contract over a recorded trace and exits with a code a CI step can read:
152
+ `traces check` (`@tangle-network/traces` 0.16.3+) runs a contract over a recorded trace and exits with a code a CI step can read:
155
153
 
156
154
  ```sh
157
155
  traces check spans.otlp.jsonl --contract refund-desk.contract.json --junit contract.xml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-eval",
3
- "version": "0.197.0",
3
+ "version": "0.198.1",
4
4
  "description": "Evaluate and improve AI agents from runs, traces, judges, and feedback. Compare candidates, cluster failures, measure lift, and gate releases.",
5
5
  "homepage": "https://github.com/tangle-network/agent-eval#readme",
6
6
  "repository": {
@@ -104,6 +104,11 @@
104
104
  "import": "./dist/campaign/index.js",
105
105
  "default": "./dist/campaign/index.js"
106
106
  },
107
+ "./search": {
108
+ "types": "./dist/search/index.d.ts",
109
+ "import": "./dist/search/index.js",
110
+ "default": "./dist/search/index.js"
111
+ },
107
112
  "./ledger-core": {
108
113
  "types": "./dist/ledger-core/index.d.ts",
109
114
  "import": "./dist/ledger-core/index.js",
@@ -1,204 +0,0 @@
1
- import { i as makeRng } from "./internal-BMFSR8Ns.js";
2
- import { n as observedScore } from "./reward-nw2xZGZG.js";
3
- //#region src/rl/active-curriculum.ts
4
- /**
5
- * Adaptive curriculum / active scenario selection.
6
- *
7
- * Fixed scenario sets waste sample budget on cells the policy already
8
- * passes (no information left) and cells the policy never passes (no
9
- * gradient available either). Active learning over scenarios fixes this
10
- * by allocating the next sample budget to cells where the policy's
11
- * outcome is *uncertain* — those carry the most decision-relevant signal.
12
- *
13
- * This module ships two complementary strategies:
14
- *
15
- * 1. **Variance-based** — score each (variant, scenario) cell by the
16
- * empirical variance of past observations. Allocate next-round budget
17
- * proportional to variance. Standard active-learning-by-uncertainty
18
- * heuristic; works well when the policy is non-deterministic and
19
- * cells differ in observation noise.
20
- *
21
- * 2. **Bandit-based (Thompson sampling)** — model each (variant,
22
- * scenario) cell as a Beta-Bernoulli arm; sample a posterior; pick
23
- * cells whose posterior mean is closest to the per-scenario decision
24
- * threshold. The right primitive when scenarios are
25
- * "pass/fail" rather than continuous, and when promotion gates fire
26
- * at a known threshold (e.g., 0.5).
27
- *
28
- * The output is a *next-round budget allocation* — a list of (variant,
29
- * scenario, count) triples. The consumer's matrix runner consumes the
30
- * allocation, runs those cells, feeds the new observations back. Loop.
31
- *
32
- * Out of scope (deliberate): scenario *generation* — that's the
33
- * adversarial primitive's job. This module allocates over an existing
34
- * scenario pool.
35
- */
36
- /**
37
- * Variance-proportional allocation. For each cell, estimate variance from
38
- * past observations + a prior, then allocate the budget proportional to
39
- * (sqrt(variance) + 1/sqrt(n)) — a classical optimal-allocation rule
40
- * (Neyman 1934) that balances "explore noisy cells" with "explore
41
- * under-sampled cells."
42
- */
43
- function varianceBasedCurriculum(observations, candidateCells, opts) {
44
- const variancePrior = opts.variancePrior ?? .05;
45
- const floor = opts.floorPerCell ?? 1;
46
- const budget = opts.budget;
47
- const grouped = /* @__PURE__ */ new Map();
48
- for (const o of observations) {
49
- const k = `${o.variantId}::${o.scenarioId}`;
50
- const arr = grouped.get(k) ?? [];
51
- arr.push(o.score);
52
- grouped.set(k, arr);
53
- }
54
- const cellStats = candidateCells.map((c) => {
55
- const k = `${c.variantId}::${c.scenarioId}`;
56
- const samples = grouped.get(k) ?? [];
57
- const n = samples.length;
58
- const mean = n === 0 ? .5 : samples.reduce((s, v) => s + v, 0) / n;
59
- const variance = n < 2 ? variancePrior : samples.reduce((s, v) => s + (v - mean) ** 2, 0) / (n - 1) + variancePrior;
60
- const weight = Math.sqrt(variance) + 1 / Math.sqrt(Math.max(1, n));
61
- return {
62
- variantId: c.variantId,
63
- scenarioId: c.scenarioId,
64
- n,
65
- mean,
66
- variance,
67
- weight
68
- };
69
- });
70
- const floorTotal = floor * cellStats.length;
71
- if (floorTotal >= budget) {
72
- const each = Math.max(1, Math.floor(budget / Math.max(1, cellStats.length)));
73
- return cellStats.map((c) => ({
74
- variantId: c.variantId,
75
- scenarioId: c.scenarioId,
76
- count: each,
77
- reason: `floor allocation (budget tight; n=${c.n})`
78
- }));
79
- }
80
- const remaining = budget - floorTotal;
81
- const totalWeight = cellStats.reduce((s, c) => s + c.weight, 0);
82
- return cellStats.map((c) => {
83
- const proportional = totalWeight === 0 ? 0 : Math.round(c.weight / totalWeight * remaining);
84
- return {
85
- variantId: c.variantId,
86
- scenarioId: c.scenarioId,
87
- count: floor + proportional,
88
- reason: `variance ${c.variance.toFixed(3)} (n=${c.n}, mean=${c.mean.toFixed(3)})`
89
- };
90
- });
91
- }
92
- /**
93
- * Thompson-sampling-style allocation for pass/fail cells. For each cell:
94
- *
95
- * - Maintain Beta(α + passes, β + failures) posterior on pass-rate
96
- * - Allocation weight ∝ exp(-((sampledMean - threshold) / σ)^2):
97
- * cells whose sampled posterior straddles the decision boundary get
98
- * the most weight; cells already clearly above or below get less.
99
- *
100
- * This is the right primitive when promotion gates fire at a known
101
- * threshold and you want to sharpen the posterior near the boundary.
102
- */
103
- function thompsonCurriculum(observations, candidateCells, opts) {
104
- const threshold = opts.decisionThreshold ?? .5;
105
- const alpha0 = opts.priorAlpha ?? 1;
106
- const beta0 = opts.priorBeta ?? 1;
107
- const rng = makeRng(opts.seed, observations.map((observation) => observation.score));
108
- const grouped = /* @__PURE__ */ new Map();
109
- for (const o of observations) {
110
- const k = `${o.variantId}::${o.scenarioId}`;
111
- const cur = grouped.get(k) ?? {
112
- passes: 0,
113
- failures: 0
114
- };
115
- if (o.pass ?? o.score >= threshold) cur.passes += 1;
116
- else cur.failures += 1;
117
- grouped.set(k, cur);
118
- }
119
- const stats = candidateCells.map((c) => {
120
- const k = `${c.variantId}::${c.scenarioId}`;
121
- const cur = grouped.get(k) ?? {
122
- passes: 0,
123
- failures: 0
124
- };
125
- const a = alpha0 + cur.passes;
126
- const b = beta0 + cur.failures;
127
- const sampled = sampleBeta(a, b, rng);
128
- const distance = Math.abs(sampled - threshold);
129
- const variance = a * b / ((a + b) ** 2 * (a + b + 1));
130
- const sigma = Math.max(.05, Math.sqrt(variance));
131
- const weight = Math.exp(-((distance / sigma) ** 2));
132
- return {
133
- variantId: c.variantId,
134
- scenarioId: c.scenarioId,
135
- n: cur.passes + cur.failures,
136
- sampled,
137
- sigma,
138
- weight,
139
- a,
140
- b
141
- };
142
- });
143
- const totalWeight = stats.reduce((s, c) => s + c.weight, 0);
144
- return stats.map((c) => {
145
- const proportional = totalWeight === 0 ? 0 : Math.round(c.weight / totalWeight * opts.budget);
146
- return {
147
- variantId: c.variantId,
148
- scenarioId: c.scenarioId,
149
- count: Math.max(0, proportional),
150
- reason: `Beta(${c.a.toFixed(1)},${c.b.toFixed(1)}) sample=${c.sampled.toFixed(3)} (target ${threshold})`
151
- };
152
- });
153
- }
154
- /** Convenience: extract `CellObservation[]` directly from `RunRecord[]`. */
155
- function observationsFromRunRecords(runs, opts = {}) {
156
- const threshold = opts.passThreshold ?? .5;
157
- const useHoldout = opts.useHoldout ?? true;
158
- const out = [];
159
- for (const r of runs) {
160
- if (!r.scenarioId) continue;
161
- const score = observedScore(r, useHoldout ? "holdout" : "search");
162
- if (typeof score !== "number" || !Number.isFinite(score)) continue;
163
- out.push({
164
- variantId: r.candidateId,
165
- scenarioId: r.scenarioId,
166
- score,
167
- pass: score >= threshold
168
- });
169
- }
170
- return out;
171
- }
172
- /**
173
- * Sample from Beta(α, β) via the Marsaglia–Tsang method using two Gamma
174
- * variates. Accuracy is good for α, β > 1; we floor the parameters at 1
175
- * to avoid degenerate cases.
176
- */
177
- function sampleBeta(alpha, beta, rng) {
178
- const a = Math.max(1, alpha);
179
- const b = Math.max(1, beta);
180
- const x = sampleGamma(a, rng);
181
- return x / (x + sampleGamma(b, rng));
182
- }
183
- function sampleGamma(shape, rng) {
184
- const d = shape - 1 / 3;
185
- const c = 1 / Math.sqrt(9 * d);
186
- while (true) {
187
- let x;
188
- let v;
189
- do {
190
- const u1 = rng() || 1e-12;
191
- const u2 = rng() || 1e-12;
192
- x = Math.sqrt(-2 * Math.log(u1)) * Math.cos(2 * Math.PI * u2);
193
- v = 1 + c * x;
194
- } while (v <= 0);
195
- v = v * v * v;
196
- const u = rng();
197
- if (u < 1 - .0331 * x ** 4) return d * v;
198
- if (Math.log(u) < .5 * x * x + d * (1 - v + Math.log(v))) return d * v;
199
- }
200
- }
201
- //#endregion
202
- export { thompsonCurriculum as n, varianceBasedCurriculum as r, observationsFromRunRecords as t };
203
-
204
- //# sourceMappingURL=active-curriculum-OjIWgrUJ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"active-curriculum-OjIWgrUJ.js","names":[],"sources":["../src/rl/active-curriculum.ts"],"sourcesContent":["/**\n * Adaptive curriculum / active scenario selection.\n *\n * Fixed scenario sets waste sample budget on cells the policy already\n * passes (no information left) and cells the policy never passes (no\n * gradient available either). Active learning over scenarios fixes this\n * by allocating the next sample budget to cells where the policy's\n * outcome is *uncertain* — those carry the most decision-relevant signal.\n *\n * This module ships two complementary strategies:\n *\n * 1. **Variance-based** — score each (variant, scenario) cell by the\n * empirical variance of past observations. Allocate next-round budget\n * proportional to variance. Standard active-learning-by-uncertainty\n * heuristic; works well when the policy is non-deterministic and\n * cells differ in observation noise.\n *\n * 2. **Bandit-based (Thompson sampling)** — model each (variant,\n * scenario) cell as a Beta-Bernoulli arm; sample a posterior; pick\n * cells whose posterior mean is closest to the per-scenario decision\n * threshold. The right primitive when scenarios are\n * \"pass/fail\" rather than continuous, and when promotion gates fire\n * at a known threshold (e.g., 0.5).\n *\n * The output is a *next-round budget allocation* — a list of (variant,\n * scenario, count) triples. The consumer's matrix runner consumes the\n * allocation, runs those cells, feeds the new observations back. Loop.\n *\n * Out of scope (deliberate): scenario *generation* — that's the\n * adversarial primitive's job. This module allocates over an existing\n * scenario pool.\n */\n\nimport { observedScore } from '../rollout/reward'\nimport type { RunRecord } from '../run-record'\nimport { makeRng } from '../statistics/internal'\n\nexport interface CellObservation {\n variantId: string\n scenarioId: string\n /** Observed score in [0, 1]. */\n score: number\n /** For Bernoulli arms — derive from the score with a threshold if needed. */\n pass?: boolean\n}\n\nexport interface CurriculumAllocation {\n variantId: string\n scenarioId: string\n /** How many additional reps to run on this cell. */\n count: number\n /** Strategy-specific reason for the allocation. */\n reason: string\n}\n\nexport interface VarianceCurriculumOptions {\n /** Total reps to allocate across all cells. */\n budget: number\n /**\n * Smoothing prior on variance — keeps the allocator from concentrating\n * on a cell with one observation just because its 1-sample variance is\n * 0. Default 0.05.\n */\n variancePrior?: number\n /**\n * Minimum reps per cell — even when the variance estimate is low, give\n * every cell at least this many. Default 1.\n */\n floorPerCell?: number\n}\n\n/**\n * Variance-proportional allocation. For each cell, estimate variance from\n * past observations + a prior, then allocate the budget proportional to\n * (sqrt(variance) + 1/sqrt(n)) — a classical optimal-allocation rule\n * (Neyman 1934) that balances \"explore noisy cells\" with \"explore\n * under-sampled cells.\"\n */\nexport function varianceBasedCurriculum(\n observations: CellObservation[],\n candidateCells: Array<{ variantId: string; scenarioId: string }>,\n opts: VarianceCurriculumOptions,\n): CurriculumAllocation[] {\n const variancePrior = opts.variancePrior ?? 0.05\n const floor = opts.floorPerCell ?? 1\n const budget = opts.budget\n\n const grouped = new Map<string, number[]>()\n for (const o of observations) {\n const k = `${o.variantId}::${o.scenarioId}`\n const arr = grouped.get(k) ?? []\n arr.push(o.score)\n grouped.set(k, arr)\n }\n\n const cellStats = candidateCells.map((c) => {\n const k = `${c.variantId}::${c.scenarioId}`\n const samples = grouped.get(k) ?? []\n const n = samples.length\n const mean = n === 0 ? 0.5 : samples.reduce((s, v) => s + v, 0) / n\n const variance =\n n < 2\n ? variancePrior\n : samples.reduce((s, v) => s + (v - mean) ** 2, 0) / (n - 1) + variancePrior\n // Neyman optimal allocation: weight ∝ √variance; add √(1/n) to break\n // ties toward under-sampled cells.\n const weight = Math.sqrt(variance) + 1 / Math.sqrt(Math.max(1, n))\n return { variantId: c.variantId, scenarioId: c.scenarioId, n, mean, variance, weight }\n })\n\n // Reserve floor*N for the floor; allocate the rest proportional to weight.\n const floorTotal = floor * cellStats.length\n if (floorTotal >= budget) {\n const each = Math.max(1, Math.floor(budget / Math.max(1, cellStats.length)))\n return cellStats.map((c) => ({\n variantId: c.variantId,\n scenarioId: c.scenarioId,\n count: each,\n reason: `floor allocation (budget tight; n=${c.n})`,\n }))\n }\n const remaining = budget - floorTotal\n const totalWeight = cellStats.reduce((s, c) => s + c.weight, 0)\n return cellStats.map((c) => {\n const proportional = totalWeight === 0 ? 0 : Math.round((c.weight / totalWeight) * remaining)\n return {\n variantId: c.variantId,\n scenarioId: c.scenarioId,\n count: floor + proportional,\n reason: `variance ${c.variance.toFixed(3)} (n=${c.n}, mean=${c.mean.toFixed(3)})`,\n }\n })\n}\n\nexport interface ThompsonCurriculumOptions {\n budget: number\n /**\n * The per-scenario decision threshold. Cells whose posterior mean is\n * closest to this get the most budget — that's where the next observation\n * has the highest information value for the gate decision. Default 0.5.\n */\n decisionThreshold?: number\n /** Beta prior parameters. Default α=β=1 (uniform). */\n priorAlpha?: number\n priorBeta?: number\n /** Seed the Thompson sampler. Absent, the seed is derived from the observed\n * scores, so the same observations reproduce the same allocation. */\n seed?: number\n}\n\n/**\n * Thompson-sampling-style allocation for pass/fail cells. For each cell:\n *\n * - Maintain Beta(α + passes, β + failures) posterior on pass-rate\n * - Allocation weight ∝ exp(-((sampledMean - threshold) / σ)^2):\n * cells whose sampled posterior straddles the decision boundary get\n * the most weight; cells already clearly above or below get less.\n *\n * This is the right primitive when promotion gates fire at a known\n * threshold and you want to sharpen the posterior near the boundary.\n */\nexport function thompsonCurriculum(\n observations: CellObservation[],\n candidateCells: Array<{ variantId: string; scenarioId: string }>,\n opts: ThompsonCurriculumOptions,\n): CurriculumAllocation[] {\n const threshold = opts.decisionThreshold ?? 0.5\n const alpha0 = opts.priorAlpha ?? 1\n const beta0 = opts.priorBeta ?? 1\n const rng = makeRng(\n opts.seed,\n observations.map((observation) => observation.score),\n )\n\n const grouped = new Map<string, { passes: number; failures: number }>()\n for (const o of observations) {\n const k = `${o.variantId}::${o.scenarioId}`\n const cur = grouped.get(k) ?? { passes: 0, failures: 0 }\n const pass = o.pass ?? o.score >= threshold\n if (pass) cur.passes += 1\n else cur.failures += 1\n grouped.set(k, cur)\n }\n\n const stats = candidateCells.map((c) => {\n const k = `${c.variantId}::${c.scenarioId}`\n const cur = grouped.get(k) ?? { passes: 0, failures: 0 }\n const a = alpha0 + cur.passes\n const b = beta0 + cur.failures\n // Sample a single Beta draw — the Thompson signal.\n const sampled = sampleBeta(a, b, rng)\n const distance = Math.abs(sampled - threshold)\n // Information-near-threshold weight: closer = higher.\n // Use Gaussian-shaped kernel with σ tuned to posterior std.\n const variance = (a * b) / ((a + b) ** 2 * (a + b + 1))\n const sigma = Math.max(0.05, Math.sqrt(variance))\n const weight = Math.exp(-((distance / sigma) ** 2))\n return {\n variantId: c.variantId,\n scenarioId: c.scenarioId,\n n: cur.passes + cur.failures,\n sampled,\n sigma,\n weight,\n a,\n b,\n }\n })\n\n const totalWeight = stats.reduce((s, c) => s + c.weight, 0)\n return stats.map((c) => {\n const proportional = totalWeight === 0 ? 0 : Math.round((c.weight / totalWeight) * opts.budget)\n return {\n variantId: c.variantId,\n scenarioId: c.scenarioId,\n count: Math.max(0, proportional),\n reason: `Beta(${c.a.toFixed(1)},${c.b.toFixed(1)}) sample=${c.sampled.toFixed(3)} (target ${threshold})`,\n }\n })\n}\n\n/** Convenience: extract `CellObservation[]` directly from `RunRecord[]`. */\nexport function observationsFromRunRecords(\n runs: RunRecord[],\n opts: { passThreshold?: number; useHoldout?: boolean } = {},\n): CellObservation[] {\n const threshold = opts.passThreshold ?? 0.5\n const useHoldout = opts.useHoldout ?? true\n const out: CellObservation[] = []\n for (const r of runs) {\n if (!r.scenarioId) continue\n // Ungated on purpose, and the precedence is caller policy, not a default:\n // `useHoldout: false` means \"score this curriculum on the search split when\n // both exist\". This feeds sampling COUNTS, not an exported reward. Known\n // risk: a gamed run's high score inflates the cell's Beta posterior, so the\n // curriculum stops sampling a cell it wrongly believes is solved. The fix\n // for that is an upstream filter on gated records — zeroing the score here\n // would push the posterior the opposite way and be equally wrong.\n const score = observedScore(r, useHoldout ? 'holdout' : 'search')\n if (typeof score !== 'number' || !Number.isFinite(score)) continue\n out.push({\n variantId: r.candidateId,\n scenarioId: r.scenarioId,\n score,\n pass: score >= threshold,\n })\n }\n return out\n}\n\n// ── Helpers ──────────────────────────────────────────────────────────────\n\n/**\n * Sample from Beta(α, β) via the Marsaglia–Tsang method using two Gamma\n * variates. Accuracy is good for α, β > 1; we floor the parameters at 1\n * to avoid degenerate cases.\n */\nfunction sampleBeta(alpha: number, beta: number, rng: () => number): number {\n const a = Math.max(1, alpha)\n const b = Math.max(1, beta)\n const x = sampleGamma(a, rng)\n const y = sampleGamma(b, rng)\n return x / (x + y)\n}\n\nfunction sampleGamma(shape: number, rng: () => number): number {\n // Marsaglia–Tsang for shape ≥ 1.\n const d = shape - 1 / 3\n const c = 1 / Math.sqrt(9 * d)\n while (true) {\n let x: number\n let v: number\n do {\n const u1 = rng() || 1e-12\n const u2 = rng() || 1e-12\n // Box-Muller for a normal sample.\n x = Math.sqrt(-2 * Math.log(u1)) * Math.cos(2 * Math.PI * u2)\n v = 1 + c * x\n } while (v <= 0)\n v = v * v * v\n const u = rng()\n if (u < 1 - 0.0331 * x ** 4) return d * v\n if (Math.log(u) < 0.5 * x * x + d * (1 - v + Math.log(v))) return d * v\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,SAAgB,wBACd,cACA,gBACA,MACwB;CACxB,MAAM,gBAAgB,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