oh-my-opencode 5.1.29 → 5.1.30

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.
Files changed (121) hide show
  1. package/README.ja.md +2 -0
  2. package/README.ko.md +2 -0
  3. package/README.md +2 -0
  4. package/README.ru.md +2 -0
  5. package/README.zh-cn.md +2 -0
  6. package/dist/cli/cli-program.d.ts +1 -20
  7. package/dist/cli/index.js +942 -49
  8. package/dist/cli/install-command-options.d.ts +20 -0
  9. package/dist/cli/service-auth/browser.d.ts +3 -0
  10. package/dist/cli/service-auth/cli-keystore.fixture.d.ts +7 -0
  11. package/dist/cli/service-auth/commands.d.ts +8 -0
  12. package/dist/cli/service-auth/device-flow.d.ts +15 -0
  13. package/dist/cli/service-auth/device-keys.d.ts +10 -0
  14. package/dist/cli/service-auth/device-name.d.ts +3 -0
  15. package/dist/cli/service-auth/keystore.d.ts +20 -0
  16. package/dist/cli/service-auth/loopback.d.ts +11 -0
  17. package/dist/cli/service-auth/protocol.d.ts +86 -0
  18. package/dist/cli/service-auth/refresh-child.fixture.d.ts +1 -0
  19. package/dist/cli/service-auth/session.d.ts +17 -0
  20. package/dist/cli/service-auth/terminal-text.d.ts +1 -0
  21. package/dist/cli/service-auth/test-support.d.ts +43 -0
  22. package/dist/cli/service-auth/tls-test-certificate.d.ts +4 -0
  23. package/dist/cli-node/index.js +942 -49
  24. package/dist/features/opencode-skill-loader/opencode-shell-skill-content.d.ts +8 -0
  25. package/dist/features/opencode-skill-loader/skill-content.d.ts +1 -0
  26. package/dist/hooks/non-interactive-env/non-interactive-env-hook.d.ts +5 -1
  27. package/dist/index.js +40660 -40393
  28. package/dist/shared/disabled-agents.d.ts +1 -0
  29. package/dist/shared/opencode-shell.d.ts +27 -0
  30. package/dist/skills/browser/SKILL.md +1 -1
  31. package/dist/skills/browser/runtime/omowright/manifest.json +1 -1
  32. package/dist/skills/ultimate-browsing/SKILL.md +14 -16
  33. package/dist/skills/ulw-research/SKILL.md +17 -18
  34. package/dist/skills/ulw-research/scripts/cli-support.test.ts +5 -3
  35. package/dist/skills/ulw-research/scripts/outcome.test.ts +10 -4
  36. package/dist/skills/ulw-research/scripts/report-tools.test.ts +3 -2
  37. package/dist/skills/visual-qa/scripts/cli.test.ts +5 -3
  38. package/dist/tools/session-manager/sdk-storage.d.ts +15 -2
  39. package/dist/tools/session-manager/storage.d.ts +4 -2
  40. package/dist/tui.js +85 -19
  41. package/package.json +15 -14
  42. package/packages/git-bash-mcp/dist/cli.js +1 -1
  43. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +90 -0
  44. package/packages/lsp-core/src/lsp/client.ts +3 -1
  45. package/packages/lsp-core/src/lsp/workspace-apply-edit-test-support.ts +5 -2
  46. package/packages/lsp-daemon/dist/cli.js +1 -1
  47. package/packages/lsp-daemon/dist/client.js +1 -1
  48. package/packages/lsp-daemon/dist/index.js +1 -1
  49. package/packages/lsp-tools-mcp/dist/cli.js +1 -1
  50. package/packages/lsp-tools-mcp/dist/lsp/manager.js +1 -1
  51. package/packages/lsp-tools-mcp/dist/mcp.js +1 -1
  52. package/packages/lsp-tools-mcp/dist/tools.js +1 -1
  53. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  54. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +3 -2
  55. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  56. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  57. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  58. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  59. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  60. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  61. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  62. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  63. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  64. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +1 -1
  65. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  66. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  67. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  68. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  69. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  70. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  71. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  72. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  73. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  74. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  75. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +1 -1
  76. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  77. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +5 -5
  78. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/post-tool-use-recording-spawn-admission.json +1 -1
  87. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  88. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  89. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  90. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  91. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  92. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  93. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  94. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  95. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  96. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  97. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  98. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  99. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  100. package/packages/omo-codex/plugin/package-lock.json +12 -12
  101. package/packages/omo-codex/plugin/package.json +1 -1
  102. package/packages/omo-codex/plugin/scripts/auto-update-plan.mjs +2 -0
  103. package/packages/omo-codex/plugin/scripts/auto-update.mjs +2 -0
  104. package/packages/omo-codex/plugin/scripts/build-bundled-mcp-runtimes.mjs +2 -0
  105. package/packages/omo-codex/plugin/scripts/build-components.mjs +1 -0
  106. package/packages/omo-codex/plugin/scripts/materialize-shared-upstreams.mjs +42 -10
  107. package/packages/omo-codex/plugin/skills/browser/SKILL.md +1 -1
  108. package/packages/omo-codex/plugin/skills/browser/runtime/omowright/manifest.json +1 -1
  109. package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +14 -16
  110. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +17 -18
  111. package/packages/omo-codex/plugin/test/materialize-shared-upstreams.test.mjs +179 -0
  112. package/packages/omo-codex/plugin/test/windows-console-hide.test.mjs +150 -0
  113. package/packages/omo-codex/scripts/install-dist/install-local.mjs +7 -4
  114. package/packages/shared-skills/skills/browser/SKILL.md +1 -1
  115. package/packages/shared-skills/skills/browser/runtime/omowright/manifest.json +1 -1
  116. package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +14 -16
  117. package/packages/shared-skills/skills/ulw-research/SKILL.md +17 -18
  118. package/packages/shared-skills/skills/ulw-research/scripts/cli-support.test.ts +5 -3
  119. package/packages/shared-skills/skills/ulw-research/scripts/outcome.test.ts +10 -4
  120. package/packages/shared-skills/skills/ulw-research/scripts/report-tools.test.ts +3 -2
  121. package/packages/shared-skills/skills/visual-qa/scripts/cli.test.ts +5 -3
