@remnic/bench 9.6.24 → 9.6.25

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
@@ -1785,6 +1785,10 @@ interface BenchmarkArtifactJudgeCalibration {
1785
1785
  sourceResultId?: string;
1786
1786
  /** Ordered, bounded task ids that make the pinned calibration slice auditable. */
1787
1787
  sliceQuestionIds?: readonly string[];
1788
+ /** Sanitized full local judge provider configuration hash. */
1789
+ localJudgeConfigHash?: string;
1790
+ /** Sanitized full frontier judge provider configuration hash. */
1791
+ frontierJudgeConfigHash?: string;
1788
1792
  }
1789
1793
  interface BenchmarkArtifactPerTaskScore {
1790
1794
  /** Runner-assigned task ID (stable across reruns). */
@@ -2330,6 +2334,8 @@ declare function createDeterministicSpotCheckLogger(options: {
2330
2334
  declare function zeroScores(): AssistantRubricScores;
2331
2335
  declare function clampScore(value: number): number;
2332
2336
 
2337
+ /** Hash of the exact rubric/prompt surface used by `createProviderBackedJudge`. */
2338
+ declare function getProviderBackedJudgePromptIdentity(config: ProviderFactoryConfig): string;
2333
2339
  interface GatewayResponderOptions {
2334
2340
  gatewayConfig?: GatewayConfig;
2335
2341
  agentId?: string;
@@ -2922,8 +2928,11 @@ interface ResolveBenchRuntimeProfileOptions {
2922
2928
  disableThinking?: boolean;
2923
2929
  /**
2924
2930
  * Path to a local-lab manifest JSON file (issue #1573 PR2). Required when
2925
- * `runtimeProfile: "local-lab"`. The manifest pins responder/judge/embedding
2926
- * to operator-hosted models with temperature=0 and a fixed seed.
2931
+ * `runtimeProfile: "local-lab"`. For other profiles, an explicit manifest
2932
+ * binds the benchmark judge to the manifest's normalized judge config while
2933
+ * leaving the profile's responder unchanged. The manifest pins
2934
+ * provider/model/baseUrl/temperature/seed; runtime options are overlaid by
2935
+ * the same resolver used by `judge-calibrate`.
2927
2936
  */
2928
2937
  localLabManifestPath?: string;
2929
2938
  }
@@ -2949,6 +2958,15 @@ interface ResolvedBenchRuntimeProfile {
2949
2958
  localLab?: ResolvedLocalLabProfile;
2950
2959
  }
2951
2960
  declare function resolveBenchRuntimeProfile(options: ResolveBenchRuntimeProfileOptions): Promise<ResolvedBenchRuntimeProfile>;
2961
+ /**
2962
+ * Resolve the local judge configuration that is shared by calibration and
2963
+ * benchmark execution. Keeping manifest normalization and runtime overlays in
2964
+ * one path prevents the persisted calibration hash from describing a subtly
2965
+ * different judge (for example, a bare Ollama URL without temperature/seed).
2966
+ */
2967
+ declare function resolveLocalLabJudgeProviderConfig(options: Pick<ResolveBenchRuntimeProfileOptions, "requestTimeout" | "max429WaitMs" | "disableThinking"> & {
2968
+ localLabManifestPath: string;
2969
+ }): Promise<ProviderConfig>;
2952
2970
 
2953
2971
  /**
2954
2972
  * Published benchmark registry for @remnic/bench phase 1.
@@ -3998,6 +4016,9 @@ type LoadedJudgeCalibrationState = BenchmarkArtifactJudgeCalibration & Partial<J
3998
4016
  answerSetHash?: string;
3999
4017
  /** Question ids in the pinned calibration slice, in verdict order. */
4000
4018
  sliceQuestionIds?: readonly string[];
4019
+ /** Full sanitized provider configuration hashes bound to this calibration. */
4020
+ localJudgeConfigHash?: string;
4021
+ frontierJudgeConfigHash?: string;
4001
4022
  };
4002
4023
  /**
4003
4024
  * Fixed slice size per benchmark. Issue #1877 raises the calibration target
@@ -4037,6 +4058,17 @@ interface CalibrationVerdictPair {
4037
4058
  localCategory: JudgeCategory;
4038
4059
  frontierCategory: JudgeCategory;
4039
4060
  }
4061
+ declare const JUDGE_CALIBRATION_PROTOCOL_VERSION = "judge-calibration-v3";
4062
+ interface JudgeCalibrationCheckpointProvenance {
4063
+ dir: string;
4064
+ sourceResultId: string;
4065
+ sourceResultSha256: string;
4066
+ orderedQuestionIdsHash: string;
4067
+ localJudgePromptIdentity: string;
4068
+ frontierJudgePromptIdentity: string;
4069
+ localJudgeConfigHash: string;
4070
+ frontierJudgeConfigHash: string;
4071
+ }
4040
4072
  interface RunJudgeCalibrationOptions {
4041
4073
  /** Benchmark id the calibration is scoped to (recorded in the result). */
4042
4074
  benchmarkId: string;
@@ -4052,6 +4084,8 @@ interface RunJudgeCalibrationOptions {
4052
4084
  * binning function so they are compared on the same scale.
4053
4085
  */
4054
4086
  binScore?: (score: number) => JudgeCategory;
4087
+ /** Stable identity of `binScore`; required with a custom mapper and checkpointing. */
4088
+ binningIdentity?: string;
4055
4089
  /** Override the slice size (default 200; mainly for tests). */
4056
4090
  sliceSize?: number;
4057
4091
  /** Override the warning threshold (default 0.7). */
@@ -4064,6 +4098,10 @@ interface RunJudgeCalibrationOptions {
4064
4098
  pinnedQuestionIds?: readonly string[];
4065
4099
  /** Fail before judge calls when the pinned answer payload changed. */
4066
4100
  expectedAnswerSetHash?: string;
4101
+ /** Fail before judge calls when the full source task-id order changed. */
4102
+ expectedOrderedQuestionIdsHash?: string;
4103
+ /** Durable per-judge-side resume state. A mismatch or corrupt file fails closed. */
4104
+ checkpoint?: JudgeCalibrationCheckpointProvenance;
4067
4105
  }
4068
4106
  interface JudgeCalibrationResult extends CohenKappaResult {
4069
4107
  benchmarkId: string;
@@ -4081,6 +4119,14 @@ interface JudgeCalibrationResult extends CohenKappaResult {
4081
4119
  answerSetHash: string;
4082
4120
  /** Per-question verdict pairs, in slice order. */
4083
4121
  verdicts: readonly CalibrationVerdictPair[];
4122
+ /** Execution provenance distinguishes resumed outputs from fresh model calls. */
4123
+ execution: {
4124
+ localJudgeCalls: number;
4125
+ frontierJudgeCalls: number;
4126
+ resumedJudgeOutputs: number;
4127
+ checkpointPath?: string;
4128
+ checkpointContractHash?: string;
4129
+ };
4084
4130
  }
4085
4131
  /**
4086
4132
  * Select the calibration slice from a universe of question ids.
@@ -4102,6 +4148,7 @@ declare function selectCalibrationSlice(questionIds: readonly string[], size?: n
4102
4148
  * subsequent local artifacts' `judgeCalibration.kappa`.
4103
4149
  */
4104
4150
  declare function runJudgeCalibration(options: RunJudgeCalibrationOptions): Promise<JudgeCalibrationResult>;
4151
+ declare function hashOrderedQuestionIds(questionIds: readonly string[]): string;
4105
4152
  /**
4106
4153
  * Persist a calibration result so subsequent local artifacts can carry the
4107
4154
  * kappa (issue #1573 done-when: "a kappa number that lands in subsequent
@@ -4118,6 +4165,8 @@ declare function runJudgeCalibration(options: RunJudgeCalibrationOptions): Promi
4118
4165
  */
4119
4166
  declare function writeJudgeCalibrationState(result: JudgeCalibrationResult, calibrationDir: string, identities?: JudgeCalibrationIdentities, provenance?: {
4120
4167
  sourceResultId: string;
4168
+ localJudgeConfigHash?: string;
4169
+ frontierJudgeConfigHash?: string;
4121
4170
  }): Promise<string>;
4122
4171
  /**
4123
4172
  * Load a previously persisted calibration result for a benchmark. Returns
@@ -5251,4 +5300,4 @@ declare function checkCodingGraphRegression(report: CodingGraphBenchReport, base
5251
5300
  */
5252
5301
  declare function buildBaselineFromReport(report: CodingGraphBenchReport, note: string): CodingGraphBaseline;
5253
5302
 
5254
- export { AMA_BENCH_DIAGNOSTIC_VARIANTS, ASSISTANT_AGENT_CONFIG_KEY, ASSISTANT_JUDGE_CONFIG_KEY, ASSISTANT_MEETING_PREP_SCENARIOS, ASSISTANT_MEETING_PREP_SMOKE_SCENARIOS, ASSISTANT_MORNING_BRIEF_SCENARIOS, ASSISTANT_MORNING_BRIEF_SMOKE_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SMOKE_SCENARIOS, ASSISTANT_RUBRIC_DIMENSIONS, ASSISTANT_RUBRIC_ID_KEY, ASSISTANT_SEEDS_CONFIG_KEY, ASSISTANT_SPOT_CHECK_DIR_KEY, ASSISTANT_SYNTHESIS_SCENARIOS, ASSISTANT_SYNTHESIS_SMOKE_SCENARIOS, type AblationConfigOverrides, type AbstentionRetrievalCase, type AggregateMetrics, type AmaBenchDiagnosticAdapterOptions, type AmaBenchDiagnosticAnswererMode, type AmaBenchDiagnosticBreakdown, type AmaBenchDiagnosticMatrixArtifact, type AmaBenchDiagnosticRecallMode, type AmaBenchDiagnosticRunContext, type AmaBenchDiagnosticTaskEvidence, type AmaBenchDiagnosticTaskRow, type AmaBenchDiagnosticVariant, type AmaBenchDiagnosticVariantSummary, type AnthropicProviderConfig, type AssistantAgent, type AssistantMemoryFact, type AssistantMemoryGraph, type AssistantRubricDimension, type AssistantRubricRequest, type AssistantRubricScores, type AssistantRunnerOptions, type AssistantScenario, type AssistantStance, type AttackRecallOptions, type AttackRetrievalHit, type AttackerMode, BENCHMARK_ARTIFACT_SCHEMA_VERSION, BENCHMARK_INTEGRITY_META_SCHEMA, BENCHMARK_REPRO_MANIFEST_FILENAME, BENCHMARK_REPRO_MANIFEST_SCHEMA_VERSION, BENCHMARK_RESULT_SCHEMA, BENCHMARK_SPLIT_TYPES, type BaselineRow, type BaselineScenario, type BeamDatasetPreview, type BenchConfig, type BenchJudge, type BenchJudgeResult, type BenchMemoryAdapter, type BenchModelSource, type BenchReasoningEffort, type BenchRecallOptions, type BenchRecallSupportAssessment, type BenchRecallSupportRequest, type BenchRecallSupportStatus, type BenchResponder, type BenchResponse, type BenchRuntimeProfile, type BenchTier, type BenchmarkArtifact, type BenchmarkArtifactEnvironment, type BenchmarkArtifactHardware, type BenchmarkArtifactJudgeCalibration, type BenchmarkArtifactPerTaskScore, type BenchmarkArtifactSystem, type BenchmarkArtifactTier, type BenchmarkCategory, type BenchmarkDefinition, type BenchmarkIntegrityMeta, type BenchmarkMeta, type BenchmarkMode, type BenchmarkReport, type BenchmarkReproManifest, type BenchmarkReproManifestDataset, type BenchmarkReproManifestFile, type BenchmarkReproManifestResult, type BenchmarkResult, type BenchmarkSplitType, type BenchmarkStatus, type BenchmarkSuiteResult, type BenchmarkTier, type BootstrapKappaOptions, type BootstrapKappaResult, type BuildBenchmarkArtifactInput, type BuildBenchmarkPublishFeedOptions, type BuildBenchmarkReproManifestOptions, type BuiltInProvider, CALIBRATION_SLICE_SIZE, CANARY_FIXED_RECALL, CANARY_SCORE_FLOOR, DEFAULT_10K_FIXTURE as CODING_GRAPH_10K_FIXTURE, CODING_GRAPH_BENCH_SCHEMA_VERSION, DEFAULT_TOLERANCE_PERCENT as CODING_GRAPH_DEFAULT_TOLERANCE, MIN_ITERATIONS as CODING_GRAPH_MIN_ITERATIONS, DEFAULT_SMOKE_FIXTURE as CODING_GRAPH_SMOKE_FIXTURE, type CalibrationAnswer, type CalibrationVerdictPair, type CanaryAdapterOptions, type CanaryFloorCheck, type ClaudeCliProviderConfig, type CodexCliProviderConfig, type CodexCreditReceipt, type CodexCreditReceiptScope, type CodexCreditReconciliationReceipt, type CodingGraphBaseline, type CodingGraphBenchConfig, type CodingGraphBenchReport, type MachineFingerprint as CodingGraphMachineFingerprint, type CodingGraphMetricKey, type RegressionMetricDetail as CodingGraphRegressionDetail, type RegressionMetricKey as CodingGraphRegressionKey, type RegressionGateResult as CodingGraphRegressionResult, type CohenKappaResult, type ComparisonMetricDelta, type ComparisonResult, type CompletionOpts, type CompletionResult, type ConfidenceInterval, type ContaminationCheckResult, type ContaminationEntry, type ContaminationManifest, type CustomBenchmarkScoring, type CustomBenchmarkSpec, type CustomBenchmarkTask, DEFAULT_ABLATION_BENCHMARK, DEFAULT_ABLATION_BOOTSTRAP_SEED, DEFAULT_ASSISTANT_RUBRIC_ID, DEFAULT_BASELINE_SCENARIOS, DEFAULT_JUDGE_BINARIZATION_THRESHOLD, DEFAULT_KAPPA_BOOTSTRAP_SAMPLES, DEFAULT_KAPPA_CONFIDENCE_LEVEL, DEFAULT_OPENAI_RESPONSES_JUDGE_MODEL, type DatasetSource, type DiagnoseLoComoProfileDeltaOptions, type DiagnoseLoComoRecallDeltaOptions, type DiscoveredModel, EMPTY_CONTAMINATION_MANIFEST, type EffectSizeInterpretation, type EffectSizeSummary, type ExplainResult, type ExtractedEntity, type ExtractedLink, type ExtractedPage, type ExtractionAttackOptions, type ExtractionAttackResult, type ExtractionAttackTarget, type FixtureGenerator, type FixtureOutput, type FixtureVariant, GENERAL_ANSWER_JUDGE_RUBRIC, type GeneratedFile, type GeneratedRepo, type GoldEntity, type GoldEntityType, type GoldGraph, type GoldLink, type GoldPage, type HarnessRng, INTEGRITY_CIPHER_ALGORITHM, INTEGRITY_HASH_ALGORITHM, INTEGRITY_META_FIELDS, type IngestionBenchAdapter, type IngestionLog, JUDGE_CALIBRATION_KAPPA_THRESHOLD, type JudgeCalibrationIdentities, type JudgeCalibrationResult, type JudgeCategory, type KappaConfidenceInterval, LOCAL_LAB_PROVIDER_KINDS, LOCOMO_DATASET_FILENAMES, LOCOMO_FULL_TASK_COUNT, LOCOMO_RECALL_DIFF_LINE_LIMIT, LOCOMO_RECALL_EXCERPT_CHARS, LONG_MEM_EVAL_DATASET_FILENAMES, type LeaderboardArtifactWrite, type LettaAdapterConfig, LettaMemCorrectAdapter, type LlmJudge, type LlmProvider, type LoComoCategoryDelta, type LoComoFinalContextRegression, type LoComoMetricDelta, type LoComoProfileArtifactEvidence, type LoComoProfileDeltaReport, type LoComoRawResultEvidence, type LoComoRecallCategoryDelta, type LoComoRecallContextSummary, type LoComoRecallDeltaReport, type LoComoRecallLineDelta, type LoComoRecallLineEvidence, type LoComoRecallMetricDelta, type LoComoRecallResultProvenance, type LoComoRecallTextDigest, type LoComoTaskRegression, type LoadDatasetOptions, type LoadSealedQrelsOptions, type LoadedDataset, type LoadedJudgeCalibrationState, type LocalLabManifest, type LocalLabManifestNotes, type LocalLabPhase, type LocalLabPhaseDescriptor, type LocalLabPhaseExecute, type LocalLabPhaseName, type LocalLabPhaseOutcome, LocalLabPreflightError, type LocalLabPreflightFailure, type LocalLabPreflightInput, type LocalLabPreflightOptions, type LocalLabPreflightResult, type LocalLabPreflightSuccess, type LocalLabProviderKind, type LocalLabRoleConfig, type LocalLlmProviderConfig, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC_VERSION, MEMCORRECT_STALE_HARM_RUBRIC, MEMCORRECT_STALE_HARM_RUBRIC_VERSION, MEMORY_EVAL_DIMENSIONS, MEMORY_EVAL_PUBLIC_LINE, MIN_CALIBRATION_SOURCE_TASKS, MITIGATED_BASELINE_SCENARIOS, type McpArgumentSemantic, type McpBackendErrorCode, type McpBackendResult, type McpBenchMemoryAdapter, type McpConformanceResult, type McpHttpTransportConfig, type McpListedTool, type McpMemCorrectAdapter, type McpMemoryAdapterOptions, McpMemoryBackendError, type McpMemoryToolMapping, type McpMemoryTransportConfig, type McpStdioTransportConfig, type McpToolCallResult, type McpToolClient, type McpToolMappingEntry, type McpToolMappingValue, type McpToolOperation, type Mem0AdapterConfig, Mem0MemCorrectAdapter, type MemCorrectGeneratorOptions, type MemCorrectJudgeRequest, type MemCorrectJudgeResult, type MemCorrectSystemAdapter, type MemoryEvalCategory, type MemoryEvalDimension, type MemoryEvalDimensionId, type MemoryEvalMetric, type MemoryGraph, type MemoryStats, type MemorySystem, type Message, type MetricAggregate, type MicroMetric, MissingCredentialError, type MitigatedBaselineConfig, type MitigatedTargetConfig, type MultipleChoiceQuestion, OPENAI_RESPONSES_JUDGE_RUBRIC_VERSION, OTHER_NAMESPACE_MEMORIES, type OllamaProviderConfig, type OpenAiCompatibleProviderConfig, OpenAiResponsesJudgeError, type OpenAiResponsesJudgeErrorCode, type OpenAiResponsesJudgeTelemetry, OpenAiResponsesProvider, type OpenAiResponsesProviderConfig, type OpenAiResponsesVerdict, type OpenAiResponsesVerdictResult, PROCEDURAL_REAL_SCENARIOS, PROCEDURAL_REAL_SCENARIOS_SMOKE, PUBLISHED_BENCHMARK_ARTIFACT_IDS, type PersonalizationRetrievalCase, type PreflightDiscoveredModel, type ProceduralAblationArtifact, type ProceduralAblationPerCase, type ProceduralAblationScenario, type ProceduralRealScenario, type ProceduralRealScenarioCategory, type ProviderBaseConfig, type ProviderConfig, type ProviderDiscoveryResult, type ProviderFactoryConfig, type PublishSkipReason, type PublishSkipRecord, type PublishedBenchmarkFeed, type PublishedBenchmarkFeedEntry, type PublishedBenchmarkId, REQUIRED_FRONTMATTER_FIELDS, type RecallMetrics, type RecoveredMemory, type RegressionDetail, type RegressionGateResult$1 as RegressionGateResult, type RemnicAdapterOptions, type ReportCardProvenanceContext, type ResolveBenchRuntimeProfileOptions, type ResolvedBenchRuntimeProfile, type ResolvedLocalLabProfile, type ResolvedLocalLabRole, type ResolvedRunBenchmarkOptions, type RotatedChoices, type RunBenchmarkOptions, type RunJudgeCalibrationOptions, type RunProceduralAblationCliArgs, type RunProceduralAblationOptions, type RunSequentialPhasesOptions, SCHEMA_TIER_FIXTURE, SCHEMA_TIER_SMOKE_FIXTURE, SEALED_PROMPT_REGISTRY, SINGLE_FLAG_ABLATION_MATRIX, SYNTHETIC_MEMORIES, type SanitizedDiagnosticProvider, type SavedBaseline, type SchemaTierCorpus, type SchemaTierFixture, type SchemaTierName, type SchemaTierPage, type SchemaTierPageFrontmatter, type SealedArtifact, type SealedJudgeDecision, type SealedJudgeInput, type SealedQrelsArtifact, type SealedQrelsHandle, type SealedRubric, type SearchResult, type SeededMemory, type SeededRng, type SequentialPhaseHooks, type SingleFlagAblationCell, type SingleFlagAblationId, type SpotCheckLogger, type StatisticalReport, type StructuredJudge, StructuredJudgeError, type StructuredJudgeErrorCode, type StructuredJudgeProvider, type StructuredJudgeTelemetry, type StructuredJudgeVerdict, type StructuredJudgeVerdictResult, type StructuredVerdictRequest, type SyntheticEdge, type SyntheticEmailIngestionAdapterOptions, type SyntheticFileIR, type SyntheticRepoConfig, type SyntheticSymbol, type SyntheticTargetOptions, type TaskResult, type TaskTokenUsage, type TemporalRetrievalCase, type ThirdPartyAdapterConfig, type TierDetail, type TimelineEntry, type TokenUsage, type WallMetric, type WriteBenchmarkArtifactResult, type ZepAdapterConfig, ZepMemCorrectAdapter, addContaminationEntry, aggregateTaskScores, answerBenchmarkQuestion, assertCanaryUnderFloor, assertIntegrityMetaPresent, assertPublishableIntegrity, assertSha256Hex, assistantMeetingPrepDefinition, assistantMorningBriefDefinition, assistantNextBestActionDefinition, assistantSynthesisDefinition, backlinkF1, binarizeJudgeScore, bootstrapCohensKappaConfidenceInterval, bootstrapMeanConfidenceInterval, buildAmaBenchDiagnosticMatrixArtifact, buildAmaBenchDiagnosticVariantSummary, buildAmaBenchLeaderboardRows, buildBaselineFromReport, buildBenchmarkArtifact, buildBenchmarkArtifactFilename, buildBenchmarkPublishFeed, buildBenchmarkReproManifest, buildBenchmarkRunSeeds, buildCodexCreditReceipt, buildJudgePayload, buildOracleTrajectoryRecall, buildSchemaTierFixture, buildSchemaTierSmokeFixture, calendarFixture, canonicalJsonStringify, captureMachineFingerprint, chatFixture, checkCodingGraphRegression, checkDatasetContamination, checkRegression, clampScore, cohensD, compareResults, computeCohensKappa, computeSealHash, containsAnswer, createSeededRng$1 as createAdamSeededRng, createAmaBenchDiagnosticAdapter, createAnthropicProvider, createCanaryAdapter, createClaudeCliProvider, createCodexCliProvider, createSeededRng as createCodingGraphSeededRng, createDeterministicSpotCheckLogger, createGatewayResponder, createLightweightAdapter, createLiteLlmProvider, createLocalLlmProvider, createMcpDemoMemCorrectAdapter, createMcpDemoMemoryAdapter, createMcpMemCorrectAdapter, createMcpMemoryAdapter, createMitigatedTarget, createOllamaProvider, createOpenAiCompatibleProvider, createOpenAiResponsesBenchJudge, createOpenAiResponsesProvider, createSeededRandom as createProceduralAblationSeededRandom, createProvider, createProviderBackedAmaBenchRecommendedJudge, createProviderBackedJudge, createProviderBackedResponder, createProviderBackedStructuredJudge, createRemnicAdapter, createResponderFromProvider, createSeededRng$2 as createSeededRng, createSpotCheckFileLogger, createStructuredBenchJudge, createStructuredJudgeFromProvider, createSyntheticEmailIngestionAdapter, createSyntheticTarget, createTimeoutGuardedAdapter, defaultBenchmarkBaselineDir, defaultBenchmarkPublishPath, deleteBenchmarkResults, diagnoseLoComoProfileDelta, diagnoseLoComoRecallDelta, discoverAllProviders, discoveryEndpointFor, emailFixture, entityRecall, exactMatch, extractMetrics as extractCodingGraphMetrics, extractMarkdownSectionsByTitle, f1Score, fixtureToAblationScenarios, formatHandoffNote, formatMissingDatasetError, generateReport, generateSyntheticRepo, getAblationCell, getBenchmark, getBenchmarkLowerIsBetter, getMemoryEvalDimension, getRemnicVersion, hashBenchmarkArtifact, hashBytes, hashCanonicalJson, hashString, integrityMetaIsComplete, interpretEffectSize, isAmaBenchUnknownLikeAnswer, isContaminationEntry, isContaminationManifest, isSealedQrelsArtifact, isSha256Hex, isStructuredJudgeProvider, judgeMemCorrectCorrectionAcceptance, judgeMemCorrectStaleMemoryHarm, linkMatches, listBenchmarkBaselines, listBenchmarkResults, listBenchmarks, listMemoryEvalBenchmarkIds, listMemoryEvalDimensions, llmJudgeScore, llmJudgeScoreDetailed, loadAblationFixture, loadBaseline, loadBeamDatasetPreview, loadBenchmarkArtifact, loadBenchmarkBaseline, loadBenchmarkReportCardProvenance, loadBenchmarkResult, loadCustomBenchmarkFile, loadJudgeCalibrationState, loadLoCoMo10, loadLocalLabManifest, loadLongMemEvalS, loadSealKeyFromEnv, loadSealedQrels, loadSealedRubric, matchEntity, mergeContaminationManifests, openSeal, orchestrateBenchmarkRuns, pairedDeltaConfidenceInterval, parseBenchmarkArtifact, parseCustomBenchmark, parseLocalLabManifest, parseRubricResponse, parseSealedQrels, pickStableQualifiedName, precisionAtK, preflightLocalLabRole, projectFolderFixture, recallAtK, reconcileCodexCreditLedger, redactBenchmarkResultSecrets, renderBaselineMarkdown, renderBenchmarkResultExport, renderLoComoProfileDeltaMarkdown, renderLoComoRecallDeltaMarkdown, renderMemorySummaryForJudge, renderMemoryViewForAgent, resolveAssistantAgent, resolveAssistantRubricId, resolveAssistantSeeds, resolveAssistantSpotCheckDir, resolveBenchRuntimeProfile, resolveBenchmarkPhaseTimeoutMs, resolveBenchmarkProgressLogging, resolveBenchmarkResultReference, resolveBenchmarkRunCount, resolveLocalLabProfile, resolveLocalLabRole, resolveStructuredJudge, rotateDistractors, rougeL, runAssistantBenchmark, runAssistantMeetingPrepBenchmark, runAssistantMorningBriefBenchmark, runAssistantNextBestActionBenchmark, runAssistantSynthesisBenchmark, runBaseline, runBenchSuite, runBenchmark, runCodingGraphBenchmark, runCustomBenchmarkFile, runExplain, runExtractionAttack, runJudgeCalibration, runMitigatedBaseline, runProceduralAblation, runProceduralAblationCli, runSealedJudge, runSequentialPhases, safeHexEqual, sanitizeLoComoResultReference, saveBaseline, saveBenchmarkBaseline, schemaCompleteness, sealPayload, selectAmaBenchDiagnosticVariants, selectCalibrationSlice, selectFixtureVariant, serializeBenchmarkArtifact, serializeJsonl, serializeSealedQrels, shuffleTasks, timed, verifyRubricDigest, writeBenchmarkArtifact, writeBenchmarkPublishFeed, writeBenchmarkReproManifest, writeBenchmarkResult, writeJudgeCalibrationState, writeLeaderboardArtifactsForResult, zeroScores };
5303
+ export { AMA_BENCH_DIAGNOSTIC_VARIANTS, ASSISTANT_AGENT_CONFIG_KEY, ASSISTANT_JUDGE_CONFIG_KEY, ASSISTANT_MEETING_PREP_SCENARIOS, ASSISTANT_MEETING_PREP_SMOKE_SCENARIOS, ASSISTANT_MORNING_BRIEF_SCENARIOS, ASSISTANT_MORNING_BRIEF_SMOKE_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SCENARIOS, ASSISTANT_NEXT_BEST_ACTION_SMOKE_SCENARIOS, ASSISTANT_RUBRIC_DIMENSIONS, ASSISTANT_RUBRIC_ID_KEY, ASSISTANT_SEEDS_CONFIG_KEY, ASSISTANT_SPOT_CHECK_DIR_KEY, ASSISTANT_SYNTHESIS_SCENARIOS, ASSISTANT_SYNTHESIS_SMOKE_SCENARIOS, type AblationConfigOverrides, type AbstentionRetrievalCase, type AggregateMetrics, type AmaBenchDiagnosticAdapterOptions, type AmaBenchDiagnosticAnswererMode, type AmaBenchDiagnosticBreakdown, type AmaBenchDiagnosticMatrixArtifact, type AmaBenchDiagnosticRecallMode, type AmaBenchDiagnosticRunContext, type AmaBenchDiagnosticTaskEvidence, type AmaBenchDiagnosticTaskRow, type AmaBenchDiagnosticVariant, type AmaBenchDiagnosticVariantSummary, type AnthropicProviderConfig, type AssistantAgent, type AssistantMemoryFact, type AssistantMemoryGraph, type AssistantRubricDimension, type AssistantRubricRequest, type AssistantRubricScores, type AssistantRunnerOptions, type AssistantScenario, type AssistantStance, type AttackRecallOptions, type AttackRetrievalHit, type AttackerMode, BENCHMARK_ARTIFACT_SCHEMA_VERSION, BENCHMARK_INTEGRITY_META_SCHEMA, BENCHMARK_REPRO_MANIFEST_FILENAME, BENCHMARK_REPRO_MANIFEST_SCHEMA_VERSION, BENCHMARK_RESULT_SCHEMA, BENCHMARK_SPLIT_TYPES, type BaselineRow, type BaselineScenario, type BeamDatasetPreview, type BenchConfig, type BenchJudge, type BenchJudgeResult, type BenchMemoryAdapter, type BenchModelSource, type BenchReasoningEffort, type BenchRecallOptions, type BenchRecallSupportAssessment, type BenchRecallSupportRequest, type BenchRecallSupportStatus, type BenchResponder, type BenchResponse, type BenchRuntimeProfile, type BenchTier, type BenchmarkArtifact, type BenchmarkArtifactEnvironment, type BenchmarkArtifactHardware, type BenchmarkArtifactJudgeCalibration, type BenchmarkArtifactPerTaskScore, type BenchmarkArtifactSystem, type BenchmarkArtifactTier, type BenchmarkCategory, type BenchmarkDefinition, type BenchmarkIntegrityMeta, type BenchmarkMeta, type BenchmarkMode, type BenchmarkReport, type BenchmarkReproManifest, type BenchmarkReproManifestDataset, type BenchmarkReproManifestFile, type BenchmarkReproManifestResult, type BenchmarkResult, type BenchmarkSplitType, type BenchmarkStatus, type BenchmarkSuiteResult, type BenchmarkTier, type BootstrapKappaOptions, type BootstrapKappaResult, type BuildBenchmarkArtifactInput, type BuildBenchmarkPublishFeedOptions, type BuildBenchmarkReproManifestOptions, type BuiltInProvider, CALIBRATION_SLICE_SIZE, CANARY_FIXED_RECALL, CANARY_SCORE_FLOOR, DEFAULT_10K_FIXTURE as CODING_GRAPH_10K_FIXTURE, CODING_GRAPH_BENCH_SCHEMA_VERSION, DEFAULT_TOLERANCE_PERCENT as CODING_GRAPH_DEFAULT_TOLERANCE, MIN_ITERATIONS as CODING_GRAPH_MIN_ITERATIONS, DEFAULT_SMOKE_FIXTURE as CODING_GRAPH_SMOKE_FIXTURE, type CalibrationAnswer, type CalibrationVerdictPair, type CanaryAdapterOptions, type CanaryFloorCheck, type ClaudeCliProviderConfig, type CodexCliProviderConfig, type CodexCreditReceipt, type CodexCreditReceiptScope, type CodexCreditReconciliationReceipt, type CodingGraphBaseline, type CodingGraphBenchConfig, type CodingGraphBenchReport, type MachineFingerprint as CodingGraphMachineFingerprint, type CodingGraphMetricKey, type RegressionMetricDetail as CodingGraphRegressionDetail, type RegressionMetricKey as CodingGraphRegressionKey, type RegressionGateResult as CodingGraphRegressionResult, type CohenKappaResult, type ComparisonMetricDelta, type ComparisonResult, type CompletionOpts, type CompletionResult, type ConfidenceInterval, type ContaminationCheckResult, type ContaminationEntry, type ContaminationManifest, type CustomBenchmarkScoring, type CustomBenchmarkSpec, type CustomBenchmarkTask, DEFAULT_ABLATION_BENCHMARK, DEFAULT_ABLATION_BOOTSTRAP_SEED, DEFAULT_ASSISTANT_RUBRIC_ID, DEFAULT_BASELINE_SCENARIOS, DEFAULT_JUDGE_BINARIZATION_THRESHOLD, DEFAULT_KAPPA_BOOTSTRAP_SAMPLES, DEFAULT_KAPPA_CONFIDENCE_LEVEL, DEFAULT_OPENAI_RESPONSES_JUDGE_MODEL, type DatasetSource, type DiagnoseLoComoProfileDeltaOptions, type DiagnoseLoComoRecallDeltaOptions, type DiscoveredModel, EMPTY_CONTAMINATION_MANIFEST, type EffectSizeInterpretation, type EffectSizeSummary, type ExplainResult, type ExtractedEntity, type ExtractedLink, type ExtractedPage, type ExtractionAttackOptions, type ExtractionAttackResult, type ExtractionAttackTarget, type FixtureGenerator, type FixtureOutput, type FixtureVariant, GENERAL_ANSWER_JUDGE_RUBRIC, type GeneratedFile, type GeneratedRepo, type GoldEntity, type GoldEntityType, type GoldGraph, type GoldLink, type GoldPage, type HarnessRng, INTEGRITY_CIPHER_ALGORITHM, INTEGRITY_HASH_ALGORITHM, INTEGRITY_META_FIELDS, type IngestionBenchAdapter, type IngestionLog, JUDGE_CALIBRATION_KAPPA_THRESHOLD, JUDGE_CALIBRATION_PROTOCOL_VERSION, type JudgeCalibrationCheckpointProvenance, type JudgeCalibrationIdentities, type JudgeCalibrationResult, type JudgeCategory, type KappaConfidenceInterval, LOCAL_LAB_PROVIDER_KINDS, LOCOMO_DATASET_FILENAMES, LOCOMO_FULL_TASK_COUNT, LOCOMO_RECALL_DIFF_LINE_LIMIT, LOCOMO_RECALL_EXCERPT_CHARS, LONG_MEM_EVAL_DATASET_FILENAMES, type LeaderboardArtifactWrite, type LettaAdapterConfig, LettaMemCorrectAdapter, type LlmJudge, type LlmProvider, type LoComoCategoryDelta, type LoComoFinalContextRegression, type LoComoMetricDelta, type LoComoProfileArtifactEvidence, type LoComoProfileDeltaReport, type LoComoRawResultEvidence, type LoComoRecallCategoryDelta, type LoComoRecallContextSummary, type LoComoRecallDeltaReport, type LoComoRecallLineDelta, type LoComoRecallLineEvidence, type LoComoRecallMetricDelta, type LoComoRecallResultProvenance, type LoComoRecallTextDigest, type LoComoTaskRegression, type LoadDatasetOptions, type LoadSealedQrelsOptions, type LoadedDataset, type LoadedJudgeCalibrationState, type LocalLabManifest, type LocalLabManifestNotes, type LocalLabPhase, type LocalLabPhaseDescriptor, type LocalLabPhaseExecute, type LocalLabPhaseName, type LocalLabPhaseOutcome, LocalLabPreflightError, type LocalLabPreflightFailure, type LocalLabPreflightInput, type LocalLabPreflightOptions, type LocalLabPreflightResult, type LocalLabPreflightSuccess, type LocalLabProviderKind, type LocalLabRoleConfig, type LocalLlmProviderConfig, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC, MEMCORRECT_CORRECTION_ACCEPTANCE_RUBRIC_VERSION, MEMCORRECT_STALE_HARM_RUBRIC, MEMCORRECT_STALE_HARM_RUBRIC_VERSION, MEMORY_EVAL_DIMENSIONS, MEMORY_EVAL_PUBLIC_LINE, MIN_CALIBRATION_SOURCE_TASKS, MITIGATED_BASELINE_SCENARIOS, type McpArgumentSemantic, type McpBackendErrorCode, type McpBackendResult, type McpBenchMemoryAdapter, type McpConformanceResult, type McpHttpTransportConfig, type McpListedTool, type McpMemCorrectAdapter, type McpMemoryAdapterOptions, McpMemoryBackendError, type McpMemoryToolMapping, type McpMemoryTransportConfig, type McpStdioTransportConfig, type McpToolCallResult, type McpToolClient, type McpToolMappingEntry, type McpToolMappingValue, type McpToolOperation, type Mem0AdapterConfig, Mem0MemCorrectAdapter, type MemCorrectGeneratorOptions, type MemCorrectJudgeRequest, type MemCorrectJudgeResult, type MemCorrectSystemAdapter, type MemoryEvalCategory, type MemoryEvalDimension, type MemoryEvalDimensionId, type MemoryEvalMetric, type MemoryGraph, type MemoryStats, type MemorySystem, type Message, type MetricAggregate, type MicroMetric, MissingCredentialError, type MitigatedBaselineConfig, type MitigatedTargetConfig, type MultipleChoiceQuestion, OPENAI_RESPONSES_JUDGE_RUBRIC_VERSION, OTHER_NAMESPACE_MEMORIES, type OllamaProviderConfig, type OpenAiCompatibleProviderConfig, OpenAiResponsesJudgeError, type OpenAiResponsesJudgeErrorCode, type OpenAiResponsesJudgeTelemetry, OpenAiResponsesProvider, type OpenAiResponsesProviderConfig, type OpenAiResponsesVerdict, type OpenAiResponsesVerdictResult, PROCEDURAL_REAL_SCENARIOS, PROCEDURAL_REAL_SCENARIOS_SMOKE, PUBLISHED_BENCHMARK_ARTIFACT_IDS, type PersonalizationRetrievalCase, type PreflightDiscoveredModel, type ProceduralAblationArtifact, type ProceduralAblationPerCase, type ProceduralAblationScenario, type ProceduralRealScenario, type ProceduralRealScenarioCategory, type ProviderBaseConfig, type ProviderConfig, type ProviderDiscoveryResult, type ProviderFactoryConfig, type PublishSkipReason, type PublishSkipRecord, type PublishedBenchmarkFeed, type PublishedBenchmarkFeedEntry, type PublishedBenchmarkId, REQUIRED_FRONTMATTER_FIELDS, type RecallMetrics, type RecoveredMemory, type RegressionDetail, type RegressionGateResult$1 as RegressionGateResult, type RemnicAdapterOptions, type ReportCardProvenanceContext, type ResolveBenchRuntimeProfileOptions, type ResolvedBenchRuntimeProfile, type ResolvedLocalLabProfile, type ResolvedLocalLabRole, type ResolvedRunBenchmarkOptions, type RotatedChoices, type RunBenchmarkOptions, type RunJudgeCalibrationOptions, type RunProceduralAblationCliArgs, type RunProceduralAblationOptions, type RunSequentialPhasesOptions, SCHEMA_TIER_FIXTURE, SCHEMA_TIER_SMOKE_FIXTURE, SEALED_PROMPT_REGISTRY, SINGLE_FLAG_ABLATION_MATRIX, SYNTHETIC_MEMORIES, type SanitizedDiagnosticProvider, type SavedBaseline, type SchemaTierCorpus, type SchemaTierFixture, type SchemaTierName, type SchemaTierPage, type SchemaTierPageFrontmatter, type SealedArtifact, type SealedJudgeDecision, type SealedJudgeInput, type SealedQrelsArtifact, type SealedQrelsHandle, type SealedRubric, type SearchResult, type SeededMemory, type SeededRng, type SequentialPhaseHooks, type SingleFlagAblationCell, type SingleFlagAblationId, type SpotCheckLogger, type StatisticalReport, type StructuredJudge, StructuredJudgeError, type StructuredJudgeErrorCode, type StructuredJudgeProvider, type StructuredJudgeTelemetry, type StructuredJudgeVerdict, type StructuredJudgeVerdictResult, type StructuredVerdictRequest, type SyntheticEdge, type SyntheticEmailIngestionAdapterOptions, type SyntheticFileIR, type SyntheticRepoConfig, type SyntheticSymbol, type SyntheticTargetOptions, type TaskResult, type TaskTokenUsage, type TemporalRetrievalCase, type ThirdPartyAdapterConfig, type TierDetail, type TimelineEntry, type TokenUsage, type WallMetric, type WriteBenchmarkArtifactResult, type ZepAdapterConfig, ZepMemCorrectAdapter, addContaminationEntry, aggregateTaskScores, answerBenchmarkQuestion, assertCanaryUnderFloor, assertIntegrityMetaPresent, assertPublishableIntegrity, assertSha256Hex, assistantMeetingPrepDefinition, assistantMorningBriefDefinition, assistantNextBestActionDefinition, assistantSynthesisDefinition, backlinkF1, binarizeJudgeScore, bootstrapCohensKappaConfidenceInterval, bootstrapMeanConfidenceInterval, buildAmaBenchDiagnosticMatrixArtifact, buildAmaBenchDiagnosticVariantSummary, buildAmaBenchLeaderboardRows, buildBaselineFromReport, buildBenchmarkArtifact, buildBenchmarkArtifactFilename, buildBenchmarkPublishFeed, buildBenchmarkReproManifest, buildBenchmarkRunSeeds, buildCodexCreditReceipt, buildJudgePayload, buildOracleTrajectoryRecall, buildSchemaTierFixture, buildSchemaTierSmokeFixture, calendarFixture, canonicalJsonStringify, captureMachineFingerprint, chatFixture, checkCodingGraphRegression, checkDatasetContamination, checkRegression, clampScore, cohensD, compareResults, computeCohensKappa, computeSealHash, containsAnswer, createSeededRng$1 as createAdamSeededRng, createAmaBenchDiagnosticAdapter, createAnthropicProvider, createCanaryAdapter, createClaudeCliProvider, createCodexCliProvider, createSeededRng as createCodingGraphSeededRng, createDeterministicSpotCheckLogger, createGatewayResponder, createLightweightAdapter, createLiteLlmProvider, createLocalLlmProvider, createMcpDemoMemCorrectAdapter, createMcpDemoMemoryAdapter, createMcpMemCorrectAdapter, createMcpMemoryAdapter, createMitigatedTarget, createOllamaProvider, createOpenAiCompatibleProvider, createOpenAiResponsesBenchJudge, createOpenAiResponsesProvider, createSeededRandom as createProceduralAblationSeededRandom, createProvider, createProviderBackedAmaBenchRecommendedJudge, createProviderBackedJudge, createProviderBackedResponder, createProviderBackedStructuredJudge, createRemnicAdapter, createResponderFromProvider, createSeededRng$2 as createSeededRng, createSpotCheckFileLogger, createStructuredBenchJudge, createStructuredJudgeFromProvider, createSyntheticEmailIngestionAdapter, createSyntheticTarget, createTimeoutGuardedAdapter, defaultBenchmarkBaselineDir, defaultBenchmarkPublishPath, deleteBenchmarkResults, diagnoseLoComoProfileDelta, diagnoseLoComoRecallDelta, discoverAllProviders, discoveryEndpointFor, emailFixture, entityRecall, exactMatch, extractMetrics as extractCodingGraphMetrics, extractMarkdownSectionsByTitle, f1Score, fixtureToAblationScenarios, formatHandoffNote, formatMissingDatasetError, generateReport, generateSyntheticRepo, getAblationCell, getBenchmark, getBenchmarkLowerIsBetter, getMemoryEvalDimension, getProviderBackedJudgePromptIdentity, getRemnicVersion, hashBenchmarkArtifact, hashBytes, hashCanonicalJson, hashOrderedQuestionIds, hashString, integrityMetaIsComplete, interpretEffectSize, isAmaBenchUnknownLikeAnswer, isContaminationEntry, isContaminationManifest, isSealedQrelsArtifact, isSha256Hex, isStructuredJudgeProvider, judgeMemCorrectCorrectionAcceptance, judgeMemCorrectStaleMemoryHarm, linkMatches, listBenchmarkBaselines, listBenchmarkResults, listBenchmarks, listMemoryEvalBenchmarkIds, listMemoryEvalDimensions, llmJudgeScore, llmJudgeScoreDetailed, loadAblationFixture, loadBaseline, loadBeamDatasetPreview, loadBenchmarkArtifact, loadBenchmarkBaseline, loadBenchmarkReportCardProvenance, loadBenchmarkResult, loadCustomBenchmarkFile, loadJudgeCalibrationState, loadLoCoMo10, loadLocalLabManifest, loadLongMemEvalS, loadSealKeyFromEnv, loadSealedQrels, loadSealedRubric, matchEntity, mergeContaminationManifests, openSeal, orchestrateBenchmarkRuns, pairedDeltaConfidenceInterval, parseBenchmarkArtifact, parseCustomBenchmark, parseLocalLabManifest, parseRubricResponse, parseSealedQrels, pickStableQualifiedName, precisionAtK, preflightLocalLabRole, projectFolderFixture, recallAtK, reconcileCodexCreditLedger, redactBenchmarkResultSecrets, renderBaselineMarkdown, renderBenchmarkResultExport, renderLoComoProfileDeltaMarkdown, renderLoComoRecallDeltaMarkdown, renderMemorySummaryForJudge, renderMemoryViewForAgent, resolveAssistantAgent, resolveAssistantRubricId, resolveAssistantSeeds, resolveAssistantSpotCheckDir, resolveBenchRuntimeProfile, resolveBenchmarkPhaseTimeoutMs, resolveBenchmarkProgressLogging, resolveBenchmarkResultReference, resolveBenchmarkRunCount, resolveLocalLabJudgeProviderConfig, resolveLocalLabProfile, resolveLocalLabRole, resolveStructuredJudge, rotateDistractors, rougeL, runAssistantBenchmark, runAssistantMeetingPrepBenchmark, runAssistantMorningBriefBenchmark, runAssistantNextBestActionBenchmark, runAssistantSynthesisBenchmark, runBaseline, runBenchSuite, runBenchmark, runCodingGraphBenchmark, runCustomBenchmarkFile, runExplain, runExtractionAttack, runJudgeCalibration, runMitigatedBaseline, runProceduralAblation, runProceduralAblationCli, runSealedJudge, runSequentialPhases, safeHexEqual, sanitizeLoComoResultReference, saveBaseline, saveBenchmarkBaseline, schemaCompleteness, sealPayload, selectAmaBenchDiagnosticVariants, selectCalibrationSlice, selectFixtureVariant, serializeBenchmarkArtifact, serializeJsonl, serializeSealedQrels, shuffleTasks, timed, verifyRubricDigest, writeBenchmarkArtifact, writeBenchmarkPublishFeed, writeBenchmarkReproManifest, writeBenchmarkResult, writeJudgeCalibrationState, writeLeaderboardArtifactsForResult, zeroScores };
package/dist/index.js CHANGED
@@ -8303,6 +8303,8 @@ function readJudgeCalibrationFromBenchmarkOptions(value) {
8303
8303
  const answerSetHash = record.answerSetHash;
8304
8304
  const sourceResultId = record.sourceResultId;
8305
8305
  const sliceQuestionIds = readCalibrationQuestionIds(record.sliceQuestionIds);
8306
+ const localJudgeConfigHash = record.localJudgeConfigHash;
8307
+ const frontierJudgeConfigHash = record.frontierJudgeConfigHash;
8306
8308
  const hasCompleteProvenance = typeof answerSetHash === "string" && /^[0-9a-f]{64}$/.test(answerSetHash) && typeof sourceResultId === "string" && sourceResultId.length > 0 && sliceQuestionIds !== void 0 && sliceQuestionIds.length === sampleSize;
8307
8309
  return {
8308
8310
  kappa,
@@ -8311,7 +8313,8 @@ function readJudgeCalibrationFromBenchmarkOptions(value) {
8311
8313
  warning,
8312
8314
  ...confidenceInterval ? { confidenceInterval } : {},
8313
8315
  ...typeof bootstrapSamples === "number" && Number.isInteger(bootstrapSamples) && bootstrapSamples > 0 ? { bootstrapSamples } : {},
8314
- ...hasCompleteProvenance ? { answerSetHash, sourceResultId, sliceQuestionIds } : {}
8316
+ ...hasCompleteProvenance ? { answerSetHash, sourceResultId, sliceQuestionIds } : {},
8317
+ ...typeof localJudgeConfigHash === "string" && /^[0-9a-f]{64}$/.test(localJudgeConfigHash) && typeof frontierJudgeConfigHash === "string" && /^[0-9a-f]{64}$/.test(frontierJudgeConfigHash) ? { localJudgeConfigHash, frontierJudgeConfigHash } : {}
8315
8318
  };
8316
8319
  }
8317
8320
  function readCalibrationConfidenceInterval(value) {
@@ -8428,6 +8431,11 @@ function parseBenchmarkArtifact(raw) {
8428
8431
  if (calibration.sliceQuestionIds !== void 0 && !readCalibrationQuestionIds(calibration.sliceQuestionIds)) {
8429
8432
  throw new Error("BenchmarkArtifact judgeCalibration.sliceQuestionIds must contain 1 to 200 unique non-empty strings when provided.");
8430
8433
  }
8434
+ for (const key of ["localJudgeConfigHash", "frontierJudgeConfigHash"]) {
8435
+ if (calibration[key] !== void 0 && (typeof calibration[key] !== "string" || !/^[0-9a-f]{64}$/.test(calibration[key]))) {
8436
+ throw new Error(`BenchmarkArtifact judgeCalibration.${key} must be a lowercase SHA-256 hex digest when provided.`);
8437
+ }
8438
+ }
8431
8439
  const hasAnyPinnedProvenance = calibration.answerSetHash !== void 0 || calibration.sourceResultId !== void 0 || calibration.sliceQuestionIds !== void 0;
8432
8440
  if (hasAnyPinnedProvenance && (typeof calibration.answerSetHash !== "string" || !/^[0-9a-f]{64}$/.test(calibration.answerSetHash) || typeof calibration.sourceResultId !== "string" || calibration.sourceResultId.length === 0 || !readCalibrationQuestionIds(calibration.sliceQuestionIds) || calibration.sliceQuestionIds.length !== calibration.sampleSize)) {
8433
8441
  throw new Error("BenchmarkArtifact judgeCalibration pinned provenance requires a sourceResultId, answerSetHash, and unique sliceQuestionIds matching sampleSize.");
@@ -12634,6 +12642,7 @@ function asStringArray(value) {
12634
12642
  }
12635
12643
 
12636
12644
  // src/responders.ts
12645
+ import { createHash as createHash7 } from "crypto";
12637
12646
  import { FallbackLlmClient } from "@remnic/core";
12638
12647
 
12639
12648
  // src/providers/openai-responses.ts
@@ -13082,6 +13091,32 @@ var DEFAULT_JUDGE_SYSTEM_PROMPT = [
13082
13091
  "Return only a numeric score from 0.00 to 1.00 inclusive.",
13083
13092
  "Use 1.00 for a fully correct answer, 0.00 for a fully incorrect answer, and fractional values for partial matches."
13084
13093
  ].join(" ");
13094
+ function buildDefaultJudgeUserPrompt(question, predicted, expected) {
13095
+ return [
13096
+ `QUESTION: ${question}`,
13097
+ "",
13098
+ `EXPECTED_ANSWER: ${expected}`,
13099
+ "",
13100
+ `PREDICTED_ANSWER: ${predicted}`,
13101
+ "",
13102
+ "Score the predicted answer against the expected answer."
13103
+ ].join("\n");
13104
+ }
13105
+ function getProviderBackedJudgePromptIdentity(config) {
13106
+ const contract = config.provider === "openai" ? {
13107
+ kind: "structured",
13108
+ rubric: GENERAL_ANSWER_JUDGE_RUBRIC,
13109
+ rubricVersion: config.rubricVersion ?? OPENAI_RESPONSES_JUDGE_RUBRIC_VERSION,
13110
+ inputTemplate: ["QUESTION: {question}", "REFERENCE_ANSWER: {expected}", "PREDICTED_ANSWER: {predicted}"]
13111
+ } : {
13112
+ kind: "scalar",
13113
+ systemPrompt: DEFAULT_JUDGE_SYSTEM_PROMPT,
13114
+ userPrompt: buildDefaultJudgeUserPrompt("{question}", "{predicted}", "{expected}"),
13115
+ temperature: 0,
13116
+ maxTokens: 16
13117
+ };
13118
+ return `sha256:${createHash7("sha256").update(JSON.stringify(contract)).digest("hex")}`;
13119
+ }
13085
13120
  var AMA_BENCH_RECOMMENDED_JUDGE_SYSTEM_PROMPT = [
13086
13121
  "You are evaluating an AMA-Bench long-horizon memory question.",
13087
13122
  "Decide whether the predicted answer correctly answers the question using the reference answer as ground truth.",
@@ -13526,15 +13561,7 @@ function createJudgeFromProvider(provider) {
13526
13561
  }
13527
13562
  async function scoreWithMetrics(question, predicted, expected, control) {
13528
13563
  const completion = await provider.complete(
13529
- [
13530
- `QUESTION: ${question}`,
13531
- "",
13532
- `EXPECTED_ANSWER: ${expected}`,
13533
- "",
13534
- `PREDICTED_ANSWER: ${predicted}`,
13535
- "",
13536
- "Score the predicted answer against the expected answer."
13537
- ].join("\n"),
13564
+ buildDefaultJudgeUserPrompt(question, predicted, expected),
13538
13565
  {
13539
13566
  systemPrompt: DEFAULT_JUDGE_SYSTEM_PROMPT,
13540
13567
  temperature: 0,
@@ -14753,7 +14780,7 @@ async function resolveBenchRuntimeProfile(options) {
14753
14780
  options.systemResponderContextBudgetChars,
14754
14781
  options.systemResponderPromptBudgetChars
14755
14782
  );
14756
- const judgeProvider = resolveProviderConfig(
14783
+ const explicitJudgeProvider = resolveProviderConfig(
14757
14784
  "judge",
14758
14785
  options.judgeProvider,
14759
14786
  options.judgeModel,
@@ -14766,6 +14793,11 @@ async function resolveBenchRuntimeProfile(options) {
14766
14793
  void 0,
14767
14794
  void 0
14768
14795
  );
14796
+ const judgeProvider = options.localLabManifestPath ? await resolveManifestBoundJudgeProvider(
14797
+ options.localLabManifestPath,
14798
+ options,
14799
+ explicitJudgeProvider
14800
+ ) : explicitJudgeProvider;
14769
14801
  const internalProvider = applyInternalProviderDefaults(
14770
14802
  resolveProviderConfig(
14771
14803
  "internal",
@@ -15185,6 +15217,56 @@ function applyLocalLabRuntimeOptions(config, options) {
15185
15217
  ...disableThinking ? { disableThinking: true } : {}
15186
15218
  };
15187
15219
  }
15220
+ async function resolveLocalLabJudgeProviderConfig(options) {
15221
+ const manifest = await loadLocalLabManifest(options.localLabManifestPath);
15222
+ const resolved = resolveLocalLabProfile(manifest);
15223
+ return buildLocalLabJudgeProviderConfig(resolved, options);
15224
+ }
15225
+ function buildLocalLabJudgeProviderConfig(resolved, options) {
15226
+ return applyLocalLabRuntimeOptions(
15227
+ sanitizeProviderConfig(resolved.judge.providerConfig),
15228
+ options
15229
+ );
15230
+ }
15231
+ async function resolveManifestBoundJudgeProvider(localLabManifestPath, options, explicitJudgeProvider) {
15232
+ const manifestJudge = await resolveLocalLabJudgeProviderConfig({
15233
+ localLabManifestPath,
15234
+ requestTimeout: options.requestTimeout,
15235
+ max429WaitMs: options.max429WaitMs,
15236
+ disableThinking: options.disableThinking
15237
+ });
15238
+ if (explicitJudgeProvider) {
15239
+ assertManifestJudgeIdentity(explicitJudgeProvider, manifestJudge);
15240
+ }
15241
+ return manifestJudge;
15242
+ }
15243
+ function assertManifestJudgeIdentity(explicitJudge, manifestJudge) {
15244
+ if (explicitJudge.provider !== manifestJudge.provider || explicitJudge.model !== manifestJudge.model) {
15245
+ throw new Error(
15246
+ `judge provider/model flags do not match the local-lab manifest judge: flags=${explicitJudge.provider}/${explicitJudge.model}, manifest=${manifestJudge.provider}/${manifestJudge.model}`
15247
+ );
15248
+ }
15249
+ if (explicitJudge.baseUrl !== void 0 && normalizeProviderBaseUrl(explicitJudge.provider, explicitJudge.baseUrl) !== manifestJudge.baseUrl) {
15250
+ throw new Error(
15251
+ `judge baseUrl flag does not match the normalized local-lab manifest judge: flags=${normalizeProviderBaseUrl(explicitJudge.provider, explicitJudge.baseUrl)}, manifest=${String(manifestJudge.baseUrl)}`
15252
+ );
15253
+ }
15254
+ if (explicitJudge.apiKey !== void 0) {
15255
+ throw new Error(
15256
+ "manifest-bound local judge does not accept --judge-api-key; keep local endpoint credentials out of the persisted manifest/hash contract"
15257
+ );
15258
+ }
15259
+ }
15260
+ function normalizeProviderBaseUrl(provider, rawBaseUrl) {
15261
+ const trimmed = rawBaseUrl.trim().endsWith("/") ? rawBaseUrl.trim().slice(0, -1) : rawBaseUrl.trim();
15262
+ if (provider === "ollama" && !trimmed.endsWith("/api")) {
15263
+ return `${trimmed}/api`;
15264
+ }
15265
+ if (provider === "local-llm" && !trimmed.endsWith("/v1")) {
15266
+ return `${trimmed}/v1`;
15267
+ }
15268
+ return trimmed;
15269
+ }
15188
15270
  function registerCodexCliFallbackRunnerIfNeeded(config) {
15189
15271
  if (!config || config.provider !== "codex-cli" || codexCliFallbackRegistered) {
15190
15272
  return;
@@ -15337,10 +15419,7 @@ async function resolveLocalLabRuntimeProfile(options) {
15337
15419
  sanitizeProviderConfig(resolved.responder.providerConfig),
15338
15420
  options
15339
15421
  );
15340
- const judgeProvider = applyLocalLabRuntimeOptions(
15341
- sanitizeProviderConfig(resolved.judge.providerConfig),
15342
- options
15343
- );
15422
+ const judgeProvider = buildLocalLabJudgeProviderConfig(resolved, options);
15344
15423
  const judgeFactoryConfig = judgeProvider ? asProviderFactoryConfig(judgeProvider) : void 0;
15345
15424
  const judge = judgeFactoryConfig ? createProviderBackedJudge(judgeFactoryConfig) : void 0;
15346
15425
  const structuredJudge = judgeFactoryConfig ? createProviderBackedStructuredJudge(judgeFactoryConfig) : void 0;
@@ -15377,11 +15456,11 @@ async function resolveLocalLabRuntimeProfile(options) {
15377
15456
  // src/benchmark.ts
15378
15457
  import fs2 from "fs";
15379
15458
  import path35 from "path";
15380
- import { createHash as createHash12 } from "crypto";
15459
+ import { createHash as createHash13 } from "crypto";
15381
15460
  import { expandTildePath as expandTildePath3 } from "@remnic/core";
15382
15461
 
15383
15462
  // src/judges/judge-cache.ts
15384
- import { createHash as createHash7, randomBytes as randomBytes2 } from "crypto";
15463
+ import { createHash as createHash8, randomBytes as randomBytes2 } from "crypto";
15385
15464
  import {
15386
15465
  mkdir as mkdir9,
15387
15466
  readFile as readFile11,
@@ -15424,8 +15503,8 @@ var JudgeCache = class {
15424
15503
  }
15425
15504
  /** Compute the sha256-hex key for a set of parts. Pure, sync, side-effect-free. */
15426
15505
  computeKey(parts) {
15427
- const fieldDigest = (value) => createHash7("sha256").update(value).digest();
15428
- return createHash7("sha256").update(fieldDigest(parts.benchmarkId)).update(fieldDigest(parts.datasetVersion)).update(fieldDigest(parts.questionId)).update(fieldDigest(parts.answerText)).update(fieldDigest(parts.judgePromptHash)).update(fieldDigest(parts.judgeModelId)).update(fieldDigest(parts.judgeParamsHash)).digest("hex");
15506
+ const fieldDigest = (value) => createHash8("sha256").update(value).digest();
15507
+ return createHash8("sha256").update(fieldDigest(parts.benchmarkId)).update(fieldDigest(parts.datasetVersion)).update(fieldDigest(parts.questionId)).update(fieldDigest(parts.answerText)).update(fieldDigest(parts.judgePromptHash)).update(fieldDigest(parts.judgeModelId)).update(fieldDigest(parts.judgeParamsHash)).digest("hex");
15429
15508
  }
15430
15509
  /**
15431
15510
  * Read a previously-stored verdict. Returns `undefined` on miss, corrupted
@@ -15620,7 +15699,7 @@ function runJudgeWithCache(options) {
15620
15699
  // Binary prompts are content-sensitive: two distinct prompts of
15621
15700
  // the same character length would collide on the previous
15622
15701
  // `binary:N` key, so key on a sha256 prefix of the prompt body.
15623
- questionId: `binary:${createHash7("sha256").update(prompt).digest("hex").slice(0, 16)}`,
15702
+ questionId: `binary:${createHash8("sha256").update(prompt).digest("hex").slice(0, 16)}`,
15624
15703
  answerText: prompt,
15625
15704
  judgePromptHash: keyExtras.judgePromptHash ?? "unknown-prompt",
15626
15705
  judgeModelId: keyExtras.judgeModelId ?? "unknown-judge",
@@ -23111,7 +23190,7 @@ var StructuredLiteralParser = class {
23111
23190
  };
23112
23191
 
23113
23192
  // src/benchmarks/published/personamem/runner.ts
23114
- import { createHash as createHash8, randomUUID as randomUUID7 } from "crypto";
23193
+ import { createHash as createHash9, randomUUID as randomUUID7 } from "crypto";
23115
23194
  import { readFile as readFile16, realpath as realpath4 } from "fs/promises";
23116
23195
  import path19 from "path";
23117
23196
 
@@ -23716,7 +23795,7 @@ function buildMcqPrompt(sample, seed) {
23716
23795
  function deterministicShuffle(values, seedMaterial) {
23717
23796
  return values.map((value, index) => ({
23718
23797
  value,
23719
- key: createHash8("sha256").update(`${seedMaterial}:${index}:${value}`).digest("hex"),
23798
+ key: createHash9("sha256").update(`${seedMaterial}:${index}:${value}`).digest("hex"),
23720
23799
  index
23721
23800
  })).sort((left, right) => {
23722
23801
  const byKey = left.key.localeCompare(right.key);
@@ -32175,7 +32254,7 @@ function pairedDeltaConfidenceInterval(candidateValues, baselineValues, options
32175
32254
  }
32176
32255
 
32177
32256
  // src/judges/sealed-rubric.ts
32178
- import { createHash as createHash9 } from "crypto";
32257
+ import { createHash as createHash10 } from "crypto";
32179
32258
  import { appendFileSync, mkdirSync } from "fs";
32180
32259
  import path31 from "path";
32181
32260
 
@@ -32284,7 +32363,7 @@ function loadSealedRubric(id = DEFAULT_ASSISTANT_RUBRIC_ID, options = {}) {
32284
32363
  if (typeof prompt !== "string" || prompt.length === 0) {
32285
32364
  throw new Error(`sealed rubric not found in registry: ${id}`);
32286
32365
  }
32287
- const sha2563 = createHash9("sha256").update(prompt, "utf8").digest("hex");
32366
+ const sha2563 = createHash10("sha256").update(prompt, "utf8").digest("hex");
32288
32367
  const version = parseVersionFromId(id);
32289
32368
  return { id, version, prompt, sha256: sha2563 };
32290
32369
  }
@@ -34487,7 +34566,7 @@ async function runRetentionAgedDatasetBenchmark(options) {
34487
34566
  import { randomUUID as randomUUID31 } from "crypto";
34488
34567
 
34489
34568
  // src/benchmarks/remnic/memcorrect/generator.ts
34490
- import { createHash as createHash10 } from "crypto";
34569
+ import { createHash as createHash11 } from "crypto";
34491
34570
 
34492
34571
  // src/benchmarks/remnic/memcorrect/token-pools.ts
34493
34572
  var PERSONAS = [
@@ -34811,7 +34890,7 @@ function corpusHash(corpus) {
34811
34890
  uptakeLatencyCap: corpus.options.uptakeLatencyCap,
34812
34891
  scenarios: corpus.scenarios
34813
34892
  });
34814
- return createHash10("sha256").update(canonical).digest("hex");
34893
+ return createHash11("sha256").update(canonical).digest("hex");
34815
34894
  }
34816
34895
 
34817
34896
  // src/benchmarks/remnic/memcorrect/schema.ts
@@ -35766,7 +35845,7 @@ import { mkdir as mkdir17, writeFile as writeFile16 } from "fs/promises";
35766
35845
  import path34 from "path";
35767
35846
 
35768
35847
  // src/benchmarks/remnic/bounded-memory-contracts/fixture.ts
35769
- import { createHash as createHash11 } from "crypto";
35848
+ import { createHash as createHash12 } from "crypto";
35770
35849
  var SCOPE_ACME = "project:acme";
35771
35850
  var SCOPE_BETA = "project:beta";
35772
35851
  var SCOPE_ALICE = "user:alice";
@@ -36249,7 +36328,7 @@ var BOUNDED_MEMORY_SMOKE_FIXTURE = [
36249
36328
  function fixtureHash(tasks) {
36250
36329
  const source = tasks ?? BOUNDED_MEMORY_FIXTURE;
36251
36330
  const payload = JSON.stringify(source);
36252
- return createHash11("sha256").update(payload, "utf8").digest("hex");
36331
+ return createHash12("sha256").update(payload, "utf8").digest("hex");
36253
36332
  }
36254
36333
 
36255
36334
  // src/benchmarks/remnic/bounded-memory-contracts/agent.ts
@@ -37509,13 +37588,13 @@ function wrapJudgeWithCache(args) {
37509
37588
  // differentiator is part of the prompt hash. Bumping
37510
37589
  // JUDGE_CACHE_PROTOCOL_VERSION invalidates verdicts when judge
37511
37590
  // prompt/parse semantics change (PR #1591, High).
37512
- judgePromptHash: createHash12("sha256").update(JUDGE_CACHE_PROTOCOL_VERSION).update("").update(args.amaBenchJudgeProtocol).update("").update(args.role).digest("hex"),
37591
+ judgePromptHash: createHash13("sha256").update(JUDGE_CACHE_PROTOCOL_VERSION).update("").update(args.amaBenchJudgeProtocol).update("").update(args.role).digest("hex"),
37513
37592
  judgeModelId: args.provider?.model !== void 0 && args.provider.model.length > 0 ? `${args.provider.model}${crossJudgeIdSuffix}` : `unknown-${args.role}-judge`,
37514
37593
  // Full judge configuration, deterministically serialized (sorted
37515
37594
  // keys) so provider/base-url/retry changes produce fresh cache
37516
37595
  // keys. `role` is included so primary and cross judges never
37517
37596
  // share a paramsHash.
37518
- judgeParamsHash: createHash12("sha256").update(
37597
+ judgeParamsHash: createHash13("sha256").update(
37519
37598
  stableStringify2({
37520
37599
  role: args.role,
37521
37600
  provider: args.provider
@@ -38221,7 +38300,7 @@ function formatSignedScore(value) {
38221
38300
  }
38222
38301
 
38223
38302
  // src/stats/locomo-recall-delta.ts
38224
- import { createHash as createHash13 } from "crypto";
38303
+ import { createHash as createHash14 } from "crypto";
38225
38304
  import { basename } from "path";
38226
38305
  var LOCOMO_FULL_TASK_COUNT = 1986;
38227
38306
  var LOCOMO_RECALL_EXCERPT_CHARS = 240;
@@ -38702,7 +38781,7 @@ function normalizeText3(value) {
38702
38781
  return value.replaceAll("\r\n", "\n").replaceAll("\r", "\n");
38703
38782
  }
38704
38783
  function sha2562(value) {
38705
- return createHash13("sha256").update(value).digest("hex");
38784
+ return createHash14("sha256").update(value).digest("hex");
38706
38785
  }
38707
38786
  function stableJson(value) {
38708
38787
  return JSON.stringify(value);
@@ -40140,8 +40219,8 @@ var chatFixture = {
40140
40219
  };
40141
40220
 
40142
40221
  // src/judges/calibration-slice.ts
40143
- import { createHash as createHash14, randomBytes as randomBytes3 } from "crypto";
40144
- import { mkdir as mkdir18, readFile as readFile22, rename as rename4, unlink as unlink4, writeFile as writeFile17 } from "fs/promises";
40222
+ import { createHash as createHash15, randomBytes as randomBytes3 } from "crypto";
40223
+ import { chmod as chmod2, lstat as lstat4, mkdir as mkdir18, open as open2, readFile as readFile22, rename as rename4, unlink as unlink4, writeFile as writeFile17 } from "fs/promises";
40145
40224
  import path37 from "path";
40146
40225
 
40147
40226
  // src/judges/cohen-kappa.ts
@@ -40272,6 +40351,8 @@ function binarizeJudgeScore(score, threshold = DEFAULT_JUDGE_BINARIZATION_THRESH
40272
40351
  var CALIBRATION_SLICE_SIZE = 200;
40273
40352
  var MIN_CALIBRATION_SOURCE_TASKS = 10;
40274
40353
  var JUDGE_CALIBRATION_KAPPA_THRESHOLD = 0.7;
40354
+ var JUDGE_CALIBRATION_PROTOCOL_VERSION = "judge-calibration-v3";
40355
+ var DEFAULT_JUDGE_BINNING_IDENTITY = "default-binary-score-v1:incorrect<0.5,correct>=0.5,nonfinite=incorrect";
40275
40356
  function selectCalibrationSlice(questionIds, size = CALIBRATION_SLICE_SIZE) {
40276
40357
  if (!Number.isInteger(size) || size <= 0) {
40277
40358
  throw new Error(`selectCalibrationSlice: size must be a positive integer; got ${String(size)}.`);
@@ -40287,7 +40368,7 @@ function selectCalibrationSlice(questionIds, size = CALIBRATION_SLICE_SIZE) {
40287
40368
  unique.push(id);
40288
40369
  }
40289
40370
  }
40290
- return unique.map((id) => ({ id, digest: createHash14("sha256").update(id, "utf8").digest("hex") })).sort((a, b) => a.digest < b.digest ? -1 : a.digest > b.digest ? 1 : 0).slice(0, Math.min(size, unique.length)).map((entry) => entry.id);
40371
+ return unique.map((id) => ({ id, digest: createHash15("sha256").update(id, "utf8").digest("hex") })).sort((a, b) => a.digest < b.digest ? -1 : a.digest > b.digest ? 1 : 0).slice(0, Math.min(size, unique.length)).map((entry) => entry.id);
40291
40372
  }
40292
40373
  async function runJudgeCalibration(options) {
40293
40374
  const binScore = options.binScore ?? ((score) => binarizeJudgeScore(score));
@@ -40304,52 +40385,107 @@ async function runJudgeCalibration(options) {
40304
40385
  }
40305
40386
  const sliceAnswers = sliceIds.map((id) => answerById.get(id)).filter((answer) => answer !== void 0);
40306
40387
  const answerSetHash = hashCalibrationAnswerSet(sliceAnswers);
40388
+ const orderedQuestionIdsHash = hashOrderedQuestionIds(options.answers.map((answer) => answer.questionId));
40389
+ if (options.expectedOrderedQuestionIdsHash !== void 0 && orderedQuestionIdsHash !== options.expectedOrderedQuestionIdsHash) {
40390
+ throw new Error(
40391
+ `runJudgeCalibration: ordered question-id list changed (expected sha256:${options.expectedOrderedQuestionIdsHash}, got sha256:${orderedQuestionIdsHash}).`
40392
+ );
40393
+ }
40307
40394
  if (options.expectedAnswerSetHash !== void 0 && answerSetHash !== options.expectedAnswerSetHash) {
40308
40395
  throw new Error(
40309
40396
  `runJudgeCalibration: pinned answer set changed (expected sha256:${options.expectedAnswerSetHash}, got sha256:${answerSetHash}). Restore the original stored result or intentionally reset calibration state.`
40310
40397
  );
40311
40398
  }
40399
+ if (options.checkpoint && options.binScore && !options.binningIdentity) {
40400
+ throw new Error("runJudgeCalibration: checkpointed custom binScore requires an explicit binningIdentity.");
40401
+ }
40402
+ const binningIdentity = options.binningIdentity ?? DEFAULT_JUDGE_BINNING_IDENTITY;
40403
+ const checkpoint = options.checkpoint ? await loadOrInitializeCheckpoint(
40404
+ options.benchmarkId,
40405
+ { ...options.checkpoint, binningIdentity },
40406
+ sliceIds,
40407
+ answerSetHash,
40408
+ orderedQuestionIdsHash
40409
+ ) : void 0;
40312
40410
  const localLabels = [];
40313
40411
  const frontierLabels = [];
40314
40412
  const verdicts = [];
40315
- for (const answer of sliceAnswers) {
40316
- const localScore = await options.localJudge.score(
40317
- answer.question,
40318
- answer.predicted,
40319
- answer.expected
40320
- );
40321
- const frontierScore = await options.frontierJudge.score(
40322
- answer.question,
40323
- answer.predicted,
40324
- answer.expected
40325
- );
40326
- const localCategory = binScore(localScore);
40327
- const frontierCategory = binScore(frontierScore);
40328
- localLabels.push(localCategory);
40329
- frontierLabels.push(frontierCategory);
40330
- verdicts.push({
40331
- questionId: answer.questionId,
40332
- localCategory,
40333
- frontierCategory
40413
+ let localJudgeCalls = 0;
40414
+ let frontierJudgeCalls = 0;
40415
+ let resumedJudgeOutputs = 0;
40416
+ try {
40417
+ for (const answer of sliceAnswers) {
40418
+ const saved = checkpoint?.state.completed[answer.questionId];
40419
+ let localCategory = saved?.localCategory;
40420
+ if (localCategory !== void 0) {
40421
+ resumedJudgeOutputs += 1;
40422
+ } else {
40423
+ const localScore = await options.localJudge.score(answer.question, answer.predicted, answer.expected);
40424
+ localJudgeCalls += 1;
40425
+ localCategory = binScore(localScore);
40426
+ if (checkpoint) {
40427
+ checkpoint.state.completed[answer.questionId] = { ...saved, localCategory };
40428
+ await writeCalibrationCheckpoint(checkpoint.path, checkpoint.state);
40429
+ }
40430
+ }
40431
+ let frontierCategory = checkpoint?.state.completed[answer.questionId]?.frontierCategory;
40432
+ if (frontierCategory !== void 0) {
40433
+ resumedJudgeOutputs += 1;
40434
+ } else {
40435
+ const frontierScore = await options.frontierJudge.score(answer.question, answer.predicted, answer.expected);
40436
+ frontierJudgeCalls += 1;
40437
+ frontierCategory = binScore(frontierScore);
40438
+ if (checkpoint) {
40439
+ checkpoint.state.completed[answer.questionId] = {
40440
+ ...checkpoint.state.completed[answer.questionId],
40441
+ frontierCategory
40442
+ };
40443
+ await writeCalibrationCheckpoint(checkpoint.path, checkpoint.state);
40444
+ }
40445
+ }
40446
+ localLabels.push(localCategory);
40447
+ frontierLabels.push(frontierCategory);
40448
+ verdicts.push({
40449
+ questionId: answer.questionId,
40450
+ localCategory,
40451
+ frontierCategory
40452
+ });
40453
+ }
40454
+ const kappaResult = computeCohensKappa(localLabels, frontierLabels);
40455
+ const bootstrap = bootstrapCohensKappaConfidenceInterval(localLabels, frontierLabels, {
40456
+ iterations: options.bootstrapSamples ?? DEFAULT_KAPPA_BOOTSTRAP_SAMPLES,
40457
+ level: options.confidenceLevel
40334
40458
  });
40459
+ const warning = kappaResult.kappa < threshold;
40460
+ return {
40461
+ ...kappaResult,
40462
+ benchmarkId: options.benchmarkId,
40463
+ sliceQuestionIds: sliceIds,
40464
+ threshold,
40465
+ warning,
40466
+ confidenceInterval: bootstrap.confidenceInterval,
40467
+ bootstrapSamples: bootstrap.bootstrapSamples,
40468
+ answerSetHash,
40469
+ verdicts,
40470
+ execution: {
40471
+ localJudgeCalls,
40472
+ frontierJudgeCalls,
40473
+ resumedJudgeOutputs,
40474
+ ...checkpoint ? {
40475
+ checkpointPath: checkpoint.path,
40476
+ checkpointContractHash: checkpoint.state.contractHash
40477
+ } : {}
40478
+ }
40479
+ };
40480
+ } finally {
40481
+ await checkpoint?.release();
40335
40482
  }
40336
- const kappaResult = computeCohensKappa(localLabels, frontierLabels);
40337
- const bootstrap = bootstrapCohensKappaConfidenceInterval(localLabels, frontierLabels, {
40338
- iterations: options.bootstrapSamples ?? DEFAULT_KAPPA_BOOTSTRAP_SAMPLES,
40339
- level: options.confidenceLevel
40340
- });
40341
- const warning = kappaResult.kappa < threshold;
40342
- return {
40343
- ...kappaResult,
40344
- benchmarkId: options.benchmarkId,
40345
- sliceQuestionIds: sliceIds,
40346
- threshold,
40347
- warning,
40348
- confidenceInterval: bootstrap.confidenceInterval,
40349
- bootstrapSamples: bootstrap.bootstrapSamples,
40350
- answerSetHash,
40351
- verdicts
40352
- };
40483
+ }
40484
+ function hashOrderedQuestionIds(questionIds) {
40485
+ if (questionIds.some((id) => typeof id !== "string" || id.length === 0)) {
40486
+ throw new Error("hashOrderedQuestionIds: question ids must be non-empty strings.");
40487
+ }
40488
+ return createHash15("sha256").update(JSON.stringify(questionIds), "utf8").digest("hex");
40353
40489
  }
40354
40490
  function validatePinnedQuestionIds(ids, availableIds) {
40355
40491
  if (ids.length === 0 || ids.length > CALIBRATION_SLICE_SIZE || ids.some((id) => typeof id !== "string" || id.length === 0) || new Set(ids).size !== ids.length) {
@@ -40362,15 +40498,141 @@ function validatePinnedQuestionIds(ids, availableIds) {
40362
40498
  return [...ids];
40363
40499
  }
40364
40500
  function hashCalibrationAnswerSet(answers) {
40365
- return createHash14("sha256").update(JSON.stringify(answers.map((answer) => [
40501
+ return createHash15("sha256").update(JSON.stringify(answers.map((answer) => [
40366
40502
  answer.questionId,
40367
40503
  answer.question,
40368
40504
  answer.predicted,
40369
40505
  answer.expected
40370
40506
  ]))).digest("hex");
40371
40507
  }
40508
+ async function loadOrInitializeCheckpoint(benchmarkId, provenance, sliceQuestionIds, answerSetHash, orderedQuestionIdsHash) {
40509
+ for (const [name, digest] of Object.entries({
40510
+ sourceResultSha256: provenance.sourceResultSha256,
40511
+ orderedQuestionIdsHash,
40512
+ localJudgeConfigHash: provenance.localJudgeConfigHash,
40513
+ frontierJudgeConfigHash: provenance.frontierJudgeConfigHash
40514
+ })) {
40515
+ if (!/^[0-9a-f]{64}$/.test(digest)) throw new Error(`runJudgeCalibration: ${name} must be a lowercase SHA-256 digest.`);
40516
+ }
40517
+ if (!provenance.sourceResultId || !provenance.localJudgePromptIdentity || !provenance.frontierJudgePromptIdentity || !provenance.binningIdentity) {
40518
+ throw new Error("runJudgeCalibration: checkpoint sourceResultId, prompt identities, and binningIdentity are required.");
40519
+ }
40520
+ if (provenance.orderedQuestionIdsHash !== orderedQuestionIdsHash) {
40521
+ throw new Error("runJudgeCalibration: checkpoint ordered-question-id hash does not match the validated source.");
40522
+ }
40523
+ await ensurePrivateDirectory(provenance.dir);
40524
+ const checkpointPath = path37.join(provenance.dir, `${sanitizeCalibrationSegment(benchmarkId)}.checkpoint.json`);
40525
+ const lockPath = `${checkpointPath}.lock`;
40526
+ let lockHandle;
40527
+ try {
40528
+ lockHandle = await open2(lockPath, "wx", 384);
40529
+ await lockHandle.writeFile(`${JSON.stringify({ pid: process.pid, acquiredAt: (/* @__PURE__ */ new Date()).toISOString() })}
40530
+ `, "utf8");
40531
+ await chmod2(lockPath, 384);
40532
+ } catch (error) {
40533
+ if (lockHandle) {
40534
+ await lockHandle.close().catch(() => void 0);
40535
+ await unlink4(lockPath).catch(() => void 0);
40536
+ }
40537
+ if (error.code === "EEXIST") {
40538
+ throw new Error(
40539
+ `runJudgeCalibration: checkpoint is locked at ${lockPath}; refusing concurrent or stale-lock recovery to avoid duplicate paid judge calls.`
40540
+ );
40541
+ }
40542
+ throw error;
40543
+ }
40544
+ let released = false;
40545
+ const release = async () => {
40546
+ if (released) return;
40547
+ if (!lockHandle) throw new Error(`runJudgeCalibration: checkpoint lock handle was not acquired for ${lockPath}.`);
40548
+ released = true;
40549
+ await lockHandle.close();
40550
+ await unlink4(lockPath);
40551
+ };
40552
+ try {
40553
+ const contract = {
40554
+ protocolVersion: JUDGE_CALIBRATION_PROTOCOL_VERSION,
40555
+ benchmarkId,
40556
+ sourceResultId: provenance.sourceResultId,
40557
+ sourceResultSha256: provenance.sourceResultSha256,
40558
+ orderedQuestionIdsHash: provenance.orderedQuestionIdsHash,
40559
+ answerSetHash,
40560
+ sliceQuestionIds,
40561
+ localJudgePromptIdentity: provenance.localJudgePromptIdentity,
40562
+ frontierJudgePromptIdentity: provenance.frontierJudgePromptIdentity,
40563
+ localJudgeConfigHash: provenance.localJudgeConfigHash,
40564
+ frontierJudgeConfigHash: provenance.frontierJudgeConfigHash,
40565
+ binningIdentity: provenance.binningIdentity
40566
+ };
40567
+ const contractHash = createHash15("sha256").update(stableJson2(contract)).digest("hex");
40568
+ let raw;
40569
+ try {
40570
+ const info = await lstat4(checkpointPath);
40571
+ if (!info.isFile() || info.isSymbolicLink()) throw new Error("checkpoint path is not a regular file");
40572
+ raw = await readFile22(checkpointPath, "utf8");
40573
+ } catch (error) {
40574
+ if (error.code !== "ENOENT") throw error;
40575
+ const state = { schemaVersion: 2, contractHash, contract, completed: {} };
40576
+ await writeCalibrationCheckpoint(checkpointPath, state);
40577
+ return { path: checkpointPath, state, release };
40578
+ }
40579
+ let parsed;
40580
+ try {
40581
+ parsed = JSON.parse(raw);
40582
+ } catch {
40583
+ throw new Error(`runJudgeCalibration: corrupt checkpoint at ${checkpointPath}; refusing to call judges.`);
40584
+ }
40585
+ if (!isValidCheckpoint(parsed, new Set(sliceQuestionIds))) {
40586
+ throw new Error(`runJudgeCalibration: corrupt checkpoint at ${checkpointPath}; refusing to call judges.`);
40587
+ }
40588
+ if (parsed.contractHash !== contractHash || stableJson2(parsed.contract) !== stableJson2(contract)) {
40589
+ throw new Error(`runJudgeCalibration: checkpoint contract mismatch at ${checkpointPath}; refusing to call judges.`);
40590
+ }
40591
+ await chmod2(checkpointPath, 384);
40592
+ return { path: checkpointPath, state: parsed, release };
40593
+ } catch (error) {
40594
+ await release().catch(() => void 0);
40595
+ throw error;
40596
+ }
40597
+ }
40598
+ function isValidCheckpoint(value, sliceIds) {
40599
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
40600
+ const record = value;
40601
+ if (record.schemaVersion !== 2 || typeof record.contractHash !== "string" || !/^[0-9a-f]{64}$/.test(record.contractHash) || !record.contract || typeof record.contract !== "object" || Array.isArray(record.contract) || !record.completed || typeof record.completed !== "object" || Array.isArray(record.completed)) return false;
40602
+ return Object.entries(record.completed).every(([id, output]) => {
40603
+ if (!sliceIds.has(id) || !output || typeof output !== "object" || Array.isArray(output)) return false;
40604
+ const fields = output;
40605
+ return Object.keys(fields).every((key) => key === "localCategory" || key === "frontierCategory") && [fields.localCategory, fields.frontierCategory].every((category) => category === void 0 || typeof category === "string" && category.length > 0);
40606
+ });
40607
+ }
40608
+ async function ensurePrivateDirectory(dir) {
40609
+ await mkdir18(dir, { recursive: true, mode: 448 });
40610
+ const info = await lstat4(dir);
40611
+ if (!info.isDirectory() || info.isSymbolicLink()) throw new Error(`runJudgeCalibration: checkpoint directory must be a real directory: ${dir}`);
40612
+ await chmod2(dir, 448);
40613
+ }
40614
+ async function writeCalibrationCheckpoint(filePath, state) {
40615
+ const tempPath = `${filePath}.${randomBytes3(6).toString("hex")}.tmp`;
40616
+ await writeFile17(tempPath, `${JSON.stringify(state, null, 2)}
40617
+ `, { encoding: "utf8", mode: 384 });
40618
+ try {
40619
+ await rename4(tempPath, filePath);
40620
+ await chmod2(filePath, 384);
40621
+ } catch (error) {
40622
+ await unlink4(tempPath).catch(() => void 0);
40623
+ throw error;
40624
+ }
40625
+ }
40626
+ function stableJson2(value) {
40627
+ if (Array.isArray(value)) return `[${value.map(stableJson2).join(",")}]`;
40628
+ if (value !== null && typeof value === "object") {
40629
+ const record = value;
40630
+ return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${stableJson2(record[key])}`).join(",")}}`;
40631
+ }
40632
+ return JSON.stringify(value) ?? "null";
40633
+ }
40372
40634
  async function writeJudgeCalibrationState(result, calibrationDir, identities, provenance) {
40373
- await mkdir18(calibrationDir, { recursive: true });
40635
+ await ensurePrivateDirectory(calibrationDir);
40374
40636
  const state = {
40375
40637
  kappa: result.kappa,
40376
40638
  sampleSize: result.sampleSize,
@@ -40386,9 +40648,10 @@ async function writeJudgeCalibrationState(result, calibrationDir, identities, pr
40386
40648
  const filePath = path37.join(calibrationDir, `${sanitizeCalibrationSegment(result.benchmarkId)}.json`);
40387
40649
  const tempPath = `${filePath}.${randomBytes3(6).toString("hex")}.tmp`;
40388
40650
  await writeFile17(tempPath, `${JSON.stringify(state, null, 2)}
40389
- `, "utf8");
40651
+ `, { encoding: "utf8", mode: 384 });
40390
40652
  try {
40391
40653
  await rename4(tempPath, filePath);
40654
+ await chmod2(filePath, 384);
40392
40655
  } catch (error) {
40393
40656
  await unlink4(tempPath).catch(() => void 0);
40394
40657
  throw error;
@@ -40434,6 +40697,10 @@ async function loadJudgeCalibrationState(benchmarkId, calibrationDir) {
40434
40697
  loaded.answerSetHash = answerSetHash;
40435
40698
  loaded.sliceQuestionIds = record.sliceQuestionIds;
40436
40699
  }
40700
+ if (typeof record.localJudgeConfigHash === "string" && /^[0-9a-f]{64}$/.test(record.localJudgeConfigHash) && typeof record.frontierJudgeConfigHash === "string" && /^[0-9a-f]{64}$/.test(record.frontierJudgeConfigHash)) {
40701
+ loaded.localJudgeConfigHash = record.localJudgeConfigHash;
40702
+ loaded.frontierJudgeConfigHash = record.frontierJudgeConfigHash;
40703
+ }
40437
40704
  const identityKeys = [
40438
40705
  "localJudgeProvider",
40439
40706
  "localJudgeModel",
@@ -41818,7 +42085,7 @@ function createMitigatedTarget(config) {
41818
42085
  }
41819
42086
 
41820
42087
  // src/coding-graph/generator.ts
41821
- import { createHash as createHash15 } from "crypto";
42088
+ import { createHash as createHash16 } from "crypto";
41822
42089
  function createSeededRng3(seed) {
41823
42090
  let state = seed >>> 0;
41824
42091
  return function rng() {
@@ -41847,7 +42114,7 @@ var EDGE_TYPE_WEIGHTS = [
41847
42114
  var PROVENANCE_VALUES = ["heuristic", "heuristic", "heuristic", "trace"];
41848
42115
  var AVG_BYTES_PER_LINE = 40;
41849
42116
  function hashContent(input) {
41850
- return createHash15("sha256").update(input).digest("hex").slice(0, 16);
42117
+ return createHash16("sha256").update(input).digest("hex").slice(0, 16);
41851
42118
  }
41852
42119
  function generateSyntheticRepo(config) {
41853
42120
  const rng = createSeededRng3(config.seed);
@@ -42413,6 +42680,7 @@ export {
42413
42680
  INTEGRITY_HASH_ALGORITHM,
42414
42681
  INTEGRITY_META_FIELDS,
42415
42682
  JUDGE_CALIBRATION_KAPPA_THRESHOLD,
42683
+ JUDGE_CALIBRATION_PROTOCOL_VERSION,
42416
42684
  LOCAL_LAB_PROVIDER_KINDS,
42417
42685
  LOCOMO_DATASET_FILENAMES,
42418
42686
  LOCOMO_FULL_TASK_COUNT,
@@ -42547,10 +42815,12 @@ export {
42547
42815
  getBenchmark,
42548
42816
  getBenchmarkLowerIsBetter,
42549
42817
  getMemoryEvalDimension,
42818
+ getProviderBackedJudgePromptIdentity,
42550
42819
  getRemnicVersion,
42551
42820
  hashBenchmarkArtifact,
42552
42821
  hashBytes,
42553
42822
  hashCanonicalJson,
42823
+ hashOrderedQuestionIds,
42554
42824
  hashString,
42555
42825
  integrityMetaIsComplete,
42556
42826
  interpretEffectSize,
@@ -42617,6 +42887,7 @@ export {
42617
42887
  resolveBenchmarkProgressLogging,
42618
42888
  resolveBenchmarkResultReference,
42619
42889
  resolveBenchmarkRunCount,
42890
+ resolveLocalLabJudgeProviderConfig,
42620
42891
  resolveLocalLabProfile,
42621
42892
  resolveLocalLabRole,
42622
42893
  resolveStructuredJudge,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/bench",
3
- "version": "9.6.24",
3
+ "version": "9.6.25",
4
4
  "description": "Retrieval latency ladder benchmarks + CI regression gates for @remnic/core",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -39,8 +39,8 @@
39
39
  "hyparquet": "^1.25.7",
40
40
  "yaml": "^2.4.2",
41
41
  "zod": "^3.24.0",
42
- "@remnic/coding-graph": "^9.6.24",
43
- "@remnic/core": "^9.6.24"
42
+ "@remnic/coding-graph": "^9.6.25",
43
+ "@remnic/core": "^9.6.25"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsup": "^8.5.1",