@remnic/bench 9.6.33 → 9.6.34

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
@@ -3465,6 +3465,83 @@ declare function buildProviderFreeLoCoMoRetrievalConfig(retrievalConfig: Record<
3465
3465
  declare function captureLoCoMoRetrievalTrace(options: CaptureLoCoMoRetrievalTraceOptions): Promise<LoCoMoRetrievalTraceReceipt>;
3466
3466
  declare function serializeLoCoMoRetrievalTraceReceipt(receipt: LoCoMoRetrievalTraceReceipt): string;
3467
3467
 
3468
+ declare const LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION: 1;
3469
+ declare const CATEGORIES: readonly ["single_hop", "multi_hop", "temporal", "open_domain", "adversarial"];
3470
+ declare const MECHANISMS: readonly ["real-core-visible-lcm-displacement", "lcm-selection-change", "composition-filter-displacement", "composition-digest-change", "budget-truncation-change", "mixed", "no-structural-delta", "insufficient-exact-lineage"];
3471
+ type LoCoMoRetrievalMechanism = (typeof MECHANISMS)[number];
3472
+ type LoCoMoCategory = (typeof CATEGORIES)[number];
3473
+ interface LoCoMoStructuralMultisetDelta {
3474
+ baselineCount: number;
3475
+ realCount: number;
3476
+ sharedCount: number;
3477
+ baselineOnlyCount: number;
3478
+ realOnlyCount: number;
3479
+ changed: boolean;
3480
+ }
3481
+ interface LoCoMoRetrievalTaskDelta {
3482
+ taskRef: {
3483
+ sha256: string;
3484
+ length: number;
3485
+ };
3486
+ category: LoCoMoCategory;
3487
+ mechanism: LoCoMoRetrievalMechanism;
3488
+ dimensions: {
3489
+ sectionVisibleChars: LoCoMoStructuralMultisetDelta;
3490
+ selections: LoCoMoStructuralMultisetDelta;
3491
+ archiveRows: LoCoMoStructuralMultisetDelta;
3492
+ lcmCandidates: LoCoMoStructuralMultisetDelta;
3493
+ coreResults: LoCoMoStructuralMultisetDelta;
3494
+ coreFilters: LoCoMoStructuralMultisetDelta;
3495
+ coreBudget: LoCoMoStructuralMultisetDelta;
3496
+ recallBudget: LoCoMoStructuralMultisetDelta;
3497
+ compositionPolicy: LoCoMoStructuralMultisetDelta;
3498
+ compositionDigests: LoCoMoStructuralMultisetDelta;
3499
+ };
3500
+ }
3501
+ interface LoCoMoRetrievalMechanismSummary {
3502
+ taskCount: number;
3503
+ mechanisms: Record<LoCoMoRetrievalMechanism, number>;
3504
+ }
3505
+ interface LoCoMoRetrievalTraceDeltaReport {
3506
+ schemaVersion: typeof LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION;
3507
+ benchmarkId: "locomo";
3508
+ analysisKind: "paired-retrieval-structural-delta";
3509
+ artifactHash: string;
3510
+ sensitivity: {
3511
+ classification: "restricted";
3512
+ contentEncoding: "sha256+length";
3513
+ containsGold: false;
3514
+ containsRawContent: false;
3515
+ containsRawIdentifiers: false;
3516
+ };
3517
+ comparison: {
3518
+ baselineArtifactHash: string;
3519
+ realArtifactHash: string;
3520
+ retrievalConfigHashesDiffer: true;
3521
+ taskOrderSha256: string;
3522
+ };
3523
+ overall: LoCoMoRetrievalMechanismSummary;
3524
+ categories: Array<LoCoMoRetrievalMechanismSummary & {
3525
+ category: LoCoMoCategory;
3526
+ }>;
3527
+ dominantMultiHopMechanism: {
3528
+ status: "supported" | "not-supported";
3529
+ mechanism?: LoCoMoRetrievalMechanism;
3530
+ count: number;
3531
+ taskCount: number;
3532
+ rule: "strict-majority-and-at-least-two";
3533
+ };
3534
+ tasks: LoCoMoRetrievalTaskDelta[];
3535
+ evidenceBoundary: {
3536
+ attribution: "observed-structural-mechanism-only";
3537
+ causalClaim: false;
3538
+ exactLineageRequired: true;
3539
+ explanation: string;
3540
+ };
3541
+ }
3542
+ declare function diagnoseLoCoMoRetrievalTraceDelta(baseline: LoCoMoRetrievalTraceReceipt, real: LoCoMoRetrievalTraceReceipt): LoCoMoRetrievalTraceDeltaReport;
3543
+ declare function serializeLoCoMoRetrievalTraceDelta(report: LoCoMoRetrievalTraceDeltaReport): string;
3544
+
3468
3545
  /**
3469
3546
  * Dataset-contamination guard.
3470
3547
  *
@@ -5538,4 +5615,4 @@ declare function checkCodingGraphRegression(report: CodingGraphBenchReport, base
5538
5615
  */
5539
5616
  declare function buildBaselineFromReport(report: CodingGraphBenchReport, note: string): CodingGraphBaseline;
5540
5617
 
5541
- 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 BenchRecallLineageStatus, type BenchRecallOptions, type BenchRecallSupportAssessment, type BenchRecallSupportRequest, type BenchRecallSupportStatus, type BenchRecallTrace, type BenchRecallTraceCoreCapture, type BenchRecallTraceLcmCandidate, type BenchRecallTraceRange, type BenchRecallTraceSection, type BenchRecallTraceSelection, type BenchRecallWithTraceResult, 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 CaptureLoCoMoRetrievalTraceOptions, 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, LOCOMO_RETRIEVAL_TRACE_BUDGET_VERSION, LOCOMO_RETRIEVAL_TRACE_SCHEMA_VERSION, LOCOMO_RETRIEVAL_TRACE_SELECTION_VERSION, LONG_MEM_EVAL_DATASET_FILENAMES, type LeaderboardArtifactWrite, type LettaAdapterConfig, LettaMemCorrectAdapter, type LlmJudge, type LlmProvider, type LoCoMoRetrievalSessionReceipt, type LoCoMoRetrievalStructuralTrace, type LoCoMoRetrievalTaskReceipt, type LoCoMoRetrievalTraceCoreCaptureReceipt, type LoCoMoRetrievalTraceProfile, type LoCoMoRetrievalTraceReceipt, type LoCoMoRetrievalTraceSelectionManifest, type LoCoMoRetrievalTraceSelector, 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, buildProviderFreeLoCoMoRetrievalConfig, buildSchemaTierFixture, buildSchemaTierSmokeFixture, calendarFixture, canonicalJsonStringify, captureLoCoMoRetrievalTrace, 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, getGitSha, 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, preflightLoCoMoRetrievalTraceCapture, 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, serializeLoCoMoRetrievalTraceReceipt, serializeSealedQrels, shuffleTasks, timed, verifyRubricDigest, writeBenchmarkArtifact, writeBenchmarkPublishFeed, writeBenchmarkReproManifest, writeBenchmarkResult, writeJudgeCalibrationState, writeLeaderboardArtifactsForResult, zeroScores };
5618
+ 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 BenchRecallLineageStatus, type BenchRecallOptions, type BenchRecallSupportAssessment, type BenchRecallSupportRequest, type BenchRecallSupportStatus, type BenchRecallTrace, type BenchRecallTraceCoreCapture, type BenchRecallTraceLcmCandidate, type BenchRecallTraceRange, type BenchRecallTraceSection, type BenchRecallTraceSelection, type BenchRecallWithTraceResult, 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 CaptureLoCoMoRetrievalTraceOptions, 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, LOCOMO_RETRIEVAL_TRACE_BUDGET_VERSION, LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION, LOCOMO_RETRIEVAL_TRACE_SCHEMA_VERSION, LOCOMO_RETRIEVAL_TRACE_SELECTION_VERSION, LONG_MEM_EVAL_DATASET_FILENAMES, type LeaderboardArtifactWrite, type LettaAdapterConfig, LettaMemCorrectAdapter, type LlmJudge, type LlmProvider, type LoCoMoCategory, type LoCoMoRetrievalMechanism, type LoCoMoRetrievalMechanismSummary, type LoCoMoRetrievalSessionReceipt, type LoCoMoRetrievalStructuralTrace, type LoCoMoRetrievalTaskDelta, type LoCoMoRetrievalTaskReceipt, type LoCoMoRetrievalTraceCoreCaptureReceipt, type LoCoMoRetrievalTraceDeltaReport, type LoCoMoRetrievalTraceProfile, type LoCoMoRetrievalTraceReceipt, type LoCoMoRetrievalTraceSelectionManifest, type LoCoMoRetrievalTraceSelector, type LoCoMoStructuralMultisetDelta, 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, buildProviderFreeLoCoMoRetrievalConfig, buildSchemaTierFixture, buildSchemaTierSmokeFixture, calendarFixture, canonicalJsonStringify, captureLoCoMoRetrievalTrace, 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, diagnoseLoCoMoRetrievalTraceDelta, diagnoseLoComoProfileDelta, diagnoseLoComoRecallDelta, discoverAllProviders, discoveryEndpointFor, emailFixture, entityRecall, exactMatch, extractMetrics as extractCodingGraphMetrics, extractMarkdownSectionsByTitle, f1Score, fixtureToAblationScenarios, formatHandoffNote, formatMissingDatasetError, generateReport, generateSyntheticRepo, getAblationCell, getBenchmark, getBenchmarkLowerIsBetter, getGitSha, 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, preflightLoCoMoRetrievalTraceCapture, 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, serializeLoCoMoRetrievalTraceDelta, serializeLoCoMoRetrievalTraceReceipt, serializeSealedQrels, shuffleTasks, timed, verifyRubricDigest, writeBenchmarkArtifact, writeBenchmarkPublishFeed, writeBenchmarkReproManifest, writeBenchmarkResult, writeJudgeCalibrationState, writeLeaderboardArtifactsForResult, zeroScores };
package/dist/index.js CHANGED
@@ -8998,8 +8998,8 @@ function parseRetryAfterMs(value) {
8998
8998
  if (Number.isNaN(asNumber2)) {
8999
8999
  const dateMs = Date.parse(value);
9000
9000
  if (Number.isFinite(dateMs)) {
9001
- const delta = dateMs - Date.now();
9002
- return delta > 0 ? Math.min(delta, MAX_RETRY_AFTER_S * 1e3) : 0;
9001
+ const delta2 = dateMs - Date.now();
9002
+ return delta2 > 0 ? Math.min(delta2, MAX_RETRY_AFTER_S * 1e3) : 0;
9003
9003
  }
9004
9004
  }
9005
9005
  return void 0;
@@ -16394,11 +16394,11 @@ function tokenize(value) {
16394
16394
  return normalizeText(value).replace(/[^\w\s]/g, " ").split(/\s+/).filter((token) => token.length > 0);
16395
16395
  }
16396
16396
  function frequencyMap(tokens) {
16397
- const counts = /* @__PURE__ */ new Map();
16397
+ const counts2 = /* @__PURE__ */ new Map();
16398
16398
  for (const token of tokens) {
16399
- counts.set(token, (counts.get(token) ?? 0) + 1);
16399
+ counts2.set(token, (counts2.get(token) ?? 0) + 1);
16400
16400
  }
16401
- return counts;
16401
+ return counts2;
16402
16402
  }
16403
16403
  function longestCommonSubsequence(left, right) {
16404
16404
  let previous = new Array(right.length + 1).fill(0);
@@ -16806,11 +16806,11 @@ function buildAmaBenchRecallQueries(qaPairs) {
16806
16806
  });
16807
16807
  }
