gm-skill 2.0.1561 → 2.0.1563

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
@@ -22,7 +22,7 @@ Skills encode environment-specific constraints that override general knowledge.
22
22
 
23
23
  # Architecture & Philosophy
24
24
 
25
- This repo IS the published `gm-skill` npm package: repo root = package root, no factory, no build step generating a separate output dir. `skills/gm-skill/SKILL.md` is the entry point; orchestration logic lives in rs-plugkit, served on demand via the `instruction` verb. Agent-facing prose (phase instruction text + gate/residual messages) is externalized to an editable bundle in `gm-plugkit/instructions/`, shipped by gm-plugkit and provisioned into `.gm/instructions/<key>.md`; `rs-plugkit/src/prose.rs` serves the bundle entry per key and falls back to the compiled `const` when absent -- so editing prose is a gm-plugkit republish with no Rust rebuild. The bundle .md and the rs-plugkit `src/orchestrator/instructions/<key>.rs` consts are kept byte-aligned by `gm-plugkit/scripts/sync-instruction-consts.mjs` (regenerates each `<key>.rs` as `pub const TEXT` from the .md). Detail in rs-learn (`recall: string-externalization project`).
25
+ This repo IS the published `gm-skill` npm package: repo root = package root, no factory, no build step generating a separate output dir. `skills/gm-skill/SKILL.md` is the entry point; orchestration logic lives in rs-plugkit, served on demand via the `instruction` verb. Agent-facing prose (phase instruction + gate/residual text) is externalized to an editable `gm-plugkit/instructions/` bundle, so editing prose is a gm-plugkit republish with no Rust rebuild. Mechanism (prose.rs per-key fallback to compiled const; sync-instruction-consts.mjs byte-aligns the .md and the rs-plugkit consts) in rs-learn (`recall: string-externalization project`).
26
26
 
27
27
  ## WASM-only
28
28
 
@@ -40,7 +40,7 @@ Agents dispatch verbs by writing `.gm/exec-spool/in/<verb>/<N>.txt` and reading
40
40
 
41
41
  - **Orchestrator verbs**: `instruction`, `transition`, `phase-status`, `mutable-resolve`, `memorize-fire`, `residual-scan`, `auto-recall`.
42
42
  - **Wasm-direct verbs**: fs/kv/exec/fetch/env, recall, codesearch, memorize(+prune), health, filter, full git verb family. Enumeration in rs-learn (`recall: wasm-direct plugkit verbs full list`).
43
- - **memorize-prune**: deletes bad/superseded memories (a wrong recall hit is worse than a miss). `{key}`/`{keys:[...]}` deletes; `{query}` returns review-only candidates to judge before re-dispatching stale keys -- never a blind similarity-delete. Spec in rs-learn (`recall: memorize-prune verb two-mode spec`).
43
+ - **memorize-prune**: prunes bad/superseded memories (`{key}`/`{keys}` deletes; `{query}` returns review-only candidates to judge first). Spec in rs-learn (`recall: memorize-prune verb two-mode spec`).
44
44
  - **git verbs**: git is a first-class spool surface, never a shell command; `git_finalize {message}` is the bundled COMPLETE-phase push surface, `git_push` the only admissible raw push (porcelain-gated, rebase-retry). A git-dominant `bash`/`powershell` body is gated (`deviation.bash-git-bypass`). Per-verb shapes + host_git `.exe` resolution in rs-learn (`recall: git verbs rs-plugkit spool surface`).
45
45
  - **filter**: pure stdout -> compact-stdout transform, in-wasm, no subprocess; pipe raw command output through it before it enters context. Spec in rs-learn (`recall: filter verb rs-plugkit spool spec`).
46
46
 
@@ -132,7 +132,7 @@ Every skill's `allowed-tools:` is reduced to `Skill, Read, Write` (plus the SKIL
132
132
 
133
133
  **rs-learn observability**: learning-pipeline state changes emit `evt:` lines to `.gm/exec-spool/.watcher.log` + gm-log; recall replies carry per-hit scoring fields. Surface + taxonomy + flags in rs-learn (`recall: rs-learn observability taxonomy`).
