gm-skill 2.0.2502 → 2.0.2503

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
- 09cc6e9455e21eaffd40f86d32471f1487d0e6f034d36de93016b52bedac0793 plugkit-slim.wasm
1
+ be3e9b6f26f95cb356628bafa84532dbd209182cfa3b40039e9d9104bdcbe7c9 plugkit-slim.wasm
@@ -1 +1 @@
1
- 0.1.1192
1
+ 0.1.1194
@@ -1 +1 @@
1
- cb16c2345dfca7a309227741af44431281122616b0bfac87f4be8da58f2ed354 plugkit.wasm
1
+ 8c5318d25e2a6710bb3992155f9c76460da9aed04247c4ebf9aaa502bc6b62a8 plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.2502",
3
+ "version": "2.0.2503",
4
4
  "description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform wasm, verifies SHA256, and launches agentplug-runner (the native wasm host) as the spool watcher daemon.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1 +1 @@
1
- 09cc6e9455e21eaffd40f86d32471f1487d0e6f034d36de93016b52bedac0793 plugkit-slim.wasm
1
+ be3e9b6f26f95cb356628bafa84532dbd209182cfa3b40039e9d9104bdcbe7c9 plugkit-slim.wasm
@@ -1 +1 @@
1
- 0.1.1192
1
+ 0.1.1194
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.2502",
3
+ "version": "2.0.2503",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -17,5 +17,5 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "plugkitVersion": "0.1.1192"
20
+ "plugkitVersion": "0.1.1194"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.2502",
3
+ "version": "2.0.2503",
4
4
  "description": "Canonical universal harness — AI-native software engineering via skill-driven orchestration; bootstraps plugkit for task execution and session isolation. Install in any AI coding agent host.",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@
13
13
  // namespace|text content-hash key scheme gm's memorize verb uses.
14
14
  //
15
15
  // Usage:
16
- // node scripts/migrate-memory-to-tencentdb.mjs --project <path> [--namespace default] [--dry-run]
16
+ // node scripts/migrate-memory-to-tencentdb.mjs --project <path> [--namespace default] [--dry-run] [--archive]
17
17
  //
18
18
  // Requires the target project to have a live gm-plugkit spool watcher
19
19
  // (boots one if .gm/exec-spool is missing, same as any other gm session)
@@ -21,13 +21,29 @@
21
21
  // listed in gm.config.json -- this script drives the memorize verb, never
22
22
  // writes .gm/tencentdb-memory files directly, so the write always goes
23
23
  // through the same dedup/embed/index path a live agent dispatch would.
24
+ //
25
+ // This is the batch/CLI-driven migration path -- useful for migrating a
26
+ // whole namespace outside a live agent session, and it applies the
27
+ // derivable-state discard filter below (the verb-based path does not).
28
+ // The `tencentdb-memory-import` verb (rs-plugkit's
29
+ // wasm_dispatch/verbs.rs::tencentdb_memory_import) is the single-dispatch
30
+ // alternative for use from within an already-running agent session; both
31
+ // write through the same tencentdb_memory::write_cfg path and share the
32
+ // same --archive/archive_source opt-in archiving behavior (see below).
33
+ //
34
+ // --archive (default off, matches the verb's archive_source default) moves
35
+ // each successfully-migrated source .md file to
36
+ // .gm/memories-archive-tencentdb/<namespace>/<filename> instead of leaving
37
+ // it in place -- opt-in because the default stays a pure one-way copy (the
38
+ // old backend keeps working for any namespace not also switched over).
24
39
 
25
- import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
26
- import { join } from "node:path";
40
+ import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, renameSync } from "node:fs";
41
+ import { join, dirname } from "node:path";
27
42
  import { execFileSync } from "node:child_process";
28
43
 
29
44
  const args = process.argv.slice(2);
30
45
  const DRY_RUN = args.includes("--dry-run");
46
+ const ARCHIVE = args.includes("--archive");
31
47
  const projectIdx = args.indexOf("--project");
32
48
  const PROJECT = projectIdx >= 0 ? args[projectIdx + 1] : process.cwd();
33
49
  const nsIdx = args.indexOf("--namespace");
@@ -37,6 +53,7 @@ const SPOOL_IN = join(PROJECT, ".gm", "exec-spool", "in");
37
53
  const SPOOL_OUT = join(PROJECT, ".gm", "exec-spool", "out");
38
54
  const MEMORIES_DIR = join(PROJECT, ".gm", "memories");
39
55
  const RS_LEARN_DB = join(PROJECT, ".gm", "rs-learn.db");
56
+ const ARCHIVE_DIR = join(PROJECT, ".gm", "memories-archive-tencentdb", NAMESPACE);
40
57
 
41
58
  // Mirrors rs-plugkit's orchestrator/memorize.rs::is_derivable_state exactly
42
59
  // (pattern list kept in sync by hand -- both are small and rarely change;
