gm-skill 2.0.1528 → 2.0.1530

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
@@ -30,7 +30,7 @@ The plugkit stack runs as a wasm cdylib loaded by `plugkit-wasm-wrapper.js` unde
30
30
 
31
31
  **Every wasm host-import `extern "C"` block carries `#[link(wasm_import_module = "env")]`.** The host provides every possible host fn (host_kv_get/put/query, host_vec_search, host_git, host_log, host_now_ms, host_fs_*, host_env_get, host_exec_js, host_random_fill, ...) under the `env` import module (`plugkit-wasm-wrapper.js` `importObject.env`). A bare `extern "C"` block links only because lenient linkers tolerate the unresolved module; the strict Linux release `rust-lld` in CI errors `undefined symbol: host_*` and Build-WASM fails. This holds in rs-plugkit AND every dep crate linked into the cdylib (rs-learn) AND any sibling that builds wasm (rs-exec, rs-search). The trap: `cargo check` and even `cargo build --release` on a non-Linux host both pass while CI fails -- the linker differs by host, so the only reproduction is a Linux release link; the CI job log is admin-gated, so Build-WASM echoes `::error::` annotations to surface the lld error publicly. Add a host import anywhere and the block carries the attribute or the cascade goes dark. Full incident in rs-learn (`recall: cascade outage wasm import module link`).
32
32
 
