@avantf/dsh-mem 0.6.0 → 0.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAQlD,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,EAAE,mBAAmB,EAAU,MAAM,kCAAkC,CAAA;AAE9E,OAAO,EAQL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,WAAW,EAEhB,KAAK,WAAW,EACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAeL,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,YAAY,EACjB,KAAK,cAAc,EAEnB,KAAK,oBAAoB,EAG1B,MAAM,sBAAsB,CAAA;AAqB7B,eAAO,MAAM,IAAI,eAAe,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC,OAAO,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAQ7E,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAA;AAEpB,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AACD,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAO3B,CAAA;AA6CF,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAOvC;;;;;;;;;;GAUG;AACH,qBAAa,gBAAiB,SAAQ,mBAAmB;IACvD,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAe;gBACtB,GAAG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,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAwYvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,oBAAoB,EAGpB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAGhF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AA6E/D,eAAO,MAAM,WAAW,EAAE,SAAS,oBAAoB,EA0HtD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,wBAGhC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,IAAI,CAAA;AAE7B;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,SAAS,CAEnE;AA8BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBA0C9B,CAAA"}
1
+ {"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/remote.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EACV,oBAAoB,EAGpB,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAGhF,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AA6E/D,eAAO,MAAM,WAAW,EAAE,SAAS,oBAAoB,EA4HtD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,EAAE,wBAGhC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,YAAY,IAAI,CAAA;AAE7B;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,SAAS,CAEnE;AA8BD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,EAAE,kBA0C9B,CAAA"}
@@ -1,29 +1,33 @@
1
1
  /**
2
- * The plugin's driver for the bounded, resumable background migration of persisted vectors into the
3
- * current embedding space.
2
+ * The plugin's lifecycle for the bounded, resumable background migration of persisted vectors into
3
+ * the current embedding space.
4
4
  *
5
- * Changing the embedding space (default model, width, pooling, normalization) is a DATA MIGRATION,
6
- * not a config tweak: every persisted vector still decodes, but in another model's coordinates, so
7
- * the semantic leg must not serve it. Measured on the real library after the 512→768 default-model
8
- * swap, 78 of 80 ACTIVE facts fell out of the semantic leg and retrieval degraded to lexical+entity
9
- * with no error anywhere — the store's open-time warning now says so, and this module is what
10
- * repairs it without the operator having to know `vectors --fix` exists.
5
+ * Changing the embedding space (default model, width, pooling, normalization, input window, weights)
6
+ * is a DATA MIGRATION, not a config tweak: every persisted vector still decodes, but in another
7
+ * model's coordinates, so the semantic leg must not serve it. Measured on the real library after the
8
+ * 512→768 default-model swap, 78 of 80 ACTIVE facts fell out of the semantic leg and retrieval
9
+ * degraded to lexical+entity with no error anywhere — the stores' open-time warning now says so, and
10
+ * this module is what repairs it without the operator having to know `vectors --fix` exists.
11
11
  *
12
- * It sits BEHIND the startup gate (`awaitStartupGate`, see index.ts): the model warm and this first
13
- * batch must not land in the boot window (DESIGN §20.14), and the tokenizer/model are the expensive
14
- * resources the gate exists to move out. The loop itself lives in the store
15
- * (`MemoryStore.migrateVectors`), which owns the batch size, the per-batch error handling and the
16
- * event-loop yield; this module owns the LOGGING (start / progress / end) and the lifecycle
17
- * (`shouldStop` = plugin disposed or runtime closed).
12
+ * The FLOW lives in the engine, once, for both stores (`@avantf/mem`'s `store/vector_repair.ts`:
13
+ * batch size, event-loop yield, stop / resume / no-progress rules, the `semantic.auto_migrate`
14
+ * decision and the four store-named log kinds). It is driven for BOTH stores — memory and knowledge
15
+ * — in one pass, because one embedding space is configured for the whole runtime: the knowledge
16
+ * store used to be left behind, silently, with only a manual `kb_reindex` able to fix it.
18
17
  *
19
- * Deliberately no new state in this file: what still needs migrating is derived from the database on
20
- * every pass, which is exactly what makes the migration resumable across a restart.
18
+ * This module owns only the process LIFECYCLE: one start, one stop, and "never an unhandled
19
+ * rejection". It sits BEHIND the startup gate (`awaitStartupGate`, see index.ts): the model warm and
20
+ * this first batch must not land in the boot window (DESIGN §20.14).
21
+ *
22
+ * Deliberately no state: what still needs migrating is derived from the databases on every pass —
23
+ * and the adapters are created ONCE so the shared flow's once-per-process `auto_migrate` warning is
24
+ * genuinely once per process, not once per heartbeat.
21
25
  */
22
26
  import { type AvantfRuntime } from '../engine/mem/index.js';
23
27
  import type { AvantfLogger } from '../engine/mem-contract/index.js';
24
28
  export interface VectorMigrationHandle {
25
29
  /**
26
- * Run one migration pass. Quiet no-op when the store is already current, when a pass is already
30
+ * Run one migration pass. Quiet no-op when both stores are already current, when a pass is already
27
31
  * running, or after {@link stop}. Failures never escape: they are logged and left for the next
28
32
  * heartbeat to retry.
29
33
  */
@@ -38,7 +42,7 @@ export declare function createVectorMigration(opts: {
38
42
  logger: AvantfLogger;
39
43
  /** False once the plugin's fiber is disposed (profile reload / unload). */
40
44
  isActive: () => boolean;
41
- /** Rows per batch; the store's `DEFAULT_VECTOR_MIGRATION_BATCH` when omitted. */
45
+ /** Rows per batch; the engine's `DEFAULT_VECTOR_MIGRATION_BATCH` when omitted. */
42
46
  batchSize?: number;
43
47
  }): VectorMigrationHandle;
44
48
  //# sourceMappingURL=vectorMigration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vectorMigration.d.ts","sourceRoot":"","sources":["../../src/vectorMigration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAA;IACb,wFAAwF;IACxF,IAAI,IAAI,IAAI,CAAA;IACZ,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,EAAE,EAAE,aAAa,CAAA;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,OAAO,CAAA;IACvB,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,qBAAqB,CAuExB"}
1
+ {"version":3,"file":"vectorMigration.d.ts","sourceRoot":"","sources":["../../src/vectorMigration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,KAAK,IAAI,IAAI,CAAA;IACb,wFAAwF;IACxF,IAAI,IAAI,IAAI,CAAA;IACZ,wCAAwC;IACxC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE;IAC1C,EAAE,EAAE,aAAa,CAAA;IACjB,MAAM,EAAE,YAAY,CAAA;IACpB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,OAAO,CAAA;IACvB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,qBAAqB,CAiCxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avantf/dsh-mem",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "avantf-mem DSH native Cordis plugin: host service + tools + RPC + client tabs 记忆/知识",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -78,10 +78,10 @@
78
78
  },
79
79
  "devDependencies": {
80
80
  "@avantf/dsh-plugin-base": ">=0.3.0 <1.0.0",
81
- "@avantf/mem": "0.6.0",
82
- "@avantf/mem-contract": "0.6.0",
83
- "@avantf/mem-convert": "0.6.0",
84
- "@avantf/mem-provision": "0.6.0",
81
+ "@avantf/mem": "0.6.1",
82
+ "@avantf/mem-contract": "0.6.1",
83
+ "@avantf/mem-convert": "0.6.1",
84
+ "@avantf/mem-provision": "0.6.1",
85
85
  "@types/node": "^22.0.0",
86
86
  "@types/react": "^18.3.0",
87
87
  "lightningcss": "^1.32.0",