gm-qwen 2.0.801 → 2.0.803

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/bin/bootstrap.js CHANGED
@@ -17,6 +17,27 @@ const LOCK_STALE_MS = 5 * 60 * 1000;
17
17
 
18
18
  function log(msg) {
19
19
  try { process.stderr.write(`[plugkit-bootstrap] ${msg}\n`); } catch (_) {}
20
+ try { obsEvent('bootstrap', 'log', { msg }); } catch (_) {}
21
+ }
22
+
23
+ function obsEvent(subsystem, event, fields) {
24
+ if (process.env.GM_LOG_DISABLE) return;
25
+ try {
26
+ const root = process.env.GM_LOG_DIR
27
+ || path.join(os.homedir(), '.claude', 'gm-log');
28
+ const day = new Date().toISOString().slice(0, 10);
29
+ const dir = path.join(root, day);
30
+ fs.mkdirSync(dir, { recursive: true });
31
+ const line = JSON.stringify({
32
+ ts: new Date().toISOString(),
33
+ sub: subsystem,
34
+ event,
35
+ pid: process.pid,
36
+ sess: process.env.CLAUDE_SESSION_ID || process.env.GM_SESSION_ID || '',
37
+ ...fields,
38
+ });
39
+ fs.appendFileSync(path.join(dir, `${subsystem}.jsonl`), line + '\n');
40
+ } catch (_) {}
20
41
  }
21
42
 