33
- **`plugkit-wasm-wrapper.js` is ESM; never use inline `require()` for a node builtin -- import it at module scope.** The wrapper runs under both node and bun, and the supervisor's `resolveRuntime()` prefers bun. Under bun's ESM, `require` is not a global, so an inline `const x = require('crypto'|'net'|'http'|'https'|'child_process')` throws `require is not defined` -- and because those calls sit in `catch(_){}` blocks, the failure is silent: it broke `_ownWrapperSha12` (status.wrapper_sha stayed null, leaving the supervisor wrapper-sha-drift recycle inert), `_wrapperShaAtBoot` and its self-drift-restart, the synthetic-session cwd-hash, and the file-index sha -- all only under the bun watcher, which is why it hid for so long (node-run watchers have `require` via CJS interop). Every node builtin is imported once at the top (`import crypto from 'crypto'`, etc.); inline `require` of a builtin is forbidden. Full incident in rs-learn (`recall: wrapper require not defined under bun`).
33
+ **`plugkit-wasm-wrapper.js` is ESM; import node builtins at module scope, never inline `require()` (throws silently under bun's ESM inside `catch(_){}`).** Full incident in rs-learn (`recall: wrapper require not defined under bun`).
34
34
 
35
35
  **Every single-instance / lock guard is atomic (`fs.openSync(path,'wx')` O_EXCL or atomic-rename), never check-then-act; count plugkit processes by executable Name not command-line substring.** Both are Windows concurrency mechanics whose full incident lives in rs-learn (`recall: supervisor churn TOCTOU atomic guard`).
36
36
 
@@ -1 +1 @@
1
- 0.1.634
1
+ 0.1.635
@@ -1 +1 @@
1
- 7437aa3d4ce3b12aa74d60ba264525b27abc80bfb4f67340d286b6ab7d66e9f1 plugkit.wasm
1
+ eaef35fadc535e11a1e1d2030e8cad3014fd7dd5fc032a79ab5c16ccac44252d plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1528",
3
+ "version": "2.0.1530",
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": {
@@ -453,56 +453,6 @@ function readCurrentSess() {
453
453
 
454
454
  const __lockRejectedEmitAt = new Map();
455
455
 
456
- const UNAMBIGUOUS_CLIENT_EXT_RE = /\.(?:html?|jsx|tsx|vue|svelte|css|scss|sass)$/i;
457
- const AMBIGUOUS_JS_EXT_RE = /\.(?:m?js|cjs|ts)$/i;
458
- const BROWSER_REACHABLE_DIR_RE = /(?:^|\/)(?:site|public|web|www|client|frontend|ui|assets|static|dist|build|docs)\//i;
459
- const NODE_ONLY_DIR_RE = /(?:^|\/)(?:lib|bin|scripts?|gm-plugkit|node_modules|tests?|__tests__|\.gm)\//i;
460
-
461
- function isBrowserRelevantPath(rel, cwd) {
462
- if (UNAMBIGUOUS_CLIENT_EXT_RE.test(rel)) return true;
463
- if (!AMBIGUOUS_JS_EXT_RE.test(rel)) return false;
464
- if (NODE_ONLY_DIR_RE.test(rel)) return false;
465
- if (BROWSER_REACHABLE_DIR_RE.test(rel)) return true;
466
- try {
467
- const dir = path.dirname(path.isAbsolute(rel) ? rel : path.join(cwd, rel));
468
- const sibs = fs.readdirSync(dir);
469
- if (sibs.some(f => /\.html?$/i.test(f))) return true;
470
- } catch (_) {}
471
- return false;
472
- }
473
-
474
- function autoRecordBrowserEditsFromBody(body, cwd, taskBase, verb) {
475
- if (!body || typeof body !== 'string') return;
476
- const BROWSER_EXT_RE = /[\w.\-/\\]+\.(?:html?|tsx?|jsx?|mjs|cjs|vue|svelte|css|scss|sass)\b/gi;
477
- const matches = body.match(BROWSER_EXT_RE);
478
- if (!matches || matches.length === 0) return;
479
- const seen = new Set();
480
- const editsFile = path.join(cwd, '.gm', 'exec-spool', '.turn-browser-edits.json');
481
- let list = [];
482
- try { list = JSON.parse(fs.readFileSync(editsFile, 'utf8')); if (!Array.isArray(list)) list = []; } catch (_) {}
483
- let added = 0;
484
- for (const raw of matches) {
485
- let rel = String(raw).replace(/^["'`(]+|["'`)]+$/g, '').replace(/\\/g, '/');
486
- if (rel.startsWith('http://') || rel.startsWith('https://') || rel.startsWith('//')) continue;
487
- if (rel.includes('node_modules/') || rel.startsWith('.gm/') || rel.includes('/.gm/')) continue;
488
- if (!isBrowserRelevantPath(rel, cwd)) continue;
489
- if (seen.has(rel)) continue;
490
- seen.add(rel);
491
- const abs = path.isAbsolute(rel) ? rel : path.join(cwd, rel);
492
- let st;
493
- try { st = fs.statSync(abs); } catch (_) { continue; }
494
- if (!st.isFile()) continue;
495
- let hash = '';
496
- try { hash = crypto.createHash('sha256').update(fs.readFileSync(abs)).digest('hex').slice(0, 12); } catch (_) {}
497
- const idx = list.findIndex(e => e && e.file === rel);
498
- const entry = { file: rel, ts: Date.now(), hash, source_verb: verb, source_task: taskBase };
499
- if (idx === -1) { list.push(entry); added++; } else { list[idx] = entry; }
500
- }
501
- if (added > 0) {
502
- try { fs.mkdirSync(path.dirname(editsFile), { recursive: true }); fs.writeFileSync(editsFile, JSON.stringify(list)); } catch (_) {}
503
- logEvent('plugkit', 'browser.edits-autorecorded', { verb, task: taskBase, files: list.slice(-added).map(e => e.file), added });
504
- }
505
- }
506
456
 
507
457
  function logEvent(sub, event, fields) {
508
458
  if (process.env.GM_LOG_DISABLE) return;
@@ -3088,10 +3038,6 @@ async function runSpoolWatcher(instance, spoolDir) {
3088
3038
  try { _writeStatusBusy(180000); } catch (_) {}
3089
3039
  }
3090
3040
 
3091
- if (verb === 'memorize-fire' || verb === 'transition' || verb === 'prd-resolve' || verb === 'mutable-resolve') {
3092
- try { autoRecordBrowserEditsFromBody(body, process.cwd(), taskBase, verb); } catch (_) {}
3093
- }
3094
-
3095
3041
  let autoRecallPayload = null;
3096
3042
  if (verb === 'instruction') {
3097
3043
  const sessForRecall = readCurrentSess();
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1528",
3
+ "version": "2.0.1530",
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.634"
20
+ "plugkitVersion": "0.1.635"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1528",
3
+ "version": "2.0.1530",
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",