134
134
 
135
- **Bootstrap contract (skill-init + SKILL.md auto-refresh + project wiring)**: `bootstrapPlugkit`/`ensureReady` initialize wasm hook-free (failures non-fatal), sha256-rewrite stale installed SKILL.md, and seed per-project `CLAUDE.md` (`@AGENTS.md`) + `.gm/next-step.md`; the wiring lives in `gm-plugkit/bootstrap.js::ensureReady` (the consumer-project watcher boot path), not only repo-root `bin`/`lib`. Detail in rs-learn (`recall: skill-initiated bootstrap contract`, `recall: SKILL.md auto-refresh`).
135
+ **Bootstrap contract**: `ensureReady` initializes wasm hook-free, sha256-rewrites a stale installed SKILL.md, and seeds per-project `CLAUDE.md`/`.gm/next-step.md`. Detail in rs-learn (`recall: skill-initiated bootstrap contract`, `recall: SKILL.md auto-refresh`).
136
136
 
137
137
  ## Cascade pipeline
138
138
 
@@ -144,8 +144,6 @@ Three npm packages publish from this repo: `gm-skill` (harness), `gm-plugkit` (b
144
144
 
145
145
  **To update every possible thing**: push to the relevant repo. No manual version bumps, no local cargo builds -- never run `cargo update`/`cargo build` locally, push and let CI build.
146
146
 
147
- **Timeout enforcement**: every `exec_js` dispatch carries a positive `timeoutMs`; the host treats missing or zero as a hard error.
148
-
149
147
  ## Spool-dispatch architecture replaces hooks
150
148
 
151
149
  Orchestration state is tracked via `.gm/` marker files, not hook events; the CLI layer calls `checkDispatchGates()` before tool execution to gate Write/Edit/git. Marker set (`prd.yml, mutables.yml, needs-gm, gm-fired-<sessionId>, residual-check-fired`) + SpoolDispatcher mechanism in rs-learn (`recall: gate enforcement layer`, `recall: spool dispatch gates marker files`).
@@ -156,7 +154,7 @@ Orchestration state is tracked via `.gm/` marker files, not hook events; the CLI
156
154
 
157
155
  **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`).
158
156
 
159
- **The first verb after a genuine multi-minute IDLE is `instruction`, to reset the long-gap clock**: the gate fires on genuine idle only (>300s since the last instruction AND >300s since any verb), so active back-to-back work verbs keep the chain alive without an interleaved `instruction` -- do not inject defensive instruction dispatches between active work. A true wait (version download, overnight, long external CI watch) trips it, and the first verb back is `instruction`. When the wait is self-inflicted and predictable (a blocking `TaskOutput`/`gh run watch`), dispatch `instruction` immediately BEFORE entering the wait, not only after. Mechanism in rs-learn (`recall: first verb after multi-minute wait instruction long-gap`).
157
+ **The first verb after a genuine multi-minute IDLE is `instruction`, to reset the long-gap clock**: the gate fires on genuine idle only (>300s since the last instruction AND >300s since any verb), so active back-to-back work verbs keep the chain alive without an interleaved `instruction` -- do not inject defensive instruction dispatches between active work. A true wait (version download, overnight, long external CI watch) trips it, and the first verb back is `instruction`. When the wait is self-inflicted and predictable (a blocking `TaskOutput`/`gh run watch`), dispatch `instruction` immediately BEFORE entering the wait, not only after. "Work verbs"/"any verb" here means SPOOL dispatches -- platform `Bash`/`Read`/`Edit`/`Grep` do NOT reset the clock, so a long investigation run purely in them (the audit `gmsniff`/`ccsniff` sweep + source reading/editing exceeding 300s) trips a false `mid-chain-stall` even while actively working; interleave a `prd-add` (convert each finding as it emerges per density-grows-along-the-walk) or an `instruction` to keep the clock warm. Mechanism in rs-learn (`recall: first verb after multi-minute wait instruction long-gap`).
160
158
 
161
159
  **A stop-hook firing on a terminal chain does not authorize re-polling**: when a stop-hook fires while already at `phase=COMPLETE` AND `prd_pending_count=0`, re-dispatching `instruction`/`phase-status` to "re-confirm" is a deviation (`deviation.complete-chain-poll`, `instructions/mod.rs`). Two admissible responses: (a) a prose-only turn (COMPLETE is in hand), or (b) genuinely new planned work opened with a FRESH `{"prompt":...}` body (resets phase to PLAN, driven through the skill). Repeatedly answering the same hook is a loop; state the terminal facts once and stop, or open new work.
162
160
 
@@ -164,7 +162,7 @@ Orchestration state is tracked via `.gm/` marker files, not hook events; the CLI
164
162
 
165
163
  ## Spool observability surface
166
164
 
167
- One-shot system-state probe: dispatch `plugkit health` via the file-spool before assuming any component is broken. Three runtime diagnostic files at `.gm/exec-spool/` root (`.status.json`, `.last-session-start.json`, `.bootstrap-error.json`) are readable directly via Read (runtime-data exception). Field enumeration in rs-learn (`recall: plugkit health verb fields`).
165
+ One-shot system-state probe: dispatch `plugkit health` via the file-spool before assuming any component is broken; the runtime diagnostic files at `.gm/exec-spool/` root are readable directly via Read (runtime-data exception). File list + health fields in rs-learn (`recall: spool runtime diagnostic files`, `recall: plugkit health verb fields`).
168
166
 
169
167
  ## Site Build & Documentation
170
168
 
@@ -1 +1 @@
1
- 0.1.645
1
+ 0.1.647
@@ -1 +1 @@
1
- 8380b75df694c28fb73d26a67c1cc184c2157feac4d0b8b252bd0a3aa6020c57 plugkit.wasm
1
+ ec5acd688dae137c8fd18434027015b66b8e9934f651cb8c2ba692eda4153ca6 plugkit.wasm
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1561",
3
+ "version": "2.0.1563",
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": {
@@ -411,6 +411,17 @@ function scanStalledTurns() {
411
411
  }
412
412
  }
413
413
 
414
+ // Every spool dispatch is the agent actively driving the chain, including wasm-direct verbs
415
+ // (recall/codesearch/exec_js/git/fetch) that never reach turnTick. Refresh the open turn's stall
416
+ // clock so a Bash-free stretch of pure wasm-direct verbs does not trip a false mid-chain-stall
417
+ // (the recurring audit-fire own-defect). Never create or split a turn -- that stays turnTick's job.
418
+ function touchActiveTurn(sess) {
419
+ const t = _turns.get(sess || '(no-session)');
420
+ if (!t) return;
421
+ t.lastTs = Date.now();
422
+ t.stallEmitted = false;
423
+ }
424
+
414
425
  let __sessCache = { value: '', mtimeMs: 0, readAt: 0, srcMtimeMs: 0 };
415
426
  function readCurrentSess() {
416
427
  const now = Date.now();
@@ -479,10 +490,14 @@ function logEvent(sub, event, fields) {
479
490
  }
480
491
 
481
492
  function emitOrchestratorEvents(verb, taskBase, resultStr) {
482
- if (!ORCHESTRATOR_VERBS.has(verb)) return;
483
493
  let parsed;
484
- try { parsed = JSON.parse(resultStr); } catch (_) { return; }
485
- if (!parsed || parsed.ok !== true) {
494
+ try { parsed = JSON.parse(resultStr); } catch (_) { parsed = null; }
495
+ if (!ORCHESTRATOR_VERBS.has(verb)) {
496
+ if (parsed && parsed.ok === true) { try { touchActiveTurn(readCurrentSess()); } catch (_) {} }
497
+ return;
498
+ }
499
+ if (!parsed) return;
500
+ if (parsed.ok !== true) {
486
501
  let errData = null;
487
502
  if (parsed && typeof parsed.stdout === 'string' && parsed.stdout.length > 0) {
488
503
  try { errData = JSON.parse(parsed.stdout); } catch (_) {}
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.1561",
3
+ "version": "2.0.1563",
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.645"
20
+ "plugkitVersion": "0.1.647"
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-skill",
3
- "version": "2.0.1561",
3
+ "version": "2.0.1563",
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",