gm-skill 2.0.1402 → 2.0.1404

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
- 0.1.553
1
+ 0.1.554
@@ -1 +1 @@
1
- c780906b4ca15a51a4a9943fb40759422e42b116af064ada4bc74e0223e41bbc plugkit.wasm
1
+ 575fc6ea9a9cb798bec44776216c6f7af023ac8c3a89fa9a70ddd15bfa88911c plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1402",
3
+ "version": "2.0.1404",
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": {
@@ -288,29 +288,39 @@ function mergeAutoRecallIntoInstructionResponse(resultStr, autoRecall) {
288
288
  return JSON.stringify(parsed);
289
289
  }
290
290
 
291
+ function endTurn(sess, t, idleSpanned) {
292
+ logEvent('plugkit', 'turn.end', {
293
+ sess, turn_idx: t.idx, dur_ms: t.lastTs - t.startTs,
294
+ dispatches: t.dispatches, verbs: Object.fromEntries(t.verbs),
295
+ phases_walked: [...t.phases], deviations: t.deviations,
296
+ ended_in_phase: t.lastPhase || null,
297
+ idle_spanned: !!idleSpanned,
298
+ });
299
+ }
300
+
291
301
  function turnTick(sess, verb, taskBase, phase) {
292
302
  const key = sess || '(no-session)';
293
303
  const now = Date.now();
294
304
  let t = _turns.get(key);
295
- if (verb === 'instruction') {
296
- if (t && (now - t.lastTs) > TURN_IDLE_MS) {
297
- logEvent('plugkit', 'turn.end', {
298
- sess, turn_idx: t.idx, dur_ms: t.lastTs - t.startTs,
299
- dispatches: t.dispatches, verbs: Object.fromEntries(t.verbs),
300
- phases_walked: [...t.phases], deviations: t.deviations,
301
- ended_in_phase: t.lastPhase || null,
302
- });
303
- t = null;
304
- }
305
- if (!t) {
306
- const idx = ((_turns.get(key + ':lastIdx') || 0) + 1);
307
- _turns.set(key + ':lastIdx', idx);
308
- t = { idx, startTs: now, lastTs: now, dispatches: 0, verbs: new Map(), phases: new Set(), deviations: 0, lastPhase: phase };
309
- _turns.set(key, t);
310
- logEvent('plugkit', 'turn.start', { sess, turn_idx: idx, phase: phase || null });
311
- }
305
+ // Any verb arriving after an idle gap closes the stale turn — not just instruction.
306
+ // Otherwise a non-instruction verb (prd-add, mutable-resolve, transition) landing
307
+ // after an overnight sleep stamps t.lastTs forward without splitting, and dur_ms
308
+ // (lastTs - startTs) balloons to wall-clock-with-sleep instead of active work time.
309
+ if (t && (now - t.lastTs) > TURN_IDLE_MS) {
310
+ endTurn(sess, t, true);
311
+ _turns.delete(key);
312
+ t = null;
313
+ }
314
+ if (!t) {
315
+ // Only an instruction dispatch opens a new turn; a stray non-instruction verb after
316
+ // idle is recorded against no turn (the next instruction starts the real turn).
317
+ if (verb !== 'instruction') return;
318
+ const idx = ((_turns.get(key + ':lastIdx') || 0) + 1);
319
+ _turns.set(key + ':lastIdx', idx);
320
+ t = { idx, startTs: now, lastTs: now, dispatches: 0, verbs: new Map(), phases: new Set(), deviations: 0, lastPhase: phase };
321
+ _turns.set(key, t);
322
+ logEvent('plugkit', 'turn.start', { sess, turn_idx: idx, phase: phase || null });
312
323
  }
313
- if (!t) return;
314
324
  t.lastTs = now;
315
325
  t.dispatches++;
316
326
  t.verbs.set(verb, (t.verbs.get(verb) || 0) + 1);
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1402",
3
+ "version": "2.0.1404",
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.553"
20
+ "plugkitVersion": "0.1.554"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1402",
3
+ "version": "2.0.1404",
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",