oh-my-opencode 5.0.0-beta.8 → 5.0.0-beta.9

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 (114) hide show
  1. package/.agents/command/publish.md +44 -16
  2. package/.agents/skills/publish/SKILL.md +44 -16
  3. package/.opencode/command/publish.md +44 -16
  4. package/dist/agents/atlas/agent.d.ts +0 -1
  5. package/dist/cli/index.js +34 -31
  6. package/dist/cli/run/on-complete-hook.d.ts +2 -0
  7. package/dist/cli-node/index.js +34 -31
  8. package/dist/hooks/atlas/final-wave-approval-gate.test-support.d.ts +50 -0
  9. package/dist/hooks/atlas/system-reminder-templates.d.ts +0 -1
  10. package/dist/index.js +25 -24
  11. package/dist/shared/shell-env.d.ts +1 -1
  12. package/dist/skills/ultimate-browsing/ATTRIBUTION.md +35 -8
  13. package/dist/skills/ultimate-browsing/engine/AGENTS.md +110 -0
  14. package/dist/tui.js +2 -2
  15. package/package.json +15 -14
  16. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  17. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  18. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  19. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +2 -2
  20. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +2 -2
  21. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  22. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  23. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  24. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  25. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  26. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  27. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  28. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +3 -17
  29. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +2 -2
  30. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  31. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  32. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  33. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  34. package/packages/omo-codex/plugin/components/rules/test/bundled-rules-priority.test.ts +11 -16
  35. package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +16 -23
  36. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-budget.test.ts +9 -7
  37. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-context.test.ts +0 -6
  38. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-dedup.test.ts +6 -4
  39. package/packages/omo-codex/plugin/components/rules/test/codex-hook-post-compact-directive.test.ts +12 -9
  40. package/packages/omo-codex/plugin/components/rules/test/codex-hook.test.ts +28 -37
  41. package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +37 -69
  42. package/packages/omo-codex/plugin/components/rules/test/hook-output.test.ts +2 -3
  43. package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -15
  44. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  45. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  46. package/packages/omo-codex/plugin/components/start-work-continuation/test/cli.test.ts +0 -3
  47. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +2 -16
  48. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  49. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  50. package/packages/omo-codex/plugin/components/teammode/test/thread-title-hook.test.ts +3 -9
  51. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  52. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  53. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  54. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  55. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +0 -136
  56. package/packages/omo-codex/plugin/components/ultrawork/test/skill-pointer.test.ts +0 -2
  57. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  58. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  59. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-continuation.test.ts +0 -1
  60. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +2 -2
  61. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-hook.test.ts +0 -3
  62. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +2 -35
  63. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +4 -5
  64. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  65. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  66. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  67. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  68. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  69. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  70. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  71. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  72. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  73. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  74. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  75. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  76. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  77. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  78. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  79. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  80. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  81. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  82. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  83. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  84. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  85. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  86. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  87. package/packages/omo-codex/plugin/package-lock.json +20 -20
  88. package/packages/omo-codex/plugin/package.json +1 -1
  89. package/packages/omo-codex/plugin/skills/ultimate-browsing/ATTRIBUTION.md +35 -8
  90. package/packages/omo-codex/plugin/skills/ultimate-browsing/engine/AGENTS.md +110 -0
  91. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +19 -173
  92. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +4 -24
  93. package/packages/omo-codex/plugin/test/aggregate-plugin-fixture.mjs +175 -13
  94. package/packages/omo-codex/plugin/test/aggregate.test.mjs +78 -2
  95. package/packages/omo-codex/plugin/test/auto-update-release-notes.test.mjs +19 -33
  96. package/packages/omo-codex/plugin/test/lcx-contribute-bug-fix-template.test.mjs +21 -27
  97. package/packages/omo-codex/plugin/test/scaffold-plan.test.mjs +0 -36
  98. package/packages/omo-codex/plugin/test/sync-skills-codex-compatibility.test.mjs +101 -0
  99. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +1 -119
  100. package/packages/omo-codex/plugin/test/teammode-archive-ambiguity.test.mjs +0 -40
  101. package/packages/omo-codex/plugin/test/teammode-communication.test.mjs +6 -62
  102. package/packages/omo-codex/plugin/test/teammode-thread-links.test.mjs +3 -36
  103. package/packages/omo-codex/plugin/test/teammode-transport.test.mjs +0 -44
  104. package/packages/omo-codex/plugin/test/teammode-worktree.test.mjs +2 -6
  105. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +0 -3
  106. package/packages/omo-codex/plugin/test/ulw-plan-review-state-contract.test.mjs +0 -3
  107. package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
  108. package/packages/omo-codex/scripts/install-lazycodex-version-stamp.test.mjs +7 -2
  109. package/packages/shared-skills/skills/ultimate-browsing/ATTRIBUTION.md +35 -8
  110. package/packages/shared-skills/skills/ultimate-browsing/engine/AGENTS.md +110 -0
  111. package/dist/tools/call-omo-agent/background-agent-executor.d.ts +0 -5
  112. package/packages/omo-codex/plugin/test/aggregate-skills.test.mjs +0 -92
  113. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +0 -314
  114. package/packages/omo-codex/plugin/test/ulw-plan-scope-contract.test.mjs +0 -24
