@dzhechkov/harness-core 0.3.78 → 0.3.82
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/agentdb-index.d.ts +35 -0
- package/dist/agentdb-index.d.ts.map +1 -1
- package/dist/agentdb-index.js +67 -2
- package/dist/agentdb-index.js.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/patterns.d.ts +32 -0
- package/dist/patterns.d.ts.map +1 -1
- package/dist/patterns.js +0 -0
- package/dist/patterns.js.map +1 -1
- package/dist/skill-drift.d.ts +99 -0
- package/dist/skill-drift.d.ts.map +1 -0
- package/dist/skill-drift.js +210 -0
- package/dist/skill-drift.js.map +1 -0
- package/dist/vector-tier.d.ts +139 -0
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +400 -3
- package/dist/vector-tier.js.map +1 -1
- package/package.json +2 -2
- package/src/agentdb-index.ts +100 -2
- package/src/index.ts +18 -4
- package/src/patterns.ts +0 -0
- package/src/skill-drift.ts +273 -0
- package/src/vector-tier.ts +503 -2
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Intra-monorepo skill-drift guard.
|
|
3
|
+
*
|
|
4
|
+
* The same skill is physically duplicated across many monorepo packages
|
|
5
|
+
* (`packages/@dzhechkov/*/<skill>/` + `.claude/skills/<skill>/`). A fix applied to ONE copy
|
|
6
|
+
* silently leaves the others broken — this is exactly how a CRITICAL `goap-research-ed25519`
|
|
7
|
+
* self-signed-forgery exploit shipped in 10 of 12 copies, and how a `brutal-honesty-review`
|
|
8
|
+
* `set -e` crash reached the PUBLISHED `@dzhechkov/skills-qe`. Both were found only by accident.
|
|
9
|
+
*
|
|
10
|
+
* `dz sync-upstream` only checks against EXTERNAL repos and is structurally blind to this class of
|
|
11
|
+
* drift. This module is the intra-monorepo complement:
|
|
12
|
+
*
|
|
13
|
+
* • `sweepSkillDrift(root)` — detector: which shared skills byte-differ between copies.
|
|
14
|
+
* • `syncCanonicalSkill(root, s)` — healer: overwrite every copy from `skills-meta/<skill>`.
|
|
15
|
+
*
|
|
16
|
+
* Both are PURE functions that return plain data — no printing, no `process.exit`, no throwing on
|
|
17
|
+
* the "canonical missing" / "drift found" business cases. The CLI layer owns exit codes and I/O.
|
|
18
|
+
* Dependency-free: `node:fs` / `node:path` / `node:crypto` only.
|
|
19
|
+
*
|
|
20
|
+
* @packageDocumentation
|
|
21
|
+
*/
|
|
22
|
+
import { readdirSync, statSync, readFileSync, writeFileSync, mkdirSync, rmSync, existsSync } from 'node:fs';
|
|
23
|
+
import { join, relative, dirname, basename } from 'node:path';
|
|
24
|
+
import { createHash } from 'node:crypto';
|
|
25
|
+
const SKILL_MANIFEST = 'SKILL.md';
|
|
26
|
+
const IGNORED_ENTRIES = new Set(['node_modules', '__pycache__', '.DS_Store']);
|
|
27
|
+
/** md5 of a file's bytes (identical to both prototype scripts ⇒ identical drift verdicts). */
|
|
28
|
+
function md5(path) {
|
|
29
|
+
return createHash('md5').update(readFileSync(path)).digest('hex');
|
|
30
|
+
}
|
|
31
|
+
/** Recursive file list under `dir`; skips `node_modules` / `__pycache__` / `.DS_Store`. */
|
|
32
|
+
function walk(dir) {
|
|
33
|
+
const out = [];
|
|
34
|
+
for (const entry of readdirSync(dir)) {
|
|
35
|
+
if (IGNORED_ENTRIES.has(entry))
|
|
36
|
+
continue;
|
|
37
|
+
const p = join(dir, entry);
|
|
38
|
+
let st;
|
|
39
|
+
try {
|
|
40
|
+
st = statSync(p);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (st.isDirectory())
|
|
46
|
+
out.push(...walk(p));
|
|
47
|
+
else
|
|
48
|
+
out.push(p);
|
|
49
|
+
}
|
|
50
|
+
return out;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Every skill dir (a dir containing `SKILL.md`) under `packages/` + `.claude/skills`, excluding
|
|
54
|
+
* `node_modules` / `__pycache__`. Ported verbatim from `scripts/drift-sweep-skills.mjs`.
|
|
55
|
+
*/
|
|
56
|
+
function findSkillDirs(root, scope = 'all') {
|
|
57
|
+
const dirs = [];
|
|
58
|
+
const roots = scope === 'packages' ? [join(root, 'packages')] : [join(root, 'packages'), join(root, '.claude', 'skills')];
|
|
59
|
+
const stack = roots.filter((p) => existsSync(p));
|
|
60
|
+
while (stack.length) {
|
|
61
|
+
const d = stack.pop();
|
|
62
|
+
let entries;
|
|
63
|
+
try {
|
|
64
|
+
entries = readdirSync(d);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (entries.includes(SKILL_MANIFEST))
|
|
70
|
+
dirs.push(d);
|
|
71
|
+
for (const e of entries) {
|
|
72
|
+
if (IGNORED_ENTRIES.has(e))
|
|
73
|
+
continue;
|
|
74
|
+
const p = join(d, e);
|
|
75
|
+
try {
|
|
76
|
+
if (statSync(p).isDirectory())
|
|
77
|
+
stack.push(p);
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
/* skip unreadable entries */
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return dirs;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Detect intra-monorepo skill drift: find every skill duplicated across ≥2 locations and report
|
|
88
|
+
* which copies byte-differ. Pure port of `scripts/drift-sweep-skills.mjs`.
|
|
89
|
+
*
|
|
90
|
+
* `result.drifted.length === 0` is the exact condition the CI gate keys on.
|
|
91
|
+
*/
|
|
92
|
+
export function sweepSkillDrift(root, opts = {}) {
|
|
93
|
+
const scope = opts.scope ?? 'all';
|
|
94
|
+
const allow = new Set(opts.allowlist ?? []);
|
|
95
|
+
// Group skill dirs by basename → Map<name, locations[]>.
|
|
96
|
+
const byName = new Map();
|
|
97
|
+
for (const d of findSkillDirs(root, scope)) {
|
|
98
|
+
const name = basename(d);
|
|
99
|
+
const list = byName.get(name);
|
|
100
|
+
if (list)
|
|
101
|
+
list.push(d);
|
|
102
|
+
else
|
|
103
|
+
byName.set(name, [d]);
|
|
104
|
+
}
|
|
105
|
+
let duplicated = 0;
|
|
106
|
+
const drifted = [];
|
|
107
|
+
const allowlisted = [];
|
|
108
|
+
for (const [name, unsorted] of [...byName.entries()].sort((a, b) => (a[0] < b[0] ? -1 : 1))) {
|
|
109
|
+
if (unsorted.length < 2)
|
|
110
|
+
continue;
|
|
111
|
+
duplicated++;
|
|
112
|
+
const copies = [...unsorted].sort();
|
|
113
|
+
// Union of relative file paths across every copy.
|
|
114
|
+
const relFiles = new Set();
|
|
115
|
+
for (const c of copies)
|
|
116
|
+
for (const f of walk(c))
|
|
117
|
+
relFiles.add(relative(c, f));
|
|
118
|
+
let driftFiles = 0;
|
|
119
|
+
let missingFiles = 0;
|
|
120
|
+
for (const rel of relFiles) {
|
|
121
|
+
const hashes = new Set();
|
|
122
|
+
for (const c of copies) {
|
|
123
|
+
const p = join(c, rel);
|
|
124
|
+
if (existsSync(p))
|
|
125
|
+
hashes.add(md5(p));
|
|
126
|
+
else {
|
|
127
|
+
missingFiles++;
|
|
128
|
+
hashes.add('__MISSING__');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (hashes.size > 1)
|
|
132
|
+
driftFiles++;
|
|
133
|
+
}
|
|
134
|
+
if (driftFiles > 0) {
|
|
135
|
+
const entry = {
|
|
136
|
+
name,
|
|
137
|
+
copies: copies.length,
|
|
138
|
+
driftFiles,
|
|
139
|
+
totalFiles: relFiles.size,
|
|
140
|
+
missingFiles,
|
|
141
|
+
locations: copies,
|
|
142
|
+
};
|
|
143
|
+
(allow.has(name) ? allowlisted : drifted).push(entry);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const byDrift = (a, b) => b.driftFiles - a.driftFiles;
|
|
147
|
+
drifted.sort(byDrift);
|
|
148
|
+
allowlisted.sort(byDrift);
|
|
149
|
+
return { duplicated, drifted, allowlisted };
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Heal one skill: treat `from ?? skills-meta/<skill>` as canonical and overwrite every other copy in
|
|
153
|
+
* the monorepo, proving byte-identity. Pure port of `scripts/sync-canonical-skill.mjs`.
|
|
154
|
+
*
|
|
155
|
+
* `check:true` writes NOTHING (`wrote` stays empty) and only reports the drift count.
|
|
156
|
+
* Default overwrites drifting copies; a subsequent {@link sweepSkillDrift} then reports 0 drift.
|
|
157
|
+
* When the canonical dir does not exist, returns `canonicalExists:false` and does nothing (the CLI
|
|
158
|
+
* turns that into a non-zero exit) — this function never throws / never `process.exit`s.
|
|
159
|
+
*/
|
|
160
|
+
export function syncCanonicalSkill(root, skill, opts = {}) {
|
|
161
|
+
const check = opts.check === true;
|
|
162
|
+
const canonical = opts.from ?? join(root, 'packages/@dzhechkov/skills-meta', skill);
|
|
163
|
+
if (!existsSync(canonical)) {
|
|
164
|
+
return { canonical, canonicalExists: false, copies: 0, synced: 0, drifted: 0, wrote: [] };
|
|
165
|
+
}
|
|
166
|
+
const canonFiles = walk(canonical)
|
|
167
|
+
.map((p) => relative(canonical, p))
|
|
168
|
+
.sort();
|
|
169
|
+
// The healer heals EXACTLY what the detector sees (same roots via findSkillDirs) — otherwise a copy
|
|
170
|
+
// could be silently healed but never gated, or vice-versa. Every <skill>/ dir except the canonical.
|
|
171
|
+
const copies = findSkillDirs(root, 'all')
|
|
172
|
+
.filter((d) => basename(d) === skill && relative(canonical, d) !== '')
|
|
173
|
+
.sort();
|
|
174
|
+
let drifted = 0;
|
|
175
|
+
let synced = 0;
|
|
176
|
+
const wrote = [];
|
|
177
|
+
for (const copy of copies) {
|
|
178
|
+
const copyFiles = new Set(walk(copy).map((p) => relative(copy, p)));
|
|
179
|
+
let differs = false;
|
|
180
|
+
// Extra files in the copy not present in canonical ⇒ drift.
|
|
181
|
+
for (const f of copyFiles)
|
|
182
|
+
if (!canonFiles.includes(f))
|
|
183
|
+
differs = true;
|
|
184
|
+
for (const f of canonFiles) {
|
|
185
|
+
const src = join(canonical, f);
|
|
186
|
+
const dst = join(copy, f);
|
|
187
|
+
if (!existsSync(dst) || md5(src) !== md5(dst))
|
|
188
|
+
differs = true;
|
|
189
|
+
}
|
|
190
|
+
if (!differs)
|
|
191
|
+
continue;
|
|
192
|
+
drifted++;
|
|
193
|
+
if (check)
|
|
194
|
+
continue; // report only — write NOTHING
|
|
195
|
+
// Overwrite: remove extra files, then copy every canonical file byte-for-byte.
|
|
196
|
+
for (const f of copyFiles)
|
|
197
|
+
if (!canonFiles.includes(f))
|
|
198
|
+
rmSync(join(copy, f));
|
|
199
|
+
for (const f of canonFiles) {
|
|
200
|
+
const src = join(canonical, f);
|
|
201
|
+
const dst = join(copy, f);
|
|
202
|
+
mkdirSync(dirname(dst), { recursive: true });
|
|
203
|
+
writeFileSync(dst, readFileSync(src));
|
|
204
|
+
}
|
|
205
|
+
synced++;
|
|
206
|
+
wrote.push(copy);
|
|
207
|
+
}
|
|
208
|
+
return { canonical, canonicalExists: true, copies: copies.length, synced, drifted, wrote };
|
|
209
|
+
}
|
|
210
|
+
//# sourceMappingURL=skill-drift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-drift.js","sourceRoot":"","sources":["../src/skill-drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5G,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAmEzC,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAA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|
68
68
|
readonly engine?: VectorEngineKind | undefined;
|
|
69
69
|
readonly error?: string | undefined;
|
|
70
70
|
}
|
|
71
|
+
/** One precomputed vector to upsert by its content-addressed `dzId` (the `dz vector import` row). */
|
|
72
|
+
export interface ImportVectorRow {
|
|
73
|
+
readonly dzId: string;
|
|
74
|
+
readonly vector: Float32Array;
|
|
75
|
+
readonly text: string;
|
|
76
|
+
readonly taskType: string;
|
|
77
|
+
readonly score: number;
|
|
78
|
+
readonly metadata?: Record<string, unknown> | undefined;
|
|
79
|
+
}
|
|
71
80
|
/** The engine PORT — both adapters implement exactly this surface (04 §4.1). */
|
|
72
81
|
export interface VectorEngine {
|
|
73
82
|
readonly kind: VectorEngineKind;
|
|
@@ -87,6 +96,15 @@ export interface VectorEngine {
|
|
|
87
96
|
exportCheckpoint?(dest: string): Promise<{
|
|
88
97
|
error?: string | undefined;
|
|
89
98
|
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Write precomputed `{ dzId, vector }` rows by id (`dz vector import`) — UPSERT-BY-dzId, never a
|
|
101
|
+
* blind whole-store overwrite. Optional (like {@link VectorEngine.exportCheckpoint}): an engine
|
|
102
|
+
* that cannot take a precomputed vector reports an honest reason; import degrades, never throws.
|
|
103
|
+
*/
|
|
104
|
+
importVectors?(rows: readonly ImportVectorRow[]): Promise<{
|
|
105
|
+
imported: number;
|
|
106
|
+
error?: string | undefined;
|
|
107
|
+
}>;
|
|
90
108
|
}
|
|
91
109
|
/** Outcome of {@link resolveVectorEngine}: an engine, or an honest reason why not. */
|
|
92
110
|
export interface ResolvedVectorEngine {
|
|
@@ -125,6 +143,85 @@ export interface VectorTierStatus {
|
|
|
125
143
|
}
|
|
126
144
|
/** Wall-time bound applied to EVERY engine call, read and write legs alike (ADR R1 + NC1). */
|
|
127
145
|
export declare const DEFAULT_VECTOR_TIMEOUT_MS = 10000;
|
|
146
|
+
/** Default cosine cutoff for near-duplicate clustering (`--threshold` / config overrides). */
|
|
147
|
+
export declare const DEFAULT_HARMONIZE_THRESHOLD = 0.92;
|
|
148
|
+
/** One record in the harmonize pool — a lexical-store record mapped to its dzId + reward + ts. */
|
|
149
|
+
export interface HarmonizeItem {
|
|
150
|
+
readonly dzId: string;
|
|
151
|
+
readonly text: string;
|
|
152
|
+
readonly reward: number;
|
|
153
|
+
readonly ts: string;
|
|
154
|
+
readonly taskType: string;
|
|
155
|
+
}
|
|
156
|
+
/** One near-duplicate cluster: the surviving keeper + the members that would be / were dropped. */
|
|
157
|
+
export interface HarmonizeCluster {
|
|
158
|
+
readonly keep: {
|
|
159
|
+
readonly dzId: string;
|
|
160
|
+
readonly text: string;
|
|
161
|
+
readonly reward: number;
|
|
162
|
+
readonly ts: string;
|
|
163
|
+
};
|
|
164
|
+
readonly drops: readonly {
|
|
165
|
+
readonly dzId: string;
|
|
166
|
+
readonly text: string;
|
|
167
|
+
readonly reward: number;
|
|
168
|
+
readonly cos: number;
|
|
169
|
+
}[];
|
|
170
|
+
}
|
|
171
|
+
/** Outcome of {@link harmonizeVectorStore}. */
|
|
172
|
+
export interface HarmonizeReport {
|
|
173
|
+
readonly mode: 'dry-run' | 'apply';
|
|
174
|
+
/** Resolved engine kind, or `'none'` when there is no engine. */
|
|
175
|
+
readonly engine: string;
|
|
176
|
+
/** True when semantic dedup was unavailable and the store was harmonized by EXACT text only. */
|
|
177
|
+
readonly fellBackToExact: boolean;
|
|
178
|
+
readonly threshold: number;
|
|
179
|
+
readonly clusters: readonly HarmonizeCluster[];
|
|
180
|
+
/** Number of clusters (size ≥ 2) — one keeper survives per cluster. */
|
|
181
|
+
readonly kept: number;
|
|
182
|
+
/** Total non-keeper members (previewed in dry-run, removed on `--apply`). */
|
|
183
|
+
readonly dropped: number;
|
|
184
|
+
/** Singleton (non-duplicate) patterns — NEVER touched. */
|
|
185
|
+
readonly unique: number;
|
|
186
|
+
/** Backup path written before an `--apply` drop (restorable via `dz teach --from-json`). */
|
|
187
|
+
readonly backupPath?: string | undefined;
|
|
188
|
+
/** Honest reason on failure (e.g. a backup write failed and the drop was aborted). */
|
|
189
|
+
readonly error?: string | undefined;
|
|
190
|
+
}
|
|
191
|
+
/** Options for {@link harmonizeVectorStore}. */
|
|
192
|
+
export interface HarmonizeOptions extends VectorServiceOptions {
|
|
193
|
+
/** Perform the drop (default `false` — dry-run previews and writes nothing). */
|
|
194
|
+
readonly apply?: boolean | undefined;
|
|
195
|
+
/** Cosine cutoff in `(0, 1]`; overrides config + the {@link DEFAULT_HARMONIZE_THRESHOLD} default. */
|
|
196
|
+
readonly threshold?: number | undefined;
|
|
197
|
+
/**
|
|
198
|
+
* Inject an embedder (tests): a function ⇒ semantic path with these embeddings; `null` ⇒ force the
|
|
199
|
+
* exact-text fallback; `undefined` ⇒ resolve the project's agentdb embedder.
|
|
200
|
+
*/
|
|
201
|
+
readonly embed?: ((text: string) => Promise<Float32Array>) | null | undefined;
|
|
202
|
+
}
|
|
203
|
+
/** Outcome of {@link importRvfCheckpoint}. */
|
|
204
|
+
export interface ImportReport {
|
|
205
|
+
/** Vectors upserted by dzId (new + replaced). */
|
|
206
|
+
readonly imported: number;
|
|
207
|
+
/** Source dzIds skipped because no local pattern exists (text must be imported first). */
|
|
208
|
+
readonly skippedOrphans: number;
|
|
209
|
+
/** Resolved target engine kind, or `'none'`. */
|
|
210
|
+
readonly engine: string;
|
|
211
|
+
/** The source `.rvf` path. */
|
|
212
|
+
readonly source: string;
|
|
213
|
+
readonly error?: string | undefined;
|
|
214
|
+
}
|
|
215
|
+
/** Options for {@link importRvfCheckpoint}. */
|
|
216
|
+
export interface ImportOptions extends VectorServiceOptions {
|
|
217
|
+
/** Inject the source `{ dzId, vector }` rows (tests) — bypasses the `.rvf`/idmap file reads. */
|
|
218
|
+
readonly sourceRows?: readonly {
|
|
219
|
+
readonly dzId: string;
|
|
220
|
+
readonly vector: Float32Array;
|
|
221
|
+
}[] | undefined;
|
|
222
|
+
/** Inject an embedder (tests) for the local-text re-embed; else the project's agentdb embedder. */
|
|
223
|
+
readonly embed?: ((text: string) => Promise<Float32Array>) | undefined;
|
|
224
|
+
}
|
|
128
225
|
/**
|
|
129
226
|
* Bound `promise` to `ms` wall-clock milliseconds. On timeout, resolve with `onTimeout()`
|
|
130
227
|
* instead — the underlying operation keeps running detached (its eventual write is later
|
|
@@ -150,6 +247,11 @@ export declare function dreamVectorEntry(d: DreamPattern): VectorEntry | undefin
|
|
|
150
247
|
export declare function memoryRecordVectorEntry(r: MemoryRecord): VectorEntry | undefined;
|
|
151
248
|
/** Read `memory.vector.engine` from `.dz/config.json`. Absent/corrupt ⇒ `auto` (never throws). */
|
|
152
249
|
export declare function readVectorEngineMode(projectRoot: string): VectorEngineMode;
|
|
250
|
+
/**
|
|
251
|
+
* Read `memory.vector.harmonizeThreshold` from `.dz/config.json`. Absent/corrupt/out-of-range ⇒
|
|
252
|
+
* {@link DEFAULT_HARMONIZE_THRESHOLD} (never throws). `--threshold` overrides this at the call site.
|
|
253
|
+
*/
|
|
254
|
+
export declare function readHarmonizeThreshold(projectRoot: string): number;
|
|
153
255
|
/**
|
|
154
256
|
* Should `dz teach` attempt the best-effort vector mirror at all? True when the project opted
|
|
155
257
|
* into the agentdb memory backend (`memory.backend === 'agentdb'`, the same gate consolidate
|
|
@@ -217,6 +319,43 @@ export declare function recallHybrid(projectRoot: string, query: string, opts?:
|
|
|
217
319
|
}): Promise<HybridRecall>;
|
|
218
320
|
/** Field observability: engine availability + mirrored-vs-lexical counts + queue size. */
|
|
219
321
|
export declare function vectorTierStatus(projectRoot: string, opts?: VectorServiceOptions): Promise<VectorTierStatus>;
|
|
322
|
+
/**
|
|
323
|
+
* Deterministic keeper INDEX within a near-dup cluster (a TOTAL order over fixed inputs — NFR-7):
|
|
324
|
+
* (1) highest reward → (2) longer / more-specific text → (3) newer `ts` → (4) `dzId` (stable
|
|
325
|
+
* final tiebreak). Pure — no I/O. The keeper survives; the other members are the drop set.
|
|
326
|
+
*/
|
|
327
|
+
export declare function selectClusterKeeper(members: readonly HarmonizeItem[]): number;
|
|
328
|
+
/**
|
|
329
|
+
* SEMANTIC dedup of the learned-pattern store (`dz vector harmonize` / `dz teach --harmonize`) —
|
|
330
|
+
* **NON-DESTRUCTIVE by contract**. Finds near-duplicate PAIRS via pairwise cosine over the embedder
|
|
331
|
+
* both adapters share (θ default {@link DEFAULT_HARMONIZE_THRESHOLD}), union-finds them into clusters,
|
|
332
|
+
* and within each cluster KEEPs the highest-signal member ({@link selectClusterKeeper}), dropping the
|
|
333
|
+
* rest. Modes:
|
|
334
|
+
*
|
|
335
|
+
* - **dry-run (default)**: previews the clusters and returns — writes NOTHING (the store is
|
|
336
|
+
* byte-identical after).
|
|
337
|
+
* - **`--apply`**: writes a restorable backup FIRST (`.dz/memory/patterns.pre-harmonize.json`); a
|
|
338
|
+
* failed backup ABORTS the drop (no partial mutation). Then removes the non-keepers from BOTH
|
|
339
|
+
* lexical tiers via {@link removePatternsByIds}. A UNIQUE (singleton) pattern is NEVER a drop.
|
|
340
|
+
*
|
|
341
|
+
* Degrades honestly: with no engine/embedder it falls back to EXACT-text dedup + a `fellBackToExact`
|
|
342
|
+
* note, exits without throwing (dry-run still writes nothing). Reversal: `dz teach --from-json <backup>`.
|
|
343
|
+
*/
|
|
344
|
+
export declare function harmonizeVectorStore(projectRoot: string, opts?: HarmonizeOptions): Promise<HarmonizeReport>;
|
|
345
|
+
/**
|
|
346
|
+
* Ingest an external `.rvf` checkpoint's vectors into THIS project's vector store, **UPSERT-BY-dzId,
|
|
347
|
+
* NON-DESTRUCTIVE** (`dz vector import <file.rvf>`). The `.idmap.json` sidecar is the dzId authority
|
|
348
|
+
* (the shipped `@ruvector/rvf` SDK exposes no vector read-out — see rUv `rvf-backend-blocker.md`), so
|
|
349
|
+
* for each checkpoint dzId that exists in the LOCAL lexical store the vector is reproduced by
|
|
350
|
+
* re-embedding the local text (D7 — under the manifest guard the same model over the same text yields
|
|
351
|
+
* the checkpoint's vector) and upserted by dzId via {@link VectorEngine.importVectors}. dzIds absent
|
|
352
|
+
* locally are ORPHANS — skipped + counted (their text must be imported first via `dz teach --from-json`).
|
|
353
|
+
*
|
|
354
|
+
* Non-destructive: only the imported dzIds are inserted/replaced; re-importing the same file adds 0
|
|
355
|
+
* duplicates and deletes nothing. A model/dim manifest mismatch is REFUSED (no cross-space merge). All
|
|
356
|
+
* failure modes return an honest `{ error }`, never a throw.
|
|
357
|
+
*/
|
|
358
|
+
export declare function importRvfCheckpoint(projectRoot: string, source: string, opts?: ImportOptions): Promise<ImportReport>;
|
|
220
359
|
interface RvfStoreHandle {
|
|
221
360
|
ingest: (id: string, vec: Float32Array) => Promise<unknown> | unknown;
|
|
222
361
|
query: (vec: Float32Array, k: number) => Promise<unknown> | unknown;
|
|
@@ -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,
|
|
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,EASL,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,eAAe,CAAC;AAcvB,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,QA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