@adhd/backlog 1.0.0 → 1.0.1
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/CHANGELOG.md +48 -0
- package/README.md +69 -32
- package/api.d.ts +50 -0
- package/api.ir.json +1 -0
- package/extract-live.d.ts +56 -0
- package/index.d.ts +2 -2
- package/index.js +67 -367
- package/index.mjs +8982 -30837
- package/ir-artifact.d.ts +86 -0
- package/package.json +20 -19
- package/skill/SKILL.md +13 -0
- package/write/bootstrap.d.ts +44 -6
- package/write/catalog.d.ts +18 -0
- package/write/citation-path.d.ts +133 -0
- package/write/create-issue.d.ts +6 -3
- package/write/embedding-config.d.ts +81 -0
- package/write/errors.d.ts +66 -4
- package/write/transition.d.ts +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
+
## 1.0.1 (2026-09-26)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- **backlog:** skill §9 — hard rule to file a feature request when the tool is friction ([cf42c407](https://github.com/PseudoSky/adhd/commit/cf42c407))
|
|
6
|
+
- **backlog:** live embedding config + embedding-status verb ([#23](https://github.com/PseudoSky/adhd/pull/23))
|
|
7
|
+
- **backlog:** mount the three stats/rollup reads as apigen ops ([1859a5ae](https://github.com/PseudoSky/adhd/commit/1859a5ae))
|
|
8
|
+
- **backlog:** deliver the embedding funnel on the successor line ([b985215a](https://github.com/PseudoSky/adhd/commit/b985215a))
|
|
9
|
+
- **vite-plugins:** absorb perf/test-resolve-fix — test-time @adhd/\* source resolution ([3e344506](https://github.com/PseudoSky/adhd/commit/3e344506))
|
|
10
|
+
|
|
11
|
+
### 🩹 Fixes
|
|
12
|
+
|
|
13
|
+
- ⚠️ **apigen:** regenerate the ADR-0004 golden snapshot, add the MAJOR release note, clear the format gate ([1fea3c2f](https://github.com/PseudoSky/adhd/commit/1fea3c2f))
|
|
14
|
+
- **backlog:** mirror the optional store's additive probe type locally, decoupling the build from a lagging install ([c15c4cdf](https://github.com/PseudoSky/adhd/commit/c15c4cdf))
|
|
15
|
+
- **apigen:** ADR-0004 — MCP tool output is the flat content payload ([7896594d](https://github.com/PseudoSky/adhd/commit/7896594d))
|
|
16
|
+
- **backlog:** directory citation is E_VALIDATION, not a retryable E_IO; log raw E_IO cause (56a2133e) ([f538387c](https://github.com/PseudoSky/adhd/commit/f538387c))
|
|
17
|
+
- **backlog:** close the baked-IR freshness gate's transitive-import hole ([182ae496](https://github.com/PseudoSky/adhd/commit/182ae496))
|
|
18
|
+
- **backlog:** exclude the backlog store from the citation default root ([715f3f97](https://github.com/PseudoSky/adhd/commit/715f3f97))
|
|
19
|
+
- **backlog:** narrow citation default external root + single-source missing-path taxonomy ([b86e98d5](https://github.com/PseudoSky/adhd/commit/b86e98d5))
|
|
20
|
+
- **backlog:** allow citations under configured external roots (c6d35272) ([69e475ae](https://github.com/PseudoSky/adhd/commit/69e475ae))
|
|
21
|
+
- **nx:** reconcile main's e2e lane with the flat ESLint config + fix missing-deps ([cf72a2ab](https://github.com/PseudoSky/adhd/commit/cf72a2ab))
|
|
22
|
+
- **backlog:** format PR #23 files; ignore pnpm-lock.yaml in prettier ([#24](https://github.com/PseudoSky/adhd/pull/24), [#23](https://github.com/PseudoSky/adhd/issues/23))
|
|
23
|
+
- **nx-build:** run-scoped release manifest token + apigen-cli readiness flake + codegen test output ([#15](https://github.com/PseudoSky/adhd/pull/15))
|
|
24
|
+
- **backlog:** self-watchdog + detached group reap so a killed test can't strand funnel consumers ([f3755c3d](https://github.com/PseudoSky/adhd/commit/f3755c3d))
|
|
25
|
+
- **backlog:** drop the forbidden 'store-engine' term from the CPU-THRASH-SKIP comment ([4dae6ee2](https://github.com/PseudoSky/adhd/commit/4dae6ee2))
|
|
26
|
+
- **vite:** restore import.meta.url in CJS output under vite 8 ([7916e639](https://github.com/PseudoSky/adhd/commit/7916e639))
|
|
27
|
+
- **nx:** finish the ESLint v9 flat-config upgrade and unblock the gate ([53f4ff3e](https://github.com/PseudoSky/adhd/commit/53f4ff3e))
|
|
28
|
+
|
|
29
|
+
### 🔥 Performance
|
|
30
|
+
|
|
31
|
+
- **backlog:** bake the IR artifact at build; startup never loads ts-morph ([da81f673](https://github.com/PseudoSky/adhd/commit/da81f673))
|
|
32
|
+
|
|
33
|
+
### ⚠️ Breaking Changes
|
|
34
|
+
|
|
35
|
+
- **apigen:** regenerate the ADR-0004 golden snapshot, add the MAJOR release note, clear the format gate ([1fea3c2f](https://github.com/PseudoSky/adhd/commit/1fea3c2f))
|
|
36
|
+
McpOutputAdapter.wrapped (exported from
|
|
37
|
+
@adhd/apigen-engine-runtime and @adhd/apigen-plugin-mcp) kept its name but
|
|
38
|
+
inverted its meaning (true now means "the return is already a top-level object,
|
|
39
|
+
emit the value as flat structuredContent", not "wrapped under result"), and an
|
|
40
|
+
MCP tool return that is not a top-level object no longer emits an outputSchema
|
|
41
|
+
or structuredContent. This is semver-MAJOR for those two packages; republish
|
|
42
|
+
them first per ADR-0004 D6.
|
|
43
|
+
|
|
44
|
+
### ❤️ Thank You
|
|
45
|
+
|
|
46
|
+
- pseudosky
|
|
47
|
+
- Sky
|
|
48
|
+
|
|
1
49
|
## 1.0.0 (Unreleased)
|
|
2
50
|
|
|
3
51
|
The first stable release. `@adhd/backlog` is a self-contained backlog system: one store, mounted live to a CLI, an MCP server, and an HTTP surface with zero duplicated logic across hosts. Every operation returns an outcome envelope — `{ok:true, data}` or `{ok:false, error:{code,message,details}}` — so a caller never has to guess whether a call succeeded from a thrown exception.
|
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ adhd-backlog upsert-project --input '{
|
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
|
-
{"ok":true,"data":{"uid":"49ec673b-…","created":true,"project":{"uid":"49ec673b-…","name":"demo-project","path":"/tmp/demo"}}}
|
|
46
|
+
{ "ok": true, "data": { "uid": "49ec673b-…", "created": true, "project": { "uid": "49ec673b-…", "name": "demo-project", "path": "/tmp/demo" } } }
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
File an issue against it:
|
|
@@ -60,7 +60,7 @@ adhd-backlog create --input '{
|
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
```json
|
|
63
|
-
{"ok":true,"data":{"created":true,"uid":"b3b2da0e-…","item":{"uid":"b3b2da0e-…","title":"Query pagination drops the last page under offset paging","kind":"issue","status":"open","priority":"HIGH","project":"49ec673b-…","component":"65c4e373-…","createdAt":"2026-09-24T00:14:38.802Z","author":"agent:worker-1","gitContext":"feat/backlog-hard-replacement @ 4bf902fc"}}}
|
|
63
|
+
{ "ok": true, "data": { "created": true, "uid": "b3b2da0e-…", "item": { "uid": "b3b2da0e-…", "title": "Query pagination drops the last page under offset paging", "kind": "issue", "status": "open", "priority": "HIGH", "project": "49ec673b-…", "component": "65c4e373-…", "createdAt": "2026-09-24T00:14:38.802Z", "author": "agent:worker-1", "gitContext": "feat/backlog-hard-replacement @ 4bf902fc" } } }
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
> `project` and `component` in the result are `uid`s, not names. `gitContext`
|
|
@@ -73,7 +73,7 @@ adhd-backlog query --input '{"filter":{"project":"demo-project","status":"open"}
|
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
```json
|
|
76
|
-
{"ok":true,"data":{"view":"list","items":[{"uid":"b3b2da0e-…","title":"Query pagination drops the last page under offset paging","kind":"issue","status":"open","priority":"HIGH"}],"hasMore":false},"meta":{"total":1,"returned":1,"limit":50}}
|
|
76
|
+
{ "ok": true, "data": { "view": "list", "items": [{ "uid": "b3b2da0e-…", "title": "Query pagination drops the last page under offset paging", "kind": "issue", "status": "open", "priority": "HIGH" }], "hasMore": false }, "meta": { "total": 1, "returned": 1, "limit": 50 } }
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
Move it forward — a `transition` records the status change in the issue's audit
|
|
@@ -92,13 +92,13 @@ adhd-backlog transition --input '{
|
|
|
92
92
|
```
|
|
93
93
|
|
|
94
94
|
```json
|
|
95
|
-
{"ok":true,"data":{"uid":"b3b2da0e-…","fromStatus":"open","toStatus":"in-progress","transitionUid":"9bcb9844-…"}}
|
|
95
|
+
{ "ok": true, "data": { "uid": "b3b2da0e-…", "fromStatus": "open", "toStatus": "in-progress", "transitionUid": "9bcb9844-…" } }
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
A failed call returns the same envelope with `ok:false` instead of throwing:
|
|
99
99
|
|
|
100
100
|
```json
|
|
101
|
-
{"ok":false,"error":{"code":"item_not_found","message":"No live issue found for uid \"does-not-exist\"","details":{"retryable":false}}}
|
|
101
|
+
{ "ok": false, "error": { "code": "item_not_found", "message": "No live issue found for uid \"does-not-exist\"", "details": { "retryable": false } } }
|
|
102
102
|
```
|
|
103
103
|
|
|
104
104
|
Every output above was captured from the built binary
|
|
@@ -126,7 +126,7 @@ adhd-backlog claim --input '{"uid":"b3b2da0e-…","by":"agent:worker-1","action"
|
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
```json
|
|
129
|
-
{"ok":true,"data":{"uid":"b3b2da0e-…","status":"claimed","claimedBy":"agent:worker-1","claimedAt":"2026-09-24T00:14:39.978Z"}}
|
|
129
|
+
{ "ok": true, "data": { "uid": "b3b2da0e-…", "status": "claimed", "claimedBy": "agent:worker-1", "claimedAt": "2026-09-24T00:14:39.978Z" } }
|
|
130
130
|
```
|
|
131
131
|
|
|
132
132
|
### 3. Structured, verifiable citations
|
|
@@ -149,7 +149,7 @@ adhd-backlog get --input '{"registry":"project","name":"demo-project"}'
|
|
|
149
149
|
```
|
|
150
150
|
|
|
151
151
|
```json
|
|
152
|
-
{"ok":true,"data":{"uid":"49ec673b-…","name":"demo-project","path":"/tmp/demo","components":[{"name":"(root)"}],"locations":[]}}
|
|
152
|
+
{ "ok": true, "data": { "uid": "49ec673b-…", "name": "demo-project", "path": "/tmp/demo", "components": [{ "name": "(root)" }], "locations": [] } }
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
### 5. Optional semantic search, optional Markdown rendering
|
|
@@ -184,13 +184,14 @@ forward to it. The old `uid` remains queryable history: addressing it returns
|
|
|
184
184
|
resolve to the wrong record.
|
|
185
185
|
|
|
186
186
|
```json
|
|
187
|
-
{"ok":false,"error":{"code":"conflict","message":"Issue \"63c2f57e-…\" was superseded by a body edit and is no longer the live issue; it now lives under \"e3b32183-…\"","details":{"retryable":false}}}
|
|
187
|
+
{ "ok": false, "error": { "code": "conflict", "message": "Issue \"63c2f57e-…\" was superseded by a body edit and is no longer the live issue; it now lives under \"e3b32183-…\"", "details": { "retryable": false } } }
|
|
188
188
|
```
|
|
189
189
|
|
|
190
190
|
## Command surface
|
|
191
191
|
|
|
192
|
-
Every verb takes a single `--input` flag carrying one JSON
|
|
193
|
-
per-field flags.
|
|
192
|
+
Every verb but `embedding-status` takes a single `--input` flag carrying one JSON
|
|
193
|
+
object; there are no per-field flags. Nineteen operations (the 18 verbs plus
|
|
194
|
+
`batch`):
|
|
194
195
|
|
|
195
196
|
| Verb | CLI | MCP tool |
|
|
196
197
|
| ----------------- | ------------------------------- | -------------------------- |
|
|
@@ -199,6 +200,7 @@ per-field flags. Eighteen operations (the 17 verbs plus `batch`):
|
|
|
199
200
|
| `priorityMatrix` | `adhd-backlog priority-matrix` | `backlog_priority_matrix` |
|
|
200
201
|
| `partOfRollup` | `adhd-backlog part-of-rollup` | `backlog_part_of_rollup` |
|
|
201
202
|
| `openCurve` | `adhd-backlog open-curve` | `backlog_open_curve` |
|
|
203
|
+
| `embeddingStatus` | `adhd-backlog embedding-status` | `backlog_embedding_status` |
|
|
202
204
|
| `lookup` | `adhd-backlog lookup` | `backlog_lookup` |
|
|
203
205
|
| `create` | `adhd-backlog create` | `backlog_create` |
|
|
204
206
|
| `update` | `adhd-backlog update` | `backlog_update` |
|
|
@@ -215,7 +217,7 @@ per-field flags. Eighteen operations (the 17 verbs plus `batch`):
|
|
|
215
217
|
|
|
216
218
|
`--help` prints these as `backlog <verb>`; the CLI also accepts the bare
|
|
217
219
|
`adhd-backlog <verb>` form shown above, and accepts the explicit namespace
|
|
218
|
-
prefix at any position. `get`/`query`/`lookup` are reads.
|
|
220
|
+
prefix at any position. `get`/`query`/`lookup`/`embedding-status` are reads.
|
|
219
221
|
`create`/`update`/`transition`/`claim`/`relate`/`move`/`delete` mutate one
|
|
220
222
|
issue. The four `upsert*`/`rmLocation` verbs manage the **registry** —
|
|
221
223
|
projects, components, and locations. `batch action` fans any one of them out
|
|
@@ -248,17 +250,17 @@ looks complete.
|
|
|
248
250
|
|
|
249
251
|
### Error codes
|
|
250
252
|
|
|
251
|
-
| Code | Meaning
|
|
252
|
-
| --------------------- |
|
|
253
|
-
| `not_found` | A referenced catalog entry (project/component/kind/status/priority) doesn't exist
|
|
254
|
-
| `item_not_found` | The addressed issue doesn't exist
|
|
255
|
-
| `invalid_argument` | Malformed flag or parameter shape
|
|
256
|
-
| `validation` | Schema rejection — unknown filter key, unknown projection field, over-limit
|
|
257
|
-
| `store_busy` | Store contention (a lease or a write conflict); `details.retryable` and `details.retryAfterMs` indicate whether/how to retry
|
|
258
|
-
| `rag_not_configured` | A semantic/similarity read was requested but no embedding backend is configured, or the vector space is empty
|
|
259
|
-
| `conflict` | Someone else holds the claim, a single-valued relation is already taken, or a supersede raced
|
|
253
|
+
| Code | Meaning | CLI exit code |
|
|
254
|
+
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
|
255
|
+
| `not_found` | A referenced catalog entry (project/component/kind/status/priority) doesn't exist | 4 |
|
|
256
|
+
| `item_not_found` | The addressed issue doesn't exist | 1 |
|
|
257
|
+
| `invalid_argument` | Malformed flag or parameter shape | 2 |
|
|
258
|
+
| `validation` | Schema rejection — unknown filter key, unknown projection field, over-limit | 2 |
|
|
259
|
+
| `store_busy` | Store contention (a lease or a write conflict); `details.retryable` and `details.retryAfterMs` indicate whether/how to retry | 1 |
|
|
260
|
+
| `rag_not_configured` | A semantic/similarity read was requested but no embedding backend is configured, or the vector space is empty | 1 |
|
|
261
|
+
| `conflict` | Someone else holds the claim, a single-valued relation is already taken, or a supersede raced | 1 |
|
|
260
262
|
| `precondition_failed` | A gate refused the write — a terminal transition missing its required citation/note, or a citation that couldn't be verified against a known project path | 1 |
|
|
261
|
-
| `internal` | Unclassified server-side failure
|
|
263
|
+
| `internal` | Unclassified server-side failure | 1 |
|
|
262
264
|
|
|
263
265
|
Success always exits 0. `item_not_found` and `internal` are deliberately
|
|
264
266
|
distinct codes even though they share exit code 1 — a caller distinguishes
|
|
@@ -269,7 +271,9 @@ code alone.
|
|
|
269
271
|
|
|
270
272
|
A citation is `{ file, lines?, context?, symbol? }`. Pass `citations` on
|
|
271
273
|
`create`, or on the `transition` that moves an issue into a terminal status
|
|
272
|
-
when the project's policy requires it.
|
|
274
|
+
when the project's policy requires it. `file` must name a file, not a
|
|
275
|
+
directory: a directory target is rejected as a non-retryable `validation`
|
|
276
|
+
error.
|
|
273
277
|
|
|
274
278
|
The item-level **`gitContext`** is separate from a citation's own `context`:
|
|
275
279
|
it records the repo disclosure contract's `<active git context>` — the first
|
|
@@ -290,6 +294,39 @@ and is rejected with `invalid_argument`, and the stats/rollup ops
|
|
|
290
294
|
priority-matrix` lines against this page if a documented field or verb is
|
|
291
295
|
refused.
|
|
292
296
|
|
|
297
|
+
## Build & startup
|
|
298
|
+
|
|
299
|
+
`nx build backlog` emits TWO things into `dist/`: the compiled
|
|
300
|
+
`index.js` + `api.d.ts`, and `api.ir.json` — the extracted operation
|
|
301
|
+
descriptors for `api.d.ts`, produced by the build's own hidden `ir-artifact`
|
|
302
|
+
subcommand:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
node dist/index.js ir-artifact --out dist/api.ir.json
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
Startup (the CLI, an MCP `initialize`, `--help`) reads `api.ir.json` and
|
|
309
|
+
derives the mounted surface from it **without loading the type extractor**, so
|
|
310
|
+
a cold start is fast without any warm cache — the fix for a startup path that
|
|
311
|
+
previously paid a multi-second synchronous extraction on every invocation.
|
|
312
|
+
|
|
313
|
+
`api.ir.json` is trusted only while it still matches the built declarations
|
|
314
|
+
beside it: the artifact records content hashes of the WHOLE `dist/**.d.ts`
|
|
315
|
+
surface it was extracted from (not just `api.d.ts` — extraction resolves types
|
|
316
|
+
through `api.d.ts`'s sibling imports), and startup re-hashes that surface
|
|
317
|
+
before using it. A missing, corrupt, or stale artifact (any `.d.ts` changed
|
|
318
|
+
since the bake) is refused, and startup falls back to a live extraction through
|
|
319
|
+
the extract-stage IR cache, which persists the result for the next run.
|
|
320
|
+
|
|
321
|
+
`ir-artifact` is a build step, not a user command — it is absent from `--help`
|
|
322
|
+
and store-free (it never opens the graph store and never writes under
|
|
323
|
+
`~/.adhd`).
|
|
324
|
+
|
|
325
|
+
| Setting | Env var | Default | Notes |
|
|
326
|
+
| ---------------- | -------------------------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
|
|
327
|
+
| IR cache enabled | `APIGEN_IR_CACHE_ENABLED` | `1` | Governs ONLY the **runtime fallback** cache. It does **not** bypass the baked `api.ir.json` artifact — that artifact is the startup path, not a cache |
|
|
328
|
+
| IR cache file | `APIGEN_IR_CACHE_FILE` | a machine-global path under `~/.adhd` | Where a fallback extraction's result is cached |
|
|
329
|
+
|
|
293
330
|
## Library API
|
|
294
331
|
|
|
295
332
|
Beyond the CLI/MCP/HTTP surface, the package exports its query layer
|
|
@@ -318,16 +355,16 @@ spanning every project on the machine, not one per repository — so an agent
|
|
|
318
355
|
working across repos sees the same graph everywhere unless it explicitly opts
|
|
319
356
|
into a narrower scope.
|
|
320
357
|
|
|
321
|
-
| Setting | Env var | Default
|
|
322
|
-
| ------------------ | ----------------------------------------------------- |
|
|
323
|
-
| Database path | `ADHD_BACKLOG_DATABASE_PATH` | resolved under the scope root | Where the graph store's data file lives
|
|
324
|
-
| Write busy timeout | `ADHD_BACKLOG_DATABASE_BUSY_TIMEOUT_MS` | `5000`
|
|
325
|
-
| Log level | `ADHD_BACKLOG_LOG_LEVEL` | `info`
|
|
326
|
-
| Scope | `ADHD_BACKLOG_SCOPE` (falls back to `ADHD_ENV_SCOPE`) | `global`
|
|
327
|
-
| Namespace | `--namespace <value>` CLI flag (no env var) | `production`
|
|
328
|
-
| Semantic search | `ADHD_BACKLOG_EMBEDDING_ENABLED` | `false`
|
|
329
|
-
| Embedding provider | `ADHD_BACKLOG_EMBEDDING_PROVIDER` | `fastembed`
|
|
330
|
-
| Embedding model | `ADHD_BACKLOG_EMBEDDING_MODEL` | `bge-base-en-v1.5` (768-dim)
|
|
358
|
+
| Setting | Env var | Default | Notes |
|
|
359
|
+
| ------------------ | ----------------------------------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
360
|
+
| Database path | `ADHD_BACKLOG_DATABASE_PATH` | resolved under the scope root | Where the graph store's data file lives |
|
|
361
|
+
| Write busy timeout | `ADHD_BACKLOG_DATABASE_BUSY_TIMEOUT_MS` | `5000` | How long a write waits on a contended lock before giving up |
|
|
362
|
+
| Log level | `ADHD_BACKLOG_LOG_LEVEL` | `info` | `trace`\|`debug`\|`info`\|`warn`\|`error`\|`fatal`\|`silent` |
|
|
363
|
+
| Scope | `ADHD_BACKLOG_SCOPE` (falls back to `ADHD_ENV_SCOPE`) | `global` | Which store root to resolve against |
|
|
364
|
+
| Namespace | `--namespace <value>` CLI flag (no env var) | `production` | Which path segment under the scope root to resolve against (`<root>/backlog/<namespace>/…`) — one of `production`\|`test`\|`sandbox`. `--namespace sandbox` ALSO mints a fresh throwaway root and writes a real `config.yaml` there with `embedding.enabled: false`, so a sandboxed invocation is isolated along two independent axes plus a deliberate config, never an accident of an empty directory |
|
|
365
|
+
| Semantic search | `ADHD_BACKLOG_EMBEDDING_ENABLED` | `false` | See below |
|
|
366
|
+
| Embedding provider | `ADHD_BACKLOG_EMBEDDING_PROVIDER` | `fastembed` | Only consulted when embedding is enabled |
|
|
367
|
+
| Embedding model | `ADHD_BACKLOG_EMBEDDING_MODEL` | `bge-base-en-v1.5` (768-dim) | Only consulted when embedding is enabled |
|
|
331
368
|
|
|
332
369
|
**Embedding (semantic search) is entirely optional.** With it left at its
|
|
333
370
|
default (`false`), `@adhd/backlog` works fully — every verb, keyword filtering
|
package/api.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { IUpdateIssueInput, IUpdateIssueOutcome } from './write/update.js';
|
|
|
8
8
|
import { ICreateIssueInput, ICreateIssueResult } from './write/create-issue.js';
|
|
9
9
|
import { IIssueGetInput, IIssueGetResult, IIssueQueryInput, IIssueQueryResult, ILookupResult } from './query/types.js';
|
|
10
10
|
import { IPriorityMatrixInput, IPriorityMatrixResult, IPartOfRollupInput, IPartOfRollupResult, IOpenCurveInput, IOpenCurveResult } from './query/views/stats.js';
|
|
11
|
+
import { EmbeddingLiveConfig } from './write/embedding-config.js';
|
|
11
12
|
import { IOutcomeEnvelope } from './envelope.js';
|
|
12
13
|
import { GraphBacklogStore } from './store/graph-backlog-store.js';
|
|
13
14
|
import { BacklogConfig } from './env.js';
|
|
@@ -17,6 +18,18 @@ import { Environment } from '@adhd/environment';
|
|
|
17
18
|
export interface BacklogCtx {
|
|
18
19
|
store: GraphBacklogStore;
|
|
19
20
|
env: Environment<BacklogConfig>;
|
|
21
|
+
/**
|
|
22
|
+
* Per-process liveness holder for the `embedding.*` config family
|
|
23
|
+
* (`write/embedding-config.ts`). Optional and additive: every existing
|
|
24
|
+
* caller/test that builds a ctx by hand keeps the pre-existing resolve-once
|
|
25
|
+
* behaviour exactly (`ctx.env.config.embedding` is the effective value).
|
|
26
|
+
*
|
|
27
|
+
* `startBacklogServer` attaches one; `ensureSemanticReady` refreshes it
|
|
28
|
+
* before each semantic verb so an on-disk `config.yaml` edit is adopted
|
|
29
|
+
* without a restart. `db.*`/`logging.level` are deliberately NOT covered —
|
|
30
|
+
* they stay restart-required (see the holder's own doc comment).
|
|
31
|
+
*/
|
|
32
|
+
embeddingConfig?: EmbeddingLiveConfig;
|
|
20
33
|
/**
|
|
21
34
|
* Test-isolation escape hatch ONLY — mirrors `BuildBacklogEnvOptions.adhdRoot`
|
|
22
35
|
* (the same value passed to `buildBacklogEnv({ adhdRoot })` when constructing
|
|
@@ -80,6 +93,43 @@ export declare function partOfRollup(ctx: BacklogCtx, input: IPartOfRollupInput)
|
|
|
80
93
|
* `queryHandle` gates.
|
|
81
94
|
*/
|
|
82
95
|
export declare function openCurve(ctx: BacklogCtx, input: IOpenCurveInput): Promise<IOutcomeEnvelope<IOpenCurveResult>>;
|
|
96
|
+
/** The `embedding_status` read op's payload (see {@link embeddingStatus}). */
|
|
97
|
+
export interface IEmbeddingStatusResult {
|
|
98
|
+
/** The on-disk `embedding.enabled` (observed from the config layers). */
|
|
99
|
+
readonly configuredEnabled: boolean;
|
|
100
|
+
/** The value the running process is actually using right now. */
|
|
101
|
+
readonly effectiveEnabled: boolean;
|
|
102
|
+
readonly provider: string;
|
|
103
|
+
readonly model: string;
|
|
104
|
+
/** Whether the resolved semantic members are currently retained for the store. */
|
|
105
|
+
readonly membersPresent: {
|
|
106
|
+
readonly embedding: boolean;
|
|
107
|
+
readonly search: boolean;
|
|
108
|
+
};
|
|
109
|
+
/** `configuredEnabled !== effectiveEnabled` — on-disk enabled, process not (yet) adopted. */
|
|
110
|
+
readonly divergent: boolean;
|
|
111
|
+
/** Config hash the process started with (`ctx.env.version.configHash`). */
|
|
112
|
+
readonly startupHash: string;
|
|
113
|
+
/** Config hash currently observed on disk. */
|
|
114
|
+
readonly currentHash: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Health/observability read for the semantic layer: EFFECTIVE vs CONFIGURED
|
|
118
|
+
* `embedding.*`, member presence, and both config hashes.
|
|
119
|
+
*
|
|
120
|
+
* A READ op — it never opens the cold semantic backend (`queryHandle` is not
|
|
121
|
+
* touched), so a caller can ask "is RAG on, and is on-disk ahead of me?"
|
|
122
|
+
* cheaply. `provider`/`model` are the effective values; `divergent` is the
|
|
123
|
+
* one non-obvious bit — on-disk says enabled while the process is still
|
|
124
|
+
* effectively disabled, which normally resolves on the next semantic verb
|
|
125
|
+
* (see {@link ensureSemanticReady}).
|
|
126
|
+
*
|
|
127
|
+
* A first-class read op (rather than a `query` view) because it is a property
|
|
128
|
+
* of the PROCESS and its config, not of the issue graph — and because the
|
|
129
|
+
* write path's own loudness net (`write/bootstrap.ts`) reports the same
|
|
130
|
+
* divergence, so operators can confirm it out-of-band.
|
|
131
|
+
*/
|
|
132
|
+
export declare function embeddingStatus(ctx: BacklogCtx): Promise<IOutcomeEnvelope<IEmbeddingStatusResult>>;
|
|
83
133
|
/**
|
|
84
134
|
* Resolve a free-text reference to a project, component or location in the
|
|
85
135
|
* registry.
|