oh-my-codex 0.16.1 → 0.16.2

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 (143) hide show
  1. package/Cargo.lock +5 -5
  2. package/Cargo.toml +1 -1
  3. package/README.md +2 -2
  4. package/dist/cli/__tests__/doctor-warning-copy.test.js +1 -1
  5. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
  6. package/dist/cli/__tests__/explore.test.js +2 -2
  7. package/dist/cli/__tests__/explore.test.js.map +1 -1
  8. package/dist/cli/__tests__/setup-install-mode.test.js +3 -0
  9. package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
  10. package/dist/cli/__tests__/setup-scope.test.js +12 -0
  11. package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
  12. package/dist/cli/__tests__/ultragoal.test.js +14 -9
  13. package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
  14. package/dist/cli/__tests__/uninstall.test.js +6 -2
  15. package/dist/cli/__tests__/uninstall.test.js.map +1 -1
  16. package/dist/cli/explore.d.ts.map +1 -1
  17. package/dist/cli/explore.js +3 -4
  18. package/dist/cli/explore.js.map +1 -1
  19. package/dist/cli/setup.d.ts.map +1 -1
  20. package/dist/cli/setup.js +7 -5
  21. package/dist/cli/setup.js.map +1 -1
  22. package/dist/cli/ultragoal.d.ts +1 -1
  23. package/dist/cli/ultragoal.d.ts.map +1 -1
  24. package/dist/cli/ultragoal.js +26 -8
  25. package/dist/cli/ultragoal.js.map +1 -1
  26. package/dist/cli/uninstall.d.ts.map +1 -1
  27. package/dist/cli/uninstall.js +2 -1
  28. package/dist/cli/uninstall.js.map +1 -1
  29. package/dist/config/__tests__/codex-hooks.test.js +92 -2
  30. package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
  31. package/dist/config/__tests__/generator-idempotent.test.js +1 -1
  32. package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
  33. package/dist/config/__tests__/generator-notify.test.js +22 -0
  34. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  35. package/dist/config/__tests__/wiki-config-contract.test.js +2 -1
  36. package/dist/config/__tests__/wiki-config-contract.test.js.map +1 -1
  37. package/dist/config/codex-hooks.d.ts +17 -3
  38. package/dist/config/codex-hooks.d.ts.map +1 -1
  39. package/dist/config/codex-hooks.js +98 -1
  40. package/dist/config/codex-hooks.js.map +1 -1
  41. package/dist/config/generator.d.ts +4 -1
  42. package/dist/config/generator.d.ts.map +1 -1
  43. package/dist/config/generator.js +69 -12
  44. package/dist/config/generator.js.map +1 -1
  45. package/dist/hooks/__tests__/keyword-detector.test.js +37 -25
  46. package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
  47. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +10 -4
  48. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
  49. package/dist/hooks/__tests__/wiki-docs-contract.test.js +6 -4
  50. package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +1 -1
  51. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  52. package/dist/hooks/keyword-detector.js +2 -4
  53. package/dist/hooks/keyword-detector.js.map +1 -1
  54. package/dist/mcp/__tests__/state-server.test.js +145 -6
  55. package/dist/mcp/__tests__/state-server.test.js.map +1 -1
  56. package/dist/mcp/__tests__/wiki-server.test.js +97 -1
  57. package/dist/mcp/__tests__/wiki-server.test.js.map +1 -1
  58. package/dist/mcp/wiki-server.d.ts.map +1 -1
  59. package/dist/mcp/wiki-server.js +11 -2
  60. package/dist/mcp/wiki-server.js.map +1 -1
  61. package/dist/scripts/__tests__/codex-native-hook.test.js +62 -1
  62. package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
  63. package/dist/scripts/codex-execution-surface.d.ts +1 -1
  64. package/dist/scripts/codex-execution-surface.d.ts.map +1 -1
  65. package/dist/scripts/codex-execution-surface.js.map +1 -1
  66. package/dist/scripts/codex-native-hook.d.ts +1 -1
  67. package/dist/scripts/codex-native-hook.d.ts.map +1 -1
  68. package/dist/scripts/codex-native-hook.js +30 -2
  69. package/dist/scripts/codex-native-hook.js.map +1 -1
  70. package/dist/state/__tests__/operations.test.js +79 -0
  71. package/dist/state/__tests__/operations.test.js.map +1 -1
  72. package/dist/state/__tests__/skill-active.test.js +10 -18
  73. package/dist/state/__tests__/skill-active.test.js.map +1 -1
  74. package/dist/state/operations.d.ts.map +1 -1
  75. package/dist/state/operations.js +1 -20
  76. package/dist/state/operations.js.map +1 -1
  77. package/dist/state/skill-active.d.ts +1 -0
  78. package/dist/state/skill-active.d.ts.map +1 -1
  79. package/dist/state/skill-active.js +28 -18
  80. package/dist/state/skill-active.js.map +1 -1
  81. package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
  82. package/dist/state/workflow-transition-reconcile.js +1 -0
  83. package/dist/state/workflow-transition-reconcile.js.map +1 -1
  84. package/dist/ultragoal/__tests__/artifacts.test.js +81 -7
  85. package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
  86. package/dist/ultragoal/__tests__/docs-contract.test.js +8 -0
  87. package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
  88. package/dist/ultragoal/artifacts.d.ts +4 -0
  89. package/dist/ultragoal/artifacts.d.ts.map +1 -1
  90. package/dist/ultragoal/artifacts.js +72 -4
  91. package/dist/ultragoal/artifacts.js.map +1 -1
  92. package/dist/utils/paths.d.ts +3 -1
  93. package/dist/utils/paths.d.ts.map +1 -1
  94. package/dist/utils/paths.js +6 -2
  95. package/dist/utils/paths.js.map +1 -1
  96. package/dist/wiki/__tests__/ingest.test.js +35 -1
  97. package/dist/wiki/__tests__/ingest.test.js.map +1 -1
  98. package/dist/wiki/__tests__/lint.test.js +14 -1
  99. package/dist/wiki/__tests__/lint.test.js.map +1 -1
  100. package/dist/wiki/__tests__/query.test.js +28 -3
  101. package/dist/wiki/__tests__/query.test.js.map +1 -1
  102. package/dist/wiki/__tests__/session-hooks.test.js +30 -2
  103. package/dist/wiki/__tests__/session-hooks.test.js.map +1 -1
  104. package/dist/wiki/__tests__/storage.test.js +62 -22
  105. package/dist/wiki/__tests__/storage.test.js.map +1 -1
  106. package/dist/wiki/index.d.ts +2 -2
  107. package/dist/wiki/index.d.ts.map +1 -1
  108. package/dist/wiki/index.js +2 -2
  109. package/dist/wiki/index.js.map +1 -1
  110. package/dist/wiki/ingest.js +2 -2
  111. package/dist/wiki/ingest.js.map +1 -1
  112. package/dist/wiki/lifecycle.d.ts +5 -0
  113. package/dist/wiki/lifecycle.d.ts.map +1 -1
  114. package/dist/wiki/lifecycle.js +31 -4
  115. package/dist/wiki/lifecycle.js.map +1 -1
  116. package/dist/wiki/lint.d.ts.map +1 -1
  117. package/dist/wiki/lint.js +12 -8
  118. package/dist/wiki/lint.js.map +1 -1
  119. package/dist/wiki/query.d.ts.map +1 -1
  120. package/dist/wiki/query.js +3 -2
  121. package/dist/wiki/query.js.map +1 -1
  122. package/dist/wiki/storage.d.ts +4 -0
  123. package/dist/wiki/storage.d.ts.map +1 -1
  124. package/dist/wiki/storage.js +54 -18
  125. package/dist/wiki/storage.js.map +1 -1
  126. package/package.json +1 -1
  127. package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
  128. package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +2 -2
  129. package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +1 -1
  130. package/plugins/oh-my-codex/skills/plan/SKILL.md +4 -4
  131. package/plugins/oh-my-codex/skills/ralplan/SKILL.md +2 -2
  132. package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +11 -7
  133. package/plugins/oh-my-codex/skills/wiki/SKILL.md +5 -5
  134. package/prompts/planner.md +1 -1
  135. package/skills/deep-interview/SKILL.md +2 -2
  136. package/skills/omx-setup/SKILL.md +1 -1
  137. package/skills/plan/SKILL.md +4 -4
  138. package/skills/ralplan/SKILL.md +2 -2
  139. package/skills/ultragoal/SKILL.md +11 -7
  140. package/skills/wiki/SKILL.md +5 -5
  141. package/src/scripts/__tests__/codex-native-hook.test.ts +71 -1
  142. package/src/scripts/codex-execution-surface.ts +2 -0
  143. package/src/scripts/codex-native-hook.ts +34 -2