22
43
  function platformKey() {
@@ -352,7 +373,7 @@ function resolveCachedBinary(opts) {
352
373
  return null;
353
374
  }
354
375
 
355
- module.exports = { bootstrap, resolveCachedBinary, resolveCachedRtk, platformKey, binaryName, rtkBinaryName, cacheRoot };
376
+ module.exports = { bootstrap, resolveCachedBinary, resolveCachedRtk, platformKey, binaryName, rtkBinaryName, cacheRoot, obsEvent };
356
377
 
357
378
  if (require.main === module) {
358
379
  bootstrap({ silent: false })
package/bin/plugkit.js CHANGED
@@ -3,7 +3,7 @@
3
3
  const { spawn, spawnSync } = require('child_process');
4
4
  const path = require('path');
5
5
  const fs = require('fs');
6
- const { bootstrap, resolveCachedBinary, resolveCachedRtk } = require('./bootstrap');
6
+ const { bootstrap, resolveCachedBinary, resolveCachedRtk, obsEvent } = require('./bootstrap');
7
7
 
8
8
  const dir = __dirname;
9
9
 
@@ -24,11 +24,14 @@ async function resolveBinary() {
24
24
  async function main() {
25
25
  const args = process.argv.slice(2);
26
26
  const isHook = args[0] === 'hook';
27
+ const startedAt = Date.now();
28
+ obsEvent('plugkit_wrapper', 'invoke', { argv: args.slice(0, 4), is_hook: isHook });
27
29
  let bin;
28
30
  try {
29
31
  bin = await resolveBinary();
30
32
  } catch (err) {
31
33
  process.stderr.write(`[plugkit] bootstrap failed: ${err.message}\n`);
34
+ obsEvent('plugkit_wrapper', 'bootstrap_failed', { err: err.message });
32
35
  const legacy = legacyFallback();
33
36
  if (legacy) { bin = legacy; }
34
37
  else if (isHook) { process.exit(0); }
@@ -49,6 +52,7 @@ async function main() {
49
52
  process.stdin.on('error', () => process.exit(1));
50
53
  } else {
51
54
  const result = spawnSync(bin, args, { stdio: 'inherit', windowsHide: true, env });
55
+ obsEvent('plugkit_wrapper', 'exit', { dur_ms: Date.now() - startedAt, code: result.status ?? -1 });
52
56
  process.exit(result.status ?? 1);
53
57
  }
54
58
  }
@@ -1,6 +1,6 @@
1
- 6d21821f6509bdbafbfd5864b4b9e110bffd8ee3cb3c9ab5f74469dcd299574f plugkit-win32-x64.exe
2
- c1b6fe884fa50fb1adaebf826e70a2dd7ba47d6d82e7324d0b0bbf2855b3e831 plugkit-win32-arm64.exe
3
- 4795c9893ead08ab5ef722e9c23d8a677982a064e4ec533c6227ebc009d2b793 plugkit-darwin-x64
4
- e4661868e46c7999c118b852d818d7a6742c84a416768a7eb74f2e6000c4c58c plugkit-darwin-arm64
5
- 48d2348129fb6ab5b4b36687a408315efdec09fad95c0da665aedec2087d0ad5 plugkit-linux-x64
6
- 32b89d2e249548561205e17c3f2dc328aac048a3f77375de058050b392b88ac5 plugkit-linux-arm64
1
+ 4a4201ed31f9338e23b81e78f9da97f8eaa568ac1fe88329f258680d95f102cf plugkit-win32-x64.exe
2
+ 10dbe0668558e1a0b98c40f6649f317d97d3b99a180d180b65337d299a519b98 plugkit-win32-arm64.exe
3
+ 7919aa48a1b35a57ffb989ddc90a727e1f5ae94dc10db8f402cbf7d4eb5e3bf7 plugkit-darwin-x64
4
+ fd3db4ada0edf9896049cf7abf4f810aa83255ec24916a390d487940b7bedfea plugkit-darwin-arm64
5
+ fac22aac7d0465aa7fd7bfb3902d895637882cc5f688fbdb167a57dc78582ec0 plugkit-linux-x64
6
+ 6e0d405b7c9e0a127351f27fd36ca8215022b23bc88a1d50e6575e2547eadda6 plugkit-linux-arm64
@@ -1 +1 @@
1
- 0.1.260
1
+ 0.1.261
package/bin/rtk.sha256 CHANGED
@@ -1,5 +1,5 @@
1
- 5baf1d840217fc4b875d90456d6bd41c1acfd5420c6b96259dc602c0365e5ef4 rtk-win32-x64.exe
2
- 1b5d832cfceea810068a79ad4abe23b9f122d81b0c55792cbd8c82dfc969e204 rtk-win32-arm64.exe
1
+ 1fb115244b456a937fcd0b7888766c6ddeb27b073321faf620612a75d29dcba0 rtk-win32-x64.exe
2
+ b9666cd5aba12f71e1aea4994dd139d75f6e4b2068630bdfcda097c211592171 rtk-win32-arm64.exe
3
3
  e89fdf402c28796b510587a8b0fe046438b5b24d49533d1a2339a48aecae35e9 rtk-darwin-x64
4
4
  2b203fd380f5782b5489eb016e34e3dbf848272a7fadf36b39bce6cfd9a3005c rtk-darwin-arm64
5
5
  0da9950b859c7a2693aaf6c169f05f9b8965508ba1f23f1547e63d5fa988749e rtk-linux-x64
package/gm.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm",
3
- "version": "2.0.801",
3
+ "version": "2.0.803",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -23,5 +23,5 @@
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
26
- "plugkitVersion": "0.1.260"
26
+ "plugkitVersion": "0.1.261"
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-qwen",
3
- "version": "2.0.801",
3
+ "version": "2.0.803",
4
4
  "description": "State machine agent with hooks, skills, and automated git enforcement",
5
5
  "author": "AnEntrypoint",
6
6
  "license": "MIT",
@@ -93,6 +93,14 @@ Pure-prose edits to static documents with no JS/canvas/DOM behavior change are e
93
93
 
94
94
  This rule fires in EXECUTE (witness on edit), EMIT (post-emit verify), and VERIFY (final gate). All three.
95
95
 
96
+ ## OBSERVABILITY — HARD RULE
97
+
98
+ Every program is observed by default. plugkit, rs-exec, rs-plugkit, rs-learn, rs-search, and rs-codeinsight emit structured JSONL events to `~/.claude/gm-log/<YYYY-MM-DD>/<subsystem>.jsonl` for every hook fired, every exec spawn, every recall, every run_self call. The agent inspects this stream when diagnosing — `plugkit log tail`, `plugkit log grep <terms>`, `plugkit log stats`, `plugkit log path`. Asking "why did X happen" without first checking the log is forced closure.
99
+
100
+ The same discipline applies to code the agent writes. State transitions, error paths, external IO (network, disk, subprocess, queue), and timing of operations longer than a heartbeat are events the future debugger will need. Find the project's existing observability surface before inventing one (codesearch first); if a surface exists, extend it rather than starting a parallel one. If the project has none, the smallest correct shim is a single function or macro that emits one JSONL line per event to a file under `.gm/log/` (mirror what plugkit does — same shape, same fields). Never `console.log` / `println!` scatter across files; that fragments the surface and dies on the first compaction or rotation. The events are the program's own self-narration, not a debugging afterthought.
101
+
102
+ What to emit, not how often: every state transition once; every error path once at the boundary it crosses; every external IO with timing; every nontrivial decision (allow/deny, route picked, branch taken on user-derived input). Do not emit per-iteration loop bodies, per-character parser steps, or anything whose volume would obscure the load-bearing events. The signal-to-noise judgment is the agent's; the cost of getting it wrong is paid by future-you reading the file.
103
+
96
104
  ## NOTHING FAKE — HARD RULE
97
105
 
98
106
  What ships runs against real services, real data, real binaries. Stubs, mocks, placeholder returns, fixture-only paths, "TODO: implement", `return null /* fake */`, hardcoded sample responses, and demo-mode fallbacks are forbidden in source the user will run. They produce green checks that survive into production and lie about what works.