@tangle-network/agent-eval 1.0.34 → 1.0.36

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 (74) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/adapters/http.d.ts +2 -2
  3. package/dist/analyst/index.d.ts +3 -3
  4. package/dist/app-grade/index.d.ts +2 -2
  5. package/dist/benchmarks/index.d.ts +90 -8
  6. package/dist/benchmarks/index.d.ts.map +1 -1
  7. package/dist/benchmarks/index.js +592 -52
  8. package/dist/benchmarks/index.js.map +1 -1
  9. package/dist/campaign/index.d.ts +5 -5
  10. package/dist/campaign/index.js +5 -5
  11. package/dist/{campaign-BOoc6hc3.js → campaign-CifihyXp.js} +4 -4
  12. package/dist/{campaign-BOoc6hc3.js.map → campaign-CifihyXp.js.map} +1 -1
  13. package/dist/{campaign-evidence-DGTNdS_7.js → campaign-evidence-BPaJAccn.js} +27 -3
  14. package/dist/campaign-evidence-BPaJAccn.js.map +1 -0
  15. package/dist/contract/index.d.ts +8 -8
  16. package/dist/contract/index.js +5 -5
  17. package/dist/{default-registry-2Ziw-0sL.d.ts → default-registry-CfZCJdJT.d.ts} +2 -2
  18. package/dist/{default-registry-2Ziw-0sL.d.ts.map → default-registry-CfZCJdJT.d.ts.map} +1 -1
  19. package/dist/{define-agent-eval-DmCV1TZo.d.ts → define-agent-eval-C4v1f7hM.d.ts} +5 -5
  20. package/dist/{define-agent-eval-DmCV1TZo.d.ts.map → define-agent-eval-C4v1f7hM.d.ts.map} +1 -1
  21. package/dist/{define-agent-eval-Cw0HHdMF.js → define-agent-eval-DkvfaHya.js} +3 -3
  22. package/dist/{define-agent-eval-Cw0HHdMF.js.map → define-agent-eval-DkvfaHya.js.map} +1 -1
  23. package/dist/{evaluation-BQQ2ga5W.d.ts → evaluation-imW3I7tD.d.ts} +2 -2
  24. package/dist/{evaluation-BQQ2ga5W.d.ts.map → evaluation-imW3I7tD.d.ts.map} +1 -1
  25. package/dist/evaluation.d.ts +1 -1
  26. package/dist/experiment/index.d.ts +1 -1
  27. package/dist/experiment/index.js +1 -1
  28. package/dist/{index-8hbrQwdR.d.ts → index-0xdMmIi4.d.ts} +10 -5
  29. package/dist/index-0xdMmIi4.d.ts.map +1 -0
  30. package/dist/{index-BwJtNdaj.d.ts → index-BmtnyRsI.d.ts} +11 -11
  31. package/dist/{index-BwJtNdaj.d.ts.map → index-BmtnyRsI.d.ts.map} +1 -1
  32. package/dist/{index-BnqugnsM.d.ts → index-C8OFP1qj.d.ts} +6 -6
  33. package/dist/{index-BnqugnsM.d.ts.map → index-C8OFP1qj.d.ts.map} +1 -1
  34. package/dist/{index-BFpDeCuS.d.ts → index-CeTno9aO.d.ts} +2 -2
  35. package/dist/{index-BFpDeCuS.d.ts.map → index-CeTno9aO.d.ts.map} +1 -1
  36. package/dist/{index-BfxYoHGF.d.ts → index-_Gwk9sZl.d.ts} +2 -2
  37. package/dist/{index-BfxYoHGF.d.ts.map → index-_Gwk9sZl.d.ts.map} +1 -1
  38. package/dist/index.d.ts +11 -11
  39. package/dist/index.js +4 -156
  40. package/dist/index.js.map +1 -1
  41. package/dist/{llm-judge-DOgWUOml.js → llm-judge-DXygU107.js} +39 -5
  42. package/dist/llm-judge-DXygU107.js.map +1 -0
  43. package/dist/{matrix-D0fEU0fq.d.ts → matrix-Bk8Iz49C.d.ts} +2 -2
  44. package/dist/{matrix-D0fEU0fq.d.ts.map → matrix-Bk8Iz49C.d.ts.map} +1 -1
  45. package/dist/multishot/golden/index.d.ts +1 -1
  46. package/dist/multishot/index.d.ts +2 -2
  47. package/dist/openapi.json +1 -1
  48. package/dist/rl.d.ts +1 -1
  49. package/dist/rollout/index.d.ts +2 -2
  50. package/dist/search/index.d.ts +2 -2
  51. package/dist/{search-kernel-IpyhPDQd.d.ts → search-kernel-BigyOZX3.d.ts} +2 -2
  52. package/dist/{search-kernel-IpyhPDQd.d.ts.map → search-kernel-BigyOZX3.d.ts.map} +1 -1
  53. package/dist/{skillopt-optimization-method-lDHnLno3.js → skillopt-optimization-method-D3xC4hG9.js} +3 -3
  54. package/dist/{skillopt-optimization-method-lDHnLno3.js.map → skillopt-optimization-method-D3xC4hG9.js.map} +1 -1
  55. package/dist/{statistical-heldout-AvgLVFp6.d.ts → statistical-heldout-Bx4q4NUa.d.ts} +4 -2
  56. package/dist/statistical-heldout-Bx4q4NUa.d.ts.map +1 -0
  57. package/dist/{systemone-DPVj7a1g.d.ts → systemone-Dpp7I3uV.d.ts} +3 -3
  58. package/dist/{systemone-DPVj7a1g.d.ts.map → systemone-Dpp7I3uV.d.ts.map} +1 -1
  59. package/dist/systemone.d.ts +2 -2
  60. package/dist/{types-qJwFZTqa.d.ts → types-BeJIREX-.d.ts} +6 -1
  61. package/dist/types-BeJIREX-.d.ts.map +1 -0
  62. package/dist/{types-rf0yhJmW.d.ts → types-ff0YYJnj.d.ts} +69 -3
  63. package/dist/types-ff0YYJnj.d.ts.map +1 -0
  64. package/dist/verification-strategy-CYhDX1rE.js +156 -0
  65. package/dist/verification-strategy-CYhDX1rE.js.map +1 -0
  66. package/dist/wire/index.d.ts +3 -3
  67. package/docs/evaluation-integrity.md +14 -0
  68. package/package.json +1 -1
  69. package/dist/campaign-evidence-DGTNdS_7.js.map +0 -1
  70. package/dist/index-8hbrQwdR.d.ts.map +0 -1
  71. package/dist/llm-judge-DOgWUOml.js.map +0 -1
  72. package/dist/statistical-heldout-AvgLVFp6.d.ts.map +0 -1
  73. package/dist/types-qJwFZTqa.d.ts.map +0 -1
  74. package/dist/types-rf0yhJmW.d.ts.map +0 -1
