gm-skill 2.0.1621 → 2.0.1623

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/AGENTS.md CHANGED
@@ -160,7 +160,7 @@ Orchestration state is tracked via `.gm/` marker files, not hook events; the CLI
160
160
 
161
161
  **Dead-watcher recovery uses `bun x gm-plugkit@latest spool`, never direct-node boot** (mechanism in rs-learn: `recall: dead-watcher recovery bun x not direct-node`).
162
162
 
163
- **Apparent tooling failure is mechanical self-recovery, NEVER a question for the user and never an a/b-test/blind-restart.** "The spooler is not working" / a missing spool response / a stale watcher is the agent's own job to fix: honor a future `busy_until` (wait), else boot the watcher and re-dispatch; on a transient boot hiccup (`FailedToOpenSocket`) retry `@latest`, never the non-`@latest` cache (stale). The spooler is sound by construction -- `.status.json` is written atomically (temp+rename, `atomicWriteJson`) and every long verb advertises `busy_until` -- so a transient unreadable/stale read is a respawn/idle-teardown window to boot through, not a broken tool; asking the user to do what a verb can do is a paper-spirit violation. Debug the live page via `window.*` globals + the `browser` verb's `page.evaluate` as a process of elimination, never variant-after-variant a/b testing. This IS the core gm method on every surface including its own tooling: record all mutables, eliminate each by witness, discover more, keep going.
163
+ **Apparent tooling failure is mechanical self-recovery, NEVER a question for the user and never an a/b-test/blind-restart.** A missing spool response / stale watcher is the agent's own job: honor a future `busy_until` else boot the watcher and re-dispatch -- the spooler is sound by construction, so asking the user to do what a verb can do is a paper-spirit violation. Recovery mechanics (atomic `.status.json`, `FailedToOpenSocket` retry, debug-via-`window.*`-globals) in rs-learn (`recall: spooler self-recovery mechanics`).
164
164
 
165
165
  **Process-of-elimination is the debugging paradigm EVERYWHERE, and manual real-services witness is the verification paradigm EVERYWHERE.** Every debug -- code, wasm, cascade, browser, the spooler itself -- enumerates candidate causes as mutables and eliminates each by a witness read against real input (`exec_js`/`codesearch`/`Read`/`browser page.evaluate`), each elimination revealing the next, never guess-and-restart/a-b-test/shotgun. Every verification is manual labour against the real thing -- the single mock-free `test.js`, the live page, the real service, the live wasm -- never an automated unit/mock suite standing in for the real-services witness (the conventional-testing tell-tale gm replaces). Stated in `instructions/execute.md` (the served EXECUTE prose) so it reaches every LLM in-session.
166
166
 
@@ -178,5 +178,7 @@ One-shot system-state probe: dispatch `plugkit health` via the file-spool before
178
178
 
179
179
  Site build + landing render is single-surface detail, fully drained to rs-learn (`recall: gm site build details`).
180
180
 
