@aionis/substrate 0.1.3 → 0.1.5
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 +21 -0
- package/README.md +120 -13
- package/dist/candidate-index.d.ts +25 -0
- package/dist/candidate-index.d.ts.map +1 -0
- package/dist/candidate-index.js +217 -0
- package/dist/candidate-index.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +160 -2
- package/dist/cli.js.map +1 -1
- package/dist/embedding-projection.d.ts +16 -0
- package/dist/embedding-projection.d.ts.map +1 -0
- package/dist/embedding-projection.js +101 -0
- package/dist/embedding-projection.js.map +1 -0
- package/dist/file-substrate.d.ts +3 -0
- package/dist/file-substrate.d.ts.map +1 -1
- package/dist/file-substrate.js +47 -1
- package/dist/file-substrate.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/runtime-live-sidecar.d.ts +79 -0
- package/dist/runtime-live-sidecar.d.ts.map +1 -0
- package/dist/runtime-live-sidecar.js +382 -0
- package/dist/runtime-live-sidecar.js.map +1 -0
- package/dist/search.d.ts +11 -2
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +78 -7
- package/dist/search.js.map +1 -1
- package/dist/sqlite-substrate.d.ts +3 -0
- package/dist/sqlite-substrate.d.ts.map +1 -1
- package/dist/sqlite-substrate.js +61 -6
- package/dist/sqlite-substrate.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/zvec-candidate-index.d.ts +42 -0
- package/dist/zvec-candidate-index.d.ts.map +1 -0
- package/dist/zvec-candidate-index.js +463 -0
- package/dist/zvec-candidate-index.js.map +1 -0
- package/docs/ADAPTER_CONTRACT.md +12 -2
- package/docs/API_USAGE.md +135 -0
- package/docs/CLI.md +76 -1
- package/docs/RUNTIME_DUAL_WRITE_EXPERIMENT.md +14 -0
- package/docs/RUNTIME_LIVE_SIDECAR.md +142 -0
- package/docs/RUNTIME_SNAPSHOT_IMPORT.md +3 -0
- package/docs/RUNTIME_ZVEC_CANDIDATE_INDEX.md +80 -0
- package/docs/STORE_CONTRACT.md +15 -0
- package/docs/V0_2_ROADMAP.md +15 -3
- package/docs/ZVEC_PROVIDER_EMBEDDING_EVAL.md +216 -0
- package/docs/ZVEC_SCALE_MAINTENANCE.md +89 -0
- package/examples/live-sidecar/index.mjs +189 -0
- package/package.json +17 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,27 @@ All notable changes to Aionis Substrate are documented here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Live sidecar integration example that builds a real Runtime Lite SQLite source, mirrors it through the checkpointed sidecar, and previews governed context buckets.
|
|
10
|
+
- Optional candidate index boundary with rebuild, verify, write-through node sync, and candidate-id narrowing before canonical Substrate scoring.
|
|
11
|
+
- Optional Zvec-backed candidate index adapter for local vector preselection while keeping file/SQLite as truth storage.
|
|
12
|
+
- Runtime Zvec candidate-index validation gate that imports real Runtime Lite SQLite scopes into isolated Substrate stores and checks Zvec health plus canonical-search parity.
|
|
13
|
+
- Zvec scale-maintenance gate that writes a SQLite truth store with a Zvec candidate sidecar, verifies write-through health, wide-search parity, narrow seeded recovery, lifecycle-transition sync, compaction, and reopen rebuild.
|
|
14
|
+
- Provider-backed Zvec embedding eval that calls OpenAI-compatible or MiniMax native embeddings endpoints and reports raw Zvec candidate hit rate separately from final Substrate search hit rate.
|
|
15
|
+
- Candidate-index semantic fusion that lets Zvec/provider candidates influence final `searchNodes()` ranking without bypassing scope, lifecycle, authority, confidence, or target-file filters.
|
|
16
|
+
- DashScope native `text-embedding-v4` provider eval with query/document projection, optional query instructions, and projection-aware reports.
|
|
17
|
+
- Stable SDK embedding projection helpers for provider hosts: `buildAionisEmbeddingDocument`, `buildAionisEmbeddingQuery`, and `AIONIS_EMBEDDING_PROJECTION_VERSION`.
|
|
18
|
+
|
|
19
|
+
## 0.1.4 - 2026-06-26
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Runtime live sidecar API and CLI command for checkpointed, repeated Runtime Lite SQLite mirroring into a separate Substrate target.
|
|
24
|
+
- Runtime live sidecar bounded watch mode with interval polling, aggregate reports, and a single-instance checkpoint lock.
|
|
25
|
+
- Runtime live sidecar soak check that repeatedly appends real Runtime Lite SQLite evidence and verifies checkpointed watch sync into a separate Substrate SQLite target.
|
|
26
|
+
- Runtime live sidecar documentation covering checkpoint behavior, dry runs, watch mode, soak checks, and product boundaries.
|
|
27
|
+
|
|
7
28
|
## 0.1.3 - 2026-06-26
|
|
8
29
|
|
|
9
30
|
### Added
|
package/README.md
CHANGED
|
@@ -4,18 +4,18 @@ Aionis Substrate is an independent storage-contract project for Aionis memory an
|
|
|
4
4
|
|
|
5
5
|
It defines the durable substrate Aionis needs for governed working memory: append-only evidence, lifecycle state, relations, feedback, decision receipts, and context admission buckets.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Aionis Runtime can use this layer as a durable governed memory substrate. Agents and Runtime policy remain above it; file/SQLite remain the truth store; optional indexes such as Zvec can accelerate candidate preselection.
|
|
8
8
|
|
|
9
9
|
## Status
|
|
10
10
|
|
|
11
11
|
- Package: `@aionis/substrate`
|
|
12
|
-
- Version: `0.1.
|
|
12
|
+
- Version: `0.1.4`
|
|
13
13
|
- Runtime: Node 24+
|
|
14
14
|
- License: Apache-2.0
|
|
15
15
|
- Current adapters: file store and SQLite
|
|
16
|
-
- Runtime integration status: read-only snapshot import, reference-corpus parity, external admission parity, and isolated dual-write sidecar experiments
|
|
16
|
+
- Runtime integration status: read-only snapshot import, checkpointed live sidecar mirror, reference-corpus parity, external admission parity, and isolated dual-write sidecar experiments
|
|
17
17
|
|
|
18
|
-
The project is intentionally independent from `AionisRuntime-focused`. It can import real Runtime Lite SQLite snapshots for validation and run isolated sidecar dual-write experiments, but it does not mutate Runtime source code or replace Runtime storage.
|
|
18
|
+
The project is intentionally independent from `AionisRuntime-focused`. It can import real Runtime Lite SQLite snapshots for validation, mirror Runtime evidence into a separate Substrate target through an external checkpointed sidecar, and run isolated sidecar dual-write experiments, but it does not mutate Runtime source code or replace Runtime storage.
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
@@ -43,8 +43,28 @@ npx aionis-substrate preview-context --adapter sqlite --path ./substrate.sqlite
|
|
|
43
43
|
npx aionis-substrate backup --adapter sqlite --path ./substrate.sqlite --output ./backup.json
|
|
44
44
|
npx aionis-substrate restore --adapter sqlite --path ./restored.sqlite --input ./backup.json
|
|
45
45
|
npx aionis-substrate compact --adapter sqlite --path ./substrate.sqlite
|
|
46
|
+
npx aionis-substrate live-sidecar --source ./runtime.sqlite --target ./substrate.sqlite --adapter sqlite --checkpoint ./runtime-live-checkpoint.json --scope repo-a
|
|
47
|
+
npx aionis-substrate live-sidecar --source ./runtime.sqlite --target ./substrate.sqlite --adapter sqlite --checkpoint ./runtime-live-checkpoint.json --scope repo-a --watch --iterations 20 --interval-ms 5000
|
|
46
48
|
```
|
|
47
49
|
|
|
50
|
+
## Two-Minute Live Sidecar Demo
|
|
51
|
+
|
|
52
|
+
From a cloned repository:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run example:live-sidecar
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The demo creates a real Runtime Lite SQLite source, inserts current route, failed
|
|
59
|
+
branch, and raw-trace pointer evidence, mirrors that source into a separate
|
|
60
|
+
Substrate SQLite store through `runRuntimeLiveSidecarOnce`, and previews the
|
|
61
|
+
governed context buckets. The expected output shows:
|
|
62
|
+
|
|
63
|
+
- `current-route` in `use_now`;
|
|
64
|
+
- `failed-branch` in `do_not_use`;
|
|
65
|
+
- `raw-trace` in `rehydrate`;
|
|
66
|
+
- the second sidecar run applying zero unchanged rows.
|
|
67
|
+
|
|
48
68
|
## Goal
|
|
49
69
|
|
|
50
70
|
Define the storage semantics Aionis needs before choosing or building a storage engine:
|
|
@@ -56,15 +76,11 @@ Define the storage semantics Aionis needs before choosing or building a storage
|
|
|
56
76
|
- decision traces that explain why memory was admitted, downgraded, blocked, or deferred
|
|
57
77
|
- controlled forgetting as state transitions, not silent deletion
|
|
58
78
|
|
|
59
|
-
##
|
|
79
|
+
## Product Boundary
|
|
60
80
|
|
|
61
|
-
-
|
|
62
|
-
- not a vector index;
|
|
63
|
-
- not a chat memory store;
|
|
64
|
-
- not a benchmark harness;
|
|
65
|
-
- not the full Aionis Runtime policy engine.
|
|
81
|
+
Aionis Substrate owns durable memory evidence, lifecycle state, relation graph, feedback receipts, audit reads, side-effect-free preview, and the minimum governed context contract.
|
|
66
82
|
|
|
67
|
-
|
|
83
|
+
Aionis Runtime owns richer admission policy, product orchestration, Agent-facing guide behavior, and model/provider workflows above this storage-contract layer.
|
|
68
84
|
|
|
69
85
|
## Current Scope
|
|
70
86
|
|
|
@@ -80,8 +96,12 @@ This first version ships two embedded adapters:
|
|
|
80
96
|
- the SQLite adapter persists schema metadata, records applied schema migrations, and rejects stores created by a newer unsupported schema.
|
|
81
97
|
- event-log backups can be exported, checksum-verified, and restored to either file or SQLite stores.
|
|
82
98
|
- checkpoint compaction can rewrite a store event log to one checksum-covered checkpoint event without changing governed state.
|
|
83
|
-
- `searchNodes` provides scoped deterministic lexical/structured search over memory nodes without mutating events or admission state.
|
|
99
|
+
- `searchNodes` provides scoped deterministic lexical/structured search over memory nodes without mutating events or admission state.
|
|
100
|
+
- stores can be opened with an optional candidate index. The index is rebuilt on open by default, receives write-through node updates, can be verified for missing/orphan/stale entries, and only narrows candidate ids before Substrate reloads truth nodes and scores them.
|
|
101
|
+
- `createZvecCandidateIndex` provides an optional Zvec-backed candidate index for local vector preselection. Substrate fuses candidate-index rank into final search while preserving scope, lifecycle, authority, confidence, and target-file filters. It requires installing `@zvec/zvec`; file/SQLite remain the truth store.
|
|
102
|
+
- `buildAionisEmbeddingDocument` and `buildAionisEmbeddingQuery` expose the stable SDK projection for hosts that generate provider vectors before writing nodes or querying Zvec.
|
|
84
103
|
- `importRuntimeLiteSnapshot` can import an existing Runtime Lite SQLite database into an isolated Substrate store through a read-only source connection.
|
|
104
|
+
- `runRuntimeLiveSidecarOnce`, `runRuntimeLiveSidecarWatch`, and `aionis-substrate live-sidecar` incrementally mirror Runtime Lite evidence into a separate Substrate target through a checkpoint file.
|
|
85
105
|
|
|
86
106
|
This is intentionally small. It proves the substrate contract without changing the existing Aionis Runtime.
|
|
87
107
|
|
|
@@ -103,6 +123,15 @@ Checkpoint compaction is documented in [docs/CHECKPOINT_COMPACTION.md](docs/CHEC
|
|
|
103
123
|
|
|
104
124
|
Runtime snapshot import is documented in [docs/RUNTIME_SNAPSHOT_IMPORT.md](docs/RUNTIME_SNAPSHOT_IMPORT.md).
|
|
105
125
|
|
|
126
|
+
Runtime live sidecar sync is documented in [docs/RUNTIME_LIVE_SIDECAR.md](docs/RUNTIME_LIVE_SIDECAR.md).
|
|
127
|
+
|
|
128
|
+
Runtime Zvec candidate-index validation is documented in [docs/RUNTIME_ZVEC_CANDIDATE_INDEX.md](docs/RUNTIME_ZVEC_CANDIDATE_INDEX.md).
|
|
129
|
+
|
|
130
|
+
Zvec scale and maintenance validation is documented in [docs/ZVEC_SCALE_MAINTENANCE.md](docs/ZVEC_SCALE_MAINTENANCE.md).
|
|
131
|
+
|
|
132
|
+
Provider-backed Zvec embedding validation is documented in [docs/ZVEC_PROVIDER_EMBEDDING_EVAL.md](docs/ZVEC_PROVIDER_EMBEDDING_EVAL.md).
|
|
133
|
+
The provider eval supports OpenAI-compatible embedding endpoints and MiniMax native embeddings for checking Zvec candidate preselection with real provider vectors.
|
|
134
|
+
|
|
106
135
|
Runtime reference corpus parity is documented in [docs/RUNTIME_REFERENCE_CORPUS.md](docs/RUNTIME_REFERENCE_CORPUS.md).
|
|
107
136
|
|
|
108
137
|
Runtime sidecar stabilization is documented in [docs/RUNTIME_SIDECAR_STABILIZATION.md](docs/RUNTIME_SIDECAR_STABILIZATION.md).
|
|
@@ -132,10 +161,11 @@ Node 24+ is required because the project runs TypeScript directly.
|
|
|
132
161
|
## Minimal API Loop
|
|
133
162
|
|
|
134
163
|
```ts
|
|
135
|
-
import { openSqliteAionisSubstrate } from "@aionis/substrate";
|
|
164
|
+
import { createMemoryCandidateIndex, openSqliteAionisSubstrate } from "@aionis/substrate";
|
|
136
165
|
|
|
137
166
|
const store = await openSqliteAionisSubstrate({
|
|
138
167
|
path: "./aionis-substrate.sqlite",
|
|
168
|
+
candidateIndex: createMemoryCandidateIndex(),
|
|
139
169
|
});
|
|
140
170
|
|
|
141
171
|
await store.putNode({
|
|
@@ -205,6 +235,33 @@ npm run check:runtime-corpus -- \
|
|
|
205
235
|
|
|
206
236
|
This scans Runtime Lite SQLite files read-only, imports selected scopes into temporary Substrate stores, and writes an aggregate matrix report under `reports/runtime-snapshot-corpus-*`. The report includes bucket totals, node/relation/feedback/decision coverage, source-table presence, skip reasons, and Runtime JSON issues.
|
|
207
237
|
|
|
238
|
+
Runtime Zvec candidate-index check:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
npm run check:runtime-zvec-index -- \
|
|
242
|
+
--root /path/to/AionisRuntime-focused/.tmp \
|
|
243
|
+
--max-scopes 20 \
|
|
244
|
+
--min-nodes 3 \
|
|
245
|
+
--probes-per-scope 8
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
This imports real Runtime Lite SQLite scopes into isolated Substrate SQLite stores, rebuilds a Zvec candidate index, verifies missing/orphan/stale health, and checks that wide candidate search preserves canonical Substrate search while narrow candidate search recovers seeded real Runtime memory nodes.
|
|
249
|
+
|
|
250
|
+
Runtime live sidecar mirror:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
npx aionis-substrate live-sidecar \
|
|
254
|
+
--source /path/to/aionis-runtime-lite.sqlite \
|
|
255
|
+
--target /tmp/aionis-substrate.sqlite \
|
|
256
|
+
--adapter sqlite \
|
|
257
|
+
--checkpoint /tmp/aionis-runtime-live-checkpoint.json \
|
|
258
|
+
--scope repo-a
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
This opens Runtime SQLite read-only, writes only new or changed mapped evidence into the separate Substrate target, and atomically updates a checkpoint file. Re-running the command should report unchanged evidence instead of replaying the same rows.
|
|
262
|
+
|
|
263
|
+
Add `--watch --iterations <n> --interval-ms <ms>` for a bounded polling loop with a single-instance checkpoint lock.
|
|
264
|
+
|
|
208
265
|
Runtime reference corpus parity:
|
|
209
266
|
|
|
210
267
|
```bash
|
|
@@ -266,6 +323,23 @@ npm run check:runtime-dual-write -- \
|
|
|
266
323
|
|
|
267
324
|
The soak report includes per-scenario latency summaries, chain-probe latency, reopen latency, event-sequence continuity, and SQLite file sizes.
|
|
268
325
|
|
|
326
|
+
Runtime product bridge gate:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
npm run check:runtime-product-bridge -- \
|
|
330
|
+
--runtime-root /path/to/AionisRuntime-focused
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
This is the product-level bridge check. It runs real focused Runtime
|
|
334
|
+
`observe -> guide -> feedback -> measure`, verifies external Substrate
|
|
335
|
+
dual-write parity, closes and reopens the Substrate store, runs lifecycle/relation
|
|
336
|
+
chain probes, mirrors the Runtime Lite SQLite source through read-only
|
|
337
|
+
`live-sidecar`, re-runs `live-sidecar` to prove checkpoint idempotency, and then
|
|
338
|
+
compares the mirrored Substrate `previewContext` buckets back against Runtime
|
|
339
|
+
guide surfaces. The default gate runs 4 fixed scenarios, 96 deterministic
|
|
340
|
+
generated scenarios, and 16 chain probes. It writes a single
|
|
341
|
+
`product-bridge-gate-summary.json` report and exits non-zero if any stage fails.
|
|
342
|
+
|
|
269
343
|
## Development Checks
|
|
270
344
|
|
|
271
345
|
```bash
|
|
@@ -273,9 +347,11 @@ npm run typecheck
|
|
|
273
347
|
npm run build
|
|
274
348
|
npm test
|
|
275
349
|
npm run bench:contract
|
|
350
|
+
npm run check:runtime-live-sidecar-soak
|
|
276
351
|
npm run check:pack
|
|
277
352
|
npm run check:install-smoke
|
|
278
353
|
npm run example:basic
|
|
354
|
+
npm run example:live-sidecar
|
|
279
355
|
```
|
|
280
356
|
|
|
281
357
|
The CI workflow runs the same checks on every push and pull request.
|
|
@@ -290,6 +366,8 @@ npm run check:release
|
|
|
290
366
|
|
|
291
367
|
`check:install-smoke` packs the built package, installs that tarball into a fresh temporary project, imports `@aionis/substrate`, and runs real file/SQLite store operations from the installed package.
|
|
292
368
|
|
|
369
|
+
`check:runtime-live-sidecar-soak` creates a real Runtime Lite SQLite fixture, repeatedly appends execution-memory rows, and verifies checkpointed live-sidecar watch sync into a separate real Substrate SQLite store.
|
|
370
|
+
|
|
293
371
|
After publishing to npm, run the registry package checks:
|
|
294
372
|
|
|
295
373
|
```bash
|
|
@@ -310,3 +388,32 @@ npm run check:scale -- \
|
|
|
310
388
|
```
|
|
311
389
|
|
|
312
390
|
The scale smoke writes a temporary SQLite substrate, verifies event sequence continuity, runs scoped search, compiles context, compacts the store, reopens it, and writes a report under `reports/scale-*`.
|
|
391
|
+
|
|
392
|
+
SQLite + Zvec scale maintenance:
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
npm run check:zvec-scale -- \
|
|
396
|
+
--nodes 10000 \
|
|
397
|
+
--scopes 10 \
|
|
398
|
+
--relations 2000 \
|
|
399
|
+
--feedback 1000 \
|
|
400
|
+
--probes 100 \
|
|
401
|
+
--narrow-candidate-limit 20
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
This writes a temporary SQLite truth store with a Zvec candidate sidecar, verifies write-through index health, compares wide-window Zvec search against canonical Substrate search, checks narrow-window seeded recovery, transitions lifecycle state, compacts, reopens, and writes a report under `reports/zvec-scale-*`.
|
|
405
|
+
|
|
406
|
+
Provider-backed Zvec embedding eval:
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
AIONIS_EMBEDDING_API_KEY=... \
|
|
410
|
+
AIONIS_EMBEDDING_MODEL=text-embedding-3-small \
|
|
411
|
+
npm run check:zvec-provider-embedding -- \
|
|
412
|
+
--base-url https://api.openai.com/v1 \
|
|
413
|
+
--nodes 240 \
|
|
414
|
+
--scopes 4 \
|
|
415
|
+
--queries 20 \
|
|
416
|
+
--candidate-limit 20
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
This uses a real embedding provider, stores provider vectors on generated Substrate nodes, runs Zvec candidate search, and reports both raw Zvec candidate hit rate and final Substrate search hit rate. The runner supports OpenAI-compatible endpoints, MiniMax native embeddings, and DashScope native `text-embedding-v4` with query/document projection.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AionisMemoryNode, AionisMemorySearchInput, AionisMemorySearchReason } from "./types.ts";
|
|
2
|
+
export type AionisCandidateIndexSearchResult = {
|
|
3
|
+
scope: string;
|
|
4
|
+
memoryId: string;
|
|
5
|
+
score: number;
|
|
6
|
+
reasons: AionisMemorySearchReason[];
|
|
7
|
+
};
|
|
8
|
+
export type AionisCandidateIndexHealthReport = {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
sourceCount: number;
|
|
11
|
+
indexedCount: number;
|
|
12
|
+
missingNodeIds: string[];
|
|
13
|
+
orphanNodeIds: string[];
|
|
14
|
+
staleNodeIds: string[];
|
|
15
|
+
};
|
|
16
|
+
export type AionisCandidateIndex = {
|
|
17
|
+
upsertNode(node: AionisMemoryNode): Promise<void>;
|
|
18
|
+
deleteNode(scope: string, id: string): Promise<void>;
|
|
19
|
+
search(input: AionisMemorySearchInput): Promise<AionisCandidateIndexSearchResult[] | null>;
|
|
20
|
+
rebuild(nodes: AionisMemoryNode[]): Promise<AionisCandidateIndexHealthReport>;
|
|
21
|
+
verify(nodes: AionisMemoryNode[]): Promise<AionisCandidateIndexHealthReport>;
|
|
22
|
+
close?(): Promise<void>;
|
|
23
|
+
};
|
|
24
|
+
export declare function createMemoryCandidateIndex(nodes?: AionisMemoryNode[]): AionisCandidateIndex;
|
|
25
|
+
//# sourceMappingURL=candidate-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate-index.d.ts","sourceRoot":"","sources":["../src/candidate-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gCAAgC,GAAG;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,EAAE,EAAE,OAAO,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,MAAM,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,gCAAgC,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3F,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC9E,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC7E,KAAK,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACzB,CAAC;AAyJF,wBAAgB,0BAA0B,CAAC,KAAK,GAAE,gBAAgB,EAAO,GAAG,oBAAoB,CA0E/F"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
const DEFAULT_INDEX_LIMIT = 200;
|
|
2
|
+
function indexKey(scope, id) {
|
|
3
|
+
return `${scope}\u0000${id}`;
|
|
4
|
+
}
|
|
5
|
+
function normalizeText(value) {
|
|
6
|
+
return value.toLowerCase().normalize("NFKC");
|
|
7
|
+
}
|
|
8
|
+
function tokenize(value) {
|
|
9
|
+
return Array.from(new Set(normalizeText(value).match(/[\p{L}\p{N}_./:-]+/gu) ?? []));
|
|
10
|
+
}
|
|
11
|
+
function normalizePath(value) {
|
|
12
|
+
return value.trim().replaceAll("\\", "/").replace(/\/+/g, "/").toLowerCase();
|
|
13
|
+
}
|
|
14
|
+
function stableMetadataText(metadata) {
|
|
15
|
+
if (!metadata)
|
|
16
|
+
return "";
|
|
17
|
+
return Object.entries(metadata)
|
|
18
|
+
.filter(([, value]) => typeof value === "string" || typeof value === "number" || typeof value === "boolean")
|
|
19
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
20
|
+
.map(([key, value]) => `${key}:${String(value)}`)
|
|
21
|
+
.join(" ");
|
|
22
|
+
}
|
|
23
|
+
function nodeSearchText(node) {
|
|
24
|
+
return [
|
|
25
|
+
node.id,
|
|
26
|
+
node.kind,
|
|
27
|
+
node.title ?? "",
|
|
28
|
+
node.summary,
|
|
29
|
+
...(node.targetFiles ?? []),
|
|
30
|
+
node.payloadRef ?? "",
|
|
31
|
+
node.agentId ?? "",
|
|
32
|
+
node.teamId ?? "",
|
|
33
|
+
stableMetadataText(node.metadata),
|
|
34
|
+
].filter(Boolean).join(" ");
|
|
35
|
+
}
|
|
36
|
+
function nodeFingerprint(node) {
|
|
37
|
+
return JSON.stringify({
|
|
38
|
+
id: node.id,
|
|
39
|
+
scope: node.scope,
|
|
40
|
+
kind: node.kind,
|
|
41
|
+
title: node.title ?? null,
|
|
42
|
+
summary: node.summary,
|
|
43
|
+
lifecycle: node.lifecycle,
|
|
44
|
+
authority: node.authority,
|
|
45
|
+
confidence: node.confidence,
|
|
46
|
+
targetFiles: node.targetFiles ?? [],
|
|
47
|
+
payloadRef: node.payloadRef ?? null,
|
|
48
|
+
agentId: node.agentId ?? null,
|
|
49
|
+
teamId: node.teamId ?? null,
|
|
50
|
+
metadata: node.metadata ?? {},
|
|
51
|
+
updatedAt: node.updatedAt,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function toIndexedNode(node) {
|
|
55
|
+
const text = nodeSearchText(node);
|
|
56
|
+
return {
|
|
57
|
+
node,
|
|
58
|
+
fingerprint: nodeFingerprint(node),
|
|
59
|
+
text: normalizeText(text),
|
|
60
|
+
tokens: new Set(tokenize(text)),
|
|
61
|
+
targetFiles: new Set((node.targetFiles ?? []).map(normalizePath).filter(Boolean)),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function hasAnyTargetFile(indexed, targetFiles) {
|
|
65
|
+
if (targetFiles.length === 0)
|
|
66
|
+
return true;
|
|
67
|
+
return targetFiles.some((target) => indexed.targetFiles.has(normalizePath(target)));
|
|
68
|
+
}
|
|
69
|
+
function setContains(filter, value) {
|
|
70
|
+
return !filter || filter.has(value);
|
|
71
|
+
}
|
|
72
|
+
function compareIso(value, boundary) {
|
|
73
|
+
return value.localeCompare(boundary);
|
|
74
|
+
}
|
|
75
|
+
function scoreQuery(indexed, query) {
|
|
76
|
+
const queryTokens = tokenize(query ?? "");
|
|
77
|
+
if (queryTokens.length === 0)
|
|
78
|
+
return {
|
|
79
|
+
score: indexed.node.confidence,
|
|
80
|
+
reasons: [{ code: "candidate_index_scope_match", detail: `scope=${indexed.node.scope}` }],
|
|
81
|
+
};
|
|
82
|
+
let score = indexed.node.confidence;
|
|
83
|
+
const matched = [];
|
|
84
|
+
for (const token of queryTokens) {
|
|
85
|
+
if (indexed.tokens.has(token)) {
|
|
86
|
+
score += 2;
|
|
87
|
+
matched.push(token);
|
|
88
|
+
}
|
|
89
|
+
else if (indexed.text.includes(token)) {
|
|
90
|
+
score += 1;
|
|
91
|
+
matched.push(token);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (matched.length === 0)
|
|
95
|
+
return null;
|
|
96
|
+
return {
|
|
97
|
+
score,
|
|
98
|
+
reasons: [{
|
|
99
|
+
code: "candidate_index_query_match",
|
|
100
|
+
detail: `candidate index matched ${matched.length}/${queryTokens.length} query tokens: ${matched.join(", ")}`,
|
|
101
|
+
}],
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function healthFrom(indexed, nodes) {
|
|
105
|
+
const source = new Map(nodes.map((node) => [indexKey(node.scope, node.id), node]));
|
|
106
|
+
const missingNodeIds = [];
|
|
107
|
+
const orphanNodeIds = [];
|
|
108
|
+
const staleNodeIds = [];
|
|
109
|
+
for (const [key, node] of source) {
|
|
110
|
+
const current = indexed.get(key);
|
|
111
|
+
if (!current) {
|
|
112
|
+
missingNodeIds.push(node.id);
|
|
113
|
+
}
|
|
114
|
+
else if (current.fingerprint !== nodeFingerprint(node)) {
|
|
115
|
+
staleNodeIds.push(node.id);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (const [key, current] of indexed) {
|
|
119
|
+
if (!source.has(key))
|
|
120
|
+
orphanNodeIds.push(current.node.id);
|
|
121
|
+
}
|
|
122
|
+
missingNodeIds.sort();
|
|
123
|
+
orphanNodeIds.sort();
|
|
124
|
+
staleNodeIds.sort();
|
|
125
|
+
return {
|
|
126
|
+
ok: missingNodeIds.length === 0 && orphanNodeIds.length === 0 && staleNodeIds.length === 0,
|
|
127
|
+
sourceCount: source.size,
|
|
128
|
+
indexedCount: indexed.size,
|
|
129
|
+
missingNodeIds,
|
|
130
|
+
orphanNodeIds,
|
|
131
|
+
staleNodeIds,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export function createMemoryCandidateIndex(nodes = []) {
|
|
135
|
+
const indexed = new Map();
|
|
136
|
+
for (const node of nodes)
|
|
137
|
+
indexed.set(indexKey(node.scope, node.id), toIndexedNode(node));
|
|
138
|
+
return {
|
|
139
|
+
async upsertNode(node) {
|
|
140
|
+
indexed.set(indexKey(node.scope, node.id), toIndexedNode(node));
|
|
141
|
+
},
|
|
142
|
+
async deleteNode(scope, id) {
|
|
143
|
+
indexed.delete(indexKey(scope, id));
|
|
144
|
+
},
|
|
145
|
+
async search(input) {
|
|
146
|
+
const scope = input.scope.trim();
|
|
147
|
+
if (!scope)
|
|
148
|
+
throw new Error("scope is required");
|
|
149
|
+
const limit = input.limit === undefined ? DEFAULT_INDEX_LIMIT : input.limit;
|
|
150
|
+
if (!Number.isInteger(limit) || limit < 1)
|
|
151
|
+
throw new Error("limit must be a positive integer");
|
|
152
|
+
if (input.minConfidence !== undefined && (!Number.isFinite(input.minConfidence) || input.minConfidence < 0 || input.minConfidence > 1)) {
|
|
153
|
+
throw new Error("minConfidence must be between 0 and 1");
|
|
154
|
+
}
|
|
155
|
+
const kindFilter = input.kinds === undefined ? null : new Set(input.kinds);
|
|
156
|
+
const lifecycleFilter = input.lifecycle === undefined ? null : new Set(input.lifecycle);
|
|
157
|
+
const authorityFilter = input.authority === undefined ? null : new Set(input.authority);
|
|
158
|
+
const targetFiles = input.targetFiles?.map((item) => item.trim()).filter(Boolean) ?? [];
|
|
159
|
+
const results = [];
|
|
160
|
+
for (const item of indexed.values()) {
|
|
161
|
+
const node = item.node;
|
|
162
|
+
if (node.scope !== scope)
|
|
163
|
+
continue;
|
|
164
|
+
if (!setContains(kindFilter, node.kind))
|
|
165
|
+
continue;
|
|
166
|
+
if (!setContains(lifecycleFilter, node.lifecycle))
|
|
167
|
+
continue;
|
|
168
|
+
if (!setContains(authorityFilter, node.authority))
|
|
169
|
+
continue;
|
|
170
|
+
if (input.agentId !== undefined && node.agentId !== input.agentId)
|
|
171
|
+
continue;
|
|
172
|
+
if (input.teamId !== undefined && node.teamId !== input.teamId)
|
|
173
|
+
continue;
|
|
174
|
+
if (input.minConfidence !== undefined && node.confidence < input.minConfidence)
|
|
175
|
+
continue;
|
|
176
|
+
if (input.updatedAfter !== undefined && compareIso(node.updatedAt, input.updatedAfter) < 0)
|
|
177
|
+
continue;
|
|
178
|
+
if (input.updatedBefore !== undefined && compareIso(node.updatedAt, input.updatedBefore) > 0)
|
|
179
|
+
continue;
|
|
180
|
+
if (!hasAnyTargetFile(item, targetFiles))
|
|
181
|
+
continue;
|
|
182
|
+
const query = scoreQuery(item, input.query);
|
|
183
|
+
if (!query)
|
|
184
|
+
continue;
|
|
185
|
+
results.push({
|
|
186
|
+
scope: node.scope,
|
|
187
|
+
memoryId: node.id,
|
|
188
|
+
score: query.score,
|
|
189
|
+
reasons: query.reasons,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
return results
|
|
193
|
+
.sort((a, b) => {
|
|
194
|
+
const byScore = b.score - a.score;
|
|
195
|
+
if (byScore !== 0)
|
|
196
|
+
return byScore;
|
|
197
|
+
const aNode = indexed.get(indexKey(a.scope, a.memoryId))?.node;
|
|
198
|
+
const bNode = indexed.get(indexKey(b.scope, b.memoryId))?.node;
|
|
199
|
+
const byTime = (bNode?.updatedAt ?? "").localeCompare(aNode?.updatedAt ?? "");
|
|
200
|
+
if (byTime !== 0)
|
|
201
|
+
return byTime;
|
|
202
|
+
return a.memoryId.localeCompare(b.memoryId);
|
|
203
|
+
})
|
|
204
|
+
.slice(0, limit);
|
|
205
|
+
},
|
|
206
|
+
async rebuild(nodes) {
|
|
207
|
+
indexed.clear();
|
|
208
|
+
for (const node of nodes)
|
|
209
|
+
indexed.set(indexKey(node.scope, node.id), toIndexedNode(node));
|
|
210
|
+
return healthFrom(indexed, nodes);
|
|
211
|
+
},
|
|
212
|
+
async verify(nodes) {
|
|
213
|
+
return healthFrom(indexed, nodes);
|
|
214
|
+
},
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=candidate-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate-index.js","source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,CAAC,CAAC;YAC9C,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACrB,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,KAAyB;YACrC,OAAO,CAAC,KAAK,EAAE,CAAC;YAChB,KAAK,MAAM,IAAI,IAAI,KAAK;gBAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;YAC1F,OAAO,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACpC,CAAC;QAED,KAAK,CAAC,MAAM,CAAC,KAAyB;YACpC,OAAO,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAgzBA,wBAAsB,MAAM,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAuCxE"}
|