oh-my-opencode 4.16.3 → 4.17.0

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 (177) hide show
  1. package/.agents/command/omomomo.md +1 -1
  2. package/.agents/skills/hyperplan/SKILL.md +3 -3
  3. package/.agents/skills/omomomo/SKILL.md +1 -1
  4. package/.opencode/command/omomomo.md +1 -1
  5. package/.opencode/skills/hyperplan/SKILL.md +3 -3
  6. package/.opencode/skills/pre-publish-review/SKILL.md +3 -0
  7. package/README.ja.md +4 -4
  8. package/README.ko.md +4 -4
  9. package/README.md +2 -2
  10. package/README.ru.md +4 -4
  11. package/README.zh-cn.md +4 -4
  12. package/dist/cli/index.js +179 -63
  13. package/dist/cli-node/index.js +179 -63
  14. package/dist/features/team-mode/test-support/async-test-helpers.d.ts +2 -2
  15. package/dist/index.js +121 -58
  16. package/dist/plugin/chat-message/types.d.ts +4 -0
  17. package/dist/plugin/command-execute-before.d.ts +1 -0
  18. package/dist/plugin/stop-continuation.d.ts +17 -0
  19. package/dist/skills/remove-ai-slops/SKILL.md +2 -2
  20. package/dist/skills/start-work/SKILL.md +5 -2
  21. package/dist/skills/ulw-plan/scripts/scaffold-plan.mjs +2 -2
  22. package/dist/tui.js +71 -29
  23. package/package.json +15 -14
  24. package/packages/git-bash-mcp/package.json +27 -0
  25. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +3 -1
  26. package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +84 -19
  27. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  28. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  29. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  30. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  31. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  32. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  33. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  34. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/AGENTS.md +2 -2
  35. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +6 -2
  36. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +6 -2
  37. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +2 -2
  38. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  39. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +6 -2
  40. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/cli.test.ts +1 -1
  41. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +67 -2
  42. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  43. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  44. package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +0 -13
  45. package/packages/omo-codex/plugin/components/rules/bundled-rules/hephaestus/gpt-5.6.md +1 -1
  46. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  47. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  48. package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
  49. package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
  50. package/packages/omo-codex/plugin/components/start-work-continuation/test/codex-hook.test.ts +1 -79
  51. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  52. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  53. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  54. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  55. package/packages/omo-codex/plugin/components/ultrawork/agents/explorer.toml +2 -2
  56. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-code-reviewer.toml +2 -2
  57. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-gate-reviewer.toml +6 -6
  58. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-qa-executor.toml +5 -5
  59. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-high.toml +26 -0
  60. package/packages/omo-codex/plugin/components/ultrawork/agents/{lazycodex-executor.toml → lazycodex-worker-low.toml} +6 -4
  61. package/packages/omo-codex/plugin/components/ultrawork/agents/lazycodex-worker-medium.toml +26 -0
  62. package/packages/omo-codex/plugin/components/ultrawork/agents/librarian.toml +2 -2
  63. package/packages/omo-codex/plugin/components/ultrawork/agents/plan.toml +4 -4
  64. package/packages/omo-codex/plugin/components/ultrawork/directive.md +55 -28
  65. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  66. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
  67. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +55 -28
  68. package/packages/omo-codex/plugin/components/ultrawork/skills/ulw-plan/scripts/scaffold-plan.mjs +2 -2
  69. package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook.test.ts +22 -0
  70. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +0 -68
  71. package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +1 -1
  72. package/packages/omo-codex/plugin/components/ulw-loop/CHANGELOG.md +2 -0
  73. package/packages/omo-codex/plugin/components/ulw-loop/README.md +3 -1
  74. package/packages/omo-codex/plugin/components/ulw-loop/directive.md +55 -28
  75. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +6 -1
  76. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.d.ts +1 -1
  77. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +13 -2
  78. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +405 -25
  79. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +12 -1
  80. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +4 -2
  81. package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.d.ts +7 -0
  82. package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +16 -1
  83. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-crud.js +1 -0
  84. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.d.ts +6 -0
  85. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-verdicts.js +20 -0
  86. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.d.ts +1 -0
  87. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +12 -9
  88. package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.d.ts +3 -0
  89. package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.js +148 -0
  90. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.d.ts +2 -0
  91. package/packages/omo-codex/plugin/components/ulw-loop/dist/stop-resume-hook.js +209 -0
  92. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +25 -2
  93. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  94. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/SKILL.md +14 -15
  95. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +29 -27
  96. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +6 -1
  97. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +14 -3
  98. package/packages/omo-codex/plugin/components/ulw-loop/src/cli.ts +10 -0
  99. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +12 -1
  100. package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +4 -2
  101. package/packages/omo-codex/plugin/components/ulw-loop/src/paths.ts +27 -1
  102. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-crud.ts +1 -0
  103. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-verdicts.ts +23 -0
  104. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +16 -9
  105. package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-guard.ts +138 -0
  106. package/packages/omo-codex/plugin/components/ulw-loop/src/stop-resume-hook.ts +208 -0
  107. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +12 -0
  108. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-entrypoint.test.ts +4 -1
  109. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +8 -35
  110. package/packages/omo-codex/plugin/components/ulw-loop/test/fixtures/quality-gate-builder.ts +24 -13
  111. package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +5 -2
  112. package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +43 -8
  113. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +55 -2
  114. package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-guard.test.ts +228 -0
  115. package/packages/omo-codex/plugin/components/ulw-loop/test/stop-resume-hook.test.ts +193 -0
  116. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  117. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  118. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  119. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  120. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  121. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  122. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  123. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  124. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  125. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +18 -0
  126. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  127. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  128. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  129. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  130. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  131. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  132. package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
  133. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +17 -0
  134. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
  135. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +2 -2
  136. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  137. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  138. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  139. package/packages/omo-codex/plugin/model-catalog.json +16 -7
  140. package/packages/omo-codex/plugin/package-lock.json +13 -13
  141. package/packages/omo-codex/plugin/package.json +1 -1
  142. package/packages/omo-codex/plugin/scripts/migrate-codex-config/catalog.mjs +16 -7
  143. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +8 -2
  144. package/packages/omo-codex/plugin/skills/init-deep/SKILL.md +2 -2
  145. package/packages/omo-codex/plugin/skills/refactor/SKILL.md +2 -2
  146. package/packages/omo-codex/plugin/skills/remove-ai-slops/SKILL.md +4 -4
  147. package/packages/omo-codex/plugin/skills/review-work/SKILL.md +8 -2
  148. package/packages/omo-codex/plugin/skills/start-work/SKILL.md +5 -2
  149. package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +55 -28
  150. package/packages/omo-codex/plugin/skills/ulw-loop/SKILL.md +14 -15
  151. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +29 -27
  152. package/packages/omo-codex/plugin/skills/ulw-plan/scripts/scaffold-plan.mjs +2 -2
  153. package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +2 -2
  154. package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +2 -2
  155. package/packages/omo-codex/plugin/test/aggregate-agents.test.mjs +76 -16
  156. package/packages/omo-codex/plugin/test/aggregate-hooks.test.mjs +23 -2
  157. package/packages/omo-codex/plugin/test/aggregate-manifest.test.mjs +1 -1
  158. package/packages/omo-codex/plugin/test/aggregate-model-catalog.test.mjs +4 -4
  159. package/packages/omo-codex/plugin/test/auto-update.test.mjs +4 -4
  160. package/packages/omo-codex/plugin/test/component-hook-contract-cases.mjs +2 -2
  161. package/packages/omo-codex/plugin/test/lcx-bug-skills.test.mjs +4 -101
  162. package/packages/omo-codex/plugin/test/migrate-codex-config.test.mjs +14 -14
  163. package/packages/omo-codex/plugin/test/sync-skills-orchestration.test.mjs +11 -0
  164. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +1 -1
  165. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +4 -2
  166. package/packages/omo-codex/plugin/test/ulw-plan-skill-contract.test.mjs +9 -40
  167. package/packages/omo-codex/plugin/test/ulw-research-skill-contract.test.mjs +4 -277
  168. package/packages/omo-codex/scripts/install-config-reasoning.test.mjs +5 -5
  169. package/packages/omo-codex/scripts/install-config.test.mjs +22 -3
  170. package/packages/omo-codex/scripts/install-dist/install-local.mjs +91 -21
  171. package/packages/shared-skills/skills/remove-ai-slops/SKILL.md +2 -2
  172. package/packages/shared-skills/skills/start-work/SKILL.md +5 -2
  173. package/packages/shared-skills/skills/ulw-plan/scripts/scaffold-plan.mjs +2 -2
  174. package/dist/skills/visual-qa/scripts/skill-prompt-contract.test.ts +0 -296
  175. package/packages/omo-codex/plugin/components/ulw-loop/test/skill-contract.test.ts +0 -70
  176. package/packages/omo-codex/plugin/test/ulw-research-epistemic-contract.test.mjs +0 -98
  177. package/packages/shared-skills/skills/visual-qa/scripts/skill-prompt-contract.test.ts +0 -296
