@rulvar/evals 1.180.0 → 1.181.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CompiledWorkflow, DeclaredLadder, Effort, Engine, EvidenceRef, Json, JsonSchema, KnowledgeSnapshot, ModelClaim, ModelKnowledgeStore, ModelRef, ModelSpec, RunOutcome, SchemaSpec, TaskClass, Usage, WireError, Workflow, WorkflowEvent } from "@rulvar/core";
1
+ import { ClaimCoverageGrade, ClaimPair, CompiledWorkflow, ContradictionSource, DeclaredLadder, Effort, Engine, EvidenceRef, Json, JsonSchema, KnowledgeSnapshot, ModelClaim, ModelKnowledgeStore, ModelRef, ModelSpec, RunFactsSheet, RunOutcome, SchemaSpec, TaskClass, Usage, WireError, Workflow, WorkflowEvent } from "@rulvar/core";
2
2
 
3
3
  //#region src/envelope.d.ts
4
4
  /** Thrown when authorizing a run's ceiling would exceed the envelope. */
@@ -837,4 +837,53 @@ declare const FAULT_SCENARIO_NAMES: readonly string[];
837
837
  */
838
838
  declare function runFaultInjection(options?: RunFaultInjectionOptions): Promise<FaultInjectionReport>;
839
839
  //#endregion