@@ -9,7 +9,7 @@ Use when the user asks for `ultragoal`, `create-goals`, `complete-goals`, durabl
9
9
 
10
10
  ## Purpose
11
11
 
12
- `ultragoal` turns a brief into repo-native artifacts and then drives one goal at a time through Codex goal tools:
12
+ `ultragoal` turns a brief into repo-native artifacts and then drives a Codex goal safely through goal tools. New plans default to an aggregate Codex goal for the whole ultragoal run while OMX tracks G001/G002 story progress in the ledger.
13
13
 
14
14
  - `.omx/ultragoal/brief.md`
15
15
  - `.omx/ultragoal/goals.json`
@@ -21,6 +21,7 @@ Use when the user asks for `ultragoal`, `create-goals`, `complete-goals`, durabl
21
21
  - `omx ultragoal create-goals --brief "<brief>"`
22
22
  - `omx ultragoal create-goals --brief-file <path>`
23
23
  - `cat <brief> | omx ultragoal create-goals --from-stdin`
24
+ - `omx ultragoal create-goals --codex-goal-mode per-story --brief "<brief>"` only when one fresh Codex thread per story is explicitly preferred
24
25
  2. Inspect `.omx/ultragoal/goals.json` and refine if needed.
25
26
 
26
27
  ## Complete goals
@@ -30,20 +31,23 @@ Loop until `omx ultragoal status` reports all goals complete:
30
31
  1. Run `omx ultragoal complete-goals`.
31
32
  2. Read the printed handoff.
32
33
  3. Call `get_goal`.
33
- 4. If no active Codex goal exists, call `create_goal` with the printed payload.
34
- 5. Complete that single goal only.
35
- 6. Run a completion audit against the objective and real artifacts/tests.
36
- 7. When complete, call `update_goal({status: "complete"})`, then call `get_goal` again for a fresh completion snapshot.
34
+ 4. If no active Codex goal exists, call `create_goal` with the printed payload. In aggregate mode, if the same aggregate Codex objective is already active, continue the current OMX story without creating a new Codex goal.
35
+ 5. Complete the current OMX story only.
36
+ 6. Run a completion audit against the story objective and real artifacts/tests.
37
+ 7. In aggregate mode, do **not** call `update_goal` for intermediate stories; checkpoint with a fresh `get_goal` snapshot whose aggregate objective is still `active`. On the final story only, call `update_goal({status: "complete"})`, then call `get_goal` again for a fresh `complete` snapshot.
37
38
  8. Checkpoint the durable ledger with that snapshot:
