gm-skill 2.0.1863 → 2.0.1865
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 +2 -2
- package/README.md +0 -1
- package/gm-plugkit/instructions/residual/browser-open.md +1 -1
- package/gm-plugkit/instructions/residual/dirty-tree.md +1 -1
- package/gm-plugkit/instructions/residual/imperative.md +1 -1
- package/gm-plugkit/instructions/residual/tasks-running.md +1 -1
- package/gm-plugkit/package.json +1 -3
- package/gm-plugkit/plugkit-wasm-wrapper.js +72 -9
- package/gm-plugkit/supervisor.js +20 -13
- package/gm.json +1 -1
- package/lib/spool.js +1 -46
- package/package.json +1 -2
- package/skills/fifth-dimension-engine/SKILL.md +5 -5
- package/skills/fifth-dimension-engine/references/research-kernel-extraction.md +3 -3
- package/skills/fifth-dimension-engine/references/route-inspection-guide.md +1 -1
- package/skills/fifth-dimension-engine/references/route-structure.md +1 -1
- package/skills/gm/SKILL.md +2 -2
- package/skills/polaris-goal-compiler/SKILL.md +5 -5
- package/skills/polaris-goal-compiler/references/claim-ceiling-examples.md +2 -2
- package/skills/polaris-goal-compiler/references/task-atomization.md +11 -11
- package/skills/polaris-goal-compiler/references/verification-gates.md +6 -6
- package/skills/polaris-protocol/SKILL.md +16 -16
- package/skills/wfgy-method/SKILL.md +28 -28
- package/skills/wfgy-method/references/failure-modes.md +5 -5
- package/skills/wfgy-method/references/honesty-and-provenance.md +10 -10
- package/skills/wfgy-method/references/lessons-template.md +4 -4
- package/skills/wfgy-method/references/wfgy-core-mechanism.md +14 -14
- package/lib/spool-dispatch.js +0 -484
package/AGENTS.md
CHANGED
|
@@ -152,13 +152,13 @@ A task that reduces to read/investigate/report, or a change confined to files th
|
|
|
152
152
|
|
|
153
153
|
Push to any rs-* sibling -> `cascade.yml` -> rs-plugkit `release.yml` -> single `plugkit.wasm` (npm `plugkit-wasm` + `plugkit-bin` Releases) -> auto-bump `gm.json::plugkitVersion` -> `publish.yml` ships gm-skill+gm-plugkit+SKILL.md mirror. Step sequence + PUBLISHER_TOKEN: the recall store (`recall: cascade pipeline`).
|
|
154
154
|
|
|
155
|
-
**Repos involved (push to any triggers cascade):** `AnEntrypoint/{rs-
|
|
155
|
+
**Repos involved (push to any triggers cascade):** `AnEntrypoint/{rs-codeinsight, rs-search, rs-plugkit, gm}`. rs-learn and rs-exec are retired (crates removed from / never depended on by rs-plugkit; their spool-dispatch and memory surfaces reimplemented natively in rs-plugkit wasm_dispatch; repos archived as tombstones, README points at rs-plugkit). Roles, npm package names, legacy-retirement detail: the recall store (`recall: cascade repos involved roles`, `recall: legacy gm-skill variants retired`).
|
|
156
156
|
|
|
157
157
|
**To update every possible thing**: push to the relevant repo. No manual version bumps, no local `cargo update`/`cargo build` -- push, let CI build.
|
|
158
158
|
|
|
159
159
|
## Spool-dispatch architecture replaces hooks
|
|
160
160
|
|
|
161
|
-
Orchestration state tracked via `.gm/` marker files, not hook events;
|
|
161
|
+
Orchestration state tracked via `.gm/` marker files, not hook events; the gate that admits Write/Edit/git pre-execution runs natively inside `plugkit.wasm` (rs-plugkit `gates.rs` + the `hook_pre_tool_use`/`hook_stop` exports), driven off the same `.gm/` markers. (The former JS `lib/spool-dispatch.js`/`checkDispatchGates()` reimplementation was removed once the gate moved into the wasm binary.) Marker set + gate mechanism: the recall store (`recall: gate enforcement layer`, `recall: spool dispatch gates marker files`).
|
|
162
162
|
|
|
163
163
|
**gm tool-use sequencing**: `Skill(skill="gm")` clears needs-gm gate. One shipped skill, no subagent variant. Marker mechanics: the recall store (`recall: gm-skill tool-use sequencing mechanics`).
|
|
164
164
|
|
package/README.md
CHANGED
|
@@ -61,7 +61,6 @@ gm/
|
|
|
61
61
|
|-- bin/ <- bootstrap + plugkit launcher (gmsniff / ccsniff are separate npm packages, `bun x gmsniff`, `bun x ccsniff`)
|
|
62
62
|
|-- lib/ <- runtime: spool dispatch, skill bootstrap, daemon mgmt
|
|
63
63
|
|-- agents/ <- subagent prompts (gm, memorize, research-worker, textprocessing)
|
|
64
|
-
|-- prompts/ <- bash-deny, session-start, prompt-submit, pre-compact
|
|
65
64
|
|-- lang/ <- language packs (browser, ssh)
|
|
66
65
|
|-- gm-plugkit/ <- separate npm package that ships the wasm-wrapper
|
|
67
66
|
|-- gm.json <- version + plugkit pin
|
|
@@ -1 +1 @@
|
|
|
1
|
-
browser sessions still open
|
|
1
|
+
browser sessions still open -- dispatch `browser` with `session list` body to enumerate open ids, then `session close <id>` for each before retrying residual-scan
|
|
@@ -1 +1 @@
|
|
|
1
|
-
worktree dirty
|
|
1
|
+
worktree dirty -- modified={modified} untracked={untracked} -- commit or revert before residual scan; a push from a dirty tree orphans the unstaged delta
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Residual scan. Worktree clean, remote pushed, PRD empty, mutables witnessed
|
|
1
|
+
Residual scan. Worktree clean, remote pushed, PRD empty, mutables witnessed -- the four checks. Anything reachable and in-spirit expands the PRD and runs. Out-of-reach is credentials, down service, product decision.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
background tasks still running
|
|
1
|
+
background tasks still running -- wait for completion or kill them via the host_exec_js interface before retrying residual-scan
|
package/gm-plugkit/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-plugkit",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1865",
|
|
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": {
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
"plugkit-wasm-wrapper.js",
|
|
17
17
|
"plugkit.version",
|
|
18
18
|
"plugkit.sha256",
|
|
19
|
-
"SKILL.md",
|
|
20
|
-
"SKILL-*.md",
|
|
21
19
|
"instructions/"
|
|
22
20
|
],
|
|
23
21
|
"keywords": [
|
|
@@ -2728,7 +2728,24 @@ function makeHostFunctions(instanceRef) {
|
|
|
2728
2728
|
+ `})();\n`;
|
|
2729
2729
|
cmd = process.execPath; args = ['-e', memRunner];
|
|
2730
2730
|
} else {
|
|
2731
|
-
|
|
2731
|
+
// Wrap in an async IIFE so top-level `return` (and top-level
|
|
2732
|
+
// `await`) work -- `node/bun -e "return 2+2;"` is a SyntaxError
|
|
2733
|
+
// at top level, but the gm exec_js contract lets code `return` a
|
|
2734
|
+
// result. This mirrors the mem/profile paths and the browser verb.
|
|
2735
|
+
// The returned value is emitted via a __GM_RESULT__ sentinel so the
|
|
2736
|
+
// user's own stdout stays clean; a throw still prints its stack to
|
|
2737
|
+
// stderr and exits 1, preserving the documented error channel.
|
|
2738
|
+
const defRunner = `(async () => {\n`
|
|
2739
|
+
+ ` try {\n`
|
|
2740
|
+
+ ` const __r = await (async () => {\n${code}\n})();\n`
|
|
2741
|
+
+ ` try { console.log('__GM_RESULT__' + JSON.stringify(__r === undefined ? null : __r)); }\n`
|
|
2742
|
+
+ ` catch (__se) { console.log('__GM_RESULT__' + JSON.stringify({ __unserializable: String(__se && __se.message || __se) })); }\n`
|
|
2743
|
+
+ ` } catch (__e) {\n`
|
|
2744
|
+
+ ` console.error(String(__e && __e.stack || __e));\n`
|
|
2745
|
+
+ ` process.exitCode = 1;\n`
|
|
2746
|
+
+ ` }\n`
|
|
2747
|
+
+ `})();\n`;
|
|
2748
|
+
cmd = process.execPath; args = ['-e', defRunner];
|
|
2732
2749
|
}
|
|
2733
2750
|
}
|
|
2734
2751
|
else if (lang === 'python') { cmd = 'python'; args = ['-c', code]; }
|
|
@@ -2742,6 +2759,20 @@ function makeHostFunctions(instanceRef) {
|
|
|
2742
2759
|
} finally {
|
|
2743
2760
|
if (profileUserFile) { try { fs.unlinkSync(profileUserFile); } catch (_) {} }
|
|
2744
2761
|
}
|
|
2762
|
+
// Shared across all result branches: a genuine timeout kills the child
|
|
2763
|
+
// near the deadline. A SIGTERM far under timeoutMs is a spurious /
|
|
2764
|
+
// host-injected kill (e.g. the stale-watcher SIGTERM-at-28ms), not a
|
|
2765
|
+
// timeout -- do not mislabel it as timed_out.
|
|
2766
|
+
const __execDurMs = Date.now() - __execT0;
|
|
2767
|
+
const __execTimedOut = result.signal === 'SIGTERM' && __execDurMs >= Math.floor(timeoutMs * 0.9);
|
|
2768
|
+
// spawnSync sets result.error (and leaves status/signal null) when the
|
|
2769
|
+
// child could NOT be started or was reaped abnormally (spawn race
|
|
2770
|
+
// during watcher boot, ETIMEDOUT, EBADF, ENOENT for a missing runtime).
|
|
2771
|
+
// Surface it so a status:-1 is diagnosable instead of a silent empty
|
|
2772
|
+
// failure -- the caller sees WHY, not just exit_code:-1.
|
|
2773
|
+
const __spawnError = result.error
|
|
2774
|
+
? { code: result.error.code || null, errno: result.error.errno || null, syscall: result.error.syscall || null, message: String(result.error.message || result.error) }
|
|
2775
|
+
: null;
|
|
2745
2776
|
if (wantProfile) {
|
|
2746
2777
|
const raw = result.stdout || '';
|
|
2747
2778
|
const idx = raw.indexOf('__GM_PROFILE__');
|
|
@@ -2752,14 +2783,15 @@ function makeHostFunctions(instanceRef) {
|
|
|
2752
2783
|
stdout: idx >= 0 ? raw.slice(0, idx) : raw,
|
|
2753
2784
|
stderr: result.stderr || '',
|
|
2754
2785
|
exit_code: result.status === null ? -1 : result.status,
|
|
2755
|
-
timed_out:
|
|
2756
|
-
duration_ms:
|
|
2786
|
+
timed_out: __execTimedOut,
|
|
2787
|
+
duration_ms: __execDurMs,
|
|
2757
2788
|
result: parsed ? parsed.result : null,
|
|
2758
2789
|
profile: parsed ? parsed.profile : { timeframe: null, culprits: [] },
|
|
2759
2790
|
profile_error: parsed ? parsed.profile_error : 'profile sentinel not found in stdout',
|
|
2760
2791
|
user_error: parsed ? parsed.user_error : null,
|
|
2761
2792
|
mem: parsed ? parsed.mem : null,
|
|
2762
2793
|
wall_vs_cpu: parsed ? parsed.wall_vs_cpu : null,
|
|
2794
|
+
...(__spawnError ? { spawn_error: __spawnError } : {}),
|
|
2763
2795
|
});
|
|
2764
2796
|
}
|
|
2765
2797
|
if (opts.mem === true && isJsLang) {
|
|
@@ -2772,21 +2804,41 @@ function makeHostFunctions(instanceRef) {
|
|
|
2772
2804
|
stdout: idx >= 0 ? raw.slice(0, idx) : raw,
|
|
2773
2805
|
stderr: result.stderr || '',
|
|
2774
2806
|
exit_code: result.status === null ? -1 : result.status,
|
|
2775
|
-
timed_out:
|
|
2776
|
-
duration_ms:
|
|
2807
|
+
timed_out: __execTimedOut,
|
|
2808
|
+
duration_ms: __execDurMs,
|
|
2777
2809
|
result: meta ? meta.result : null,
|
|
2778
2810
|
mem: meta ? meta.mem : null,
|
|
2779
2811
|
wall_ms: meta ? meta.wall_ms : null,
|
|
2780
2812
|
...(meta && meta.error ? { error: meta.error } : {}),
|
|
2813
|
+
...(__spawnError ? { spawn_error: __spawnError } : {}),
|
|
2781
2814
|
});
|
|
2782
2815
|
}
|
|
2816
|
+
let __defStdout = result.stdout || '';
|
|
2817
|
+
let __defResult = null;
|
|
2818
|
+
let __defHasResult = false;
|
|
2819
|
+
if (isJsLang) {
|
|
2820
|
+
const __ri = __defStdout.lastIndexOf('__GM_RESULT__');
|
|
2821
|
+
if (__ri >= 0) {
|
|
2822
|
+
const __tail = __defStdout.slice(__ri + '__GM_RESULT__'.length);
|
|
2823
|
+
const __nl = __tail.indexOf('\n');
|
|
2824
|
+
const __jsonStr = __nl >= 0 ? __tail.slice(0, __nl) : __tail;
|
|
2825
|
+
try { __defResult = JSON.parse(__jsonStr); __defHasResult = true; } catch (_) {}
|
|
2826
|
+
// Strip the __GM_RESULT__ sentinel line (console.log emits it on its
|
|
2827
|
+
// own line after the user's output) so the caller's stdout is clean.
|
|
2828
|
+
let __clean = __defStdout.slice(0, __ri) + (__nl >= 0 ? __tail.slice(__nl + 1) : '');
|
|
2829
|
+
if (__clean.endsWith('\n')) __clean = __clean.slice(0, -1);
|
|
2830
|
+
__defStdout = __clean;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2783
2833
|
return writeWasmJson(instanceRef.value, {
|
|
2784
2834
|
ok: result.status === 0,
|
|
2785
|
-
stdout:
|
|
2835
|
+
stdout: __defStdout,
|
|
2786
2836
|
stderr: result.stderr || '',
|
|
2787
2837
|
exit_code: result.status === null ? -1 : result.status,
|
|
2788
|
-
timed_out:
|
|
2789
|
-
duration_ms:
|
|
2838
|
+
timed_out: __execTimedOut,
|
|
2839
|
+
duration_ms: __execDurMs,
|
|
2840
|
+
...(__defHasResult ? { result: __defResult } : {}),
|
|
2841
|
+
...(__spawnError ? { spawn_error: __spawnError } : {}),
|
|
2790
2842
|
...(profileSkipped ? { profile_skipped: profileSkipped } : {}),
|
|
2791
2843
|
});
|
|
2792
2844
|
} catch (e) {
|
|
@@ -4327,7 +4379,18 @@ async function runSpoolWatcher(instance, spoolDir) {
|
|
|
4327
4379
|
|
|
4328
4380
|
setTimeout(() => {
|
|
4329
4381
|
try {
|
|
4330
|
-
|
|
4382
|
+
// The boot warmup's codesearch triggers a codeinsight reindex + full
|
|
4383
|
+
// in-wasm embed of the project when the stored digest is absent/stale.
|
|
4384
|
+
// That embed is a SYNCHRONOUS wasm call that blocks the event loop, so
|
|
4385
|
+
// the 5s heartbeat interval cannot fire while it runs. On a large repo a
|
|
4386
|
+
// cold embed can take several minutes; if it exceeds the busy_until
|
|
4387
|
+
// window the supervisor's stale-heartbeat check kills the watcher
|
|
4388
|
+
// mid-embed, the digest never persists, and every respawn re-embeds from
|
|
4389
|
+
// scratch -- an unbounded restart loop that spawns duplicate watchers.
|
|
4390
|
+
// The window must therefore comfortably exceed the worst-case cold embed;
|
|
4391
|
+
// it is a one-time cost (the digest persists after a single completion,
|
|
4392
|
+
// so subsequent boots' warmup is near-instant).
|
|
4393
|
+
_writeStatusBusy(1200000);
|
|
4331
4394
|
const vb = new TextEncoder().encode('codesearch');
|
|
4332
4395
|
const bb = new TextEncoder().encode(JSON.stringify({ query: 'index warmup', k: 1 }));
|
|
4333
4396
|
const vp = writeWasmInput(instance, vb, 'boot-warmup:codesearch.verb');
|
package/gm-plugkit/supervisor.js
CHANGED
|
@@ -159,6 +159,22 @@ function readShutdownReason() {
|
|
|
159
159
|
try { return JSON.parse(fs.readFileSync(SHUTDOWN_REASON_PATH, 'utf-8')); } catch (_) { return null; }
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
// A supervisor-initiated kill is PLANNED (version/wrapper drift, heartbeat-stale),
|
|
163
|
+
// but on Windows process.kill(pid,'SIGTERM') terminates the child immediately with
|
|
164
|
+
// no catchable signal, so the child never writes its own .shutdown-reason.json and
|
|
165
|
+
// the taskkill /F that follows leaves none either -- the NEXT boot then mislabels a
|
|
166
|
+
// deliberate upgrade recycle as a SILENT ABORT / unplanned-restart critical. Write
|
|
167
|
+
// the planned reason on the child's behalf BEFORE killing, so the next boot reads a
|
|
168
|
+
// fresh planned shutdown reason and classifies the restart correctly.
|
|
169
|
+
function killChild(reason) {
|
|
170
|
+
if (!currentChildPid) return;
|
|
171
|
+
try { fs.writeFileSync(SHUTDOWN_REASON_PATH, JSON.stringify({ reason, ts: Date.now(), pid: currentChildPid, killed_by_supervisor: true })); } catch (_) {}
|
|
172
|
+
try { process.kill(currentChildPid, 'SIGTERM'); } catch (_) {}
|
|
173
|
+
if (process.platform === 'win32') {
|
|
174
|
+
try { spawnSync('taskkill', ['/F', '/T', '/PID', String(currentChildPid)], { stdio: 'ignore', windowsHide: true, timeout: 3000 }); } catch (_) {}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
162
178
|
let lastSpawnedAt = 0;
|
|
163
179
|
let lastVersionDriftActionAt = 0;
|
|
164
180
|
let restartTimestamps = [];
|
|
@@ -258,7 +274,7 @@ function spawnWatcher(bootReason) {
|
|
|
258
274
|
const idleClean = reason === 'idle';
|
|
259
275
|
const lockRejected = code === 75;
|
|
260
276
|
const cleanExit = code === 0;
|
|
261
|
-
const plannedReasons = new Set(['idle', 'sigterm', 'version-change', 'wrapper-change', 'peer-stale-takeover', 'external-planned', 'process-exit']);
|
|
277
|
+
const plannedReasons = new Set(['idle', 'sigterm', 'version-change', 'wrapper-change', 'heartbeat-stale', 'peer-stale-takeover', 'external-planned', 'process-exit']);
|
|
262
278
|
const isPlanned = plannedReasons.has(reason) || lockRejected || cleanExit;
|
|
263
279
|
const eventName = idleClean
|
|
264
280
|
? 'supervisor.watcher-exited-idle'
|
|
@@ -335,10 +351,7 @@ function checkWatcherHealth() {
|
|
|
335
351
|
stale_limit_ms: STATUS_STALE_MS,
|
|
336
352
|
severity: 'critical',
|
|
337
353
|
});
|
|
338
|
-
|
|
339
|
-
if (process.platform === 'win32') {
|
|
340
|
-
try { spawnSync('taskkill', ['/F', '/T', '/PID', String(currentChildPid)], { stdio: 'ignore', windowsHide: true, timeout: 3000 }); } catch (_) {}
|
|
341
|
-
}
|
|
354
|
+
killChild('heartbeat-stale');
|
|
342
355
|
return;
|
|
343
356
|
}
|
|
344
357
|
const reported = status.wrapper_sha || null;
|
|
@@ -350,10 +363,7 @@ function checkWatcherHealth() {
|
|
|
350
363
|
on_disk_sha: onDisk,
|
|
351
364
|
severity: 'info',
|
|
352
365
|
});
|
|
353
|
-
|
|
354
|
-
if (process.platform === 'win32') {
|
|
355
|
-
try { spawnSync('taskkill', ['/F', '/T', '/PID', String(currentChildPid)], { stdio: 'ignore', windowsHide: true, timeout: 3000 }); } catch (_) {}
|
|
356
|
-
}
|
|
366
|
+
killChild('wrapper-change');
|
|
357
367
|
return;
|
|
358
368
|
}
|
|
359
369
|
if (status.version_drifted === true) {
|
|
@@ -377,10 +387,7 @@ function checkWatcherHealth() {
|
|
|
377
387
|
try { fs.unlinkSync(path.join(gmTools, f)); } catch (_) {}
|
|
378
388
|
}
|
|
379
389
|
} catch (_) {}
|
|
380
|
-
|
|
381
|
-
if (process.platform === 'win32') {
|
|
382
|
-
try { spawnSync('taskkill', ['/F', '/T', '/PID', String(currentChildPid)], { stdio: 'ignore', windowsHide: true, timeout: 3000 }); } catch (_) {}
|
|
383
|
-
}
|
|
390
|
+
killChild('version-change');
|
|
384
391
|
}
|
|
385
392
|
}
|
|
386
393
|
|
package/gm.json
CHANGED
package/lib/spool.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
-
const os = require('os');
|
|
4
3
|
|
|
5
4
|
function getSpoolBaseDir() {
|
|
6
5
|
const cwd = process.cwd();
|
|
@@ -162,54 +161,10 @@ async function execSpool(body, lang, options = {}) {
|
|
|
162
161
|
return result;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
|
-
async function execCodesearch(query, options = {}) { return execSpool(query, 'codesearch', options); }
|
|
166
|
-
async function execRecall(query, options = {}) { return execSpool(query, 'recall', options); }
|
|
167
|
-
async function execMemorize(fact, options = {}) { return execSpool(fact, 'memorize', options); }
|
|
168
|
-
|
|
169
|
-
function getAllOutputs() {
|
|
170
|
-
const baseDir = getSpoolBaseDir();
|
|
171
|
-
const outDir = path.join(baseDir, 'out');
|
|
172
|
-
|
|
173
|
-
if (!fs.existsSync(outDir)) {
|
|
174
|
-
return [];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const files = fs.readdirSync(outDir);
|
|
178
|
-
const taskIds = new Set();
|
|
179
|
-
|
|
180
|
-
files.forEach(file => {
|
|
181
|
-
const match = file.match(/^(.+?)\.(out|err|json)$/);
|
|
182
|
-
if (match) {
|
|
183
|
-
taskIds.add(match[1]);
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
return Array.from(taskIds).map(id => readSpoolOutput(id));
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
async function getEvents(sessionId, cwd) {
|
|
191
|
-
try {
|
|
192
|
-
const { getSnapshot } = require('./skill-bootstrap');
|
|
193
|
-
return await getSnapshot(sessionId, cwd);
|
|
194
|
-
} catch (e) {
|
|
195
|
-
return { error: e.message };
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
164
|
module.exports = {
|
|
200
165
|
writeSpool,
|
|
201
166
|
writeSpoolVerb,
|
|
202
167
|
readSpoolOutput,
|
|
203
168
|
waitForCompletion,
|
|
204
|
-
execSpool
|
|
205
|
-
execCodesearch,
|
|
206
|
-
execRecall,
|
|
207
|
-
execMemorize,
|
|
208
|
-
getAllOutputs,
|
|
209
|
-
getSpoolBaseDir,
|
|
210
|
-
generateTaskId,
|
|
211
|
-
validateLang,
|
|
212
|
-
getExtForLang,
|
|
213
|
-
validateVerb,
|
|
214
|
-
getEvents
|
|
169
|
+
execSpool
|
|
215
170
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gm-skill",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1865",
|
|
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",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"files": [
|
|
32
32
|
"skills/",
|
|
33
33
|
"agents/",
|
|
34
|
-
"prompts/",
|
|
35
34
|
"lib/",
|
|
36
35
|
"lang/",
|
|
37
36
|
"scripts/",
|
|
@@ -121,7 +121,7 @@ See `references/research-kernel-extraction.md` for how mixed themes become resea
|
|
|
121
121
|
|
|
122
122
|
### Everyday Problems
|
|
123
123
|
|
|
124
|
-
The same engine works on ordinary decisions, work problems, product questions, and engineering failures
|
|
124
|
+
The same engine works on ordinary decisions, work problems, product questions, and engineering failures -- any well-specified target benefits from being shot into a route rather than answered directly.
|
|
125
125
|
|
|
126
126
|
## Verification
|
|
127
127
|
|
|
@@ -141,7 +141,7 @@ This skill does not:
|
|
|
141
141
|
## References
|
|
142
142
|
|
|
143
143
|
See `references/` directory for:
|
|
144
|
-
- `route-structure.md`
|
|
145
|
-
- `research-kernel-extraction.md`
|
|
146
|
-
- `route-inspection-guide.md`
|
|
147
|
-
- `skills/polaris-protocol/SKILL.md`
|
|
144
|
+
- `route-structure.md` -- what a route is and how it is structured
|
|
145
|
+
- `research-kernel-extraction.md` -- turning ideas into research kernels
|
|
146
|
+
- `route-inspection-guide.md` -- how to verify and attack a route
|
|
147
|
+
- `skills/polaris-protocol/SKILL.md` -- the Polaris Protocol tree root and state machine
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Research Kernel Extraction
|
|
1
|
+
# Research Kernel Extraction -- Fifth-Dimension Engine
|
|
2
2
|
|
|
3
3
|
Mixing two unrelated themes turns them into a theorem-shaped research kernel. The same mechanic generalizes to ordinary research questions.
|
|
4
4
|
|
|
@@ -16,12 +16,12 @@ The engine's job is to move a target from symbol to structure:
|
|
|
16
16
|
1. Name the two themes.
|
|
17
17
|
2. Shoot them together.
|
|
18
18
|
3. Read the returned route: what structure does the engine propose?
|
|
19
|
-
4. Inspect the candidate lemmas
|
|
19
|
+
4. Inspect the candidate lemmas -- are they real mathematical objects, or metaphor?
|
|
20
20
|
5. Keep the parts that survive inspection; discard the parts that are only poetry.
|
|
21
21
|
|
|
22
22
|
## Everyday research use
|
|
23
23
|
|
|
24
|
-
The same pattern works without strangeness
|
|
24
|
+
The same pattern works without strangeness -- shoot an ordinary open research question directly. The engine returns a route: candidate theoretical bounds, objections, open questions. You then verify the lemmas and expand the open debt into real research.
|
|
25
25
|
|
|
26
26
|
## What this does NOT claim
|
|
27
27
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Route Inspection Guide
|
|
1
|
+
# Route Inspection Guide -- Fifth-Dimension Engine
|
|
2
2
|
|
|
3
3
|
A route from the Fifth-Dimension Engine is not a final answer. It is a structure you can inspect, attack, expand, and test. Inspection is your job; the engine only produces the route.
|
|
4
4
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## What a Route Is
|
|
4
4
|
|
|
5
|
-
A route is the **output of the Fifth-Dimension Engine**
|
|
5
|
+
A route is the **output of the Fifth-Dimension Engine** -- a structured, inspectable answer to a complex problem.
|
|
6
6
|
|
|
7
7
|
Instead of a flat statement like "Yes, do this" or "The answer is X," the engine produces:
|
|
8
8
|
|
package/skills/gm/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gm
|
|
3
3
|
description: The primary driver for any non-trivial coding, refactoring, debugging, or multi-step engineering task in a project using this harness -- use it first, for the whole task, not just a piece of it. 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. Not for the post-completion remaining-work check (that is `gm-continue`) or for drift-recovery mid-task (that is `wfgy-method`) -- this skill is the work itself.
|
|
4
|
-
allowed-tools: Skill, Read, Write, Bash(bun *), Bash(npx *)
|
|
4
|
+
allowed-tools: Skill, Read, Write, Bash(bun *), Bash(npx *), Bash(cat *), Bash(date *)
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# gm
|
|
@@ -84,7 +84,7 @@ VERIFY is adversarial, never confirmatory: run the real code path and read its a
|
|
|
84
84
|
|
|
85
85
|
Phase transitions: PLAN -> EXECUTE, EXECUTE -> EMIT, EMIT -> VERIFY, VERIFY -> CONSOLIDATE, CONSOLIDATE -> COMPLETE. Each requires `transition {to:"PHASE"}` dispatch. EXECUTE resolves mutables in `.gm/mutables.yml` before EMIT. EMIT writes file changes. VERIFY validates via `exec_js`/`browser`. CONSOLIDATE pushes changes via `git_finalize` or `git_push`, then witnesses CI/CD pipeline green. COMPLETE gate requires: worktree clean, remote pushed, mutables resolved, and `.ci-validated` marker written with current commit SHA.
|
|
86
86
|
|
|
87
|
-
CI/CD validation in CONSOLIDATE phase: After push succeeds, watch the triggered workflow. When pipeline goes green, dispatch `fs_write {path:".gm/exec-spool/.ci-validated",
|
|
87
|
+
CI/CD validation in CONSOLIDATE phase: After push succeeds, watch the triggered workflow. When pipeline goes green, dispatch `fs_write {path:".gm/exec-spool/.ci-validated", content:"{\"head_sha\":\"<current commit SHA>\"}"}` to mark validation complete -- the marker's file CONTENT is the JSON string `{"head_sha":"<SHA>"}`, passed under the `content` field the fs_write handler reads (not a `body`/`head_sha` object, which the handler ignores). `.ci-validated`'s head_sha must match current HEAD; COMPLETE gate refuses if stale or missing. Red runs require fix + re-push + re-watch; no skip for "it looked safe."
|
|
88
88
|
|
|
89
89
|
Memory via `memorize-fire` dispatch stores in `.gm/rs-learn.db` and is retrieved via `recall` and `auto_recall`. `discipline-note {discipline, text}` writes `.gm/disciplines/<name>/policy.md`; `instruction` auto-surfaces policies from disciplines listed in `.gm/disciplines/enabled.txt`.
|
|
90
90
|
|
|
@@ -117,7 +117,7 @@ Over-claiming (saying something is done when it's only drafted) is the most comm
|
|
|
117
117
|
|
|
118
118
|
### Closure Records
|
|
119
119
|
|
|
120
|
-
For each atom, record what is done, what is missing, what is only partially true, and what is still unsafe to claim. A closure record preserves continuity across rounds so that unfinished work stays visible instead of being buried in prose
|
|
120
|
+
For each atom, record what is done, what is missing, what is only partially true, and what is still unsafe to claim. A closure record preserves continuity across rounds so that unfinished work stays visible instead of being buried in prose -- this is what stops a local step from being promoted into fake global completion.
|
|
121
121
|
|
|
122
122
|
## Interaction with Other Skills
|
|
123
123
|
|
|
@@ -143,10 +143,10 @@ Use Goal Compiler to compile the problem statement, then dispatch to Fifth-Dimen
|
|
|
143
143
|
## References
|
|
144
144
|
|
|
145
145
|
See `references/` directory for:
|
|
146
|
-
- `task-atomization.md`
|
|
147
|
-
- `verification-gates.md`
|
|
148
|
-
- `claim-ceiling-examples.md`
|
|
149
|
-
- `skills/polaris-protocol/SKILL.md`
|
|
146
|
+
- `task-atomization.md` -- how to break work into atoms
|
|
147
|
+
- `verification-gates.md` -- designing verification for each stage
|
|
148
|
+
- `claim-ceiling-examples.md` -- what "complete" actually means in different contexts
|
|
149
|
+
- `skills/polaris-protocol/SKILL.md` -- the Polaris Protocol tree root and state machine that wires this skill to Fifth-Dimension Engine and WFGY-Method
|
|
150
150
|
|
|
151
151
|
## What This Is Not
|
|
152
152
|
|
|
@@ -20,12 +20,12 @@ The point is not optimism or pessimism. It is that a local success should not be
|
|
|
20
20
|
|
|
21
21
|
- Atom A03 "Repair structure" is finished and the file compiles.
|
|
22
22
|
- Claim ceiling: you may say "the structure is repaired and compiles." You may **not** yet say "the bug is fixed" until A04 (verify repair) passes.
|
|
23
|
-
- If A04 is still blocked, saying "fixed" is a ceiling violation
|
|
23
|
+
- If A04 is still blocked, saying "fixed" is a ceiling violation -- it promotes a local step to global completion.
|
|
24
24
|
|
|
25
25
|
### Documentation packaging
|
|
26
26
|
|
|
27
27
|
- You wrote the release note (A06) but A04 (verify repair) never ran.
|
|
28
|
-
- Claim ceiling: you may say "a draft release note exists." You may **not** say "release ready"
|
|
28
|
+
- Claim ceiling: you may say "a draft release note exists." You may **not** say "release ready" -- readiness requires the verification gate first.
|
|
29
29
|
- This is exactly the upstream failure mode: writing the announcement before the repair is verified.
|
|
30
30
|
|
|
31
31
|
### Research synthesis
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
A task atom is the smallest executable unit of work. It must satisfy all of:
|
|
6
6
|
|
|
7
|
-
1. **Atomic**
|
|
8
|
-
2. **Completable**
|
|
9
|
-
3. **Verifiable**
|
|
10
|
-
4. **Interdependent**
|
|
7
|
+
1. **Atomic** -- Cannot be divided further without losing meaning
|
|
8
|
+
2. **Completable** -- Can be finished in one session/sprint
|
|
9
|
+
3. **Verifiable** -- Has clear entrance and exit criteria
|
|
10
|
+
4. **Interdependent** -- Has clear dependencies (blocks/is blocked by other atoms)
|
|
11
11
|
|
|
12
12
|
## Examples
|
|
13
13
|
|
|
@@ -27,7 +27,7 @@ A task atom is the smallest executable unit of work. It must satisfy all of:
|
|
|
27
27
|
|
|
28
28
|
Start with: "Goal: Build a payment microservice."
|
|
29
29
|
|
|
30
|
-
1. **Identify phases**: Research
|
|
30
|
+
1. **Identify phases**: Research -> Design -> Implement -> Test -> Deploy
|
|
31
31
|
2. **For each phase, ask: What's the smallest piece?**
|
|
32
32
|
- Research: API options, compliance, existing solutions
|
|
33
33
|
- Design: Data model, interfaces, error handling
|
|
@@ -40,19 +40,19 @@ Start with: "Goal: Build a payment microservice."
|
|
|
40
40
|
## Dependency Edges
|
|
41
41
|
|
|
42
42
|
Each atom has:
|
|
43
|
-
- **Blockers**
|
|
44
|
-
- **Unblocks**
|
|
43
|
+
- **Blockers** -- Things that must finish before this starts
|
|
44
|
+
- **Unblocks** -- Things that can't start until this finishes
|
|
45
45
|
|
|
46
46
|
Example:
|
|
47
47
|
```
|
|
48
48
|
Research APIs (A1)
|
|
49
|
-
|
|
49
|
+
-> unblocks
|
|
50
50
|
Design interface (A2)
|
|
51
|
-
|
|
51
|
+
-> unblocks
|
|
52
52
|
Implement core (A3)
|
|
53
|
-
|
|
53
|
+
-> unblocks
|
|
54
54
|
Test integration (A4)
|
|
55
|
-
|
|
55
|
+
-> unblocks
|
|
56
56
|
Deploy (A5)
|
|
57
57
|
```
|
|
58
58
|
|
|
@@ -43,17 +43,17 @@ For an atom:
|
|
|
43
43
|
|
|
44
44
|
## Bad Gates
|
|
45
45
|
|
|
46
|
-
- "Complete"
|
|
47
|
-
- "Good enough"
|
|
48
|
-
- "No obvious bugs"
|
|
46
|
+
- "Complete" -- unmeasurable
|
|
47
|
+
- "Good enough" -- too vague
|
|
48
|
+
- "No obvious bugs" -- not verifiable
|
|
49
49
|
- Checking something trivial (wasting time)
|
|
50
50
|
|
|
51
51
|
## Gate Failure
|
|
52
52
|
|
|
53
53
|
If an atom fails its gate:
|
|
54
|
-
- **Do not move forward**
|
|
55
|
-
- **Return to the atom**
|
|
56
|
-
- **Fix or redefine**
|
|
54
|
+
- **Do not move forward** -- you have incomplete work that looks complete
|
|
55
|
+
- **Return to the atom** -- what's actually missing?
|
|
56
|
+
- **Fix or redefine** -- either finish the work or redefine the atom scope
|
|
57
57
|
|
|
58
58
|
This is where fake completion gets caught.
|
|
59
59
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: polaris-protocol
|
|
3
|
-
description: WFGY 5.0 Polaris Protocol
|
|
3
|
+
description: WFGY 5.0 Polaris Protocol -- the active flagship route from onestardao/WFGY. A two-layer reasoning system that compiles goals before execution and shoots complex problems into inspectable routes, with drift control throughout. This skill is the tree root: load it first, then dispatch its child skills as explicit transitions -- polaris-goal-compiler (compile), fifth-dimension-engine (shoot), wfgy-method (drift control). Use for any complex, multi-step, high-stakes, or long-horizon task where premature completion or goal drift is a risk.
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: Portable protocol; upstream released the Goal Compiler ChatGPT-first (teaser) and the Fifth-Dimension Engine as the main product surface. This skill wraps both plus WFGY-Method drift control into one discoverable entry point for any assistant or agent that loads skills.
|
|
6
6
|
metadata:
|
|
@@ -8,19 +8,19 @@ metadata:
|
|
|
8
8
|
provenance: adapted-and-honest-reimplementation-not-verbatim
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# WFGY 5.0
|
|
11
|
+
# WFGY 5.0 -- Polaris Protocol (tree root)
|
|
12
12
|
|
|
13
13
|
Polaris is the active public route of WFGY 5.0. The **Fifth-Dimension Engine** is the current main product surface; the **Polaris Goal Compiler** is the first public protocol component. **WFGY-Method** supplies the drift-control discipline that keeps the whole system aligned with the original goal.
|
|
14
14
|
|
|
15
|
-
This skill is the **tree root**. It does not re-explain the children
|
|
15
|
+
This skill is the **tree root**. It does not re-explain the children -- it wires them into one state machine and tells you which child to dispatch at each step. Treat the three child skills as the transitions of the machine below.
|
|
16
16
|
|
|
17
17
|
## The tree
|
|
18
18
|
|
|
19
19
|
```
|
|
20
|
-
polaris-protocol (this skill
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
polaris-protocol (this skill -- root / entry)
|
|
21
|
+
|-- polaris-goal-compiler (COMPILE state)
|
|
22
|
+
|-- fifth-dimension-engine (SHOOT state)
|
|
23
|
+
`-- wfgy-method (DRIFT CONTROL -- applies at every state)
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
Discoverable: each node is a standalone `SKILL.md` inside its own `skills/<skill-name>/` directory. This root is the entry point; the children are reached by explicit dispatch.
|
|
@@ -37,7 +37,7 @@ A skill tree can behave like a state machine. Each transition is an explicit ski
|
|
|
37
37
|
| `COMPILED` | Goal Compiler emitted task atoms, dependencies, verification gates, claim ceilings, and a closure-record template. |
|
|
38
38
|
| `SHOOTING` | A complex atom is being lifted by Fifth-Dimension Engine into a route. |
|
|
39
39
|
| `EXECUTING` | An atom (routine, or the result of a route) is being carried out. |
|
|
40
|
-
| `VERIFYING` | Output is checked against the atom's verification gate and against drift (
|
|
40
|
+
| `VERIFYING` | Output is checked against the atom's verification gate and against drift (deltaS, via WFGY-Method). |
|
|
41
41
|
| `CLOSED` | Claim ceiling met, closure record written, atom done. |
|
|
42
42
|
|
|
43
43
|
### Transitions (each is a dispatch)
|
|
@@ -58,13 +58,13 @@ VERIFYING --gate fail / drift --> BBCR checkpoint ----> COMPILED (re-compile or
|
|
|
58
58
|
CLOSED --next atom------------------------------------> COMPILED
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
`wfgy-method` is not a single transition
|
|
61
|
+
`wfgy-method` is not a single transition -- it is the drift-control observer attached to **every** state. Before any step that could have drifted, dispatch it and read the result.
|
|
62
62
|
|
|
63
|
-
## Canonical syntax (pro-rata
|
|
63
|
+
## Canonical syntax (pro-rata -- use exactly this)
|
|
64
64
|
|
|
65
65
|
- **Compile first. Execute one active atom. Verify before unlock. Claim only what is supported.** (Goal Compiler)
|
|
66
|
-
- **shoot + [your problem]**
|
|
67
|
-
-
|
|
66
|
+
- **shoot + [your problem]** -- the Fifth-Dimension Engine interface.
|
|
67
|
+
- **deltaS = 1 - cos(I, G)** -- drift between current state (I) and goal (G). Without a real embedding call, deltaS is a qualitative label ("deltaS looks high here"), never a computed decimal -- unless a real `similarity` verb is available (see WFGY-Method).
|
|
68
68
|
|
|
69
69
|
"Compile first. Then shoot." is the spine of the whole protocol.
|
|
70
70
|
|
|
@@ -77,7 +77,7 @@ CLOSED --next atom------------------------------------> COMPILED
|
|
|
77
77
|
3. At `VERIFYING`, dispatch `Skill(skill="wfgy-method")` to check drift and apply the atom's verification gate.
|
|
78
78
|
- Pass + claim ceiling honored -> `CLOSED` -> next atom (back to `COMPILED`).
|
|
79
79
|
- Fail or drift -> BBCR checkpoint, re-compile or re-shoot (back to `COMPILED`).
|
|
80
|
-
4. When all atoms are `CLOSED`, the task is done
|
|
80
|
+
4. When all atoms are `CLOSED`, the task is done -- and only then may you claim completion.
|
|
81
81
|
|
|
82
82
|
## What this tree is not
|
|
83
83
|
|
|
@@ -88,8 +88,8 @@ CLOSED --next atom------------------------------------> COMPILED
|
|
|
88
88
|
|
|
89
89
|
## Children (dispatch these)
|
|
90
90
|
|
|
91
|
-
- `polaris-goal-compiler`
|
|
92
|
-
- `fifth-dimension-engine`
|
|
93
|
-
- `wfgy-method`
|
|
91
|
+
- `polaris-goal-compiler` -- compile the goal into atoms, gates, claim ceilings.
|
|
92
|
+
- `fifth-dimension-engine` -- shoot a complex atom into a structured route.
|
|
93
|
+
- `wfgy-method` -- hold drift control across every state.
|
|
94
94
|
|
|
95
95
|
For the full DAG, integration workflows, and mismatch detection, see `../POLARIS-SKILLS-GUIDE.md`.
|