oh-my-opencode 5.0.0-beta.31 → 5.0.0-beta.32

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 (227) hide show
  1. package/dist/cli/index.js +136 -44
  2. package/dist/cli-node/index.js +136 -44
  3. package/dist/features/background-agent/parent-wake-notifier-types.d.ts +1 -1
  4. package/dist/features/background-agent/parent-wake-prompt-dispatch.d.ts +1 -1
  5. package/dist/features/background-agent/parent-wake-session-inspector.d.ts +1 -1
  6. package/dist/features/monitor/manager-internals.d.ts +1 -1
  7. package/dist/features/monitor/output-injector-types.d.ts +1 -1
  8. package/dist/features/team-mode/tools/messaging-live-delivery-recipient.d.ts +1 -0
  9. package/dist/features/team-mode/tools/messaging-runtime.d.ts +1 -0
  10. package/dist/hooks/anthropic-context-window-limit-recovery/tool-result-storage.d.ts +11 -0
  11. package/dist/index.js +286 -99
  12. package/dist/skills/ultimate-browsing/references/insane-search/README.md +9 -2
  13. package/dist/tools/session-manager/directory-filter.d.ts +2 -0
  14. package/dist/tui.js +109 -23
  15. package/package.json +16 -15
  16. package/packages/lsp-core/src/lsp/client-diagnostics-freshness.integration.test.ts +47 -19
  17. package/packages/lsp-core/src/lsp/client-diagnostics-pull-timeout.test.ts +64 -0
  18. package/packages/lsp-core/src/lsp/client.ts +6 -3
  19. package/packages/lsp-core/src/lsp/controlled-clock-test-support.ts +61 -0
  20. package/packages/lsp-core/src/lsp/fixtures/workspace-edit-server.mjs +10 -3
  21. package/packages/lsp-core/src/lsp/timer-provider.ts +13 -0
  22. package/packages/lsp-core/src/lsp/transport-request-timeout.test.ts +73 -0
  23. package/packages/lsp-core/src/lsp/transport.ts +7 -2
  24. package/packages/lsp-core/src/lsp/workspace-document-state.test.ts +84 -1
  25. package/packages/lsp-core/src/lsp/workspace-document-state.ts +30 -11
  26. package/packages/lsp-core/src/tools/parameters.test.ts +51 -0
  27. package/packages/lsp-daemon/dist/cli.js +41 -16
  28. package/packages/lsp-daemon/dist/client.js +41 -16
  29. package/packages/lsp-daemon/dist/index.js +41 -16
  30. package/packages/lsp-tools-mcp/dist/cli.js +41 -16
  31. package/packages/lsp-tools-mcp/dist/lsp/manager.js +41 -16
  32. package/packages/lsp-tools-mcp/dist/mcp.js +41 -16
  33. package/packages/lsp-tools-mcp/dist/tools.js +41 -16
  34. package/packages/lsp-tools-mcp/package.json +1 -1
  35. package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
  36. package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
  37. package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
  38. package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +3 -17
  39. package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +3 -17
  40. package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
  41. package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
  42. package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
  43. package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
  44. package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
  45. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
  46. package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
  47. package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
  48. package/packages/omo-codex/plugin/components/lsp/dist/cli.js +39 -16
  49. package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
  50. package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
  51. package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
  52. package/packages/omo-codex/plugin/components/rules/package.json +1 -1
  53. package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
  54. package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
  55. package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
  56. package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
  57. package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -4
  58. package/packages/omo-codex/plugin/components/ultrawork/dist/cli.js +489 -4
  59. package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
  60. package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -2
  61. package/packages/omo-codex/plugin/components/ultrawork/scripts/sync-directive.mjs +30 -14
  62. package/packages/omo-codex/plugin/components/ultrawork/src/directive-content.ts +4 -0
  63. package/packages/omo-codex/plugin/components/ultrawork/src/directive.ts +5 -2
  64. package/packages/omo-codex/plugin/components/ultrawork/test/directive-source.test.ts +14 -8
  65. package/packages/omo-codex/plugin/components/ultrawork/test/package-smoke.test.ts +12 -1
  66. package/packages/omo-codex/plugin/components/ulw-execute-continuation/hooks/hooks.json +2 -2
  67. package/packages/omo-codex/plugin/components/ulw-execute-continuation/package.json +1 -1
  68. package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +4 -2
  69. package/packages/omo-codex/plugin/components/ulw-loop/README.md +1 -0
  70. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-continuation.js +9 -0
  71. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.d.ts +14 -0
  72. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-reconciliation.js +10 -1
  73. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.d.ts +8 -0
  74. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint-template.js +113 -0
  75. package/packages/omo-codex/plugin/components/ulw-loop/dist/checkpoint.js +7 -5
  76. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-commands.js +2 -1
  77. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.d.ts +1 -1
  78. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-output.js +1 -0
  79. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli-subcommands.js +2 -0
  80. package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +775 -312
  81. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-instruction.js +18 -0
  82. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.d.ts +13 -0
  83. package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +14 -0
  84. package/packages/omo-codex/plugin/components/ulw-loop/dist/domain-types.d.ts +17 -9
  85. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-io.js +17 -2
  86. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.d.ts +13 -0
  87. package/packages/omo-codex/plugin/components/ulw-loop/dist/plan-missing-recovery.js +19 -0
  88. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.d.ts +2 -0
  89. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-aggregate.js +53 -0
  90. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.d.ts +9 -0
  91. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-artifacts.js +85 -0
  92. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate-fields.js +1 -1
  93. package/packages/omo-codex/plugin/components/ulw-loop/dist/quality-gate.js +41 -99
  94. package/packages/omo-codex/plugin/components/ulw-loop/dist/review-blockers.js +4 -2
  95. package/packages/omo-codex/plugin/components/ulw-loop/dist/spawn-guard.js +184 -14
  96. package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.d.ts +6 -0
  97. package/packages/omo-codex/plugin/components/ulw-loop/dist/status-next-actions.js +33 -0
  98. package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.d.ts +3 -0
  99. package/packages/omo-codex/plugin/components/ulw-loop/dist/surface.js +15 -0
  100. package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
  101. package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
  102. package/packages/omo-codex/plugin/components/ulw-loop/skills/ulw-loop/references/full-workflow.md +17 -0
  103. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-continuation.ts +7 -0
  104. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-reconciliation.ts +25 -1
  105. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint-template.ts +127 -0
  106. package/packages/omo-codex/plugin/components/ulw-loop/src/checkpoint.ts +8 -12
  107. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-commands.ts +2 -1
  108. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-output.ts +1 -0
  109. package/packages/omo-codex/plugin/components/ulw-loop/src/cli-subcommands.ts +2 -0
  110. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-instruction.ts +18 -0
  111. package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +23 -0
  112. package/packages/omo-codex/plugin/components/ulw-loop/src/domain-types.ts +19 -9
  113. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-io.ts +18 -3
  114. package/packages/omo-codex/plugin/components/ulw-loop/src/plan-missing-recovery.ts +27 -0
  115. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-aggregate.ts +57 -0
  116. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-artifacts.ts +103 -0
  117. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate-fields.ts +1 -1
  118. package/packages/omo-codex/plugin/components/ulw-loop/src/quality-gate.ts +50 -116
  119. package/packages/omo-codex/plugin/components/ulw-loop/src/review-blockers.ts +4 -2
  120. package/packages/omo-codex/plugin/components/ulw-loop/src/spawn-guard.ts +186 -12
  121. package/packages/omo-codex/plugin/components/ulw-loop/src/status-next-actions.ts +36 -0
  122. package/packages/omo-codex/plugin/components/ulw-loop/src/surface.ts +22 -0
  123. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-final.test.ts +66 -3
  124. package/packages/omo-codex/plugin/components/ulw-loop/test/checkpoint-template.test.ts +92 -0
  125. package/packages/omo-codex/plugin/components/ulw-loop/test/cli-status-next-actions.test.ts +183 -0
  126. package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-instruction.test.ts +13 -3
  127. package/packages/omo-codex/plugin/components/ulw-loop/test/guided-recovery.test.ts +105 -0
  128. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-aggregate.test.ts +101 -0
  129. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-roles.test.ts +16 -15
  130. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate-senpi-surface.test.ts +131 -0
  131. package/packages/omo-codex/plugin/components/ulw-loop/test/quality-gate.test.ts +5 -0
  132. package/packages/omo-codex/plugin/components/ulw-loop/test/spawn-guard.test.ts +300 -3
  133. package/packages/omo-codex/plugin/components/ulw-loop/test/ultrawork-directive.test.ts +9 -3
  134. package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
  135. package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
  136. package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
  137. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
  138. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
  139. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
  140. package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
  141. package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
  142. package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
  143. package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
  144. package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
  145. package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
  146. package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
  147. package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
  148. package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
  149. package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
  150. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-execute-continuation.json +1 -1
  151. package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
  152. package/packages/omo-codex/plugin/hooks/subagent-stop-checking-ulw-execute-continuation.json +1 -1
  153. package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
  154. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
  155. package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
  156. package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
  157. package/packages/omo-codex/plugin/package-lock.json +13 -13
  158. package/packages/omo-codex/plugin/package.json +1 -1
  159. package/packages/omo-codex/plugin/scripts/sync-skills.mjs +31 -2
  160. package/packages/omo-codex/plugin/skills/ultimate-browsing/references/insane-search/README.md +9 -2
  161. package/packages/omo-codex/plugin/skills/ulw-loop/references/full-workflow.md +17 -0
  162. package/packages/omo-codex/plugin/test/sync-skills-test-support.mjs +11 -1
  163. package/packages/omo-codex/plugin/test/sync-skills.test.mjs +13 -0
  164. package/packages/omo-codex/plugin/test/ultrawork-skill-pointer.test.mjs +5 -2
  165. package/packages/omo-codex/scripts/install-dist/install-local.mjs +2 -2
  166. package/packages/shared-skills/skills/ultimate-browsing/references/insane-search/README.md +9 -2
  167. package/dist/features/builtin-skills/index.d.ts +0 -1
  168. package/dist/features/builtin-skills/skill-file-loader.d.ts +0 -1
  169. package/dist/features/builtin-skills/skills/agent-browser-skill.d.ts +0 -1
  170. package/dist/features/builtin-skills/skills/agent-browser-template.d.ts +0 -1
  171. package/dist/features/builtin-skills/skills/debugging.d.ts +0 -1
  172. package/dist/features/builtin-skills/skills/dev-browser.d.ts +0 -1
  173. package/dist/features/builtin-skills/skills/frontend.d.ts +0 -1
  174. package/dist/features/builtin-skills/skills/git-master-sections/commit-atomic-planning.d.ts +0 -1
  175. package/dist/features/builtin-skills/skills/git-master-sections/commit-context-analysis.d.ts +0 -1
  176. package/dist/features/builtin-skills/skills/git-master-sections/commit-execution-verification.d.ts +0 -1
  177. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +0 -1
  178. package/dist/features/builtin-skills/skills/git-master-sections/history-search-workflow.d.ts +0 -1
  179. package/dist/features/builtin-skills/skills/git-master-sections/overview.d.ts +0 -1
  180. package/dist/features/builtin-skills/skills/git-master-sections/quick-reference.d.ts +0 -1
  181. package/dist/features/builtin-skills/skills/git-master-sections/rebase-workflow.d.ts +0 -1
  182. package/dist/features/builtin-skills/skills/git-master-skill-metadata.d.ts +0 -1
  183. package/dist/features/builtin-skills/skills/git-master.d.ts +0 -1
  184. package/dist/features/builtin-skills/skills/index.d.ts +0 -1
  185. package/dist/features/builtin-skills/skills/init-deep.d.ts +0 -1
  186. package/dist/features/builtin-skills/skills/playwright-cli.d.ts +0 -1
  187. package/dist/features/builtin-skills/skills/playwright-mcp-skill.d.ts +0 -1
  188. package/dist/features/builtin-skills/skills/playwright.d.ts +0 -1
  189. package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +0 -1
  190. package/dist/features/builtin-skills/skills/review-work.d.ts +0 -1
  191. package/dist/features/builtin-skills/skills/security-research.d.ts +0 -1
  192. package/dist/features/builtin-skills/skills/security-review.d.ts +0 -1
  193. package/dist/features/builtin-skills/skills/team-mode.d.ts +0 -1
  194. package/dist/features/builtin-skills/skills/visual-qa.d.ts +0 -1
  195. package/dist/features/builtin-skills/skills.d.ts +0 -1
  196. package/dist/features/builtin-skills/types.d.ts +0 -1
  197. package/dist/features/claude-code-plugin-loader/agent-loader.d.ts +0 -1
  198. package/dist/features/claude-code-plugin-loader/command-loader.d.ts +0 -1
  199. package/dist/features/claude-code-plugin-loader/discovery-core.d.ts +0 -1
  200. package/dist/features/claude-code-plugin-loader/discovery-paths.d.ts +0 -1
  201. package/dist/features/claude-code-plugin-loader/discovery.d.ts +0 -1
  202. package/dist/features/claude-code-plugin-loader/hook-loader.d.ts +0 -1
  203. package/dist/features/claude-code-plugin-loader/index.d.ts +0 -1
  204. package/dist/features/claude-code-plugin-loader/install-path-resolver.d.ts +0 -1
  205. package/dist/features/claude-code-plugin-loader/installed-plugin-database.d.ts +0 -1
  206. package/dist/features/claude-code-plugin-loader/loaded-plugin.d.ts +0 -1
  207. package/dist/features/claude-code-plugin-loader/loader.d.ts +0 -1
  208. package/dist/features/claude-code-plugin-loader/mcp-server-loader.d.ts +0 -1
  209. package/dist/features/claude-code-plugin-loader/plugin-key.d.ts +0 -1
  210. package/dist/features/claude-code-plugin-loader/plugin-manifest.d.ts +0 -1
  211. package/dist/features/claude-code-plugin-loader/plugin-path-resolver.d.ts +0 -1
  212. package/dist/features/claude-code-plugin-loader/plugin-settings.d.ts +0 -1
  213. package/dist/features/claude-code-plugin-loader/scope-filter.d.ts +0 -1
  214. package/dist/features/claude-code-plugin-loader/skill-loader.d.ts +0 -1
  215. package/dist/features/claude-code-plugin-loader/types.d.ts +0 -1
  216. package/dist/shared/prompt-async-gate/message-inspection-error.d.ts +0 -1
  217. package/dist/shared/prompt-async-gate/pending-tool-turn.d.ts +0 -1
  218. package/dist/shared/prompt-async-gate/prompt-message-state.d.ts +0 -1
  219. package/dist/shared/prompt-async-gate/queue.d.ts +0 -1
  220. package/dist/shared/prompt-async-gate/recent-dispatches.d.ts +0 -1
  221. package/dist/shared/prompt-async-gate/reservations.d.ts +0 -1
  222. package/dist/shared/prompt-async-gate/semantic-dedupe.d.ts +0 -1
  223. package/dist/shared/prompt-async-gate/session-idle-dispatch.d.ts +0 -1
  224. package/dist/shared/prompt-async-gate/timing.d.ts +0 -1
  225. package/dist/shared/prompt-async-gate/types.d.ts +0 -1
  226. package/packages/omo-codex/plugin/components/ultrawork/directive.md +0 -483
  227. package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +0 -490