38
39
  `omx ultragoal checkpoint --goal-id <id> --status complete --evidence "<evidence>" --codex-goal-json <get_goal-json-or-path>`
39
40
  9. If blocked or failed, checkpoint failure:
40
41
  `omx ultragoal checkpoint --goal-id <id> --status failed --evidence "<blocker/evidence>"`
41
- 10. Resume failed goals with `omx ultragoal complete-goals --retry-failed`.
42
+ 10. For legacy per-story completed-goal blockers, preserve the non-terminal blocker with:
43
+ `omx ultragoal checkpoint --goal-id <id> --status blocked --evidence "<completed legacy Codex goal blocks create_goal in this thread>" --codex-goal-json <get_goal-json-or-path>`
44
+ 11. Resume failed goals with `omx ultragoal complete-goals --retry-failed`.
42
45
 
43
46
  ## Constraints
44
47
 
45
48
  - The shell command cannot directly invoke Codex interactive `/goal`; it emits a model-facing handoff for the active Codex agent.
46
49
  - Never call `create_goal` when `get_goal` reports a different active goal.
47
- - Never call `update_goal` unless the current goal is actually complete.
50
+ - Never call `update_goal` unless the aggregate run or legacy per-story goal is actually complete.
51
+ - In aggregate mode, intermediate story checkpoints require a matching `active` Codex snapshot; final story completion requires a matching `complete` snapshot after `update_goal`.
48
52
  - Completion checkpoints require read-only Codex snapshot reconciliation: pass fresh `get_goal` JSON/path with `--codex-goal-json`; shell commands and hooks must not mutate Codex goal state.
49
53
  - Treat `ledger.jsonl` as the durable audit trail; checkpoint after every success or failure.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wiki
3
- description: Persistent markdown project wiki stored under .omx/wiki with keyword search and lifecycle capture
3
+ description: Persistent markdown project wiki stored under repository omx_wiki with keyword search and lifecycle capture
4
4
  triggers: ["wiki add", "wiki lint", "wiki query", "wiki read", "wiki delete"]
5
5
  ---
6
6
 
@@ -42,9 +42,9 @@ wiki_refresh()
42
42
  `architecture`, `decision`, `pattern`, `debugging`, `environment`, `session-log`, `reference`, `convention`
43
43
 
44
44
  ## Storage
45
- - Pages: `.omx/wiki/*.md`
46
- - Index: `.omx/wiki/index.md`
47
- - Log: `.omx/wiki/log.md`
45
+ - Pages: `omx_wiki/*.md`
46
+ - Index: `omx_wiki/index.md`
47
+ - Log: `omx_wiki/log.md`
48
48
 
49
49
  ## Cross-References
50
50
  Use `[[page-name]]` wiki-link syntax to create cross-references between pages.
@@ -54,4 +54,4 @@ At session end, discoveries can be captured as `session-log-*` pages. Configure
54
54
 
55
55
  ## Hard Constraints
56
56
  - No vector embeddings — query uses keyword + tag matching only
57
- - Wiki files remain local project state under `.omx/wiki/`
57
+ - Wiki files are repository project knowledge under `omx_wiki/`; legacy `.omx/wiki/` is read-only compatibility input when no canonical wiki exists
@@ -59,7 +59,7 @@ Leave execution with a right-sized, evidence-grounded plan: scope, steps, accept
59
59
  - Codebase facts come from inspection.
60
60
  - Plan is saved to `.omx/plans/{name}.md`.
61
61
  - User confirmation is obtained before handoff.
62
- - Consensus mode includes complete RALPLAN-DR, ADR, an explicit available-agent-types roster, staffing guidance for team and ralph follow-up paths, product-facing goal-mode follow-up suggestions (`$ultragoal` generally, `$autoresearch-goal` for research projects, `$performance-goal` for optimization/performance projects), suggested reasoning levels by lane, launch hints, and a team verification path when needed.
62
+ - Consensus mode includes complete RALPLAN-DR, ADR, an explicit available-agent-types roster, staffing guidance for team and ralph follow-up paths, product-facing goal-mode follow-up suggestions (`$ultragoal` generally and by default, `$autoresearch-goal` for research projects, `$performance-goal` for optimization/performance projects), suggested reasoning levels by lane, launch hints, and a team verification path when needed.
63
63
  </success_criteria>
64
64
 
65
65
  <tools>
@@ -365,7 +365,7 @@ Present execution options after artifact generation using explicit handoff contr
365
365
 
366
366
  Include these product-facing suggestions when they fit the clarified spec, without removing the existing `$ralplan`, `$autopilot`, `$ralph`, and `$team` handoff options:
367
367
 
368
- - **`$ultragoal`** — use for general goal-oriented follow-up when the spec should be converted into durable Codex goals with sequential completion tracking.
368
+ - **`$ultragoal`** — default goal-mode follow-up for implementation or general goal-oriented follow-up specs that should be converted into durable Codex/OMX goals with sequential completion tracking.
369
369
  - **`$autoresearch-goal`** — use when the clarified context is a research project: a research question, reference/literature gathering, evaluator-backed analysis, or professor/critic-style deliverable.