181
+ **The site consumes the `anentrypoint-design` SDK pro-rata, never overriding it.** `site/theme.mjs` loads the SDK at runtime (`unpkg.com/anentrypoint-design@latest`) and the local `<style>` carries ONLY render-mode plumbing (flatspace html-class toggles `article-flow`/`landing-cap`, the crumb media query) plus site article-layout rhythm that is not an SDK component -- never a themed visual component. Every graphic-design change (a token, a component's look, TOC/cli/panel/card/callout styling) is made IN the SDK repo (`../anentrypoint-design`, GitHub `AnEntrypoint/design`, npm `anentrypoint-design`) as a token-only sheet and published; the site picks it up via `@latest`. A new local CSS rule that styles a visual component is a deviation -- it belongs in the SDK. SDK component sheets are lint-gated literal-free (every color a `var(--token)`); the SDK build prefixes all selectors with the `.ds-247420` scope. Mechanism in rs-learn (`recall: design SDK pro-rata consumption`).
182
+
181
183
 
182
184
  @.gm/next-step.md
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1621",
3
+ "version": "2.0.1623",
4
4
  "description": "Bootstrap and daemon-spawn tool for gm plugkit binary. Downloads the correct platform binary, verifies SHA256, and starts the spool watcher daemon. Includes plugkit-wasm-wrapper for WASM-based spool watching.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -2277,13 +2277,14 @@ function readInstanceVersion(instance) {
2277
2277
  const result = fn();
2278
2278
  let ptr, len;
2279
2279
  if (typeof result === 'bigint') {
2280
- ptr = Number(result & 0xffffffffn);
2281
- len = Number(result >> 32n);
2280
+ const u = BigInt.asUintN(64, result); // normalize the i64 to unsigned before splitting (signed-ptr fix)
2281
+ ptr = Number(u & 0xffffffffn);
2282
+ len = Number(u >> 32n);
2282
2283
  } else {
2283
- ptr = Number(result) & 0xffffffff;
2284
+ ptr = Number(result) >>> 0; // unsigned 32-bit
2284
2285
  len = 0;
2285
2286
  }
2286
- const buf = new Uint8Array(instance.exports.memory.buffer, ptr, 64);
2287
+ const buf = new Uint8Array(instance.exports.memory.buffer, ptr, 64); // fresh buffer (post fn() grow)
2287
2288
  if (len === 0) {
2288
2289
  let end = 0;
2289
2290
  while (end < buf.length && buf[end] !== 0) end++;
@@ -3274,20 +3275,17 @@ async function runSpoolWatcher(instance, spoolDir) {
3274
3275
  }
3275
3276
  }
3276
3277
 
3277
- const verbPtr = instance.exports.plugkit_alloc(verbBytes.length);
3278
- const bodyPtr = instance.exports.plugkit_alloc(bodyBytes.length);
3279
- new Uint8Array(instance.exports.memory.buffer, verbPtr, verbBytes.length).set(verbBytes);
3280
- new Uint8Array(instance.exports.memory.buffer, bodyPtr, bodyBytes.length).set(bodyBytes);
3278
+ // writeWasmInput re-reads memory.buffer fresh after each alloc (detached-buffer write fix).
3279
+ const verbPtr = writeWasmInput(instance, verbBytes, `spool-dispatch:${verb}.verb`);
3280
+ const bodyPtr = writeWasmInput(instance, bodyBytes, `spool-dispatch:${verb}.body`);
3281
3281
 
3282
3282
  writeVerbActive(verb, taskBase);
3283
3283
  const result = dispatch(verbPtr, verbBytes.length, bodyPtr, bodyBytes.length);
3284
3284
  clearVerbActive();
3285
3285
 
3286
- const ptr = Number(result & 0xffffffffn);
3287
- const len = Number(result >> 32n);
3288
- guardWasmRange(instance.exports.memory.buffer, ptr, len, `spool-dispatch:${verb}`);
3289
- const resultBytes = new Uint8Array(instance.exports.memory.buffer, ptr, len);
3290
- let resultStr = new TextDecoder().decode(resultBytes);
3286
+ // decodeWasmResult normalizes the i64 (BigInt.asUintN), re-reads the buffer FRESH (post-grow),
3287
+ // guards the range, AND frees the result ptr -- so the (ptr,len) free below is dropped.
3288
+ let resultStr = decodeWasmResult(instance, result, `spool-dispatch:${verb}`);
3291
3289
 
3292
3290
  if (autoRecallPayload) {
3293
3291
  resultStr = mergeAutoRecallIntoInstructionResponse(resultStr, autoRecallPayload);
@@ -3340,7 +3338,7 @@ async function runSpoolWatcher(instance, spoolDir) {
3340
3338
 
3341
3339
  try { instance.exports.plugkit_free(verbPtr, verbBytes.length); } catch (_) {}
3342
3340
  try { instance.exports.plugkit_free(bodyPtr, bodyBytes.length); } catch (_) {}
3343
- try { instance.exports.plugkit_free(ptr, len); } catch (_) {}
3341
+ // (the result ptr is freed inside decodeWasmResult above)
3344
3342
 
3345
3343
  try { if (fs.existsSync(filePath)) fs.unlinkSync(filePath); } catch (_) {}
3346
3344
  unmarkProcessed(key);
@@ -3988,15 +3986,12 @@ if (_isCliEntry) (async () => {
3988
3986
  const dispatch = instance.exports.dispatch_verb;
3989
3987
  const verbBytes = new TextEncoder().encode(verb);
3990
3988
  const bodyBytes = new TextEncoder().encode(body);
3991
- const verbPtr = instance.exports.plugkit_alloc(verbBytes.length);
3992
- const bodyPtr = instance.exports.plugkit_alloc(bodyBytes.length);
3993
- new Uint8Array(instance.exports.memory.buffer, verbPtr, verbBytes.length).set(verbBytes);
3994
- new Uint8Array(instance.exports.memory.buffer, bodyPtr, bodyBytes.length).set(bodyBytes);
3989
+ const verbPtr = writeWasmInput(instance, verbBytes, `cli-dispatch:${verb}.verb`);
3990
+ const bodyPtr = writeWasmInput(instance, bodyBytes, `cli-dispatch:${verb}.body`);
3995
3991
  const result = dispatch(verbPtr, verbBytes.length, bodyPtr, bodyBytes.length);
3996
- const ptr = Number(result & 0xffffffffn);
3997
- const len = Number(result >> 32n);
3998
- guardWasmRange(instance.exports.memory.buffer, ptr, len, `cli-dispatch:${verb}`);
3999
- const out = new TextDecoder().decode(new Uint8Array(instance.exports.memory.buffer, ptr, len));
3992
+ const out = decodeWasmResult(instance, result, `cli-dispatch:${verb}`); // normalized i64 + fresh buffer
3993
+ try { instance.exports.plugkit_free(verbPtr, verbBytes.length); } catch (_) {}
3994
+ try { instance.exports.plugkit_free(bodyPtr, bodyBytes.length); } catch (_) {}
4000
3995
  process.stdout.write(out);
4001
3996
  let parsed;
4002
3997
  try { parsed = JSON.parse(out); } catch (_) { parsed = null; }
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1621",
3
+ "version": "2.0.1623",
4
4
  "description": "Spool-dispatch orchestration engine with unified state machine, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1621",
3
+ "version": "2.0.1623",
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",