@@ -0,0 +1,179 @@
1
+ import assert from "node:assert/strict";
2
+ import { spawnSync } from "node:child_process";
3
+ import { copyFileSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";
4
+ import { tmpdir } from "node:os";
5
+ import { dirname, join } from "node:path";
6
+ import test from "node:test";
7
+ import { fileURLToPath, pathToFileURL } from "node:url";
8
+
9
+ const scripts = join(dirname(fileURLToPath(import.meta.url)), "..", "scripts");
10
+
11
+ // Drive the shipped CLI in a disposable layout. Only external Git results and
12
+ // backoff time are controlled; no test-only export or option is added to it.
13
+ function runCli(t, { failures = 0, strict = true, strictEnv = false, skip = false, pins = "valid" } = {}) {
14
+ const root = realpathSync(mkdtempSync(join(tmpdir(), "omo-materialize-retry-")));
15
+ t.after(() => rmSync(root, { recursive: true, force: true }));
16
+ const entry = join(root, "packages", "omo-codex", "plugin", "scripts");
17
+ const shared = join(root, "packages", "shared-skills");
18
+ mkdirSync(entry, { recursive: true });
19
+ mkdirSync(join(shared, "scripts"), { recursive: true });
20
+ for (const name of ["materialize-shared-upstreams.mjs", "entry-guard.mjs"]) {
21
+ copyFileSync(join(scripts, name), join(entry, name));
22
+ }
23
+ writeFileSync(join(shared, "scripts", "materialize-frontend-refs.mjs"),
24
+ 'export async function materializeFrontendRefs({ strict }) { globalThis.record({ op: "materialize", strict }); return { skipped: false }; }\n');
25
+ writeFileSync(join(shared, "stage-omowright-runtime.mjs"),
26
+ 'export async function stageOmowrightRuntime() { globalThis.record({ op: "stage" }); return { version: "fixture" }; }\n');
27
+ const trace = join(root, "trace.json");
28
+ writeFileSync(trace, "[]");
29
+ const preload = join(root, "git-fixture.mjs");
30
+ writeFileSync(preload, `
31
+ import childProcess from "node:child_process";
32
+ import timers from "node:timers/promises";
33
+ import { syncBuiltinESMExports } from "node:module";
34
+ import { writeFileSync } from "node:fs";
35
+ const events = [];
36
+ const realSleep = timers.setTimeout;
37
+ let attempts = 0;
38
+ let paths = [];
39
+ globalThis.record = (event) => {
40
+ events.push(event);
41
+ writeFileSync(${JSON.stringify(trace)}, JSON.stringify(events));
42
+ };
43
+ childProcess.execFileSync = (command, args, options) => {
44
+ if (command !== "git") throw new Error("unexpected command: " + command);
45
+ record({ op: args[0], args, cwd: options.cwd, windowsHide: options.windowsHide });
46
+ if (args[0] === "submodule") {
47
+ paths = args.slice(4);
48
+ if (++attempts <= ${failures}) throw new Error("fixture fetch unavailable");
49
+ return Buffer.alloc(0);
50
+ }
51
+ if (args[0] !== "ls-files") throw new Error("unexpected Git operation");
52
+ if (${JSON.stringify(pins)} === "error") throw new Error("fixture index unavailable");
53
+ return paths.map((path, i) => {
54
+ const mode = ${JSON.stringify(pins)} === "invalid" ? "100644" : "160000";
55
+ const stage = ${JSON.stringify(pins)} === "unmerged" ? "2" : "0";
56
+ const sha = String(i + 1).repeat(${JSON.stringify(pins)} === "sha256" ? 64 : 40);
57
+ return mode + " " + sha + " " + stage + "\\t" + path + "\\0";
58
+ }).join("");
59
+ };
60
+ timers.setTimeout = async (ms) => {
61
+ record({ op: "sleep", ms });
62
+ await realSleep(15);
63
+ record({ op: "wake", ms });
64
+ };
65
+ syncBuiltinESMExports();
66
+ `);
67
+ const env = { ...process.env };
68
+ delete env.NODE_OPTIONS;
69
+ delete env.OMO_SKIP_MATERIALIZE;
70
+ delete env.OMO_MATERIALIZE_STRICT;
71
+ if (strictEnv) env.OMO_MATERIALIZE_STRICT = "1";
72
+ if (skip) env.OMO_SKIP_MATERIALIZE = "1";
73
+ const result = spawnSync(process.execPath, ["--import", pathToFileURL(preload).href, join(entry, "materialize-shared-upstreams.mjs"), ...(strict ? ["--strict"] : [])], {
74
+ cwd: root, env, encoding: "utf8", windowsHide: true, timeout: 10000,
75
+ });
76
+ assert.ifError(result.error);
77
+ assert.equal(result.signal, null, result.stderr);
78
+ return { ...result, events: JSON.parse(readFileSync(trace, "utf8")), root };
79
+ }
80
+
81
+ const operations = (result) => result.events.map(({ op }) => op);
82
+ const attempts = (result) => result.events.filter(({ op }) => op === "submodule");
83
+ const delays = (result) => result.events.filter(({ op }) => op === "sleep").map(({ ms }) => ms);
84
+
85
+ function assertFetchContract(result, count) {
86
+ assert.equal(attempts(result).length, count);
87
+ for (const call of attempts(result)) {
88
+ assert.deepEqual(call.args.slice(0, 4), ["submodule", "update", "--init", "--recursive"]);
89
+ assert.equal(call.args.includes("--remote"), false);
90
+ assert.equal(call.cwd, result.root);
91
+ assert.equal(call.windowsHide, true);
92
+ }
93
+ }
94
+
95
+ test("#given reachable pins #when strict materialization runs #then fetch once without backoff", (t) => {
96
+ const r = runCli(t);
97
+ assert.equal(r.status, 0, r.stderr);
98
+ assertFetchContract(r, 1);
99
+ assert.deepEqual(operations(r), ["submodule", "materialize", "stage"]);
100
+ });
101
+
102
+ test("#given one failed fetch #when strict materialization retries #then await recovery before staging", (t) => {
103
+ const r = runCli(t, { failures: 1 });
104
+ assert.equal(r.status, 0, r.stderr);
105
+ assertFetchContract(r, 2);
106
+ assert.deepEqual(delays(r), [1000]);
107
+ assert.deepEqual(operations(r), ["submodule", "sleep", "wake", "submodule", "materialize", "stage"]);
108
+ });
109
+
110
+ test("#given two failed fetches #when the final attempt recovers #then stop retrying with bounded backoff", (t) => {
111
+ const r = runCli(t, { failures: 2 });
112
+ assert.equal(r.status, 0, r.stderr);
113
+ assertFetchContract(r, 3);
114
+ assert.deepEqual(delays(r), [1000, 2000]);
115
+ assert.equal(r.events.filter(({ op }) => op === "materialize").length, 1);
116
+ assert.equal(r.events.some(({ op }) => op === "ls-files"), false);
117
+ });
118
+
119
+ test("#given persistent fetch failure #when strict attempts exhaust #then fail with every path and pinned SHA", (t) => {
120
+ const r = runCli(t, { failures: 9 });
121
+ assert.equal(r.status, 1, r.stderr);
122
+ assertFetchContract(r, 3);
123
+ assert.deepEqual(delays(r), [1000, 2000]);
124
+ assert.equal(r.events.some(({ op }) => op === "materialize" || op === "stage"), false);
125
+ assert.match(r.stderr, /failed after 3 attempts/);
126
+ assert.match(r.stderr, /fixture fetch unavailable/);
127
+ const paths = attempts(r)[0].args.slice(4);
128
+ paths.forEach((path, i) => assert.ok(r.stderr.includes(`${path}@${String(i + 1).repeat(40)}`), r.stderr));
129
+ const lookup = r.events.find(({ op }) => op === "ls-files");
130
+ assert.deepEqual(lookup.args, ["ls-files", "--stage", "-z", "--", ...paths]);
131
+ assert.equal(lookup.cwd, r.root);
132
+ assert.equal(lookup.windowsHide, true);
133
+ });
134
+
135
+ test("#given persistent fetch failure #when best-effort attempts exhaust #then warn and materialize once", (t) => {
136
+ const r = runCli(t, { failures: 9, strict: false });
137
+ assert.equal(r.status, 0, r.stderr);
138
+ assertFetchContract(r, 3);
139
+ assert.deepEqual(delays(r), [1000, 2000]);
140
+ assert.deepEqual(operations(r).slice(-3), ["ls-files", "materialize", "stage"]);
141
+ assert.match(r.stderr, /continuing without submodule refresh/);
142
+ assert.equal(r.events.find(({ op }) => op === "materialize").strict, false);
143
+ });
144
+
145
+ test("#given an unreadable index #when retries exhaust #then preserve the original fetch failure and name paths", (t) => {
146
+ const r = runCli(t, { failures: 9, pins: "error" });
147
+ assert.equal(r.status, 1, r.stderr);
148
+ assertFetchContract(r, 3);
149
+ assert.match(r.stderr, /fixture fetch unavailable/);
150
+ for (const path of attempts(r)[0].args.slice(4)) assert.ok(r.stderr.includes(`${path}@unknown`), r.stderr);
151
+ assert.match(r.stderr, /pinned SHA unavailable/);
152
+ });
153
+
154
+ for (const pins of ["invalid", "unmerged"]) {
155
+ test(`#given ${pins} index entries #when reporting failure #then do not invent resolved gitlink pins`, (t) => {
156
+ const r = runCli(t, { failures: 9, pins });
157
+ assert.equal(r.status, 1, r.stderr);
158
+ for (const path of attempts(r)[0].args.slice(4)) assert.ok(r.stderr.includes(`${path}@unknown`), r.stderr);
159
+ });
160
+ }
161
+
162
+ test("#given SHA-256 gitlinks #when retries exhaust #then retain complete pinned object IDs", (t) => {
163
+ const r = runCli(t, { failures: 9, pins: "sha256" });
164
+ assert.equal(r.status, 1, r.stderr);
165
+ attempts(r)[0].args.slice(4).forEach((path, i) => assert.ok(r.stderr.includes(`${path}@${String(i + 1).repeat(64)}`), r.stderr));
166
+ });
167
+
168
+ test("#given strict mode from the environment #when retries exhaust #then fail before downstream materialization", (t) => {
169
+ const r = runCli(t, { failures: 9, strict: false, strictEnv: true });
170
+ assert.equal(r.status, 1, r.stderr);
171
+ assertFetchContract(r, 3);
172
+ assert.equal(r.events.some(({ op }) => op === "materialize"), false);
173
+ });
174
+
175
+ test("#given materialization was already performed #when skip is set #then perform no Git or materializer calls", (t) => {
176
+ const r = runCli(t, { failures: 9, skip: true });
177
+ assert.equal(r.status, 0, r.stderr);
178
+ assert.deepEqual(r.events, []);
179
+ });
@@ -0,0 +1,150 @@
1
+ import assert from "node:assert/strict";
2
+ import { readdirSync, readFileSync } from "node:fs";
3
+ import { dirname, join } from "node:path";
4
+ import test from "node:test";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ // Platform contract (#9838, same class as #7144 and #8501): plugin scripts run from Codex hooks, which
8
+ // have no console of their own. On Windows a console-subsystem child spawned there without windowsHide
9
+ // gets a FRESH console window; the detached `cmd.exe /c npm.cmd` auto-update got one on every update.
10
+ // This gate walks every plugin script and resolves the node:child_process entry points each file
11
+ // imports, so a new call site, or an exec*/fork call a spawn-only regex would miss, cannot ship
12
+ // unflagged. The flag is inert on posix, so the call text is the only place this is provable off Windows.
13
+ const ENTRY_POINTS = ["spawnSync", "spawn", "execFileSync", "execFile", "execSync", "exec", "fork"];
14
+
15
+ // Intentionally visible processes, or calls whose text cannot carry the literal flag, go here with a
16
+ // reason. None today.
17
+ const ALLOWLIST = [];
18
+
19
+ const scriptsDir = join(dirname(fileURLToPath(import.meta.url)), "..", "scripts");
20
+
21
+ // readdirSync returns backslash-separated entries on win32; matching on raw entries would silently
22
+ // find nothing there while the gate still looked green.
23
+ function toPosix(entry) {
24
+ return entry.replaceAll("\\", "/");
25
+ }
26
+
27
+ function scriptSources() {
28
+ return readdirSync(scriptsDir, { recursive: true, encoding: "utf8" })
29
+ .map(toPosix)
30
+ .filter((entry) => /\.(mjs|mts|js|cjs|ts)$/.test(entry))
31
+ .sort();
32
+ }
33
+
34
+ function importedEntryPoints(source) {
35
+ const locals = new Set();
36
+ for (const [, clause] of source.matchAll(/import\s*\{([^}]*)\}\s*from\s*["'](?:node:)?child_process["']/g)) {
37
+ for (const specifier of (clause ?? "").split(",")) {
38
+ const [importedPart, aliasPart] = specifier.split(/\s+as\s+/);
39
+ const imported = (importedPart ?? "").trim().replace(/^type\s+/, "");
40
+ if (!ENTRY_POINTS.includes(imported)) continue;
41
+ locals.add((aliasPart ?? imported).trim());
42
+ }
43
+ }
44
+ return [...locals];
45
+ }
46
+
47
+ // A namespace, default or require import would hide calls from the named-import resolution above, so
48
+ // the gate refuses those forms instead of silently auditing nothing.
49
+ function unsupportedImportForms(source) {
50
+ return [
51
+ /import\s+\*\s+as\s+\w+\s+from\s*["'](?:node:)?child_process["']/,
52
+ /import\s+\w+\s*(?:,\s*\{[^}]*\})?\s*from\s*["'](?:node:)?child_process["']/,
53
+ /require\(\s*["'](?:node:)?child_process["']\s*\)/,
54
+ ].filter((pattern) => pattern.test(source)).length;
55
+ }
56
+
57
+ function callText(source, openingParen) {
58
+ let depth = 0;
59
+ for (let index = openingParen; index < source.length; index += 1) {
60
+ if (source[index] === "(") depth += 1;
61
+ else if (source[index] === ")") {
62
+ depth -= 1;
63
+ if (depth === 0) return source.slice(openingParen, index + 1);
64
+ }
65
+ }
66
+ return source.slice(openingParen);
67
+ }
68
+
69
+ // Comment prose names these functions too, so only the code spelling (identifier then `(`) on a
70
+ // non-comment line counts as a call.
71
+ function isCommentLine(source, offset) {
72
+ const lineStart = source.lastIndexOf("\n", offset - 1) + 1;
73
+ const lead = source.slice(lineStart, offset).trimStart();
74
+ return lead.startsWith("//") || lead.startsWith("*") || lead.startsWith("/*");
75
+ }
76
+
77
+ function collectCalls(file, source) {
78
+ const calls = [];
79
+ for (const local of importedEntryPoints(source)) {
80
+ for (const match of source.matchAll(new RegExp(String.raw`(?<![\w$.])${local}\(`, "g"))) {
81
+ if (isCommentLine(source, match.index)) continue;
82
+ calls.push({
83
+ file,
84
+ line: source.slice(0, match.index).split("\n").length,
85
+ callee: local,
86
+ text: `${local}${callText(source, match.index + match[0].length - 1)}`,
87
+ });
88
+ }
89
+ }
90
+ return calls;
91
+ }
92
+
93
+ function auditedCalls() {
94
+ return scriptSources().flatMap((file) => collectCalls(file, readFileSync(join(scriptsDir, file), "utf8")));
95
+ }
96
+
97
+ function isAllowlisted(call) {
98
+ return ALLOWLIST.some((entry) => entry.file === call.file && entry.callee === call.callee);
99
+ }
100
+
101
+ test("#given every plugin script child_process call #when inspected #then each passes windowsHide: true or is allowlisted with a reason", () => {
102
+ const offenders = auditedCalls()
103
+ .filter((call) => !/windowsHide:\s*true/.test(call.text) && !isAllowlisted(call))
104
+ .map((call) => `${call.file}:${call.line} ${call.callee}`);
105
+
106
+ assert.deepEqual(offenders, []);
107
+ });
108
+
109
+ test("#given every plugin script #when its child_process import is read #then it uses a form the gate can audit", () => {
110
+ const unauditable = scriptSources().filter((file) => unsupportedImportForms(readFileSync(join(scriptsDir, file), "utf8")) > 0);
111
+
112
+ assert.deepEqual(unauditable, []);
113
+ });
114
+
115
+ test("#given the audit #when it runs #then it still reaches the detached auto-update spawn it exists for", () => {
116
+ const autoUpdate = auditedCalls().filter((call) => call.file === "auto-update.mjs" && call.callee === "spawn");
117
+
118
+ assert.ok(autoUpdate.length > 0, "the gate no longer sees auto-update.mjs spawn calls");
119
+ });
120
+
121
+ test("#given the allowlist #when checked #then every entry has a reason and still matches a real call", () => {
122
+ const calls = auditedCalls();
123
+ const stale = ALLOWLIST.filter(
124
+ (entry) => !entry.reason || !calls.some((call) => call.file === entry.file && call.callee === entry.callee),
125
+ );
126
+
127
+ assert.deepEqual(stale, []);
128
+ });
129
+
130
+ test("#given an aliased execFile import without the flag #when audited #then the call is reported, not skipped", () => {
131
+ const source = ['import { execFile as run } from "node:child_process";', 'run("powershell.exe", args, { encoding: "utf8" }, callback);'].join("\n");
132
+
133
+ const calls = collectCalls("fixture.mjs", source);
134
+
135
+ assert.deepEqual(
136
+ calls.map((call) => call.callee),
137
+ ["run"],
138
+ );
139
+ assert.equal(/windowsHide:\s*true/.test(calls[0].text), false);
140
+ });
141
+
142
+ test("#given a namespace child_process import #when checked #then it is refused as unauditable", () => {
143
+ assert.equal(unsupportedImportForms('import * as cp from "node:child_process";'), 1);
144
+ assert.equal(unsupportedImportForms('const cp = require("child_process");'), 1);
145
+ assert.equal(unsupportedImportForms('import { spawn } from "node:child_process";'), 0);
146
+ });
147
+
148
+ test("#given a win32 directory entry #when normalized #then it matches under POSIX separators", () => {
149
+ assert.equal(toPosix("lib\\auto-update.mjs"), "lib/auto-update.mjs");
150
+ });
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // omo-codex-install:83c45a1c78073f1bfdb31c0a25d9fea733aa0d90e789d9e378db864df0e4a431:fcd96f611f49548cfb4f350c4f2a6db29a6e296c08b6a888e8f835ae206e9833
2
+ // omo-codex-install:c0434c323119abd4c8f9dbe2770f25c161f77afbc2510028fd56c1cf8686c9f0:e05728c791992ba8b6cd306a4648b585ac26e82c604e589ee39a47768c95fb09
3
3
  var __esm = (fn, res, err) => () => {
4
4
  if (fn)
5
5
  try {
@@ -9984,7 +9984,7 @@ var package_default;
9984
9984
  var init_package = __esm(() => {
9985
9985
  package_default = {
9986
9986
  name: "@oh-my-opencode/omo-codex",
9987
- version: "5.1.29",
9987
+ version: "5.1.30",
9988
9988
  type: "module",
9989
9989
  private: true,
9990
9990
  description: "Codex harness adapter for oh-my-openagent. Vendored Codex plugin namespace (omo) + TypeScript installer + telemetry.",
@@ -10239,6 +10239,9 @@ function resolveStdio(options) {
10239
10239
  }
10240
10240
  return [options.stdin ?? "ignore", options.stdout ?? "pipe", options.stderr ?? "inherit"];
10241
10241
  }
10242
+ function createBunSpawnOptions(options) {
10243
+ return { ...options, windowsHide: true };
10244
+ }
10242
10245
  function createNodeSpawnOptions(options, platform = process.platform) {
10243
10246
  const nodeOptions = {
10244
10247
  stdio: resolveStdio(options),
@@ -10327,7 +10330,7 @@ function spawn(cmdOrOpts, opts) {
10327
10330
  const { cmd, opts: options } = resolveCommand(cmdOrOpts, opts);
10328
10331
  const bun = getBunRuntime();
10329
10332
  if (bun)
10330
- return wrapBunProcess(bun.spawn(cmd, options));
10333
+ return wrapBunProcess(bun.spawn(cmd, createBunSpawnOptions(options)));
10331
10334
  const [bin, ...args] = cmd;
10332
10335
  if (!bin)
10333
10336
  throw new Error("spawn requires a command");
@@ -10409,7 +10412,7 @@ function isKnownNonGitBashLauncher(path) {
10409
10412
  }
10410
10413
  function whereCommand(command) {
10411
10414
  try {
10412
- return execFileSync("where", [command], { encoding: "utf8" }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
10415
+ return execFileSync("where", [command], { encoding: "utf8", windowsHide: true }).split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0);
10413
10416
  } catch (error) {
10414
10417
  if (error instanceof Error)
10415
10418
  return [];
@@ -11,7 +11,7 @@ One library, two engines. omowright ships inside this skill; choose the engine b
11
11
  |---|---|---|
12
12
  | A site the user is signed into, their open tabs, a form, a click-through, a screenshot, web QA, an extension popup | **attached** — the user's own browser through BrowserSkill | `connectBrowserSkill()` |
13
13
  | A throwaway profile, bot-scoring evasion, a CAPTCHA, network interception, a QA flight trace, coordinate control, headless runs | **owned** — a browser your code launches | `connectPipe()` / `connectCloakProfile()` — [references/owned-engine/README.md](references/owned-engine/README.md) |
14
- | Text out of a URL, a 403 bypass, a platform that blocks fetchers | neither | the `ultimate-browsing` skill |
14
+ | A 403/WAF host the attached engine cannot open, a platform with a native reader, an archive snapshot | neither | the `ultimate-browsing` skill |
15
15
 
16
16
  **Attached is the default,** because it is the only engine carrying the user's logins and the only
17
17
  one where a human is a single call away. Never substitute one engine for the other silently: if
@@ -5,5 +5,5 @@
5
5
  "index.js": "b6b064fab277031c6c51f5a58b84b31040f9960bf767bf646adc0540c1d25c1b",
6
6
  "page-bundle.js": "bfd51e8383cf47200d57387bbbed258bce5a3a3d00c38fc108034d2888e23f0c"
7
7
  },
8
- "stagedAtUtc": "2026-10-09T17:46:21.855Z"
8
+ "stagedAtUtc": "2026-10-11T14:43:14.044Z"
9
9
  }
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: ultimate-browsing
3
- description: "Renders, drives, and screenshots web pages: JS-rendered sources, clicks and forms, persistent logins, WAF-blocked hosts (platform-native readers, stealth Chrome), and the browsing lane of a research run, with screenshots as provenance. Not for plain search or unblocked static fetch."
3
+ description: "Reaches web pages the user's browser cannot open: WAF-blocked and bot-scored hosts, platform-native readers (Chinese and social platforms), archive snapshots with provenance, and a browser you own for stealth or throwaway profiles. Not for plain search, an unblocked static fetch, or a page the user's browser can open."
4
4
  ---
5
5
 
6
6
  # Ultimate Browsing
7
7
 
8
- Web access for everything a plain fetch cannot finish: a page that renders in JS, a click or a form, a screenshot, a login that must persist across pages, or a host that blocks generic fetchers (WAF / 403 / Cloudflare). Start at the cheapest tier that can do the job and climb only when it cannot:
8
+ Web access for the hosts the user's browser cannot open (WAF / 403 / Cloudflare / bot-scored pages) and for platforms with a native reader. Reading and interaction on a page the user's browser can open belong to the `browser` skill's attached engine, not here. Start at the cheapest tier that can reach the blocked host and climb only when it cannot:
9
9
 
10
10
  **Tier 1 — insane-search** (headless extraction + WAF bypass) -> **Tier 1.5 — agent-reach** (platform-native APIs, esp. Chinese platforms) -> **Tier 2 — a real browser** through omowright from js eval: 2a the owned engine (a browser your code launches, CloakBrowser for stealth), 2b the attached engine (the user's own signed-in browser).
11
11
 
@@ -14,29 +14,27 @@ Web access for everything a plain fetch cannot finish: a page that renders in JS
14
14
  ```
15
15
  User request
16
16
  |
17
- +- extract text/data from a URL --------------------- TIER 1 insane-search
17
+ +- a page the user's browser can open (read, click, screenshot, QA, login) NOT this skill (browser skill, attached engine)
18
+ +- simple search query ------------------------------ NOT this skill (use web-search)
19
+ |
18
20
  +- URL blocked / 403 / Cloudflare / WAF ------------- TIER 1 insane-search
19
21
  +- YouTube/Vimeo/TikTok subtitles or metadata ------- TIER 1 insane-search (yt-dlp)
20
- +- read an article / blog / Reddit / HN / arXiv ----- TIER 1 insane-search
22
+ +- archive snapshot of a dead or changed page ------- TIER 1 insane-search (surrogates, provenance-tagged)
21
23
  |
22
24
  +- Chinese platform (xhs/douyin/weibo/bilibili/v2ex/wechat) TIER 1.5 agent-reach
23
25
  +- podcast transcript / stock forum ----------------- TIER 1.5 agent-reach
24
26
  +- Twitter feed / LinkedIn profile / GitHub via CLI - TIER 1.5 agent-reach
25
27
  |
26
- +- Tier 1/1.5 returned empty or partial ------------- TIER 2 2a owned engine -> 2b attached engine
27
- +- click / fill form / scroll / interact ------------ TIER 2 2a owned engine -> 2b attached engine
28
- +- screenshot / render / play video ----------------- TIER 2 2a owned engine -> 2b attached engine
29
- +- login session across pages / the user's account --- TIER 2 2b attached engine (their browser)
30
- +- test web app / QA / dogfood ---------------------- TIER 2 2a owned engine -> 2b attached engine
31
- |
32
- +- simple search query ------------------------------ NOT this skill (use web-search)
28
+ +- Tier 1/1.5 returned empty or partial ------------- TIER 2 2a owned engine (stealth)
29
+ +- a blocked host that also needs a click, a scroll or a screenshot TIER 2 2a owned engine
30
+ +- the user's account on a host the owned engine cannot pass TIER 2 2b attached engine (their browser)
33
31
  ```
34
32
 
35
33
  Read the matching reference before acting: [`references/insane-search/README.md`](references/insane-search/README.md), [`references/agent-reach/README.md`](references/agent-reach/README.md), or [`references/chrome-stealth.md`](references/chrome-stealth.md).
36
34
 
37
35
  ## Tier 1 — insane-search (headless extraction)
38
36
 
39
- **When**: content extraction, blocked-URL bypass, media metadata — no browser UI needed.
37
+ **When**: blocked-URL bypass, media metadata, archive surrogates — no browser UI needed.
40
38
  **Why first**: ~10x faster than a browser, no process spin-up; handles most "fetch this blocked page" requests via curl_cffi TLS impersonation, yt-dlp (1858 sites), official public APIs, mobile URL transforms, **Phase-2.5 surrogate archives** (Wayback / archive.today snapshots, provenance-tagged — see [`references/insane-search/cache-archive.md`](references/insane-search/cache-archive.md)), a key-gated Jina Reader (`JINA_API_KEY`), and a Playwright real-Chrome fallback. The engine lives **inside this skill** at `engine/` and is invoked as a module. Surrogate results are dated COPIES: a result whose `provenance` is `snapshot` must be reported with its `snapshot_timestamp`, never presented as the live page.
41
39
 
42
40
  ```bash
@@ -56,7 +54,7 @@ The full engine harness (rules R1-R7, the Phase 0 official-API index, the no-sit
56
54
 
57
55
  ### Escalate to Tier 1.5 or Tier 2 when
58
56
  - The target is a Chinese / social platform with a native reader -> Tier 1.5.
59
- - insane-search returns empty/partial, or the page needs JS interaction, a screenshot, a persistent login, or media playback -> Tier 2.
57
+ - insane-search returns empty/partial, or the blocked page needs JS interaction, a screenshot, or media playback -> Tier 2.
60
58
 
61
59
  ## Tier 1.5 — agent-reach (platform-native readers)
62
60
 
@@ -82,7 +80,7 @@ Routing table, per-platform auth (set `TWITTER_*` env vars, `gh auth login`, a t
82
80
 
83
81
  ## Tier 2 — a real browser (real interaction)
84
82
 
85
- **When**: real interaction is needed (clicks, forms, screenshots, video, persistent login), or Tier 1/1.5 failed.
83
+ **When**: Tier 1/1.5 failed on a blocked host, or that host needs interaction (clicks, scroll, screenshots, video). A page the user's browser can open is the `browser` skill's job, attached engine first.
86
84
 
87
85
  Both tiers are omowright, staged inside the `browser` skill and loaded from js eval:
88
86
 
@@ -110,9 +108,9 @@ try {
110
108
 
111
109
  The rest of the surface (CUA coordinates, captcha solving, routes, traces, frames, human handoff) is in the `browser` skill's `references/owned-engine/`. A stealth binary is not proof of access: inspect the rendered result and report challenges that remain.
112
110
 
113
- ### Tier 2b — attached engine (logged-in pages)
111
+ ### Tier 2b — attached engine (the user's account on a blocked host)
114
112
 
115
- When the page needs the user's account, drive the browser they are already signed into instead of cloning their profile: `connectBrowserSkill()` → `session.navigate` → `bskSnapshot(session)` / `session.observe()` → `session.click` → `session.stop()`. NEVER launch against or clear cookies/cache/site data from the user's live profile, and never fall back to the owned engine for an authenticated criterion: if no extension is connected, run the `browser` skill's onboarding script and relay its one human step. The full loop is the `browser` skill.
113
+ When the blocked flow needs the user's account, drive the browser they are already signed into instead of cloning their profile: `connectBrowserSkill()` → `session.navigate` → `bskSnapshot(session)` / `session.observe()` → `session.click` → `session.stop()`. NEVER launch against or clear cookies/cache/site data from the user's live profile, and never fall back to the owned engine for an authenticated criterion: if no extension is connected, run the `browser` skill's onboarding script and relay its one human step. The full loop is the `browser` skill.
116
114
 
117
115
  ### Cookie login (cross-platform)
118
116
 
@@ -86,7 +86,7 @@ Saturation research defaults to teammode, not isolated fire-and-forget workers:
86
86
 
87
87
  ## Worker ground rules
88
88
 
89
- Research workers (explore, librarian, browsing) differ by harness, but assume:
89
+ Research workers (explore, web, repo-dive) differ by harness, but assume:
90
90
 
91
91
  - **Read-only.** Most research workers cannot write files. Never ask a worker to write the journal or any session file — every journal write is yours.
92
92
  - **No recursion — workers AND members.** Workers cannot spawn their own subagents, and team members must not re-orchestrate: a member researches its axis and reports; it never stands up its own team, loads this skill, or fans out a research swarm of its own. Depth comes from YOUR expansion waves. Say so in every spawn message — a member that starts its own research protocol burns the run's budget on duplicated orchestration and returns nothing you can cite.
@@ -119,11 +119,13 @@ Before spawning anything, decompose the query. Start from "what must be true if
119
119
  <analysis>
120
120
  Core question: <the actual information need>
121
121
  Axes (3+ orthogonal): <axis — what to search, where, why> ...
122
- Codebase relevant: <yes/no> · External: <yes/no> · Browsing: <yes/no> · Verification likely: <yes/no>
122
+ Codebase relevant: <yes/no> · External: <yes/no> · Collection: <search-only | browser> · Verification likely: <yes/no>
123
123
  Scale: <axis count, source territories, target document length> · Precision demand: <what a wrong claim costs here> → lifecycle: <single team | research team then refinement team>
124
124
  </analysis>
125
125
  ```
126
126
 
127
+ `Collection` is `search-only` only when a result snippet settles every axis (a date, a version, a spec value); anything that needs reading a source is `browser`.
128
+
127
129
  Then create the session directory:
128
130
 
129
131
  ```bash
@@ -169,26 +171,23 @@ Otherwise launch the entire first wave in one turn — every axis at once, as te
169
171
 
170
172
  Scaling floor — more angles always justify more workers:
171
173
 
172
- | Query scope | explore | librarian | browsing | repo-dive | floor |
173
- |---|---|---|---|---|---|
174
- | Single topic, codebase only | 3 | 0 | 0 | 0 | 3 |
175
- | Single topic, web only | 0 | 4 | 1 | 1 | 6 |
176
- | Single topic, both | 2 | 3 | 1 | 1 | 7 |
177
- | Multi-faceted | 4 | 6 | 2 | 2 | 14 |
178
- | Full due diligence | 4 | 6 | 3 | 2 | 15 |
179
-
180
- The browsing column is BINDING, not advisory: when the brief says `Browsing: yes`, the roster names a browsing-worker angle, armed with the `ultimate-browsing` skill, before the first wave launches, and that worker is spawned in the same turn as the rest of the wave. A run that reaches wave 2 with zero browsing workers on a `Browsing: yes` brief has silently downgraded every source to what plain fetch happened to return.
174
+ | Query scope | explore | web | repo-dive | floor |
175
+ |---|---|---|---|---|
176
+ | Single topic, codebase only | 3 | 0 | 0 | 3 |
177
+ | Single topic, web only | 0 | 5 | 1 | 6 |
178
+ | Single topic, both | 2 | 4 | 1 | 7 |
179
+ | Multi-faceted | 4 | 8 | 2 | 14 |
180
+ | Full due diligence | 4 | 9 | 2 | 15 |
181
181
 
182
182
  **Disambiguate before you expand.** When the topic names something that could resolve several ways — a product, a person, a codename, a version — the first wave settles WHICH entity before any worker researches its history, benchmarks, or controversies: canonical name, first-party URL or account, whether it exists in the claimed category, and a confidence line. An unresolved entity never becomes a premise in a later wave's spawn message; that is exactly how a run starts inventing facts about something that does not exist.
183
183
 
184
184
  Role protocols — embed the relevant one in each spawn message; every worker gets a unique angle:
185
185
 
186
186
  - **Codebase (explore), 2-4 workers.** Grep with 3+ keyword variations; structural/AST search; LSP definitions and references; file-name globs; `git log --all -S '<keyword>'` and `--grep` for history including deleted code. Cross-validate hits across tools. Report absolute file paths, patterns with `file:line`, and how findings connect.
187
- - **Web (librarian), 3-6 workers.** At least 10 distinct websearch queries per worker, each with a different operator or angle (see Search craft); fetch the full page for every result that matters — snippets lie. Context7 with 3+ queries per known library. grep.app and `gh search code|repos|issues` for real-world usage. Official docs via sitemap discovery (`<base>/sitemap.xml`), then targeted pages.
188
- - **Browsing, 1-3 workers on a `Browsing: yes` brief (0 otherwise), every one loaded with the `ultimate-browsing` skill.** The skill owns the routing — the harness's own browser first, then its extraction engine with archive surrogates, platform-native readers, and Chrome stealth as each source demands; the worker owns the deliverable. This worker RENDERS pages, it does not re-fetch them: its standing deliverable is a full-page screenshot of every top source plus the rendered text plain fetch could not reach; a worker that returns only fetched text has not done its job. JS-rendered, login-gated, WAF-blocked, and screenshot-bearing sources all belong here rather than in the web lane. **Provenance is part of the claim**: when a source came back with `provenance` of `snapshot` (an archive copy), cite it with its `snapshot_timestamp` and never state it as the current live page; content from a `proxy` route is `untrusted` and needs a second independent route before any claim rests on it. When one blocked territory hides many leads, fan out more browsing subagents in parallel for breadth instead of serializing one worker through them.
187
+ - **Web, 3-9 workers, every one loaded with the `browser` skill.** Search with 10+ websearch queries per worker, each with a different operator or angle (see Search craft); a result is a candidate, not a source. Read every candidate in the user's browser through the `browser` skill's attached engine: one named session per worker, one tab per source, several tabs open side by side while sources are compared — `session.tabCreate` / `tabSelect` / `tabClose` where the harness has a JS eval kernel, `bsk tab create --url <url>` / `tab select <id>` / `tab close <id>` / `tab list` on the CLI — the page scrolled to its end, a full-page screenshot of each top source saved as provenance, the tab closed once reported. A browser on another machine is reached through the `browser` skill's remote reference or a user-level skill that bridges to it, never replaced by a local headless one. `webfetch` is for raw files only: PDF, JSON, feeds, sitemaps. A host the browser cannot open (WAF, bot score, 403) goes to `ultimate-browsing`, whose provenance travels with the claim: a `snapshot` result cites its `snapshot_timestamp` and is never stated as the live page; a `proxy` result is `untrusted` until a second independent route agrees. Context7 with 3+ queries per known library; grep.app and `gh search code|repos|issues` for real-world usage; official docs via sitemap discovery (`<base>/sitemap.xml`), then targeted pages. A worker whose sources are all fetched text has searched, not read.
189
188
  - **Repo deep-dive (librarian), 0-2 workers.** Shallow-clone the most relevant repos to `${TMPDIR:-/tmp}`, pin the HEAD SHA, read core modules, follow call chains, return SHA-pinned permalinks.
190
189
 
191
- Example spawn (codebase axis; librarian, browsing, and repo-dive follow the same contract with their own protocol):
190
+ Example spawn (codebase axis; web and repo-dive follow the same contract with their own protocol):
192
191
 
193
192
  ```
194
193
  task(subagent_type="explore", run_in_background=true, prompt="TASK: act as a codebase researcher. AXIS: <specific angle>.
@@ -207,9 +206,9 @@ This loop is what makes the mode research rather than search. Collect returns as
207
206
  3. Spawn an expansion worker immediately for each new unchecked lead:
208
207
 
209
208
  ```
210
- task(subagent_type="librarian", run_in_background=true, prompt="TASK: expansion wave <N> — investigate: <lead>.
209
+ task(category="deep-low", load_skills=["browser"], run_in_background=true, prompt="TASK: expansion wave <N> — investigate: <lead>.
211
210
  PARENT: <which return surfaced it>. This is an explicit exhaustive-research assignment; budgets do not apply.
212
- <role protocol for the lead's territory — librarian protocol for external leads, explore protocol for codebase leads>
211
+ <role protocol for the lead's territory — web protocol for external leads, explore protocol for codebase leads>
213
212
  End your reply with the ## EXPAND tail.")
214
213
  ```
215
214
 
@@ -331,7 +330,7 @@ Asset workers (background, parallel, each fed `design-spec.md`) — visuals are
331
330
  - **Charts for every quantitative finding, computed from real data.** Pull the numbers into an actual table first (CSV/JSON under `$SESSION_DIR`), then plot from that table, never from prose. Follow the data-scientist tool doctrine — numpy always, Polars for filtering/sorting/transforms, DuckDB for joins/aggregations/window functions, never pandas — and load the `data-scientist` skill when this session has it: `uv run --with numpy --with polars --with duckdb --with pyarrow --with matplotlib python`. Keep `pyarrow` in that set — the DuckDB-to-Polars handoff (`.pl()`) fails without it, and `.df()` fails without pandas, so hand data across through `.pl()`, never `.df()`. Save to `$SESSION_DIR/assets/`.
332
331
  - **Mermaid graphs** for process, architecture, argument, timeline, and evidence-flow structure, themed to the spec's fonts and palette. Render each to SVG and confirm the file exists before the document references it.
333
332
  - **Generated visuals through the imagegen skill whenever the session has it:** a cover plus a concept illustration per major theme, prompted from the spec's style, palette, and mood — document-styled illustration, never generic stock art dropped into a designed page.
334
- - **Full-page screenshots** of the top 5-10 sources (browsing worker) as provenance you can show.
333
+ - **Full-page screenshots** of the top 5-10 sources, saved by the web workers while reading, as provenance you can show.
335
334
 
336
335
  **Verify the asset manifest before rendering.** List every asset the document references, assert each file exists and is non-empty on disk, and re-render whatever is missing. A document that renders with three broken diagrams is a document you will publish twice.
337
336
 
@@ -390,7 +389,7 @@ High-yield combinations: official docs (`site:<docs domain>`), GitHub implementa
390
389
  | Obeying a surrounding "stop exploring" rule mid-research | Authority section — those rules do not bind this mode |
391
390
  | Asking a worker to write journal or session files | Workers are read-only; you journal every return |
392
391
  | Two workers given the same angle | One unique angle per worker, always |
393
- | A `Browsing: yes` run whose roster carries no browsing worker, or a browsing worker spawned without `ultimate-browsing` | The browsing column is binding — name the angle in the brief and spawn it, armed with the skill, in the first wave before any lead is chased |
392
+ | A web worker that returned only fetched text, or a `Collection: browser` run whose workers never opened a tab | Sources are read in the user's browser through the `browser` skill; `webfetch` is for raw files; every web worker carries the skill from the first wave |
394
393
  | Contested claim settled by judgment | Phase 3 — run code, capture output, verdict |
395
394
  | Deliverable claims without citations | Every claim cites a source or a verification artifact |
396
395
  | Guessing the deliverable format | Derive it from the request and destination; ask the empty-info interview only for what is still missing, and record `answered_by` for every field |
@@ -1,5 +1,5 @@
1
- import { describe, expect, test } from "bun:test"
2
- import { mkdtempSync, readdirSync, readFileSync, writeFileSync } from "node:fs"
1
+ import { describe, expect, onTestFinished, test } from "bun:test"
2
+ import { mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"
3
3
  import { tmpdir } from "node:os"
4
4
  import { join } from "node:path"
5
5
  import { pathToFileURL } from "node:url"
@@ -8,7 +8,9 @@ import { CliError, exitCodeFor, parseArgs, readJsonFile, writeJsonAtomic } from
8
8
  import { isCliEntry } from "./entry-guard.mjs"
9
9
 
10
10
  function tempDir() {
11
- return mkdtempSync(join(tmpdir(), "report-tools-"))
11
+ const dir = mkdtempSync(join(tmpdir(), "report-tools-"))
12
+ onTestFinished(() => rmSync(dir, { recursive: true, force: true }))
13
+ return dir
12
14
  }
13
15
 
14
16
  describe("parseArgs", () => {
@@ -1,5 +1,5 @@
1
- import { describe, expect, test } from "bun:test"
2
- import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, writeFileSync } from "node:fs"
1
+ import { describe, expect, onTestFinished, test } from "bun:test"
2
+ import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"
3
3
  import { tmpdir } from "node:os"
4
4
  import { join } from "node:path"
5
5
 
@@ -22,8 +22,14 @@ import {
22
22
  const STAMP = "20260101-120000"
23
23
  const START_LOCAL = new Date(2026, 0, 1, 12, 0, 0)
24
24
 
25
+ function tempRoot(): string {
26
+ const root = mkdtempSync(join(tmpdir(), "ulw-outcome-"))
27
+ onTestFinished(() => rmSync(root, { recursive: true, force: true }))
28
+ return root
29
+ }
30
+
25
31
  function sessionDir(): string {
26
- const dir = join(mkdtempSync(join(tmpdir(), "ulw-outcome-")), STAMP)
32
+ const dir = join(tempRoot(), STAMP)
27
33
  mkdirSync(dir)
28
34
  return dir
29
35
  }
@@ -57,7 +63,7 @@ describe("initManifest", () => {
57
63
 
58
64
  test("#given a session dir without a YYYYMMDD-HHMMSS basename #when initialised #then it throws a typed error", () => {
59
65
  // given
60
- const dir = mkdtempSync(join(tmpdir(), "ulw-outcome-"))
66
+ const dir = tempRoot()
61
67
  // when / then
62
68
  expect(() => initManifest({ sessionDir: dir, promised: ["pdf"], lane: null })).toThrow(OutcomeError)
63
69
  })