370
370
  - **`$performance-goal`** — use when the clarified context is an optimization or performance project with measurable speed, latency, throughput, memory, benchmark, or evaluator criteria.
371
371
 
@@ -378,7 +378,7 @@ Preserve `$ralph` for persistent single-owner execution/verification and `$team`
378
378
  - **Skipped / Already-Satisfied Stages:** Requirements discovery, ambiguity clarification, and early intent-boundary elicitation
379
379
  - **Expected Output:** Canonical planning artifacts under `.omx/plans/`, especially `prd-*.md` and `test-spec-*.md`
380
380
  - **Best When:** Requirements are clear enough to stop interviewing, but architectural validation / consensus planning is still desirable
381
- - **Next Recommended Step:** Use the approved planning artifacts with `$autopilot`, `$ralph`, `$team`, or a goal-mode follow-up (`$ultragoal`, `$autoresearch-goal`, `$performance-goal`) depending on whether the next need is direct execution, coordination, durable goals, research validation, or measurable optimization
381
+ - **Next Recommended Step:** Use the approved planning artifacts with `$autopilot`, `$ralph`, `$team`, or `$ultragoal` as the default goal-mode follow-up; choose `$autoresearch-goal` for research validation or `$performance-goal` for measurable optimization
382
382
 
383
383
  ### 2. **`$autopilot`**
384
384
  - **Input Artifact:** `.omx/specs/deep-interview-{slug}.md`
@@ -74,7 +74,7 @@ Use this map when reconciling setup behavior or debugging a confusing install:
74
74
  | Surface | Owner | Notes |
75
75
  | --- | --- | --- |
76
76
  | `./.omx/setup-scope.json` | `omx setup` | Persists setup scope and user-scope skill delivery mode. TTY reruns summarize it and offer keep/review/reset. |
77
- | `~/.codex/config.toml` / `./.codex/config.toml` | `omx setup` generated blocks + user edits | Setup refreshes OMX-managed blocks while preserving supported manual content; setup-owned runtime feature flags include `multi_agent`, `child_agents_md`, `codex_hooks`, and `goals`. |
77
+ | `~/.codex/config.toml` / `./.codex/config.toml` | `omx setup` generated blocks + user edits | Setup refreshes OMX-managed blocks while preserving supported manual content; setup-owned runtime feature flags include `multi_agent`, `child_agents_md`, `hooks`, and `goals`. |
78
78
  | `~/.codex/hooks.json` / `./.codex/hooks.json` | `omx setup` shared ownership | Setup owns OMX native hook wrappers and preserves user-owned hooks. |
79
79
  | prompts, skills, native agents | `omx setup` or Codex plugin delivery | Legacy mode installs local files; plugin mode relies on plugin discovery for bundled skills and archives/removes legacy OMX-managed prompt/native-agent copies. |
80
80
  | `AGENTS.md` | `omx setup` with overwrite safety | Generated defaults or managed refreshes are guarded by force/session checks. |
@@ -95,12 +95,12 @@ Jumping into code without understanding requirements leads to rework, scope cree
95
95
  c. Update the plan file in `.omx/plans/` with the accepted improvements (add missing details, refine steps, strengthen acceptance criteria, ADR updates, etc.)
96
96
  d. Note which improvements were applied in a brief changelog section at the end of the plan
97
97
  e. Before any execution handoff, derive an explicit **available-agent-types roster** from the known prompt catalog and add concrete **follow-up staffing guidance** for both `$ralph` and `$team` (recommended roles, counts, suggested reasoning levels by lane, and why each lane exists)
98
- f. Add a product-facing **Goal-Mode Follow-up Suggestions** section: suggest `$ultragoal` for general goal-oriented follow-up, `$autoresearch-goal` when the context is a research project, and `$performance-goal` when the context is an optimization or performance project. Keep these suggestions alongside the Ralph/team paths rather than replacing them when implementation delivery is still the main need.
98
+ f. Add a product-facing **Goal-Mode Follow-up Suggestions** section: recommend `$ultragoal` by default for general goal-oriented follow-up, `$autoresearch-goal` when the context is a research project, and `$performance-goal` when the context is an optimization or performance project. Keep these suggestions alongside the Ralph/team paths rather than replacing them when implementation delivery is still the main need.
99
99
  g. For the `$team` path, add an explicit launch-hint block with concrete `omx team` / `$team` commands and a **team verification path** (what team proves before shutdown, what Ralph verifies after handoff)
100
100
  7. On Critic approval (with improvements applied): *(--interactive only)* If running with `--interactive`, use `AskUserQuestion` / the structured question UI to present the plan with these options:
101
101
  - **Approve and execute** — proceed to implementation via ralph+ultrawork
102
102
  - **Approve and implement via team** — proceed to implementation via coordinated parallel team agents
103
- - **Start goal-mode follow-up** — proceed via `$ultragoal`, `$autoresearch-goal`, or `$performance-goal` when the approved plan fits durable goals, research validation, or measurable optimization
103
+ - **Start goal-mode follow-up** — proceed via `$ultragoal` by default, or `$autoresearch-goal` / `$performance-goal` when the approved plan specifically fits research validation or measurable optimization
104
104
  - **Request changes** — return to step 1 with user feedback
105
105
  - **Reject** — discard the plan entirely
106
106
  If NOT running with `--interactive`, output the final approved plan and stop. Do NOT auto-execute.
@@ -108,7 +108,7 @@ Jumping into code without understanding requirements leads to rework, scope cree
108
108
  9. On user approval (--interactive only):