package/dist/index.js CHANGED
@@ -15,17 +15,18 @@ import { a as welchsTTest, i as iqr, n as checkCanaries, t as analyzeRuns } from
15
15
  import { i as pairedDeltaTest, n as pairedDecisionShape, r as minimumPairsForPairedDeltaTest, t as decidePairedPromotion } from "./paired-promotion-decision-BoWHWL1i.js";
16
16
  import { c as runsForScenario, i as judgeSpans, t as argHash } from "./query-Ck6KhcDo.js";
17
17
  import { n as contentHash, r as fileVerdictCache, t as canonicalJson } from "./verdict-cache-DfzlHLdf.js";
18
- import { $ as runCampaign, B as DEFAULT_RED_TEAM_CORPUS, G as runCanaries, H as redTeamReport, U as scoreRedTeamOutput, V as redTeamDataset, W as Dataset, a as clamp01, i as aggregateRunScore, r as transientDispatchFailure, t as llmJudge } from "./llm-judge-DOgWUOml.js";
18
+ import { B as DEFAULT_RED_TEAM_CORPUS, G as runCanaries, H as redTeamReport, U as scoreRedTeamOutput, V as redTeamDataset, W as Dataset, a as clamp01, et as runCampaign, i as aggregateRunScore, r as transientDispatchFailure, t as llmJudge } from "./llm-judge-DXygU107.js";
19
19
  import { c as costForTokenPricing, d as estimateCost, f as estimateTokens, i as CostCeilingReachedError, l as costForUsage, m as resolveModelPricing, n as CostAccountingIncompleteError, p as isModelPriced, t as CostLedger, u as MODEL_PRICING } from "./cost-ledger-1CwUnVOd.js";