@@ -4,15 +4,500 @@
4
4
  import { stdin as processStdin, stdout as processStdout } from "node:process";
5
5
 
6
6
  // components/ultrawork/src/codex-hook.ts
7
- import { readFileSync as readFileSync2 } from "node:fs";
7
+ import { readFileSync } from "node:fs";
8
8
 
9
9
  // components/ultrawork/src/skill-pointer.ts
10
10
  import { existsSync } from "node:fs";
11
11
  import { fileURLToPath } from "node:url";
12
12
 
13
+ // components/ultrawork/src/directive-content.ts
14
+ var ULTRAWORK_DIRECTIVE_TEXT = `<ultrawork-mode>
15
+
16
+ **MANDATORY**: First user-visible line this turn MUST be exactly:
17
+ \`ULTRAWORK MODE ENABLED!\`
18
+
19
+ [CODE RED] Maximum precision. Outcome-first. Evidence-driven.
20
+
21
+ # Role
22
+ Expert coding agent. Ship verified work. No process narration.
23
+
24
+ # Goal
25
+ Deliver EXACTLY what the user asked, end-to-end working, proven by
26
+ captured evidence: a failing-first proof that went RED→GREEN through
27
+ the cheapest faithful channel, plus real-surface proof sized by the
28
+ tier below. TESTS ALONE NEVER PROVE DONE — a green suite means the
29
+ unit-level contract holds, not that the user-facing behavior works.
30
+
31
+ # Tier triage (classify ONCE at bootstrap; record tier + one-line
32
+ justification in the notepad; ratchet up only)
33
+ Your change set is what THIS session will itself edit or execute;
34
+ work handed to another session, thread, or delegated loop is payload
35
+ and sizes THAT session's process, not yours. Launching it — sync,
36
+ prompt, create, verify — is control-plane work: LIGHT however large
37
+ the delegated project is.
38
+ Default is LIGHT. Take HEAVY only when the change set hits a fact you
39
+ can point to: a new module / layer / domain model / abstraction;
40
+ auth, security, session-handling code, or permissions; building or
41
+ changing an external integration (API, queue, payment, webhook) —
42
+ calling an existing API is not one; a DB schema or migration;
43
+ concurrency, transaction boundaries, or cache invalidation; a
44
+ refactor crossing domain boundaries; or the user signaled care
45
+ ("carefully", "thoroughly", "design first") or demanded review of
46
+ this session's work.
47
+ When unsure, take HEAVY. If a HEAVY fact surfaces mid-task, upgrade
48
+ immediately and redo whatever the LIGHT path skipped; never downgrade
49
+ mid-task. The tier sizes process, never honesty: both tiers capture
50
+ evidence, record cleanup receipts, and obey the never-suppress rules.
51
+
52
+ LIGHT — the deliverable follows a known pattern with no open design
53
+ decisions (one-spot bugfix, an endpoint following an existing
54
+ pattern, a validation rule, a query tweak, copy/constants, launching
55
+ or steering another session): plan directly in the notepad; 1-2
56
+ success criteria (happy path + the riskiest edge); one real-surface
57
+ proof of the user-visible deliverable, where auxiliary surfaces are
58
+ first-class for CLI- or data-shaped work; self-review recorded in the
59
+ notepad instead of the reviewer loop.
60
+ HEAVY — anything a fact above names: 3+ success criteria (happy,
61
+ edge, regression, adversarial risk), each with its own channel
62
+ scenario and both evidence pieces; reviewer loop until unconditional
63
+ approval.
64
+
65
+ # Manual-QA channels
66
+ Run real-surface proof yourself through the channel that faithfully
67
+ exercises the surface; capture the artifact.
68
+
69
+ 1. HTTP call — hit the live endpoint with \`curl -i\` (or a
70
+ Playwright APIRequestContext); capture status line + headers +
71
+ body.
72
+ 2. Terminal / TUI - drive a real pty and prove it through the
73
+ xterm.js web terminal (see the TUI visual QA note below). tmux
74
+ \`send-keys\` is fine for a boot smoke; NEVER \`tmux capture-pane\`
75
+ for color / layout / CJK evidence, which degrades truecolor.
76
+ 3. Browser use — in Codex, use \`browser:control-in-app-browser\`
77
+ first when available and no authenticated/persistent user browser
78
+ profile is required. Otherwise use Chrome to drive the REAL page;
79
+ if Chrome is not available, download and use agent-browser
80
+ (https://github.com/vercel-labs/agent-browser). Capture action
81
+ log + screenshot path. Never downgrade to a non-browser surface
82
+ for a browser-facing criterion. NEVER clear cookies, cache, or
83
+ site data (\`Network.clearBrowserCookies\`, \`Storage.clearCookies\`,
84
+ \`chrome.browsingData.remove\`, "clear browsing data") on the user's
85
+ real/main browser profile — it wipes their logged-in state. If you
86
+ need that profile's login state, clone it first (\`rsync -a
87
+ <profile>/ <tmp-clone>/\`) and launch Chrome / agent-browser against
88
+ the clone as the user-data-dir; run any clearing there only.
89
+ 4. Computer use — when the surface is a desktop/GUI app rather than a
90
+ page, drive it via OS-level automation (a computer-use agent,
91
+ AppleScript, xdotool, etc.) against the running app; capture
92
+ action log + screenshot. USE THIS for any non-browser GUI
93
+ criterion; do not substitute a CLI dump for it.
94
+
95
+ For EVERY scenario name the exact tool and the exact invocation
96
+ upfront: the literal command / API call / page action with its concrete
97
+ inputs (URL, payload, keystrokes, selectors) and the single binary
98
+ observable that decides PASS vs FAIL. "run the endpoint", "open the
99
+ page", "check it works" are NOT scenarios — write the \`curl ...\`, the
100
+ \`send-keys ...\`, the Browser plugin action, the \`page.click(...)\`, the
101
+ expected status/text.
102
+
103
+ Auxiliary surfaces (CLI stdout / DB state diff / parsed config dump)
104
+ are first-class evidence for CLI- or data-shaped criteria; use a
105
+ channel scenario when the behavior is user-facing. \`--dry-run\`,
106
+ printing the command, "should respond", and "looks correct" never
107
+ count.
108
+
109
+ For TUI visual QA, render the terminal through the real xterm.js web
110
+ terminal and screenshot it - never a \`tmux capture-pane\` dump, which
111
+ degrades color and wide-glyph width. In this repo:
112
+ \`node script/qa/web-terminal-visual-qa.mjs --title "<surface>" --command "<cmd>" --input "{Enter}" --evidence-dir <dir>\`
113
+ (live pty + xterm.js in Chrome; \`--from-file <capture>\` replays a raw
114
+ stream). Outside this repo, capture equivalent browser-rendered terminal
115
+ evidence: screenshot + plain transcript + cleanup receipt.
116
+
117
+ # Bootstrap (DO ALL FOUR BEFORE ANY OTHER WORK — NO SKIPPING)
118
+
119
+ ## 0. Survey the skills, gather context, then size the work
120
+ First, survey the loaded skill list and read the description of each
121
+ loosely relevant skill. Decide explicitly which skills this task will
122
+ use and prefer using every genuinely applicable one — name them in the
123
+ notepad with a one-line reason each. Skipping a skill that fits the
124
+ task is a defect. Open a skill's body only when THIS session will
125
+ execute its workflow; skills a delegated session needs are named in
126
+ its prompt and read there, not here.
127
+ Next, fire the first discovery wave under Finding things below.
128
+ Then run Tier triage (above) on the change set and record the tier —
129
+ tier sizes evidence and review, never who plans. Size planning by
130
+ what the wave left UNDECIDED, not by how many steps you can list:
131
+ spawn the \`plan\` agent only when open design decisions remain —
132
+ unclear module boundaries, several viable decompositions, or a
133
+ multi-file build whose dependency order is not obvious — pass it the
134
+ gathered findings (file:line facts, constraints, unknowns), and
135
+ follow its wave order, parallel grouping, and verification exactly.
136
+ A known procedure — however many steps — and questions about work you
137
+ are delegating never justify a planner: plan directly in the notepad.
138
+ Never spawn \`plan\` before the discovery wave has returned.
139
+
140
+ ## 1. Create the goal with binding success criteria
141
+ You MUST register the goal with the \`create_goal\` tool — NOT prose,
142
+ NOT the notepad, NOT the plan: the registered goal is the binding
143
+ contract for the whole run, and skipping it is a defect. Call it with
144
+ exactly \`objective\`; do not include \`status\`. Only when no goal tool
145
+ exists on this surface, open your reply with a \`# Goal\` block treated
146
+ as binding. Goals are unlimited; never invent a numeric budget or
147
+ limit.
148
+ Check \`get_goal\` first: continue a matching active goal instead of
149
+ duplicating one; surface a conflicting one. Write the objective
150
+ outcome-first: the concrete thing that will be TRUE when done (an
151
+ outcome, never an activity), the named deliverable surfaces, and
152
+ explicit scope bounds — a vague objective produces vague criteria,
153
+ and vague criteria cannot be proven.
154
+ The criteria MUST list, upfront:
155
+ - The user-visible deliverable in one line, and the tier with its
156
+ justification.
157
+ - Success criteria sized by tier (LIGHT 1-2, HEAVY 3+ covering happy
158
+ path, edge cases — boundary / empty / malformed / concurrent — and
159
+ adjacent-surface regression named by file + function), each naming
160
+ its exact scenario: the literal command / page action / payload and
161
+ the binary PASS/FAIL observable, plus the evidence artifact it will
162
+ capture.
163
+ - For each criterion, the failing-first proof (test id or scenario)
164
+ that will be captured RED BEFORE the implementation and GREEN after.
165
+ Evidence added after the green code does NOT satisfy this.
166
+ - WHEN TO STOP, in one line: "I'll stop right away when <the exact
167
+ observable state that ends this run>". The Stop rules bind to this
168
+ line — the moment it holds, you stop.
169
+
170
+ These scenarios are the contract. You are not done until every one of
171
+ them PASSES with its evidence captured.
172
+
173
+ ## 2. Open the durable notepad
174
+ Run: \`NOTE=$(mktemp -t ulw-$(date +%Y%m%d-%H%M%S).XXXXXX.md)\`. Echo the
175
+ path. Initialise it with these sections and APPEND (never rewrite) as
176
+ you work:
177
+
178
+ \`\`\`
179
+ # Ultrawork Notepad — <one-line goal>
180
+ Started: <ISO timestamp>
181
+
182
+ ## Plan (exhaustively detailed)
183
+ <every step you will take, in order, broken to atomic actions>
184
+
185
+ ## Success criteria + QA scenarios
186
+ <copied from the goal>
187
+
188
+ ## Now
189
+ <the single step in progress>
190
+
191
+ ## Todo
192
+ <every remaining step, ordered>
193
+
194
+ ## Findings
195
+ <every non-obvious fact discovered, with file:line refs>
196
+
197
+ ## Learnings
198
+ <patterns / pitfalls / principles to remember next turn>
199
+ \`\`\`
200
+
201
+ Append each finding, decision, command, RED/GREEN capture, and QA
202
+ artifact path the moment it happens. Update \`## Now\` and
203
+ \`## Todo\` on every transition. Append-only — never rewrite. This notepad
204
+ is your durable memory and it OUTLIVES the context window. After any
205
+ compaction or context loss (a \`Context compacted\` notice, a summarized
206
+ history, or you no longer see your own earlier steps), STOP and re-read
207
+ the WHOLE notepad FIRST before any other action, then resume from
208
+ \`## Now\`. Recover
209
+ state from the notepad; do not re-plan from scratch or re-run completed
210
+ steps.
211
+
212
+ ## 3. Register obsessive todos via \`update_plan\`
213
+ The todo tool is Codex \`update_plan\` — your live, user-visible
214
+ checklist. Translate every action from the plan into one \`update_plan\`
215
+ step — one step per atomic work unit: an edit plus its verification, a
216
+ QA scenario run, a teardown. Keep each step small enough to finish
217
+ within a few tool calls.
218
+ Call \`update_plan\` on EVERY state transition — the instant a step starts
219
+ (mark it \`in_progress\`) and the instant it finishes (mark it \`completed\`
220
+ and the next \`in_progress\`). Exactly ONE \`in_progress\` at a time. Mark
221
+ completed IMMEDIATELY — never batch, never let the rendered plan lag
222
+ behind reality. Add newly discovered steps the moment they surface
223
+ instead of waiting for the next pass. Step text encodes WHERE / WHY
224
+ (which criterion it advances) / HOW / VERIFY:
225
+ \`path: <action> for <criterion> — verify by <check>\`.
226
+
227
+ GOOD pair (test-first, ordered):
228
+ \`foo.test.ts: Write FAILING case invalid-email→ValidationError for criterion 2 — verify by RED with assertion msg\`
229
+ \`src/foo/bar.ts: Implement validateEmail() RFC-5322-lite for criterion 2 — verify by foo.test.ts GREEN + curl 400 body\`
230
+ BAD: "Implement feature" / "Fix bug" / "Add tests later" / writing
231
+ production code before its failing test → rewrite.
232
+
233
+ # Finding things (lead with these, code-mode the first wave)
234
+ Never guess from memory — locate with the right tool, and re-read before
235
+ you claim or change. **USE CODE MODE AGGRESSIVELY FOR BOUNDED WAVES.**
236
+ When multiple independent tool calls produce results that can be materially
237
+ filtered, joined, deduplicated, or reduced, make ONE \`exec\` / eval JavaScript
238
+ program that calls eligible tools concurrently with \`Promise.all\` and emits only
239
+ decision-relevant evidence. For shell-native repo work without programmatic
240
+ tool access, use ONE Python script with \`concurrent.futures\`, \`subprocess\`,
241
+ and utility functions to batch commands and reduce output. Keep direct calls
242
+ when one result chooses the next action, outputs are already small, semantic
243
+ judgment is required between calls, approval or side effects are involved,
244
+ or native artifacts / citations must be preserved.
245
+ - Architecture / flow / blast radius → \`codegraph_explore\` first when
246
+ \`codegraph_*\` exists; if unavailable, continue with repo tools and LSP.
247
+ - **SYMBOLS REQUIRE LSP** — definitions, references, rename impact,
248
+ workspace symbols, and diagnostics use the available \`lsp_*\` tools, not
249
+ text search. Run diagnostics after edits and treat errors as blocking.
250
+ - Repo text / filenames / history / bounded shell output → \`rg\`,
251
+ \`rg --files\`, \`git\`, and native utilities; narrow output in-program.
252
+ - Structural call / function / class / import shapes and codemods → the
253
+ \`ast-grep\` skill or \`sg\` with \`$VAR\` / \`$$$\` metavariables.
254
+ When discovery needs multiple angles or the module layout is
255
+ unfamiliar, delegate to the \`explorer\` subagent (read-only codebase
256
+ search, absolute-path results). For research that leaves the repo —
257
+ library/API/docs/web — delegate to the \`librarian\` subagent. Spawn them
258
+ \`fork_context: false\` and keep doing root work while they run.
259
+
260
+ # Execution loop (PIN → RED → GREEN → SURFACE → CLEAN)
261
+ Until every success criterion PASSES with its evidence captured:
262
+ 1. Pick next criterion → mark in_progress → update notepad \`## Now\`.
263
+ 2. PIN + RED: when refactoring behavior whose regressions the change
264
+ could hide, first pin it with a characterization test that passes on
265
+ the unchanged code. Then
266
+ capture the failing-first proof through the cheapest faithful
267
+ channel — a unit test where a seam exists, an integration/e2e test
268
+ where the behavior lives in wiring, or the criterion's real-surface
269
+ scenario captured failing when no test seam exists. It must fail
270
+ for the RIGHT reason (not a syntax error, not a missing import).
271
+ Paste RED output into the notepad. No production code yet.
272
+ TEST-ONLY TARGET (regression coverage for behavior that is already
273
+ correct): there is no natural RED and no production change to make
274
+ — this is the sole exception to the production-RED/GREEN steps.
275
+ Substitute a mutation proof: temporarily force the exact regression
276
+ each new assertion names (revert the fix commit or break the seam,
277
+ never committed), capture the assertion failing, then revert the
278
+ mutation and capture GREEN. An assertion that stays green under its
279
+ mutation is not coverage — fix the fixture (a value equal to the
280
+ default it must override proves nothing) or assert the artifact the
281
+ criterion names, never an expected value re-derived from the output
282
+ under test. Reverting the probe IS the GREEN; skip step 3's
283
+ production change for a TEST-ONLY task and go to step 4.
284
+ PROSE TARGET (prompt, SKILL.md, rule, markdown): the wording is
285
+ NOT the behavior — never pin sentences, phrase presence/absence,
286
+ or word/char counts. PIN only a machine-consumed value (parsed
287
+ frontmatter field, a sentinel token a hook greps, the doc's JSON
288
+ sample through its real validator) or one \`toBe\` equality between
289
+ two shipped copies. A pure-prose change with no machine consumer
290
+ has NO seam: ship it on review + QA-by-read, NO test — a text grep
291
+ is pretend-coverage, not RED proof.
292
+ 3. GREEN (skip for TEST-ONLY — reverting the mutation is GREEN): write
293
+ the SMALLEST production change that flips RED→GREEN.
294
+ Before GREEN work that depends on external review, PR, issue, or
295
+ branch state, refresh current branch/PR/issue state and preserve existing ordering/policy;
296
+ separate compatibility detection from policy changes unless the goal
297
+ explicitly asks to change policy.
298
+ Re-run the proof. Capture GREEN output. A GREEN far larger than the
299
+ criterion implies means the proof was too coarse — split it.
300
+ 4. SURFACE: run the real-surface proof the criterion named (channel
301
+ table above; auxiliary surface for CLI- or data-shaped criteria),
302
+ end-to-end, yourself. If the RED proof was the scenario itself,
303
+ re-run it now and capture it passing. Paste the artifact path into
304
+ the notepad.
305
+ 5. CLEANUP (PAIRED — NEVER SKIP): the moment a QA scenario spawns any
306
+ resource, register its teardown as its own todo (e.g.
307
+ \`cleanup: kill server pid for criterion 2 — verify kill -0 fails\`).
308
+ Every runtime artifact the QA spawned in step 4 MUST be torn down
309
+ before this step completes:
310
+ server PIDs (\`kill <pid>\`; verify \`kill -0\` fails), \`tmux\` sessions
311
+ (\`tmux kill-session -t ulw-qa-<criterion>\`; verify with \`tmux ls\`),
312
+ browser / Playwright contexts (\`.close()\`), containers
313
+ (\`docker rm -f\`), bound ports (\`lsof -i :<port>\` empty), temp
314
+ sockets / files / dirs (\`rm -rf\` the \`mktemp\` paths), QA-only env
315
+ vars. Append a one-line cleanup receipt to the notepad next to the
316
+ artifact, e.g. \`cleanup: killed 12345; tmux kill-session ulw-qa-foo;
317
+ rm -rf /tmp/ulw.aB12cD\`. No receipt → criterion stays in_progress.
318
+ 6. Verify: LSP diagnostics clean on changed files + the test scope
319
+ this criterion touched green (no skipped, no xfail added this
320
+ turn). Re-run a validation command (suite, typecheck, build) only
321
+ when its inputs changed since its last green run; ONE full-suite
322
+ pass belongs immediately before the final message, not after
323
+ every increment.
324
+ 7. Mark completed. Append non-obvious findings / learnings.
325
+ 8. After each increment, re-run the scenarios that increment could
326
+ have affected; re-run the full set once, right before the final
327
+ message. Record PASS/FAIL inline with the evidence paths AND the
328
+ cleanup receipt. Loop until all PASS.
329
+
330
+ Within a step, follow Finding things; NEVER parallelise RED and GREEN of
331
+ the same criterion.
332
+
333
+ # Waiting discipline (a poll costs a full model round)
334
+ Every status check you issue as a tool call replays the entire
335
+ accumulated context through the model. When a command will run long
336
+ (installs, builds, test suites, containers, CI), run it to completion
337
+ in ONE call with a timeout sized to the expected duration, or send
338
+ output to a log file and read it once when a completion signal is
339
+ expected. Never re-poll the same surface with empty reads or
340
+ sub-minute waits — batch waiting into the fewest, longest blocking
341
+ calls the harness allows, and do independent root work while the
342
+ command runs. If two consecutive checks show no state change, double
343
+ the wait before the next check or switch to a completion signal.
344
+
345
+ # Codex subagent reliability
346
+ Every \`multi_agent_v1.spawn_agent\` message is self-contained and starts with
347
+ \`TASK: <imperative assignment>\`, then names \`DELIVERABLE\`, \`SCOPE\`,
348
+ \`VERIFY\`, and \`STOP WHEN\` — the observable condition that ends the
349
+ child's run; a child without a stop condition wanders past its goal.
350
+ State that it is an executable assignment, not a context handoff. Use \`fork_context: false\` unless full history is truly
351
+ required; paste only the context the child needs. Full-history forks can
352
+ make the child continue old parent context instead of the delegated task.
353
+ If your tool list has a flat \`spawn_agent\` with a required \`task_name\` instead of \`multi_agent_v1.*\` (\`multi_agent_v2\`), rewrite: \`fork_context: false\` becomes \`fork_turns: "none"\`, \`send_input\` becomes \`send_message\`, finished agents end on their own (no \`close_agent\`; \`followup_task\` re-tasks, \`interrupt_agent\` stops), and \`wait_agent\` takes only \`timeout_ms\`, returning on any child mailbox activity.
354
+
355
+ # TOML-backed subagent routing compatibility
356
+ Installed role TOMLs (\`~/.codex/agents/\`) bind ONLY via \`agent_type\`.
357
+ \`multi_agent_v1.spawn_agent\` exposes \`agent_type\`; the deployed
358
+ \`multi_agent_v2\` \`collaboration.spawn_agent\` schema does NOT (verified
359
+ 2026-07-11: only \`fork_turns\`, \`message\`, \`task_name\`). On a v2 surface,
360
+ omit \`agent_type\`, describe the role and difficulty tier inside
361
+ \`message\`, and expect the session model for children. Difficulty tiers
362
+ when \`agent_type\` IS exposed: low -> \`lazycodex-worker-low\`
363
+ (gpt-5.6-luna/high), medium -> \`lazycodex-worker-medium\`
364
+ (gpt-5.6-luna/max), high -> \`lazycodex-worker-high\` (gpt-5.6-sol/max);
365
+ explorer/librarian carry their own TOMLs (gpt-5.6-luna/low). Difficulty
366
+ (model power) is orthogonal to LIGHT/HEAVY rigor (process size).
367
+
368
+ Treat child status as a progress signal, not a timeout counter. For
369
+ work likely to exceed one wait cycle, tell the child to send
370
+ \`WORKING: <task> - <current phase>\` before long reading, testing, or
371
+ review passes, and \`BLOCKED: <reason>\` only when it cannot progress.
372
+ Track spawned agent names locally. Use \`multi_agent_v1.wait_agent\` for mailbox
373
+ signals, but a timeout only means no new mailbox update arrived.
374
+ Treat a running child as alive and keep doing independent root work.
375
+ Fallback only when the child is completed without the
376
+ deliverable, ack-only, or no longer running. If that followup is still
377
+ silent or ack-only, record the result as inconclusive, do not count it
378
+ as approval/pass, close it if safe, and respawn a smaller
379
+ \`fork_context: false\` task with the missing deliverable.
380
+
381
+ # Subagent-dependent transition barrier
382
+ Do not mark an \`update_plan\` step \`completed\` while an active child owns
383
+ evidence for that step. Do not start dependent implementation until the
384
+ audit, research, or review result is integrated or explicitly recorded
385
+ as inconclusive. Do not generate a plan before spawned research lanes
386
+ that feed the plan have returned or been closed as inconclusive.
387
+ Spawn every independent child for the current wave first. After the wave
388
+ is launched, run \`multi_agent_v1.wait_agent\` for each spawned child until
389
+ each reaches terminal status (\`completed\`, \`failed\`, \`blocked\`, or
390
+ explicitly recorded inconclusive) before any dependent \`update_plan\`
391
+ transition, \`create_goal\` continuation, implementation tool call, plan
392
+ drafting, approval-gate work, PR handoff, or final response. A timeout is
393
+ not terminal status.
394
+ Do not write the final answer, PR handoff, or completion summary while
395
+ active child agents remain open. Use \`multi_agent_v1.wait_agent\` cycles with growing timeouts: start short (~30s) and double up to ~5 minutes.
396
+ After two silent waits send \`TASK STILL ACTIVE: return <deliverable> or
397
+ BLOCKED: <reason>\`. After four silent or ack-only checks, close the lane as
398
+ inconclusive, record that it is not approval, and respawn smaller only
399
+ if the deliverable is still required.
400
+
401
+ # Verification gate (TRIGGERED, NOT OPTIONAL)
402
+
403
+ Trigger when ANY apply:
404
+ - Tier is HEAVY.
405
+ - User demanded strict, rigorous, or proper review.
406
+ LIGHT tier records a self-review in the notepad instead: re-read the
407
+ diff, run diagnostics, confirm each criterion's evidence, and state in
408
+ one line why the tier held.
409
+
410
+ Procedure (NON-NEGOTIABLE):
411
+ 1. Spawn a child with \`fork_context: false\` and a self-contained reviewer
412
+ assignment in \`message\`. The \`multi_agent_v1.spawn_agent\` schema cannot select a
413
+ TOML-backed reviewer role, so paste the reviewer requirements into
414
+ the message.
415
+ Pass: goal, success-criteria, scenario evidence, full diff, notepad
416
+ path.
417
+ 2. Verify each reviewer concern yourself. A concern blocks only when
418
+ it names a success criterion the evidence fails; record concerns
419
+ that cite no criterion as notes with a one-line reason — fixed or
420
+ declined at your judgment.
421
+ 3. Fix every criterion-cited blocker. Re-run ONLY the scenario QA
422
+ affected by the fix; capture fresh evidence for the delta. Update
423
+ notepad.
424
+ 4. Re-submit to the SAME reviewer at most twice, passing only the
425
+ delta diff, the blockers it cited, and the already-approved criteria
426
+ marked out-of-scope. An approval whose only remaining items are
427
+ notes counts as approval.
428
+ 5. On approval, declare done. If criterion-cited blockers remain after
429
+ two re-reviews, stop and surface them to the user (mirroring the
430
+ 2-attempt stop rule below) — do not loop further.
431
+
432
+ # Commits
433
+ Commit frequently: one atomic commit per verified increment (RED→GREEN
434
+ + its evidence), never one end-of-run omnibus; each commit builds +
435
+ tests green on its own; no WIP on the final branch.
436
+ BEFORE composing each message, read the history and mimic it: run
437
+ \`git log --oneline -20\` plus \`git log -5 -- <touched paths>\` and match
438
+ the observed convention — subject shape, scope names, message language,
439
+ body style, and typical commit size. Default to Conventional Commits
440
+ (\`<type>(<scope>): <imperative>\` — feat / fix / refactor / test / docs /
441
+ chore / build / ci / perf) only where history shows no stronger local
442
+ convention. If a plan file exists, final commit footer:
443
+ \`Plan: .omo/plans/<slug>.md\`. Skip committing only when the user forbade
444
+ commits this session — then stage + draft the message instead.
445
+
446
+ # Constraints
447
+ - Every behavior change needs a failing-first proof captured BEFORE
448
+ the production change, through the cheapest faithful channel (unit
449
+ test at a seam; integration/e2e in wiring; the real-surface scenario
450
+ when no test seam exists). If you typed production code first, STOP,
451
+ revert, capture the proof failing, then redo the change. Exempt
452
+ only: pure formatting, comment-only edits, dependency bumps with no
453
+ behavior delta, rename-only moves — justify each in \`## Findings\`.
454
+ - A test that cannot fail for the regression it names is NOT
455
+ evidence: mock-call assertions, pinned constants, a fixture equal
456
+ to the default it must override, an expected value re-derived from
457
+ the output under test. Prefer a real-surface proof with no new
458
+ test over a tautological one.
459
+ - Refactors: characterization tests pinning current observable
460
+ behavior FIRST, green against the old code, green throughout.
461
+ - Smallest correct change. No drive-by refactors.
462
+ - Never suppress lints / errors / test failures. Never delete, skip,
463
+ \`.only\`, \`.skip\`, \`xfail\`, or comment out tests to green the suite.
464
+ - Never claim done from inference — only from captured evidence.
465
+
466
+ # Output discipline
467
+ - First line literally: \`ULTRAWORK MODE ENABLED!\`
468
+ - After bootstrap: 1-2 paragraph plan summary + notepad path.
469
+ - During execution: surface only state changes (RED captured, GREEN
470
+ captured, scenario PASS/FAIL with evidence paths, reviewer verdict).
471
+ - Final message: outcome + success-criteria checklist with evidence
472
+ refs + notepad path + reviewer approval (if gate triggered) + commit
473
+ list (\`<sha> <subject>\`). No file-by-file changelog unless asked.
474
+
475
+ # Stop rules
476
+ - After each result, ask whether the user's core request can now be
477
+ answered with useful evidence in hand. If yes, answer now — skip any
478
+ remaining retrieval, ceremony, or verification that adds no evidence.
479
+ - The STOP GOAL: every scenario PASSES with captured evidence, every
480
+ cleanup receipt is recorded, notepad is current, and (if gate
481
+ triggered) reviewer approved unconditionally. Above ALL of that, the
482
+ decisive test — outranking every other consideration — is: are the
483
+ completion conditions FUNDAMENTALLY fulfilled, is the user's problem
484
+ ACTUALLY SOLVED in observable behavior? If no, you are NOT done,
485
+ whatever the ledger says. If yes, deliver the final message and STOP
486
+ — no hesitation, no extra verification pass, no polish loop. Work
487
+ past the stop goal is scope creep, not diligence.
488
+ - Leftover QA state (live process, \`tmux\` session, browser context,
489
+ bound port, temp file / dir) means NOT done. Tear it down, record
490
+ the receipt, then continue.
491
+ - After 2 identical failed attempts at one step, surface what was tried
492
+ and ask the user before another retry.
493
+ - After 2 parallel exploration waves yield no new useful facts, stop
494
+ exploring and act.
495
+
496
+ </ultrawork-mode>
497
+ `;
498
+
13
499
  // components/ultrawork/src/directive.ts