109
109
  - **Approve and execute**: **MUST** invoke `$ralph` with the approved plan path from `.omx/plans/` as context **plus the explicit available-agent-types roster, suggested reasoning levels, concrete role allocation guidance, and direct launch hints for Ralph follow-up work**. Do NOT implement directly. Do NOT edit source code files in the planning agent. The ralph skill handles execution via ultrawork parallel agents.
110
110
  - **Approve and implement via team**: **MUST** invoke `$team` with the approved plan path from `.omx/plans/` as context **plus the explicit available-agent-types roster, suggested reasoning levels, concrete staffing / worker-role allocation guidance, explicit `omx team` / `$team` launch hints, and the team verification path**. Do NOT implement directly. The team skill coordinates parallel agents across the staged pipeline for faster execution on large tasks.
111
- - **Start goal-mode follow-up**: **MUST** invoke the selected goal workflow with the approved plan path and appropriate success context: `$ultragoal` for general goal-oriented follow-up, `$autoresearch-goal` for research projects, or `$performance-goal` for optimization/performance projects with measurable evaluator criteria. Do NOT implement directly in the planning agent.
111
+ - **Start goal-mode follow-up**: **MUST** invoke the selected goal workflow with the approved plan path and appropriate success context: `$ultragoal` as the default goal-mode path, `$autoresearch-goal` for research projects, or `$performance-goal` for optimization/performance projects with measurable evaluator criteria. Do NOT implement directly in the planning agent.
112
112
 
113
113
  ### Review Mode (`--review`)
114
114
 
@@ -150,7 +150,7 @@ Plans are saved to `.omx/plans/`. Drafts go to `.omx/drafts/`.
150
150
  - In consensus mode, default to RALPLAN-DR short mode; enable deliberate mode on `--deliberate` or explicit high-risk signals (auth/security, migrations, destructive changes, production incidents, compliance/PII, public API breakage)
151
151
  - In consensus mode with `--interactive`: use `AskUserQuestion` / the structured question UI for the user feedback step (step 2) and the final approval step (step 7) -- never ask for approval in plain text when a structured surface is available. Without `--interactive`, auto-proceed through planning steps without pausing. Output the final plan without execution.
152
152
  - In consensus mode with `--interactive`, on user approval **MUST** invoke the selected follow-up lane from step 9 (`$ralph`, `$team`, `$ultragoal`, `$autoresearch-goal`, or `$performance-goal`) -- never implement directly in the planning agent
153
- - In consensus mode, execution follow-up handoff **MUST** include an explicit available-agent-types roster plus concrete staffing / role-allocation guidance grounded in that roster, suggested reasoning levels by lane, product-facing goal-mode follow-up suggestions (`$ultragoal` generally, `$autoresearch-goal` for research projects, `$performance-goal` for optimization/performance projects), explicit `omx team` / `$team` launch hints, and a team verification path
153
+ - In consensus mode, execution follow-up handoff **MUST** include an explicit available-agent-types roster plus concrete staffing / role-allocation guidance grounded in that roster, suggested reasoning levels by lane, product-facing goal-mode follow-up suggestions (`$ultragoal` by default, `$autoresearch-goal` for research projects, `$performance-goal` for optimization/performance projects), explicit `omx team` / `$team` launch hints, and a team verification path
154
154
  </Tool_Usage>
155
155
 
156
156
 
@@ -54,7 +54,7 @@ The consensus workflow:
54
54
  d. Return to Critic evaluation
55
55
  e. Repeat this loop until Critic returns `APPROVE` or 5 iterations are reached
56
56
  f. If 5 iterations are reached without `APPROVE`, present the best version to the user
57
- 6. On Critic approval *(--interactive only)*: If `--interactive` is set, use the structured question UI to present the plan with approval options (Approve and execute via ralph / Approve and implement via team / Start a goal-mode follow-up / Request changes / Reject). Final plan must include ADR (Decision, Drivers, Alternatives considered, Why chosen, Consequences, Follow-ups), an explicit available-agent-types roster, concrete follow-up staffing guidance for both `ralph` and `team`, suggested reasoning levels by lane, explicit `omx team` / `$team` launch hints, a concrete **team verification** path, and a product-facing **Goal-Mode Follow-up Suggestions** section. Suggest `$ultragoal` for general goal-oriented follow-up, `$autoresearch-goal` when the context is a research project, and `$performance-goal` when the context is an optimization or performance project. Otherwise, output the final plan and stop.
57
+ 6. On Critic approval *(--interactive only)*: If `--interactive` is set, use the structured question UI to present the plan with approval options (Approve and execute via ralph / Approve and implement via team / Start a goal-mode follow-up / Request changes / Reject). Final plan must include ADR (Decision, Drivers, Alternatives considered, Why chosen, Consequences, Follow-ups), an explicit available-agent-types roster, concrete follow-up staffing guidance for both `ralph` and `team`, suggested reasoning levels by lane, explicit `omx team` / `$team` launch hints, a concrete **team verification** path, and a product-facing **Goal-Mode Follow-up Suggestions** section. Recommend `$ultragoal` by default for goal-mode follow-up, use `$autoresearch-goal` instead when the context is a research project, and use `$performance-goal` instead when the context is an optimization or performance project. Otherwise, output the final plan and stop.
58
58
  7. *(--interactive only)* User chooses: Approve (ralph, team, or a goal-mode follow-up), Request changes, or Reject