@@ -143,6 +160,7 @@ function main() {
143
160
  let kept = 0;
144
161
  let discarded = 0;
145
162
  let errored = 0;
163
+ let archived = 0;
146
164
  const discardedSamples = [];
147
165
 
148
166
  for (const path of files) {
@@ -169,6 +187,16 @@ function main() {
169
187
  const resp = dispatchVerb("memorize", { text: parsed.text, namespace: NAMESPACE, kind: "l0" });
170
188
  if (resp.ok) {
171
189
  kept++;
190
+ if (ARCHIVE) {
191
+ try {
192
+ const dest = join(ARCHIVE_DIR, path.slice(path.lastIndexOf("/") + 1));
193
+ mkdirSync(dirname(dest), { recursive: true });
194
+ renameSync(path, dest);
195
+ archived++;
196
+ } catch (e) {
197
+ console.log(`[migrate] WARN: migrated ${parsed.key} but failed to archive source ${path}: ${e.message}`);
198
+ }
199
+ }
172
200
  } else {
173
201
  errored++;
174
202
  console.log(`[migrate] ERROR migrating ${parsed.key}: ${resp.error || JSON.stringify(resp)}`);
@@ -179,7 +207,7 @@ function main() {
179
207
  }
180
208
  }
181
209
 
182
- console.log(`[migrate] summary: kept=${kept} discarded=${discarded} errored=${errored} total=${files.length}`);
210
+ console.log(`[migrate] summary: kept=${kept} discarded=${discarded} errored=${errored} archived=${archived} total=${files.length}`);
183
211
  if (discardedSamples.length) {
184
212
  console.log(`[migrate] sample of discarded entries (up to 10):`);
185
213
  for (const s of discardedSamples) {
@@ -71,23 +71,40 @@ evolution). This is for a project that already has gm-native memories
71
71
  namespace opts into the Tencent-compatible backend, so recall doesn't go
72
72
  cold on the switch.
73
73
 
74
- Dispatch the `tencentdb-memory-import` verb: `{"source_namespace":
75
- "default", "dest_namespace": "<routed-namespace>", "kind": "l1"}`. It reads
76
- every `.md` doc in the source namespace, re-embeds through gm's own
77
- 384-dim pipeline, and writes into the destination via
78
- `tencentdb_memory::write_cfg`. It refuses up front unless
79
- `dest_namespace`'s resolved `memory.tencentdb_backend.vectors_db_dims` is
80
- exactly `384` -- gm's embedder cannot produce vectors at any other width,
81
- and a namespace configured for externally-embedded 768-dim content (the
82
- default) cannot safely receive them (recall queries that namespace through
83
- the project-resolved dim, not a per-import override, so a dim mismatch
84
- there is a real defect, not a formality). A project wanting both kinds of
74
+ Two ways to run this migration -- same underlying write path
75
+ (`tencentdb_memory::write_cfg`), pick whichever fits the situation:
76
+
77
+ - **From within a live agent session**: dispatch the
78
+ `tencentdb-memory-import` verb: `{"source_namespace": "default",
79
+ "dest_namespace": "<routed-namespace>", "kind": "l1"}`. It reads every
80
+ `.md` doc in the source namespace and re-embeds through gm's own 384-dim
81
+ pipeline.
82
+ - **Batch/CLI, outside an agent session**: `node
83
+ scripts/migrate-memory-to-tencentdb.mjs --project <path> --namespace
84
+ <ns> [--dry-run] [--archive]`. Same write path, but also applies the
85
+ derivable-state discard filter (git-log-derivable facts, dated audit
86
+ entries, historical framing) the verb does not -- prefer this for a bulk
87
+ migration where discarding superfluous content matters, and the verb for
88
+ a single dispatch from an already-running session.
89
+
90
+ Both refuse up front unless the destination namespace's resolved
91
+ `memory.tencentdb_backend.vectors_db_dims` is exactly `384` -- gm's
92
+ embedder cannot produce vectors at any other width, and a namespace
93
+ configured for externally-embedded 768-dim content (the default) cannot
94
+ safely receive them (recall queries that namespace through the
95
+ project-resolved dim, not a per-import override, so a dim mismatch there
96
+ is a real defect, not a formality). A project wanting both kinds of
85
97
  content needs two separate `tencentdb_backend`-routed namespaces, each at
86
98
  its own dim.
87
99
 
88
- This is a one-way copy, not a move: the source `.md` files and their
89
- `rssearch_vectors` index rows are untouched, so the default backend keeps
90
- working for any namespace not also switched over.
100
+ By default this is a one-way copy, not a move: the source `.md` files and
101
+ their `rssearch_vectors` index rows are left untouched, so the default
102
+ backend keeps working for any namespace not also switched over. Pass
103
+ `archive_source: true` (verb) or `--archive` (script) to opt into moving
104
+ each successfully-migrated source file to
105
+ `.gm/memories-archive-tencentdb/<namespace>/<filename>` instead of leaving
106
+ it in place -- content stays inspectable, but the live `.gm/memories/`
107
+ corpus no longer duplicates what the new backend now serves.
91
108
 
92
109
  ## Verification (do this before declaring setup done)
93
110