gm-plugkit 2.0.1617 → 2.0.1619

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/SKILL.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: gm-skill
2
+ name: gm
3
3
  description: Plugkit-served instruction stream. Three-layer admission (witness, single-writer, direction) over every possible mutation; effort unbounded, never gated on cost. Closure on first emit; partial = non-monotonic.
4
4
  allowed-tools: Skill, Read, Write, Bash(bun *), Bash(npx *)
5
5
  ---
package/bootstrap.js CHANGED
@@ -768,9 +768,9 @@ function ensureSkillMdFresh() {
768
768
  try {
769
769
  const candidates = [
770
770
  path.join(__dirname, 'SKILL.md'),
771
- path.join(__dirname, '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
772
- path.join(__dirname, '..', '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
773
- path.join(__dirname, '..', 'skills', 'gm-skill', 'SKILL.md'),
771
+ path.join(__dirname, '..', 'gm-skill', 'skills', 'gm', 'SKILL.md'),
772
+ path.join(__dirname, '..', '..', 'gm-skill', 'skills', 'gm', 'SKILL.md'),
773
+ path.join(__dirname, '..', 'skills', 'gm', 'SKILL.md'),
774
774
  ];
775
775
  const bundledPath = candidates.find(p => {
776
776
  try { return fs.existsSync(p); } catch (_) { return false; }
@@ -787,9 +787,15 @@ function ensureSkillMdFresh() {
787
787
  const bundledHash = crypto.createHash('sha256').update(_norm(bundled)).digest('hex');
788
788
  const home = process.env.HOME || process.env.USERPROFILE || require('os').homedir();
789
789
  const targets = [
790
- path.join(home, '.agents', 'skills', 'gm-skill', 'SKILL.md'),
791
- path.join(home, '.claude', 'skills', 'gm-skill', 'SKILL.md'),
790
+ path.join(home, '.agents', 'skills', 'gm', 'SKILL.md'),
791
+ path.join(home, '.claude', 'skills', 'gm', 'SKILL.md'),
792
792
  ];
793
+ for (const legacy of [
794
+ path.join(home, '.agents', 'skills', 'gm-skill'),
795
+ path.join(home, '.claude', 'skills', 'gm-skill'),
796
+ ]) {
797
+ try { if (fs.existsSync(legacy)) fs.rmSync(legacy, { recursive: true, force: true }); } catch (_) {}
798
+ }
793
799
  const refreshed = [];
794
800
  for (const target of targets) {
795
801
  try {
@@ -14,7 +14,7 @@ Feed search outputs into EMIT only when the digest matches the live filesystem;
14
14
 
15
15
  ## Write-then-verify
16
16
 
17
- One write per artifact, then a disk Read against every touched path to assert the change -- verified disk state IS the witness, not the tool-call return. On discrepancy, regress to root cause, do not retry.
17
+ One write per artifact, then a disk Read against every touched path to assert the change -- you do not reason that the write succeeded, you run the read and witness it. Verified disk state IS the witness, not the tool-call return. On discrepancy, regress to root cause, do not retry.
18
18
 
19
19
  **Client-side artifacts: write-then-browser-witness, same turn.** If the artifact is `.html .js .jsx .ts .tsx .vue .svelte .mjs .css` or any browser-loaded path, the disk Read is necessary but not sufficient -- also dispatch a `browser` verb that `page.evaluate`s the invariant the artifact establishes (the page-side assertion is the real witness; the disk Read only witnesses serialization). Skipping it ships a green-checked stub. The COMPLETE gate refuses while any client-side file edited this session lacks its paired browser-witness (`deviation.client-edit-no-witness`, gates.rs); the missing witness is the next dispatch.
20
20
 
@@ -41,11 +41,11 @@ The five phases are scheduling; the filter is the engine on every candidate, gat
41
41
 
42
42
  ## Token Discipline
43
43
 
44
- English describing intent is liability when code can encode it; comments are liability when names + structure encode the same; duplication that must sync is liability. Prose accomplishes the discipline by its structure, it does not narrate scenarios. Recognize the closure anti-shape by structure (a claim composed in prose displacing a dispatch). The response body is not a mutation surface.
44
+ English describing intent is liability when code can encode it; comments are liability when names + structure encode the same; duplication that must sync is liability. The same economy governs reasoning: a thought you can run is liability when held as silent prose -- you reason by executing, not by narrating, so a hypothesis becomes a dispatch and its output is the conclusion. Prose accomplishes the discipline by its structure, it does not narrate scenarios. Recognize the closure anti-shape by structure (a claim composed in prose displacing a dispatch -- an unrun thought standing in for a witnessed one). The response body is not a mutation surface.
45
45
 
46
46
  ## Install
47
47
 
48
- `bun x skills add AnEntrypoint/gm-skill` -> `~/.agents/skills/<name>/SKILL.md` symlinked into `~/.claude/skills/<name>/`.
48
+ `npx gm-skill install` copies the skill directory into `~/.claude/skills/gm/` (and `~/.agents/skills/gm/`), installed as `/gm`; `--yes` is the non-interactive form. No `skills` library.
49
49
 
50
50
  ## Bootstrap
51
51
 
@@ -12,7 +12,9 @@ Every code/file/symbol lookup is a `codesearch` dispatch -- never a platform Exp
12
12
 
13
13
  ## Witness
14
14
 
15
- The witness IS the distance measurement: artifact present in observable state means `d(state, goal)` decreased. An artifact composed only in prose, or success returned without doing the work, sits at high distance regardless of structure -- L3 rejects the next dispatch.
15
+ You still reason as hard as ever -- you just think in code rather than in silent prose. A thought you cannot run is a guess; the hypothesis you form becomes an `exec_js`, a `codesearch`, a `page.evaluate`, and its output is the conclusion. The internal monologue that used to argue both sides of an unknown is replaced by the cheaper, truthful move: run it and read the real result. Hypothesize, execute, witness -- that loop IS your reasoning, and it leaves an artifact the next agent can trust.
16
+
17
+ The witness IS the distance measurement: artifact present in observable state means `d(state, goal)` decreased. An artifact composed only in prose, or success returned without doing the work, sits at high distance regardless of structure -- a conclusion reasoned-to but never run-to is exactly that unwitnessed prose; L3 rejects the next dispatch.
16
18
 
17
19
  Witness code running on a non-default surface on that surface in the same turn; a passing test on surface A is not witness for code on surface B. For the browser surface, dispatch the `browser` verb (`in/browser/<N>.txt`, raw JS, globals `page`/`snapshot`/`screenshotWithAccessibilityLabels`/`state`; `session new|list|close <id>`).
18
20
 
@@ -36,7 +38,7 @@ First emit = closure of the transform; scaffold + IOU externalizes residual cost
36
38
 
37
39
  Data first -- get the structures and their invariants right and the code writes itself; convoluted control flow means the data model is wrong, so fix the model. Make invalid state unrepresentable -- pass parameters over hidden globals, encode the constraint in the type/shape so the bad combination cannot be constructed. Reason from physical constraints (latency, bandwidth, memory, coordination, the worst node) before designing within them. Keep the spine flat, each unit single-focus and understandable at its call site. Make misuse structurally impossible, not documented-against. Optimize the worst case, not the average; design every failure path explicitly (full -> degraded -> safe-fail -> explicit-error), never a silent catastrophic mode. Measure, do not assume -- profile before optimizing, implement both and compare on real input when in genuine dispute. When a change regresses something that worked, revert first and investigate second: restore green, then diagnose from a known-good base. Fail fast and loud over limping on bad state.
38
40
 
39
- **Process of elimination is the debugging paradigm on every surface, and manual labour against real services is how you witness.** Never guess-and-restart, a/b-test, or shotgun variants: enumerate the candidate causes as mutables, then eliminate each by a witness read against REAL input -- `exec_js` against the real service, `codesearch`/`Read` against the real source, the `browser` verb's `page.evaluate` against a `window.*` global on the live page. Each elimination reveals the next mutable; record it and keep going until one cause survives every other's refutation. Reading the live runtime once observes more than a hundred blind restarts. Profile on the real surface, not from intuition: wrap the suspect node and read the live numbers. In node, `exec_js` carries `duration_ms` for free, surfaces your own timing and `process.memoryUsage()` on stdout, and lands the thrown-error `stack` on stderr -- read both channels (numbers on stdout, stack on stderr). In the browser, a body prefixed `capture\n<script>` auto-returns `{result, debug:{console, pageErrors, network, performance}}` with zero boilerplate. When the slow node is not obvious, sample it bottom-up: `exec_js` with `opts.profile:true` and the browser `profile\n<script>` prefix both return `{result, profile:{timeframe:{start_us,end_us,total_us,sample_count}, culprits:[{location,function,self_us,self_pct,hits}]}}` -- the worst-20 `file:line` by self-time across init and code-execution, identical shape on both surfaces, so the culprit ranking points straight at the line to fix. Profile to LOCATE the slow/broken node, then eliminate hypotheses by live measurement. Verification is the same labour: run the real thing and witness the real output (the single mock-free `test.js`, the live page, the real service), never an automated unit/mock harness standing in for the real-services witness. Apparent tooling failure is part of this -- it is your mechanical self-recovery by elimination, never a question for the user.
41
+ **Process of elimination is the debugging paradigm on every surface, and manual labour against real services is how you witness.** This is thinking-in-code at its sharpest: each candidate cause is a hypothesis, and you test the hypothesis by running it, not by reasoning around it. Never guess-and-restart, a/b-test, or shotgun variants: enumerate the candidate causes as mutables, then eliminate each by a witness read against REAL input -- `exec_js` against the real service, `codesearch`/`Read` against the real source, the `browser` verb's `page.evaluate` against a `window.*` global on the live page. Each elimination reveals the next mutable; record it and keep going until one cause survives every other's refutation. Reading the live runtime once observes more than a hundred blind restarts. Profile on the real surface, not from intuition: wrap the suspect node and read the live numbers. In node, `exec_js` carries `duration_ms` for free, surfaces your own timing and `process.memoryUsage()` on stdout, and lands the thrown-error `stack` on stderr -- read both channels (numbers on stdout, stack on stderr). In the browser, a body prefixed `capture\n<script>` auto-returns `{result, debug:{console, pageErrors, network, performance}}` with zero boilerplate. When the slow node is not obvious, sample it bottom-up: `exec_js` with `opts.profile:true` and the browser `profile\n<script>` prefix both return `{result, profile:{timeframe:{start_us,end_us,total_us,sample_count}, culprits:[{location,function,self_us,self_pct,hits}]}}` -- the worst-20 `file:line` by self-time across init and code-execution, identical shape on both surfaces, so the culprit ranking points straight at the line to fix. Profile to LOCATE the slow/broken node, then eliminate hypotheses by live measurement. Verification is the same labour: run the real thing and witness the real output (the single mock-free `test.js`, the live page, the real service), never an automated unit/mock harness standing in for the real-services witness. Apparent tooling failure is part of this -- it is your mechanical self-recovery by elimination, never a question for the user.
40
42
 
41
43
  ## Memorize
42
44
 
@@ -6,7 +6,7 @@ L1 baseline + L2 covering family. You loaded prior memory on entry via `instruct
6
6
 
7
7
  ## Orient
8
8
 
9
- First non-trivial dispatch = a single-message parallel fan-out of `recall` + `codesearch` against the request's nouns. Hits are your baseline; misses delimit fresh ground to investigate. Skip orient and you commit to an unobserved envelope.
9
+ First non-trivial dispatch = a single-message parallel fan-out of `recall` + `codesearch` against the request's nouns. This is where planning-thought becomes executed query rather than recalled-from-memory assumption: what you would otherwise assume about the codebase, you instead hypothesize and look up. Hits are your baseline; misses delimit fresh ground to investigate. Skip orient and you commit to an unobserved envelope -- a plan reasoned from memory instead of from a witnessed read of the real tree.
10
10
 
11
11
  ## Cover
12
12
 
@@ -16,7 +16,7 @@ The `git_push` verb is the only admissible push surface, any repo, any cwd; it r
16
16
 
17
17
  ## CI
18
18
 
19
- The push IS the validation dispatch. Local proof covers one platform; the matrix covers all. Red = a divergent observation that holds the trajectory until you name the cause and push green; toolchain skew is an observation to converge, not stop.
19
+ Verification is thinking run rather than reasoned: the question "is this correct?" is not argued in prose, it is executed -- the real test, the real matrix, the real page answer it. The push IS the validation dispatch. Local proof covers one platform; the matrix covers all. Red = a divergent observation that holds the trajectory until you name the cause and push green; toolchain skew is an observation to converge, not stop.
20
20
 
21
21
  ## Integration witness
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gm-plugkit",
3
- "version": "2.0.1617",
3
+ "version": "2.0.1619",
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": {
@@ -1062,6 +1062,13 @@ function startManagedBrowser(pw, profileDir) {
1062
1062
  '--disable-default-apps',
1063
1063
  '--disable-gpu-process-crash-limit',
1064
1064
  ];
1065
+ // In containers where unprivileged user namespaces are disabled, Chromium's
1066
+ // sandbox cannot initialize and the remote-debugging port never binds (the CDP
1067
+ // "did not become ready" failure). Opt in to running without the sandbox (plus
1068
+ // the small-/dev/shm workaround common in containers) via GM_BROWSER_NO_SANDBOX=1.
1069
+ if (process.env.GM_BROWSER_NO_SANDBOX === '1') {
1070
+ args.push('--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage');
1071
+ }
1065
1072
  if (headless) {
1066
1073
  args.push('--headless=new');
1067
1074
  } else {
@@ -3598,9 +3605,9 @@ async function runSpoolWatcher(instance, spoolDir) {
3598
3605
  try {
3599
3606
  const skillCandidates = [
3600
3607
  path.join(wrapperDir, 'SKILL.md'),
3601
- path.join(wrapperDir, '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
3602
- path.join(wrapperDir, '..', '..', 'gm-skill', 'skills', 'gm-skill', 'SKILL.md'),
3603
- path.join(wrapperDir, '..', 'skills', 'gm-skill', 'SKILL.md'),
3608
+ path.join(wrapperDir, '..', 'gm-skill', 'skills', 'gm', 'SKILL.md'),
3609
+ path.join(wrapperDir, '..', '..', 'gm-skill', 'skills', 'gm', 'SKILL.md'),
3610
+ path.join(wrapperDir, '..', 'skills', 'gm', 'SKILL.md'),
3604
3611
  ];
3605
3612
  const bundledPath = skillCandidates.find(p => { try { return fs.existsSync(p); } catch (_) { return false; } });
3606
3613
  if (!bundledPath) return;
@@ -3608,8 +3615,8 @@ async function runSpoolWatcher(instance, spoolDir) {
3608
3615
  const bundledHash = crypto.createHash('sha256').update(bundled).digest('hex');
3609
3616
  const home = process.env.HOME || process.env.USERPROFILE || os.homedir();
3610
3617
  const targets = [
3611
- path.join(home, '.agents', 'skills', 'gm-skill', 'SKILL.md'),
3612
- path.join(home, '.claude', 'skills', 'gm-skill', 'SKILL.md'),
3618
+ path.join(home, '.agents', 'skills', 'gm', 'SKILL.md'),
3619
+ path.join(home, '.claude', 'skills', 'gm', 'SKILL.md'),
3613
3620
  ];
3614
3621
  const refreshed = [];
3615
3622
  for (const target of targets) {