20
- import { C as assertRealBackend, S as BackendIntegrityError, _ as parseReflectionResponse, a as ATTESTATION_ALGORITHM, g as buildReflectionPrompt, o as attest, s as verifyAttestation, w as summarizeBackendIntegrity } from "./campaign-evidence-DGTNdS_7.js";
20
+ import { C as assertRealBackend, S as BackendIntegrityError, _ as parseReflectionResponse, a as ATTESTATION_ALGORITHM, g as buildReflectionPrompt, o as attest, s as verifyAttestation, w as summarizeBackendIntegrity } from "./campaign-evidence-BPaJAccn.js";
21
21
  import { s as surfaceContentHash } from "./json-recovery-b7O9WVTF.js";
22
22
  import { n as paretoFrontier, t as dominates } from "./pareto-LXHRfcP7.js";
23
23
  import { c as redactText, l as shareAllowed, n as REDACTION_VERSION, o as redact, r as assessShareSafety, s as redactForShare } from "./redact-zp_ILC4l.js";
24
24
  import { a as makeProposalFinding, i as makeFinding, r as computeFindingId } from "./types-C8AyaiFi.js";
25
25
  import { n as pairedPromotionPower, r as requiredPairsForPairedPromotion } from "./paired-promotion-power-BXH3gzvs.js";
26
26
  import { a as LlmCallError, i as stripFencedJson, n as isRecord, o as LlmResponseError } from "./json-DtvZNAU9.js";
27
- import { r as selfImprove, t as defineAgentEval } from "./define-agent-eval-Cw0HHdMF.js";
27
+ import { r as selfImprove, t as defineAgentEval } from "./define-agent-eval-DkvfaHya.js";
28
28
  import { n as equivalenceVerdict, t as certificationEvidenceDigest } from "./verdict-CKo1iZkI.js";
29
+ import { a as runEquivalenceCheck, i as defineEquivalenceCheck, n as VERIFICATION_STRATEGIES, r as VERIFICATION_STRATEGY_SOURCES, t as EquivalenceProtocolError } from "./verification-strategy-CYhDX1rE.js";
29
30
  import { c as createBoundedTraceAnalysisStore, p as DEFAULT_TRACE_ANALYST_BUDGETS, t as createTraceAnalyst } from "./kind-factory-BTUq1Byh.js";
30
31
  import { C as assertUniqueFindingIds, D as validateAnalystReviewDecisions, E as snapshotAnalystRun, S as analystRunDigest, T as readAnalystReview, c as FAILURE_MODE_KIND_SPEC, i as DEFAULT_TRACE_ANALYST_KINDS, n as AnalystRegistry, t as buildDefaultAnalystRegistry, w as completedAnalystReviewQuality, x as analystFindingDigest } from "./default-registry-DQQ7hTXJ.js";
31
32
  import { OUTPUT_VALUE } from "./trace-attributes.js";
@@ -266,159 +267,6 @@ function sectionHash(section) {
266
267
  body: section.body
267
268
  }));
268
269
  }