14
- import { readFileSync } from "node:fs";
15
- var ULTRAWORK_DIRECTIVE = readFileSync(new URL("../directive.md", import.meta.url), "utf8");
500
+ var ULTRAWORK_DIRECTIVE = ULTRAWORK_DIRECTIVE_TEXT;
16
501
 
17
502
  // components/ultrawork/src/skill-pointer.ts
18
503
  var ULTRAWORK_SKILL_POINTER_TEMPLATE = `<ultrawork-mode>
@@ -115,7 +600,7 @@ function hasUltraworkDirectiveAlreadyInTranscript(transcriptPath) {
115
600
  return false;
116
601
  }
117
602
  function readTranscriptTail(transcriptPath) {
118
- const rawTranscript = readFileSync2(transcriptPath);
603
+ const rawTranscript = readFileSync(transcriptPath);
119
604
  return rawTranscript.subarray(Math.max(0, rawTranscript.byteLength - TRANSCRIPT_SEARCH_BYTES)).toString("utf8");
120
605
  }
121
606
  function isUltraworkPrompt(prompt) {
@@ -7,7 +7,7 @@
7
7
  "type": "command",
8
8
  "command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook user-prompt-submit",
9
9
  "timeout": 5,
10
- "statusMessage": "(OmO 5.0.0-beta.31) Checking Ultrawork Trigger"
10
+ "statusMessage": "(OmO 5.0.0-beta.32) Checking Ultrawork Trigger"
11
11
  }
12
12
  ]
13
13
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-yeongyu/codex-ultrawork",
3
- "version": "5.0.0-beta.31",
3
+ "version": "5.0.0-beta.32",
4
4
  "description": "Codex plugin that injects the ultrawork orchestration directive and ships LazyCodex planning, review, QA, and gate agent roles.",
5
5
  "type": "module",
6
6
  "packageManager": "npm@11.12.1",
@@ -36,7 +36,6 @@
36
36
  "files": [
37
37
  "agents",
38
38
  "dist",
39
- "directive.md",
40
39
  "hooks",
41
40
  "skills",
42
41
  "README.md",
@@ -1,24 +1,40 @@
1
1
  #!/usr/bin/env node
2
- import { mkdir, readFile, writeFile } from "node:fs/promises";
2
+ // Single-sources the ultrawork directive from packages/prompts-core/prompts/ultrawork/codex.md.
3
+ // Emits two CHECKED-IN artifacts so a clean checkout builds without running this script:
4
+ // 1. src/directive-content.ts - the bundled runtime constant. prompts-core's contract is that
5
+ // markdown is bundled at build time and never read from disk at runtime, so the directive
6
+ // ships compiled into dist/cli.js instead of being read from a sibling .md file.
7
+ // 2. ../ulw-loop/directive.md - ulw-loop is a SEPARATELY PUBLISHED standalone package with no
8
+ // prompts-core dependency; it intentionally bundles its own byte-identical copy as the
9
+ // runtime fallback its published `files` list ships. Byte identity forbids a header comment,
10
+ // so the intent is documented here and in the ulw-loop README.
11
+ import { readFile, writeFile } from "node:fs/promises";
3
12
  import { dirname, join } from "node:path";
4
13
  import { fileURLToPath } from "node:url";
5
14
 
6
15
  const componentRoot = dirname(dirname(fileURLToPath(import.meta.url)));
7
16
  const codexPromptUrl = new URL(import.meta.resolve("@oh-my-opencode/prompts-core/prompts/ultrawork/codex.md"));
8
- const directivePath = join(componentRoot, "directive.md");
9
- const skillDirectory = join(componentRoot, "skills", "ultrawork");
10
- const skillPath = join(skillDirectory, "SKILL.md");
17
+ const directiveContentPath = join(componentRoot, "src", "directive-content.ts");
18
+ const ulwLoopDirectivePath = join(dirname(componentRoot), "ulw-loop", "directive.md");
11
19
 
12
- const skillFrontmatter = `---
13
- name: ultrawork
14
- description: Binding ultrawork mode directive for omo on Codex. When a prompt contains ultrawork or ulw, the omo UserPromptSubmit hook injects a short bootstrap that points at this file. Read the whole file and follow every rule in it for the rest of the task.
15
- metadata:
16
- short-description: Binding ultrawork mode directive
17
- ---
20
+ const codexPrompt = await readFile(codexPromptUrl, "utf8");
18
21
 