840
- export { type BenchmarkFingerprint, type BenchmarkMetricExtractor, type BenchmarkPercentiles, type BenchmarkReport, type BenchmarkRunRecord, type BenchmarkSpec, type BenchmarkVerification, type CanaryDriftReport, type CanaryProbeSet, type CanaryReport, type CanaryRunOptions, type CheckpointArm, type CheckpointCell, type CheckpointLadder, type CheckpointPool, type CheckpointReport, type CriterionOneReport, type CriterionTwoReport, type EvalCase, type EvalCaseResult, type EvalCommitterOptions, EvalJudgeError, type EvalMatrixReport, type EvalSuiteResult, FAULT_SCENARIO_NAMES, type FaultInjectionReport, type FaultScenarioArtifact, type FaultScenarioObservation, type FaultScenarioReport, type GoldenGraderOptions, type Grader, type GraderContext, type GraderVerdict, JUDGE_VERDICT_SCHEMA, type JudgeGraderOptions, type JudgeSpec, type MatrixCell, type MatrixCellReport, type MeasuredClaimInput, type OrchestratedCase, type RubricCriterion, type RubricGraderOptions, type RunBenchmarkOptions, type RunCheckpointOptions, type RunEvalCaseOptions, type RunEvalSuiteOptions, type RunFaultInjectionOptions, type RunSweepOptions, SWEEP_THRESHOLD_DEFAULTS, SpendEnvelope, SweepBudgetError, type SweepCase, type SweepCellReport, type SweepModel, type SweepPool, type SweepReport, type SweepThresholds, agentTypeRuleHolds, canaryFingerprint, commitEvalMeasured, evalMeasuredClaim, flipStaleOnCanaryDrift, goldenGrader, judgeGrader, normalizeCanaryOutput, renderCheckpointReport, rubricGrader, runBenchmark, runCanary, runEvalCase, runEvalMatrix, runEvalSuite, runFaultInjection, runSweepMatrix, runValueCheckpoint, rungRuleHolds };
840
+ //#region src/claim-corpus.d.ts
841
+ /** The failure classes the eighteenth benchmark shipped, plus the bound classes. */
842
+ type ClaimCorpusClass = "live-fact" | "package-identity" | "inverted-default" | "numeric-range" | "negation" | "bounded-coverage";
843
+ /** One adversarial case: a draft, its contradicting evidence, and the mechanical expectations. */
844
+ interface ClaimCorpusCase {
845
+ id: string;
846
+ class: ClaimCorpusClass;
847
+ /** The composed prose committing the falsehood. */
848
+ draft: string;
849
+ /** Settled pool readings that contradict it (source-claim classes). */
850
+ pool?: readonly ContradictionSource[];
851
+ /** The recorded fact sheet that contradicts it (run-claim classes). */
852
+ runFacts?: RunFactsSheet;
853
+ /** Caller-style substring triggers for the run-facts arm. */
854
+ runFactTerms?: readonly string[];
855
+ /** Critical anchor declarations, exactly as a caller would pass them. */
856
+ critical?: readonly string[];
857
+ /** Pair bound override, for the bounded-coverage class. */
858
+ max?: number;
859
+ expect: {
860
+ /** Source-claim pairs the fold must form, at minimum. */minPairs?: number; /** Run-facts pairs the fold must form, at minimum. */
861
+ minRunFactPairs?: number; /** Anchors that must appear among the formed pairs. */
862
+ anchors?: readonly string[]; /** The coverage grade the assembled meta must carry. */
863
+ coverage?: ClaimCoverageGrade;
864
+ };
865
+ }
866
+ /** The shipped corpus, one case per failure class, adversarial by design. */
867
+ declare const CLAIM_CORPUS: readonly ClaimCorpusCase[];
868
+ /** One case's verdict: mechanical expectations against the folds' output. */
869
+ interface ClaimCorpusVerdict {
870
+ id: string;
871
+ class: ClaimCorpusClass;
872
+ pass: boolean;
873
+ /** Every unmet expectation, named; empty exactly when `pass`. */
874
+ failures: string[];
875
+ /** The formed source-claim pairs, for judge handoff. */
876
+ pairs: ClaimPair[];
877
+ /** The formed run-facts pairs, for judge handoff. */
878
+ runFactPairs: ClaimPair[];
879
+ /** The grade the assembled meta carries. */
880
+ coverage: ClaimCoverageGrade;
881
+ }
882
+ /**
883
+ * Runs every corpus case through the pure folds and grades the
884
+ * mechanical expectations. No engine, no model, no journal: the same
885
+ * functions the orchestrator runs, on the same bytes.
886
+ */
887
+ declare function runClaimCorpus(cases?: readonly ClaimCorpusCase[]): ClaimCorpusVerdict[];
888
+ //#endregion
889
+ export { type BenchmarkFingerprint, type BenchmarkMetricExtractor, type BenchmarkPercentiles, type BenchmarkReport, type BenchmarkRunRecord, type BenchmarkSpec, type BenchmarkVerification, CLAIM_CORPUS, type CanaryDriftReport, type CanaryProbeSet, type CanaryReport, type CanaryRunOptions, type CheckpointArm, type CheckpointCell, type CheckpointLadder, type CheckpointPool, type CheckpointReport, type ClaimCorpusCase, type ClaimCorpusClass, type ClaimCorpusVerdict, type CriterionOneReport, type CriterionTwoReport, type EvalCase, type EvalCaseResult, type EvalCommitterOptions, EvalJudgeError, type EvalMatrixReport, type EvalSuiteResult, FAULT_SCENARIO_NAMES, type FaultInjectionReport, type FaultScenarioArtifact, type FaultScenarioObservation, type FaultScenarioReport, type GoldenGraderOptions, type Grader, type GraderContext, type GraderVerdict, JUDGE_VERDICT_SCHEMA, type JudgeGraderOptions, type JudgeSpec, type MatrixCell, type MatrixCellReport, type MeasuredClaimInput, type OrchestratedCase, type RubricCriterion, type RubricGraderOptions, type RunBenchmarkOptions, type RunCheckpointOptions, type RunEvalCaseOptions, type RunEvalSuiteOptions, type RunFaultInjectionOptions, type RunSweepOptions, SWEEP_THRESHOLD_DEFAULTS, SpendEnvelope, SweepBudgetError, type SweepCase, type SweepCellReport, type SweepModel, type SweepPool, type SweepReport, type SweepThresholds, agentTypeRuleHolds, canaryFingerprint, commitEvalMeasured, evalMeasuredClaim, flipStaleOnCanaryDrift, goldenGrader, judgeGrader, normalizeCanaryOutput, renderCheckpointReport, rubricGrader, runBenchmark, runCanary, runClaimCorpus, runEvalCase, runEvalMatrix, runEvalSuite, runFaultInjection, runSweepMatrix, runValueCheckpoint, rungRuleHolds };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from "node:module";
2
- import { ConfigError, InMemoryStore, JsonlFileStore, KnowledgeCasError, LeaseHeldError, SettlementError, SupersededError, claimExpiry, compareRates, compileVerifiedLayer, createEngine, defineWorkflow, hashRunOutput, invoiceFromJournal, journalPricingSnapshot, lastRunSettle, memoryQuotaLimiter, priceComponentsOf } from "@rulvar/core";
2
+ import { ConfigError, InMemoryStore, JsonlFileStore, KnowledgeCasError, LeaseHeldError, SettlementError, SupersededError, claimCoverageOf, claimExpiry, compareRates, compileVerifiedLayer, createEngine, defineWorkflow, hashRunOutput, invoiceFromJournal, journalPricingSnapshot, lastRunSettle, memoryQuotaLimiter, pairDraftClaims, pairRunFactClaims, priceComponentsOf } from "@rulvar/core";
3
3
  import { createHash } from "node:crypto";
