@anuma/sdk 6.10.0 → 6.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/expo/{chunk-4M56MKBV.mjs → chunk-ZO7S3TBT.mjs} +79 -25
- package/dist/expo/index.cjs +67 -13
- package/dist/expo/index.d.mts +42 -0
- package/dist/expo/index.d.ts +42 -0
- package/dist/expo/index.mjs +1 -1
- package/dist/expo/{recall-WIB7RQQZ.mjs → recall-OALPGL3H.mjs} +1 -1
- package/dist/react/{chunk-EJ65X4GI.mjs → chunk-HNQ2ZEFF.mjs} +79 -25
- package/dist/react/index.cjs +67 -13
- package/dist/react/index.d.mts +42 -0
- package/dist/react/index.d.ts +42 -0
- package/dist/react/index.mjs +1 -1
- package/dist/react/{recall-FWILZSFH.mjs → recall-F5DBVCU2.mjs} +1 -1
- package/dist/server/{chunk-I56324FR.mjs → chunk-BKB6AT7Z.mjs} +79 -25
- package/dist/server/index.cjs +67 -13
- package/dist/server/index.d.mts +42 -0
- package/dist/server/index.d.ts +42 -0
- package/dist/server/index.mjs +1 -1
- package/dist/server/{recall-T7CNXTQ3.mjs → recall-HVIEAH7J.mjs} +1 -1
- package/package.json +1 -1
package/dist/react/index.cjs
CHANGED
|
@@ -6791,9 +6791,9 @@ function recencyMultiplier(updatedAt, opts = {}) {
|
|
|
6791
6791
|
const updatedMs = updatedAt.getTime();
|
|
6792
6792
|
if (!Number.isFinite(updatedMs)) return noDate;
|
|
6793
6793
|
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
6794
|
-
const
|
|
6795
|
-
if (!Number.isFinite(
|
|
6796
|
-
const ageDays2 = Math.max(0, (
|
|
6794
|
+
const nowMs3 = now.getTime();
|
|
6795
|
+
if (!Number.isFinite(nowMs3)) return noDate;
|
|
6796
|
+
const ageDays2 = Math.max(0, (nowMs3 - updatedMs) / DAY_MS2);
|
|
6797
6797
|
const perYearDecay = opts.perYearDecay ?? DEFAULT_PER_YEAR_DECAY;
|
|
6798
6798
|
const floor = opts.floor ?? DEFAULT_FLOOR;
|
|
6799
6799
|
const decay = perYearDecay * (ageDays2 / 365);
|
|
@@ -7847,6 +7847,9 @@ async function recall(query, ctx, options = {}) {
|
|
|
7847
7847
|
const chunkResults = [];
|
|
7848
7848
|
let vaultSize;
|
|
7849
7849
|
let didRerank = false;
|
|
7850
|
+
let rerankMs = 0;
|
|
7851
|
+
let queryEmbedMs = 0;
|
|
7852
|
+
let vaultRowsEmbedded;
|
|
7850
7853
|
let hadV2Head = false;
|
|
7851
7854
|
let embeddingsUnavailable = false;
|
|
7852
7855
|
let chunkEmbedFailed = false;
|
|
@@ -7871,12 +7874,15 @@ async function recall(query, ctx, options = {}) {
|
|
|
7871
7874
|
...vaultSize !== void 0 && { vaultSize },
|
|
7872
7875
|
...decryptLastRan !== void 0 && { decryptLast: decryptLastRan },
|
|
7873
7876
|
...vaultRowsDecrypted !== void 0 && { vaultRowsDecrypted },
|
|
7877
|
+
...vaultRowsEmbedded !== void 0 && { vaultRowsEmbedded },
|
|
7874
7878
|
factCount: factResults.length,
|
|
7875
7879
|
chunkCount: chunkResults.length,
|
|
7876
7880
|
timings: {
|
|
7877
7881
|
total: nowMs() - t0,
|
|
7878
7882
|
prep: prepMs,
|
|
7879
7883
|
factLane: factLaneMs,
|
|
7884
|
+
rerank: rerankMs,
|
|
7885
|
+
queryEmbed: queryEmbedMs,
|
|
7880
7886
|
chunkLane: chunkLaneMs,
|
|
7881
7887
|
fuse: fuseMs
|
|
7882
7888
|
},
|
|
@@ -7940,6 +7946,9 @@ async function recall(query, ctx, options = {}) {
|
|
|
7940
7946
|
results,
|
|
7941
7947
|
vaultSize: size,
|
|
7942
7948
|
reranked,
|
|
7949
|
+
rerankMs: factRerankMs,
|
|
7950
|
+
queryEmbedMs: factQueryEmbedMs,
|
|
7951
|
+
rowsEmbedded: factRowsEmbedded,
|
|
7943
7952
|
hadV2Head: v2Head,
|
|
7944
7953
|
embeddingsUnavailable: factEmbeddingsUnavailable,
|
|
7945
7954
|
rankedOnCosine: factRankedOnCosine,
|
|
@@ -7998,6 +8007,9 @@ async function recall(query, ctx, options = {}) {
|
|
|
7998
8007
|
);
|
|
7999
8008
|
vaultSize = size;
|
|
8000
8009
|
didRerank = reranked;
|
|
8010
|
+
rerankMs = factRerankMs;
|
|
8011
|
+
queryEmbedMs = factQueryEmbedMs;
|
|
8012
|
+
vaultRowsEmbedded = factRowsEmbedded;
|
|
8001
8013
|
hadV2Head = v2Head;
|
|
8002
8014
|
if (factEmbeddingsUnavailable) embeddingsUnavailable = true;
|
|
8003
8015
|
factLaneRankedOnCosine = factRankedOnCosine;
|
|
@@ -8462,6 +8474,7 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
8462
8474
|
const rerankTopN = options.rerankTopN ?? 30;
|
|
8463
8475
|
const ceWeight = options.ceWeight ?? 0.1;
|
|
8464
8476
|
const headSlice = v2Ranked.slice(0, rerankTopN);
|
|
8477
|
+
const ceStart = nowMs2();
|
|
8465
8478
|
try {
|
|
8466
8479
|
const reranked = await rerankPairs(
|
|
8467
8480
|
query,
|
|
@@ -8489,6 +8502,8 @@ async function rankFusedVaultMemoriesAsync(query, queryEmbedding, items, options
|
|
|
8489
8502
|
getLogger().warn("[memory/search] cross-encoder rerank failed; using V2 ranking", err);
|
|
8490
8503
|
}
|
|
8491
8504
|
combined = v2Ranked;
|
|
8505
|
+
} finally {
|
|
8506
|
+
if (options.rerankStats) options.rerankStats.ms += nowMs2() - ceStart;
|
|
8492
8507
|
}
|
|
8493
8508
|
} else {
|
|
8494
8509
|
combined = v2Ranked;
|
|
@@ -8655,6 +8670,7 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
|
|
|
8655
8670
|
const ceWeight = options.ceWeight ?? 0.1;
|
|
8656
8671
|
const headSlice = combined.slice(0, rerankTopN);
|
|
8657
8672
|
const tailSlice = combined.slice(rerankTopN);
|
|
8673
|
+
const ceStart = nowMs2();
|
|
8658
8674
|
try {
|
|
8659
8675
|
const reranked = await rerankPairs(
|
|
8660
8676
|
originalQuery,
|
|
@@ -8682,6 +8698,8 @@ async function rankComposite(originalQuery, originalQueryEmbedding, subQueries,
|
|
|
8682
8698
|
err
|
|
8683
8699
|
);
|
|
8684
8700
|
}
|
|
8701
|
+
} finally {
|
|
8702
|
+
if (options.rerankStats) options.rerankStats.ms += nowMs2() - ceStart;
|
|
8685
8703
|
}
|
|
8686
8704
|
}
|
|
8687
8705
|
if (options?.mmr) {
|
|
@@ -8808,11 +8826,13 @@ async function buildProjectedCorpus(query, vaultCtx, embeddingOptions, cache, qu
|
|
|
8808
8826
|
rowsDecrypted: 0
|
|
8809
8827
|
};
|
|
8810
8828
|
}
|
|
8829
|
+
const queryEmbedStart = nowMs2();
|
|
8811
8830
|
const queryEmbedding = await embedQueryOrDegrade(
|
|
8812
8831
|
query,
|
|
8813
8832
|
embeddingOptions,
|
|
8814
8833
|
opts.onEmbeddingDegraded
|
|
8815
8834
|
);
|
|
8835
|
+
if (opts.embedStats) opts.embedStats.queryMs += nowMs2() - queryEmbedStart;
|
|
8816
8836
|
const embeddingsDegraded = queryEmbedding.length === 0;
|
|
8817
8837
|
const currentModel = embeddingOptions.model ?? DEFAULT_API_EMBEDDING_MODEL;
|
|
8818
8838
|
const vectored = [];
|
|
@@ -8865,6 +8885,7 @@ async function buildProjectedCorpus(query, vaultCtx, embeddingOptions, cache, qu
|
|
|
8865
8885
|
const laneRows = laneFetched.filter((m) => !isEncrypted(m.content));
|
|
8866
8886
|
if (laneRows.length > 0) {
|
|
8867
8887
|
let laneVecs;
|
|
8888
|
+
if (opts.embedStats) opts.embedStats.rowsEmbedded += laneRows.length;
|
|
8868
8889
|
try {
|
|
8869
8890
|
laneVecs = await generateEmbeddings(
|
|
8870
8891
|
laneRows.map((m) => m.content),
|
|
@@ -8943,6 +8964,10 @@ async function buildProjectedCorpus(query, vaultCtx, embeddingOptions, cache, qu
|
|
|
8943
8964
|
async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache, searchOptions) {
|
|
8944
8965
|
if (!query || typeof query !== "string") {
|
|
8945
8966
|
return {
|
|
8967
|
+
// Nothing was read and nothing was embedded — the short-circuit fires
|
|
8968
|
+
// before either.
|
|
8969
|
+
queryEmbedMs: 0,
|
|
8970
|
+
rowsEmbedded: 0,
|
|
8946
8971
|
memories: [],
|
|
8947
8972
|
embeddedItems: [],
|
|
8948
8973
|
queryEmbedding: [],
|
|
@@ -8975,6 +9000,7 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
8975
9000
|
embeddingsUnavailable = true;
|
|
8976
9001
|
embeddingFailure = true;
|
|
8977
9002
|
};
|
|
9003
|
+
const embedStats = { queryMs: 0, rowsEmbedded: 0 };
|
|
8978
9004
|
if (searchOptions?.decryptLast) {
|
|
8979
9005
|
const forceIncludeIds = [
|
|
8980
9006
|
...searchOptions.entityRanking ?? [],
|
|
@@ -8986,7 +9012,8 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
8986
9012
|
admitFloor: ADMIT_FLOOR,
|
|
8987
9013
|
unembeddedCap: UNEMBEDDED_CAP,
|
|
8988
9014
|
...forceIncludeIds.length > 0 && { forceIncludeIds },
|
|
8989
|
-
onEmbeddingDegraded
|
|
9015
|
+
onEmbeddingDegraded,
|
|
9016
|
+
embedStats
|
|
8990
9017
|
});
|
|
8991
9018
|
if (corpus.vaultSize === 0) {
|
|
8992
9019
|
return {
|
|
@@ -8997,7 +9024,9 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
8997
9024
|
embeddingsUnavailable: false,
|
|
8998
9025
|
embeddingFailure: false,
|
|
8999
9026
|
decryptLast: true,
|
|
9000
|
-
rowsDecrypted: corpus.rowsDecrypted
|
|
9027
|
+
rowsDecrypted: corpus.rowsDecrypted,
|
|
9028
|
+
queryEmbedMs: embedStats.queryMs,
|
|
9029
|
+
rowsEmbedded: embedStats.rowsEmbedded
|
|
9001
9030
|
};
|
|
9002
9031
|
}
|
|
9003
9032
|
({ memories, embeddedItems, queryEmbedding, vaultSize } = corpus);
|
|
@@ -9014,7 +9043,9 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
9014
9043
|
decryptLast: true,
|
|
9015
9044
|
// Rows WERE decrypt-attempted even though none came back readable — that
|
|
9016
9045
|
// is the whole point of reporting attempts rather than successes.
|
|
9017
|
-
rowsDecrypted: corpus.rowsDecrypted
|
|
9046
|
+
rowsDecrypted: corpus.rowsDecrypted,
|
|
9047
|
+
queryEmbedMs: embedStats.queryMs,
|
|
9048
|
+
rowsEmbedded: embedStats.rowsEmbedded
|
|
9018
9049
|
};
|
|
9019
9050
|
}
|
|
9020
9051
|
} else {
|
|
@@ -9039,10 +9070,14 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
9039
9070
|
embeddingsUnavailable: false,
|
|
9040
9071
|
embeddingFailure: false,
|
|
9041
9072
|
decryptLast: false,
|
|
9042
|
-
rowsDecrypted: loaded.length
|
|
9073
|
+
rowsDecrypted: loaded.length,
|
|
9074
|
+
queryEmbedMs: embedStats.queryMs,
|
|
9075
|
+
rowsEmbedded: embedStats.rowsEmbedded
|
|
9043
9076
|
};
|
|
9044
9077
|
}
|
|
9078
|
+
const legacyEmbedStart = nowMs2();
|
|
9045
9079
|
queryEmbedding = await embedQueryOrDegrade(query, embeddingOptions, onEmbeddingDegraded);
|
|
9080
|
+
embedStats.queryMs += nowMs2() - legacyEmbedStart;
|
|
9046
9081
|
const currentModel = embeddingOptions.model ?? DEFAULT_API_EMBEDDING_MODEL;
|
|
9047
9082
|
const uncachedTexts = [];
|
|
9048
9083
|
const uncachedIndices = [];
|
|
@@ -9076,6 +9111,7 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
9076
9111
|
}
|
|
9077
9112
|
if (uncachedTexts.length > 0) {
|
|
9078
9113
|
let newEmbeddings;
|
|
9114
|
+
embedStats.rowsEmbedded += uncachedTexts.length;
|
|
9079
9115
|
try {
|
|
9080
9116
|
newEmbeddings = await generateEmbeddings(uncachedTexts, embeddingOptions);
|
|
9081
9117
|
} catch (err) {
|
|
@@ -9119,6 +9155,8 @@ async function prepareVaultCandidates(query, vaultCtx, embeddingOptions, cache,
|
|
|
9119
9155
|
embeddingsUnavailable = true;
|
|
9120
9156
|
}
|
|
9121
9157
|
return {
|
|
9158
|
+
queryEmbedMs: embedStats.queryMs,
|
|
9159
|
+
rowsEmbedded: embedStats.rowsEmbedded,
|
|
9122
9160
|
memories,
|
|
9123
9161
|
embeddedItems,
|
|
9124
9162
|
queryEmbedding,
|
|
@@ -9169,11 +9207,15 @@ async function rankPreparedVaultCandidates(query, prepared, embeddingOptions, se
|
|
|
9169
9207
|
results: results2,
|
|
9170
9208
|
vaultSize: out.vaultSize,
|
|
9171
9209
|
reranked: out.reranked ?? false,
|
|
9210
|
+
// Read straight off the shared stats object rather than being passed in at
|
|
9211
|
+
// each call site: every return in this function funnels through here, so a
|
|
9212
|
+
// path added later reports the CE bill without having to remember to.
|
|
9213
|
+
rerankMs: rerankStats.ms,
|
|
9172
9214
|
hadV2Head: out.hadV2Head ?? false,
|
|
9173
9215
|
embeddingsUnavailable
|
|
9174
9216
|
};
|
|
9175
9217
|
};
|
|
9176
|
-
const rerankStats = { applied: false };
|
|
9218
|
+
const rerankStats = { applied: false, ms: 0 };
|
|
9177
9219
|
const useFusion = searchOptions?.useFusion ?? true;
|
|
9178
9220
|
const tuning = {
|
|
9179
9221
|
...searchOptions?.recencyAlpha !== void 0 && { recencyAlpha: searchOptions.recencyAlpha },
|
|
@@ -9292,13 +9334,16 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
9292
9334
|
results: [],
|
|
9293
9335
|
vaultSize: 0,
|
|
9294
9336
|
reranked: false,
|
|
9337
|
+
rerankMs: 0,
|
|
9295
9338
|
hadV2Head: false,
|
|
9296
9339
|
embeddingsUnavailable: false,
|
|
9297
9340
|
rankedOnCosine: false,
|
|
9298
9341
|
// No storage read happened, so nothing was decrypted; report the path the
|
|
9299
9342
|
// caller asked for so this turn is still attributable.
|
|
9300
9343
|
decryptLast: !!searchOptions?.decryptLast,
|
|
9301
|
-
rowsDecrypted: 0
|
|
9344
|
+
rowsDecrypted: 0,
|
|
9345
|
+
queryEmbedMs: 0,
|
|
9346
|
+
rowsEmbedded: 0
|
|
9302
9347
|
};
|
|
9303
9348
|
}
|
|
9304
9349
|
if (searchOptions?.decompose === "llm" && normalizeSubQueries(searchOptions.subQueries).length < 2 && !warnedProgrammaticDecomposeIgnored) {
|
|
@@ -9319,11 +9364,14 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
9319
9364
|
results: [],
|
|
9320
9365
|
vaultSize: 0,
|
|
9321
9366
|
reranked: false,
|
|
9367
|
+
rerankMs: 0,
|
|
9322
9368
|
hadV2Head: false,
|
|
9323
9369
|
embeddingsUnavailable: prepared.embeddingsUnavailable,
|
|
9324
9370
|
rankedOnCosine: false,
|
|
9325
9371
|
decryptLast: prepared.decryptLast,
|
|
9326
|
-
rowsDecrypted: prepared.rowsDecrypted
|
|
9372
|
+
rowsDecrypted: prepared.rowsDecrypted,
|
|
9373
|
+
queryEmbedMs: prepared.queryEmbedMs,
|
|
9374
|
+
rowsEmbedded: prepared.rowsEmbedded
|
|
9327
9375
|
};
|
|
9328
9376
|
}
|
|
9329
9377
|
if (prepared.memories.length === 0) {
|
|
@@ -9331,11 +9379,14 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
9331
9379
|
results: [],
|
|
9332
9380
|
vaultSize: prepared.vaultSize,
|
|
9333
9381
|
reranked: false,
|
|
9382
|
+
rerankMs: 0,
|
|
9334
9383
|
hadV2Head: false,
|
|
9335
9384
|
embeddingsUnavailable: prepared.embeddingsUnavailable,
|
|
9336
9385
|
rankedOnCosine: false,
|
|
9337
9386
|
decryptLast: prepared.decryptLast,
|
|
9338
|
-
rowsDecrypted: prepared.rowsDecrypted
|
|
9387
|
+
rowsDecrypted: prepared.rowsDecrypted,
|
|
9388
|
+
queryEmbedMs: prepared.queryEmbedMs,
|
|
9389
|
+
rowsEmbedded: prepared.rowsEmbedded
|
|
9339
9390
|
};
|
|
9340
9391
|
}
|
|
9341
9392
|
const ranked = await rankPreparedVaultCandidates(
|
|
@@ -9348,7 +9399,9 @@ async function searchVaultMemoriesWithSize(query, vaultCtx, embeddingOptions, ca
|
|
|
9348
9399
|
...ranked,
|
|
9349
9400
|
rankedOnCosine: !ranked.embeddingsUnavailable,
|
|
9350
9401
|
decryptLast: prepared.decryptLast,
|
|
9351
|
-
rowsDecrypted: prepared.rowsDecrypted
|
|
9402
|
+
rowsDecrypted: prepared.rowsDecrypted,
|
|
9403
|
+
queryEmbedMs: prepared.queryEmbedMs,
|
|
9404
|
+
rowsEmbedded: prepared.rowsEmbedded
|
|
9352
9405
|
};
|
|
9353
9406
|
}
|
|
9354
9407
|
async function searchVaultMemories(query, vaultCtx, embeddingOptions, cache, searchOptions) {
|
|
@@ -9498,7 +9551,7 @@ ${formatted}`;
|
|
|
9498
9551
|
}
|
|
9499
9552
|
};
|
|
9500
9553
|
}
|
|
9501
|
-
var warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
|
|
9554
|
+
var nowMs2, warnedProgrammaticDecomposeIgnored, SUPERSESSION_SIMILARITY_THRESHOLD, SUPERSESSION_MIN_AGE_GAP_MS, SUPERSESSION_BOOST_FACTOR, SUPERSESSION_MAX_WINDOW, EMBEDDINGS_DEGRADED_EMPTY_NO_LEXICAL;
|
|
9502
9555
|
var init_searchTool = __esm({
|
|
9503
9556
|
"src/lib/memoryVault/searchTool.ts"() {
|
|
9504
9557
|
"use strict";
|
|
@@ -9516,6 +9569,7 @@ var init_searchTool = __esm({
|
|
|
9516
9569
|
init_bm25();
|
|
9517
9570
|
init_decomposeQuery();
|
|
9518
9571
|
init_lruCache();
|
|
9572
|
+
nowMs2 = () => typeof performance !== "undefined" && typeof performance.now === "function" ? performance.now() : Date.now();
|
|
9519
9573
|
warnedProgrammaticDecomposeIgnored = false;
|
|
9520
9574
|
SUPERSESSION_SIMILARITY_THRESHOLD = 0.7;
|
|
9521
9575
|
SUPERSESSION_MIN_AGE_GAP_MS = 30 * 24 * 60 * 60 * 1e3;
|
package/dist/react/index.d.mts
CHANGED
|
@@ -6992,6 +6992,17 @@ interface RecallDiagnostics {
|
|
|
6992
6992
|
* never the cost.
|
|
6993
6993
|
*/
|
|
6994
6994
|
vaultRowsDecrypted?: number;
|
|
6995
|
+
/**
|
|
6996
|
+
* Rows the fact lane had to re-embed through the portal because their stored
|
|
6997
|
+
* vector was unusable — stale `embedding_model`, wrong dimension, or
|
|
6998
|
+
* unparseable. Absent when the fact lane didn't run.
|
|
6999
|
+
*
|
|
7000
|
+
* Expected to be 0 on a healthy vault: rows are embedded at write time and the
|
|
7001
|
+
* re-embed writes the current model back, so a persistently non-zero value
|
|
7002
|
+
* means the writeback is not sticking and every turn is paying for it. On the
|
|
7003
|
+
* LEGACY read path this batch is uncapped, so it can be the whole vault.
|
|
7004
|
+
*/
|
|
7005
|
+
vaultRowsEmbedded?: number;
|
|
6995
7006
|
/** Facts the fact lane returned (post-dedupe, pre-fusion). */
|
|
6996
7007
|
factCount: number;
|
|
6997
7008
|
/** Chunks the chunk lane returned (post-dedupe, pre-fusion). */
|
|
@@ -7004,6 +7015,37 @@ interface RecallDiagnostics {
|
|
|
7004
7015
|
prep: number;
|
|
7005
7016
|
/** Vault fact-lane search (`searchVaultMemoriesWithSize`). */
|
|
7006
7017
|
factLane: number;
|
|
7018
|
+
/**
|
|
7019
|
+
* The cross-encoder's share of {@link factLane} — wall-clock spent inside
|
|
7020
|
+
* `rerankPairs`. Billed even when the CE threw partway through, because a
|
|
7021
|
+
* rerank that burned three seconds and then failed still cost them.
|
|
7022
|
+
*
|
|
7023
|
+
* A SUBSET of `factLane`, not a sibling: read `factLane - rerank` for
|
|
7024
|
+
* everything else the lane did (query embed, vault read, fused ranking).
|
|
7025
|
+
* 0 when the CE did not run; `reranked` is what distinguishes that from a
|
|
7026
|
+
* rerank that cost nothing.
|
|
7027
|
+
*
|
|
7028
|
+
* Exists because #845 spent three rounds arguing about which stage inside
|
|
7029
|
+
* the fact lane dominated — whole-vault read, then admission window, then
|
|
7030
|
+
* the CE — with one aggregate number for all of them. Every hypothesis was
|
|
7031
|
+
* an inference; this makes the question a query.
|
|
7032
|
+
*/
|
|
7033
|
+
rerank: number;
|
|
7034
|
+
/**
|
|
7035
|
+
* The query embed's share of {@link factLane} — one portal round trip.
|
|
7036
|
+
*
|
|
7037
|
+
* Also a SUBSET of `factLane`. Together with `rerank` this makes the lane
|
|
7038
|
+
* decomposable: `factLane - queryEmbed - rerank` is the local work (vault
|
|
7039
|
+
* read, decrypt, BM25/cosine fusion), and each of the three implies a
|
|
7040
|
+
* completely different fix.
|
|
7041
|
+
*
|
|
7042
|
+
* 0 when the lane returned before embedding, which includes every empty
|
|
7043
|
+
* vault — `prepareVaultCandidates` short-circuits first. That is why the
|
|
7044
|
+
* fast `vault_size = 0` population never established a baseline for this
|
|
7045
|
+
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
7046
|
+
* attributable owner.
|
|
7047
|
+
*/
|
|
7048
|
+
queryEmbed: number;
|
|
7007
7049
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
7008
7050
|
chunkLane: number;
|
|
7009
7051
|
/** Cross-lane RRF fusion + provenance dedup after both lanes. */
|
package/dist/react/index.d.ts
CHANGED
|
@@ -6992,6 +6992,17 @@ interface RecallDiagnostics {
|
|
|
6992
6992
|
* never the cost.
|
|
6993
6993
|
*/
|
|
6994
6994
|
vaultRowsDecrypted?: number;
|
|
6995
|
+
/**
|
|
6996
|
+
* Rows the fact lane had to re-embed through the portal because their stored
|
|
6997
|
+
* vector was unusable — stale `embedding_model`, wrong dimension, or
|
|
6998
|
+
* unparseable. Absent when the fact lane didn't run.
|
|
6999
|
+
*
|
|
7000
|
+
* Expected to be 0 on a healthy vault: rows are embedded at write time and the
|
|
7001
|
+
* re-embed writes the current model back, so a persistently non-zero value
|
|
7002
|
+
* means the writeback is not sticking and every turn is paying for it. On the
|
|
7003
|
+
* LEGACY read path this batch is uncapped, so it can be the whole vault.
|
|
7004
|
+
*/
|
|
7005
|
+
vaultRowsEmbedded?: number;
|
|
6995
7006
|
/** Facts the fact lane returned (post-dedupe, pre-fusion). */
|
|
6996
7007
|
factCount: number;
|
|
6997
7008
|
/** Chunks the chunk lane returned (post-dedupe, pre-fusion). */
|
|
@@ -7004,6 +7015,37 @@ interface RecallDiagnostics {
|
|
|
7004
7015
|
prep: number;
|
|
7005
7016
|
/** Vault fact-lane search (`searchVaultMemoriesWithSize`). */
|
|
7006
7017
|
factLane: number;
|
|
7018
|
+
/**
|
|
7019
|
+
* The cross-encoder's share of {@link factLane} — wall-clock spent inside
|
|
7020
|
+
* `rerankPairs`. Billed even when the CE threw partway through, because a
|
|
7021
|
+
* rerank that burned three seconds and then failed still cost them.
|
|
7022
|
+
*
|
|
7023
|
+
* A SUBSET of `factLane`, not a sibling: read `factLane - rerank` for
|
|
7024
|
+
* everything else the lane did (query embed, vault read, fused ranking).
|
|
7025
|
+
* 0 when the CE did not run; `reranked` is what distinguishes that from a
|
|
7026
|
+
* rerank that cost nothing.
|
|
7027
|
+
*
|
|
7028
|
+
* Exists because #845 spent three rounds arguing about which stage inside
|
|
7029
|
+
* the fact lane dominated — whole-vault read, then admission window, then
|
|
7030
|
+
* the CE — with one aggregate number for all of them. Every hypothesis was
|
|
7031
|
+
* an inference; this makes the question a query.
|
|
7032
|
+
*/
|
|
7033
|
+
rerank: number;
|
|
7034
|
+
/**
|
|
7035
|
+
* The query embed's share of {@link factLane} — one portal round trip.
|
|
7036
|
+
*
|
|
7037
|
+
* Also a SUBSET of `factLane`. Together with `rerank` this makes the lane
|
|
7038
|
+
* decomposable: `factLane - queryEmbed - rerank` is the local work (vault
|
|
7039
|
+
* read, decrypt, BM25/cosine fusion), and each of the three implies a
|
|
7040
|
+
* completely different fix.
|
|
7041
|
+
*
|
|
7042
|
+
* 0 when the lane returned before embedding, which includes every empty
|
|
7043
|
+
* vault — `prepareVaultCandidates` short-circuits first. That is why the
|
|
7044
|
+
* fast `vault_size = 0` population never established a baseline for this
|
|
7045
|
+
* cost, and why the ~850ms floor on the smallest NON-empty vaults had no
|
|
7046
|
+
* attributable owner.
|
|
7047
|
+
*/
|
|
7048
|
+
queryEmbed: number;
|
|
7007
7049
|
/** Chunk-lane search (`searchChunksOp`). */
|
|
7008
7050
|
chunkLane: number;
|
|
7009
7051
|
/** Cross-lane RRF fusion + provenance dedup after both lanes. */
|
package/dist/react/index.mjs
CHANGED