@remnic/bench 9.6.31 → 9.6.32
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 +109 -1
- package/dist/index.js +455 -77
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -165,6 +165,11 @@ interface BenchJudge {
|
|
|
165
165
|
interface BenchMemoryAdapter {
|
|
166
166
|
store(sessionId: string, messages: Message[], control?: BenchPhaseControl): Promise<void>;
|
|
167
167
|
recall(sessionId: string, query: string, budgetChars?: number, options?: BenchRecallOptions, control?: BenchPhaseControl): Promise<string>;
|
|
168
|
+
/**
|
|
169
|
+
* Optional diagnostic recall surface. The trace contains only structural
|
|
170
|
+
* lineage and budget metadata; it never includes recalled or source text.
|
|
171
|
+
*/
|
|
172
|
+
recallWithTrace?(sessionId: string, query: string, budgetChars?: number, options?: BenchRecallOptions, control?: BenchPhaseControl): Promise<BenchRecallWithTraceResult>;
|
|
168
173
|
/**
|
|
169
174
|
* Optionally assess support using the exact, final recall context that will
|
|
170
175
|
* be sent to the responder. Implementations may return `weak` only from
|
|
@@ -195,6 +200,109 @@ interface BenchRecallOptions {
|
|
|
195
200
|
/** Optional historical recall timestamp for benchmarks that expose query time. */
|
|
196
201
|
asOf?: string;
|
|
197
202
|
}
|
|
203
|
+
type BenchRecallLineageStatus = "exact" | "unavailable";
|
|
204
|
+
/**
|
|
205
|
+
* Half-open offsets measured in JavaScript string characters (UTF-16 code
|
|
206
|
+
* units), matching `String.length` and `String.prototype.slice`.
|
|
207
|
+
*/
|
|
208
|
+
interface BenchRecallTraceRange {
|
|
209
|
+
composedStart: number;
|
|
210
|
+
composedEnd: number;
|
|
211
|
+
visibleStart: number;
|
|
212
|
+
visibleEnd: number;
|
|
213
|
+
}
|
|
214
|
+
interface BenchRecallTraceSection extends BenchRecallTraceRange {
|
|
215
|
+
id: string;
|
|
216
|
+
source: "derived" | "explicit-cue" | "trajectory-analysis" | "core" | "evidence-pack" | "lcm-summary" | "raw-row";
|
|
217
|
+
/** Character offset where this section's leading separator starts. */
|
|
218
|
+
separatorStart: number;
|
|
219
|
+
/** Character offset where content starts after the optional `\n\n` separator. */
|
|
220
|
+
contentStart: number;
|
|
221
|
+
/** Exclusive character offset where section content ends. */
|
|
222
|
+
contentEnd: number;
|
|
223
|
+
/** Visible separator plus content characters attributed to this section. */
|
|
224
|
+
visibleChars: number;
|
|
225
|
+
}
|
|
226
|
+
interface BenchRecallTraceSelection extends BenchRecallTraceRange {
|
|
227
|
+
sectionId: string;
|
|
228
|
+
kind: "evidence-block" | "trajectory-line" | "lcm-summary" | "raw-row";
|
|
229
|
+
lineageStatus: BenchRecallLineageStatus;
|
|
230
|
+
archiveRowIds?: number[];
|
|
231
|
+
turnIndex?: number;
|
|
232
|
+
role?: string;
|
|
233
|
+
score?: number;
|
|
234
|
+
summary?: {
|
|
235
|
+
id: string;
|
|
236
|
+
depth: number;
|
|
237
|
+
msgStart: number;
|
|
238
|
+
msgEnd: number;
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
interface BenchRecallTraceLcmCandidate {
|
|
242
|
+
rank: number;
|
|
243
|
+
archiveRowId?: number;
|
|
244
|
+
turnIndex: number;
|
|
245
|
+
role: string;
|
|
246
|
+
score?: number;
|
|
247
|
+
lineageStatus: BenchRecallLineageStatus;
|
|
248
|
+
}
|
|
249
|
+
interface BenchRecallTraceCoreCapture {
|
|
250
|
+
snapshotId: string;
|
|
251
|
+
capturedAt: number;
|
|
252
|
+
traceId?: string;
|
|
253
|
+
budget: {
|
|
254
|
+
chars: number;
|
|
255
|
+
used: number;
|
|
256
|
+
};
|
|
257
|
+
filters: Array<{
|
|
258
|
+
name: string;
|
|
259
|
+
considered: number;
|
|
260
|
+
admitted: number;
|
|
261
|
+
}>;
|
|
262
|
+
results: Array<{
|
|
263
|
+
/** Content-free reference to the UTF-8 encoded core memory id. */
|
|
264
|
+
memoryIdRef: {
|
|
265
|
+
sha256: string;
|
|
266
|
+
length: number;
|
|
267
|
+
};
|
|
268
|
+
servedBy: string;
|
|
269
|
+
scoreDecomposition: {
|
|
270
|
+
vector?: number;
|
|
271
|
+
bm25?: number;
|
|
272
|
+
importance?: number;
|
|
273
|
+
mmrPenalty?: number;
|
|
274
|
+
tierPrior?: number;
|
|
275
|
+
reinforcementBoost?: number;
|
|
276
|
+
final: number;
|
|
277
|
+
};
|
|
278
|
+
admittedBy: string[];
|
|
279
|
+
rejectedBy?: string;
|
|
280
|
+
disclosure?: "chunk" | "section" | "raw";
|
|
281
|
+
estimatedTokens?: number;
|
|
282
|
+
}>;
|
|
283
|
+
}
|
|
284
|
+
interface BenchRecallTrace {
|
|
285
|
+
schemaVersion: 1;
|
|
286
|
+
sensitivity: {
|
|
287
|
+
classification: "restricted";
|
|
288
|
+
contentEncoding: "sha256+length";
|
|
289
|
+
containsGold: false;
|
|
290
|
+
};
|
|
291
|
+
sections: BenchRecallTraceSection[];
|
|
292
|
+
selections: BenchRecallTraceSelection[];
|
|
293
|
+
lcmCandidates: BenchRecallTraceLcmCandidate[];
|
|
294
|
+
coreCapture?: BenchRecallTraceCoreCapture;
|
|
295
|
+
budget: {
|
|
296
|
+
requestedChars: number;
|
|
297
|
+
composedChars: number;
|
|
298
|
+
returnedChars: number;
|
|
299
|
+
truncated: boolean;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
interface BenchRecallWithTraceResult {
|
|
303
|
+
text: string;
|
|
304
|
+
trace: BenchRecallTrace;
|
|
305
|
+
}
|
|
198
306
|
type LlmJudge = BenchJudge;
|
|
199
307
|
type MemorySystem = BenchMemoryAdapter;
|
|
200
308
|
|
|
@@ -5300,4 +5408,4 @@ declare function checkCodingGraphRegression(report: CodingGraphBenchReport, base
|
|
|
5300
5408
|
*/
|
|
5301
5409
|
declare function buildBaselineFromReport(report: CodingGraphBenchReport, note: string): CodingGraphBaseline;
|
|
5302
5410
|
|
|
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 };
|
|
5411
|
+
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 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
|
@@ -597,7 +597,7 @@ var LettaMemCorrectAdapter = class {
|
|
|
597
597
|
var REQUIRED_FRONTMATTER_FIELDS = ["title", "type", "state", "created", "see-also"];
|
|
598
598
|
|
|
599
599
|
// src/adapters/remnic-adapter.ts
|
|
600
|
-
import { createHash } from "crypto";
|
|
600
|
+
import { createHash as createHash2 } from "crypto";
|
|
601
601
|
import { execFile } from "child_process";
|
|
602
602
|
import {
|
|
603
603
|
chmod,
|
|
@@ -629,6 +629,226 @@ import {
|
|
|
629
629
|
parseEntityFile,
|
|
630
630
|
serializeEntityFile
|
|
631
631
|
} from "@remnic/core";
|
|
632
|
+
import {
|
|
633
|
+
lcmEvidenceIdentity
|
|
634
|
+
} from "@remnic/core/lcm";
|
|
635
|
+
|
|
636
|
+
// src/adapters/remnic-recall-trace.ts
|
|
637
|
+
import { createHash } from "crypto";
|
|
638
|
+
import {
|
|
639
|
+
lcmArchiveRowId
|
|
640
|
+
} from "@remnic/core/lcm";
|
|
641
|
+
function visibleRange(start, end, returnedChars) {
|
|
642
|
+
const visibleStart = Math.min(start, returnedChars);
|
|
643
|
+
return {
|
|
644
|
+
visibleStart,
|
|
645
|
+
visibleEnd: Math.max(visibleStart, Math.min(end, returnedChars))
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function projectBenchCoreCapture(snapshot) {
|
|
649
|
+
return {
|
|
650
|
+
snapshotId: snapshot.snapshotId,
|
|
651
|
+
capturedAt: snapshot.capturedAt,
|
|
652
|
+
...snapshot.traceId === void 0 ? {} : { traceId: snapshot.traceId },
|
|
653
|
+
budget: { chars: snapshot.budget.chars, used: snapshot.budget.used },
|
|
654
|
+
filters: snapshot.filters.map(({ name, considered, admitted }) => ({
|
|
655
|
+
name,
|
|
656
|
+
considered,
|
|
657
|
+
admitted
|
|
658
|
+
})),
|
|
659
|
+
results: snapshot.results.map((result) => {
|
|
660
|
+
const scores = result.scoreDecomposition;
|
|
661
|
+
return {
|
|
662
|
+
memoryIdRef: {
|
|
663
|
+
sha256: createHash("sha256").update(result.memoryId, "utf8").digest("hex"),
|
|
664
|
+
length: Buffer.byteLength(result.memoryId, "utf8")
|
|
665
|
+
},
|
|
666
|
+
servedBy: result.servedBy,
|
|
667
|
+
scoreDecomposition: {
|
|
668
|
+
...typeof scores.vector === "number" ? { vector: scores.vector } : {},
|
|
669
|
+
...typeof scores.bm25 === "number" ? { bm25: scores.bm25 } : {},
|
|
670
|
+
...typeof scores.importance === "number" ? { importance: scores.importance } : {},
|
|
671
|
+
...typeof scores.mmrPenalty === "number" ? { mmrPenalty: scores.mmrPenalty } : {},
|
|
672
|
+
...typeof scores.tierPrior === "number" ? { tierPrior: scores.tierPrior } : {},
|
|
673
|
+
...typeof scores.reinforcementBoost === "number" ? { reinforcementBoost: scores.reinforcementBoost } : {},
|
|
674
|
+
final: scores.final
|
|
675
|
+
},
|
|
676
|
+
admittedBy: [...result.admittedBy],
|
|
677
|
+
...result.rejectedBy === void 0 ? {} : { rejectedBy: result.rejectedBy },
|
|
678
|
+
...result.disclosure === void 0 ? {} : { disclosure: result.disclosure },
|
|
679
|
+
...result.estimatedTokens === void 0 ? {} : { estimatedTokens: result.estimatedTokens }
|
|
680
|
+
};
|
|
681
|
+
})
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
function createBenchRecallTraceRecorder(requestedChars) {
|
|
685
|
+
const sections = [];
|
|
686
|
+
const pendingSelections = [];
|
|
687
|
+
const lcmCandidates = [];
|
|
688
|
+
let composedChars = 0;
|
|
689
|
+
let coreCapture;
|
|
690
|
+
const sectionById = (sectionId) => {
|
|
691
|
+
const section = sections.find((entry) => entry.id === sectionId);
|
|
692
|
+
if (!section) throw new Error(`Unknown benchmark recall trace section: ${sectionId}`);
|
|
693
|
+
return section;
|
|
694
|
+
};
|
|
695
|
+
const appendRelativeSelection = (sectionId, kind, start, end, lineageStatus, fields = {}) => {
|
|
696
|
+
const section = sectionById(sectionId);
|
|
697
|
+
const contentLength = section.contentEnd - section.contentStart;
|
|
698
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start < 0 || end < start || end > contentLength) {
|
|
699
|
+
throw new Error(
|
|
700
|
+
`Invalid benchmark recall trace range for ${sectionId}: ${start}..${end}.`
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
pendingSelections.push({
|
|
704
|
+
sectionId,
|
|
705
|
+
kind,
|
|
706
|
+
lineageStatus,
|
|
707
|
+
composedStart: section.contentStart + start,
|
|
708
|
+
composedEnd: section.contentStart + end,
|
|
709
|
+
...fields
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
return {
|
|
713
|
+
appendSection(id, source, renderedLength) {
|
|
714
|
+
if (!Number.isSafeInteger(renderedLength) || renderedLength < 0) {
|
|
715
|
+
throw new Error("Benchmark recall trace section length must be a non-negative integer.");
|
|
716
|
+
}
|
|
717
|
+
if (sections.some((section) => section.id === id)) {
|
|
718
|
+
throw new Error(`Duplicate benchmark recall trace section: ${id}`);
|
|
719
|
+
}
|
|
720
|
+
const separatorStart = composedChars;
|
|
721
|
+
const contentStart = composedChars + (sections.length === 0 ? 0 : 2);
|
|
722
|
+
const contentEnd = contentStart + renderedLength;
|
|
723
|
+
sections.push({
|
|
724
|
+
id,
|
|
725
|
+
source,
|
|
726
|
+
separatorStart,
|
|
727
|
+
contentStart,
|
|
728
|
+
contentEnd,
|
|
729
|
+
composedStart: separatorStart,
|
|
730
|
+
composedEnd: contentEnd,
|
|
731
|
+
visibleStart: 0,
|
|
732
|
+
visibleEnd: 0,
|
|
733
|
+
visibleChars: 0
|
|
734
|
+
});
|
|
735
|
+
composedChars = contentEnd;
|
|
736
|
+
},
|
|
737
|
+
recordEvidenceSelections(sectionId, receipts) {
|
|
738
|
+
for (const receipt of receipts) {
|
|
739
|
+
appendRelativeSelection(
|
|
740
|
+
sectionId,
|
|
741
|
+
"evidence-block",
|
|
742
|
+
receipt.blockStart,
|
|
743
|
+
receipt.blockEnd,
|
|
744
|
+
receipt.item.archiveRowId === void 0 ? "unavailable" : "exact",
|
|
745
|
+
{
|
|
746
|
+
...receipt.item.archiveRowId === void 0 ? {} : { archiveRowIds: [receipt.item.archiveRowId] },
|
|
747
|
+
...receipt.item.turnIndex === void 0 ? {} : { turnIndex: receipt.item.turnIndex },
|
|
748
|
+
...receipt.item.role === void 0 ? {} : { role: receipt.item.role },
|
|
749
|
+
...receipt.item.score === void 0 ? {} : { score: receipt.item.score }
|
|
750
|
+
}
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
recordTrajectorySelections(sectionId, receipts) {
|
|
755
|
+
for (const receipt of receipts) {
|
|
756
|
+
appendRelativeSelection(
|
|
757
|
+
sectionId,
|
|
758
|
+
"trajectory-line",
|
|
759
|
+
receipt.lineStart,
|
|
760
|
+
receipt.lineEnd,
|
|
761
|
+
receipt.lineageStatus,
|
|
762
|
+
{
|
|
763
|
+
archiveRowIds: [
|
|
764
|
+
...receipt.actionArchiveRowIds,
|
|
765
|
+
...receipt.observationArchiveRowIds
|
|
766
|
+
]
|
|
767
|
+
}
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
recordSummarySelections(sectionId, receipts) {
|
|
772
|
+
for (const receipt of receipts) {
|
|
773
|
+
appendRelativeSelection(
|
|
774
|
+
sectionId,
|
|
775
|
+
"lcm-summary",
|
|
776
|
+
receipt.entryStart,
|
|
777
|
+
receipt.entryEnd,
|
|
778
|
+
"exact",
|
|
779
|
+
{
|
|
780
|
+
summary: {
|
|
781
|
+
id: receipt.id,
|
|
782
|
+
depth: receipt.depth,
|
|
783
|
+
msgStart: receipt.msgStart,
|
|
784
|
+
msgEnd: receipt.msgEnd
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
recordRawRow(sectionId, range, row) {
|
|
791
|
+
const archiveRowId = lcmArchiveRowId(row);
|
|
792
|
+
appendRelativeSelection(
|
|
793
|
+
sectionId,
|
|
794
|
+
"raw-row",
|
|
795
|
+
range.start,
|
|
796
|
+
range.end,
|
|
797
|
+
archiveRowId === void 0 ? "unavailable" : "exact",
|
|
798
|
+
{
|
|
799
|
+
...archiveRowId === void 0 ? {} : { archiveRowIds: [archiveRowId] },
|
|
800
|
+
turnIndex: row.turn_index,
|
|
801
|
+
role: row.role
|
|
802
|
+
}
|
|
803
|
+
);
|
|
804
|
+
},
|
|
805
|
+
recordLcmCandidate(candidate) {
|
|
806
|
+
lcmCandidates.push({ ...candidate });
|
|
807
|
+
},
|
|
808
|
+
recordCoreCapture(snapshot) {
|
|
809
|
+
coreCapture = snapshot ? projectBenchCoreCapture(snapshot) : void 0;
|
|
810
|
+
},
|
|
811
|
+
finalize(returnedChars) {
|
|
812
|
+
const normalizedReturnedChars = Math.max(0, Math.min(returnedChars, composedChars));
|
|
813
|
+
return {
|
|
814
|
+
schemaVersion: 1,
|
|
815
|
+
sensitivity: {
|
|
816
|
+
classification: "restricted",
|
|
817
|
+
contentEncoding: "sha256+length",
|
|
818
|
+
containsGold: false
|
|
819
|
+
},
|
|
820
|
+
sections: sections.map((section) => {
|
|
821
|
+
const visible = visibleRange(
|
|
822
|
+
section.composedStart,
|
|
823
|
+
section.composedEnd,
|
|
824
|
+
normalizedReturnedChars
|
|
825
|
+
);
|
|
826
|
+
return {
|
|
827
|
+
...section,
|
|
828
|
+
...visible,
|
|
829
|
+
visibleChars: visible.visibleEnd - visible.visibleStart
|
|
830
|
+
};
|
|
831
|
+
}),
|
|
832
|
+
selections: pendingSelections.map((selection) => ({
|
|
833
|
+
...selection,
|
|
834
|
+
...visibleRange(
|
|
835
|
+
selection.composedStart,
|
|
836
|
+
selection.composedEnd,
|
|
837
|
+
normalizedReturnedChars
|
|
838
|
+
)
|
|
839
|
+
})),
|
|
840
|
+
lcmCandidates: lcmCandidates.map((candidate) => ({ ...candidate })),
|
|
841
|
+
...coreCapture === void 0 ? {} : { coreCapture },
|
|
842
|
+
budget: {
|
|
843
|
+
requestedChars,
|
|
844
|
+
composedChars,
|
|
845
|
+
returnedChars: normalizedReturnedChars,
|
|
846
|
+
truncated: normalizedReturnedChars < composedChars
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
}
|
|
850
|
+
};
|
|
851
|
+
}
|
|
632
852
|
|
|
633
853
|
// src/recall-budget.ts
|
|
634
854
|
var DEFAULT_BENCH_RECALL_BUDGET_CHARS = 24e3;
|
|
@@ -1264,7 +1484,7 @@ function benchCoreMemoryTier(memory) {
|
|
|
1264
1484
|
return memory.path.includes(`${path.sep}cold${path.sep}`) ? "cold" : "hot";
|
|
1265
1485
|
}
|
|
1266
1486
|
function benchCoreMemorySource(sessionId) {
|
|
1267
|
-
return `bench-replay-${
|
|
1487
|
+
return `bench-replay-${createHash2("sha256").update(sessionId).digest("hex").slice(0, 16)}`;
|
|
1268
1488
|
}
|
|
1269
1489
|
function resolveSessionScopedCorrectionDecision(plan, ownedIds, phase) {
|
|
1270
1490
|
const actionTargets = [];
|
|
@@ -2009,7 +2229,8 @@ function createAdapterFactory(mode) {
|
|
|
2009
2229
|
}
|
|
2010
2230
|
return correctionAccess.service;
|
|
2011
2231
|
};
|
|
2012
|
-
|
|
2232
|
+
const composeRecall = /* @__PURE__ */ Symbol("benchRecallComposer");
|
|
2233
|
+
const adapter = {
|
|
2013
2234
|
async store(sessionId, messages, control) {
|
|
2014
2235
|
throwIfBenchPhaseAborted(control, "store");
|
|
2015
2236
|
sessionId = normalizeBenchSessionId(sessionId);
|
|
@@ -2128,7 +2349,7 @@ function createAdapterFactory(mode) {
|
|
|
2128
2349
|
throw error;
|
|
2129
2350
|
}
|
|
2130
2351
|
},
|
|
2131
|
-
async
|
|
2352
|
+
async [composeRecall](sessionId, query, budgetChars, recallOptions = {}, control, traceRecorder) {
|
|
2132
2353
|
throwIfBenchPhaseAborted(control, "recall");
|
|
2133
2354
|
const waitForRecall = (promise) => withBenchPhaseAbort(promise, control, "recall");
|
|
2134
2355
|
sessionId = normalizeBenchSessionId(sessionId);
|
|
@@ -2150,6 +2371,10 @@ function createAdapterFactory(mode) {
|
|
|
2150
2371
|
);
|
|
2151
2372
|
}
|
|
2152
2373
|
const sections = [];
|
|
2374
|
+
const appendSection = (id, source, rendered) => {
|
|
2375
|
+
traceRecorder?.appendSection(id, source, rendered.length);
|
|
2376
|
+
sections.push(rendered);
|
|
2377
|
+
};
|
|
2153
2378
|
let usedChars = 0;
|
|
2154
2379
|
const explicitReferences = historicalRecall ? [] : collectExplicitTurnReferences(query);
|
|
2155
2380
|
const hasExplicitReferences = explicitReferences.length > 0;
|
|
@@ -2175,7 +2400,7 @@ function createAdapterFactory(mode) {
|
|
|
2175
2400
|
}));
|
|
2176
2401
|
if (temporalIntervalEvidence) {
|
|
2177
2402
|
hasTemporalIntervalEvidence = true;
|
|
2178
|
-
|
|
2403
|
+
appendSection("temporal-interval", "derived", temporalIntervalEvidence);
|
|
2179
2404
|
usedChars += temporalIntervalEvidence.length;
|
|
2180
2405
|
}
|
|
2181
2406
|
}
|
|
@@ -2187,7 +2412,7 @@ function createAdapterFactory(mode) {
|
|
|
2187
2412
|
}));
|
|
2188
2413
|
if (dependencyVersionEvidence) {
|
|
2189
2414
|
hasDependencyVersionEvidence = true;
|
|
2190
|
-
|
|
2415
|
+
appendSection("dependency-version", "derived", dependencyVersionEvidence);
|
|
2191
2416
|
usedChars += dependencyVersionEvidence.length;
|
|
2192
2417
|
}
|
|
2193
2418
|
}
|
|
@@ -2199,7 +2424,7 @@ function createAdapterFactory(mode) {
|
|
|
2199
2424
|
maxChars: Math.min(3e3, Math.floor(budget * 0.25))
|
|
2200
2425
|
}));
|
|
2201
2426
|
if (latestQuantitativeEvidence) {
|
|
2202
|
-
|
|
2427
|
+
appendSection("latest-quantitative", "derived", latestQuantitativeEvidence);
|
|
2203
2428
|
usedChars += latestQuantitativeEvidence.length;
|
|
2204
2429
|
}
|
|
2205
2430
|
}
|
|
@@ -2211,10 +2436,11 @@ function createAdapterFactory(mode) {
|
|
|
2211
2436
|
}));
|
|
2212
2437
|
if (userImplementationTargetEvidence) {
|
|
2213
2438
|
hasUserImplementationTargetEvidence = true;
|
|
2214
|
-
|
|
2439
|
+
appendSection("implementation-targets", "derived", userImplementationTargetEvidence);
|
|
2215
2440
|
usedChars += userImplementationTargetEvidence.length;
|
|
2216
2441
|
}
|
|
2217
2442
|
}
|
|
2443
|
+
const explicitCueSelections = [];
|
|
2218
2444
|
const exactReferenceEvidence = historicalRecall || hasDependencyVersionEvidence ? "" : await waitForRecall(buildExplicitCueRecallSection({
|
|
2219
2445
|
engine,
|
|
2220
2446
|
sessionId,
|
|
@@ -2223,12 +2449,17 @@ function createAdapterFactory(mode) {
|
|
|
2223
2449
|
maxItemChars: CORE_EXPLICIT_CUE_MAX_ITEM_CHARS,
|
|
2224
2450
|
maxReferences: CORE_EXPLICIT_CUE_MAX_REFERENCES,
|
|
2225
2451
|
includeBenchmarkAnchorCues: sessionId.startsWith("beam-"),
|
|
2226
|
-
includeStructuredPlanCues: sessionId.startsWith("arena-")
|
|
2452
|
+
includeStructuredPlanCues: sessionId.startsWith("arena-"),
|
|
2453
|
+
...traceRecorder ? { onEvidenceSelected: (receipt) => {
|
|
2454
|
+
explicitCueSelections.push(receipt);
|
|
2455
|
+
} } : {}
|
|
2227
2456
|
}));
|
|
2228
2457
|
if (exactReferenceEvidence) {
|
|
2229
|
-
|
|
2458
|
+
appendSection("explicit-cue", "explicit-cue", exactReferenceEvidence);
|
|
2459
|
+
traceRecorder?.recordEvidenceSelections("explicit-cue", explicitCueSelections);
|
|
2230
2460
|
usedChars += exactReferenceEvidence.length;
|
|
2231
2461
|
}
|
|
2462
|
+
const trajectorySelections = [];
|
|
2232
2463
|
const trajectoryAnalysisEvidence = !historicalRecall && sessionId.startsWith("ama-") ? await waitForRecall(buildTrajectoryAnalysisRecallSection({
|
|
2233
2464
|
engine,
|
|
2234
2465
|
sessionId,
|
|
@@ -2236,10 +2467,17 @@ function createAdapterFactory(mode) {
|
|
|
2236
2467
|
maxChars: Math.min(
|
|
2237
2468
|
CORE_TRAJECTORY_ANALYSIS_MAX_CHARS,
|
|
2238
2469
|
Math.max(0, Math.floor((budget - usedChars) * 0.55))
|
|
2239
|
-
)
|
|
2470
|
+
),
|
|
2471
|
+
...traceRecorder ? { onLineSelected: (receipt) => {
|
|
2472
|
+
trajectorySelections.push(receipt);
|
|
2473
|
+
} } : {}
|
|
2240
2474
|
})) : "";
|
|
2241
2475
|
if (trajectoryAnalysisEvidence) {
|
|
2242
|
-
|
|
2476
|
+
appendSection("trajectory-analysis", "trajectory-analysis", trajectoryAnalysisEvidence);
|
|
2477
|
+
traceRecorder?.recordTrajectorySelections(
|
|
2478
|
+
"trajectory-analysis",
|
|
2479
|
+
trajectorySelections
|
|
2480
|
+
);
|
|
2243
2481
|
usedChars += trajectoryAnalysisEvidence.length;
|
|
2244
2482
|
}
|
|
2245
2483
|
if (includeCoreRecall && !requireDirectPersonalHistoryEvidence && !requireDirectTemporalEvidence && !hasTemporalIntervalEvidence && !hasDependencyVersionEvidence && !hasUserImplementationTargetEvidence) {
|
|
@@ -2252,17 +2490,27 @@ function createAdapterFactory(mode) {
|
|
|
2252
2490
|
)
|
|
2253
2491
|
)
|
|
2254
2492
|
);
|
|
2255
|
-
const
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2493
|
+
const coreOptions = {
|
|
2494
|
+
budgetCharsOverride: coreBudget,
|
|
2495
|
+
mode: "full",
|
|
2496
|
+
...control?.signal ? { abortSignal: control.signal } : {},
|
|
2497
|
+
...recallAsOf ? { asOf: recallAsOf } : {}
|
|
2498
|
+
};
|
|
2499
|
+
const coreRecall = traceRecorder ? await withBenchPhaseAbort(
|
|
2500
|
+
state.orchestrator.recallWithXrayCapture(query, sessionId, coreOptions),
|
|
2501
|
+
control,
|
|
2502
|
+
"recall",
|
|
2503
|
+
{ waitForCompletionOnAbort: true }
|
|
2504
|
+
).then((capture) => {
|
|
2505
|
+
traceRecorder.recordCoreCapture(capture.snapshot);
|
|
2506
|
+
return capture.result;
|
|
2507
|
+
}) : await waitForRecall(
|
|
2508
|
+
state.orchestrator.recall(query, sessionId, coreOptions)
|
|
2261
2509
|
);
|
|
2262
2510
|
if (coreRecall.trim().length > 0) {
|
|
2263
2511
|
const section = `## Remnic recall pipeline
|
|
2264
2512
|
${coreRecall.trim()}`;
|
|
2265
|
-
|
|
2513
|
+
appendSection("core", "core", section);
|
|
2266
2514
|
usedChars += section.length;
|
|
2267
2515
|
}
|
|
2268
2516
|
}
|
|
@@ -2273,7 +2521,7 @@ ${coreRecall.trim()}`;
|
|
|
2273
2521
|
"## Remnic historical recall",
|
|
2274
2522
|
`No historically valid Remnic memories matched this query as of ${recallAsOf}.`
|
|
2275
2523
|
].join("\n");
|
|
2276
|
-
|
|
2524
|
+
appendSection("historical-empty", "derived", section);
|
|
2277
2525
|
usedChars += section.length;
|
|
2278
2526
|
}
|
|
2279
2527
|
}
|
|
@@ -2289,6 +2537,30 @@ ${coreRecall.trim()}`;
|
|
|
2289
2537
|
sessionId
|
|
2290
2538
|
)
|
|
2291
2539
|
);
|
|
2540
|
+
const exactSearchHits = /* @__PURE__ */ new Map();
|
|
2541
|
+
const uniqueLegacySearchHits = /* @__PURE__ */ new Map();
|
|
2542
|
+
const ambiguousLegacySearchHitIds = /* @__PURE__ */ new Set();
|
|
2543
|
+
searchResults.forEach((result, rank) => {
|
|
2544
|
+
const identity = lcmEvidenceIdentity(result, result.session_id);
|
|
2545
|
+
if (identity.archiveRowId !== void 0 && !exactSearchHits.has(identity.id)) {
|
|
2546
|
+
exactSearchHits.set(identity.id, result);
|
|
2547
|
+
} else if (identity.archiveRowId === void 0) {
|
|
2548
|
+
if (uniqueLegacySearchHits.has(identity.id)) {
|
|
2549
|
+
uniqueLegacySearchHits.delete(identity.id);
|
|
2550
|
+
ambiguousLegacySearchHitIds.add(identity.id);
|
|
2551
|
+
} else if (!ambiguousLegacySearchHitIds.has(identity.id)) {
|
|
2552
|
+
uniqueLegacySearchHits.set(identity.id, result);
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
traceRecorder?.recordLcmCandidate({
|
|
2556
|
+
rank: rank + 1,
|
|
2557
|
+
...identity.archiveRowId === void 0 ? {} : { archiveRowId: identity.archiveRowId },
|
|
2558
|
+
turnIndex: result.turn_index,
|
|
2559
|
+
role: result.role,
|
|
2560
|
+
...typeof result.score === "number" ? { score: result.score } : {},
|
|
2561
|
+
lineageStatus: identity.archiveRowId === void 0 ? "unavailable" : "exact"
|
|
2562
|
+
});
|
|
2563
|
+
});
|
|
2292
2564
|
if (searchResults.length > 0) {
|
|
2293
2565
|
const evidenceItems = [];
|
|
2294
2566
|
const directTemporalEvidenceItems = [];
|
|
@@ -2307,8 +2579,20 @@ ${coreRecall.trim()}`;
|
|
|
2307
2579
|
includeCoreRecall ? 1600 : 600
|
|
2308
2580
|
)
|
|
2309
2581
|
);
|
|
2582
|
+
const expandedIdentityCounts = /* @__PURE__ */ new Map();
|
|
2583
|
+
for (const message of expanded) {
|
|
2584
|
+
const expandedIdentity = lcmEvidenceIdentity(
|
|
2585
|
+
message,
|
|
2586
|
+
result.session_id
|
|
2587
|
+
);
|
|
2588
|
+
expandedIdentityCounts.set(
|
|
2589
|
+
expandedIdentity.id,
|
|
2590
|
+
(expandedIdentityCounts.get(expandedIdentity.id) ?? 0) + 1
|
|
2591
|
+
);
|
|
2592
|
+
}
|
|
2310
2593
|
if (expanded.length === 0) {
|
|
2311
|
-
const
|
|
2594
|
+
const identity = lcmEvidenceIdentity(result, result.session_id);
|
|
2595
|
+
const { id } = identity;
|
|
2312
2596
|
if (!directTemporalTurnIds.has(id) && shouldIncludeDirectTemporalEvidence(
|
|
2313
2597
|
result.content,
|
|
2314
2598
|
query,
|
|
@@ -2317,6 +2601,7 @@ ${coreRecall.trim()}`;
|
|
|
2317
2601
|
directTemporalTurnIds.add(id);
|
|
2318
2602
|
directTemporalEvidenceItems.push({
|
|
2319
2603
|
id,
|
|
2604
|
+
...identity.archiveRowId === void 0 ? {} : { archiveRowId: identity.archiveRowId },
|
|
2320
2605
|
sessionId: result.session_id,
|
|
2321
2606
|
turnIndex: result.turn_index,
|
|
2322
2607
|
role: result.role,
|
|
@@ -2336,6 +2621,7 @@ ${coreRecall.trim()}`;
|
|
|
2336
2621
|
seenTurns.add(id);
|
|
2337
2622
|
evidenceItems.push({
|
|
2338
2623
|
id,
|
|
2624
|
+
...identity.archiveRowId === void 0 ? {} : { archiveRowId: identity.archiveRowId },
|
|
2339
2625
|
sessionId: result.session_id,
|
|
2340
2626
|
turnIndex: result.turn_index,
|
|
2341
2627
|
role: result.role,
|
|
@@ -2346,7 +2632,10 @@ ${coreRecall.trim()}`;
|
|
|
2346
2632
|
continue;
|
|
2347
2633
|
}
|
|
2348
2634
|
for (const message of expanded) {
|
|
2349
|
-
const
|
|
2635
|
+
const identity = lcmEvidenceIdentity(message, result.session_id);
|
|
2636
|
+
const { id } = identity;
|
|
2637
|
+
const attributableSearchHit = identity.archiveRowId === void 0 ? expandedIdentityCounts.get(identity.id) === 1 ? uniqueLegacySearchHits.get(identity.id) : void 0 : exactSearchHits.get(identity.id);
|
|
2638
|
+
const attributableScore = typeof attributableSearchHit?.score === "number" ? attributableSearchHit.score : void 0;
|
|
2350
2639
|
if (seenTurns.has(id)) continue;
|
|
2351
2640
|
if (!directTemporalTurnIds.has(id) && shouldIncludeDirectTemporalEvidence(
|
|
2352
2641
|
message.content,
|
|
@@ -2356,11 +2645,12 @@ ${coreRecall.trim()}`;
|
|
|
2356
2645
|
directTemporalTurnIds.add(id);
|
|
2357
2646
|
directTemporalEvidenceItems.push({
|
|
2358
2647
|
id,
|
|
2648
|
+
...identity.archiveRowId === void 0 ? {} : { archiveRowId: identity.archiveRowId },
|
|
2359
2649
|
sessionId: result.session_id,
|
|
2360
2650
|
turnIndex: message.turn_index,
|
|
2361
2651
|
role: message.role,
|
|
2362
2652
|
content: message.content,
|
|
2363
|
-
...
|
|
2653
|
+
...attributableScore === void 0 ? {} : { score: attributableScore }
|
|
2364
2654
|
});
|
|
2365
2655
|
}
|
|
2366
2656
|
if (!shouldIncludeFocusedSearchEvidence(
|
|
@@ -2377,18 +2667,23 @@ ${coreRecall.trim()}`;
|
|
|
2377
2667
|
seenTurns.add(id);
|
|
2378
2668
|
evidenceItems.push({
|
|
2379
2669
|
id,
|
|
2670
|
+
...identity.archiveRowId === void 0 ? {} : { archiveRowId: identity.archiveRowId },
|
|
2380
2671
|
sessionId: result.session_id,
|
|
2381
2672
|
turnIndex: message.turn_index,
|
|
2382
2673
|
role: message.role,
|
|
2383
2674
|
content: message.content,
|
|
2384
|
-
...
|
|
2675
|
+
...attributableScore === void 0 ? {} : { score: attributableScore }
|
|
2385
2676
|
});
|
|
2386
2677
|
}
|
|
2387
2678
|
}
|
|
2679
|
+
const directTemporalSelections = [];
|
|
2388
2680
|
const directTemporalEvidence = buildEvidencePack(directTemporalEvidenceItems, {
|
|
2389
2681
|
title: "Direct temporal evidence",
|
|
2390
2682
|
maxChars: Math.min(searchBudget, 3e3),
|
|
2391
|
-
maxItemChars: 900
|
|
2683
|
+
maxItemChars: 900,
|
|
2684
|
+
...traceRecorder ? { onSelection: (receipt) => {
|
|
2685
|
+
directTemporalSelections.push(receipt);
|
|
2686
|
+
} } : {}
|
|
2392
2687
|
});
|
|
2393
2688
|
let remainingSearchBudget = searchBudget;
|
|
2394
2689
|
if (directTemporalEvidence) {
|
|
@@ -2396,7 +2691,11 @@ ${coreRecall.trim()}`;
|
|
|
2396
2691
|
directTemporalEvidence,
|
|
2397
2692
|
"These direct temporal statements match the question wording. Prefer them over indirect schedule-update context unless the question asks for the latest or current value."
|
|
2398
2693
|
].join("\n\n");
|
|
2399
|
-
|
|
2694
|
+
appendSection("direct-temporal", "evidence-pack", section);
|
|
2695
|
+
traceRecorder?.recordEvidenceSelections(
|
|
2696
|
+
"direct-temporal",
|
|
2697
|
+
directTemporalSelections
|
|
2698
|
+
);
|
|
2400
2699
|
usedChars += section.length;
|
|
2401
2700
|
remainingSearchBudget = 0;
|
|
2402
2701
|
}
|
|
@@ -2405,19 +2704,27 @@ ${coreRecall.trim()}`;
|
|
|
2405
2704
|
evidenceItems
|
|
2406
2705
|
);
|
|
2407
2706
|
if (contradictionGuidance) {
|
|
2408
|
-
|
|
2707
|
+
appendSection("contradiction-guidance", "derived", contradictionGuidance);
|
|
2409
2708
|
usedChars += contradictionGuidance.length;
|
|
2410
2709
|
}
|
|
2710
|
+
const searchSelections = [];
|
|
2411
2711
|
const searchEvidence = buildEvidencePack(
|
|
2412
2712
|
directTemporalEvidence ? evidenceItems.filter((item) => !directTemporalTurnIds.has(item.id)) : evidenceItems,
|
|
2413
2713
|
{
|
|
2414
2714
|
title: "Search evidence",
|
|
2415
2715
|
maxChars: remainingSearchBudget,
|
|
2416
|
-
maxItemChars: 900
|
|
2716
|
+
maxItemChars: 900,
|
|
2717
|
+
...traceRecorder ? { onSelection: (receipt) => {
|
|
2718
|
+
searchSelections.push(receipt);
|
|
2719
|
+
} } : {}
|
|
2417
2720
|
}
|
|
2418
2721
|
);
|
|
2419
2722
|
if (searchEvidence) {
|
|
2420
|
-
|
|
2723
|
+
appendSection("search-evidence", "evidence-pack", searchEvidence);
|
|
2724
|
+
traceRecorder?.recordEvidenceSelections(
|
|
2725
|
+
"search-evidence",
|
|
2726
|
+
searchSelections
|
|
2727
|
+
);
|
|
2421
2728
|
usedChars += searchEvidence.length;
|
|
2422
2729
|
}
|
|
2423
2730
|
}
|
|
@@ -2429,17 +2736,26 @@ ${coreRecall.trim()}`;
|
|
|
2429
2736
|
"## Remnic recall sufficiency",
|
|
2430
2737
|
"No direct evidence found for the requested personal background or previous development projects in this session."
|
|
2431
2738
|
].join("\n");
|
|
2432
|
-
|
|
2739
|
+
appendSection("personal-history-empty", "derived", section);
|
|
2433
2740
|
usedChars += section.length;
|
|
2434
2741
|
}
|
|
2435
2742
|
}
|
|
2436
2743
|
if (!suppressBroadSummary) {
|
|
2437
2744
|
const summaryBudget = Math.max(0, budget - usedChars - 4);
|
|
2438
|
-
const
|
|
2745
|
+
const summaryCapture = traceRecorder && engine.assembleRecallWithTrace ? await waitForRecall(
|
|
2746
|
+
engine.assembleRecallWithTrace(sessionId, summaryBudget)
|
|
2747
|
+
) : void 0;
|
|
2748
|
+
const recallText = summaryCapture?.text ?? await waitForRecall(
|
|
2439
2749
|
engine.assembleRecall(sessionId, summaryBudget)
|
|
2440
2750
|
);
|
|
2441
2751
|
if (recallText) {
|
|
2442
|
-
|
|
2752
|
+
appendSection("lcm-summary", "lcm-summary", recallText);
|
|
2753
|
+
if (summaryCapture) {
|
|
2754
|
+
traceRecorder?.recordSummarySelections(
|
|
2755
|
+
"lcm-summary",
|
|
2756
|
+
summaryCapture.selectedSummaries
|
|
2757
|
+
);
|
|
2758
|
+
}
|
|
2443
2759
|
}
|
|
2444
2760
|
}
|
|
2445
2761
|
if (!historicalRecall && sections.length === 0) {
|
|
@@ -2455,16 +2771,50 @@ ${coreRecall.trim()}`;
|
|
|
2455
2771
|
)
|
|
2456
2772
|
);
|
|
2457
2773
|
if (expanded.length > 0) {
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2774
|
+
const prefix = "## Raw messages\n";
|
|
2775
|
+
const rows = expanded.map(
|
|
2776
|
+
(message) => `[${message.role}]: ${message.content}`
|
|
2461
2777
|
);
|
|
2778
|
+
const rawSection = `${prefix}${rows.join("\n")}`;
|
|
2779
|
+
appendSection("raw-messages", "raw-row", rawSection);
|
|
2780
|
+
let rowStart = prefix.length;
|
|
2781
|
+
expanded.forEach((message, index) => {
|
|
2782
|
+
const rowEnd = rowStart + rows[index].length;
|
|
2783
|
+
traceRecorder?.recordRawRow(
|
|
2784
|
+
"raw-messages",
|
|
2785
|
+
{ start: rowStart, end: rowEnd },
|
|
2786
|
+
message
|
|
2787
|
+
);
|
|
2788
|
+
rowStart = rowEnd + 1;
|
|
2789
|
+
});
|
|
2462
2790
|
}
|
|
2463
2791
|
}
|
|
2464
2792
|
}
|
|
2465
2793
|
const joined = sections.join("\n\n");
|
|
2466
2794
|
return joined.length > budget ? joined.slice(0, budget) : joined;
|
|
2467
2795
|
},
|
|
2796
|
+
recall(sessionId, query, budgetChars, recallOptions = {}, control) {
|
|
2797
|
+
return adapter[composeRecall](
|
|
2798
|
+
sessionId,
|
|
2799
|
+
query,
|
|
2800
|
+
budgetChars,
|
|
2801
|
+
recallOptions,
|
|
2802
|
+
control
|
|
2803
|
+
);
|
|
2804
|
+
},
|
|
2805
|
+
async recallWithTrace(sessionId, query, budgetChars, recallOptions = {}, control) {
|
|
2806
|
+
const budget = budgetChars ?? DEFAULT_BENCH_RECALL_BUDGET_CHARS;
|
|
2807
|
+
const traceRecorder = createBenchRecallTraceRecorder(Math.max(0, budget));
|
|
2808
|
+
const text = await adapter[composeRecall](
|
|
2809
|
+
sessionId,
|
|
2810
|
+
query,
|
|
2811
|
+
budgetChars,
|
|
2812
|
+
recallOptions,
|
|
2813
|
+
control,
|
|
2814
|
+
traceRecorder
|
|
2815
|
+
);
|
|
2816
|
+
return { text, trace: traceRecorder.finalize(text.length) };
|
|
2817
|
+
},
|
|
2468
2818
|
async assessRecallSupport(request, control) {
|
|
2469
2819
|
throwIfBenchPhaseAborted(control, "assessRecallSupport");
|
|
2470
2820
|
return assessRemnicRecallSupport(request, answerSupportMinCoverage);
|
|
@@ -2699,6 +3049,7 @@ ${expanded.map((message) => `[${message.role}]: ${message.content}`).join("\n")}
|
|
|
2699
3049
|
responder: options.responder,
|
|
2700
3050
|
judge: options.judge
|
|
2701
3051
|
};
|
|
3052
|
+
return adapter;
|
|
2702
3053
|
};
|
|
2703
3054
|
}
|
|
2704
3055
|
var createLightweightAdapter = createAdapterFactory("lightweight");
|
|
@@ -3434,7 +3785,7 @@ function extractStructuredTrajectoryCueNumber(content) {
|
|
|
3434
3785
|
function nextBenchTranscriptTurnId(counters, sessionId, message) {
|
|
3435
3786
|
const index = counters.get(sessionId) ?? 0;
|
|
3436
3787
|
counters.set(sessionId, index + 1);
|
|
3437
|
-
const digest =
|
|
3788
|
+
const digest = createHash2("sha256").update(`${sessionId}
|
|
3438
3789
|
${index}
|
|
3439
3790
|
${message.role}
|
|
3440
3791
|
${message.content}`).digest("hex").slice(0, 16);
|
|
@@ -4301,6 +4652,33 @@ function createTimeoutGuardedAdapter(adapter, options) {
|
|
|
4301
4652
|
return adapter.destroy();
|
|
4302
4653
|
}
|
|
4303
4654
|
};
|
|
4655
|
+
if (adapter.recallWithTrace) {
|
|
4656
|
+
wrapped.recallWithTrace = (sessionId, query, budgetChars, recallOptions, control) => {
|
|
4657
|
+
if (phaseTimeoutMs === void 0) {
|
|
4658
|
+
return adapter.recallWithTrace(
|
|
4659
|
+
sessionId,
|
|
4660
|
+
query,
|
|
4661
|
+
budgetChars,
|
|
4662
|
+
recallOptions,
|
|
4663
|
+
control
|
|
4664
|
+
);
|
|
4665
|
+
}
|
|
4666
|
+
return run(`recallWithTrace session=${sessionId}`, async (signal) => {
|
|
4667
|
+
const merged = mergeBenchPhaseControl(signal, control);
|
|
4668
|
+
try {
|
|
4669
|
+
return await adapter.recallWithTrace(
|
|
4670
|
+
sessionId,
|
|
4671
|
+
query,
|
|
4672
|
+
budgetChars,
|
|
4673
|
+
recallOptions,
|
|
4674
|
+
merged.control
|
|
4675
|
+
);
|
|
4676
|
+
} finally {
|
|
4677
|
+
merged.cleanup();
|
|
4678
|
+
}
|
|
4679
|
+
});
|
|
4680
|
+
};
|
|
4681
|
+
}
|
|
4304
4682
|
if (adapter.drain) {
|
|
4305
4683
|
wrapped.drain = (control) => drainTimeoutMs === void 0 ? adapter.drain(control) : run(
|
|
4306
4684
|
"drain",
|
|
@@ -5101,7 +5479,7 @@ function listMemoryEvalBenchmarkIds() {
|
|
|
5101
5479
|
import {
|
|
5102
5480
|
createCipheriv,
|
|
5103
5481
|
createDecipheriv,
|
|
5104
|
-
createHash as
|
|
5482
|
+
createHash as createHash3,
|
|
5105
5483
|
randomBytes,
|
|
5106
5484
|
timingSafeEqual
|
|
5107
5485
|
} from "crypto";
|
|
@@ -5112,10 +5490,10 @@ var AES_TAG_LENGTH = 16;
|
|
|
5112
5490
|
var INTEGRITY_HASH_ALGORITHM = "sha256";
|
|
5113
5491
|
var INTEGRITY_CIPHER_ALGORITHM = "aes-256-gcm";
|
|
5114
5492
|
function hashString(value) {
|
|
5115
|
-
return
|
|
5493
|
+
return createHash3(INTEGRITY_HASH_ALGORITHM).update(value, "utf8").digest("hex");
|
|
5116
5494
|
}
|
|
5117
5495
|
function hashBytes(value) {
|
|
5118
|
-
return
|
|
5496
|
+
return createHash3(INTEGRITY_HASH_ALGORITHM).update(value).digest("hex");
|
|
5119
5497
|
}
|
|
5120
5498
|
function canonicalJsonStringify(value, space) {
|
|
5121
5499
|
return JSON.stringify(value, canonicalReplacer, space);
|
|
@@ -5497,14 +5875,14 @@ var BENCHMARK_RESULT_SCHEMA = {
|
|
|
5497
5875
|
|
|
5498
5876
|
// src/repro-manifest.ts
|
|
5499
5877
|
import { execFileSync } from "child_process";
|
|
5500
|
-
import { createHash as
|
|
5878
|
+
import { createHash as createHash5 } from "crypto";
|
|
5501
5879
|
import { createReadStream } from "fs";
|
|
5502
5880
|
import { lstat as lstat3, mkdir as mkdir4, readFile as readFile5, readdir as readdir4, readlink, realpath as realpath3, stat as stat2, writeFile as writeFile4 } from "fs/promises";
|
|
5503
5881
|
import os3 from "os";
|
|
5504
5882
|
import path5 from "path";
|
|
5505
5883
|
|
|
5506
5884
|
// src/providers/codex-credit-budget.ts
|
|
5507
|
-
import { createHash as
|
|
5885
|
+
import { createHash as createHash4 } from "crypto";
|
|
5508
5886
|
import { mkdir as mkdir2, open, readFile as readFile3, rename as rename2, rmdir, unlink as unlink2, writeFile as writeFile2 } from "fs/promises";
|
|
5509
5887
|
import os from "os";
|
|
5510
5888
|
import path3 from "path";
|
|
@@ -6123,7 +6501,7 @@ function isSha256(value) {
|
|
|
6123
6501
|
return typeof value === "string" && /^[a-f0-9]{64}$/.test(value);
|
|
6124
6502
|
}
|
|
6125
6503
|
function sha256(value) {
|
|
6126
|
-
return
|
|
6504
|
+
return createHash4("sha256").update(value).digest("hex");
|
|
6127
6505
|
}
|
|
6128
6506
|
function normalizeZero(value) {
|
|
6129
6507
|
return Object.is(value, -0) ? 0 : value;
|
|
@@ -7270,13 +7648,13 @@ var CODEX_CREDIT_REPRO_ENV_KEYS = [
|
|
|
7270
7648
|
"REMNIC_BENCH_RUN_ID"
|
|
7271
7649
|
];
|
|
7272
7650
|
function sha256String(value) {
|
|
7273
|
-
return
|
|
7651
|
+
return createHash5("sha256").update(value).digest("hex");
|
|
7274
7652
|
}
|
|
7275
7653
|
function sha256Buffer(value) {
|
|
7276
|
-
return
|
|
7654
|
+
return createHash5("sha256").update(value).digest("hex");
|
|
7277
7655
|
}
|
|
7278
7656
|
async function sha256File(filePath) {
|
|
7279
|
-
const hash =
|
|
7657
|
+
const hash = createHash5("sha256");
|
|
7280
7658
|
await new Promise((resolve, reject) => {
|
|
7281
7659
|
const stream = createReadStream(filePath);
|
|
7282
7660
|
stream.on("data", (chunk) => hash.update(chunk));
|
|
@@ -8197,7 +8575,7 @@ async function writeBenchmarkReproManifest(resultsDir, options = {}) {
|
|
|
8197
8575
|
}
|
|
8198
8576
|
|
|
8199
8577
|
// src/published-artifact.ts
|
|
8200
|
-
import { createHash as
|
|
8578
|
+
import { createHash as createHash6 } from "crypto";
|
|
8201
8579
|
import { mkdir as mkdir5, readFile as readFile6, writeFile as writeFile5 } from "fs/promises";
|
|
8202
8580
|
import path6 from "path";
|
|
8203
8581
|
var BENCHMARK_ARTIFACT_SCHEMA_VERSION = 1;
|
|
@@ -8343,7 +8721,7 @@ function serializeBenchmarkArtifact(artifact) {
|
|
|
8343
8721
|
`;
|
|
8344
8722
|
}
|
|
8345
8723
|
function hashBenchmarkArtifact(artifact) {
|
|
8346
|
-
return
|
|
8724
|
+
return createHash6("sha256").update(serializeBenchmarkArtifact(artifact)).digest("hex");
|
|
8347
8725
|
}
|
|
8348
8726
|
async function writeBenchmarkArtifact(artifact, outputDir) {
|
|
8349
8727
|
await mkdir5(outputDir, { recursive: true });
|
|
@@ -8361,7 +8739,7 @@ async function writeBenchmarkArtifact(artifact, outputDir) {
|
|
|
8361
8739
|
return {
|
|
8362
8740
|
path: abs,
|
|
8363
8741
|
filename,
|
|
8364
|
-
sha256:
|
|
8742
|
+
sha256: createHash6("sha256").update(body).digest("hex"),
|
|
8365
8743
|
bytes: Buffer.byteLength(body, "utf8")
|
|
8366
8744
|
};
|
|
8367
8745
|
}
|
|
@@ -8475,7 +8853,7 @@ async function loadBenchmarkArtifact(filePath) {
|
|
|
8475
8853
|
const artifact = parseBenchmarkArtifact(raw);
|
|
8476
8854
|
return {
|
|
8477
8855
|
artifact,
|
|
8478
|
-
sha256:
|
|
8856
|
+
sha256: createHash6("sha256").update(raw).digest("hex"),
|
|
8479
8857
|
bytes: Buffer.byteLength(raw, "utf8")
|
|
8480
8858
|
};
|
|
8481
8859
|
}
|
|
@@ -9638,7 +10016,7 @@ function createClaudeCliProvider(config, deps) {
|
|
|
9638
10016
|
|
|
9639
10017
|
// src/providers/codex-cli.ts
|
|
9640
10018
|
import { spawn as spawn2 } from "child_process";
|
|
9641
|
-
import { createHash as
|
|
10019
|
+
import { createHash as createHash7, randomUUID } from "crypto";
|
|
9642
10020
|
import { mkdir as mkdir6, mkdtemp as mkdtemp3, readFile as readFile7, rm as rm3, writeFile as writeFile6 } from "fs/promises";
|
|
9643
10021
|
import os5 from "os";
|
|
9644
10022
|
import path8 from "path";
|
|
@@ -10506,7 +10884,7 @@ function resolveCodexCliDiagnosticsMode(config) {
|
|
|
10506
10884
|
}
|
|
10507
10885
|
function inspectCodexCompletionPrompt(prompt) {
|
|
10508
10886
|
const stats = {
|
|
10509
|
-
sha256:
|
|
10887
|
+
sha256: createHash7("sha256").update(prompt).digest("hex"),
|
|
10510
10888
|
chars: prompt.length,
|
|
10511
10889
|
lines: prompt.length === 0 ? 0 : prompt.split("\n").length
|
|
10512
10890
|
};
|
|
@@ -12642,7 +13020,7 @@ function asStringArray(value) {
|
|
|
12642
13020
|
}
|
|
12643
13021
|
|
|
12644
13022
|
// src/responders.ts
|
|
12645
|
-
import { createHash as
|
|
13023
|
+
import { createHash as createHash8 } from "crypto";
|
|
12646
13024
|
import { FallbackLlmClient } from "@remnic/core";
|
|
12647
13025
|
|
|
12648
13026
|
// src/providers/openai-responses.ts
|
|
@@ -13115,7 +13493,7 @@ function getProviderBackedJudgePromptIdentity(config) {
|
|
|
13115
13493
|
temperature: 0,
|
|
13116
13494
|
maxTokens: 16
|
|
13117
13495
|
};
|
|
13118
|
-
return `sha256:${
|
|
13496
|
+
return `sha256:${createHash8("sha256").update(JSON.stringify(contract)).digest("hex")}`;
|
|
13119
13497
|
}
|
|
13120
13498
|
var AMA_BENCH_RECOMMENDED_JUDGE_SYSTEM_PROMPT = [
|
|
13121
13499
|
"You are evaluating an AMA-Bench long-horizon memory question.",
|
|
@@ -15456,11 +15834,11 @@ async function resolveLocalLabRuntimeProfile(options) {
|
|
|
15456
15834
|
// src/benchmark.ts
|
|
15457
15835
|
import fs2 from "fs";
|
|
15458
15836
|
import path35 from "path";
|
|
15459
|
-
import { createHash as
|
|
15837
|
+
import { createHash as createHash14 } from "crypto";
|
|
15460
15838
|
import { expandTildePath as expandTildePath3 } from "@remnic/core";
|
|
15461
15839
|
|
|
15462
15840
|
// src/judges/judge-cache.ts
|
|
15463
|
-
import { createHash as
|
|
15841
|
+
import { createHash as createHash9, randomBytes as randomBytes2 } from "crypto";
|
|
15464
15842
|
import {
|
|
15465
15843
|
mkdir as mkdir9,
|
|
15466
15844
|
readFile as readFile11,
|
|
@@ -15503,8 +15881,8 @@ var JudgeCache = class {
|
|
|
15503
15881
|
}
|
|
15504
15882
|
/** Compute the sha256-hex key for a set of parts. Pure, sync, side-effect-free. */
|
|
15505
15883
|
computeKey(parts) {
|
|
15506
|
-
const fieldDigest = (value) =>
|
|
15507
|
-
return
|
|
15884
|
+
const fieldDigest = (value) => createHash9("sha256").update(value).digest();
|
|
15885
|
+
return createHash9("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");
|
|
15508
15886
|
}
|
|
15509
15887
|
/**
|
|
15510
15888
|
* Read a previously-stored verdict. Returns `undefined` on miss, corrupted
|
|
@@ -15699,7 +16077,7 @@ function runJudgeWithCache(options) {
|
|
|
15699
16077
|
// Binary prompts are content-sensitive: two distinct prompts of
|
|
15700
16078
|
// the same character length would collide on the previous
|
|
15701
16079
|
// `binary:N` key, so key on a sha256 prefix of the prompt body.
|
|
15702
|
-
questionId: `binary:${
|
|
16080
|
+
questionId: `binary:${createHash9("sha256").update(prompt).digest("hex").slice(0, 16)}`,
|
|
15703
16081
|
answerText: prompt,
|
|
15704
16082
|
judgePromptHash: keyExtras.judgePromptHash ?? "unknown-prompt",
|
|
15705
16083
|
judgeModelId: keyExtras.judgeModelId ?? "unknown-judge",
|
|
@@ -23190,7 +23568,7 @@ var StructuredLiteralParser = class {
|
|
|
23190
23568
|
};
|
|
23191
23569
|
|
|
23192
23570
|
// src/benchmarks/published/personamem/runner.ts
|
|
23193
|
-
import { createHash as
|
|
23571
|
+
import { createHash as createHash10, randomUUID as randomUUID7 } from "crypto";
|
|
23194
23572
|
import { readFile as readFile16, realpath as realpath4 } from "fs/promises";
|
|
23195
23573
|
import path19 from "path";
|
|
23196
23574
|
|
|
@@ -23795,7 +24173,7 @@ function buildMcqPrompt(sample, seed) {
|
|
|
23795
24173
|
function deterministicShuffle(values, seedMaterial) {
|
|
23796
24174
|
return values.map((value, index) => ({
|
|
23797
24175
|
value,
|
|
23798
|
-
key:
|
|
24176
|
+
key: createHash10("sha256").update(`${seedMaterial}:${index}:${value}`).digest("hex"),
|
|
23799
24177
|
index
|
|
23800
24178
|
})).sort((left, right) => {
|
|
23801
24179
|
const byKey = left.key.localeCompare(right.key);
|
|
@@ -32254,7 +32632,7 @@ function pairedDeltaConfidenceInterval(candidateValues, baselineValues, options
|
|
|
32254
32632
|
}
|
|
32255
32633
|
|
|
32256
32634
|
// src/judges/sealed-rubric.ts
|
|
32257
|
-
import { createHash as
|
|
32635
|
+
import { createHash as createHash11 } from "crypto";
|
|
32258
32636
|
import { appendFileSync, mkdirSync } from "fs";
|
|
32259
32637
|
import path31 from "path";
|
|
32260
32638
|
|
|
@@ -32363,7 +32741,7 @@ function loadSealedRubric(id = DEFAULT_ASSISTANT_RUBRIC_ID, options = {}) {
|
|
|
32363
32741
|
if (typeof prompt !== "string" || prompt.length === 0) {
|
|
32364
32742
|
throw new Error(`sealed rubric not found in registry: ${id}`);
|
|
32365
32743
|
}
|
|
32366
|
-
const sha2563 =
|
|
32744
|
+
const sha2563 = createHash11("sha256").update(prompt, "utf8").digest("hex");
|
|
32367
32745
|
const version = parseVersionFromId(id);
|
|
32368
32746
|
return { id, version, prompt, sha256: sha2563 };
|
|
32369
32747
|
}
|
|
@@ -34566,7 +34944,7 @@ async function runRetentionAgedDatasetBenchmark(options) {
|
|
|
34566
34944
|
import { randomUUID as randomUUID31 } from "crypto";
|
|
34567
34945
|
|
|
34568
34946
|
// src/benchmarks/remnic/memcorrect/generator.ts
|
|
34569
|
-
import { createHash as
|
|
34947
|
+
import { createHash as createHash12 } from "crypto";
|
|
34570
34948
|
|
|
34571
34949
|
// src/benchmarks/remnic/memcorrect/token-pools.ts
|
|
34572
34950
|
var PERSONAS = [
|
|
@@ -34890,7 +35268,7 @@ function corpusHash(corpus) {
|
|
|
34890
35268
|
uptakeLatencyCap: corpus.options.uptakeLatencyCap,
|
|
34891
35269
|
scenarios: corpus.scenarios
|
|
34892
35270
|
});
|
|
34893
|
-
return
|
|
35271
|
+
return createHash12("sha256").update(canonical).digest("hex");
|
|
34894
35272
|
}
|
|
34895
35273
|
|
|
34896
35274
|
// src/benchmarks/remnic/memcorrect/schema.ts
|
|
@@ -35845,7 +36223,7 @@ import { mkdir as mkdir17, writeFile as writeFile16 } from "fs/promises";
|
|
|
35845
36223
|
import path34 from "path";
|
|
35846
36224
|
|
|
35847
36225
|
// src/benchmarks/remnic/bounded-memory-contracts/fixture.ts
|
|
35848
|
-
import { createHash as
|
|
36226
|
+
import { createHash as createHash13 } from "crypto";
|
|
35849
36227
|
var SCOPE_ACME = "project:acme";
|
|
35850
36228
|
var SCOPE_BETA = "project:beta";
|
|
35851
36229
|
var SCOPE_ALICE = "user:alice";
|
|
@@ -36328,7 +36706,7 @@ var BOUNDED_MEMORY_SMOKE_FIXTURE = [
|
|
|
36328
36706
|
function fixtureHash(tasks) {
|
|
36329
36707
|
const source = tasks ?? BOUNDED_MEMORY_FIXTURE;
|
|
36330
36708
|
const payload = JSON.stringify(source);
|
|
36331
|
-
return
|
|
36709
|
+
return createHash13("sha256").update(payload, "utf8").digest("hex");
|
|
36332
36710
|
}
|
|
36333
36711
|
|
|
36334
36712
|
// src/benchmarks/remnic/bounded-memory-contracts/agent.ts
|
|
@@ -37588,13 +37966,13 @@ function wrapJudgeWithCache(args) {
|
|
|
37588
37966
|
// differentiator is part of the prompt hash. Bumping
|
|
37589
37967
|
// JUDGE_CACHE_PROTOCOL_VERSION invalidates verdicts when judge
|
|
37590
37968
|
// prompt/parse semantics change (PR #1591, High).
|
|
37591
|
-
judgePromptHash:
|
|
37969
|
+
judgePromptHash: createHash14("sha256").update(JUDGE_CACHE_PROTOCOL_VERSION).update("").update(args.amaBenchJudgeProtocol).update("").update(args.role).digest("hex"),
|
|
37592
37970
|
judgeModelId: args.provider?.model !== void 0 && args.provider.model.length > 0 ? `${args.provider.model}${crossJudgeIdSuffix}` : `unknown-${args.role}-judge`,
|
|
37593
37971
|
// Full judge configuration, deterministically serialized (sorted
|
|
37594
37972
|
// keys) so provider/base-url/retry changes produce fresh cache
|
|
37595
37973
|
// keys. `role` is included so primary and cross judges never
|
|
37596
37974
|
// share a paramsHash.
|
|
37597
|
-
judgeParamsHash:
|
|
37975
|
+
judgeParamsHash: createHash14("sha256").update(
|
|
37598
37976
|
stableStringify2({
|
|
37599
37977
|
role: args.role,
|
|
37600
37978
|
provider: args.provider
|
|
@@ -38300,7 +38678,7 @@ function formatSignedScore(value) {
|
|
|
38300
38678
|
}
|
|
38301
38679
|
|
|
38302
38680
|
// src/stats/locomo-recall-delta.ts
|
|
38303
|
-
import { createHash as
|
|
38681
|
+
import { createHash as createHash15 } from "crypto";
|
|
38304
38682
|
import { basename } from "path";
|
|
38305
38683
|
var LOCOMO_FULL_TASK_COUNT = 1986;
|
|
38306
38684
|
var LOCOMO_RECALL_EXCERPT_CHARS = 240;
|
|
@@ -38781,7 +39159,7 @@ function normalizeText3(value) {
|
|
|
38781
39159
|
return value.replaceAll("\r\n", "\n").replaceAll("\r", "\n");
|
|
38782
39160
|
}
|
|
38783
39161
|
function sha2562(value) {
|
|
38784
|
-
return
|
|
39162
|
+
return createHash15("sha256").update(value).digest("hex");
|
|
38785
39163
|
}
|
|
38786
39164
|
function stableJson(value) {
|
|
38787
39165
|
return JSON.stringify(value);
|
|
@@ -40219,7 +40597,7 @@ var chatFixture = {
|
|
|
40219
40597
|
};
|
|
40220
40598
|
|
|
40221
40599
|
// src/judges/calibration-slice.ts
|
|
40222
|
-
import { createHash as
|
|
40600
|
+
import { createHash as createHash16, randomBytes as randomBytes3 } from "crypto";
|
|
40223
40601
|
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";
|
|
40224
40602
|
import path37 from "path";
|
|
40225
40603
|
|
|
@@ -40368,7 +40746,7 @@ function selectCalibrationSlice(questionIds, size = CALIBRATION_SLICE_SIZE) {
|
|
|
40368
40746
|
unique.push(id);
|
|
40369
40747
|
}
|
|
40370
40748
|
}
|
|
40371
|
-
return unique.map((id) => ({ id, digest:
|
|
40749
|
+
return unique.map((id) => ({ id, digest: createHash16("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);
|
|
40372
40750
|
}
|
|
40373
40751
|
async function runJudgeCalibration(options) {
|
|
40374
40752
|
const binScore = options.binScore ?? ((score) => binarizeJudgeScore(score));
|
|
@@ -40485,7 +40863,7 @@ function hashOrderedQuestionIds(questionIds) {
|
|
|
40485
40863
|
if (questionIds.some((id) => typeof id !== "string" || id.length === 0)) {
|
|
40486
40864
|
throw new Error("hashOrderedQuestionIds: question ids must be non-empty strings.");
|
|
40487
40865
|
}
|
|
40488
|
-
return
|
|
40866
|
+
return createHash16("sha256").update(JSON.stringify(questionIds), "utf8").digest("hex");
|
|
40489
40867
|
}
|
|
40490
40868
|
function validatePinnedQuestionIds(ids, availableIds) {
|
|
40491
40869
|
if (ids.length === 0 || ids.length > CALIBRATION_SLICE_SIZE || ids.some((id) => typeof id !== "string" || id.length === 0) || new Set(ids).size !== ids.length) {
|
|
@@ -40498,7 +40876,7 @@ function validatePinnedQuestionIds(ids, availableIds) {
|
|
|
40498
40876
|
return [...ids];
|
|
40499
40877
|
}
|
|
40500
40878
|
function hashCalibrationAnswerSet(answers) {
|
|
40501
|
-
return
|
|
40879
|
+
return createHash16("sha256").update(JSON.stringify(answers.map((answer) => [
|
|
40502
40880
|
answer.questionId,
|
|
40503
40881
|
answer.question,
|
|
40504
40882
|
answer.predicted,
|
|
@@ -40564,7 +40942,7 @@ async function loadOrInitializeCheckpoint(benchmarkId, provenance, sliceQuestion
|
|
|
40564
40942
|
frontierJudgeConfigHash: provenance.frontierJudgeConfigHash,
|
|
40565
40943
|
binningIdentity: provenance.binningIdentity
|
|
40566
40944
|
};
|
|
40567
|
-
const contractHash =
|
|
40945
|
+
const contractHash = createHash16("sha256").update(stableJson2(contract)).digest("hex");
|
|
40568
40946
|
let raw;
|
|
40569
40947
|
try {
|
|
40570
40948
|
const info = await lstat4(checkpointPath);
|
|
@@ -42085,7 +42463,7 @@ function createMitigatedTarget(config) {
|
|
|
42085
42463
|
}
|
|
42086
42464
|
|
|
42087
42465
|
// src/coding-graph/generator.ts
|
|
42088
|
-
import { createHash as
|
|
42466
|
+
import { createHash as createHash17 } from "crypto";
|
|
42089
42467
|
function createSeededRng3(seed) {
|
|
42090
42468
|
let state = seed >>> 0;
|
|
42091
42469
|
return function rng() {
|
|
@@ -42114,7 +42492,7 @@ var EDGE_TYPE_WEIGHTS = [
|
|
|
42114
42492
|
var PROVENANCE_VALUES = ["heuristic", "heuristic", "heuristic", "trace"];
|
|
42115
42493
|
var AVG_BYTES_PER_LINE = 40;
|
|
42116
42494
|
function hashContent(input) {
|
|
42117
|
-
return
|
|
42495
|
+
return createHash17("sha256").update(input).digest("hex").slice(0, 16);
|
|
42118
42496
|
}
|
|
42119
42497
|
function generateSyntheticRepo(config) {
|
|
42120
42498
|
const rng = createSeededRng3(config.seed);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/bench",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.32",
|
|
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.
|
|
43
|
-
"@remnic/core": "^9.6.
|
|
42
|
+
"@remnic/coding-graph": "^9.6.32",
|
|
43
|
+
"@remnic/core": "^9.6.32"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "^8.5.1",
|