@dzhechkov/harness-core 0.6.1 → 0.7.2
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/.dz-manifest.json +60 -796
- package/README.md +40 -1
- package/dist/agentdb-index.d.ts +11 -0
- package/dist/agentdb-index.d.ts.map +1 -1
- package/dist/agentdb-index.js +8 -1
- package/dist/agentdb-index.js.map +1 -1
- package/dist/guard.d.ts +29 -0
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +54 -0
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/publish-signing.d.ts +113 -0
- package/dist/publish-signing.d.ts.map +1 -0
- package/dist/publish-signing.js +124 -0
- package/dist/publish-signing.js.map +1 -0
- package/dist/publish.d.ts +21 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publish.js +106 -0
- package/dist/publish.js.map +1 -1
- package/dist/registry.d.ts +19 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +91 -1
- package/dist/registry.js.map +1 -1
- package/dist/sign.d.ts +38 -4
- package/dist/sign.d.ts.map +1 -1
- package/dist/sign.js +174 -8
- package/dist/sign.js.map +1 -1
- package/dist/vector-tier.d.ts +81 -0
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +137 -10
- package/dist/vector-tier.js.map +1 -1
- package/package.json +5 -5
- package/sbom.json +89 -1929
- package/src/agentdb-index.ts +8 -1
- package/src/guard.ts +74 -0
- package/src/index.ts +3 -1
- package/src/publish-signing.ts +217 -0
- package/src/publish.ts +102 -1
- package/src/registry.ts +84 -1
- package/src/sign.ts +162 -8
- package/src/vector-tier.ts +202 -12
package/dist/vector-tier.d.ts
CHANGED
|
@@ -94,6 +94,17 @@ export interface VectorEngine {
|
|
|
94
94
|
ids: string[];
|
|
95
95
|
error?: string | undefined;
|
|
96
96
|
}>;
|
|
97
|
+
/**
|
|
98
|
+
* Ids of the PATTERN scope only — the task types `lexicalMirrorable` counts. Optional: an engine
|
|
99
|
+
* that cannot narrow reports nothing and the caller degrades to `orphaned: undefined`, never to a
|
|
100
|
+
* fabricated zero. Exists because `listIds()` deliberately enumerates the OWNED SUPERSET, which
|
|
101
|
+
* also holds `dz-backlog` ideas — and reporting that number beside a pattern-only count once led a
|
|
102
|
+
* reader to conclude half the index was orphaned when none of it was (ADR-001).
|
|
103
|
+
*/
|
|
104
|
+
listPatternIds?(): Promise<{
|
|
105
|
+
ids: string[];
|
|
106
|
+
error?: string | undefined;
|
|
107
|
+
}>;
|
|
97
108
|
/** Portable single-file checkpoint (RVF adapter only — `dz vector export`). */
|
|
98
109
|
exportCheckpoint?(dest: string): Promise<{
|
|
99
110
|
error?: string | undefined;
|
|
@@ -133,7 +144,36 @@ export interface HybridRecall {
|
|
|
133
144
|
readonly vectorReason?: string | undefined;
|
|
134
145
|
/** Engine was present but the search failed/timed out — lexical results returned instead. */
|
|
135
146
|
readonly vectorError?: string | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* How many candidates the engine RETURNED for this query. Zero on every lexical-only path.
|
|
149
|
+
*
|
|
150
|
+
* This and `semanticRanked` exist so the OUTPUT can state what the run did instead of what the
|
|
151
|
+
* config allows. Every false claim this feature removed came from deriving a statement about the
|
|
152
|
+
* run from `vectorEngine !== 'none'`, which is engine RESOLVABILITY (ADR-001).
|
|
153
|
+
*/
|
|
154
|
+
readonly semanticCandidates: number;
|
|
155
|
+
/**
|
|
156
|
+
* How many of those candidates survived the orphan drop and entered the merge — the honest test of
|
|
157
|
+
* "did a vector rank anything". It can be 0 while `semanticCandidates` is positive: an engine that
|
|
158
|
+
* returns only ids the lexical store no longer has has participated in nothing.
|
|
159
|
+
*/
|
|
160
|
+
readonly semanticRanked: number;
|
|
136
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* How many of `mirrorable` are absent from the mirror, given the set of ids the mirror and the
|
|
164
|
+
* pending queue account for.
|
|
165
|
+
*
|
|
166
|
+
* A record counts as mirrored under EITHER key, because there are two write seams and they do NOT
|
|
167
|
+
* agree: `patternVectorEntry` (teach) writes the CONTENT-addressed `patternRecordId`, while
|
|
168
|
+
* `memoryRecordVectorEntry` (backfill/dream) writes the record's own `r.id`. MEASURED on the real
|
|
169
|
+
* store (2026-08-22): 270 of 272 records have the same value for both, and the 2 that differ — a
|
|
170
|
+
* `dream:` record and one re-keyed teach record — are mirrored under their OWN id. Joining on the
|
|
171
|
+
* derived key alone reported them as an unpaid debt and advised a reindex with nothing to do.
|
|
172
|
+
*
|
|
173
|
+
* Pure and exported so the divergent case is testable without a store: a `dream:`-prefixed id can
|
|
174
|
+
* never equal `patternRecordId`, which always yields `teach:<hash>`.
|
|
175
|
+
*/
|
|
176
|
+
export declare function countUnmirrored(mirrorable: readonly MemoryRecord[], accounted: ReadonlySet<string>): number;
|
|
137
177
|
/** Field observability for `dz vector status` (I-2/I-5 in the field). */
|
|
138
178
|
export interface VectorTierStatus {
|
|
139
179
|
readonly mode: VectorEngineMode;
|
|
@@ -143,8 +183,44 @@ export interface VectorTierStatus {
|
|
|
143
183
|
readonly embeddingModel?: string | undefined;
|
|
144
184
|
readonly lexicalTotal: number;
|
|
145
185
|
readonly lexicalMirrorable: number;
|
|
186
|
+
/**
|
|
187
|
+
* How many MIRRORABLE RECORDS are in the vector store, counted in the same scope
|
|
188
|
+
* `lexicalMirrorable` counts — so the two may be read as a pair.
|
|
189
|
+
*
|
|
190
|
+
* `undefined` when the engine cannot report per-scope counts: under the narrower meaning this
|
|
191
|
+
* field now carries, the unnarrowed store total is NOT an answer to the question it asks.
|
|
192
|
+
*/
|
|
146
193
|
readonly mirrored?: number | undefined;
|
|
147
194
|
readonly pending: number;
|
|
195
|
+
/**
|
|
196
|
+
* Whether the mirror WRITER is enabled — `vectorMirrorEnabled()`'s own answer, reported separately
|
|
197
|
+
* from `available`, which is about the ENGINE. Conflating the two is what let an unconfigured
|
|
198
|
+
* project print a fully-healthy status line over a dead writer (ADR-001).
|
|
199
|
+
*/
|
|
200
|
+
readonly mirrorWriterEnabled: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Vectors of OTHER dz-owned task types (today: `dz-backlog`). Reported separately so a store of N
|
|
203
|
+
* vectors can be fully accounted for, and never folded into `mirrored`, which must stay comparable
|
|
204
|
+
* to `lexicalMirrorable`. `undefined` when the engine cannot narrow its listing.
|
|
205
|
+
*/
|
|
206
|
+
readonly mirroredOther?: number | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* Pattern-scope vectors matching NO record under either key — the real meaning of "orphan", and
|
|
209
|
+
* until this feature nothing computed it. `undefined` when the engine cannot narrow its listing.
|
|
210
|
+
*/
|
|
211
|
+
readonly orphaned?: number | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Mirrorable records present in NEITHER the mirror NOR the pending queue — an exact set difference
|
|
214
|
+
* over ids, so an orphan vector can never make it negative.
|
|
215
|
+
*
|
|
216
|
+
* The name is deliberately `unmirrored`, not `unqueued`: the difference proves only that a record
|
|
217
|
+
* is not in the mirror NOW. A vector that was written and later deleted, or a pending entry that
|
|
218
|
+
* was cleared, is indistinguishable from one never offered — so claiming "never queued" would
|
|
219
|
+
* overstate what was measured (raised by cross-family review, 2026-08-22).
|
|
220
|
+
*
|
|
221
|
+
* `undefined` means UNKNOWN — no engine, or an engine whose `listIds()` failed. It never means zero.
|
|
222
|
+
*/
|
|
223
|
+
readonly unmirrored?: number | undefined;
|
|
148
224
|
}
|
|
149
225
|
/** Wall-time bound applied to EVERY engine call, read and write legs alike (ADR R1 + NC1). */
|
|
150
226
|
export declare const DEFAULT_VECTOR_TIMEOUT_MS = 10000;
|
|
@@ -338,6 +414,11 @@ export interface RankedPattern {
|
|
|
338
414
|
/**
|
|
339
415
|
* Reciprocal Rank Fusion merge: `score(p) = Σ 1/(60 + rank)` over the lists containing `p`
|
|
340
416
|
* (semantic ranks weighted by `semanticWeight`). Dedup by id; `backend: 'both'` when a pattern
|
|
417
|
+
*
|
|
418
|
+
* Ordering: fused score, then EVIDENCE (`both` before lexical-only before semantic-only), then id.
|
|
419
|
+
* When `semanticWeight > 1` the lexical top-1 is guaranteed a place in the result, taken from the
|
|
420
|
+
* last seat unless that seat holds a `both` hit. See `features/semantic-keeps-exact-hits`.
|
|
421
|
+
*
|
|
341
422
|
* appears in both lists. DETERMINISTIC (AC-6): ties break on id, so fixed inputs always yield
|
|
342
423
|
* the same ordering. Pure — no I/O.
|
|
343
424
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-tier.d.ts","sourceRoot":"","sources":["../src/vector-tier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAQH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEpE,OAAO,EAcL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAuBvB,0CAA0C;AAC1C,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,KAAK,CAAC;AAEjD,wFAAwF;AACxF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAElE,4FAA4F;AAC5F,MAAM,WAAW,WAAW;IAC1B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0EAA0E;IAC1E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qGAAqG;IACrG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACxD,QA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,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE,gBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAyHrH;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CA8F9H;AA6GD,UAAU,cAAc;IACtB,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACtE,KAAK,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IACpE,KAAK,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACjD,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,GAAG,SAAS,CAAC;CAC/E;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CA4B9I"}
|
package/dist/vector-tier.js
CHANGED
|
@@ -37,13 +37,30 @@ import { pathToFileURL } from 'node:url';
|
|
|
37
37
|
import { createRequire } from 'node:module';
|
|
38
38
|
import { isNoiseInsight } from '@dzhechkov/memory';
|
|
39
39
|
import { recallPatterns, recordToPattern, patternRecordId, patternIdentityOf, dreamRecordId, lessonDeltaMap, loadStoreRecords, readMemoryLearningConfig, readReinforcementState, readQuarantineState, removePatternsByIds, snapshotStore, updateReinforcementState, } from './patterns.js';
|
|
40
|
-
import { indexPatternsToAgentdb, searchAgentdbPatterns, listAgentdbDzIds, resolveAgentdbEmbedder, cosineSimilarity, importVectorsToAgentdb, reindexAgentdbRows, readAgentdbRowsByTaskType, DZ_OWNED_TASK_TYPES, } from './agentdb-index.js';
|
|
40
|
+
import { indexPatternsToAgentdb, searchAgentdbPatterns, listAgentdbDzIds, DZ_PATTERN_TASK_TYPES, resolveAgentdbEmbedder, cosineSimilarity, importVectorsToAgentdb, reindexAgentdbRows, readAgentdbRowsByTaskType, DZ_OWNED_TASK_TYPES, } from './agentdb-index.js';
|
|
41
41
|
// smart-backlog (ADR-001/005 lifecycle): `dz vector reindex` must re-embed dz-backlog rows too, or
|
|
42
42
|
// they rot in a stale embedding space after a model bump. One-directional import — backlog.ts imports
|
|
43
43
|
// agentdb-index/compounding only, never vector-tier, so there is no cycle.
|
|
44
44
|
import { BACKLOG_TASK_TYPE } from './backlog.js';
|
|
45
45
|
import { currentEmbedManifest, guardEmbedSpace, DEFAULT_EMBED_DIM, resolveEmbedModel } from './embedding-config.js';
|
|
46
46
|
import { applyLearningSignals, applyLearningSignalsWithDelta, resolveLearningBackend } from './learning-backend.js';
|
|
47
|
+
/**
|
|
48
|
+
* How many of `mirrorable` are absent from the mirror, given the set of ids the mirror and the
|
|
49
|
+
* pending queue account for.
|
|
50
|
+
*
|
|
51
|
+
* A record counts as mirrored under EITHER key, because there are two write seams and they do NOT
|
|
52
|
+
* agree: `patternVectorEntry` (teach) writes the CONTENT-addressed `patternRecordId`, while
|
|
53
|
+
* `memoryRecordVectorEntry` (backfill/dream) writes the record's own `r.id`. MEASURED on the real
|
|
54
|
+
* store (2026-08-22): 270 of 272 records have the same value for both, and the 2 that differ — a
|
|
55
|
+
* `dream:` record and one re-keyed teach record — are mirrored under their OWN id. Joining on the
|
|
56
|
+
* derived key alone reported them as an unpaid debt and advised a reindex with nothing to do.
|
|
57
|
+
*
|
|
58
|
+
* Pure and exported so the divergent case is testable without a store: a `dream:`-prefixed id can
|
|
59
|
+
* never equal `patternRecordId`, which always yields `teach:<hash>`.
|
|
60
|
+
*/
|
|
61
|
+
export function countUnmirrored(mirrorable, accounted) {
|
|
62
|
+
return mirrorable.filter((r) => !accounted.has(r.id) && !accounted.has(patternRecordId(recordToPattern(r)))).length;
|
|
63
|
+
}
|
|
47
64
|
/** Wall-time bound applied to EVERY engine call, read and write legs alike (ADR R1 + NC1). */
|
|
48
65
|
export const DEFAULT_VECTOR_TIMEOUT_MS = 10_000;
|
|
49
66
|
/** Default cosine cutoff for near-duplicate clustering (`--threshold` / config overrides). */
|
|
@@ -430,6 +447,11 @@ const RRF_K = 60;
|
|
|
430
447
|
/**
|
|
431
448
|
* Reciprocal Rank Fusion merge: `score(p) = Σ 1/(60 + rank)` over the lists containing `p`
|
|
432
449
|
* (semantic ranks weighted by `semanticWeight`). Dedup by id; `backend: 'both'` when a pattern
|
|
450
|
+
*
|
|
451
|
+
* Ordering: fused score, then EVIDENCE (`both` before lexical-only before semantic-only), then id.
|
|
452
|
+
* When `semanticWeight > 1` the lexical top-1 is guaranteed a place in the result, taken from the
|
|
453
|
+
* last seat unless that seat holds a `both` hit. See `features/semantic-keeps-exact-hits`.
|
|
454
|
+
*
|
|
433
455
|
* appears in both lists. DETERMINISTIC (AC-6): ties break on id, so fixed inputs always yield
|
|
434
456
|
* the same ordering. Pure — no I/O.
|
|
435
457
|
*/
|
|
@@ -448,14 +470,62 @@ export function mergeHybridHits(lexical, semantic, opts) {
|
|
|
448
470
|
cur.score += weight / (RRF_K + rank + 1);
|
|
449
471
|
acc.set(h.id, cur);
|
|
450
472
|
});
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
473
|
+
// Ties break by EVIDENCE, not by the id alphabet: a hit both legs found outranks one only a single
|
|
474
|
+
// leg found. Before this, an exact-term match lost a tie to an arbitrary semantic hit purely
|
|
475
|
+
// because its id sorted later (ADR-001 AM-4).
|
|
476
|
+
const evidence = (v) => (v.lex !== undefined && v.sem ? 0 : v.lex !== undefined ? 1 : 2);
|
|
477
|
+
const ordered = [...acc.entries()]
|
|
478
|
+
.sort((a, b) => b[1].score - a[1].score
|
|
479
|
+
|| evidence(a[1]) - evidence(b[1])
|
|
480
|
+
|| (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0));
|
|
481
|
+
const toHit = ([, v]) => ({
|
|
455
482
|
pattern: v.pattern,
|
|
456
483
|
backend: v.lex !== undefined && v.sem ? 'both' : v.lex ?? 'vector',
|
|
457
484
|
score: v.score,
|
|
458
|
-
})
|
|
485
|
+
});
|
|
486
|
+
// `slice(0, -1)` drops the LAST element instead of returning nothing, so a negative limit used to
|
|
487
|
+
// return almost the whole list (MEASURED: limit -1 over 5 candidates returned 4). `dz recall`
|
|
488
|
+
// clamps its own --limit, but this function is exported and the failure is silent, so it defends
|
|
489
|
+
// itself. `Infinity` means NO limit and must keep meaning that — the first version of this clamp
|
|
490
|
+
// rejected it along with NaN and returned nothing (found by independent review).
|
|
491
|
+
const limit = opts.limit === Number.POSITIVE_INFINITY
|
|
492
|
+
? acc.size
|
|
493
|
+
: Number.isFinite(opts.limit) ? Math.max(0, Math.trunc(opts.limit)) : 0;
|
|
494
|
+
const cut = ordered.slice(0, limit);
|
|
495
|
+
// The lexical TOP-1 gets a RESERVED SEAT — but ONLY when the caller asked to emphasise the
|
|
496
|
+
// semantic leg. `--semantic` is meant to emphasise it, and instead REPLACES the lexical one: with
|
|
497
|
+
// RRF_K=60 a lexical hit at rank r is beaten by every semantic hit at rank s <= 61+2r, and the
|
|
498
|
+
// semantic list is capped at limit*2, so at any sane limit EVERY semantic hit outranks EVERY
|
|
499
|
+
// lexical one and an exact match on a rare identifier vanishes (MEASURED: one exact hit + three
|
|
500
|
+
// unrelated semantic hits at limit 3 → absent under weight 2, present under weight 1). Tuning the
|
|
501
|
+
// weight cannot fix it: any weight above ~1.02 has the same total effect.
|
|
502
|
+
//
|
|
503
|
+
// Gated on `weight > 1` because in HYBRID mode there is nothing to repair and the seat does real
|
|
504
|
+
// harm: at limit 1 it evicted a `both` hit scoring 0.0325 to seat a lexical-only hit scoring
|
|
505
|
+
// 0.0164 — half the score, and a hit BOTH legs had found (MEASURED, found by independent review;
|
|
506
|
+
// the first version of this ADR wrongly claimed the seat could not alter hybrid results).
|
|
507
|
+
// A `both` hit is never evicted: it is the strongest evidence the merge has.
|
|
508
|
+
const top = lexical[0];
|
|
509
|
+
if (weight > 1 && top !== undefined && limit > 0 && !cut.some(([id]) => id === top.id)) {
|
|
510
|
+
const seat = ordered.find(([id]) => id === top.id);
|
|
511
|
+
// Evict the WEAKEST hit that is not `both` — not simply the last one. Checking only the last
|
|
512
|
+
// seat meant a `both` hit sitting there blocked the reservation entirely, even when an evictable
|
|
513
|
+
// semantic-only hit stood right beside it: lexical [TOP, SHARED], semantic [S0…S59, SHARED],
|
|
514
|
+
// limit 2 → the cut is [S0, SHARED(both)] and TOP was dropped anyway (MEASURED, found by
|
|
515
|
+
// cross-family review). If every seat holds a `both` hit there is nothing to take, and the
|
|
516
|
+
// reservation is skipped: a hit both legs found is the strongest evidence the merge has.
|
|
517
|
+
let victim = -1;
|
|
518
|
+
for (let i = cut.length - 1; i >= 0; i -= 1) {
|
|
519
|
+
const entry = cut[i];
|
|
520
|
+
if (entry !== undefined && !(entry[1].lex !== undefined && entry[1].sem)) {
|
|
521
|
+
victim = i;
|
|
522
|
+
break;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (seat !== undefined && victim >= 0)
|
|
526
|
+
cut[victim] = seat;
|
|
527
|
+
}
|
|
528
|
+
return cut.map(toHit);
|
|
459
529
|
}
|
|
460
530
|
function markRecallHits(projectRoot, backend, hits, idOf) {
|
|
461
531
|
const cfg = readMemoryLearningConfig(projectRoot);
|
|
@@ -527,6 +597,8 @@ export async function recallHybrid(projectRoot, query, opts = {}) {
|
|
|
527
597
|
hits: enhance(lexical.map((h, rank) => ({ pattern: h.pattern, backend: h.backend, score: 1 / (RRF_K + rank + 1) }))),
|
|
528
598
|
lexicalBackend,
|
|
529
599
|
vectorEngine: 'none',
|
|
600
|
+
semanticCandidates: 0,
|
|
601
|
+
semanticRanked: 0,
|
|
530
602
|
...extra,
|
|
531
603
|
});
|
|
532
604
|
if (mode === 'lexical') {
|
|
@@ -552,6 +624,7 @@ export async function recallHybrid(projectRoot, query, opts = {}) {
|
|
|
552
624
|
const timeoutMs = opts.timeoutMs ?? DEFAULT_VECTOR_TIMEOUT_MS;
|
|
553
625
|
const sr = await withVectorTimeout(safeEngineCall(() => engine.search(query, limit * 2), (m) => ({ hits: [], error: `vector search failed: ${m}` })), timeoutMs, () => ({ hits: [], error: `vector search timed out after ${timeoutMs}ms` }));
|
|
554
626
|
if (sr.error !== undefined) {
|
|
627
|
+
// The engine answered with an error, so nothing was returned and nothing ranked — both zero.
|
|
555
628
|
const out = { ...lexicalOnly({}), vectorEngine: engine.kind, vectorError: sr.error };
|
|
556
629
|
markRecallHits(projectRoot, learning, out.hits, idOf);
|
|
557
630
|
return out;
|
|
@@ -580,7 +653,13 @@ export async function recallHybrid(projectRoot, query, opts = {}) {
|
|
|
580
653
|
}));
|
|
581
654
|
const hits = enhance(mergeHybridHits(lex, semantic, { limit, semanticWeight: mode === 'semantic' ? 2 : 1 }));
|
|
582
655
|
markRecallHits(projectRoot, learning, hits, idOf);
|
|
583
|
-
return {
|
|
656
|
+
return {
|
|
657
|
+
hits,
|
|
658
|
+
lexicalBackend,
|
|
659
|
+
vectorEngine: engine.kind,
|
|
660
|
+
semanticCandidates: sr.hits.length,
|
|
661
|
+
semanticRanked: semantic.length,
|
|
662
|
+
};
|
|
584
663
|
}
|
|
585
664
|
export async function teachGuard(projectRoot, text, opts = {}) {
|
|
586
665
|
const cfg = readMemoryLearningConfig(projectRoot);
|
|
@@ -612,10 +691,15 @@ export async function vectorTierStatus(projectRoot, opts = {}) {
|
|
|
612
691
|
catch {
|
|
613
692
|
records = [];
|
|
614
693
|
}
|
|
615
|
-
const
|
|
616
|
-
const
|
|
694
|
+
const mirrorableRecords = records.filter((r) => !isVectorNoise(r.text));
|
|
695
|
+
const lexicalMirrorable = mirrorableRecords.length;
|
|
696
|
+
const pendingEntries = readVectorPending(projectRoot);
|
|
697
|
+
const pending = pendingEntries.length;
|
|
698
|
+
const mirrorWriterEnabled = vectorMirrorEnabled(projectRoot);
|
|
617
699
|
const resolved = pickEngine(projectRoot, opts);
|
|
618
700
|
if (resolved.engine === undefined) {
|
|
701
|
+
// No engine to ask ⇒ the debt is UNKNOWN. Reporting 0 here is precisely the defect this feature
|
|
702
|
+
// closes: a number nobody computed is not a number anyone may print (ADR-001, AM-5).
|
|
619
703
|
return {
|
|
620
704
|
mode,
|
|
621
705
|
available: false,
|
|
@@ -624,10 +708,45 @@ export async function vectorTierStatus(projectRoot, opts = {}) {
|
|
|
624
708
|
lexicalTotal: records.length,
|
|
625
709
|
lexicalMirrorable,
|
|
626
710
|
pending,
|
|
711
|
+
mirrorWriterEnabled,
|
|
627
712
|
};
|
|
628
713
|
}
|
|
629
714
|
const engine = resolved.engine;
|
|
630
715
|
const listed = await withVectorTimeout(safeEngineCall(() => engine.listIds(), (m) => ({ ids: [], error: `vector listIds failed: ${m}` })), opts.timeoutMs ?? DEFAULT_VECTOR_TIMEOUT_MS, () => ({ ids: [], error: 'vector listIds timed out' }));
|
|
716
|
+
// The debt is a SET DIFFERENCE over the content-addressed ids the mirror actually writes under,
|
|
717
|
+
// not `mirrorable - mirrored - pending`: a vector can outlive its record (an orphan left by a
|
|
718
|
+
// harmonize), which makes the subtraction negative and the flooring a fresh lie (ADR-001 alt-b).
|
|
719
|
+
const accounted = new Set([...listed.ids, ...pendingEntries.map((e) => e.dzId)]);
|
|
720
|
+
const unmirrored = listed.error === undefined
|
|
721
|
+
? countUnmirrored(mirrorableRecords, accounted)
|
|
722
|
+
: undefined;
|
|
723
|
+
// `listIds()` enumerates the OWNED SUPERSET — it also holds `dz-backlog` ideas — so its count may
|
|
724
|
+
// not be printed beside a pattern-only lexical count. MEASURED on this repository: 547 ids against
|
|
725
|
+
// 274 records, of which 273 were backlog idea ids and ZERO were true orphans; a reader took the
|
|
726
|
+
// pair at face value and filed a task to prune a healthy index (ADR-001). Narrow it where the
|
|
727
|
+
// engine can, and report `undefined` where it cannot — never a fabricated zero.
|
|
728
|
+
const narrowed = listed.error === undefined && engine.listPatternIds !== undefined
|
|
729
|
+
? await withVectorTimeout(safeEngineCall(() => engine.listPatternIds(), (m) => ({ ids: [], error: `vector listPatternIds failed: ${m}` })), opts.timeoutMs ?? DEFAULT_VECTOR_TIMEOUT_MS, () => ({ ids: [], error: 'vector listPatternIds timed out' }))
|
|
730
|
+
: undefined;
|
|
731
|
+
// `known` is built from ALL records, not just the mirrorable ones: a vector written for a record
|
|
732
|
+
// the noise gate later excluded still HAS a record, and calling it an orphan would send the user
|
|
733
|
+
// pruning something that is merely un-mirrorable (found by cross-family review).
|
|
734
|
+
const keysOf = (r) => [r.id, patternRecordId(recordToPattern(r))];
|
|
735
|
+
const known = new Set();
|
|
736
|
+
for (const r of records)
|
|
737
|
+
for (const k of keysOf(r))
|
|
738
|
+
known.add(k);
|
|
739
|
+
const scoped = narrowed !== undefined && narrowed.error === undefined ? narrowed.ids : undefined;
|
|
740
|
+
const scopedSet = scoped !== undefined ? new Set(scoped) : undefined;
|
|
741
|
+
// Count RECORDS, not ids. A record has two possible keys and the mirror may hold BOTH, which
|
|
742
|
+
// counting ids turns into two mirrored records where there is one (found by cross-family review).
|
|
743
|
+
const mirrored = scopedSet !== undefined
|
|
744
|
+
? mirrorableRecords.filter((r) => keysOf(r).some((k) => scopedSet.has(k))).length
|
|
745
|
+
: undefined;
|
|
746
|
+
const orphaned = scoped !== undefined ? scoped.filter((id) => !known.has(id)).length : undefined;
|
|
747
|
+
const mirroredOther = scoped !== undefined && listed.error === undefined
|
|
748
|
+
? listed.ids.length - scoped.length
|
|
749
|
+
: undefined;
|
|
631
750
|
return {
|
|
632
751
|
mode,
|
|
633
752
|
kind: engine.kind,
|
|
@@ -636,8 +755,12 @@ export async function vectorTierStatus(projectRoot, opts = {}) {
|
|
|
636
755
|
...(!('error' in model) ? { embeddingModel: model.model } : {}),
|
|
637
756
|
lexicalTotal: records.length,
|
|
638
757
|
lexicalMirrorable,
|
|
639
|
-
mirrored
|
|
758
|
+
mirrored,
|
|
640
759
|
pending,
|
|
760
|
+
mirrorWriterEnabled,
|
|
761
|
+
...(unmirrored !== undefined ? { unmirrored } : {}),
|
|
762
|
+
...(mirroredOther !== undefined ? { mirroredOther } : {}),
|
|
763
|
+
...(orphaned !== undefined ? { orphaned } : {}),
|
|
641
764
|
};
|
|
642
765
|
}
|
|
643
766
|
export async function reindexVectorStore(projectRoot, opts = {}) {
|
|
@@ -1118,6 +1241,10 @@ function agentdbVectorEngine(projectRoot) {
|
|
|
1118
1241
|
async listIds() {
|
|
1119
1242
|
return listAgentdbDzIds(projectRoot);
|
|
1120
1243
|
},
|
|
1244
|
+
async listPatternIds() {
|
|
1245
|
+
// the NARROWED scope — what `lexicalMirrorable` counts, so the two numbers are comparable
|
|
1246
|
+
return listAgentdbDzIds(projectRoot, { taskTypes: DZ_PATTERN_TASK_TYPES });
|
|
1247
|
+
},
|
|
1121
1248
|
async importVectors(rows) {
|
|
1122
1249
|
return importVectorsToAgentdb(projectRoot, rows.map((r) => ({
|
|
1123
1250
|
dzId: r.dzId,
|