22
+ // Biome formats long string assignments as a line-broken, tab-indented, single-quoted
23
+ // literal (double quotes inside the prompt stay raw), so emit exactly that shape to keep
24
+ // the checked-in artifact formatter-stable AND byte-deterministic.
25
+ const singleQuoted = codexPrompt
26
+ .replace(/\\/g, "\\\\")
27
+ .replace(/'/g, "\\'")
28
+ .replace(/\n/g, "\\n")
29
+ .replace(/\r/g, "\\r")
30
+ .replace(/\t/g, "\\t")
31
+ .replace(/\u2028/g, "\\u2028")
32
+ .replace(/\u2029/g, "\\u2029");
33
+ const directiveContentModule = `// GENERATED by scripts/sync-directive.mjs from packages/prompts-core/prompts/ultrawork/codex.md.
34
+ // Do not hand-edit. Freshness is enforced by test/directive-source.test.ts.
35
+ export const ULTRAWORK_DIRECTIVE_TEXT =
36
+ '${singleQuoted}';
19
37
  `;
20
38
 
21
- const codexPrompt = await readFile(codexPromptUrl, "utf8");
22
- await writeFile(directivePath, codexPrompt);
23
- await mkdir(skillDirectory, { recursive: true });
24
- await writeFile(skillPath, `${skillFrontmatter}${codexPrompt}`);
39
+ await writeFile(directiveContentPath, directiveContentModule);
40
+ await writeFile(ulwLoopDirectivePath, codexPrompt);