59
59
  8. *(--interactive only)* On approval: invoke `$ralph` for sequential execution, `$team` for parallel team execution, or the selected goal-mode follow-up (`$ultragoal`, `$autoresearch-goal`, or `$performance-goal`) with the approved plan and matching success/evaluator context -- never implement directly. Preserve the explicit available-agent-types roster, reasoning-by-lane guidance, role/staffing allocation guidance, launch hints, and verification-path guidance from the approved plan for Ralph/team paths.
60
60
 
@@ -66,7 +66,7 @@ Follow the Plan skill's full documentation for consensus mode details.
66
66
 
67
67
  When ralplan outputs a final handoff or asks the user to choose a next lane, include product-facing goal-mode suggestions alongside the existing Ralph and team options:
68
68
 
69
- - `$ultragoal` — general goal-oriented follow-up when the plan should become one or more durable Codex goals with sequential completion tracking.
69
+ - `$ultragoal` — **default goal-mode follow-up** for implementation or general goal-oriented follow-up plans that should become durable Codex/OMX goals with sequential completion tracking.
70
70
  - `$autoresearch-goal` — research-project follow-up when the plan centers on a question, literature/reference gathering, evaluator-backed research, or a professor/critic-style research deliverable.
71
71
  - `$performance-goal` — optimization/performance follow-up when the plan centers on speed, latency, throughput, memory, benchmark, or other measurable performance work.
72
72
 
@@ -9,7 +9,7 @@ Use when the user asks for `ultragoal`, `create-goals`, `complete-goals`, durabl
9
9
 
10
10
  ## Purpose
11
11
 
12
- `ultragoal` turns a brief into repo-native artifacts and then drives one goal at a time through Codex goal tools:
12
+ `ultragoal` turns a brief into repo-native artifacts and then drives a Codex goal safely through goal tools. New plans default to an aggregate Codex goal for the whole ultragoal run while OMX tracks G001/G002 story progress in the ledger.
13
13
 
14
14
  - `.omx/ultragoal/brief.md`
15
15
  - `.omx/ultragoal/goals.json`
@@ -21,6 +21,7 @@ Use when the user asks for `ultragoal`, `create-goals`, `complete-goals`, durabl
21
21
  - `omx ultragoal create-goals --brief "<brief>"`
22
22
  - `omx ultragoal create-goals --brief-file <path>`
23
23
  - `cat <brief> | omx ultragoal create-goals --from-stdin`
24
+ - `omx ultragoal create-goals --codex-goal-mode per-story --brief "<brief>"` only when one fresh Codex thread per story is explicitly preferred
24
25
  2. Inspect `.omx/ultragoal/goals.json` and refine if needed.
25
26
 
26
27
  ## Complete goals
@@ -30,20 +31,23 @@ Loop until `omx ultragoal status` reports all goals complete:
30
31
  1. Run `omx ultragoal complete-goals`.
31
32
  2. Read the printed handoff.
32
33
  3. Call `get_goal`.
33
- 4. If no active Codex goal exists, call `create_goal` with the printed payload.
34
- 5. Complete that single goal only.
35
- 6. Run a completion audit against the objective and real artifacts/tests.
36
- 7. When complete, call `update_goal({status: "complete"})`, then call `get_goal` again for a fresh completion snapshot.
34
+ 4. If no active Codex goal exists, call `create_goal` with the printed payload. In aggregate mode, if the same aggregate Codex objective is already active, continue the current OMX story without creating a new Codex goal.
35
+ 5. Complete the current OMX story only.
36
+ 6. Run a completion audit against the story objective and real artifacts/tests.
37
+ 7. In aggregate mode, do **not** call `update_goal` for intermediate stories; checkpoint with a fresh `get_goal` snapshot whose aggregate objective is still `active`. On the final story only, call `update_goal({status: "complete"})`, then call `get_goal` again for a fresh `complete` snapshot.
37
38
  8. Checkpoint the durable ledger with that snapshot:
38
39
  `omx ultragoal checkpoint --goal-id <id> --status complete --evidence "<evidence>" --codex-goal-json <get_goal-json-or-path>`
39
40
  9. If blocked or failed, checkpoint failure:
40
41
  `omx ultragoal checkpoint --goal-id <id> --status failed --evidence "<blocker/evidence>"`
41
- 10. Resume failed goals with `omx ultragoal complete-goals --retry-failed`.
42
+ 10. For legacy per-story completed-goal blockers, preserve the non-terminal blocker with:
43
+ `omx ultragoal checkpoint --goal-id <id> --status blocked --evidence "<completed legacy Codex goal blocks create_goal in this thread>" --codex-goal-json <get_goal-json-or-path>`
44
+ 11. Resume failed goals with `omx ultragoal complete-goals --retry-failed`.
42
45
 
43
46
  ## Constraints
44
47
 
45
48
  - The shell command cannot directly invoke Codex interactive `/goal`; it emits a model-facing handoff for the active Codex agent.
46
49
  - Never call `create_goal` when `get_goal` reports a different active goal.
47
- - Never call `update_goal` unless the current goal is actually complete.
50
+ - Never call `update_goal` unless the aggregate run or legacy per-story goal is actually complete.
51
+ - In aggregate mode, intermediate story checkpoints require a matching `active` Codex snapshot; final story completion requires a matching `complete` snapshot after `update_goal`.
48
52
  - Completion checkpoints require read-only Codex snapshot reconciliation: pass fresh `get_goal` JSON/path with `--codex-goal-json`; shell commands and hooks must not mutate Codex goal state.
49
53
  - Treat `ledger.jsonl` as the durable audit trail; checkpoint after every success or failure.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: wiki