@@ -1,98 +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
- import { sharedSkillsRootPath } from "@oh-my-opencode/shared-skills";
7
-
8
- const root = dirname(dirname(fileURLToPath(import.meta.url)));
9
-
10
- async function readUlwResearchCopies() {
11
- const sharedPath = join(sharedSkillsRootPath(), "ulw-research", "SKILL.md");
12
- const packagedPath = join(root, "skills", "ulw-research", "SKILL.md");
13
- return [
14
- { label: "shared", path: sharedPath, content: await readFile(sharedPath, "utf8") },
15
- { label: "packaged", path: packagedPath, content: await readFile(packagedPath, "utf8") },
16
- ];
17
- }
18
-
19
- function escapeRegExp(value) {
20
- return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
21
- }
22
-
23
- function markdownSection(content, heading, nextHeading) {
24
- const headingPattern = new RegExp(`^${escapeRegExp(heading)}\\r?$`, "m");
25
- const headingMatch = content.match(headingPattern);
26
- assert.notEqual(headingMatch, null, `SKILL.md section not found: ${heading}`);
27
- assert.notEqual(headingMatch.index, undefined, `SKILL.md section index not found: ${heading}`);
28
- const bodyStart = headingMatch.index + headingMatch[0].length;
29
- if (nextHeading === undefined) return content.slice(bodyStart);
30
- const nextHeadingIndex = content.indexOf(`\n${nextHeading}`, bodyStart);
31
- assert.notEqual(nextHeadingIndex, -1, `SKILL.md next section not found: ${nextHeading}`);
32
- return content.slice(bodyStart, nextHeadingIndex);
33
- }
34
-
35
- test("#given ulw-research epistemic instrumentation #when the research contract is inspected #then the meta-layer artifacts and fields are required", async () => {
36
- for (const copy of await readUlwResearchCopies()) {
37
- const section = markdownSection(copy.content, "## Epistemic instrumentation", "## Run the swarm as a cooperating team");
38
- assert.match(section, /intent-diff\.md/i, `${copy.label}: body must require an intent-vs-reality diff artifact`);
39
- assert.match(section, /expected truth/i, `${copy.label}: intent diff must record expected truth`);
40
- assert.match(section, /observed reality/i, `${copy.label}: intent diff must record observed reality`);
41
- assert.match(section, /diff, violated invariant/i, `${copy.label}: intent diff must record the diff gap field and violated invariant`);
42
- assert.match(section, /claim-graph\.md/i, `${copy.label}: body must require a claim graph`);
43
- assert.match(section, /independent observation groups/i, `${copy.label}: claim graph must track independent observation groups`);
44
- assert.match(section, /convergence status/i, `${copy.label}: claim graph must track convergence status`);
45
- const claimGraphBullet = section.split("\n").find((line) => line.includes("`claim-graph.md`"));
46
- assert.notEqual(claimGraphBullet, undefined, `${copy.label}: claim graph bullet must exist`);
47
- assert.match(claimGraphBullet, /single claim store/i, `${copy.label}: claim graph must be the single claim store`);
48
- assert.match(claimGraphBullet, /risk tier/i, `${copy.label}: claim graph nodes must carry a risk tier`);
49
- assert.match(claimGraphBullet, /counter-search/i, `${copy.label}: claim graph nodes must carry the counter-search result`);
50
- assert.match(claimGraphBullet, /primary source/i, `${copy.label}: claim graph nodes must carry primary source backing`);
51
- assert.match(claimGraphBullet, /verified-claims/i, `${copy.label}: cleared nodes must feed the verified-claims digest`);
52
- assert.match(section, /observation-manifest\.md/i, `${copy.label}: body must require an observation manifest`);
53
- assert.match(section, /observer group/i, `${copy.label}: observation manifest must record observer groups`);
54
- assert.match(section, /independence basis/i, `${copy.label}: observation manifest must record independence basis`);
55
- assert.match(section, /observed_at/i, `${copy.label}: temporal evidence must include observed_at`);
56
- assert.match(section, /valid_at|claim_valid_at/i, `${copy.label}: temporal evidence must include a validity field`);
57
- assert.match(section, /verification-economics\.md/i, `${copy.label}: body must require verification economics`);
58
- assert.match(section, /cause-disappearance\.md/i, `${copy.label}: body must require cause-disappearance records`);
59
- assert.match(section, /last_seen/i, `${copy.label}: cause-disappearance records must track last_seen`);
60
- assert.match(section, /disconfirming observation/i, `${copy.label}: cause-disappearance records must track disconfirming observations`);
61
- assert.match(section, /no longer observed/i, `${copy.label}: cause-disappearance records must support no-longer-observed verdicts`);
62
- }
63
- });
64
-
65
- test("#given ulw-research readiness gates #when synthesis rules are inspected #then diff closure and independent convergence are required", async () => {
66
- for (const copy of await readUlwResearchCopies()) {
67
- const success = markdownSection(copy.content, "## Success criteria", "## Epistemic instrumentation");
68
- const phase4 = markdownSection(copy.content, "## Phase 4 — Synthesize", "## Phase 5 — Final materials");
69
- assert.match(success, /intent-vs-reality diff/i, `${copy.label}: success criteria must require intent diff closure`);
70
- assert.match(success, /independent observation groups/i, `${copy.label}: success criteria must require independent observations`);
71
- assert.match(success, /convergence/i, `${copy.label}: success criteria must require convergence`);
72
- assert.match(phase4, /intent-diff\.md/i, `${copy.label}: synthesis must start from the intent diff`);
73
- assert.match(phase4, /independent-observation convergence/i, `${copy.label}: synthesis must summarize independent convergence`);
74
- }
75
- });
76
-
77
- test("#given ulw-research observation instrumentation #when worker ownership is inspected #then workers return candidates as message text and the orchestrator writes manifests", async () => {
78
- for (const copy of await readUlwResearchCopies()) {
79
- assert.match(copy.content, /observation candidates?|claim candidates?/i, `${copy.label}: workers must return claim and observation candidates`);
80
- assert.match(copy.content, /message text/i, `${copy.label}: claim and observation candidates must travel as message text`);
81
- assert.match(copy.content, /orchestrator-owned|orchestrator owns/i, `${copy.label}: instrumentation artifacts must be orchestrator-owned`);
82
- assert.doesNotMatch(
83
- copy.content,
84
- /worker[^.]*\b(?:write|append|create)s?\b[^.]*(?:intent-diff|observation-manifest|claim-graph|verification-economics|cause-disappearance)/i,
85
- `${copy.label}: workers must not write instrumentation artifacts directly`,
86
- );
87
- }
88
- });
89
-
90
- test("#given the claim graph as the single claim store #when the retired ledger is scanned #then claim-ledger is gone and the gate lives on graph nodes", async () => {
91
- for (const copy of await readUlwResearchCopies()) {
92
- assert.doesNotMatch(copy.content, /claim[- ]ledger/i, `${copy.label}: the retired claim-ledger artifact must not appear`);
93
- const phase3b = markdownSection(copy.content, "## Phase 3b — Lock non-code claims through the claim graph", "## Phase 4 — Synthesize");
94
- assert.match(phase3b, /claim-graph\.md/i, `${copy.label}: the gate must record outcomes on claim-graph nodes`);
95
- assert.match(phase3b, /verified-claims/i, `${copy.label}: the verified-claims allowlist digest must survive the merge`);
96
- assert.match(phase3b, /sole allowlist/i, `${copy.label}: the data-flow-lock must stay self-enforcing`);
97
- }
98
- });
@@ -1,296 +0,0 @@
1
- import { describe, expect, test } from "bun:test"
2
- import { existsSync, readFileSync } from "node:fs"
3
- import { dirname, join } from "node:path"
4
-
5
- const repoRoot = findRepoRoot(import.meta.dir)
6
- const sharedSkillPath = join(repoRoot, "packages", "shared-skills", "skills", "visual-qa", "SKILL.md")
7
- const codexSkillPath = join(repoRoot, "packages", "omo-codex", "plugin", "skills", "visual-qa", "SKILL.md")
8
- const referencesPath = join(
9
- repoRoot,
10
- "packages",
11
- "shared-skills",
12
- "skills",
13
- "visual-qa",
14
- "references",
15
- "agent-browser-setup.md",
16
- )
17
-
18
- type PromptFixture = {
19
- readonly label: string
20
- readonly text: string
21
- }
22
-
23
- function readPrompt(path: string): string {
24
- return readFileSync(path, "utf8")
25
- }
26
-
27
- function findRepoRoot(start: string): string {
28
- let current = start
29
- while (true) {
30
- if (existsSync(join(current, "package.json")) && existsSync(join(current, "packages"))) {
31
- return current
32
- }
33
- const parent = dirname(current)
34
- if (parent === current) {
35
- throw new Error(`repository root not found from ${start}`)
36
- }
37
- current = parent
38
- }
39
- }
40
-
41
- function fixtures(): readonly PromptFixture[] {
42
- const promptFixtures: PromptFixture[] = [{ label: "shared skill", text: readPrompt(sharedSkillPath) }]
43
- if (existsSync(codexSkillPath)) {
44
- promptFixtures.push({ label: "codex plugin copy", text: readPrompt(codexSkillPath) })
45
- }
46
- return promptFixtures
47
- }
48
-
49
- function sectionBetween(text: string, startMarker: string, endMarker: string): string {
50
- const start = text.indexOf(startMarker)
51
- if (start < 0) {
52
- throw new Error(`missing start marker: ${startMarker}`)
53
- }
54
- const end = text.indexOf(endMarker, start + startMarker.length)
55
- if (end < 0) {
56
- throw new Error(`missing end marker: ${endMarker}`)
57
- }
58
- return text.slice(start, end)
59
- }
60
-
61
- describe("visual-qa skill prompt contract", () => {
62
- test("#given visual QA prompts #when dispatching pass B #then the oracle must directly inspect screenshots and content for CJK wrapping", () => {
63
- for (const fixture of fixtures()) {
64
- const passB = sectionBetween(fixture.text, "### Pass B", "## Step 4")
65
- const lowerPassB = passB.toLowerCase()
66
-
67
- expect(lowerPassB, fixture.label).toContain("directly open")
68
- expect(lowerPassB, fixture.label).toContain("view_image")
69
- expect(lowerPassB, fixture.label).toContain("source code")
70
- expect(passB, fixture.label).toContain("[Image #1]")
71
- expect(passB, fixture.label).toContain("semantic phrases")
72
- expect(passB, fixture.label).toContain("놀라운 변 / 화")
73
- expect(passB, fixture.label).toContain("에이전트 오케스트")
74
- expect(passB, fixture.label).toContain("레이션 현황 및 미")
75
- expect(passB, fixture.label).toContain("래")
76
- expect(passB, fixture.label).toContain("REVISE/FAIL")
77
- }
78
- })
79
-
80
- test("#given visual QA prompts #when dispatching pass A #then the oracle must reject mock-only UI instead of accepting superficial screenshots", () => {
81
- for (const fixture of fixtures()) {
82
- const passA = sectionBetween(fixture.text, "### Pass A", "### Pass B")
83
- const checkBlock = sectionBetween(passA, "CHECK EACH:", "OUTPUT:")
84
- const outputBlock = sectionBetween(passA, "OUTPUT:", '"""')
85
- const lowerCheckBlock = checkBlock.toLowerCase()
86
-
87
- expect(lowerCheckBlock, fixture.label).toContain("mock-only")
88
- expect(lowerCheckBlock, fixture.label).toContain("faked-with-an-image")
89
- expect(lowerCheckBlock, fixture.label).toContain("coherent design tokens")
90
- expect(lowerCheckBlock, fixture.label).toContain("reused primitives")
91
- expect(lowerCheckBlock, fixture.label).toContain("blocking")
92
- expect(outputBlock, fixture.label).toContain("BLOCKING:")
93
- }
94
- })
95
-
96
- test("#given the Web capture path #when no browser tooling is configured #then it falls back to agent-browser", () => {
97
- for (const fixture of fixtures()) {
98
- const web = sectionBetween(fixture.text, "### Web", "### TUI")
99
-
100
- expect(web, fixture.label).toContain("agent-browser")
101
- expect(fixture.text, fixture.label).toContain("npm install -g agent-browser")
102
- expect(fixture.text, fixture.label).toContain("https://github.com/vercel-labs/agent-browser")
103
- expect(fixture.text, fixture.label).toContain("references/agent-browser-setup.md")
104
- }
105
- })
106
-
107
- test("#given the agent-browser fallback #when documenting setup #then a references doc lists install, link, and help", () => {
108
- expect(existsSync(referencesPath)).toBe(true)
109
- const doc = readFileSync(referencesPath, "utf8")
110
-
111
- expect(doc).toContain("npm install -g agent-browser")
112
- expect(doc).toContain("agent-browser install")
113
- expect(doc).toContain("https://github.com/vercel-labs/agent-browser")
114
- expect(doc).toContain("agent-browser --help")
115
- })
116
-
117
- test("#given the visual QA evidence commands #when documented #then they use the Node bundle, not a Bun-only TypeScript launcher", () => {
118
- for (const fixture of fixtures()) {
119
- expect(fixture.text, fixture.label).toContain('node "$SKILL_DIR/scripts/visual-qa.mjs" image-diff')
120
- expect(fixture.text, fixture.label).toContain('node "$SKILL_DIR/scripts/visual-qa.mjs" tui-check')
121
- expect(fixture.text, fixture.label).not.toContain('bun "$SKILL_DIR/scripts/cli.ts"')
122
- }
123
- })
124
-
125
- test("#given a concrete visual target #when in reference-fidelity mode #then dual pixel + code-fidelity verification loops until both pass", () => {
126
- for (const fixture of fixtures()) {
127
- const cloneMode = sectionBetween(fixture.text, "## Step 5", "## Reference evidence is not the verdict")
128
- const lowerCloneMode = cloneMode.toLowerCase()
129
-
130
- expect(lowerCloneMode, fixture.label).toContain("clone")
131
- expect(lowerCloneMode, fixture.label).toContain("imagen")
132
- expect(lowerCloneMode, fixture.label).toContain("stitch")
133
- expect(lowerCloneMode, fixture.label).toContain("generated mockup")
134
- expect(lowerCloneMode, fixture.label).toContain("overview")
135
- expect(cloneMode, fixture.label).toContain("pixel-by-pixel")
136
- expect(cloneMode, fixture.label).toContain("image-diff")
137
- expect(cloneMode, fixture.label).toContain("lazycodex-clone-fidelity-reviewer")
138
- expect(lowerCloneMode, fixture.label).toContain("extensible state variants")
139
- expect(lowerCloneMode, fixture.label).toContain("retry")
140
- }
141
- })
142
- })
143
-
144
- describe("visual-qa skill exhaustive-coverage and review-gate contract", () => {
145
- test("#given a multi-page surface #when capturing #then every page is enumerated and verified per page, not sampled", () => {
146
- for (const fixture of fixtures()) {
147
- const capture = sectionBetween(fixture.text, "## Step 2", "## Step 3")
148
- const lower = capture.toLowerCase()
149
-
150
- expect(lower, fixture.label).toContain("every page")
151
- expect(lower, fixture.label).toContain("enumerate")
152
- expect(lower, fixture.label).toContain("never sample")
153
- expect(lower, fixture.label).toContain("per page")
154
- expect(lower, fixture.label).toContain("one failing page fails")
155
- }
156
- })
157
-
158
- test("#given prior QA artifacts #when verifying #then stale evidence older than the source must be regenerated", () => {
159
- for (const fixture of fixtures()) {
160
- const capture = sectionBetween(fixture.text, "## Step 2", "## Step 3")
161
- const lower = capture.toLowerCase()
162
-
163
- expect(lower, fixture.label).toContain("stale")
164
- expect(lower, fixture.label).toContain("older than")
165
- expect(lower, fixture.label).toContain("regenerate")
166
- }
167
- })
168
-
169
- test("#given Step 3 dispatch #when running the review #then it is required pre-done, harness-native, and covers every enumerated page", () => {
170
- for (const fixture of fixtures()) {
171
- const dispatch = sectionBetween(fixture.text, "## Step 3", "### Pass A")
172
- const lower = dispatch.toLowerCase()
173
-
174
- expect(lower, fixture.label).toContain("required before")
175
- expect(lower, fixture.label).toContain("do not self-review")
176
- expect(dispatch, fixture.label).toContain("spawn_agent")
177
- expect(dispatch, fixture.label).toContain("lazycodex-gate-reviewer")
178
- expect(lower, fixture.label).toContain("every enumerated page")
179
- }
180
- })
181
-
182
- test("#given the completion gate #when deciding done #then an independent reviewer must PASS on a fresh full capture, looping until clean", () => {
183
- for (const fixture of fixtures()) {
184
- const gate = sectionBetween(fixture.text, "## Step 4", "## Step 5")
185
- const lower = gate.toLowerCase()
186
-
187
- expect(lower, fixture.label).toContain("hard stop rule")
188
- expect(lower, fixture.label).toContain("independent")
189
- expect(lower, fixture.label).toContain("no blocking")
190
- expect(lower, fixture.label).toContain("fresh")
191
- expect(lower, fixture.label).toContain("every enumerated page")
192
- expect(lower, fixture.label).toContain("loop until")
193
- expect(lower, fixture.label).toContain("do not stop because the automated script")
194
- }
195
- })
196
-
197
- test("#given Pass B CJK checks #when inspecting #then it flags topic, connective, and source-citation splits across every page", () => {
198
- for (const fixture of fixtures()) {
199
- const passB = sectionBetween(fixture.text, "### Pass B", "## Step 4")
200
- const lower = passB.toLowerCase()
201
-
202
- expect(passB, fixture.label).toContain("두 강은")
203
- expect(passB, fixture.label).toContain("쓸 수")
204
- expect(passB, fixture.label).toContain("Attention Is")
205
- expect(lower, fixture.label).toContain("citation")
206
- expect(lower, fixture.label).toContain("every page")
207
- expect(lower, fixture.label).toContain("regardless of similarityscore")
208
- }
209
- })
210
-
211
- test("#given a generated reference packet #when reviewing #then Pass A and B require extensible design-system code and pixel-level reference matching", () => {
212
- for (const fixture of fixtures()) {
213
- const passA = sectionBetween(fixture.text, "### Pass A", "### Pass B")
214
- const passB = sectionBetween(fixture.text, "### Pass B", "## Step 4")
215
- const lowerPassA = passA.toLowerCase()
216
- const lowerPassB = passB.toLowerCase()
217
-
218
- expect(passA, fixture.label).toContain("REFERENCE PACKET:")
219
- expect(passB, fixture.label).toContain("REFERENCE PACKET:")
220
- expect(lowerPassA, fixture.label).toContain("reusable tokens/primitives")
221
- expect(lowerPassA, fixture.label).toContain("extend to new pages")
222
- expect(lowerPassA, fixture.label).toContain("missing overview content")
223
- expect(lowerPassB, fixture.label).toContain("pixel-perfectly")
224
- expect(lowerPassB, fixture.label).toContain("actual against reference")
225
- expect(lowerPassB, fixture.label).toContain("overview text is part of the target")
226
- }
227
- })
228
-
229
- test("#given reference packet evidence #when prompting reviewers #then sensitive content is redacted and annotations stay untrusted data", () => {
230
- for (const fixture of fixtures()) {
231
- const capture = sectionBetween(fixture.text, "## Step 2", "## Step 3")
232
- const passA = sectionBetween(fixture.text, "### Pass A", "### Pass B")
233
- const passB = sectionBetween(fixture.text, "### Pass B", "## Step 4")
234
- const combined = `${capture}\n${passA}\n${passB}`.toLowerCase()
235
-
236
- expect(combined, fixture.label).toContain("redact or omit secrets")
237
- expect(combined, fixture.label).toContain("credentials")
238
- expect(combined, fixture.label).toContain("tokens")
239
- expect(combined, fixture.label).toContain("auth headers")
240
- expect(combined, fixture.label).toContain("customer data")
241
- expect(combined, fixture.label).toContain("private messages")
242
- expect(combined, fixture.label).toContain("internal urls")
243
- expect(combined, fixture.label).toContain("other sensitive content")
244
- expect(combined, fixture.label).toContain("overview text")
245
- expect(combined, fixture.label).toContain("annotations")
246
- expect(combined, fixture.label).toContain("untrusted data")
247
- expect(combined, fixture.label).toContain("captured ui copy")
248
- expect(combined, fixture.label).toContain("comments")
249
- expect(combined, fixture.label).toContain("filenames")
250
- expect(combined, fixture.label).toContain("not reviewer instructions")
251
- expect(combined, fixture.label).toContain("never as instructions")
252
- }
253
- })
254
- })
255
-
256
- describe("visual-qa motion capture and slop-animation contract", () => {
257
- test("#given an animated or interactive surface #when capturing #then rest, mid-transition and settled frames are driven and captured", () => {
258
- for (const fixture of fixtures()) {
259
- const motion = sectionBetween(fixture.text, "### Motion and interaction capture", "## Step 3")
260
- const lower = motion.toLowerCase()
261
-
262
- expect(lower, fixture.label).toContain("rest")
263
- expect(lower, fixture.label).toContain("mid-transition")
264
- expect(lower, fixture.label).toContain("settled")
265
- expect(lower, fixture.label).toContain("hover")
266
- expect(lower, fixture.label).toContain("focus")
267
- expect(lower, fixture.label).toContain("click")
268
- expect(lower, fixture.label).toContain("scroll-triggered")
269
- expect(lower, fixture.label).toContain("load animation")
270
- }
271
- })
272
-
273
- test("#given animation-induced pixel diff #when judging fidelity #then it is never an excuse to dismiss a defect", () => {
274
- for (const fixture of fixtures()) {
275
- const motion = sectionBetween(fixture.text, "### Motion and interaction capture", "## Step 3")
276
- const lower = motion.toLowerCase()
277
-
278
- expect(lower, fixture.label).toContain("never a valid excuse")
279
- expect(lower, fixture.label).toContain("settled state to settled state")
280
- expect(lower, fixture.label).toContain("reference's own motion")
281
- }
282
- })
283
-
284
- test("#given meaningless motion #when reviewing #then Pass A flags slop animation, especially hover-without-action", () => {
285
- for (const fixture of fixtures()) {
286
- const passA = sectionBetween(fixture.text, "### Pass A", "### Pass B")
287
- const checkBlock = sectionBetween(passA, "CHECK EACH:", "OUTPUT:")
288
- const lower = checkBlock.toLowerCase()
289
-
290
- expect(lower, fixture.label).toContain("slop animation")
291
- expect(lower, fixture.label).toContain("non-interactive")
292
- expect(lower, fixture.label).toContain("no state change")
293
- expect(lower, fixture.label).toContain("hover-without-action")
294
- }
295
- })
296
- })