@dzhechkov/harness-core 0.3.138 → 0.3.141
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 +69 -17
- package/dist/agentdb-index.d.ts +36 -0
- package/dist/agentdb-index.d.ts.map +1 -1
- package/dist/agentdb-index.js +146 -2
- package/dist/agentdb-index.js.map +1 -1
- package/dist/backlog.d.ts +310 -0
- package/dist/backlog.d.ts.map +1 -0
- package/dist/backlog.js +755 -0
- package/dist/backlog.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/score.d.ts +44 -0
- package/dist/score.d.ts.map +1 -0
- package/dist/score.js +148 -0
- package/dist/score.js.map +1 -0
- package/dist/vector-tier.d.ts +9 -0
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +38 -6
- package/dist/vector-tier.js.map +1 -1
- package/package.json +6 -6
- package/sbom.json +146 -16
- package/src/agentdb-index.ts +145 -2
- package/src/backlog.ts +978 -0
- package/src/index.ts +10 -1
- package/src/score.ts +220 -0
- package/src/vector-tier.ts +47 -4
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `dz backlog` — the Smart Backlog: a personal, goal-directed idea pipeline (feature smart-backlog).
|
|
3
|
+
*
|
|
4
|
+
* Capture an idea → semantic dedup against existing ideas via the EXISTING Brain vector engine
|
|
5
|
+
* (agentdb + the shared embedder — ADR-001; NO second store) → score alignment against a GoalMap
|
|
6
|
+
* (ADR-003) → weighted-roulette pick (ADR-004) → stage an idea2prd enrich hand-off → draft a Jira
|
|
7
|
+
* issue through a configurable, stub-first adapter seam (ADR-006).
|
|
8
|
+
*
|
|
9
|
+
* ARCHITECTURE (05): every load-bearing decision is a PURE function tested on a layer-1 deterministic
|
|
10
|
+
* test; the CLI handler (`cmdBacklog`) is a thin arg-parse + call. Semantic work (embedding, cosine,
|
|
11
|
+
* vector search) is an OUTBOUND PORT to harness-core's Brain engine — this file defines NO embedder,
|
|
12
|
+
* NO cosine, and imports NO MCP client (ADR-001 / ADR-006, both grep-guarded).
|
|
13
|
+
*
|
|
14
|
+
* Ideas carry `task_type:'dz-backlog'` in the shared `.dz/agentdb.db`, so they never surface in
|
|
15
|
+
* `dz recall`'s lesson namespace (ADR-005 T-005b, the discriminating isolation test). Structured
|
|
16
|
+
* records live in a dedicated `.dz/backlog/ideas.jsonl`, never in `.dz/memory/patterns.*`.
|
|
17
|
+
*/
|
|
18
|
+
/** The vector-store namespace that isolates ideas from lessons (ADR-001/005). */
|
|
19
|
+
export declare const BACKLOG_TASK_TYPE = "dz-backlog";
|
|
20
|
+
export type IdeaStatus = 'new' | 'enriched' | 'in-progress' | 'shipped' | 'dropped';
|
|
21
|
+
/** The aggregate root — one captured idea. `id` is content-addressed (no `Date.now()` in identity). */
|
|
22
|
+
export interface IdeaRecord {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly text: string;
|
|
25
|
+
status: IdeaStatus;
|
|
26
|
+
readonly createdTs: string;
|
|
27
|
+
effort: number;
|
|
28
|
+
goalId: string | null;
|
|
29
|
+
goalAlignment: number;
|
|
30
|
+
relatedIds: string[];
|
|
31
|
+
uses: number;
|
|
32
|
+
proposal?: string;
|
|
33
|
+
enrichedPath?: string;
|
|
34
|
+
jiraKey?: string;
|
|
35
|
+
tags: string[];
|
|
36
|
+
}
|
|
37
|
+
/** The compass (ADR-003) — user-owned, edited as a file. */
|
|
38
|
+
export interface Goal {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly statement: string;
|
|
41
|
+
readonly weight: number;
|
|
42
|
+
readonly keywords: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
export interface GoalMap {
|
|
45
|
+
readonly version: number;
|
|
46
|
+
readonly goals: readonly Goal[];
|
|
47
|
+
}
|
|
48
|
+
export type DedupAction = 'duplicate' | 'related' | 'new';
|
|
49
|
+
/** Pure output of the classifier (04) — consumed by capture. */
|
|
50
|
+
export interface DedupVerdict {
|
|
51
|
+
readonly action: DedupAction;
|
|
52
|
+
/** Top-1 raw cosine (ADR-002 — never an RRF score). `-1` when there is nothing to compare against. */
|
|
53
|
+
readonly cosine: number;
|
|
54
|
+
readonly matchedId: string | undefined;
|
|
55
|
+
readonly relatedIds: readonly string[];
|
|
56
|
+
/** True when the embedder was unavailable and dedup degraded to exact-text (ADR-002 §degrade). */
|
|
57
|
+
readonly exactTextOnly: boolean;
|
|
58
|
+
}
|
|
59
|
+
export declare const DEFAULT_DUPLICATE_THRESHOLD = 0.92;
|
|
60
|
+
export declare const DEFAULT_RELATEDNESS_FLOOR = 0.35;
|
|
61
|
+
export declare const DEFAULT_ROULETTE_ALPHA = 1.5;
|
|
62
|
+
export declare const DEFAULT_HALF_LIFE_DAYS = 30;
|
|
63
|
+
export declare const DEFAULT_RECENCY_FLOOR = 0.3;
|
|
64
|
+
export declare const DEFAULT_EFFORT = 3;
|
|
65
|
+
export interface BacklogConfig {
|
|
66
|
+
readonly dedup: {
|
|
67
|
+
readonly duplicateThreshold: number;
|
|
68
|
+
readonly relatednessFloor: number;
|
|
69
|
+
};
|
|
70
|
+
readonly roulette: {
|
|
71
|
+
readonly alpha: number;
|
|
72
|
+
readonly halfLifeDays: number;
|
|
73
|
+
readonly recencyFloor: number;
|
|
74
|
+
readonly defaultEffort: number;
|
|
75
|
+
};
|
|
76
|
+
readonly jira: {
|
|
77
|
+
readonly adapter: BacklogBackend;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export declare function readBacklogConfig(projectRoot: string): BacklogConfig;
|
|
81
|
+
export declare function backlogDir(projectRoot: string): string;
|
|
82
|
+
export declare function ideasPath(projectRoot: string): string;
|
|
83
|
+
export declare function goalsPath(projectRoot: string): string;
|
|
84
|
+
export declare function jiraOutboxDir(projectRoot: string): string;
|
|
85
|
+
/** Content-addressed id — `sha1(text|createdTs).slice(0,16)`; NO `Date.now()` (mirrors patterns.ts). */
|
|
86
|
+
export declare function ideaId(text: string, createdTs: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Strict id whitelist (mirrors `dz score`'s slug guard) — the ONLY shape that may be interpolated into
|
|
89
|
+
* a filesystem path (jira-outbox/<id>.json, enrich slug fallback). Rejects `.`/`..`/`/`/`\` and any
|
|
90
|
+
* traversal, so an idea id like `../../../owned` from a hand-edited store can NEVER escape its dir
|
|
91
|
+
* (HIGH-1). A content-addressed `ideaId()` (16 hex) always passes; anything else is refused, not sanitised
|
|
92
|
+
* into a surprising path.
|
|
93
|
+
*/
|
|
94
|
+
export declare function isSafeId(id: unknown): id is string;
|
|
95
|
+
/** Read the append-only store. A corrupt line is SKIPPED (never fatal) — the whole store never throws. */
|
|
96
|
+
export declare function readIdeas(projectRoot: string): IdeaRecord[];
|
|
97
|
+
/** Atomic full rewrite (tmp + rename) so a crash mid-write never truncates the store. */
|
|
98
|
+
export declare function writeIdeas(projectRoot: string, ideas: readonly IdeaRecord[]): void;
|
|
99
|
+
/** Pre-mutation snapshot (NFR-6) — mirrors `snapshotStore`. A failed snapshot returns `{error}` so
|
|
100
|
+
* the caller ABORTS the mutation (no partial merge). */
|
|
101
|
+
export interface SnapshotResult {
|
|
102
|
+
readonly path: string;
|
|
103
|
+
readonly count: number;
|
|
104
|
+
readonly error?: string;
|
|
105
|
+
}
|
|
106
|
+
export declare function snapshotIdeas(projectRoot: string, dest: string): SnapshotResult;
|
|
107
|
+
/** One existing-idea comparison candidate: its id and the RAW cosine of the new idea against it. */
|
|
108
|
+
export interface DedupCandidate {
|
|
109
|
+
readonly id: string;
|
|
110
|
+
readonly cosine: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* THE LOAD-BEARING CLASSIFIER (ADR-002 T-002a) — PURE. Bands the top-1 raw cosine:
|
|
114
|
+
* DUPLICATE cosine ≥ duplicateThreshold (default 0.92)
|
|
115
|
+
* RELATED relatednessFloor ≤ cosine < dup (default [0.35, 0.92)) ⇒ create + attach relatedIds
|
|
116
|
+
* NEW cosine < relatednessFloor
|
|
117
|
+
* Flip either cut and exactly one boundary fixture crosses a band — the test REDS.
|
|
118
|
+
*/
|
|
119
|
+
export declare function classifyDedup(candidates: readonly DedupCandidate[], cfg: BacklogConfig['dedup'], opts?: {
|
|
120
|
+
exactTextOnly?: boolean;
|
|
121
|
+
}): DedupVerdict;
|
|
122
|
+
/** Injectable deps so the production dedup path is testable without a live agentdb. */
|
|
123
|
+
export interface DedupDeps {
|
|
124
|
+
/** Semantic search over the `dz-backlog` namespace — defaults to the real `searchAgentdbPatterns`. */
|
|
125
|
+
readonly search?: (projectRoot: string, query: string) => Promise<{
|
|
126
|
+
hits: {
|
|
127
|
+
dzId?: string | undefined;
|
|
128
|
+
similarity: number;
|
|
129
|
+
}[];
|
|
130
|
+
error?: string | undefined;
|
|
131
|
+
}>;
|
|
132
|
+
/** Existing structured ideas (for the exact-text degrade path) — defaults to `readIdeas`. */
|
|
133
|
+
readonly ideas?: readonly IdeaRecord[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Production dedup: embed+search the `dz-backlog` vectors (RAW COSINE via `searchAgentdbPatterns`,
|
|
137
|
+
* NEVER the RRF `recallHybrid().score` — ADR-002 T-002c), then band via {@link classifyDedup}. If the
|
|
138
|
+
* embedder/search is unavailable it DEGRADES to exact-text dedup (identical text ⇒ DUPLICATE), never
|
|
139
|
+
* blocking capture (NFR-2 / ADR-002 T-002e).
|
|
140
|
+
*/
|
|
141
|
+
export declare function dedupIdea(projectRoot: string, text: string, cfg: BacklogConfig, deps?: DedupDeps): Promise<DedupVerdict>;
|
|
142
|
+
/** Defensive GoalMap reader — never throws; a missing/corrupt file ⇒ empty compass. */
|
|
143
|
+
export declare function readGoalMap(projectRoot: string): GoalMap;
|
|
144
|
+
/** The text embedded for a goal: statement + keywords (same convention across cache + score). */
|
|
145
|
+
export declare function goalEmbedText(goal: Goal): string;
|
|
146
|
+
export interface AlignmentResult {
|
|
147
|
+
readonly goalId: string | null;
|
|
148
|
+
readonly goalAlignment: number;
|
|
149
|
+
}
|
|
150
|
+
/** One goal with its precomputed embedding + weight — the input to the pure scorer. */
|
|
151
|
+
export interface GoalVector {
|
|
152
|
+
readonly id: string;
|
|
153
|
+
readonly vec: Float32Array;
|
|
154
|
+
readonly weight: number;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* THE LOAD-BEARING ALIGNMENT SCORER (ADR-003 T-003a) — PURE. Alignment =
|
|
158
|
+
* `max over goals of ( cosine(ideaVec, goalVec) * weight )`, clamped to [0,1]. Weighted-MAX (not
|
|
159
|
+
* sum/mean) so a focused idea advancing ONE goal strongly scores high. No goals ⇒ 0 / null.
|
|
160
|
+
*/
|
|
161
|
+
export declare function scoreAlignment(ideaVec: Float32Array, goals: readonly GoalVector[]): AlignmentResult;
|
|
162
|
+
/** Injectable embedder so the production alignment path is testable. */
|
|
163
|
+
export interface AlignDeps {
|
|
164
|
+
readonly embed?: (text: string) => Promise<Float32Array>;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Production alignment: embed the idea + each goal (same reused embedder) and score. No embedder or no
|
|
168
|
+
* GoalMap ⇒ `{goalId:null, goalAlignment:0}` — capture and roulette still work (ADR-003 T-003d).
|
|
169
|
+
*/
|
|
170
|
+
export declare function alignIdea(projectRoot: string, text: string, goalMap: GoalMap, deps?: AlignDeps): Promise<AlignmentResult>;
|
|
171
|
+
export interface GoalEmbedCache {
|
|
172
|
+
readonly model: string;
|
|
173
|
+
readonly dim: number;
|
|
174
|
+
/** id → { hash of the embed text, vector as a plain number[] } */
|
|
175
|
+
readonly goals: Record<string, {
|
|
176
|
+
readonly hash: string;
|
|
177
|
+
readonly vec: number[];
|
|
178
|
+
}>;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* PURE cache validity check (ADR-003 T-003e): a cache is valid for a goal ONLY when the embed
|
|
182
|
+
* model+dim manifest matches AND the goal's embed-text hash is unchanged. A model change (different
|
|
183
|
+
* `model`/`dim`) invalidates EVERY cached goal vector — forcing a recompute, never a stale alignment.
|
|
184
|
+
*/
|
|
185
|
+
export declare function goalCacheHit(cache: GoalEmbedCache | undefined, model: string, dim: number, goal: Goal): Float32Array | undefined;
|
|
186
|
+
export declare function readGoalEmbedCache(projectRoot: string): GoalEmbedCache | undefined;
|
|
187
|
+
export declare function writeGoalEmbedCache(projectRoot: string, cache: GoalEmbedCache): void;
|
|
188
|
+
/** Tiny base added to the compass term so an unaligned idea keeps a non-zero weight (no starvation). */
|
|
189
|
+
export declare const ROULETTE_EPSILON = 0.02;
|
|
190
|
+
/** Ideas eligible for a spin: only `new` and `enriched` (ADR-004). */
|
|
191
|
+
export declare function eligibleIdeas(ideas: readonly IdeaRecord[]): IdeaRecord[];
|
|
192
|
+
/** Bounded recency decay ∈ [floor, 1]: `2^(-ageDays/halfLife)`, floored so old ideas are down-weighted, never zero. */
|
|
193
|
+
export declare function recencyDecay(ageMs: number, halfLifeDays: number, floor: number): number;
|
|
194
|
+
/**
|
|
195
|
+
* THE selection weight (ADR-004): `(alignment^alpha + EPS) · recencyDecay(age) · (1/effort)`. Strictly
|
|
196
|
+
* positive for every idea (EPS>0, floor>0, effort≥1) ⇒ no permanent starvation (T-004c). Equal
|
|
197
|
+
* alignment+age+effort ⇒ equal weights ⇒ a uniform draw (the T-004a control).
|
|
198
|
+
*/
|
|
199
|
+
export declare function ideaWeight(idea: IdeaRecord, cfg: BacklogConfig['roulette'], nowMs: number): number;
|
|
200
|
+
/** Deterministic ranked shortlist (`--pick N`): by weight desc, id asc — no RNG. */
|
|
201
|
+
export declare function rankRoulette(ideas: readonly IdeaRecord[], cfg: BacklogConfig['roulette'], nowMs: number): IdeaRecord[];
|
|
202
|
+
/**
|
|
203
|
+
* A single WEIGHTED-RANDOM spin over normalised weights, using an injected seeded RNG (`rng()∈[0,1)`).
|
|
204
|
+
* Same seed ⇒ identical pick (ADR-004 T-004b determinism). Returns `undefined` when nothing is eligible.
|
|
205
|
+
*/
|
|
206
|
+
export declare function spinRoulette(ideas: readonly IdeaRecord[], cfg: BacklogConfig['roulette'], rng: () => number, nowMs: number): IdeaRecord | undefined;
|
|
207
|
+
/** Build a seeded RNG from a `--seed` integer (reuses the one repo mulberry32). */
|
|
208
|
+
export declare function seededRng(seed: number): () => number;
|
|
209
|
+
/** kebab-case, Latin-only, ≤40 chars (feature-adr slug convention). */
|
|
210
|
+
export declare function ideaSlug(idea: IdeaRecord): string;
|
|
211
|
+
export interface EnrichmentStaging {
|
|
212
|
+
readonly slug: string;
|
|
213
|
+
readonly scaffoldPath: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Stage the idea2prd INPUT and hand off to the `idea2prd-manual` skill (an AGENT phase — 02 §R-G).
|
|
217
|
+
* The CLI writes the scaffold ONLY; it never fabricates a PRD (idea2prd is a skill, not a synchronous
|
|
218
|
+
* transform). Returns the hand-off target so the agent can pick it up.
|
|
219
|
+
*/
|
|
220
|
+
export declare function stageEnrichment(projectRoot: string, idea: IdeaRecord, related: readonly IdeaRecord[], goalMap: GoalMap): EnrichmentStaging;
|
|
221
|
+
export declare const BACKLOG_BACKENDS: readonly ["jira-mcp", "copilot-mcp", "none"];
|
|
222
|
+
export type BacklogBackend = (typeof BACKLOG_BACKENDS)[number];
|
|
223
|
+
export declare function isBacklogBackend(v: unknown): v is BacklogBackend;
|
|
224
|
+
/** Built by the domain from an IdeaRecord (+ enrichedPath if any). */
|
|
225
|
+
export interface JiraIssueDraft {
|
|
226
|
+
readonly summary: string;
|
|
227
|
+
readonly description: string;
|
|
228
|
+
readonly labels: readonly string[];
|
|
229
|
+
readonly sourceIdeaId: string;
|
|
230
|
+
}
|
|
231
|
+
export interface IssueRef {
|
|
232
|
+
readonly backend: BacklogBackend;
|
|
233
|
+
readonly key: string | null;
|
|
234
|
+
readonly url?: string;
|
|
235
|
+
readonly stub: boolean;
|
|
236
|
+
readonly outboxPath: string;
|
|
237
|
+
}
|
|
238
|
+
export type VerifyForm = 'full' | 'manual';
|
|
239
|
+
export interface JiraVerifyResult {
|
|
240
|
+
readonly form: VerifyForm;
|
|
241
|
+
readonly ready: boolean;
|
|
242
|
+
/** The exact wiring step the user must run — non-empty for a `manual` backend (T-006e). */
|
|
243
|
+
readonly instruction: string;
|
|
244
|
+
}
|
|
245
|
+
/** The I/O the adapters need — injected so `createIssue` is testable without touching disk. */
|
|
246
|
+
export interface BacklogIO {
|
|
247
|
+
/** Persist an outbox payload for `<ideaId>`; returns the path written. */
|
|
248
|
+
writeOutbox(ideaId: string, payload: unknown): string;
|
|
249
|
+
}
|
|
250
|
+
/** THE SEAM (ADR-006): a port with pure methods; NO MCP client is imported here or by its impls. */
|
|
251
|
+
export interface JiraPort {
|
|
252
|
+
readonly backend: BacklogBackend;
|
|
253
|
+
createIssue(draft: JiraIssueDraft, io: BacklogIO): Promise<IssueRef>;
|
|
254
|
+
verify(): Promise<JiraVerifyResult>;
|
|
255
|
+
}
|
|
256
|
+
/** Pure draft builder from an idea. */
|
|
257
|
+
export declare function buildJiraDraft(idea: IdeaRecord, goalMap: GoalMap): JiraIssueDraft;
|
|
258
|
+
/** The registry — coverage-tested (ADR-006 T-006a): keys ≡ BACKLOG_BACKENDS as a set. */
|
|
259
|
+
export declare const JIRA_ADAPTERS: Record<BacklogBackend, JiraPort>;
|
|
260
|
+
/** Factory: pick the configured adapter; an unknown value fell back to `none` in readBacklogConfig. */
|
|
261
|
+
export declare function resolveJiraAdapter(cfg: BacklogConfig): JiraPort;
|
|
262
|
+
/** Production BacklogIO — writes `.dz/backlog/jira-outbox/<id>.json`. */
|
|
263
|
+
export declare function makeBacklogIO(projectRoot: string): BacklogIO;
|
|
264
|
+
export interface BacklogHarmonizeReport {
|
|
265
|
+
readonly mode: 'dry-run' | 'apply';
|
|
266
|
+
/** True when no embedder was available and clustering fell back to EXACT text. */
|
|
267
|
+
readonly fellBackToExact: boolean;
|
|
268
|
+
readonly threshold: number;
|
|
269
|
+
/** One cluster per group of size ≥ 2: the surviving keeper id + the merged-away ids. */
|
|
270
|
+
readonly clusters: readonly {
|
|
271
|
+
readonly keep: string;
|
|
272
|
+
readonly drops: readonly string[];
|
|
273
|
+
}[];
|
|
274
|
+
readonly kept: number;
|
|
275
|
+
readonly dropped: number;
|
|
276
|
+
readonly unique: number;
|
|
277
|
+
readonly snapshotPath?: string;
|
|
278
|
+
readonly error?: string;
|
|
279
|
+
/**
|
|
280
|
+
* MED-E: set when the structured ideas were removed but their agentdb `dz-backlog` vectors could NOT be
|
|
281
|
+
* pruned (locked/unavailable store). Backlog dedup stays correct (the membership guard drops orphans),
|
|
282
|
+
* but the store is left with dangling vectors — a non-clean outcome the caller MUST surface, never a
|
|
283
|
+
* silent success. `dz backlog harmonize` prints this as a warning; the idea removal still stands.
|
|
284
|
+
*/
|
|
285
|
+
readonly pruneError?: string;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Batch-dedup the backlog: cluster near-duplicate ideas (cosine ≥ threshold when an embedder is
|
|
289
|
+
* available, EXACT text otherwise), keep one deterministic keeper per cluster, merge the others'
|
|
290
|
+
* `uses` into it. DRY-RUN by default (writes nothing); `--apply` SNAPSHOTS FIRST then mutates and
|
|
291
|
+
* ABORTS the mutation if the snapshot fails (NFR-6). Injectable `embed` for tests.
|
|
292
|
+
*/
|
|
293
|
+
export declare function harmonizeBacklog(projectRoot: string, opts?: {
|
|
294
|
+
apply?: boolean;
|
|
295
|
+
threshold?: number;
|
|
296
|
+
embed?: ((t: string) => Promise<Float32Array>) | null;
|
|
297
|
+
}): Promise<BacklogHarmonizeReport>;
|
|
298
|
+
/**
|
|
299
|
+
* Mirror one idea's vector into the SHARED `.dz/agentdb.db` under `task_type:'dz-backlog'`, written
|
|
300
|
+
* DIRECTLY through `importVectorsToAgentdb` (upsert-by-dzId) — NOT the configurable vector engine.
|
|
301
|
+
* This is the load-bearing single-store guarantee (ADR-001/005): dedup ALWAYS searches agentdb, so
|
|
302
|
+
* the write must ALWAYS land in agentdb, no matter what `memory.vector.engine` says. Upsert-by-dzId
|
|
303
|
+
* makes a re-mirror idempotent (0 duplicate rows). `guardEmbedSpace` inside `importVectorsToAgentdb`
|
|
304
|
+
* covers the write (ADR-001 T-001c). Best-effort: NEVER blocks capture (I-1) — honest `{error}`.
|
|
305
|
+
*/
|
|
306
|
+
export declare function mirrorIdeaVector(projectRoot: string, idea: IdeaRecord): Promise<{
|
|
307
|
+
mirrored: number;
|
|
308
|
+
error?: string | undefined;
|
|
309
|
+
}>;
|
|
310
|
+
//# sourceMappingURL=backlog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backlog.d.ts","sourceRoot":"","sources":["../src/backlog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAgBH,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAM9C,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,SAAS,CAAC;AAEpF,uGAAuG;AACvG,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,4DAA4D;AAC5D,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,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