16808
16808
  function questionCounts(qaPairs) {
16809
- const counts = /* @__PURE__ */ new Map();
16809
+ const counts2 = /* @__PURE__ */ new Map();
16810
16810
  for (const qa of qaPairs) {
16811
- counts.set(qa.question, (counts.get(qa.question) ?? 0) + 1);
16811
+ counts2.set(qa.question, (counts2.get(qa.question) ?? 0) + 1);
16812
16812
  }
16813
- return counts;
16813
+ return counts2;
16814
16814
  }
16815
16815
  function isInventoryHistoryQuestion(question) {
16816
16816
  const normalized = question.toLowerCase();
@@ -26454,11 +26454,11 @@ function officialF1(prediction, groundTruth) {
26454
26454
  return 2 * precision * recall / (precision + recall);
26455
26455
  }
26456
26456
  function countTokens(tokens) {
26457
- const counts = /* @__PURE__ */ new Map();
26457
+ const counts2 = /* @__PURE__ */ new Map();
26458
26458
  for (const token of tokens) {
26459
- counts.set(token, (counts.get(token) ?? 0) + 1);
26459
+ counts2.set(token, (counts2.get(token) ?? 0) + 1);
26460
26460
  }
26461
- return counts;
26461
+ return counts2;
26462
26462
  }
26463
26463
  function extractRecommendationMovies(output, movieCandidates, aliasCounts) {
26464
26464
  let recommendationText = output;
@@ -26524,14 +26524,14 @@ function stripTrailingRecommendationPunctuation(value) {
26524
26524
  return value.replace(/^["'`]+/g, "").replace(/["'`.!?;:]+$/g, "").trim();
26525
26525
  }
26526
26526
  function countMovieAliases(movieCandidates) {
26527
- const counts = /* @__PURE__ */ new Map();
26527
+ const counts2 = /* @__PURE__ */ new Map();
26528
26528
  for (const movie of movieCandidates) {
26529
26529
  for (const alias of movieAliases(movie)) {
26530
26530
  const normalizedAlias = alias.toLowerCase();
26531
- counts.set(normalizedAlias, (counts.get(normalizedAlias) ?? 0) + 1);
26531
+ counts2.set(normalizedAlias, (counts2.get(normalizedAlias) ?? 0) + 1);
26532
26532
  }
26533
26533
  }
26534
- return counts;
26534
+ return counts2;
26535
26535
  }
26536
26536
  function movieAliases(movie) {
26537
26537
  const aliases = [movie];
@@ -35611,10 +35611,10 @@ function uptakeLatency(log, corrections, cap) {
35611
35611
  let resolved = cap;
35612
35612
  let found = false;
35613
35613
  for (const entry of post) {
35614
- const delta = entry.turnIndex - correction.turnIndex;
35615
- if (delta > cap) break;
35614
+ const delta2 = entry.turnIndex - correction.turnIndex;
35615
+ if (delta2 > cap) break;
35616
35616
  if (probePassesForCorrection(entry, correction)) {
35617
- resolved = delta;
35617
+ resolved = delta2;
35618
35618
  found = true;
35619
35619
  break;
35620
35620
  }
@@ -38458,11 +38458,11 @@ function compareResults(baseline, candidate, threshold = 0.05, lowerIsBetter = /
38458
38458
  candidate,
38459
38459
  metricName
38460
38460
  );
38461
- const delta = aggregate.mean - baselineAggregate.mean;
38461
+ const delta2 = aggregate.mean - baselineAggregate.mean;
38462
38462
  const metricDelta = {
38463
38463
  baseline: baselineAggregate.mean,
38464
38464
  candidate: aggregate.mean,
38465
- delta,
38465
+ delta: delta2,
38466
38466
  percentChange: percentChange(aggregate.mean, baselineAggregate.mean),
38467
38467
  effectSize: {
38468
38468
  cohensD: 0,
@@ -39283,6 +39283,803 @@ function formatSignedScore2(value) {
39283
39283
  return `${value >= 0 ? "+" : ""}${formatScore2(value)}`;
39284
39284
  }
39285
39285
 
39286
+ // src/stats/locomo-retrieval-trace-delta.ts
39287
+ var LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION = 1;
39288
+ var CATEGORIES = ["single_hop", "multi_hop", "temporal", "open_domain", "adversarial"];
39289
+ var MECHANISMS = [
39290
+ "real-core-visible-lcm-displacement",
39291
+ "lcm-selection-change",
39292
+ "composition-filter-displacement",
39293
+ "composition-digest-change",
39294
+ "budget-truncation-change",
39295
+ "mixed",
39296
+ "no-structural-delta",
39297
+ "insufficient-exact-lineage"
39298
+ ];
39299
+ function diagnoseLoCoMoRetrievalTraceDelta(baseline, real) {
39300
+ assertReceipt(baseline, "baseline");
39301
+ assertReceipt(real, "real");
39302
+ assertComparable(baseline, real);
39303
+ const tasks = baseline.tasks.map(
39304
+ (baselineTask, index) => compareTask(baselineTask, real.tasks[index])
39305
+ );
39306
+ const overall = summarize(tasks);
39307
+ const categories = CATEGORIES.filter((category) => tasks.some((task) => task.category === category)).map(
39308
+ (category) => ({ category, ...summarize(tasks.filter((task) => task.category === category)) })
39309
+ );
39310
+ const multiHop = tasks.filter((task) => task.category === "multi_hop");
39311
+ const candidates = MECHANISMS.filter(
39312
+ (mechanism) => mechanism !== "no-structural-delta" && mechanism !== "insufficient-exact-lineage"
39313
+ ).map((mechanism) => ({ mechanism, count: multiHop.filter((task) => task.mechanism === mechanism).length }));
39314
+ candidates.sort((left, right) => right.count - left.count || left.mechanism.localeCompare(right.mechanism));
39315
+ const dominant = candidates[0];
39316
+ const supported = dominant !== void 0 && dominant.count >= 2 && dominant.count * 2 > multiHop.length;
39317
+ const withoutHash = {
39318
+ schemaVersion: LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION,
39319
+ benchmarkId: "locomo",
39320
+ analysisKind: "paired-retrieval-structural-delta",
39321
+ sensitivity: {
39322
+ classification: "restricted",
39323
+ contentEncoding: "sha256+length",
39324
+ containsGold: false,
39325
+ containsRawContent: false,
39326
+ containsRawIdentifiers: false
39327
+ },
39328
+ comparison: {
39329
+ baselineArtifactHash: baseline.artifactHash,
39330
+ realArtifactHash: real.artifactHash,
39331
+ retrievalConfigHashesDiffer: true,
39332
+ taskOrderSha256: hashCanonicalJson(baseline.tasks.map((task) => digestIdentifier(task.taskId)))
39333
+ },
39334
+ overall,
39335
+ categories,
39336
+ dominantMultiHopMechanism: {
39337
+ status: supported ? "supported" : "not-supported",
39338
+ ...supported && dominant ? { mechanism: dominant.mechanism } : {},
39339
+ count: dominant?.count ?? 0,
39340
+ taskCount: multiHop.length,
39341
+ rule: "strict-majority-and-at-least-two"
39342
+ },
39343
+ tasks,
39344
+ evidenceBoundary: {
39345
+ attribution: "observed-structural-mechanism-only",
39346
+ causalClaim: false,
39347
+ exactLineageRequired: true,
39348
+ explanation: "Labels summarize paired, content-free structural differences. The budget-truncation label denotes a fixed-budget tail-geometry transition with a stable recorded composition outcome; it does not prove identical prefix content. No label proves that a retrieval mechanism caused an answer or score change."
39349
+ }
39350
+ };
39351
+ return { ...withoutHash, artifactHash: hashCanonicalJson(withoutHash) };
39352
+ }
39353
+ function serializeLoCoMoRetrievalTraceDelta(report) {
39354
+ return `${canonicalJsonStringify(report, 2)}
39355
+ `;
39356
+ }
39357
+ function compareTask(baseline, real) {
39358
+ const category = categoryOf(baseline.taskId);
39359
+ const dimensions = {
39360
+ sectionVisibleChars: delta(signatures(baseline, "sectionVisibleChars"), signatures(real, "sectionVisibleChars")),
39361
+ selections: delta(signatures(baseline, "selections"), signatures(real, "selections")),
39362
+ archiveRows: delta(signatures(baseline, "archiveRows"), signatures(real, "archiveRows")),
39363
+ lcmCandidates: delta(signatures(baseline, "lcmCandidates"), signatures(real, "lcmCandidates")),
39364
+ coreResults: delta(signatures(baseline, "coreResults"), signatures(real, "coreResults")),
39365
+ coreFilters: delta(signatures(baseline, "coreFilters"), signatures(real, "coreFilters")),
39366
+ coreBudget: delta(signatures(baseline, "coreBudget"), signatures(real, "coreBudget")),
39367
+ recallBudget: delta(signatures(baseline, "recallBudget"), signatures(real, "recallBudget")),
39368
+ compositionPolicy: delta(signatures(baseline, "compositionPolicy"), signatures(real, "compositionPolicy")),
39369
+ compositionDigests: delta(signatures(baseline, "compositionDigests"), signatures(real, "compositionDigests"))
39370
+ };
39371
+ const hasCompleteExactLineage = (task) => {
39372
+ return task.sessions.every((session) => {
39373
+ const renderedSections = session.trace.sections.filter(
39374
+ (section) => section.source === "lcm-summary" || section.source === "raw-row"
39375
+ );
39376
+ const lcmSelections = session.trace.selections.filter(
39377
+ (selection) => selection.kind === "lcm-summary" || selection.kind === "raw-row"
39378
+ );
39379
+ const selectionMatchesSection = (selection) => renderedSections.some((section) => section.id === selection.sectionId && section.source === selection.kind);
39380
+ const renderedLineageComplete = renderedSections.every(
39381
+ (section) => lcmSelections.some(
39382
+ (selection) => selection.sectionId === section.id && selection.kind === section.source && hasExactSelectionLineage(selection)
39383
+ )
39384
+ );
39385
+ const candidateLineageComplete = session.trace.lcmCandidates.every(hasExactCandidateLineage);
39386
+ const hasCarrier = renderedSections.length > 0 && renderedLineageComplete || renderedSections.length === 0 && lcmSelections.length === 0 && session.trace.lcmCandidates.length > 0 && candidateLineageComplete;
39387
+ const hasLcmEvidence = renderedSections.length > 0 || lcmSelections.length > 0 || session.trace.lcmCandidates.length > 0;
39388
+ return (!hasLcmEvidence || hasCarrier) && lcmSelections.every(selectionMatchesSection) && lcmSelections.every(hasExactSelectionLineage) && (renderedSections.length > 0 || candidateLineageComplete) && (session.trace.coreCapture?.results.every(
39389
+ (result) => isSha256Hex(result.memoryIdRef.sha256) && result.memoryIdRef.length > 0
39390
+ ) ?? true);
39391
+ });
39392
+ };
39393
+ const exact = hasCompleteExactLineage(baseline) && hasCompleteExactLineage(real);
39394
+ const lcmSelectionsChanged = delta(
39395
+ exactSelectionSignatures(baseline, "lcm", "emitted"),
39396
+ exactSelectionSignatures(real, "lcm", "emitted")
39397
+ ).changed;
39398
+ const lcmArchiveRowsChanged = delta(
39399
+ exactArchiveRowSignatures(baseline, "lcm"),
39400
+ exactArchiveRowSignatures(real, "lcm")
39401
+ ).changed;
39402
+ const auxiliarySelectionsChanged = delta(
39403
+ exactSelectionSignatures(baseline, "auxiliary", "emitted"),
39404
+ exactSelectionSignatures(real, "auxiliary", "emitted")
39405
+ ).changed;
39406
+ const auxiliaryArchiveRowsChanged = delta(
39407
+ exactArchiveRowSignatures(baseline, "auxiliary"),
39408
+ exactArchiveRowSignatures(real, "auxiliary")
39409
+ ).changed;
39410
+ const core = dimensions.coreResults.changed || dimensions.coreFilters.changed || dimensions.coreBudget.changed;
39411
+ const baselineVisible = visibleCharsByGroup(baseline);
39412
+ const realVisible = visibleCharsByGroup(real);
39413
+ const coreSections = sectionGroupChanged(baseline, real, "core", "emitted");
39414
+ const lcmSections = sectionGroupChanged(baseline, real, "lcm", "emitted");
39415
+ const otherSections = sectionGroupChanged(baseline, real, "other", "emitted");
39416
+ const lcm = lcmSections || lcmSelectionsChanged || lcmArchiveRowsChanged || dimensions.lcmCandidates.changed;
39417
+ const auxiliary = auxiliarySelectionsChanged || auxiliaryArchiveRowsChanged;
39418
+ const other = otherSections || auxiliary;
39419
+ const composedSelectionsChanged = delta(
39420
+ structuralSelectionSignatures(baseline, "all", "composed", false),
39421
+ structuralSelectionSignatures(real, "all", "composed", false)
39422
+ ).changed;
39423
+ const allCandidatesChanged = delta(candidateSignatures(baseline, false), candidateSignatures(real, false)).changed;
39424
+ const compositionPolicy = dimensions.compositionPolicy.changed;
39425
+ const compositionDigests = dimensions.compositionDigests.changed;
39426
+ const compositionOutcomeChanged = compositionOutcomeSignature(baseline) !== compositionOutcomeSignature(real);
39427
+ const budget = dimensions.recallBudget.changed;
39428
+ const coreVisibleLcmDisplacement = core && lcm && realVisible.core > baselineVisible.core && realVisible.lcm < baselineVisible.lcm && !other && !budget && !compositionPolicy;
39429
+ const budgetTailGeometryTransition = budget && hasFixedBudgetTailGeometryTransition(baseline, real) && !core && !composedSelectionsChanged && !allCandidatesChanged && !compositionPolicy && !compositionOutcomeChanged;
39430
+ let mechanism;
39431
+ if (!exact) mechanism = "insufficient-exact-lineage";
39432
+ else if (coreVisibleLcmDisplacement) mechanism = "real-core-visible-lcm-displacement";
39433
+ else if (lcm && !core && !coreSections && !other && !budget && !compositionPolicy)
39434
+ mechanism = "lcm-selection-change";
39435
+ else if (budgetTailGeometryTransition) mechanism = "budget-truncation-change";
39436
+ else if (compositionPolicy && !core && !coreSections && !lcm && !other && !budget)
39437
+ mechanism = "composition-filter-displacement";
39438
+ else if (compositionDigests && !compositionPolicy && !core && !coreSections && !lcm && !other && !budget)
39439
+ mechanism = "composition-digest-change";
39440
+ else if (!core && !coreSections && !lcm && !other && !budget && !compositionPolicy && !compositionDigests)
39441
+ mechanism = "no-structural-delta";
39442
+ else mechanism = "mixed";
39443
+ return { taskRef: digestIdentifier(baseline.taskId), category, mechanism, dimensions };
39444
+ }
39445
+ function visibleCharsByGroup(task) {
39446
+ const output = { core: 0, lcm: 0, other: 0 };
39447
+ for (const session of task.sessions) {
39448
+ for (const section of session.trace.sections) {
39449
+ if (section.source === "core") {
39450
+ output.core += section.visibleChars;
39451
+ } else if (section.source === "lcm-summary" || section.source === "raw-row") {
39452
+ output.lcm += section.visibleChars;
39453
+ } else {
39454
+ output.other += section.visibleChars;
39455
+ }
39456
+ }
39457
+ }
39458
+ return output;
39459
+ }
39460
+ function sectionGroupChanged(baseline, real, group, projection) {
39461
+ const signaturesFor = (task) => {
39462
+ const output = [];
39463
+ task.sessions.forEach((session, sessionOrdinal) => {
39464
+ session.trace.sections.forEach((section, sectionOrdinal) => {
39465
+ if (sectionGroup(section.source) === group) {
39466
+ output.push(structuralSectionSignature(section, sessionOrdinal, sectionOrdinal, projection));
39467
+ }
39468
+ });
39469
+ });
39470
+ return output;
39471
+ };
39472
+ return delta(signaturesFor(baseline), signaturesFor(real)).changed;
39473
+ }
39474
+ function sectionGroup(source) {
39475
+ if (source === "core") return "core";
39476
+ if (source === "lcm-summary" || source === "raw-row") return "lcm";
39477
+ return "other";
39478
+ }
39479
+ function structuralSectionSignature(section, sessionOrdinal, sectionOrdinal, projection) {
39480
+ return hashCanonicalJson({
39481
+ sessionOrdinal,
39482
+ sectionOrdinal,
39483
+ sectionIdRef: digestIdentifier(section.id),
39484
+ source: section.source,
39485
+ separatorStart: section.separatorStart,
39486
+ contentStart: section.contentStart,
39487
+ contentEnd: section.contentEnd,
39488
+ composedStart: section.composedStart,
39489
+ composedEnd: section.composedEnd,
39490
+ ...projection === "emitted" ? {
39491
+ visibleStart: section.visibleStart,
39492
+ visibleEnd: section.visibleEnd,
39493
+ visibleChars: section.visibleChars
39494
+ } : {}
39495
+ });
39496
+ }
39497
+ function selectionInScope(selection, scope) {
39498
+ const isLcm = selection.kind === "lcm-summary" || selection.kind === "raw-row";
39499
+ return scope === "all" || (scope === "lcm" ? isLcm : !isLcm);
39500
+ }
39501
+ function exactSelectionSignatures(task, scope, projection) {
39502
+ return structuralSelectionSignatures(task, scope, projection, true);
39503
+ }
39504
+ function structuralSelectionSignatures(task, scope, projection, exactOnly) {
39505
+ const output = [];
39506
+ task.sessions.forEach((session, sessionOrdinal) => {
39507
+ for (const value of session.trace.selections) {
39508
+ if (!selectionInScope(value, scope) || exactOnly && !hasExactSelectionLineage(value)) continue;
39509
+ output.push(
39510
+ hashCanonicalJson({
39511
+ sessionOrdinal,
39512
+ sectionIdRef: digestIdentifier(value.sectionId),
39513
+ kind: value.kind,
39514
+ lineageStatus: value.lineageStatus,
39515
+ turnIndex: value.turnIndex,
39516
+ role: value.role,
39517
+ score: value.score,
39518
+ summary: value.summary,
39519
+ archiveRowIds: value.archiveRowIds,
39520
+ composedStart: value.composedStart,
39521
+ composedEnd: value.composedEnd,
39522
+ ...projection === "emitted" ? {
39523
+ visibleStart: value.visibleStart,
39524
+ visibleEnd: value.visibleEnd
39525
+ } : {}
39526
+ })
39527
+ );
39528
+ }
39529
+ });
39530
+ return output;
39531
+ }
39532
+ function exactArchiveRowSignatures(task, scope) {
39533
+ const output = [];
39534
+ task.sessions.forEach((session, sessionOrdinal) => {
39535
+ for (const value of session.trace.selections) {
39536
+ if (!selectionInScope(value, scope) || !hasExactSelectionLineage(value)) continue;
39537
+ for (const archiveRowId of value.archiveRowIds ?? []) {
39538
+ output.push(hashCanonicalJson({ sessionOrdinal, archiveRowId }));
39539
+ }
39540
+ }
39541
+ });
39542
+ return output;
39543
+ }
39544
+ function hasExactSelectionLineage(selection) {
39545
+ if (selection.lineageStatus !== "exact") return false;
39546
+ if (selection.kind === "lcm-summary") {
39547
+ return selection.summary !== void 0 && Number.isSafeInteger(selection.summary.depth) && selection.summary.depth >= 0 && Number.isSafeInteger(selection.summary.msgStart) && selection.summary.msgStart >= 0 && Number.isSafeInteger(selection.summary.msgEnd) && selection.summary.msgEnd >= selection.summary.msgStart;
39548
+ }
39549
+ return Array.isArray(selection.archiveRowIds) && selection.archiveRowIds.length > 0 && selection.archiveRowIds.every((id) => Number.isSafeInteger(id) && id > 0);
39550
+ }
39551
+ function hasExactCandidateLineage(candidate) {
39552
+ return candidate.lineageStatus === "exact" && Number.isSafeInteger(candidate.archiveRowId) && candidate.archiveRowId > 0;
39553
+ }
39554
+ function candidateSignatures(task, exactOnly) {
39555
+ const output = [];
39556
+ task.sessions.forEach((session, sessionOrdinal) => {
39557
+ for (const value of session.trace.lcmCandidates) {
39558
+ if (exactOnly && !hasExactCandidateLineage(value)) continue;
39559
+ output.push(
39560
+ hashCanonicalJson({
39561
+ sessionOrdinal,
39562
+ rank: value.rank,
39563
+ archiveRowId: value.archiveRowId,
39564
+ turnIndex: value.turnIndex,
39565
+ role: value.role,
39566
+ score: value.score,
39567
+ lineageStatus: value.lineageStatus
39568
+ })
39569
+ );
39570
+ }
39571
+ });
39572
+ return output;
39573
+ }
39574
+ function signatures(task, dimension) {
39575
+ if (dimension === "selections") return exactSelectionSignatures(task, "all", "emitted");
39576
+ if (dimension === "archiveRows") return exactArchiveRowSignatures(task, "all");
39577
+ if (dimension === "lcmCandidates") return candidateSignatures(task, true);
39578
+ if (dimension === "recallBudget") {
39579
+ return [
39580
+ hashCanonicalJson({
39581
+ recallBudgetChars: task.recallBudgetChars,
39582
+ budgets: task.sessions.map((session) => ({
39583
+ requestedChars: session.trace.budget.requestedChars,
39584
+ truncated: session.trace.budget.truncated
39585
+ }))
39586
+ })
39587
+ ];
39588
+ }
39589
+ if (dimension === "compositionPolicy") {
39590
+ return [
39591
+ hashCanonicalJson({
39592
+ mode: task.composition.mode,
39593
+ multiHopRecallComposition: task.composition.multiHopRecallComposition,
39594
+ selectedLines: task.composition.selectedLines.map((line) => ({
39595
+ inputOrdinal: line.inputOrdinal,
39596
+ stage: line.stage,
39597
+ hop: line.hop,
39598
+ visible: line.visible,
39599
+ outputStart: line.outputStart,
39600
+ outputEnd: line.outputEnd,
39601
+ visibleStart: line.visibleStart,
39602
+ visibleEnd: line.visibleEnd
39603
+ }))
39604
+ })
39605
+ ];
39606
+ }
39607
+ if (dimension === "compositionDigests") {
39608
+ return [
39609
+ hashCanonicalJson({
39610
+ input: task.composition.input,
39611
+ output: task.composition.output,
39612
+ selectedLines: task.composition.selectedLines.map((line) => ({ input: line.input, output: line.output }))
39613
+ })
39614
+ ];
39615
+ }
39616
+ const output = [];
39617
+ task.sessions.forEach((session, sessionOrdinal) => {
39618
+ const trace2 = session.trace;
39619
+ if (dimension === "sectionVisibleChars") {
39620
+ trace2.sections.forEach((value, sectionOrdinal) => {
39621
+ output.push(structuralSectionSignature(value, sessionOrdinal, sectionOrdinal, "emitted"));
39622
+ });
39623
+ } else if (dimension === "coreResults") {
39624
+ for (const [resultOrdinal, value] of (trace2.coreCapture?.results ?? []).entries())
39625
+ output.push(
39626
+ hashCanonicalJson({
39627
+ sessionOrdinal,
39628
+ resultOrdinal,
39629
+ memoryIdRef: value.memoryIdRef,
39630
+ servedBy: value.servedBy,
39631
+ scoreDecomposition: value.scoreDecomposition,
39632
+ admittedBy: value.admittedBy,
39633
+ rejectedBy: value.rejectedBy,
39634
+ disclosure: value.disclosure,
39635
+ estimatedTokens: value.estimatedTokens
39636
+ })
39637
+ );
39638
+ } else if (dimension === "coreFilters") {
39639
+ for (const value of trace2.coreCapture?.filters ?? [])
39640
+ output.push(
39641
+ hashCanonicalJson({
39642
+ sessionOrdinal,
39643
+ name: value.name,
39644
+ considered: value.considered,
39645
+ admitted: value.admitted
39646
+ })
39647
+ );
39648
+ } else if (dimension === "coreBudget") {
39649
+ if (trace2.coreCapture) output.push(hashCanonicalJson({ sessionOrdinal, ...trace2.coreCapture.budget }));
39650
+ }
39651
+ });
39652
+ return output;
39653
+ }
39654
+ function compositionOutcomeSignature(task) {
39655
+ return hashCanonicalJson({
39656
+ output: task.composition.output,
39657
+ selectedLines: task.composition.selectedLines.map((line) => ({ input: line.input, output: line.output }))
39658
+ });
39659
+ }
39660
+ function hasFixedBudgetTailGeometryTransition(baseline, real) {
39661
+ let sawTransition = false;
39662
+ for (let index = 0; index < baseline.sessions.length; index += 1) {
39663
+ const baselineSession = baseline.sessions[index];
39664
+ const realSession = real.sessions[index];
39665
+ const baselineTrace = baselineSession?.trace;
39666
+ const realTrace = realSession?.trace;
39667
+ if (!baselineSession || !realSession || !baselineTrace || !realTrace || baselineTrace.budget.requestedChars !== realTrace.budget.requestedChars) {
39668
+ return false;
39669
+ }
39670
+ if (baselineTrace.budget.truncated === realTrace.budget.truncated) {
39671
+ if (baselineTrace.budget.composedChars !== realTrace.budget.composedChars || baselineTrace.budget.returnedChars !== realTrace.budget.returnedChars || sectionGroupChanged(
39672
+ { ...baseline, sessions: [baselineSession] },
39673
+ { ...real, sessions: [realSession] },
39674
+ "core",
39675
+ "composed"
39676
+ ) || sectionGroupChanged(
39677
+ { ...baseline, sessions: [baselineSession] },
39678
+ { ...real, sessions: [realSession] },
39679
+ "lcm",
39680
+ "composed"
39681
+ ) || sectionGroupChanged(
39682
+ { ...baseline, sessions: [baselineSession] },
39683
+ { ...real, sessions: [realSession] },
39684
+ "other",
39685
+ "composed"
39686
+ )) {
39687
+ return false;
39688
+ }
39689
+ continue;
39690
+ }
39691
+ const shorter = baselineTrace.budget.truncated ? realTrace : baselineTrace;
39692
+ const longer = baselineTrace.budget.truncated ? baselineTrace : realTrace;
39693
+ const requested = shorter.budget.requestedChars;
39694
+ if (shorter.budget.truncated || !longer.budget.truncated || shorter.budget.composedChars > requested || longer.budget.composedChars <= requested || shorter.budget.returnedChars !== shorter.budget.composedChars || longer.budget.returnedChars !== requested || shorter.sections.length === 0 || shorter.sections.length !== longer.sections.length) {
39695
+ return false;
39696
+ }
39697
+ const finalIndex = shorter.sections.length - 1;
39698
+ for (let sectionIndex = 0; sectionIndex < finalIndex; sectionIndex += 1) {
39699
+ const shortSection = shorter.sections[sectionIndex];
39700
+ const longSection = longer.sections[sectionIndex];
39701
+ if (!shortSection || !longSection) return false;
39702
+ if (structuralSectionSignature(shortSection, 0, sectionIndex, "composed") !== structuralSectionSignature(longSection, 0, sectionIndex, "composed")) {
39703
+ return false;
39704
+ }
39705
+ }
39706
+ const shortFinal = shorter.sections[finalIndex];
39707
+ const longFinal = longer.sections[finalIndex];
39708
+ if (!shortFinal || !longFinal) return false;
39709
+ const extension = longFinal.composedEnd - shortFinal.composedEnd;
39710
+ if (shortFinal.id !== longFinal.id || shortFinal.source !== longFinal.source || shortFinal.separatorStart !== longFinal.separatorStart || shortFinal.contentStart !== longFinal.contentStart || shortFinal.composedStart !== longFinal.composedStart || shortFinal.contentEnd !== shortFinal.composedEnd || longFinal.contentEnd !== longFinal.composedEnd || shortFinal.composedEnd !== shorter.budget.composedChars || longFinal.composedEnd !== longer.budget.composedChars || extension <= 0 || longFinal.contentEnd - shortFinal.contentEnd !== extension) {
39711
+ return false;
39712
+ }
39713
+ sawTransition = true;
39714
+ }
39715
+ return sawTransition;
39716
+ }
39717
+ function delta(baseline, real) {
39718
+ const realCounts = counts(real);
39719
+ let sharedCount = 0;
39720
+ for (const entry of baseline) {
39721
+ const available = realCounts.get(entry) ?? 0;
39722
+ if (available > 0) {
39723
+ sharedCount += 1;
39724
+ realCounts.set(entry, available - 1);
39725
+ }
39726
+ }
39727
+ return {
39728
+ baselineCount: baseline.length,
39729
+ realCount: real.length,
39730
+ sharedCount,
39731
+ baselineOnlyCount: baseline.length - sharedCount,
39732
+ realOnlyCount: real.length - sharedCount,
39733
+ changed: sharedCount !== baseline.length || sharedCount !== real.length
39734
+ };
39735
+ }
39736
+ function counts(values) {
39737
+ const output = /* @__PURE__ */ new Map();
39738
+ for (const value of values) output.set(value, (output.get(value) ?? 0) + 1);
39739
+ return output;
39740
+ }
39741
+ function summarize(tasks) {
39742
+ const mechanisms = Object.fromEntries(MECHANISMS.map((mechanism) => [mechanism, 0]));
39743
+ for (const task of tasks) mechanisms[task.mechanism] += 1;
39744
+ return { taskCount: tasks.length, mechanisms };
39745
+ }
39746
+ function digestIdentifier(value) {
39747
+ return { sha256: hashString(value), length: value.length };
39748
+ }
39749
+ function categoryOf(taskId) {
39750
+ const category = CATEGORIES.find((candidate) => taskId.endsWith(`-${candidate}`));
39751
+ if (!category) throw new Error("LoCoMo retrieval trace task id has an unsupported category.");
39752
+ return category;
39753
+ }
39754
+ function assertReceipt(receipt, label) {
39755
+ if (!receipt || typeof receipt !== "object") throw new Error(`${label} receipt must be an object.`);
39756
+ assertFiniteJson(receipt, `${label} receipt`);
39757
+ assertExactKeys(
39758
+ receipt,
39759
+ ["schemaVersion", "benchmarkId", "captureKind", "artifactHash", "sensitivity", "provenance", "selection", "tasks"],
39760
+ `${label} receipt`
39761
+ );
39762
+ assertExactKeys(
39763
+ receipt.sensitivity,
39764
+ ["classification", "contentEncoding", "containsGold", "containsRawContent"],
39765
+ `${label} receipt.sensitivity`
39766
+ );
39767
+ assertExactKeys(
39768
+ receipt.provenance,
39769
+ [
39770
+ "gitSha",
39771
+ "remnicVersion",
39772
+ "runtimeProfile",
39773
+ "adapterMode",
39774
+ "replayExtractionMode",
39775
+ "providerFree",
39776
+ "dataset",
39777
+ "retrievalConfigSha256",
39778
+ "recallBudget"
39779
+ ],
39780
+ `${label} receipt.provenance`
39781
+ );
39782
+ assertExactKeys(receipt.provenance.dataset, ["id", "sha256"], `${label} receipt.provenance.dataset`);
39783
+ assertExactKeys(
39784
+ receipt.provenance.recallBudget,
39785
+ ["algorithm", "version"],
39786
+ `${label} receipt.provenance.recallBudget`
39787
+ );
39788
+ assertExactKeys(
39789
+ receipt.selection,
39790
+ ["algorithm", "version", "seed", "candidateCount", "selectedCount", "selectedTaskIds", "selectedTaskIdsSha256"],
39791
+ `${label} receipt.selection`
39792
+ );
39793
+ const { artifactHash, ...withoutHash } = receipt;
39794
+ if (!isSha256Hex(artifactHash) || hashCanonicalJson(withoutHash) !== artifactHash) {
39795
+ throw new Error(`${label} retrieval trace artifact hash verification failed.`);
39796
+ }
39797
+ if (receipt.schemaVersion !== 1 || receipt.benchmarkId !== "locomo" || receipt.captureKind !== "retrieval-only" || receipt.sensitivity.classification !== "restricted" || receipt.sensitivity.contentEncoding !== "sha256+length" || receipt.sensitivity.containsGold !== false || receipt.sensitivity.containsRawContent !== false || receipt.provenance.providerFree !== true || receipt.provenance.adapterMode !== "direct" || receipt.provenance.replayExtractionMode !== "skip" || receipt.provenance.dataset.id !== "locomo-10" || receipt.provenance.recallBudget.algorithm !== "benchmarkRecallBudgetForSessionCount" || receipt.provenance.recallBudget.version !== 1 || typeof receipt.provenance.gitSha !== "string" || receipt.provenance.gitSha.length === 0 || typeof receipt.provenance.remnicVersion !== "string" || receipt.provenance.remnicVersion.length === 0 || receipt.selection.version !== 1 || receipt.selection.algorithm !== "explicit-task-ids" && receipt.selection.algorithm !== "sha256-seeded-sample" || receipt.selection.algorithm === "explicit-task-ids" && receipt.selection.seed !== void 0 || receipt.selection.algorithm === "sha256-seeded-sample" && !isNonNegativeSafeInteger(receipt.selection.seed) || !Array.isArray(receipt.selection.selectedTaskIds) || receipt.selection.selectedTaskIds.some((taskId) => typeof taskId !== "string" || taskId.length === 0) || !Array.isArray(receipt.tasks) || !Number.isSafeInteger(receipt.selection.candidateCount) || !Number.isSafeInteger(receipt.selection.selectedCount) || receipt.selection.selectedCount <= 0 || receipt.selection.candidateCount < receipt.selection.selectedCount || receipt.selection.selectedCount !== receipt.tasks.length || receipt.selection.selectedTaskIds.length !== receipt.tasks.length || new Set(receipt.selection.selectedTaskIds).size !== receipt.selection.selectedTaskIds.length || new Set(receipt.tasks.map((task) => task.taskId)).size !== receipt.tasks.length || receipt.selection.selectedTaskIdsSha256 !== hashCanonicalJson(receipt.selection.selectedTaskIds) || receipt.selection.selectedTaskIds.some((taskId, index) => taskId !== receipt.tasks[index]?.taskId) || receipt.tasks.length === 0) {
39798
+ throw new Error(`${label} retrieval trace receipt violates the restricted provider-free contract.`);
39799
+ }
39800
+ if (!isSha256Hex(receipt.provenance.dataset.sha256) || !isSha256Hex(receipt.provenance.retrievalConfigSha256)) {
39801
+ throw new Error(`${label} retrieval trace receipt contains invalid provenance hashes.`);
39802
+ }
39803
+ for (const task of receipt.tasks) {
39804
+ assertExactKeys(
39805
+ task,
39806
+ ["taskId", "question", "recallBudgetChars", "sessions", "composition"],
39807
+ `${label} retrieval trace task`
39808
+ );
39809
+ if (typeof task.taskId !== "string" || task.taskId.length === 0 || !Array.isArray(task.sessions) || task.sessions.length === 0 || !isDigest(task.question) || !Number.isSafeInteger(task.recallBudgetChars) || task.recallBudgetChars < 0) {
39810
+ throw new Error(`${label} retrieval trace task structure is invalid.`);
39811
+ }
39812
+ categoryOf(task.taskId);
39813
+ assertComposition(task.composition, label);
39814
+ for (const session of task.sessions) {
39815
+ assertExactKeys(session, ["session", "trace"], `${label} retrieval trace session`);
39816
+ const trace2 = session.trace;
39817
+ const expectedComposedChars = Array.isArray(trace2.sections) ? trace2.sections.reduce((maximum, section) => Math.max(maximum, section.composedEnd), 0) : -1;
39818
+ assertExactKeys(
39819
+ trace2,
39820
+ ["schemaVersion", "sensitivity", "sections", "selections", "lcmCandidates", "coreCapture", "budget"],
39821
+ `${label} retrieval structural trace`
39822
+ );
39823
+ assertExactKeys(
39824
+ trace2.sensitivity,
39825
+ ["classification", "contentEncoding", "containsGold"],
39826
+ `${label} retrieval trace sensitivity`
39827
+ );
39828
+ assertExactKeys(
39829
+ trace2.budget,
39830
+ ["requestedChars", "composedChars", "returnedChars", "truncated"],
39831
+ `${label} retrieval trace budget`
39832
+ );
39833
+ if (!isDigest(session.session) || !trace2 || trace2.schemaVersion !== 1 || trace2.sensitivity.classification !== "restricted" || trace2.sensitivity.contentEncoding !== "sha256+length" || trace2.sensitivity.containsGold !== false || !Array.isArray(trace2.sections) || !Array.isArray(trace2.selections) || !Array.isArray(trace2.lcmCandidates) || new Set(trace2.sections.map((section) => section.id)).size !== trace2.sections.length || !isTraceBudget(trace2.budget) || trace2.budget.requestedChars !== task.recallBudgetChars || trace2.budget.composedChars !== expectedComposedChars || trace2.budget.returnedChars !== Math.min(trace2.budget.requestedChars, trace2.budget.composedChars) || trace2.budget.returnedChars > trace2.budget.composedChars || trace2.budget.truncated !== trace2.budget.returnedChars < trace2.budget.composedChars) {
39834
+ throw new Error(`${label} retrieval trace session structure is invalid.`);
39835
+ }
39836
+ let previousContentEnd = 0;
39837
+ for (const [sectionIndex, section] of trace2.sections.entries()) {
39838
+ assertExactKeys(
39839
+ section,
39840
+ [
39841
+ "id",
39842
+ "source",
39843
+ "separatorStart",
39844
+ "contentStart",
39845
+ "contentEnd",
39846
+ "composedStart",
39847
+ "composedEnd",
39848
+ "visibleStart",
39849
+ "visibleEnd",
39850
+ "visibleChars"
39851
+ ],
39852
+ `${label} retrieval trace section`
39853
+ );
39854
+ const expectedVisibleStart = Math.min(section.composedStart, trace2.budget.returnedChars);
39855
+ const expectedVisibleEnd = Math.max(
39856
+ expectedVisibleStart,
39857
+ Math.min(section.composedEnd, trace2.budget.returnedChars)
39858
+ );
39859
+ const expectedSeparatorStart = sectionIndex === 0 ? 0 : previousContentEnd;
39860
+ const expectedContentStart = expectedSeparatorStart + (sectionIndex === 0 ? 0 : 2);
39861
+ if (![
39862
+ "derived",
39863
+ "explicit-cue",
39864
+ "trajectory-analysis",
39865
+ "core",
39866
+ "evidence-pack",
39867
+ "lcm-summary",
39868
+ "raw-row"
39869
+ ].includes(section.source) || typeof section.id !== "string" || section.id.length === 0 || !isTraceRange(section) || ![section.separatorStart, section.contentStart, section.contentEnd].every(isNonNegativeSafeInteger) || section.separatorStart !== expectedSeparatorStart || section.contentStart !== expectedContentStart || section.contentEnd < section.contentStart || section.composedStart !== section.separatorStart || section.composedEnd !== section.contentEnd || !Number.isSafeInteger(section.visibleChars) || section.visibleChars < 0 || section.visibleStart !== expectedVisibleStart || section.visibleEnd !== expectedVisibleEnd || section.visibleChars !== expectedVisibleEnd - expectedVisibleStart) {
39870
+ throw new Error(`${label} retrieval trace section structure is invalid.`);
39871
+ }
39872
+ previousContentEnd = section.contentEnd;
39873
+ }
39874
+ for (const selection of trace2.selections) {
39875
+ assertExactKeys(
39876
+ selection,
39877
+ [
39878
+ "sectionId",
39879
+ "kind",
39880
+ "lineageStatus",
39881
+ "archiveRowIds",
39882
+ "turnIndex",
39883
+ "role",
39884
+ "score",
39885
+ "summary",
39886
+ "composedStart",
39887
+ "composedEnd",
39888
+ "visibleStart",
39889
+ "visibleEnd"
39890
+ ],
39891
+ `${label} retrieval trace selection`
39892
+ );
39893
+ if (selection.summary !== void 0) {
39894
+ assertExactKeys(
39895
+ selection.summary,
39896
+ ["depth", "msgStart", "msgEnd"],
39897
+ `${label} retrieval trace selection summary`
39898
+ );
39899
+ }
39900
+ const selectedSection = trace2.sections.find((section) => section.id === selection.sectionId);
39901
+ const expectedVisibleStart = Math.min(selection.composedStart, trace2.budget.returnedChars);
39902
+ const expectedVisibleEnd = Math.max(
39903
+ expectedVisibleStart,
39904
+ Math.min(selection.composedEnd, trace2.budget.returnedChars)
39905
+ );
39906
+ if (!["evidence-block", "trajectory-line", "lcm-summary", "raw-row"].includes(selection.kind) || typeof selection.sectionId !== "string" || selection.sectionId.length === 0 || selectedSection === void 0 || selection.kind === "lcm-summary" && selectedSection.source !== "lcm-summary" || selection.kind === "raw-row" && selectedSection.source !== "raw-row" || selection.kind === "evidence-block" && selectedSection.source !== "explicit-cue" && selectedSection.source !== "evidence-pack" || selection.kind === "trajectory-line" && selectedSection.source !== "trajectory-analysis" || !isTraceRange(selection) || selection.composedStart < selectedSection.contentStart || selection.composedEnd > selectedSection.contentEnd || selection.visibleStart !== expectedVisibleStart || selection.visibleEnd !== expectedVisibleEnd || selection.lineageStatus !== "exact" && selection.lineageStatus !== "unavailable" || selection.turnIndex !== void 0 && !isNonNegativeSafeInteger(selection.turnIndex) || selection.role !== void 0 && typeof selection.role !== "string" || selection.score !== void 0 && !Number.isFinite(selection.score) || selection.summary !== void 0 && ![selection.summary.depth, selection.summary.msgStart, selection.summary.msgEnd].every(
39907
+ isNonNegativeSafeInteger
39908
+ ) || selection.archiveRowIds !== void 0 && (!Array.isArray(selection.archiveRowIds) || selection.archiveRowIds.some((id) => !Number.isSafeInteger(id) || id <= 0))) {
39909
+ throw new Error(`${label} retrieval trace selection structure is invalid.`);
39910
+ }
39911
+ }
39912
+ for (const candidate of trace2.lcmCandidates) {
39913
+ assertExactKeys(
39914
+ candidate,
39915
+ ["rank", "archiveRowId", "turnIndex", "role", "score", "lineageStatus"],
39916
+ `${label} retrieval trace LCM candidate`
39917
+ );
39918
+ if (candidate.lineageStatus !== "exact" && candidate.lineageStatus !== "unavailable" || !Number.isSafeInteger(candidate.rank) || candidate.rank < 0 || !isNonNegativeSafeInteger(candidate.turnIndex) || typeof candidate.role !== "string" || candidate.score !== void 0 && !Number.isFinite(candidate.score) || candidate.lineageStatus === "exact" && candidate.archiveRowId === void 0 || candidate.lineageStatus === "unavailable" && candidate.archiveRowId !== void 0 || candidate.archiveRowId !== void 0 && (!Number.isSafeInteger(candidate.archiveRowId) || candidate.archiveRowId <= 0)) {
39919
+ throw new Error(`${label} retrieval trace LCM candidate structure is invalid.`);
39920
+ }
39921
+ }
39922
+ if (trace2.coreCapture) {
39923
+ assertExactKeys(trace2.coreCapture, ["budget", "filters", "results"], `${label} retrieval trace core capture`);
39924
+ assertExactKeys(trace2.coreCapture.budget, ["chars", "used"], `${label} retrieval trace core budget`);
39925
+ for (const filter of trace2.coreCapture.filters) {
39926
+ assertExactKeys(filter, ["name", "considered", "admitted"], `${label} retrieval trace core filter`);
39927
+ if (typeof filter.name !== "string" || !isNonNegativeSafeInteger(filter.considered) || !isNonNegativeSafeInteger(filter.admitted) || filter.admitted > filter.considered) {
39928
+ throw new Error(`${label} retrieval trace core filter structure is invalid.`);
39929
+ }
39930
+ }
39931
+ for (const result of trace2.coreCapture.results) {
39932
+ assertExactKeys(
39933
+ result,
39934
+ [
39935
+ "memoryIdRef",
39936
+ "servedBy",
39937
+ "scoreDecomposition",
39938
+ "admittedBy",
39939
+ "rejectedBy",
39940
+ "disclosure",
39941
+ "estimatedTokens"
39942
+ ],
39943
+ `${label} retrieval trace core result`
39944
+ );
39945
+ assertExactKeys(result.memoryIdRef, ["sha256", "length"], `${label} retrieval trace core memory reference`);
39946
+ assertExactKeys(
39947
+ result.scoreDecomposition,
39948
+ ["vector", "bm25", "importance", "mmrPenalty", "tierPrior", "reinforcementBoost", "final"],
39949
+ `${label} retrieval trace score decomposition`
39950
+ );
39951
+ if (typeof result.servedBy !== "string" || !Number.isFinite(result.scoreDecomposition.final) || !Object.values(result.scoreDecomposition).every((score) => score === void 0 || Number.isFinite(score)) || !Array.isArray(result.admittedBy) || result.admittedBy.some((reason) => typeof reason !== "string") || result.rejectedBy !== void 0 && typeof result.rejectedBy !== "string" || result.disclosure !== void 0 && !["chunk", "section", "raw"].includes(result.disclosure) || result.estimatedTokens !== void 0 && !isNonNegativeSafeInteger(result.estimatedTokens)) {
39952
+ throw new Error(`${label} retrieval trace core result structure is invalid.`);
39953
+ }
39954
+ }
39955
+ if (!isCountBudget(trace2.coreCapture.budget) || !Array.isArray(trace2.coreCapture.filters) || !Array.isArray(trace2.coreCapture.results) || trace2.coreCapture.results.some(
39956
+ (result) => !isSha256Hex(result.memoryIdRef?.sha256) || !Number.isSafeInteger(result.memoryIdRef?.length) || result.memoryIdRef.length <= 0
39957
+ )) {
39958
+ throw new Error(`${label} retrieval trace core capture structure is invalid.`);
39959
+ }
39960
+ }
39961
+ }
39962
+ }
39963
+ }
39964
+ function assertComposition(composition, label) {
39965
+ assertExactKeys(
39966
+ composition,
39967
+ ["schemaVersion", "mode", "multiHopRecallComposition", "input", "output", "selectedLines"],
39968
+ `${label} retrieval trace composition`
39969
+ );
39970
+ if (!composition || composition.schemaVersion !== 1 || composition.mode !== "focused" && composition.mode !== "fallback" || typeof composition.multiHopRecallComposition !== "boolean" || !isDigest(composition.input) || !isDigest(composition.output) || !Array.isArray(composition.selectedLines)) {
39971
+ throw new Error(`${label} retrieval trace composition structure is invalid.`);
39972
+ }
39973
+ let previousOutputEnd = -1;
39974
+ for (const line of composition.selectedLines) {
39975
+ assertExactKeys(
39976
+ line,
39977
+ [
39978
+ "inputOrdinal",
39979
+ "input",
39980
+ "output",
39981
+ "stage",
39982
+ "hop",
39983
+ "visible",
39984
+ "outputStart",
39985
+ "outputEnd",
39986
+ "visibleStart",
39987
+ "visibleEnd"
39988
+ ],
39989
+ `${label} retrieval trace composition line`
39990
+ );
39991
+ if (!isNonNegativeSafeInteger(line.inputOrdinal) || !isDigest(line.input) || !isDigest(line.output) || line.stage !== "direct" && line.stage !== "linked" || line.hop !== void 0 && !isNonNegativeSafeInteger(line.hop) || typeof line.visible !== "boolean" || ![line.outputStart, line.outputEnd, line.visibleStart, line.visibleEnd].every(isNonNegativeSafeInteger) || line.outputStart < previousOutputEnd || line.outputEnd < line.outputStart || line.outputEnd - line.outputStart !== line.output.charCount || line.visibleEnd < line.visibleStart || line.visibleStart > line.outputStart || line.visibleEnd > line.outputEnd || line.visibleEnd > composition.output.charCount || line.visibleStart < line.outputStart && line.visibleStart !== line.visibleEnd || line.visible !== (line.visibleStart === line.outputStart && line.visibleEnd === line.outputEnd)) {
39992
+ throw new Error(`${label} retrieval trace composition line structure is invalid.`);
39993
+ }
39994
+ previousOutputEnd = line.outputEnd;
39995
+ }
39996
+ }
39997
+ function assertExactKeys(value, allowed, label) {
39998
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
39999
+ throw new Error(`${label} must be an object.`);
40000
+ }
40001
+ const allowedKeys = new Set(allowed);
40002
+ if (Object.keys(value).some((key) => !allowedKeys.has(key))) {
40003
+ throw new Error(`${label} contains an unsupported field.`);
40004
+ }
40005
+ }
40006
+ function isNonNegativeSafeInteger(value) {
40007
+ return Number.isSafeInteger(value) && value >= 0;
40008
+ }
40009
+ function isTraceRange(value) {
40010
+ return [value.composedStart, value.composedEnd, value.visibleStart, value.visibleEnd].every(isNonNegativeSafeInteger) && value.composedEnd >= value.composedStart && value.visibleEnd >= value.visibleStart;
40011
+ }
40012
+ function isTraceBudget(value) {
40013
+ if (!value || typeof value !== "object") return false;
40014
+ const budget = value;
40015
+ return [budget.requestedChars, budget.composedChars, budget.returnedChars].every(
40016
+ (entry) => Number.isSafeInteger(entry) && entry >= 0
40017
+ ) && typeof budget.truncated === "boolean";
40018
+ }
40019
+ function isCountBudget(value) {
40020
+ if (!value || typeof value !== "object") return false;
40021
+ const budget = value;
40022
+ return [budget.chars, budget.used].every((entry) => Number.isSafeInteger(entry) && entry >= 0);
40023
+ }
40024
+ function assertFiniteJson(value, label) {
40025
+ if (value === null || typeof value === "string" || typeof value === "boolean") return;
40026
+ if (typeof value === "number") {
40027
+ if (!Number.isFinite(value)) throw new Error(`${label} contains a non-finite number.`);
40028
+ return;
40029
+ }
40030
+ if (Array.isArray(value)) {
40031
+ value.forEach((entry, index) => assertFiniteJson(entry, `${label}[${index}]`));
40032
+ return;
40033
+ }
40034
+ if (!value || typeof value !== "object") throw new Error(`${label} is not canonical JSON.`);
40035
+ for (const [key, entry] of Object.entries(value)) {
40036
+ if (entry === void 0) throw new Error(`${label}.${key} is undefined.`);
40037
+ assertFiniteJson(entry, `${label}.${key}`);
40038
+ }
40039
+ }
40040
+ function assertComparable(baseline, real) {
40041
+ if (baseline.provenance.runtimeProfile !== "baseline" || real.provenance.runtimeProfile !== "real") {
40042
+ throw new Error("Paired retrieval traces require baseline and real runtime profiles in that order.");
40043
+ }
40044
+ const matching = [
40045
+ [baseline.schemaVersion, real.schemaVersion],
40046
+ [baseline.benchmarkId, real.benchmarkId],
40047
+ [baseline.provenance.gitSha, real.provenance.gitSha],
40048
+ [baseline.provenance.remnicVersion, real.provenance.remnicVersion],
40049
+ [baseline.provenance.dataset.sha256, real.provenance.dataset.sha256],
40050
+ [baseline.provenance.recallBudget.version, real.provenance.recallBudget.version],
40051
+ [baseline.selection.selectedTaskIdsSha256, real.selection.selectedTaskIdsSha256],
40052
+ [canonicalJsonStringify(baseline.selection), canonicalJsonStringify(real.selection)],
40053
+ [baseline.tasks.length, real.tasks.length]
40054
+ ];
40055
+ if (matching.some(([left, right]) => left !== right))
40056
+ throw new Error("Paired retrieval trace provenance does not match.");
40057
+ if (baseline.provenance.retrievalConfigSha256 === real.provenance.retrievalConfigSha256) {
40058
+ throw new Error("Paired retrieval traces must use different baseline and real retrieval configuration hashes.");
40059
+ }
40060
+ baseline.tasks.forEach((left, index) => {
40061
+ const right = real.tasks[index];
40062
+ if (!right || left.taskId !== right.taskId || canonicalJsonStringify(left.question) !== canonicalJsonStringify(right.question) || left.recallBudgetChars !== right.recallBudgetChars || left.sessions.length !== right.sessions.length || left.composition.multiHopRecallComposition !== right.composition.multiHopRecallComposition) {
40063
+ throw new Error(`Paired retrieval trace task mismatch at index ${index}.`);
40064
+ }
40065
+ left.sessions.forEach((session, sessionIndex) => {
40066
+ const other = right.sessions[sessionIndex];
40067
+ if (!other || canonicalJsonStringify(session.session) !== canonicalJsonStringify(other.session)) {
40068
+ throw new Error(`Paired retrieval trace session mismatch at task ${index}, session ${sessionIndex}.`);
40069
+ }
40070
+ if (session.trace.budget.requestedChars !== other.trace.budget.requestedChars) {
40071
+ throw new Error(`Paired retrieval trace budget mismatch at task ${index}, session ${sessionIndex}.`);
40072
+ }
40073
+ });
40074
+ });
40075
+ }
40076
+ function isDigest(value) {
40077
+ if (!value || typeof value !== "object") return false;
40078
+ if (Object.keys(value).some((key) => !["sha256", "charCount", "lineCount"].includes(key))) return false;
40079
+ const digest = value;
40080
+ return isSha256Hex(digest.sha256) && Number.isSafeInteger(digest.charCount) && digest.charCount >= 0 && Number.isSafeInteger(digest.lineCount) && digest.lineCount >= 0;
40081
+ }
40082
+
39286
40083
  // src/benchmarks/published/locomo/retrieval-trace-runner.ts
39287
40084
  var LOCOMO_RETRIEVAL_TRACE_SCHEMA_VERSION = 1;
39288
40085
  var LOCOMO_RETRIEVAL_TRACE_SELECTION_VERSION = 1;
@@ -43497,6 +44294,7 @@ export {
43497
44294
  LOCOMO_RECALL_DIFF_LINE_LIMIT,
43498
44295
  LOCOMO_RECALL_EXCERPT_CHARS,
43499
44296
  LOCOMO_RETRIEVAL_TRACE_BUDGET_VERSION,
44297
+ LOCOMO_RETRIEVAL_TRACE_DELTA_SCHEMA_VERSION,
43500
44298
  LOCOMO_RETRIEVAL_TRACE_SCHEMA_VERSION,
43501
44299
  LOCOMO_RETRIEVAL_TRACE_SELECTION_VERSION,
43502
44300
  LONG_MEM_EVAL_DATASET_FILENAMES,
@@ -43611,6 +44409,7 @@ export {
43611
44409
  defaultBenchmarkBaselineDir,
43612
44410
  defaultBenchmarkPublishPath,
43613
44411
  deleteBenchmarkResults,
44412
+ diagnoseLoCoMoRetrievalTraceDelta,
43614
44413
  diagnoseLoComoProfileDelta,
43615
44414
  diagnoseLoComoRecallDelta,
43616
44415
  discoverAllProviders,
@@ -43739,6 +44538,7 @@ export {
43739
44538
  selectFixtureVariant,
43740
44539
  serializeBenchmarkArtifact,
43741
44540
  serializeJsonl,
44541
+ serializeLoCoMoRetrievalTraceDelta,
43742
44542
  serializeLoCoMoRetrievalTraceReceipt,
43743
44543
  serializeSealedQrels,
43744
44544
  shuffleTasks,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remnic/bench",
3
- "version": "9.6.33",
3
+ "version": "9.6.34",
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.33",
43
- "@remnic/core": "^9.6.33"
42
+ "@remnic/coding-graph": "^9.6.34",
43
+ "@remnic/core": "^9.6.34"
44
44
  },
45
45
  "devDependencies": {
46
46
  "tsup": "^8.5.1",