3
- description: Persistent markdown project wiki stored under .omx/wiki with keyword search and lifecycle capture
3
+ description: Persistent markdown project wiki stored under repository omx_wiki with keyword search and lifecycle capture
4
4
  triggers: ["wiki add", "wiki lint", "wiki query", "wiki read", "wiki delete"]
5
5
  ---
6
6
 
@@ -42,9 +42,9 @@ wiki_refresh()
42
42
  `architecture`, `decision`, `pattern`, `debugging`, `environment`, `session-log`, `reference`, `convention`
43
43
 
44
44
  ## Storage
45
- - Pages: `.omx/wiki/*.md`
46
- - Index: `.omx/wiki/index.md`
47
- - Log: `.omx/wiki/log.md`
45
+ - Pages: `omx_wiki/*.md`
46
+ - Index: `omx_wiki/index.md`
47
+ - Log: `omx_wiki/log.md`
48
48
 
49
49
  ## Cross-References
50
50
  Use `[[page-name]]` wiki-link syntax to create cross-references between pages.
@@ -54,4 +54,4 @@ At session end, discoveries can be captured as `session-log-*` pages. Configure
54
54
 
55
55
  ## Hard Constraints
56
56
  - No vector embeddings — query uses keyword + tag matching only
57
- - Wiki files remain local project state under `.omx/wiki/`
57
+ - Wiki files are repository project knowledge under `omx_wiki/`; legacy `.omx/wiki/` is read-only compatibility input when no canonical wiki exists
@@ -24,6 +24,8 @@ import { writeSessionStart } from "../../hooks/session.js";
24
24
  import { resetTriageConfigCache } from "../../hooks/triage-config.js";
25
25
  import { executeStateOperation } from "../../state/operations.js";
26
26
  import { OMX_TMUX_HUD_OWNER_ENV } from "../../hud/reconcile.js";
27
+ import { writePage } from "../../wiki/storage.js";
28
+ import { WIKI_SCHEMA_VERSION } from "../../wiki/types.js";
27
29
 