4
4
  import { appendFileSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, writeFileSync } from "node:fs";
5
5
  import { tmpdir } from "node:os";
@@ -2649,4 +2649,143 @@ async function runFaultInjection(options) {
2649
2649
  };
2650
2650
  }
2651
2651
  //#endregion
2652
- export { EvalJudgeError, FAULT_SCENARIO_NAMES, JUDGE_VERDICT_SCHEMA, SWEEP_THRESHOLD_DEFAULTS, SpendEnvelope, SweepBudgetError, agentTypeRuleHolds, canaryFingerprint, commitEvalMeasured, evalMeasuredClaim, flipStaleOnCanaryDrift, goldenGrader, judgeGrader, normalizeCanaryOutput, renderCheckpointReport, rubricGrader, runBenchmark, runCanary, runEvalCase, runEvalMatrix, runEvalSuite, runFaultInjection, runSweepMatrix, runValueCheckpoint, rungRuleHolds };
2652
+ //#region src/claim-corpus.ts
2653
+ /** The shipped corpus, one case per failure class, adversarial by design. */
2654
+ const CLAIM_CORPUS = [
2655
+ {
2656
+ id: "live-fact-models-not-run",
2657
+ class: "live-fact",
2658
+ draft: "The analysis stayed strictly offline: real models were not run in this experiment, and no provider traffic was generated at any point of the audit.",
2659
+ runFacts: {
2660
+ text: "The run recorded 125 wire requests across its agents, 6592771 input tokens and 115788 output tokens, all identity-bearing.",
2661
+ ids: ["comparison-run-aug03"],
2662
+ numbers: [
2663
+ 125,
2664
+ 6592771,
2665
+ 115788
2666
+ ]
2667
+ },
2668
+ runFactTerms: ["not run", "no provider traffic"],
2669
+ expect: { minRunFactPairs: 1 }
2670
+ },
2671
+ {
2672
+ id: "package-identity-plan-planner",
2673
+ class: "package-identity",
2674
+ draft: "The @rulvar/plan package is the hybrid that writes workflow scripts before the run (packages/planner/src/plan.ts:1).",
2675
+ pool: [{
2676
+ nodeId: "agent:2",
2677
+ text: "The plan-writing hybrid is @rulvar/planner: the plan agent, compileScript, and the worker sandbox are its exports (packages/planner/src/plan.ts:1-40). The @rulvar/plan package is the PlanRunner orchestration extension and contains no plan agent (packages/plan/src/plan-state.ts:1-30)."
2678
+ }],
2679
+ critical: ["packages/planner/src/plan.ts"],
2680
+ expect: {
2681
+ minPairs: 1,
2682
+ anchors: ["packages/planner/src/plan.ts:1"],
2683
+ coverage: "full"
2684
+ }
2685
+ },
2686
+ {
2687
+ id: "inverted-default-repair-on-load",
2688
+ class: "inverted-default",
2689
+ draft: "Repair on load ships disabled by default, so a torn journal tail stays broken until an operator opts in (packages/core/src/stores/jsonl.ts:123).",
2690
+ pool: [{
2691
+ nodeId: "agent:4",
2692
+ text: "JsonlFileStore repairs a salvageable torn tail on load BY DEFAULT; repairOnLoad: false is the verify-only opt-out for auditors (packages/core/src/stores/jsonl.ts:123-140)."
2693
+ }],
2694
+ expect: {
2695
+ minPairs: 1,
2696
+ anchors: ["packages/core/src/stores/jsonl.ts:123"],
2697
+ coverage: "full"
2698
+ }
2699
+ },
2700
+ {
2701
+ id: "numeric-range-evidence-counts",
2702
+ class: "numeric-range",
2703
+ draft: "Every role preserved 18-20 evidence entries, comfortably inside the declared floor for all six specialists.",
2704
+ runFacts: {
2705
+ text: "Recorded evidence entries per child: 23, 18, 22, 20, 20, 20; six children ok.",
2706
+ ids: ["comparison-run-aug03"],
2707
+ numbers: [
2708
+ 23,
2709
+ 18,
2710
+ 22,
2711
+ 20
2712
+ ]
2713
+ },
2714
+ expect: { minRunFactPairs: 1 }
2715
+ },
2716
+ {
2717
+ id: "negation-synthesis-wires",
2718
+ class: "negation",
2719
+ draft: "No provider requests were dispatched during synthesis; the composition phase performed zero wire calls end to end.",
2720
+ runFacts: {
2721
+ text: "The synthesize role dispatched 2 wire requests totaling 27528 tokens.",
2722
+ ids: ["comparison-run-aug03"],
2723
+ numbers: [27528]
2724
+ },
2725
+ runFactTerms: ["zero wire", "no provider requests"],
2726
+ expect: { minRunFactPairs: 1 }
2727
+ },
2728
+ {
2729
+ id: "bounded-coverage-grades-partial",
2730
+ class: "bounded-coverage",
2731
+ draft: "The executor refuses masked writes (src/exec.ts:10-20). The ledger records every intent (src/ledger.ts:5-9). The outbox settles receipts exactly once per key (src/outbox.ts:30-44).",
2732
+ pool: [
2733
+ {
2734
+ nodeId: "agent:1",
2735
+ text: "The executor admits masked writes when forced (src/exec.ts:12)."
2736
+ },
2737
+ {
2738
+ nodeId: "agent:2",
2739
+ text: "The ledger drops intents over the cap (src/ledger.ts:7)."
2740
+ },
2741
+ {
2742
+ nodeId: "agent:3",
2743
+ text: "The outbox re-settles a duplicate key (src/outbox.ts:35)."
2744
+ }
2745
+ ],
2746
+ max: 1,
2747
+ expect: {
2748
+ minPairs: 1,
2749
+ coverage: "partial"
2750
+ }
2751
+ }
2752
+ ];
2753
+ /**
2754
+ * Runs every corpus case through the pure folds and grades the
2755
+ * mechanical expectations. No engine, no model, no journal: the same
2756
+ * functions the orchestrator runs, on the same bytes.
2757
+ */
2758
+ function runClaimCorpus(cases = CLAIM_CORPUS) {
2759
+ return cases.map((corpusCase) => {
2760
+ const failures = [];
2761
+ const fold = pairDraftClaims(corpusCase.draft, corpusCase.pool ?? [], {
2762
+ ...corpusCase.critical === void 0 ? {} : { critical: corpusCase.critical },
2763
+ ...corpusCase.max === void 0 ? {} : { max: corpusCase.max }
2764
+ });
2765
+ const runFold = corpusCase.runFacts === void 0 ? void 0 : pairRunFactClaims(corpusCase.draft, corpusCase.runFacts, { ...corpusCase.runFactTerms === void 0 ? {} : { terms: corpusCase.runFactTerms } });
2766
+ const expected = corpusCase.expect;
2767
+ if (expected.minPairs !== void 0 && fold.pairs.length < expected.minPairs) failures.push(`formed ${String(fold.pairs.length)} source-claim pair(s), expected at least ` + String(expected.minPairs));
2768
+ const runFactPairs = runFold?.pairs ?? [];
2769
+ if (expected.minRunFactPairs !== void 0 && runFactPairs.length < expected.minRunFactPairs) failures.push(`formed ${String(runFactPairs.length)} run-facts pair(s), expected at least ` + String(expected.minRunFactPairs));
2770
+ for (const anchor of expected.anchors ?? []) if (!fold.pairs.some((pair) => pair.anchor === anchor)) failures.push(`no formed pair carries the expected anchor '${anchor}'`);
2771
+ const coverage = claimCoverageOf({
2772
+ draftCitingSentences: fold.draftCitingSentences,
2773
+ truncated: fold.truncated,
2774
+ coveredCitingSentences: fold.coveredCitingSentences,
2775
+ ...fold.criticalUncoveredTotal === void 0 ? {} : { criticalUncoveredTotal: fold.criticalUncoveredTotal },
2776
+ ...runFold?.truncated === true ? { runFactPairsTruncated: true } : {}
2777
+ });
2778
+ if (expected.coverage !== void 0 && coverage !== expected.coverage) failures.push(`coverage graded '${coverage}', expected '${expected.coverage}'`);
2779
+ return {
2780
+ id: corpusCase.id,
2781
+ class: corpusCase.class,
2782
+ pass: failures.length === 0,
2783
+ failures,
2784
+ pairs: fold.pairs,
2785
+ runFactPairs,
2786
+ coverage
2787
+ };
2788
+ });
2789
+ }
2790
+ //#endregion
2791
+ export { CLAIM_CORPUS, EvalJudgeError, FAULT_SCENARIO_NAMES, JUDGE_VERDICT_SCHEMA, SWEEP_THRESHOLD_DEFAULTS, SpendEnvelope, SweepBudgetError, agentTypeRuleHolds, canaryFingerprint, commitEvalMeasured, evalMeasuredClaim, flipStaleOnCanaryDrift, goldenGrader, judgeGrader, normalizeCanaryOutput, renderCheckpointReport, rubricGrader, runBenchmark, runCanary, runClaimCorpus, runEvalCase, runEvalMatrix, runEvalSuite, runFaultInjection, runSweepMatrix, runValueCheckpoint, rungRuleHolds };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/evals",
3
- "version": "1.180.0",
3
+ "version": "1.181.0",
4
4
  "description": "Rulvar evals: eval cases, golden outputs, rubric and judge graders, matrix sweeps, canary fingerprint.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -22,11 +22,11 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "@rulvar/core": "1.180.0",
26
- "@rulvar/anthropic": "1.180.0",
27
- "@rulvar/openai": "1.180.0",
28
- "@rulvar/plan": "1.180.0",
29
- "@rulvar/testing": "1.180.0"
25
+ "@rulvar/anthropic": "1.181.0",
26
+ "@rulvar/openai": "1.181.0",
27
+ "@rulvar/testing": "1.181.0",
28
+ "@rulvar/plan": "1.181.0",
29
+ "@rulvar/core": "1.181.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^22.20.1",