oh-my-codex 0.16.1 → 0.16.3
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.
- package/Cargo.lock +5 -5
- package/Cargo.toml +1 -1
- package/README.md +2 -2
- package/dist/cli/__tests__/doctor-warning-copy.test.js +37 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/explore.test.js +2 -2
- package/dist/cli/__tests__/explore.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +173 -3
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +58 -0
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +1 -0
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +8 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +82 -2
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-scope.test.js +12 -0
- package/dist/cli/__tests__/setup-scope.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +161 -0
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +14 -9
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +44 -2
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +109 -19
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +17 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/explore.d.ts.map +1 -1
- package/dist/cli/explore.js +3 -4
- package/dist/cli/explore.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +34 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +72 -6
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +54 -15
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/ultragoal.d.ts +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +26 -8
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +68 -5
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update.d.ts +10 -2
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +99 -5
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/codex-hooks.test.js +269 -2
- package/dist/config/__tests__/codex-hooks.test.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +60 -2
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +59 -1
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/__tests__/wiki-config-contract.test.js +2 -1
- package/dist/config/__tests__/wiki-config-contract.test.js.map +1 -1
- package/dist/config/codex-hooks.d.ts +52 -4
- package/dist/config/codex-hooks.d.ts.map +1 -1
- package/dist/config/codex-hooks.js +268 -7
- package/dist/config/codex-hooks.js.map +1 -1
- package/dist/config/generator.d.ts +13 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +207 -12
- package/dist/config/generator.js.map +1 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +37 -25
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +29 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +20 -4
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +1 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts +2 -0
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js +52 -0
- package/dist/hooks/__tests__/notify-hook-non-omx-guard.test.js.map +1 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +148 -0
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js +3 -0
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -1
- package/dist/hooks/__tests__/wiki-docs-contract.test.js +5 -4
- package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +2 -4
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +145 -6
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/__tests__/wiki-server.test.js +97 -1
- package/dist/mcp/__tests__/wiki-server.test.js.map +1 -1
- package/dist/mcp/wiki-server.d.ts.map +1 -1
- package/dist/mcp/wiki-server.js +11 -2
- package/dist/mcp/wiki-server.js.map +1 -1
- package/dist/planning/__tests__/artifacts.test.js +64 -0
- package/dist/planning/__tests__/artifacts.test.js.map +1 -1
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.d.ts +2 -0
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.d.ts.map +1 -0
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.js +90 -0
- package/dist/planning/__tests__/ready-context-pack-role-refs.test.js.map +1 -0
- package/dist/planning/artifacts.d.ts +7 -2
- package/dist/planning/artifacts.d.ts.map +1 -1
- package/dist/planning/artifacts.js +62 -8
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/planning/context-pack-status.d.ts +6 -0
- package/dist/planning/context-pack-status.d.ts.map +1 -1
- package/dist/planning/context-pack-status.js +25 -0
- package/dist/planning/context-pack-status.js.map +1 -1
- package/dist/ralph/persistence.d.ts +1 -1
- package/dist/ralph/persistence.d.ts.map +1 -1
- package/dist/ralph/persistence.js +8 -2
- package/dist/ralph/persistence.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +190 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/codex-execution-surface.d.ts +1 -1
- package/dist/scripts/codex-execution-surface.d.ts.map +1 -1
- package/dist/scripts/codex-execution-surface.js.map +1 -1
- package/dist/scripts/codex-native-hook.d.ts +1 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +18 -3
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/notify-dispatcher.d.ts +7 -0
- package/dist/scripts/notify-dispatcher.d.ts.map +1 -0
- package/dist/scripts/notify-dispatcher.js +58 -0
- package/dist/scripts/notify-dispatcher.js.map +1 -0
- package/dist/scripts/notify-fallback-watcher.js +4 -0
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +1 -1
- package/dist/scripts/notify-hook/ralph-session-resume.js +96 -8
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +1 -1
- package/dist/scripts/notify-hook/state-io.d.ts.map +1 -1
- package/dist/scripts/notify-hook/state-io.js +6 -2
- package/dist/scripts/notify-hook/state-io.js.map +1 -1
- package/dist/scripts/notify-hook/visual-verdict.js +3 -3
- package/dist/scripts/notify-hook/visual-verdict.js.map +1 -1
- package/dist/scripts/notify-hook.js +124 -0
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +79 -0
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/skill-active.test.js +10 -18
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +1 -20
- package/dist/state/operations.js.map +1 -1
- package/dist/state/skill-active.d.ts +1 -0
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +28 -18
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +1 -0
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/team/__tests__/approved-execution.test.js +45 -1
- package/dist/team/__tests__/approved-execution.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +173 -19
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +37 -0
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/approved-execution.d.ts +1 -0
- package/dist/team/approved-execution.d.ts.map +1 -1
- package/dist/team/approved-execution.js +50 -0
- package/dist/team/approved-execution.js.map +1 -1
- package/dist/team/delivery-log.d.ts.map +1 -1
- package/dist/team/delivery-log.js +8 -1
- package/dist/team/delivery-log.js.map +1 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +104 -18
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/state/mailbox.d.ts +1 -0
- package/dist/team/state/mailbox.d.ts.map +1 -1
- package/dist/team/state/mailbox.js +10 -1
- package/dist/team/state/mailbox.js.map +1 -1
- package/dist/team/state-root.js +1 -1
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +2 -2
- package/dist/team/state.js.map +1 -1
- package/dist/team/worker-bootstrap.d.ts +7 -2
- package/dist/team/worker-bootstrap.d.ts.map +1 -1
- package/dist/team/worker-bootstrap.js +17 -4
- package/dist/team/worker-bootstrap.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +81 -7
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +8 -0
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +4 -0
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +72 -4
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/utils/paths.d.ts +3 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +6 -2
- package/dist/utils/paths.js.map +1 -1
- package/dist/wiki/__tests__/ingest.test.js +35 -1
- package/dist/wiki/__tests__/ingest.test.js.map +1 -1
- package/dist/wiki/__tests__/lint.test.js +14 -1
- package/dist/wiki/__tests__/lint.test.js.map +1 -1
- package/dist/wiki/__tests__/query.test.js +28 -3
- package/dist/wiki/__tests__/query.test.js.map +1 -1
- package/dist/wiki/__tests__/session-hooks.test.js +30 -2
- package/dist/wiki/__tests__/session-hooks.test.js.map +1 -1
- package/dist/wiki/__tests__/storage.test.js +62 -22
- package/dist/wiki/__tests__/storage.test.js.map +1 -1
- package/dist/wiki/index.d.ts +2 -2
- package/dist/wiki/index.d.ts.map +1 -1
- package/dist/wiki/index.js +2 -2
- package/dist/wiki/index.js.map +1 -1
- package/dist/wiki/ingest.js +2 -2
- package/dist/wiki/ingest.js.map +1 -1
- package/dist/wiki/lifecycle.d.ts +5 -0
- package/dist/wiki/lifecycle.d.ts.map +1 -1
- package/dist/wiki/lifecycle.js +31 -4
- package/dist/wiki/lifecycle.js.map +1 -1
- package/dist/wiki/lint.d.ts.map +1 -1
- package/dist/wiki/lint.js +12 -8
- package/dist/wiki/lint.js.map +1 -1
- package/dist/wiki/query.d.ts.map +1 -1
- package/dist/wiki/query.js +3 -2
- package/dist/wiki/query.js.map +1 -1
- package/dist/wiki/storage.d.ts +4 -0
- package/dist/wiki/storage.d.ts.map +1 -1
- package/dist/wiki/storage.js +54 -18
- package/dist/wiki/storage.js.map +1 -1
- package/package.json +1 -1
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/plan/SKILL.md +4 -4
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +2 -2
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +11 -7
- package/plugins/oh-my-codex/skills/wiki/SKILL.md +5 -5
- package/prompts/planner.md +1 -1
- package/skills/deep-interview/SKILL.md +2 -2
- package/skills/plan/SKILL.md +4 -4
- package/skills/ralplan/SKILL.md +2 -2
- package/skills/ultragoal/SKILL.md +11 -7
- package/skills/wiki/SKILL.md +5 -5
- package/src/scripts/__tests__/codex-native-hook.test.ts +218 -1
- package/src/scripts/codex-execution-surface.ts +2 -0
- package/src/scripts/codex-native-hook.ts +22 -3
- package/src/scripts/notify-dispatcher.ts +74 -0
- package/src/scripts/notify-fallback-watcher.ts +6 -2
- package/src/scripts/notify-hook/ralph-session-resume.ts +117 -8
- package/src/scripts/notify-hook/state-io.ts +4 -2
- package/src/scripts/notify-hook/visual-verdict.ts +3 -3
- package/src/scripts/notify-hook.ts +116 -0
|
@@ -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
|
|
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
|
|
35
|
-
6. Run a completion audit against the objective and real artifacts/tests.
|
|
36
|
-
7.
|
|
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.
|
|
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
|
|
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
|
|
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:
|
|
46
|
-
- Index:
|
|
47
|
-
- Log:
|
|
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
|
|
57
|
+
- Wiki files are repository project knowledge under `omx_wiki/`; legacy `.omx/wiki/` is read-only compatibility input when no canonical wiki exists
|
package/prompts/planner.md
CHANGED
|
@@ -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`** —
|
|
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
|
|
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`
|
package/skills/plan/SKILL.md
CHANGED
|
@@ -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:
|
|
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
|
|
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`
|
|
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`
|
|
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
|
|
package/skills/ralplan/SKILL.md
CHANGED
|
@@ -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.
|
|
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
|
|
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
|
|
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
|
|
35
|
-
6. Run a completion audit against the objective and real artifacts/tests.
|
|
36
|
-
7.
|
|
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.
|
|
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
|
|
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.
|
package/skills/wiki/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wiki
|
|
3
|
-
description: Persistent markdown project wiki stored under
|
|
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:
|
|
46
|
-
- Index:
|
|
47
|
-
- Log:
|
|
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
|
|
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
|
|
|
@@ -272,6 +276,20 @@ describe("codex native hook config", () => {
|
|
|
272
276
|
hooks?: Array<Record<string, unknown>>;
|
|
273
277
|
};
|
|
274
278
|
assert.equal(stop.hooks?.[0]?.timeout, 30);
|
|
279
|
+
|
|
280
|
+
const postCompact = config.hooks.PostCompact[0] as {
|
|
281
|
+
matcher?: string;
|
|
282
|
+
hooks?: Array<Record<string, unknown>>;
|
|
283
|
+
};
|
|
284
|
+
assert.equal(postCompact.matcher, undefined);
|
|
285
|
+
assert.match(
|
|
286
|
+
String(postCompact.hooks?.[0]?.command || ""),
|
|
287
|
+
/codex-native-hook\.js"?$/,
|
|
288
|
+
);
|
|
289
|
+
assert.doesNotMatch(
|
|
290
|
+
String(postCompact.hooks?.[0]?.command || ""),
|
|
291
|
+
/PostCompact Nudge|additionalContext|printf/,
|
|
292
|
+
);
|
|
275
293
|
});
|
|
276
294
|
});
|
|
277
295
|
|
|
@@ -511,9 +529,109 @@ describe("codex native hook dispatch", () => {
|
|
|
511
529
|
assert.equal(mapCodexHookEventToOmxEvent("UserPromptSubmit"), "keyword-detector");
|
|
512
530
|
assert.equal(mapCodexHookEventToOmxEvent("PreToolUse"), "pre-tool-use");
|
|
513
531
|
assert.equal(mapCodexHookEventToOmxEvent("PostToolUse"), "post-tool-use");
|
|
532
|
+
assert.equal(mapCodexHookEventToOmxEvent("PreCompact"), "pre-compact");
|
|
533
|
+
assert.equal(mapCodexHookEventToOmxEvent("PostCompact"), "post-compact");
|
|
514
534
|
assert.equal(mapCodexHookEventToOmxEvent("Stop"), "stop");
|
|
515
535
|
});
|
|
516
536
|
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
it("does not write PreCompact stdout that Codex rejects as hook JSON", async () => {
|
|
540
|
+
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-precompact-"));
|
|
541
|
+
try {
|
|
542
|
+
writePage(cwd, {
|
|
543
|
+
filename: "architecture.md",
|
|
544
|
+
frontmatter: {
|
|
545
|
+
title: "Architecture",
|
|
546
|
+
tags: ["architecture"],
|
|
547
|
+
created: "2026-05-08T00:00:00.000Z",
|
|
548
|
+
updated: "2026-05-08T00:00:00.000Z",
|
|
549
|
+
sources: [],
|
|
550
|
+
links: [],
|
|
551
|
+
category: "architecture",
|
|
552
|
+
confidence: "high",
|
|
553
|
+
schemaVersion: WIKI_SCHEMA_VERSION,
|
|
554
|
+
},
|
|
555
|
+
content: "\n# Architecture\n\nCompaction-relevant architecture note.\n",
|
|
556
|
+
});
|
|
557
|
+
|
|
558
|
+
const result = await dispatchCodexNativeHook({
|
|
559
|
+
hook_event_name: "PreCompact",
|
|
560
|
+
cwd,
|
|
561
|
+
session_id: "sess-precompact",
|
|
562
|
+
});
|
|
563
|
+
|
|
564
|
+
assert.equal(result.hookEventName, "PreCompact");
|
|
565
|
+
assert.equal(result.omxEventName, "pre-compact");
|
|
566
|
+
assert.equal(result.outputJson, null);
|
|
567
|
+
} finally {
|
|
568
|
+
await rm(cwd, { recursive: true, force: true });
|
|
569
|
+
}
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
it("emits no CLI stdout for PreCompact when no Codex action is needed", async () => {
|
|
573
|
+
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-precompact-cli-"));
|
|
574
|
+
try {
|
|
575
|
+
writePage(cwd, {
|
|
576
|
+
filename: "architecture.md",
|
|
577
|
+
frontmatter: {
|
|
578
|
+
title: "Architecture",
|
|
579
|
+
tags: ["architecture"],
|
|
580
|
+
created: "2026-05-08T00:00:00.000Z",
|
|
581
|
+
updated: "2026-05-08T00:00:00.000Z",
|
|
582
|
+
sources: [],
|
|
583
|
+
links: [],
|
|
584
|
+
category: "architecture",
|
|
585
|
+
confidence: "high",
|
|
586
|
+
schemaVersion: WIKI_SCHEMA_VERSION,
|
|
587
|
+
},
|
|
588
|
+
content: "\n# Architecture\n\nCompaction-relevant architecture note.\n",
|
|
589
|
+
});
|
|
590
|
+
|
|
591
|
+
const stdout = runNativeHookCli({
|
|
592
|
+
hook_event_name: "PreCompact",
|
|
593
|
+
cwd,
|
|
594
|
+
session_id: "sess-precompact-cli",
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
assert.equal(stdout, "");
|
|
598
|
+
} finally {
|
|
599
|
+
await rm(cwd, { recursive: true, force: true });
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
|
|
603
|
+
it("does not write PostCompact stdout that Codex rejects as hook JSON", async () => {
|
|
604
|
+
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-postcompact-"));
|
|
605
|
+
try {
|
|
606
|
+
const result = await dispatchCodexNativeHook({
|
|
607
|
+
hook_event_name: "PostCompact",
|
|
608
|
+
cwd,
|
|
609
|
+
session_id: "sess-postcompact",
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
assert.equal(result.hookEventName, "PostCompact");
|
|
613
|
+
assert.equal(result.omxEventName, "post-compact");
|
|
614
|
+
assert.equal(result.outputJson, null);
|
|
615
|
+
} finally {
|
|
616
|
+
await rm(cwd, { recursive: true, force: true });
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
it("emits no CLI stdout for PostCompact when no Codex action is needed", async () => {
|
|
621
|
+
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-postcompact-cli-"));
|
|
622
|
+
try {
|
|
623
|
+
const stdout = runNativeHookCli({
|
|
624
|
+
hook_event_name: "PostCompact",
|
|
625
|
+
cwd,
|
|
626
|
+
session_id: "sess-postcompact-cli",
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
assert.equal(stdout, "");
|
|
630
|
+
} finally {
|
|
631
|
+
await rm(cwd, { recursive: true, force: true });
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
|
|
517
635
|
it("writes SessionStart state against the long-lived session owner pid and injects environment context", async () => {
|
|
518
636
|
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-session-start-"));
|
|
519
637
|
try {
|
|
@@ -1101,7 +1219,12 @@ describe("codex native hook dispatch", () => {
|
|
|
1101
1219
|
assert.ok(result.outputJson, "UserPromptSubmit should emit developer context");
|
|
1102
1220
|
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
1221
|
|
|
1104
|
-
|
|
1222
|
+
assert.equal(
|
|
1223
|
+
existsSync(join(cwd, ".omx", "state", "skill-active-state.json")),
|
|
1224
|
+
false,
|
|
1225
|
+
"session-scoped keyword activation should not write root skill-active-state.json",
|
|
1226
|
+
);
|
|
1227
|
+
const statePath = join(cwd, ".omx", "state", "sessions", "sess-1", "skill-active-state.json");
|
|
1105
1228
|
assert.equal(existsSync(statePath), true);
|
|
1106
1229
|
const state = JSON.parse(await readFile(statePath, "utf-8")) as {
|
|
1107
1230
|
skill?: string;
|
|
@@ -1170,6 +1293,100 @@ describe("codex native hook dispatch", () => {
|
|
|
1170
1293
|
}
|
|
1171
1294
|
});
|
|
1172
1295
|
|
|
1296
|
+
it("does not block Stop for non-passing autoresearch-goal professor-critic verdicts", async () => {
|
|
1297
|
+
for (const verdict of ["blocked", "fail", "failed"]) {
|
|
1298
|
+
const cwd = await mkdtemp(join(tmpdir(), `omx-native-hook-autoresearch-${verdict}-stop-`));
|
|
1299
|
+
const slug = `${verdict}-mission`;
|
|
1300
|
+
try {
|
|
1301
|
+
await writeJson(join(cwd, ".omx", "goals", "autoresearch", slug, "mission.json"), {
|
|
1302
|
+
version: 1,
|
|
1303
|
+
workflow: "autoresearch-goal",
|
|
1304
|
+
slug,
|
|
1305
|
+
topic: "Blocked research",
|
|
1306
|
+
status: verdict === "blocked" ? "blocked" : "failed",
|
|
1307
|
+
});
|
|
1308
|
+
await writeJson(join(cwd, ".omx", "goals", "autoresearch", slug, "completion.json"), {
|
|
1309
|
+
verdict,
|
|
1310
|
+
passed: false,
|
|
1311
|
+
});
|
|
1312
|
+
|
|
1313
|
+
const result = await dispatchCodexNativeHook({
|
|
1314
|
+
hook_event_name: "Stop",
|
|
1315
|
+
cwd,
|
|
1316
|
+
session_id: `sess-autoresearch-${verdict}-stop`,
|
|
1317
|
+
thread_id: `thread-autoresearch-${verdict}-stop`,
|
|
1318
|
+
last_assistant_message: "Autoresearch goal complete; next call update_goal({status: \"complete\"}).",
|
|
1319
|
+
}, { cwd });
|
|
1320
|
+
|
|
1321
|
+
assert.notEqual(result.outputJson?.decision, "block");
|
|
1322
|
+
assert.doesNotMatch(JSON.stringify(result.outputJson), new RegExp(`autoresearch-goal complete --slug ${slug}`));
|
|
1323
|
+
assert.doesNotMatch(JSON.stringify(result.outputJson), /get_goal snapshot reconciliation/);
|
|
1324
|
+
} finally {
|
|
1325
|
+
await rm(cwd, { recursive: true, force: true });
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
it("blocks Stop for passing autoresearch-goal professor-critic verdicts that need reconciliation", async () => {
|
|
1331
|
+
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-autoresearch-pass-stop-"));
|
|
1332
|
+
try {
|
|
1333
|
+
await writeJson(join(cwd, ".omx", "goals", "autoresearch", "passing-mission", "mission.json"), {
|
|
1334
|
+
version: 1,
|
|
1335
|
+
workflow: "autoresearch-goal",
|
|
1336
|
+
slug: "passing-mission",
|
|
1337
|
+
topic: "Passing research",
|
|
1338
|
+
status: "validation_passed",
|
|
1339
|
+
});
|
|
1340
|
+
await writeJson(join(cwd, ".omx", "goals", "autoresearch", "passing-mission", "completion.json"), {
|
|
1341
|
+
verdict: "fail",
|
|
1342
|
+
passed: true,
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
const result = await dispatchCodexNativeHook({
|
|
1346
|
+
hook_event_name: "Stop",
|
|
1347
|
+
cwd,
|
|
1348
|
+
session_id: "sess-autoresearch-pass-stop",
|
|
1349
|
+
thread_id: "thread-autoresearch-pass-stop",
|
|
1350
|
+
last_assistant_message: "Autoresearch goal complete; next call update_goal({status: \"complete\"}).",
|
|
1351
|
+
}, { cwd });
|
|
1352
|
+
|
|
1353
|
+
assert.equal(result.outputJson?.decision, "block");
|
|
1354
|
+
assert.match(JSON.stringify(result.outputJson), /get_goal snapshot reconciliation/);
|
|
1355
|
+
assert.match(JSON.stringify(result.outputJson), /omx autoresearch-goal complete --slug passing-mission/);
|
|
1356
|
+
} finally {
|
|
1357
|
+
await rm(cwd, { recursive: true, force: true });
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
|
|
1361
|
+
it("blocks Stop for autoresearch-goal verdict=pass even when passed is omitted", async () => {
|
|
1362
|
+
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-autoresearch-verdict-pass-stop-"));
|
|
1363
|
+
try {
|
|
1364
|
+
await writeJson(join(cwd, ".omx", "goals", "autoresearch", "verdict-pass-mission", "mission.json"), {
|
|
1365
|
+
version: 1,
|
|
1366
|
+
workflow: "autoresearch-goal",
|
|
1367
|
+
slug: "verdict-pass-mission",
|
|
1368
|
+
topic: "Passing research",
|
|
1369
|
+
status: "validation_passed",
|
|
1370
|
+
});
|
|
1371
|
+
await writeJson(join(cwd, ".omx", "goals", "autoresearch", "verdict-pass-mission", "completion.json"), {
|
|
1372
|
+
verdict: "pass",
|
|
1373
|
+
});
|
|
1374
|
+
|
|
1375
|
+
const result = await dispatchCodexNativeHook({
|
|
1376
|
+
hook_event_name: "Stop",
|
|
1377
|
+
cwd,
|
|
1378
|
+
session_id: "sess-autoresearch-verdict-pass-stop",
|
|
1379
|
+
thread_id: "thread-autoresearch-verdict-pass-stop",
|
|
1380
|
+
last_assistant_message: "Autoresearch goal complete; next call update_goal({status: \"complete\"}).",
|
|
1381
|
+
}, { cwd });
|
|
1382
|
+
|
|
1383
|
+
assert.equal(result.outputJson?.decision, "block");
|
|
1384
|
+
assert.match(JSON.stringify(result.outputJson), /omx autoresearch-goal complete --slug verdict-pass-mission/);
|
|
1385
|
+
} finally {
|
|
1386
|
+
await rm(cwd, { recursive: true, force: true });
|
|
1387
|
+
}
|
|
1388
|
+
});
|
|
1389
|
+
|
|
1173
1390
|
it("treats workflow keywords in native subagent prompt text as literal delegation text", async () => {
|
|
1174
1391
|
const cwd = await mkdtemp(join(tmpdir(), "omx-native-hook-subagent-keyword-literal-"));
|
|
1175
1392
|
try {
|
|
@@ -70,7 +70,10 @@ 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 {
|
|
73
|
+
import {
|
|
74
|
+
onPreCompact as buildWikiPreCompactContext,
|
|
75
|
+
onSessionStart as buildWikiSessionStartContext,
|
|
76
|
+
} from "../wiki/lifecycle.js";
|
|
74
77
|
import { readAutoresearchCompletionStatus, readAutoresearchModeStateForActiveDecision } from "../autoresearch/skill-validation.js";
|
|
75
78
|
import { readRunState } from "../runtime/run-state.js";
|
|
76
79
|
import { getRunContinuationSnapshot, shouldContinueRun } from "../runtime/run-loop.js";
|
|
@@ -99,6 +102,8 @@ type CodexHookEventName =
|
|
|
99
102
|
| "PreToolUse"
|
|
100
103
|
| "PostToolUse"
|
|
101
104
|
| "UserPromptSubmit"
|
|
105
|
+
| "PreCompact"
|
|
106
|
+
| "PostCompact"
|
|
102
107
|
| "Stop";
|
|
103
108
|
|
|
104
109
|
type CodexHookPayload = Record<string, unknown>;
|
|
@@ -358,6 +363,8 @@ function readHookEventName(payload: CodexHookPayload): CodexHookEventName | null
|
|
|
358
363
|
|| raw === "PreToolUse"
|
|
359
364
|
|| raw === "PostToolUse"
|
|
360
365
|
|| raw === "UserPromptSubmit"
|
|
366
|
+
|| raw === "PreCompact"
|
|
367
|
+
|| raw === "PostCompact"
|
|
361
368
|
|| raw === "Stop"
|
|
362
369
|
) {
|
|
363
370
|
return raw;
|
|
@@ -377,6 +384,10 @@ export function mapCodexHookEventToOmxEvent(
|
|
|
377
384
|
return "post-tool-use";
|
|
378
385
|
case "UserPromptSubmit":
|
|
379
386
|
return "keyword-detector";
|
|
387
|
+
case "PreCompact":
|
|
388
|
+
return "pre-compact";
|
|
389
|
+
case "PostCompact":
|
|
390
|
+
return "post-compact";
|
|
380
391
|
case "Stop":
|
|
381
392
|
return "stop";
|
|
382
393
|
default:
|
|
@@ -1642,7 +1653,10 @@ async function findActiveGoalWorkflowReconciliationRequirement(cwd: string): Pro
|
|
|
1642
1653
|
if (!entry.isDirectory()) continue;
|
|
1643
1654
|
const mission = await readJsonIfExists(join(autoresearchRoot, entry.name, "mission.json"));
|
|
1644
1655
|
const status = safeString(mission?.status);
|
|
1645
|
-
|
|
1656
|
+
const completion = await readJsonIfExists(join(autoresearchRoot, entry.name, "completion.json"));
|
|
1657
|
+
const completionVerdict = safeString(completion?.verdict);
|
|
1658
|
+
const completionPassed = completion?.passed === true || completionVerdict === "pass";
|
|
1659
|
+
if (mission?.workflow === "autoresearch-goal" && status && status !== "complete" && completionPassed) {
|
|
1646
1660
|
return {
|
|
1647
1661
|
workflow: "autoresearch-goal",
|
|
1648
1662
|
command: `omx autoresearch-goal complete --slug ${safeString(mission.slug) || entry.name} --codex-goal-json '<get_goal JSON or path>'`,
|
|
@@ -3010,7 +3024,12 @@ export async function dispatchCodexNativeHook(
|
|
|
3010
3024
|
});
|
|
3011
3025
|
}
|
|
3012
3026
|
|
|
3013
|
-
if (
|
|
3027
|
+
if (hookEventName === "PreCompact") {
|
|
3028
|
+
// Codex native PreCompact currently accepts only the common continuation fields.
|
|
3029
|
+
// Keep the OMX lifecycle dispatch above, but do not emit `hookSpecificOutput`
|
|
3030
|
+
// unless Codex defines a supported PreCompact output contract.
|
|
3031
|
+
buildWikiPreCompactContext({ cwd });
|
|
3032
|
+
} else if ((hookEventName === "SessionStart" && !skipCanonicalSessionStartContext) || hookEventName === "UserPromptSubmit") {
|
|
3014
3033
|
const additionalContext = hookEventName === "SessionStart"
|
|
3015
3034
|
? await buildSessionStartContext(cwd, canonicalSessionId || nativeSessionId, {
|
|
3016
3035
|
hookEventName,
|