gm-skill 2.0.1502 → 2.0.1503

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,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1502",
3
+ "version": "2.0.1503",
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": {
@@ -2304,7 +2304,30 @@ async function runSpoolWatcher(instance, spoolDir) {
2304
2304
  child.unref();
2305
2305
  try { logEvent('plugkit', 'gm-plugkit.self-stale-respawn', { running_version: own, latest_version: latest }); } catch (_) {}
2306
2306
  try { fs.writeFileSync(path.join(spoolDir, '.shutdown-reason.json'), JSON.stringify({ reason: 'gm-plugkit-self-stale', ts: Date.now(), pid: process.pid, running_version: own, latest_version: latest })); } catch (_) {}
2307
- setTimeout(() => process.exit(0), 2000);
2307
+ // Wait for the replacement's fresh heartbeat before exiting (mirror the
2308
+ // version-drift path) instead of a blind 2s exit: the gm-plugkit download can
2309
+ // take many seconds, and exiting early lets the supervisor relaunch the SAME
2310
+ // stale version before the new one lands, so the update never sticks.
2311
+ const myPid = process.pid;
2312
+ const respawnDeadline = Date.now() + 90000;
2313
+ const exitSelfStale = () => { try { process.exit(0); } catch (_) {} };
2314
+ const pollSelfStaleReplacement = () => {
2315
+ try {
2316
+ const st = JSON.parse(fs.readFileSync(STATUS_PATH_FOR_TEARDOWN, 'utf8'));
2317
+ const freshHeartbeat = st && st.ts && (Date.now() - st.ts) < 15000;
2318
+ const differentProc = st && st.pid && st.pid !== myPid;
2319
+ if (freshHeartbeat && differentProc) {
2320
+ try { logEvent('plugkit', 'gm-plugkit.self-stale-respawn-confirmed', { old_pid: myPid, new_pid: st.pid, new_version: st.version, latest_version: latest }); } catch (_) {}
2321
+ return exitSelfStale();
2322
+ }
2323
+ } catch (_) {}
2324
+ if (Date.now() > respawnDeadline) {
2325
+ try { logEvent('plugkit', 'gm-plugkit.self-stale-respawn-timeout', { old_pid: myPid, waited_ms: 90000 }); } catch (_) {}
2326
+ return exitSelfStale();
2327
+ }
2328
+ setTimeout(pollSelfStaleReplacement, 1500);
2329
+ };
2330
+ setTimeout(pollSelfStaleReplacement, 3000);
2308
2331
  } catch (e) {
2309
2332
  console.error(`[plugkit-wasm] failed to spawn replacement on self-stale: ${e.message}`);
2310
2333
  }
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1502",
3
+ "version": "2.0.1503",
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.1502",
3
+ "version": "2.0.1503",
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",