269
- // src/verification-strategy.ts
270
- /**
271
- * The family registry. `Record` over the union keeps it exhaustive: adding
272
- * a member to `VerificationStrategySource` without a profile here fails to
273
- * compile. The failure mode travels with the taxonomy so a reader of a
274
- * certification can surface it without this package's docs at hand.
275
- */
276
- const VERIFICATION_STRATEGIES = {
277
- compile: {
278
- determinism: "deterministic",
279
- failureMode: "code that compiles is not code that is correct"
280
- },
281
- test: {
282
- determinism: "deterministic",
283
- failureMode: "assumes an answer key; certifies nothing outside suite coverage, and a stubbed integration reports green"
284
- },
285
- schema: {
286
- determinism: "deterministic",
287
- failureMode: "shape is not meaning; a well-formed wrong answer passes"
288
- },
289
- sandbox: {
290
- determinism: "deterministic",
291
- failureMode: "an exit code compresses the run to one bit; a faked success exits 0"
292
- },
293
- judge: {
294
- determinism: "probabilistic",
295
- failureMode: "drifts across model versions and is Goodhart-gameable by the graded policy"
296
- },
297
- composite: {
298
- determinism: "inherited",
299
- failureMode: "scalar collapse: the blend hides which member carried the score"
300
- },
301
- "proof-kernel": {
302
- determinism: "deterministic",
303
- failureMode: "the formalization gap: the kernel certifies the formal statement, never that it matches the informal claim"
304
- },
305
- invariant: {
306
- determinism: "deterministic",
307
- failureMode: "weak invariants pass everything; a set uncalibrated by seeded bugs is a rubber stamp"
308
- },
309
- replication: {
310
- determinism: "deterministic",
311
- failureMode: "re-runs the method, so it catches drift and nondeterminism, never an error the method itself carries"
312
- },
313
- agreement: {
314
- determinism: "probabilistic",
315
- failureMode: "the shared blind spot: derivers with common corpora or priors agree for the same wrong reason"
316
- }
317
- };
318
- /** Every family member, derived from the registry so it cannot drift. */
319
- const VERIFICATION_STRATEGY_SOURCES = Object.keys(VERIFICATION_STRATEGIES);
320
- /** A refused equivalence check. `code` names the exact refusal for programmatic handling. */
321
- var EquivalenceProtocolError = class extends Error {
322
- code;
323
- constructor(code, message) {
324
- super(message);
325
- this.name = "EquivalenceProtocolError";
326
- this.code = code;
327
- }
328
- };
329
- /**
330
- * Validate and freeze a two-arm blind equivalence check spec.
331
- *
332
- * The literal types already refuse a wide design at compile time; the
333
- * runtime checks hold the same line for untyped callers. There is no
334
- * escape hatch: `arms: 3` or `blind: false` throws, never downgrades.
335
- */
336
- function defineEquivalenceCheck(spec) {
337
- if (spec.arms !== 2) throw new EquivalenceProtocolError("arm-count", `equivalence check requires exactly 2 arms, received ${String(spec.arms)}`);
338
- if (spec.blind !== true) throw new EquivalenceProtocolError("not-blind", "equivalence check requires blind: true — a non-blind run is not a weaker check, it is no check");
339
- if (typeof spec.artifact !== "string" || spec.artifact.trim() === "") throw new EquivalenceProtocolError("empty-field", "spec.artifact must identify the claim under verification");
340
- if (!VERIFICATION_STRATEGY_SOURCES.includes(spec.source)) throw new EquivalenceProtocolError("unknown-source", `spec.source '${String(spec.source)}' is not a verification-strategy member`);
341
- return Object.freeze({ spec: Object.freeze({ ...spec }) });
342
- }
343
- /**
344
- * Assemble the equivalence record, refusing every asymmetry.
345
- *
346
- * Refusals (each throws `EquivalenceProtocolError`):
347
- * - an arm whose `blindness.toOtherArms` is false — it saw the other
348
- * statement, so nothing was independently derived;
349
- * - an arm whose `blindness.toOutcome` is false — it could steer its
350
- * statement toward (or away from) the known result;
351
- * - duplicate arm ids, empty statements, empty derivations;
352
- * - an obligation whose fields contradict its status (see
353
- * `EquivalenceObligation`).
354
- */
355
- function buildEquivalenceRecord(definition, arms, obligation) {
356
- assertArms(arms);
357
- assertObligation(obligation);
358
- return Object.freeze({
359
- spec: definition.spec,
360
- arms: Object.freeze([Object.freeze({ ...arms[0] }), Object.freeze({ ...arms[1] })]),
361
- obligation: Object.freeze({ ...obligation })
362
- });
363
- }
364
- /**
365
- * Discharge the obligation through an injected checker and return the
366
- * record.
367
- *
368
- * Order matters: every arm refusal fires BEFORE the checker runs — an
369
- * invalid check must not spend. A checker whose `strategy` differs from
370
- * `spec.source` is refused for the same reason: a judge cannot silently
371
- * discharge a proof-kernel obligation.
372
- *
373
- * A checker failure (`succeeded: false`) is not thrown: it becomes an
374
- * `'unresolved'` obligation carrying the full error text, which is the
375
- * honest record of an undischarged check.
376
- */
377
- async function runEquivalenceCheck(definition, arms, checker) {
378
- assertArms(arms);
379
- if (checker.strategy !== definition.spec.source) throw new EquivalenceProtocolError("checker-strategy-mismatch", `spec.source is '${definition.spec.source}' but the bound checker declares '${checker.strategy}'`);
380
- const outcome = await checker.check({
381
- artifact: definition.spec.artifact,
382
- statements: [arms[0].statement, arms[1].statement]
383
- });
384
- if (!outcome.succeeded) return buildEquivalenceRecord(definition, arms, {
385
- status: "unresolved",
386
- unresolvedReason: outcome.error,
387
- checker: checker.identity
388
- });
389
- const { status, separatingWitness, evidenceDigest } = outcome.value;
390
- return buildEquivalenceRecord(definition, arms, {
391
- status,
392
- ...separatingWitness === void 0 ? {} : { separatingWitness },
393
- checker: checker.identity,
394
- evidenceDigest
395
- });
396
- }
397
- function assertArms(arms) {
398
- if (arms.length !== 2) throw new EquivalenceProtocolError("arm-count", `equivalence record requires exactly 2 arms, received ${arms.length}`);
399
- if (arms[0].armId === arms[1].armId) throw new EquivalenceProtocolError("duplicate-arm-id", `both arms declare armId '${arms[0].armId}' — two labels for one derivation is one arm`);
400
- for (const arm of arms) {
401
- if (arm.statement.trim() === "") throw new EquivalenceProtocolError("empty-field", `arm '${arm.armId}' committed an empty statement`);
402
- if (arm.derivedFrom.trim() === "") throw new EquivalenceProtocolError("empty-field", `arm '${arm.armId}' declares no derivation provenance`);
403
- if (arm.blindness.toOtherArms !== true) throw new EquivalenceProtocolError("arm-saw-other", `arm '${arm.armId}' saw another arm's statement — the derivation is not independent and the check is invalid`);
404
- if (arm.blindness.toOutcome !== true) throw new EquivalenceProtocolError("arm-saw-outcome", `arm '${arm.armId}' saw the outcome before committing — the check is invalid`);
405
- }
406
- }
407
- function assertObligation(obligation) {
408
- const { status, separatingWitness, unresolvedReason, evidenceDigest } = obligation;
409
- if (status === "refuted-with-separating-witness") {
410
- if (typeof separatingWitness !== "string" || separatingWitness.trim() === "") throw new EquivalenceProtocolError("witness-missing", "a refuted equivalence must carry the separating witness — a refutation without one is an assertion");
411
- if (typeof evidenceDigest !== "string" || evidenceDigest.trim() === "") throw new EquivalenceProtocolError("evidence-missing", "a refuted equivalence must carry its evidence digest");
412
- return;
413
- }
414
- if (status === "proved") {
415
- if (separatingWitness !== void 0) throw new EquivalenceProtocolError("witness-on-proved", "a proved equivalence cannot carry a separating witness — the two claims contradict");
416
- if (typeof evidenceDigest !== "string" || evidenceDigest.trim() === "") throw new EquivalenceProtocolError("evidence-missing", "a proved equivalence must carry its evidence digest");
417
- return;
418
- }
419
- if (separatingWitness !== void 0) throw new EquivalenceProtocolError("witness-on-unresolved", "an unresolved obligation cannot carry a separating witness — a witness in hand is a refutation");
420
- if (typeof unresolvedReason !== "string" || unresolvedReason.trim() === "") throw new EquivalenceProtocolError("reason-missing", "an unresolved obligation must say why — 'unresolved' with no reason erases the diagnostic");
421
- }
422
270
  // src/budget-guard.ts
423
271
  /**
424
272
  * BudgetGuard — enforces token / wall-clock / call / $ caps, records