28
30
  function nativeHookScriptPath(): string {
29
31
  return join(process.cwd(), "dist", "scripts", "codex-native-hook.js");
@@ -225,6 +227,8 @@ describe("codex native hook config", () => {
225
227
  "PreToolUse",
226
228
  "PostToolUse",
227
229
  "UserPromptSubmit",
230
+ "PreCompact",
231
+ "PostCompact",
228
232
  "Stop",
229
233
  ]);
230
234
 
@@ -511,9 +515,70 @@ describe("codex native hook dispatch", () => {
511
515
  assert.equal(mapCodexHookEventToOmxEvent("UserPromptSubmit"), "keyword-detector");
512
516
  assert.equal(mapCodexHookEventToOmxEvent("PreToolUse"), "pre-tool-use");
513
517
  assert.equal(mapCodexHookEventToOmxEvent("PostToolUse"), "post-tool-use");
518
+ assert.equal(mapCodexHookEventToOmxEvent("PreCompact"), "pre-compact");
519
+ assert.equal(mapCodexHookEventToOmxEvent("PostCompact"), "post-compact");
514
520
  assert.equal(mapCodexHookEventToOmxEvent("Stop"), "stop");
515
521
  });
516
522
 
523
+
524
+
525
+ it("returns bounded wiki context for PreCompact", async () => {
526
+ const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-precompact-"));
527
+ try {
528
+ writePage(cwd, {
529
+ filename: "architecture.md",
530
+ frontmatter: {
531
+ title: "Architecture",
532
+ tags: ["architecture"],
533
+ created: "2026-05-08T00:00:00.000Z",
534
+ updated: "2026-05-08T00:00:00.000Z",
535
+ sources: [],
536
+ links: [],
537
+ category: "architecture",
538
+ confidence: "high",
539
+ schemaVersion: WIKI_SCHEMA_VERSION,
540
+ },
541
+ content: "\n# Architecture\n\nCompaction-relevant architecture note.\n",
542
+ });
543
+
544
+ const result = await dispatchCodexNativeHook({
545
+ hook_event_name: "PreCompact",
546
+ cwd,
547
+ session_id: "sess-precompact",
548
+ });
549
+
550
+ assert.equal(result.hookEventName, "PreCompact");
551
+ assert.equal(result.omxEventName, "pre-compact");
552
+ const additionalContext = (result.outputJson as { hookSpecificOutput?: { additionalContext?: string } } | null)
553
+ ?.hookSpecificOutput?.additionalContext ?? "";
554
+ assert.match(additionalContext, /Wiki: 1 pages/);
555
+ assert.match(additionalContext, /architecture/);
556
+ } finally {
557
+ await rm(cwd, { recursive: true, force: true });
558
+ }
559
+ });
560
+
561
+ it("returns a PostCompact nudge to write compaction artifacts to omx_wiki", async () => {
562
+ const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-postcompact-"));
563
+ try {
564
+ const result = await dispatchCodexNativeHook({
565
+ hook_event_name: "PostCompact",
566
+ cwd,
567
+ session_id: "sess-postcompact",
568
+ });
569
+
570
+ assert.equal(result.hookEventName, "PostCompact");
571
+ assert.equal(result.omxEventName, "post-compact");
572
+ const additionalContext = (result.outputJson as { hookSpecificOutput?: { additionalContext?: string } } | null)
573
+ ?.hookSpecificOutput?.additionalContext ?? "";
574
+ assert.match(additionalContext, /PostCompact Nudge/);
575
+ assert.match(additionalContext, /omx_wiki/);
576
+ assert.match(additionalContext, /compaction artifacts/);
577
+ } finally {
578
+ await rm(cwd, { recursive: true, force: true });
579
+ }
580
+ });
581
+
517
582
  it("writes SessionStart state against the long-lived session owner pid and injects environment context", async () => {
518
583
  const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-session-start-"));
519
584
  try {
@@ -1101,7 +1166,12 @@ describe("codex native hook dispatch", () => {
1101
1166
  assert.ok(result.outputJson, "UserPromptSubmit should emit developer context");
1102
1167
  assert.match(JSON.stringify(result.outputJson), /skill: ralplan activated and initial state initialized at \.omx\/state\/sessions\/sess-1\/ralplan-state\.json; write subsequent updates via omx_state MCP\./);
1103
1168
 
1104
- const statePath = join(cwd, ".omx", "state", "skill-active-state.json");
1169
+ assert.equal(
1170
+ existsSync(join(cwd, ".omx", "state", "skill-active-state.json")),
1171
+ false,
1172
+ "session-scoped keyword activation should not write root skill-active-state.json",
1173
+ );
1174
+ const statePath = join(cwd, ".omx", "state", "sessions", "sess-1", "skill-active-state.json");
1105
1175
  assert.equal(existsSync(statePath), true);
1106
1176
  const state = JSON.parse(await readFile(statePath, "utf-8")) as {
1107
1177
  skill?: string;
@@ -6,6 +6,8 @@ type CodexHookEventName =
6
6
  | "PreToolUse"
7
7
  | "PostToolUse"
8
8
  | "UserPromptSubmit"
9
+ | "PreCompact"
10
+ | "PostCompact"
9
11
  | "Stop";
10
12
 
11
13
  type CodexHookPayload = Record<string, unknown>;
@@ -70,7 +70,11 @@ import {
70
70
  import type { HookEventEnvelope } from "../hooks/extensibility/types.js";
71
71
  import { dispatchHookEventRuntime } from "../hooks/extensibility/runtime.js";
72
72
  import { reconcileHudForPromptSubmit } from "../hud/reconcile.js";
73
- import { onSessionStart as buildWikiSessionStartContext } from "../wiki/lifecycle.js";
73
+ import {
74
+ onPostCompact as buildWikiPostCompactContext,
75
+ onPreCompact as buildWikiPreCompactContext,
76
+ onSessionStart as buildWikiSessionStartContext,
77
+ } from "../wiki/lifecycle.js";
74
78
  import { readAutoresearchCompletionStatus, readAutoresearchModeStateForActiveDecision } from "../autoresearch/skill-validation.js";
75
79
  import { readRunState } from "../runtime/run-state.js";
76
80
  import { getRunContinuationSnapshot, shouldContinueRun } from "../runtime/run-loop.js";
@@ -99,6 +103,8 @@ type CodexHookEventName =
99
103
  | "PreToolUse"
100
104
  | "PostToolUse"
101
105
  | "UserPromptSubmit"
106
+ | "PreCompact"
107
+ | "PostCompact"
102
108
  | "Stop";
103
109
 
104
110
  type CodexHookPayload = Record<string, unknown>;
@@ -358,6 +364,8 @@ function readHookEventName(payload: CodexHookPayload): CodexHookEventName | null
358
364
  || raw === "PreToolUse"
359
365
  || raw === "PostToolUse"
360
366
  || raw === "UserPromptSubmit"
367
+ || raw === "PreCompact"
368
+ || raw === "PostCompact"
361
369
  || raw === "Stop"
362
370
  ) {
363
371
  return raw;
@@ -377,6 +385,10 @@ export function mapCodexHookEventToOmxEvent(
377
385
  return "post-tool-use";
378
386
  case "UserPromptSubmit":
379
387
  return "keyword-detector";
388
+ case "PreCompact":
389
+ return "pre-compact";
390
+ case "PostCompact":
391
+ return "post-compact";
380
392
  case "Stop":
381
393
  return "stop";
382
394
  default:
@@ -3010,7 +3022,27 @@ export async function dispatchCodexNativeHook(
3010
3022
  });
3011
3023
  }
3012
3024
 
3013
- if ((hookEventName === "SessionStart" && !skipCanonicalSessionStartContext) || hookEventName === "UserPromptSubmit") {
3025
+ if (hookEventName === "PreCompact") {
3026
+ const compactContext = buildWikiPreCompactContext({ cwd });
3027
+ if (compactContext.additionalContext) {
3028
+ outputJson = {
3029
+ hookSpecificOutput: {
3030
+ hookEventName,
3031
+ additionalContext: compactContext.additionalContext,
3032
+ },
3033
+ };
3034
+ }
3035
+ } else if (hookEventName === "PostCompact") {
3036
+ const compactContext = buildWikiPostCompactContext({ cwd });
3037
+ if (compactContext.additionalContext) {
3038
+ outputJson = {
3039
+ hookSpecificOutput: {
3040
+ hookEventName,
3041
+ additionalContext: compactContext.additionalContext,
3042
+ },
3043
+ };
3044
+ }
3045
+ } else if ((hookEventName === "SessionStart" && !skipCanonicalSessionStartContext) || hookEventName === "UserPromptSubmit") {
3014
3046
  const additionalContext = hookEventName === "SessionStart"
3015
3047
  ? await buildSessionStartContext(cwd, canonicalSessionId || nativeSessionId, {
3016
3048
  hookEventName,