@@ -2,6 +2,116 @@
2
2
 
3
3
  **Generated:** 2026-08-10 / 38d268995
4
4
 
5
+ ## UPSTREAM BASELINE AND VERSION POLICY
6
+
7
+ **READ THIS BEFORE TOUCHING `engine/**` OR PROPOSING AN UPSTREAM SYNC.**
8
+
9
+ This engine is NOT project-original code. It is a vendored-and-modified snapshot of
10
+ [fivetaku/insane-search](https://github.com/fivetaku/insane-search), and the version
11
+ we run on is a deliberate choice, not an accident of neglect.
12
+
13
+ ### The pin
14
+
15
+ | Fact | Value |
16
+ |---|---|
17
+ | Upstream project | `https://github.com/fivetaku/insane-search` |
18
+ | Vendoring commit | `a4e4ed797` (2026-06-21) `feat(ultimate-browsing): vendor insane-search engine (junk-excluded)` |
19
+ | De-personalization | `4743199a5` (2026-06-21) |
20
+ | Pinned upstream baseline | upstream state as of 2026-06-21, **pre-0.7.0** (0.7.0 is dated 2026-06-22) |
21
+ | Re-vendors since | none — every later change here is ours |
22
+
23
+ We intentionally track a **pinned baseline plus local divergence**, not upstream HEAD.
24
+ There is no submodule and no automated drift check for this engine (unlike the
25
+ `frontend` skill's upstream submodules): the vendored files ARE the source of truth,
26
+ and upstream is a reference we port FROM, deliberately, file by file.
27
+
28
+ ### Why we do not blind-rebase onto upstream HEAD
29
+
30
+ 1. **Upstream reset its public history.** On 2026-08-06 upstream published a single
31
+ squashed commit, `019ee16 refactor: reset public history at 0.14.0`, discarding the
32
+ prior public history through 0.13.x. There is no upstream commit graph to rebase onto and no
33
+ way to cherry-pick an individual upstream change by sha — only whole-file diffing
34
+ against a moving HEAD.
35
+ 2. **Upstream 0.14.0 REMOVED capability.** The endpoint-mining / internal-API
36
+ auto-derivation / site-recipe subsystems that upstream carried publicly between
37
+ 0.12.0 and 0.14.0 are gone from upstream HEAD. Syncing to HEAD is therefore not
38
+ strictly an upgrade: parts of it are a downgrade relative to the intermediate
39
+ versions, and none of it is recoverable from the reset history.
40
+ 3. **Our tree diverged on purpose.** The KEEP list below is functionality upstream
41
+ never had. A wholesale overwrite with upstream HEAD would silently delete it.
42
+ 4. **Different threat model.** Our engine ships inside a published npm package and a
43
+ public marketplace mirror, under a CI no-site-name gate and a de-personalization
44
+ deny-list. Upstream carries neither constraint, so upstream code is not
45
+ drop-in-shippable here.
46
+
47
+ ### KEEP — our divergences a re-vendor MUST NOT regress
48
+
49
+ These exist only in our tree. Any upstream sync that removes or bypasses one of them
50
+ is a regression, not an upgrade:
51
+
52
+ - **Phase 2.5 surrogate retrieval** (`surrogate.py`, `surrogates.yaml`) — archive /
53
+ reader / proxy routes tried before paying for a browser spin-up, with per-entry
54
+ `last_verified` staleness handling and `--allow-proxy` gating.
55
+ - **Provenance / trust contract** (`result_schema.py`) — `Provenance` and `Trust`
56
+ literals on every result, so a snapshot can never be reported as the live page.
57
+ - **Surrogate dead-end validation** (L1.5 in `validators.py`) — interstitial titles and
58
+ AMP-style redirect stubs rejected instead of returned as content.
59
+ - **The no-site-name rule and its CI gate** (`bias_check.py`) — zero hard-coded site
60
+ names, brands, or target domains in `engine/**`.
61
+ - **Module split of the fetch chain** — `curl_probe` / `referers` / `url_transforms` /
62
+ `waf_detector` / `validators` / `executor` / `summary` as separate modules rather than
63
+ one monolith.
64
+ - **The Python test suite** under `engine/tests/` with its HTML/JSON fixtures.
65
+ - **De-personalization** — no personal absolute paths, no personal auth token literals,
66
+ no personal browser choice; enforced by `depersonalization-gate.test.ts`.
67
+ - **Skill-level layering** — the engine is Tier 1 under a router that also owns Tier 1.5
68
+ (agent-reach) and Tier 2 (CloakBrowser + agent-browser). Upstream has no such tiering.
69
+
70
+ ### WANT — upstream improvements worth porting forward
71
+
72
+ Our snapshot predates these; they are wanted, and each must be ported as a reviewed,
73
+ site-agnostic change that preserves every KEEP item above. Port individually; never as
74
+ a tree overwrite:
75
+
76
+ - **Content quality**: dedicated markdown conversion of fetched HTML, main-content
77
+ extraction, PDF text extraction, and JSON-LD rescue when the HTML body is thin.
78
+ - **Transient-failure retry** and **render-merge** of statically fetched HTML with the
79
+ browser-rendered DOM.
80
+ - **Differential block classification** — distinguishing a bot-detection block from an
81
+ infrastructure or authentication failure, instead of collapsing both into `challenge`.
82
+ - **Additional stealth fetch backends** beyond the current Playwright templates, and
83
+ additional WAF vendor profiles.
84
+ - **Per-host route learning** — remembering which route succeeded for a host, with a TTL
85
+ and a bounded store. Must stay runtime state, never committed site knowledge (R4).
86
+ - **Engine-level Phase 0 routing** — the official-public-API preference is currently only
87
+ a documented rule (R5) the agent can skip; upstream moved it into code so it cannot be
88
+ skipped. Worth adopting.
89
+
90
+ ### OUT OF SCOPE
91
+
92
+ - **The removed upstream endpoint-mining / internal-API auto-derivation / site-recipe
93
+ subsystems.** They are absent from upstream HEAD and are not reconstructed here. They
94
+ also sit against R3/R4 and R7's anti-bias rule: discovered internal endpoints are
95
+ runtime findings, never committed engine knowledge.
96
+ - **Any upstream code carrying site-specific selectors, domains, or brand names.** It
97
+ fails `bias_check.py` at the door; re-derive it site-agnostically or leave it out.
98
+ - **Automated upstream tracking.** No submodule, no drift check, no auto-bump. Syncing is
99
+ a deliberate, reviewed, human-initiated act.
100
+
101
+ ### THE SYNC RULE
102
+
103
+ Any future upstream sync preserves BOTH sides. Concretely:
104
+
105
+ 1. Diff the specific upstream capability you want against our tree — do not overwrite
106
+ files wholesale, and never `git checkout` upstream over `engine/`.
107
+ 2. Port it as its own reviewed change, keeping every KEEP item intact.
108
+ 3. Re-run `python3 engine/bias_check.py` and the `engine/tests/` suite; a port that
109
+ introduces a site name or breaks a fixture does not ship.
110
+ 4. Update the pin table above (baseline, date, what was ported) in the same change, plus
111
+ the provenance section of [`../ATTRIBUTION.md`](../ATTRIBUTION.md).
112
+ 5. If a port must drop a KEEP item, say so explicitly in the PR and get it agreed first —
113
+ silent regressions of the KEEP list are the failure mode this policy exists to prevent.
114
+
5
115
  ## OVERVIEW
6
116
 
7
117
  A 17-module Python package embedded in the `ultimate-browsing` skill: a site-agnostic fetch chain that escalates from a cheap curl probe to a real browser, with declarative WAF and surrogate registries. Not "optional scripts" — it has its own CLI entry (`python3 -m engine URL`), two YAML config schemas, a 4-file test suite, and a standalone CI guard. Package exports (`__init__.py`): `fetch`, `FetchResult`, `Attempt`, `Verdict`, `ValidationResult`, `validate`, `CHALLENGE_MARKERS`, `detect`, `TRANSFORMS`, `apply_transform`.
@@ -1,5 +0,0 @@
1
- import type { BackgroundManager } from "../../features/background-agent";
2
- import type { PluginInput } from "@opencode-ai/plugin";
3
- import type { CallOmoAgentArgs } from "./types";
4
- import type { ToolContextWithMetadata } from "./tool-context-with-metadata";
5
- export declare function executeBackgroundAgent(args: CallOmoAgentArgs, toolContext: ToolContextWithMetadata, manager: BackgroundManager, client: PluginInput["client"]): Promise<string>;
@@ -1,92 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { readdir, readFile, stat } from "node:fs/promises";
3
- import { basename, dirname, join } from "node:path";
4
- import test from "node:test";
5
-
6
- import {
7
- findInvalidSpawnAgentRoleParameters,
8
- findSpawnAgentCallsWithoutForkContextFalse,
9
- root,
10
- } from "./aggregate-plugin-fixture.mjs";
11
- import { listSkillFiles } from "./sync-skills-test-support.mjs";
12
-
13
- test("#given synced skills with Codex compatibility guidance #when spawn_agent is documented #then invalid role parameters are absent", async () => {
14
- const skillsDir = join(root, "skills");
15
- const skillEntries = await readdir(skillsDir, { withFileTypes: true });
16
- const skillFiles = skillEntries
17
- .filter((entry) => entry.isDirectory())
18
- .map((entry) => join(skillsDir, entry.name, "SKILL.md"));
19
-
20
- const invalidCalls = [];
21
- for (const skillPath of skillFiles) {
22
- const content = await readFile(skillPath, "utf8");
23
- for (const call of findInvalidSpawnAgentRoleParameters(content)) {
24
- invalidCalls.push(`${basename(dirname(skillPath))}/${basename(skillPath)}: ${call}`);
25
- }
26
- }
27
-
28
- assert.deepEqual(invalidCalls, []);
29
- });
30
-
31
- test('#given synced skills and bundled rules #when role-specific agents are spawned #then they set fork_context=false', async () => {
32
- const skillsDir = join(root, "skills");
33
- const skillEntries = await readdir(skillsDir, { withFileTypes: true });
34
- const promptFiles = skillEntries
35
- .filter((entry) => entry.isDirectory())
36
- .map((entry) => join(skillsDir, entry.name, "SKILL.md"));
37
- promptFiles.push(join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.5.md"));
38
- promptFiles.push(join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.6.md"));
39
-
40
- const missingForkContext = [];
41
- for (const promptPath of promptFiles) {
42
- const content = await readFile(promptPath, "utf8");
43
- for (const call of findSpawnAgentCallsWithoutForkContextFalse(content)) {
44
- missingForkContext.push(`${basename(dirname(promptPath))}/${basename(promptPath)}: ${call}`);
45
- }
46
- }
47
-
48
- assert.deepEqual(missingForkContext, []);
49
- });
50
-
51
- test("#given long-running orchestration prompts #when waiting on child agents #then parent liveness is surfaced", async () => {
52
- const promptFiles = [
53
- join(root, "skills", "ulw-loop", "SKILL.md"),
54
- join(root, "skills", "ulw-loop", "references", "full-workflow.md"),
55
- join(root, "skills", "review-work", "SKILL.md"),
56
- join(root, "skills", "start-work", "SKILL.md"),
57
- join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.5.md"),
58
- join(root, "components", "rules", "bundled-rules", "hephaestus", "gpt-5.6.md"),
59
- ];
60
-
61
- const missingLivenessGuidance = [];
62
- for (const promptPath of promptFiles) {
63
- const content = await readFile(promptPath, "utf8");
64
- if (!/active\s+subagent count/.test(content) || !/latest `WORKING:` phase/.test(content)) {
65
- missingLivenessGuidance.push(`${basename(dirname(promptPath))}/${basename(promptPath)}`);
66
- }
67
- }
68
-
69
- assert.deepEqual(missingLivenessGuidance, []);
70
- });
71
-
72
- test("#given packaged Codex prompt surfaces #when inspected #then removed sparkshell guidance is absent", async () => {
73
- const promptRoots = [
74
- join(root, "skills"),
75
- join(root, "components", "rules", "bundled-rules"),
76
- join(root, "components", "ultrawork", "agents"),
77
- join(root, "components", "ulw-loop", "skills"),
78
- ];
79
- const promptFilePattern = /\.(?:json|md|toml|ya?ml)$/i;
80
- const removedSparkshellPattern = /\b(?:sparkshell|spark[-_\s]+shell)\b/i;
81
- const matches = [];
82
-
83
- for (const promptRoot of promptRoots) {
84
- for (const relativePath of await listSkillFiles(promptRoot)) {
85
- if (!promptFilePattern.test(relativePath)) continue;
86
- const content = await readFile(join(promptRoot, relativePath), "utf8");
87
- if (removedSparkshellPattern.test(content)) matches.push(`${promptRoot}/${relativePath}`);
88
- }
89
- }
90
-
91
- assert.deepEqual(matches, []);
92
- });
@@ -1,314 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { readdir, readFile } from "node:fs/promises";
3
- import { dirname, join } from "node:path";
4
- import test from "node:test";
5
- import { fileURLToPath } from "node:url";
6
- import { codexHarnessToolCompatibility, insertCodexCompatibilityGuidance } from "../scripts/sync-skills.mjs";
7
-
8
- const root = dirname(dirname(fileURLToPath(import.meta.url)));
9
-
10
- async function listSkillNames() {
11
- const skillsRoot = join(root, "skills");
12
- const entries = await readdir(skillsRoot, { withFileTypes: true });
13
- return entries
14
- .filter((entry) => entry.isDirectory())
15
- .map((entry) => entry.name)
16
- .sort();
17
- }
18
-
19
- async function readSkill(skillName) {
20
- return readFile(join(root, "skills", skillName, "SKILL.md"), "utf8");
21
- }
22
-
23
- async function readSharedSkill(skillName) {
24
- return readFile(join(root, "../../shared-skills/skills", skillName, "SKILL.md"), "utf8");
25
- }
26
-
27
- function patternFromParts(parts, flags) {
28
- return new RegExp(parts.join(""), flags);
29
- }
30
-
31
- const multiAgentV2RoleGuidance =
32
- "If instead a flat `spawn_agent` with a required `task_name` exists (`multi_agent_v2`), rewrite every `multi_agent_v1.*` example:";
33
- const loadSkillsGuidance =
34
- "When translating `load_skills=[...]`, include the requested skill names in the spawned agent's `message`.";
35
-
36
- test("#given synced aggregate Codex skills #when they contain OpenCode orchestration examples #then Codex tool compatibility guidance is injected", async () => {
37
- // given
38
- const opencodeOnlyToolPattern = /\b(?:call_omo_agent|background_output|team_[a-z_]+|task)\s*\(/;
39
-
40
- // when / then
41
- for (const skillName of await listSkillNames()) {
42
- const content = await readSkill(skillName);
43
- if (!opencodeOnlyToolPattern.test(content)) continue;
44
-
45
- const compatibilityMatches = content.match(/## Codex Harness Tool Compatibility/g) ?? [];
46
- const compatibilityIndex = content.indexOf("## Codex Harness Tool Compatibility");
47
- assert.notEqual(compatibilityIndex, -1, `${skillName} is missing Codex compatibility guidance`);
48
- assert.equal(compatibilityMatches.length, 1, `${skillName} must not duplicate Codex compatibility guidance`);
49
- assert.ok(
50
- compatibilityIndex < content.search(opencodeOnlyToolPattern),
51
- `${skillName} must explain Codex tool translation before OpenCode-only examples`,
52
- );
53
- assert.ok(content.includes(multiAgentV2RoleGuidance), `${skillName} missing multi_agent_v2 role guidance`);
54
- assert.ok(content.includes(loadSkillsGuidance), `${skillName} missing load_skills guidance`);
55
- }
56
- });
57
-
58
- test("#given late variant Codex compatibility guidance #when adapting a skill #then it is moved without duplication", () => {
59
- // given
60
- const content = `---
61
- name: example
62
- ---
63
-
64
- # Example Skill
65
-
66
- call_omo_agent(subagent_type="explore", prompt="inspect")
67
-
68
- ## Codex Harness Tool Compatibility
69
-
70
- Older variant guidance.
71
-
72
- When translating \`load_skills=[...]\`, name the skills inside the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins.
73
-
74
- ---
75
-
76
- ## Next Section
77
-
78
- task(category="quick", prompt="verify")
79
- `;
80
-
81
- // when
82
- const adapted = insertCodexCompatibilityGuidance(content);
83
-
84
- // then
85
- const compatibilityIndex = adapted.indexOf("## Codex Harness Tool Compatibility");
86
- const firstToolIndex = adapted.search(/\b(?:call_omo_agent|task)\s*\(/);
87
- assert.notEqual(compatibilityIndex, -1);
88
- assert.ok(compatibilityIndex < firstToolIndex);
89
- assert.equal(adapted.match(/## Codex Harness Tool Compatibility/g)?.length, 1);
90
- assert.doesNotMatch(adapted, /Older variant guidance/);
91
- assert.doesNotMatch(adapted, /name the skills inside the spawned agent's `message`/);
92
- assert.match(adapted, /\n---\n\n## Next Section/);
93
- });
94
-
95
- test("#given early custom Codex compatibility guidance #when adapting a skill #then it is preserved exactly", () => {
96
- // given
97
- const content = `---
98
- name: example
99
- ---
100
-
101
- ## Codex Harness Tool Compatibility
102
-
103
- Custom guidance for this skill, including \`dispatchInternalPrompt(...)\`.
104
-
105
- # Example Skill
106
-
107
- call_omo_agent(subagent_type="explore", prompt="inspect")
108
- `;
109
-
110
- // when
111
- const adapted = insertCodexCompatibilityGuidance(content);
112
-
113
- // then
114
- assert.equal(adapted, content);
115
- });
116
-
117
- test("#given early generated stale Codex compatibility guidance #when adapting a skill #then it is replaced", () => {
118
- // given
119
- const content = `---
120
- name: example
121
- ---
122
-
123
- ## Codex Harness Tool Compatibility
124
-
125
- This skill may include examples copied from the OpenCode harness. In Codex, do not call OpenCode-only tools such as \`call_omo_agent(...)\`, \`task(...)\`, \`background_output(...)\`, or \`team_*(...)\` literally. Translate those examples to Codex native tools:
126
-
127
- | OpenCode example | Codex tool to use |
128
- | --- | --- |
129
- | \`call_omo_agent(subagent_type="explore", ...)\` | \`spawn_agent({"task_name":"...","message":"TASK: act as an explorer. ..."})\` |
130
- | \`background_output(task_id="...")\` | \`wait_agent(...)\` for mailbox signals |
131
-
132
- Obsolete generated compatibility prose.
133
-
134
- More obsolete generated compatibility prose.
135
-
136
- When translating \`load_skills=[...]\`, include the requested skill names in the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins.
137
-
138
- # Example Skill
139
-
140
- call_omo_agent(subagent_type="explore", prompt="inspect")
141
- `;
142
-
143
- // when
144
- const adapted = insertCodexCompatibilityGuidance(content);
145
-
146
- // then
147
- assert.match(adapted, /multi_agent_v1\.spawn_agent/);
148
- assert.match(adapted, /fork_context":false/);
149
- assert.match(adapted, /"agent_type":"explorer"/);
150
- assert.match(adapted, /multi_agent_v1\.wait_agent/);
151
- assert.match(adapted, /"task_name":"<lowercase_digits_underscores>"/);
152
- assert.match(adapted, /fork_turns/);
153
- assert.doesNotMatch(adapted, /\| `spawn_agent\({"task_name"/);
154
- assert.doesNotMatch(adapted, /Obsolete generated compatibility prose/);
155
- });
156
-
157
- test("#given generated Codex compatibility guidance #when adapting a skill #then multi-agent role and load_skills guidance are both present", () => {
158
- // given
159
- const content = `---
160
- name: example
161
- ---
162
-
163
- # Example Skill
164
-
165
- task(subagent_type="oracle", load_skills=["debugging"], prompt="verify")
166
- `;
167
-
168
- // when
169
- const adapted = insertCodexCompatibilityGuidance(content);
170
-
171
- // then
172
- assert.ok(adapted.includes(multiAgentV2RoleGuidance));
173
- assert.ok(adapted.includes(loadSkillsGuidance));
174
- });
175
-
176
- test("#given generated guidance before a template export #when adapting a skill #then the export wrapper is preserved", () => {
177
- // given
178
- const content = `---
179
- name: refactor
180
- ---
181
-
182
- ## Codex Harness Tool Compatibility
183
-
184
- Older variant guidance.
185
-
186
- When translating \`load_skills=[...]\`, name the skills inside the spawned agent's \`message\`. If a code block below conflicts with this section, this section wins.
187
-
188
- export const REFACTOR_TEMPLATE = \`# Refactor
189
-
190
- call_omo_agent(subagent_type="explore", prompt="inspect")
191
- \`
192
- `;
193
-
194
- // when
195
- const adapted = insertCodexCompatibilityGuidance(content);
196
-
197
- // then
198
- assert.match(adapted, /export const REFACTOR_TEMPLATE = `# Refactor/);
199
- assert.match(adapted, /multi_agent_v1\.spawn_agent/);
200
- assert.doesNotMatch(adapted, /Older variant guidance/);
201
- });
202
-
203
- test("#given synced aggregate Codex skills #when they describe background orchestration #then liveness is framed as progress rather than timeout failure", async () => {
204
- // given
205
- const orchestrationPattern = /\b(?:run_in_background|background_output|wait_agent)\b/;
206
- const requiredPatterns = [
207
- ["working progress message", /WORKING:/],
208
- ["blocked progress message", /BLOCKED:/],
209
- ["mailbox timeout framing", /timeout only means no new mailbox update arrived/],
210
- // Skills route by session tool surface: the namespaced V1 tool or the flat V2 tool both count.
211
- ["wait-agent tool ref", /multi_agent_v1\.wait_agent|`wait_agent`/],
212
- ["explicit fallback conditions", /Fallback only when|Mark a file for retry only when/],
213
- ];
214
- const bannedPatterns = [
215
- ["timeout as failure", patternFromParts(["fails or ", "times out"], "i")],
216
- ["failed or timed out", patternFromParts(["failed or ", "timed out"], "i")],
217
- ["two waits heuristic", patternFromParts(["After two ", "waits"])],
218
- ["unresponsive timeout framing", patternFromParts(["timeout", ".*", "un" + "responsive"], "i")],
219
- ["old status-tool warning", patternFromParts(["polling or ", "status tool"])],
220
- ["large status replay wording", patternFromParts(["large agent status", " and latest-message"])],
221
- ["old wait-agent aphorism", patternFromParts(["wait_agent", ".*", "signal, not ", "proof"], "i")],
222
- ];
223
-
224
- // when / then
225
- for (const skillName of await listSkillNames()) {
226
- const content = await readSkill(skillName);
227
- if (!orchestrationPattern.test(content)) continue;
228
-
229
- for (const [label, pattern] of requiredPatterns) {
230
- assert.match(content, pattern, `${skillName} missing ${label}`);
231
- }
232
- for (const [label, pattern] of bannedPatterns) {
233
- assert.doesNotMatch(content, pattern, `${skillName} still has ${label}`);
234
- }
235
- }
236
- });
237
-
238
- test("#given packaged start-work and ulw-plan skills #when inspected #then PR delivery options and the handoff explanation ship", async () => {
239
- // given
240
- const startWork = await readSkill("start-work");
241
- const workflow = await readFile(join(root, "skills", "ulw-plan", "references", "full-workflow.md"), "utf8");
242
-
243
- // when / then
244
- assert.match(startWork, /--make-pr/);
245
- assert.match(startWork, /--ship/);
246
- assert.match(startWork, /implies `--make-pr`/i);
247
- assert.match(startWork, /IMPLIES worktree mode/i);
248
- assert.match(startWork, /Goal and todo discipline/i);
249
- assert.match(startWork, /create_goal/);
250
- assert.match(startWork, /one todo per column-zero checkbox/i);
251
-
252
- assert.match(workflow, /Handoff explanation/i);
253
- assert.match(workflow, /Added beyond the request/i);
254
- assert.match(workflow, /\$start-work <plan-name>/);
255
- assert.match(workflow, /--make-pr/);
256
- assert.match(workflow, /--ship/);
257
- assert.match(workflow, /COUNT the rows/i);
258
- });
259
-
260
- test("#given start-work skill #when synced for Codex #then the difficulty-tier delegation guidance survives the overlay", async () => {
261
- const content = await readSkill("start-work");
262
-
263
- assert.match(content, /lazycodex-worker-medium/);
264
- assert.match(content, /Codex tier mapping for the delegation router/);
265
- assert.match(content, /Global Review and Debugging Gate/);
266
- assert.match(content, /full commit SHA/);
267
- assert.match(content, /re-read the ledger record/);
268
- assert.match(content, /exact lane\/SHA pair/);
269
- assert.doesNotMatch(content, /works the same on both surfaces/);
270
- });
271
-
272
- test("#given review-work skill #when some lanes do not finish #then aggregate result remains bounded", async () => {
273
- const content = await readSkill("review-work");
274
-
275
- assert.match(content, /pending\/PASS\/FAIL\/INCONCLUSIVE/);
276
- assert.match(content, /Preserve completed lane results immediately/);
277
- assert.match(content, /ALL 5 lanes have a terminal state/);
278
- assert.match(content, /REVIEW INCONCLUSIVE - not approved/);
279
- assert.match(content, /Overall Verdict: PASSED \/ FAILED \/ INCONCLUSIVE/);
280
- assert.match(content, /PASS\/FAIL\/INCONCLUSIVE \| HIGH\/MED\/LOW/);
281
- assert.match(content, /Do not spin in repeated/);
282
- assert.match(content, /bare REJECT\/FAIL token without findings is not a verdict/);
283
- assert.match(content, /cites the violated goal criterion/);
284
- assert.match(content, /append a durable task-evidence record/);
285
- assert.match(content, /full commit SHA/);
286
- assert.match(content, /re-read that record/);
287
- assert.match(content, /exact lane\/SHA pair/);
288
- assert.match(content, /Do not use `multi_agent_v1\.send_input` as an interrupt/);
289
- });
290
-
291
- test("#given PR and review skills #when synced for Codex #then worktree lifecycle is mandatory", async () => {
292
- const startWork = await readSkill("start-work");
293
- const reviewWork = await readSkill("review-work");
294
- const sharedStartWork = await readSharedSkill("start-work");
295
-
296
- assert.match(startWork, /PR creation, PR handoff, branch handoff, or merge/);
297
- assert.match(startWork, /Finish the PR\/branch lifecycle from its task-owned worktree/);
298
- assert.match(startWork, /merge by default unless explicitly opted out/);
299
- assert.match(startWork, /No PR\/branch implementation or review in the main worktree/);
300
-
301
- assert.match(sharedStartWork, /required for PR\/branch work/);
302
- assert.match(sharedStartWork, /No PR\/branch implementation, review, or merge in the main worktree/);
303
- assert.doesNotMatch(sharedStartWork, /If worktree mode was used/);
304
- assert.doesNotMatch(sharedStartWork, /merge or hand off exactly as requested/);
305
-
306
- assert.match(reviewWork, /dedicated review worktree attached to that branch/);
307
- assert.match(reviewWork, /Never\s+checkout, test, or edit the review branch in the main worktree/);
308
- });
309
-
310
- test("#given generated Codex compatibility guidance #when multi-agent lifecycle tools are mentioned #then optional tools are guarded by the active tools list", () => {
311
- assert.match(codexHarnessToolCompatibility, /when exposed in the active tools list/, "send_input/close_agent must be marked optional (lazycodex#116)");
312
- assert.match(codexHarnessToolCompatibility, /multi_agent_v1\.spawn_agent/);
313
- assert.match(codexHarnessToolCompatibility, /multi_agent_v1\.wait_agent/);
314
- });
@@ -1,24 +0,0 @@
1
- import assert from "node:assert/strict";
2
- import { readFile } from "node:fs/promises";
3
- import { dirname, join } from "node:path";
4
- import test from "node:test";
5
- import { fileURLToPath } from "node:url";
6
-
7
- const pluginRoot = dirname(dirname(fileURLToPath(import.meta.url)));
8
- const repositoryRoot = dirname(dirname(dirname(pluginRoot)));
9
- const componentReference = join(pluginRoot, "components", "ultrawork", "skills", "ulw-plan", "references", "intent-unclear.md");
10
- const sharedReference = join(repositoryRoot, "packages", "shared-skills", "skills", "ulw-plan", "references", "intent-unclear.md");
11
-
12
- test("#given an unclear auth-improvement request #when ulw-plan derives its full-scope components #then it preserves evidenced intent without inventing reduction or MFA expansion", async () => {
13
- const [component, shared] = await Promise.all([
14
- readFile(componentReference, "utf8"),
15
- readFile(sharedReference, "utf8"),
16
- ]);
17
-
18
- for (const reference of [component, shared]) {
19
- assert.match(reference, /components that refine the user's requested or evidence-backed intent/i);
20
- assert.match(reference, /neither collapse into an invented reduced subset nor expand into adjacent features/i);
21
- assert.match(reference, /MFA is an adjacent capability.*Scope OUT unless the user asks.*evidence establishes/i);
22
- assert.doesNotMatch(reference, /MFA - all four planned in full/i);
23
- }
24
- });