oh-my-codex 0.20.3 → 0.20.5
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 +35 -18
- package/Cargo.toml +1 -1
- package/README.md +2 -2
- package/crates/omx-runtime/Cargo.toml +3 -0
- package/crates/omx-runtime/src/main.rs +390 -0
- package/crates/omx-runtime/tests/execution.rs +264 -0
- package/dist/adapt/__tests__/herdr-target.test.d.ts +2 -0
- package/dist/adapt/__tests__/herdr-target.test.d.ts.map +1 -0
- package/dist/adapt/__tests__/herdr-target.test.js +72 -0
- package/dist/adapt/__tests__/herdr-target.test.js.map +1 -0
- package/dist/adapt/contracts.d.ts +1 -1
- package/dist/adapt/contracts.d.ts.map +1 -1
- package/dist/adapt/contracts.js +1 -1
- package/dist/adapt/contracts.js.map +1 -1
- package/dist/adapt/herdr/__tests__/authority.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/authority.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/authority.test.js +49 -0
- package/dist/adapt/herdr/__tests__/authority.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/bridge.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/bridge.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/bridge.test.js +176 -0
- package/dist/adapt/herdr/__tests__/bridge.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.js +45 -0
- package/dist/adapt/herdr/__tests__/sanitize.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/semantic.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/semantic.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/semantic.test.js +130 -0
- package/dist/adapt/herdr/__tests__/semantic.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.js +54 -0
- package/dist/adapt/herdr/__tests__/seq-store.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.js +104 -0
- package/dist/adapt/herdr/__tests__/socket-live.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/team-map.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/team-map.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/team-map.test.js +46 -0
- package/dist/adapt/herdr/__tests__/team-map.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/transport.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/transport.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/transport.test.js +160 -0
- package/dist/adapt/herdr/__tests__/transport.test.js.map +1 -0
- package/dist/adapt/herdr/__tests__/wiring.test.d.ts +2 -0
- package/dist/adapt/herdr/__tests__/wiring.test.d.ts.map +1 -0
- package/dist/adapt/herdr/__tests__/wiring.test.js +118 -0
- package/dist/adapt/herdr/__tests__/wiring.test.js.map +1 -0
- package/dist/adapt/herdr/authority.d.ts +34 -0
- package/dist/adapt/herdr/authority.d.ts.map +1 -0
- package/dist/adapt/herdr/authority.js +71 -0
- package/dist/adapt/herdr/authority.js.map +1 -0
- package/dist/adapt/herdr/bridge.d.ts +84 -0
- package/dist/adapt/herdr/bridge.d.ts.map +1 -0
- package/dist/adapt/herdr/bridge.js +222 -0
- package/dist/adapt/herdr/bridge.js.map +1 -0
- package/dist/adapt/herdr/sanitize.d.ts +20 -0
- package/dist/adapt/herdr/sanitize.d.ts.map +1 -0
- package/dist/adapt/herdr/sanitize.js +70 -0
- package/dist/adapt/herdr/sanitize.js.map +1 -0
- package/dist/adapt/herdr/semantic.d.ts +67 -0
- package/dist/adapt/herdr/semantic.d.ts.map +1 -0
- package/dist/adapt/herdr/semantic.js +170 -0
- package/dist/adapt/herdr/semantic.js.map +1 -0
- package/dist/adapt/herdr/seq-store.d.ts +32 -0
- package/dist/adapt/herdr/seq-store.d.ts.map +1 -0
- package/dist/adapt/herdr/seq-store.js +126 -0
- package/dist/adapt/herdr/seq-store.js.map +1 -0
- package/dist/adapt/herdr/team-map.d.ts +30 -0
- package/dist/adapt/herdr/team-map.d.ts.map +1 -0
- package/dist/adapt/herdr/team-map.js +37 -0
- package/dist/adapt/herdr/team-map.js.map +1 -0
- package/dist/adapt/herdr/transport.d.ts +115 -0
- package/dist/adapt/herdr/transport.d.ts.map +1 -0
- package/dist/adapt/herdr/transport.js +260 -0
- package/dist/adapt/herdr/transport.js.map +1 -0
- package/dist/adapt/herdr/wiring.d.ts +24 -0
- package/dist/adapt/herdr/wiring.d.ts.map +1 -0
- package/dist/adapt/herdr/wiring.js +62 -0
- package/dist/adapt/herdr/wiring.js.map +1 -0
- package/dist/adapt/herdr.d.ts +19 -0
- package/dist/adapt/herdr.d.ts.map +1 -0
- package/dist/adapt/herdr.js +115 -0
- package/dist/adapt/herdr.js.map +1 -0
- package/dist/adapt/index.d.ts +4 -0
- package/dist/adapt/index.d.ts.map +1 -1
- package/dist/adapt/index.js +48 -0
- package/dist/adapt/index.js.map +1 -1
- package/dist/adapt/registry.d.ts.map +1 -1
- package/dist/adapt/registry.js +11 -0
- package/dist/adapt/registry.js.map +1 -1
- package/dist/auth/__tests__/hotswap.test.js +60 -1
- package/dist/auth/__tests__/hotswap.test.js.map +1 -1
- package/dist/auth/__tests__/storage.test.js +33 -1
- package/dist/auth/__tests__/storage.test.js.map +1 -1
- package/dist/auth/hotswap.d.ts +16 -2
- package/dist/auth/hotswap.d.ts.map +1 -1
- package/dist/auth/hotswap.js +22 -7
- package/dist/auth/hotswap.js.map +1 -1
- package/dist/auth/storage.js +1 -1
- package/dist/auth/storage.js.map +1 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.js +86 -1333
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +1 -1
- package/dist/autopilot/ralplan-gate.d.ts.map +1 -1
- package/dist/autopilot/ralplan-gate.js +7 -6
- package/dist/autopilot/ralplan-gate.js.map +1 -1
- package/dist/cli/__tests__/agents-init.test.js +4 -23
- package/dist/cli/__tests__/agents-init.test.js.map +1 -1
- package/dist/cli/__tests__/api.test.js +61 -24
- package/dist/cli/__tests__/api.test.js.map +1 -1
- package/dist/cli/__tests__/auth.test.js +3 -1
- package/dist/cli/__tests__/auth.test.js.map +1 -1
- package/dist/cli/__tests__/codex-feature-probe.test.js +66 -1
- package/dist/cli/__tests__/codex-feature-probe.test.js.map +1 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +70 -2
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +1 -1
- package/dist/cli/__tests__/detached-leader-teardown.test.d.ts +2 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.d.ts.map +1 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js +473 -0
- package/dist/cli/__tests__/detached-leader-teardown.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js +103 -0
- package/dist/cli/__tests__/doctor-process-identity-readiness.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.d.ts +2 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.d.ts.map +1 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.js +139 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-warning-copy.test.js +35 -3
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +1 -1
- package/dist/cli/__tests__/exec.test.js +75 -0
- package/dist/cli/__tests__/exec.test.js.map +1 -1
- package/dist/cli/__tests__/index.test.js +621 -460
- package/dist/cli/__tests__/index.test.js.map +1 -1
- package/dist/cli/__tests__/launch-fallback.test.js +1020 -143
- package/dist/cli/__tests__/launch-fallback.test.js.map +1 -1
- package/dist/cli/__tests__/mcp-parity.test.js +4 -3
- package/dist/cli/__tests__/mcp-parity.test.js.map +1 -1
- package/dist/cli/__tests__/native-assets.test.js +398 -16
- package/dist/cli/__tests__/native-assets.test.js.map +1 -1
- package/dist/cli/__tests__/native-hook-claim-journal.test.js +53 -5
- package/dist/cli/__tests__/native-hook-claim-journal.test.js.map +1 -1
- package/dist/cli/__tests__/ralph.test.js +2 -2
- package/dist/cli/__tests__/ralph.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js +57 -57
- package/dist/cli/__tests__/ralplan-bootstrap-3181.test.js.map +1 -1
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.d.ts +2 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.d.ts.map +1 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.js +56 -0
- package/dist/cli/__tests__/ralplan-child-binding-3212.test.js.map +1 -0
- package/dist/cli/__tests__/ralplan.test.js +84 -12
- package/dist/cli/__tests__/ralplan.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +1118 -43
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +8 -55
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +183 -4
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +93 -41
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.js +45 -1
- package/dist/cli/__tests__/team.test.js.map +1 -1
- package/dist/cli/__tests__/ultragoal.test.js +117 -2
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +50 -5
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +669 -177
- package/dist/cli/__tests__/update.test.js.map +1 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +32 -2
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +1 -1
- package/dist/cli/api.d.ts.map +1 -1
- package/dist/cli/api.js +9 -10
- package/dist/cli/api.js.map +1 -1
- package/dist/cli/codex-feature-probe.d.ts +16 -0
- package/dist/cli/codex-feature-probe.d.ts.map +1 -1
- package/dist/cli/codex-feature-probe.js +44 -0
- package/dist/cli/codex-feature-probe.js.map +1 -1
- package/dist/cli/codex-home.d.ts.map +1 -1
- package/dist/cli/codex-home.js +7 -4
- package/dist/cli/codex-home.js.map +1 -1
- package/dist/cli/doctor.d.ts +17 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +277 -3
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.d.ts +231 -12
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2298 -735
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/native-assets.d.ts +25 -0
- package/dist/cli/native-assets.d.ts.map +1 -1
- package/dist/cli/native-assets.js +448 -51
- package/dist/cli/native-assets.js.map +1 -1
- package/dist/cli/native-hook-claim-journal.d.ts +8 -4
- package/dist/cli/native-hook-claim-journal.d.ts.map +1 -1
- package/dist/cli/native-hook-claim-journal.js +30 -8
- package/dist/cli/native-hook-claim-journal.js.map +1 -1
- package/dist/cli/package-manager-ownership.d.ts +63 -0
- package/dist/cli/package-manager-ownership.d.ts.map +1 -0
- package/dist/cli/package-manager-ownership.js +323 -0
- package/dist/cli/package-manager-ownership.js.map +1 -0
- package/dist/cli/ralph.js +2 -2
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/ralplan.d.ts +4 -2
- package/dist/cli/ralplan.d.ts.map +1 -1
- package/dist/cli/ralplan.js +76 -34
- package/dist/cli/ralplan.js.map +1 -1
- package/dist/cli/setup-preferences.d.ts +15 -0
- package/dist/cli/setup-preferences.d.ts.map +1 -1
- package/dist/cli/setup-preferences.js +27 -1
- package/dist/cli/setup-preferences.js.map +1 -1
- package/dist/cli/setup.d.ts +3 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +55 -32
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/sparkshell.d.ts.map +1 -1
- package/dist/cli/sparkshell.js +52 -9
- package/dist/cli/sparkshell.js.map +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +2 -2
- package/dist/cli/ultragoal.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +27 -28
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/update-worker.d.ts +2 -0
- package/dist/cli/update-worker.d.ts.map +1 -0
- package/dist/cli/update-worker.js +142 -0
- package/dist/cli/update-worker.js.map +1 -0
- package/dist/cli/update.d.ts +14 -22
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +192 -241
- package/dist/cli/update.js.map +1 -1
- package/dist/config/__tests__/generator-idempotent.test.js +173 -29
- package/dist/config/__tests__/generator-idempotent.test.js.map +1 -1
- package/dist/config/__tests__/generator-notify.test.js +3 -1
- package/dist/config/__tests__/generator-notify.test.js.map +1 -1
- package/dist/config/generator.d.ts +25 -3
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +113 -35
- package/dist/config/generator.js.map +1 -1
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js +25 -0
- package/dist/goal-workflows/__tests__/codex-goal-snapshot.test.js.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.d.ts.map +1 -1
- package/dist/goal-workflows/codex-goal-snapshot.js +2 -0
- package/dist/goal-workflows/codex-goal-snapshot.js.map +1 -1
- package/dist/hooks/__tests__/agents-overlay.test.js +3 -1
- package/dist/hooks/__tests__/agents-overlay.test.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +27 -4
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.d.ts +2 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js +172 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js.map +1 -0
- package/dist/hooks/__tests__/keyword-detector.test.js +172 -33
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +173 -11
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +1 -0
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +65 -17
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +27 -0
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +10 -118
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js +7 -0
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +2 -2
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +4 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +2 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +1 -0
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js +9 -0
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/session.test.js +2976 -557
- package/dist/hooks/__tests__/session.test.js.map +1 -1
- package/dist/hooks/agents-overlay.js +1 -1
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js +108 -2
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +1 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.js +151 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.js.map +1 -1
- package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
- package/dist/hooks/extensibility/dispatcher.js +20 -3
- package/dist/hooks/extensibility/dispatcher.js.map +1 -1
- package/dist/hooks/extensibility/plugin-runner.js +1 -0
- package/dist/hooks/extensibility/plugin-runner.js.map +1 -1
- package/dist/hooks/extensibility/runtime.d.ts.map +1 -1
- package/dist/hooks/extensibility/runtime.js.map +1 -1
- package/dist/hooks/extensibility/sdk/paths.d.ts +1 -1
- package/dist/hooks/extensibility/sdk/paths.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk/paths.js +2 -2
- package/dist/hooks/extensibility/sdk/paths.js.map +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk/runtime-state.js +55 -15
- package/dist/hooks/extensibility/sdk/runtime-state.js.map +1 -1
- package/dist/hooks/extensibility/sdk.d.ts +1 -0
- package/dist/hooks/extensibility/sdk.d.ts.map +1 -1
- package/dist/hooks/extensibility/sdk.js +1 -1
- package/dist/hooks/extensibility/sdk.js.map +1 -1
- package/dist/hooks/extensibility/types.d.ts +7 -0
- package/dist/hooks/extensibility/types.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +10 -3
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +116 -20
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/session.d.ts +180 -14
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +1402 -281
- package/dist/hooks/session.js.map +1 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.js +6 -6
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +1 -1
- package/dist/hud/__tests__/index.test.js +26 -16
- package/dist/hud/__tests__/index.test.js.map +1 -1
- package/dist/hud/__tests__/reconcile.test.js +83 -78
- package/dist/hud/__tests__/reconcile.test.js.map +1 -1
- package/dist/hud/__tests__/state.test.js +36 -31
- package/dist/hud/__tests__/state.test.js.map +1 -1
- package/dist/hud/__tests__/tmux.test.js +155 -198
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/tmux.d.ts +42 -4
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +1017 -139
- package/dist/hud/tmux.js.map +1 -1
- package/dist/leader/__tests__/contract.test.js +71 -34
- package/dist/leader/__tests__/contract.test.js.map +1 -1
- package/dist/leader/contract.d.ts +1 -6
- package/dist/leader/contract.d.ts.map +1 -1
- package/dist/leader/contract.js +25 -24
- package/dist/leader/contract.js.map +1 -1
- package/dist/mcp/__tests__/hermes-bridge.test.js +17 -0
- package/dist/mcp/__tests__/hermes-bridge.test.js.map +1 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +4 -4
- package/dist/mcp/__tests__/state-paths.test.js +735 -4
- package/dist/mcp/__tests__/state-paths.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +1 -1
- package/dist/mcp/__tests__/state-server.test.js.map +1 -1
- package/dist/mcp/__tests__/trace-server.test.js +2 -2
- package/dist/mcp/__tests__/trace-server.test.js.map +1 -1
- package/dist/mcp/hermes-bridge.d.ts.map +1 -1
- package/dist/mcp/hermes-bridge.js +2 -2
- package/dist/mcp/hermes-bridge.js.map +1 -1
- package/dist/mcp/state-paths.d.ts +78 -4
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +543 -40
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/mcp/state-server.d.ts +4 -4
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/modes/__tests__/base-autopilot-gates.test.js +36 -7
- package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.js +1 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -1
- package/dist/modes/__tests__/base-session-scope.test.js +17 -8
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/base.d.ts +5 -5
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +76 -21
- package/dist/modes/base.js.map +1 -1
- package/dist/native-assets/archive.d.ts +17 -0
- package/dist/native-assets/archive.d.ts.map +1 -0
- package/dist/native-assets/archive.js +238 -0
- package/dist/native-assets/archive.js.map +1 -0
- package/dist/native-assets/policy.d.ts +42 -0
- package/dist/native-assets/policy.d.ts.map +1 -0
- package/dist/native-assets/policy.js +155 -0
- package/dist/native-assets/policy.js.map +1 -0
- package/dist/pipeline/__tests__/orchestrator.test.js +162 -40
- package/dist/pipeline/__tests__/orchestrator.test.js.map +1 -1
- package/dist/pipeline/__tests__/stages.test.js +66 -149
- package/dist/pipeline/__tests__/stages.test.js.map +1 -1
- package/dist/pipeline/orchestrator.d.ts.map +1 -1
- package/dist/pipeline/orchestrator.js +124 -18
- package/dist/pipeline/orchestrator.js.map +1 -1
- package/dist/pipeline/stages/ralplan.d.ts.map +1 -1
- package/dist/pipeline/stages/ralplan.js +36 -8
- package/dist/pipeline/stages/ralplan.js.map +1 -1
- package/dist/ralplan/__tests__/consensus-gate.test.js +70 -1437
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +1 -1
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js +328 -39
- package/dist/ralplan/__tests__/documented-leader-preflight.test.js.map +1 -1
- package/dist/ralplan/__tests__/runtime.test.js +82 -102
- package/dist/ralplan/__tests__/runtime.test.js.map +1 -1
- package/dist/ralplan/consensus-gate.d.ts +9 -1
- package/dist/ralplan/consensus-gate.d.ts.map +1 -1
- package/dist/ralplan/consensus-gate.js +40 -304
- package/dist/ralplan/consensus-gate.js.map +1 -1
- package/dist/ralplan/documented-leader-preflight.d.ts +15 -8
- package/dist/ralplan/documented-leader-preflight.d.ts.map +1 -1
- package/dist/ralplan/documented-leader-preflight.js +356 -54
- package/dist/ralplan/documented-leader-preflight.js.map +1 -1
- package/dist/ralplan/runtime.d.ts +1 -1
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +68 -173
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/runtime/run-state.d.ts +5 -1
- package/dist/runtime/run-state.d.ts.map +1 -1
- package/dist/runtime/run-state.js +15 -8
- package/dist/runtime/run-state.js.map +1 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +14071 -8859
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js +225 -0
- package/dist/scripts/__tests__/issue-3293-callsite-parity.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.js +188 -0
- package/dist/scripts/__tests__/issue-3293-cancel-transaction.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js +259 -0
- package/dist/scripts/__tests__/issue-3293-hook-owned-cancel.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js +491 -0
- package/dist/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js +708 -0
- package/dist/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js +208 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js.map +1 -0
- package/dist/scripts/__tests__/notify-state-io.test.js +26 -0
- package/dist/scripts/__tests__/notify-state-io.test.js.map +1 -1
- package/dist/scripts/__tests__/notify-tmux-injection.test.js +23 -1
- package/dist/scripts/__tests__/notify-tmux-injection.test.js.map +1 -1
- package/dist/scripts/__tests__/postinstall.test.js +19 -1
- package/dist/scripts/__tests__/postinstall.test.js.map +1 -1
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js +25 -8
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js.map +1 -1
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js +60 -25
- package/dist/scripts/__tests__/role-intent-durable-recovery-3181.test.js.map +1 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +155 -16
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +1 -1
- package/dist/scripts/__tests__/verify-native-release-assets.test.d.ts +2 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.js +235 -0
- package/dist/scripts/__tests__/verify-native-release-assets.test.js.map +1 -0
- package/dist/scripts/codex-native-hook.d.ts +50 -1
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +3559 -451
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/codex-native-pre-post.d.ts +9 -0
- package/dist/scripts/codex-native-pre-post.d.ts.map +1 -1
- package/dist/scripts/codex-native-pre-post.js +35 -12
- package/dist/scripts/codex-native-pre-post.js.map +1 -1
- package/dist/scripts/generate-native-release-manifest.js +80 -51
- package/dist/scripts/generate-native-release-manifest.js.map +1 -1
- package/dist/scripts/notify-fallback-watcher.js +28 -39
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/state-io.d.ts.map +1 -1
- package/dist/scripts/notify-hook/state-io.js +5 -0
- package/dist/scripts/notify-hook/state-io.js.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-leader-nudge.js +32 -3
- package/dist/scripts/notify-hook/team-leader-nudge.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker-stop.js +23 -3
- package/dist/scripts/notify-hook/team-worker-stop.js.map +1 -1
- package/dist/scripts/notify-hook/team-worker.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-worker.js +45 -5
- package/dist/scripts/notify-hook/team-worker.js.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.d.ts +1 -0
- package/dist/scripts/notify-hook/tmux-injection.d.ts.map +1 -1
- package/dist/scripts/notify-hook/tmux-injection.js +4 -1
- package/dist/scripts/notify-hook/tmux-injection.js.map +1 -1
- package/dist/scripts/notify-hook.js +78 -82
- package/dist/scripts/notify-hook.js.map +1 -1
- package/dist/scripts/postinstall-advisory.d.ts +14 -0
- package/dist/scripts/postinstall-advisory.d.ts.map +1 -0
- package/dist/scripts/postinstall-advisory.js +49 -0
- package/dist/scripts/postinstall-advisory.js.map +1 -0
- package/dist/scripts/postinstall.d.ts +1 -1
- package/dist/scripts/postinstall.d.ts.map +1 -1
- package/dist/scripts/postinstall.js +1 -1
- package/dist/scripts/postinstall.js.map +1 -1
- package/dist/scripts/smoke-packed-install.d.ts +32 -1
- package/dist/scripts/smoke-packed-install.d.ts.map +1 -1
- package/dist/scripts/smoke-packed-install.js +413 -60
- package/dist/scripts/smoke-packed-install.js.map +1 -1
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +16 -1
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/scripts/verify-native-release-assets.js +37 -23
- package/dist/scripts/verify-native-release-assets.js.map +1 -1
- package/dist/state/__tests__/mode-state-context.test.js +12 -5
- package/dist/state/__tests__/mode-state-context.test.js.map +1 -1
- package/dist/state/__tests__/operations.test.js +460 -850
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/skill-active.test.js +400 -2
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/mode-state-context.d.ts +3 -0
- package/dist/state/mode-state-context.d.ts.map +1 -1
- package/dist/state/mode-state-context.js +27 -13
- package/dist/state/mode-state-context.js.map +1 -1
- package/dist/state/operations.d.ts +3 -0
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +144 -40
- package/dist/state/operations.js.map +1 -1
- package/dist/state/skill-active.d.ts +18 -1
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +420 -23
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition-reconcile.d.ts +3 -0
- package/dist/state/workflow-transition-reconcile.d.ts.map +1 -1
- package/dist/state/workflow-transition-reconcile.js +10 -4
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/state/workflow-transition.d.ts.map +1 -1
- package/dist/state/workflow-transition.js +3 -1
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js +27 -0
- package/dist/subagents/__tests__/leader-bootstrap-3181.test.js.map +1 -1
- package/dist/subagents/__tests__/tracker.test.js +837 -1048
- package/dist/subagents/__tests__/tracker.test.js.map +1 -1
- package/dist/subagents/tracker.d.ts +64 -60
- package/dist/subagents/tracker.d.ts.map +1 -1
- package/dist/subagents/tracker.js +809 -358
- package/dist/subagents/tracker.js.map +1 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +6 -7
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +1 -1
- package/dist/team/__tests__/mcp-comm.test.js +104 -3
- package/dist/team/__tests__/mcp-comm.test.js.map +1 -1
- package/dist/team/__tests__/notice-ledger.test.d.ts +2 -0
- package/dist/team/__tests__/notice-ledger.test.d.ts.map +1 -0
- package/dist/team/__tests__/notice-ledger.test.js +131 -0
- package/dist/team/__tests__/notice-ledger.test.js.map +1 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.d.ts +2 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.d.ts.map +1 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.js +410 -0
- package/dist/team/__tests__/pane-teardown-residue-e2e.test.js.map +1 -0
- package/dist/team/__tests__/phase-controller.test.js +20 -0
- package/dist/team/__tests__/phase-controller.test.js.map +1 -1
- package/dist/team/__tests__/runtime.test.js +725 -59
- package/dist/team/__tests__/runtime.test.js.map +1 -1
- package/dist/team/__tests__/scaling.test.js +222 -237
- package/dist/team/__tests__/scaling.test.js.map +1 -1
- package/dist/team/__tests__/state-root.test.js +117 -2
- package/dist/team/__tests__/state-root.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +887 -92
- package/dist/team/__tests__/tmux-session.test.js.map +1 -1
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.d.ts +2 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.d.ts.map +1 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js +149 -0
- package/dist/team/__tests__/tmux-source-authority-realtmux.test.js.map +1 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts +69 -0
- package/dist/team/__tests__/tmux-test-fixture.d.ts.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.js +242 -15
- package/dist/team/__tests__/tmux-test-fixture.js.map +1 -1
- package/dist/team/__tests__/tmux-test-fixture.test.js +177 -1
- package/dist/team/__tests__/tmux-test-fixture.test.js.map +1 -1
- package/dist/team/__tests__/worker-runtime-identity.test.js +45 -72
- package/dist/team/__tests__/worker-runtime-identity.test.js.map +1 -1
- package/dist/team/notice-ledger.d.ts +54 -0
- package/dist/team/notice-ledger.d.ts.map +1 -0
- package/dist/team/notice-ledger.js +259 -0
- package/dist/team/notice-ledger.js.map +1 -0
- package/dist/team/phase-controller.d.ts.map +1 -1
- package/dist/team/phase-controller.js +2 -0
- package/dist/team/phase-controller.js.map +1 -1
- package/dist/team/runtime.d.ts +3 -1
- package/dist/team/runtime.d.ts.map +1 -1
- package/dist/team/runtime.js +314 -142
- package/dist/team/runtime.js.map +1 -1
- package/dist/team/scaling.d.ts.map +1 -1
- package/dist/team/scaling.js +161 -91
- package/dist/team/scaling.js.map +1 -1
- package/dist/team/state/monitor.d.ts +10 -0
- package/dist/team/state/monitor.d.ts.map +1 -1
- package/dist/team/state/monitor.js +13 -0
- package/dist/team/state/monitor.js.map +1 -1
- package/dist/team/state/types.d.ts +15 -0
- package/dist/team/state/types.d.ts.map +1 -1
- package/dist/team/state/types.js.map +1 -1
- package/dist/team/state-root.d.ts +12 -0
- package/dist/team/state-root.d.ts.map +1 -1
- package/dist/team/state-root.js +177 -0
- package/dist/team/state-root.js.map +1 -1
- package/dist/team/state.d.ts +18 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +36 -0
- package/dist/team/state.js.map +1 -1
- package/dist/team/tmux-session.d.ts +40 -4
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +513 -166
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/ultragoal/__tests__/artifacts.test.js +950 -2
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +1 -0
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +35 -1
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +232 -46
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/utils/__tests__/file-durability.test.js +58 -1
- package/dist/utils/__tests__/file-durability.test.js.map +1 -1
- package/dist/utils/__tests__/paths.test.js +21 -1
- package/dist/utils/__tests__/paths.test.js.map +1 -1
- package/dist/utils/file-durability.d.ts +10 -0
- package/dist/utils/file-durability.d.ts.map +1 -1
- package/dist/utils/file-durability.js +34 -4
- package/dist/utils/file-durability.js.map +1 -1
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +14 -6
- package/dist/utils/paths.js.map +1 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +49 -4
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +1 -1
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js +60 -0
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +1 -1
- package/dist/verification/__tests__/native-release-manifest.test.js +157 -4
- package/dist/verification/__tests__/native-release-manifest.test.js.map +1 -1
- package/package.json +13 -5
- package/plugins/oh-my-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/oh-my-codex/hooks/codex-native-hook.mjs +81 -17
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +13 -5
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +30 -85
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +5 -5
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +15 -17
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +3 -2
- package/skills/autopilot/SKILL.md +13 -5
- package/skills/cancel/SKILL.md +30 -85
- package/skills/ralph/SKILL.md +5 -5
- package/skills/ralplan/SKILL.md +15 -17
- package/skills/ultragoal/SKILL.md +3 -2
- package/src/scripts/__tests__/codex-native-hook.test.ts +6091 -540
- package/src/scripts/__tests__/issue-3293-callsite-parity.test.ts +187 -0
- package/src/scripts/__tests__/issue-3293-cancel-transaction.test.ts +189 -0
- package/src/scripts/__tests__/issue-3293-hook-owned-cancel.test.ts +187 -0
- package/src/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.ts +591 -0
- package/src/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.ts +701 -0
- package/src/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.ts +211 -0
- package/src/scripts/__tests__/notify-state-io.test.ts +29 -0
- package/src/scripts/__tests__/notify-tmux-injection.test.ts +26 -1
- package/src/scripts/__tests__/postinstall.test.ts +23 -1
- package/src/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.ts +27 -8
- package/src/scripts/__tests__/role-intent-durable-recovery-3181.test.ts +61 -27
- package/src/scripts/__tests__/smoke-packed-install.test.ts +209 -18
- package/src/scripts/__tests__/verify-native-release-assets.test.ts +240 -0
- package/src/scripts/codex-native-hook.ts +3638 -475
- package/src/scripts/codex-native-pre-post.ts +43 -12
- package/src/scripts/generate-native-release-manifest.ts +83 -79
- package/src/scripts/notify-fallback-watcher.ts +38 -38
- package/src/scripts/notify-hook/state-io.ts +11 -0
- package/src/scripts/notify-hook/team-leader-nudge.ts +32 -4
- package/src/scripts/notify-hook/team-worker-stop.ts +23 -4
- package/src/scripts/notify-hook/team-worker.ts +43 -5
- package/src/scripts/notify-hook/tmux-injection.ts +5 -1
- package/src/scripts/notify-hook.ts +83 -82
- package/src/scripts/postinstall-advisory.ts +67 -0
- package/src/scripts/postinstall.ts +1 -1
- package/src/scripts/smoke-packed-install.ts +446 -59
- package/src/scripts/sync-plugin-mirror.ts +17 -1
- package/src/scripts/verify-native-release-assets.ts +39 -31
- package/templates/AGENTS.md +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import assert from 'node:assert/strict';
|
|
2
2
|
import { chmodSync, existsSync, linkSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, symlinkSync, writeFileSync, } from 'node:fs';
|
|
3
3
|
import { tmpdir } from 'node:os';
|
|
4
|
-
import { delimiter, dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { delimiter, dirname, isAbsolute, join, resolve } from 'node:path';
|
|
5
5
|
import { spawn, spawnSync } from 'node:child_process';
|
|
6
6
|
import { pathToFileURL } from 'node:url';
|
|
7
7
|
import { TextDecoder } from 'node:util';
|
|
@@ -10,6 +10,7 @@ import { isManagedCodexHookCommand, planManagedCodexHooksRemoval } from '../conf
|
|
|
10
10
|
import { spawnPlatformCommand, spawnPlatformCommandSync, } from '../utils/platform-command.js';
|
|
11
11
|
import { ensureReusableNodeModules, } from '../utils/repo-deps.js';
|
|
12
12
|
import { escapeTomlString } from '../utils/toml.js';
|
|
13
|
+
import { sameFilePath } from '../utils/paths.js';
|
|
13
14
|
export { hasUsableNodeModules, resolveGitCommonDir, resolveReusableNodeModulesSource, } from '../utils/repo-deps.js';
|
|
14
15
|
export const PACKED_INSTALL_SMOKE_CORE_COMMANDS = [
|
|
15
16
|
['--help'],
|
|
@@ -135,13 +136,13 @@ export const PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS = [
|
|
|
135
136
|
{ name: 'doc-preserves-earlier', prompt: 'Use autopilot mode; "note"; use $ralplan is the workflow command.', expectedSkill: 'autopilot', expectedStopBlock: true },
|
|
136
137
|
{ name: 'doc-colon-followup', prompt: 'use $ralplan is the workflow command: use $autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true },
|
|
137
138
|
{ name: 'table-followup', prompt: 'Mode | Meaning\n--- | ---\nmanual | documentation\n$ralplan plan it', expectedSkill: 'ralplan', expectedStopBlock: true },
|
|
138
|
-
{ name: 'neg-advance-reopen', prompt: 'Do not run $ralplan but advance to $ultragoal', expectedSkill: 'ultragoal', expectedStopBlock: false },
|
|
139
|
-
{ name: 'neg-jump-reopen', prompt: 'Do not run $ralplan but jump straight to $ultragoal', expectedSkill: 'ultragoal', expectedStopBlock: false },
|
|
139
|
+
{ name: 'neg-advance-reopen', prompt: 'Do not run $ralplan but advance to $ultragoal', expectedSkill: 'ultragoal', expectedStopBlock: false, insideTmux: true },
|
|
140
|
+
{ name: 'neg-jump-reopen', prompt: 'Do not run $ralplan but jump straight to $ultragoal', expectedSkill: 'ultragoal', expectedStopBlock: false, insideTmux: true },
|
|
140
141
|
{ name: 'reference-plain-title', prompt: '[docs]: /target "title\nplain text"\n$ralplan plan it', expectedSkill: 'ralplan', expectedStopBlock: true },
|
|
141
142
|
{ name: 'reference-plain-destination', prompt: '[docs]: ./target\n$ralplan plan it', expectedSkill: 'ralplan', expectedStopBlock: true },
|
|
142
143
|
{ name: 'directive-use-the', prompt: 'Do not run $ralplan; use the $autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true },
|
|
143
144
|
{ name: 'directive-continue-after-quote', prompt: '"quoted"\ncontinue with $ralplan', expectedSkill: 'ralplan', expectedStopBlock: true },
|
|
144
|
-
{ name: 'doc-advance-followup', prompt: 'use $ralplan is the workflow command; advance to $ultragoal', expectedSkill: 'ultragoal', expectedStopBlock: false },
|
|
145
|
+
{ name: 'doc-advance-followup', prompt: 'use $ralplan is the workflow command; advance to $ultragoal', expectedSkill: 'ultragoal', expectedStopBlock: false, insideTmux: true },
|
|
145
146
|
{ name: 'directive-run-code-review', prompt: 'run $code-review', expectedSkill: 'code-review', expectedStopBlock: false },
|
|
146
147
|
{ name: 'directive-documentation', prompt: 'use $ralplan is the consensus-planning command', expectedSkill: null, expectedStopBlock: false },
|
|
147
148
|
{ name: 'nested-bounded-child-unbounded-parent', prompt: '"`x`\n$ralplan plan it', expectedSkill: null, expectedStopBlock: false },
|
|
@@ -173,11 +174,26 @@ export const PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS = [
|
|
|
173
174
|
{ name: 'percent-suffix', prompt: '$ralplan%docs', expectedSkill: null, expectedStopBlock: false },
|
|
174
175
|
{ name: 'fullwidth-percent-suffix', prompt: '$ralplan%docs', expectedSkill: null, expectedStopBlock: false },
|
|
175
176
|
{ name: 'g1a-ordered-multi-skill', prompt: '$ralplan, $autopilot; $team', expectedSkill: 'ralplan', expectedStopBlock: true, expectedDeferredSkills: ['autopilot', 'team'], expectedActiveSkills: ['ralplan'], insideTmux: true },
|
|
176
|
-
{ name: 'g1c-duplicate-alias', prompt: '$autopilot $oh-my-codex:autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true, expectedDeferredSkills: [], expectedActiveSkills: [
|
|
177
|
+
{ name: 'g1c-duplicate-alias', prompt: '$autopilot $oh-my-codex:autopilot build it', expectedSkill: 'autopilot', expectedStopBlock: true, expectedDeferredSkills: [], expectedActiveSkills: [] },
|
|
177
178
|
{ name: 'b3-longer-valid-fence', prompt: '```text\n$autopilot build it\n````\n$ralplan plan it', expectedSkill: 'ralplan', expectedStopBlock: true },
|
|
178
179
|
{ name: 'b4-shorter-invalid-fence', prompt: '````text\n$autopilot build it\n```\n$ralplan plan it', expectedSkill: null, expectedStopBlock: false },
|
|
179
180
|
{ name: 'b5-different-marker-invalid-fence', prompt: '```text\n$autopilot build it\n~~~\n$ralplan plan it', expectedSkill: null, expectedStopBlock: false },
|
|
180
181
|
];
|
|
182
|
+
export function assertPackedRegressionWorkflowState(testCase, skillState) {
|
|
183
|
+
const matchesExpectedState = testCase.expectedSkill === 'autopilot'
|
|
184
|
+
? skillState.active === false
|
|
185
|
+
&& skillState.skill === 'autopilot'
|
|
186
|
+
&& skillState.phase === 'failed'
|
|
187
|
+
&& skillState.error === 'documented_host_consensus_receipt_unavailable'
|
|
188
|
+
&& skillState.active_skills?.length === 0
|
|
189
|
+
: skillState.active === true && skillState.skill === testCase.expectedSkill;
|
|
190
|
+
if (!matchesExpectedState) {
|
|
191
|
+
throw new Error(`packed regression ${testCase.name} persisted unexpected workflow state`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
export function shouldPackedRegressionStopBlock(testCase) {
|
|
195
|
+
return testCase.expectedSkill === 'autopilot' ? false : testCase.expectedStopBlock;
|
|
196
|
+
}
|
|
181
197
|
export function buildPackedRegressionEnvironment(testCase, baseEnv = process.env) {
|
|
182
198
|
const insideTmux = testCase.insideTmux === true;
|
|
183
199
|
return {
|
|
@@ -1017,15 +1033,74 @@ export const PACKED_INSTALL_PLUGIN_MCP_TARGETS = [
|
|
|
1017
1033
|
['omx_hermes', 'hermes', 'omx-hermes'],
|
|
1018
1034
|
];
|
|
1019
1035
|
const PACKED_INSTALL_OPERATIONAL_PROBE_TIMEOUT_MS = 5_000;
|
|
1020
|
-
|
|
1036
|
+
const PACKED_INSTALL_COMMAND_TIMEOUT_MS = 120_000;
|
|
1037
|
+
function runtimeBinaryName(platform) {
|
|
1038
|
+
return platform === 'win32' ? 'omx-runtime.exe' : 'omx-runtime';
|
|
1039
|
+
}
|
|
1040
|
+
function validatePackedSmokeRuntimeBinary(candidate, platform) {
|
|
1041
|
+
if (!isAbsolute(candidate)) {
|
|
1042
|
+
throw new Error(`packed smoke runtime override must be absolute: ${candidate}`);
|
|
1043
|
+
}
|
|
1044
|
+
let stats;
|
|
1045
|
+
try {
|
|
1046
|
+
stats = statSync(candidate);
|
|
1047
|
+
}
|
|
1048
|
+
catch {
|
|
1049
|
+
throw new Error(`packed smoke requires omx-runtime at "${candidate}"; run "npm run build:runtime"`);
|
|
1050
|
+
}
|
|
1051
|
+
if (!stats.isFile() || (platform !== 'win32' && (stats.mode & 0o111) === 0)) {
|
|
1052
|
+
throw new Error(`packed smoke runtime must be an executable regular file: ${candidate}`);
|
|
1053
|
+
}
|
|
1054
|
+
return candidate;
|
|
1055
|
+
}
|
|
1056
|
+
export function resolvePackedSmokeRuntimeBinary(repoRoot = process.cwd(), options = {}) {
|
|
1057
|
+
const platform = options.platform ?? process.platform;
|
|
1058
|
+
const candidate = options.candidate ?? resolve(join(repoRoot, 'target', 'debug', runtimeBinaryName(platform)));
|
|
1059
|
+
return validatePackedSmokeRuntimeBinary(candidate, platform);
|
|
1060
|
+
}
|
|
1061
|
+
export function buildPackedProbeEnv(overrides = {}, options = {}) {
|
|
1021
1062
|
const env = { ...process.env };
|
|
1022
1063
|
for (const key of Object.keys(env)) {
|
|
1023
1064
|
const upper = key.toUpperCase();
|
|
1024
|
-
if (upper === 'NODE_OPTIONS'
|
|
1065
|
+
if (upper === 'NODE_OPTIONS'
|
|
1066
|
+
|| upper === 'BASH_ENV'
|
|
1067
|
+
|| upper === 'ENV'
|
|
1068
|
+
|| upper === 'ZDOTDIR'
|
|
1069
|
+
|| upper.startsWith('OMX_')
|
|
1070
|
+
|| upper.startsWith('CODEX_')
|
|
1071
|
+
|| upper.startsWith('GJC_')
|
|
1072
|
+
|| upper === 'TMUX'
|
|
1073
|
+
|| upper === 'TMUX_PANE') {
|
|
1025
1074
|
delete env[key];
|
|
1026
1075
|
}
|
|
1027
1076
|
}
|
|
1028
|
-
|
|
1077
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
1078
|
+
if (value === undefined)
|
|
1079
|
+
delete env[key];
|
|
1080
|
+
else
|
|
1081
|
+
env[key] = value;
|
|
1082
|
+
}
|
|
1083
|
+
if (options.runtimeBinary === null) {
|
|
1084
|
+
delete env.OMX_RUNTIME_BINARY;
|
|
1085
|
+
}
|
|
1086
|
+
else {
|
|
1087
|
+
env.OMX_RUNTIME_BINARY = options.runtimeBinary === undefined
|
|
1088
|
+
? resolvePackedSmokeRuntimeBinary(options.repoRoot)
|
|
1089
|
+
: validatePackedSmokeRuntimeBinary(options.runtimeBinary, process.platform);
|
|
1090
|
+
}
|
|
1091
|
+
return env;
|
|
1092
|
+
}
|
|
1093
|
+
export function replacePathKeyCaseInsensitive(env, value) {
|
|
1094
|
+
const result = { ...env };
|
|
1095
|
+
let pathKey;
|
|
1096
|
+
for (const key of Object.keys(result)) {
|
|
1097
|
+
if (key.toUpperCase() !== 'PATH')
|
|
1098
|
+
continue;
|
|
1099
|
+
pathKey ??= key;
|
|
1100
|
+
delete result[key];
|
|
1101
|
+
}
|
|
1102
|
+
result[pathKey ?? 'PATH'] = value;
|
|
1103
|
+
return result;
|
|
1029
1104
|
}
|
|
1030
1105
|
export const PACKED_INSTALL_REQUIRED_ARTIFACT_PATHS = [
|
|
1031
1106
|
'dist/config/models.js',
|
|
@@ -1241,12 +1316,29 @@ function assertInstalledPluginHookLauncherContract(hookSource) {
|
|
|
1241
1316
|
/\.stdin\s*\.end\s*\(\s*input\s*\)/,
|
|
1242
1317
|
'forward the hook input to the delegate stdin',
|
|
1243
1318
|
],
|
|
1319
|
+
[
|
|
1320
|
+
/['"]omx-plugin-hook-routing-only:v1['"]/,
|
|
1321
|
+
'declare the routing-only discriminator contract',
|
|
1322
|
+
],
|
|
1244
1323
|
];
|
|
1245
1324
|
for (const [pattern, requirement] of requiredShape) {
|
|
1246
1325
|
if (!pattern.test(hookSource)) {
|
|
1247
1326
|
throw new Error(`installed plugin native hook launcher must ${requirement}`);
|
|
1248
1327
|
}
|
|
1249
1328
|
}
|
|
1329
|
+
for (const forbidden of [
|
|
1330
|
+
/native-anchor-auth\.key/,
|
|
1331
|
+
/\bcreateHmac\b/,
|
|
1332
|
+
/\brandomBytes\b/,
|
|
1333
|
+
/\bsignLaunchClaim\b/,
|
|
1334
|
+
/\bplugin-hook-launches\b/,
|
|
1335
|
+
/\bHMAC\b/i,
|
|
1336
|
+
/signed.?claim/i,
|
|
1337
|
+
]) {
|
|
1338
|
+
if (forbidden.test(hookSource)) {
|
|
1339
|
+
throw new Error(`installed plugin native hook launcher retains forbidden authority path: ${forbidden.source}`);
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1250
1342
|
}
|
|
1251
1343
|
export function assertInstalledPluginSurface(packageRoot) {
|
|
1252
1344
|
const pluginManifest = readInstalledPluginManifest(packageRoot, 'plugins/oh-my-codex/.codex-plugin/plugin.json');
|
|
@@ -1392,7 +1484,7 @@ async function assertInstalledReasoningArtifacts(packageRoot) {
|
|
|
1392
1484
|
function smokeInstalledRootReasoningRejections(omxPath, cwd) {
|
|
1393
1485
|
const codexHome = mkdtempSync(join(tmpdir(), 'omx-packed-root-reasoning-'));
|
|
1394
1486
|
try {
|
|
1395
|
-
const env = buildPackedProbeEnv({ CODEX_HOME: codexHome });
|
|
1487
|
+
const env = buildPackedProbeEnv({ CODEX_HOME: codexHome }, { runtimeBinary: null });
|
|
1396
1488
|
const configPath = join(codexHome, 'config.toml');
|
|
1397
1489
|
const usageResult = spawnSync(omxPath, ['reasoning'], { cwd, encoding: 'utf-8', env });
|
|
1398
1490
|
if (usageResult.status !== 0) {
|
|
@@ -1439,7 +1531,12 @@ function readFakeCodexLaunches(capturePath) {
|
|
|
1439
1531
|
return [];
|
|
1440
1532
|
return parseFakeCodexLaunches(readFileSync(capturePath, 'utf-8'));
|
|
1441
1533
|
}
|
|
1442
|
-
function
|
|
1534
|
+
export function assertPackedLaunchCwdPreserved(expectedCwd, receivedCwd, message) {
|
|
1535
|
+
if (!sameFilePath(expectedCwd, receivedCwd)) {
|
|
1536
|
+
throw new Error(`${message}: expected ${expectedCwd}, received ${receivedCwd}`);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
function smokeInstalledLaunchArgumentBoundary(omxPath, runtimeBinary) {
|
|
1443
1540
|
const smokeRoot = mkdtempSync(join(tmpdir(), 'omx-packed-launch-boundary-'));
|
|
1444
1541
|
const modelInstructionsPath = join(smokeRoot, 'model-instructions.md');
|
|
1445
1542
|
try {
|
|
@@ -1495,7 +1592,7 @@ function smokeInstalledLaunchArgumentBoundary(omxPath) {
|
|
|
1495
1592
|
OMX_MODEL_INSTRUCTIONS_FILE: modelInstructionsPath,
|
|
1496
1593
|
OMX_LAUNCH_POLICY: 'direct',
|
|
1497
1594
|
OMX_PACKED_FAKE_CODEX_CAPTURE_PATH: capturePath,
|
|
1498
|
-
});
|
|
1595
|
+
}, { runtimeBinary });
|
|
1499
1596
|
delete env.OMX_NOTIFY_TEMP_CONTRACT;
|
|
1500
1597
|
delete env.OMX_TEAM_WORKER_LAUNCH_ARGS;
|
|
1501
1598
|
writeFileSync(modelInstructionsPath, '# Packed launch boundary instructions\n');
|
|
@@ -1542,9 +1639,7 @@ function smokeInstalledLaunchArgumentBoundary(omxPath) {
|
|
|
1542
1639
|
throw new Error(`omx must launch exactly one fake Codex process: ${JSON.stringify(launches)}`);
|
|
1543
1640
|
}
|
|
1544
1641
|
assert.deepStrictEqual(launch.argv, expectedCodexArgs, 'omx must inject model instructions before -- and preserve exact post-marker argument boundaries');
|
|
1545
|
-
|
|
1546
|
-
throw new Error(`omx must not change cwd for post-marker arguments: expected ${launchCwd}, received ${launch.cwd}`);
|
|
1547
|
-
}
|
|
1642
|
+
assertPackedLaunchCwdPreserved(launchCwd, launch.cwd, 'omx must not change cwd for post-marker arguments');
|
|
1548
1643
|
if (launch.OMX_NOTIFY_TEMP_CONTRACT !== null) {
|
|
1549
1644
|
throw new Error(`omx must not activate temporary notification routing for post-marker arguments: ${JSON.stringify(launch)}`);
|
|
1550
1645
|
}
|
|
@@ -1674,9 +1769,7 @@ function smokeInstalledLaunchArgumentBoundary(omxPath) {
|
|
|
1674
1769
|
`model_instructions_file="${escapeTomlString(modelInstructionsPath)}"`,
|
|
1675
1770
|
...twoMarkerArgs.slice(1),
|
|
1676
1771
|
], 'the first literal -- must terminate OMX parsing and preserve every later argv element');
|
|
1677
|
-
|
|
1678
|
-
throw new Error(`the first literal -- must preserve launch cwd: expected ${launchCwd}, received ${twoMarkerLaunch.cwd}`);
|
|
1679
|
-
}
|
|
1772
|
+
assertPackedLaunchCwdPreserved(launchCwd, twoMarkerLaunch.cwd, 'the first literal -- must preserve launch cwd');
|
|
1680
1773
|
if (twoMarkerLaunch.OMX_NOTIFY_TEMP_CONTRACT !== null) {
|
|
1681
1774
|
throw new Error(`the first literal -- must not activate notification routing: ${JSON.stringify(twoMarkerLaunch)}`);
|
|
1682
1775
|
}
|
|
@@ -1692,6 +1785,7 @@ function usage() {
|
|
|
1692
1785
|
return [
|
|
1693
1786
|
'Usage: node scripts/smoke-packed-install.mjs',
|
|
1694
1787
|
'',
|
|
1788
|
+
' --fail-closed-probe install the package, assert the runtime-absent fail-closed denial, and exit',
|
|
1695
1789
|
'Creates an npm tarball, installs it into an isolated prefix, and smoke tests the installed omx CLI.',
|
|
1696
1790
|
'Release smoke validates installed CLI boot, native-hook dispatch, packaged artifacts, installed reasoning boundaries, and the isolated setup/rerun/uninstall lifecycle; Codex trust checks run when the pinned CLI is present.',
|
|
1697
1791
|
].join('\n');
|
|
@@ -1729,21 +1823,32 @@ export function ensureRepoDependencies(repoRoot, options = {}) {
|
|
|
1729
1823
|
nodeModulesPath: join(repoRoot, 'node_modules'),
|
|
1730
1824
|
};
|
|
1731
1825
|
}
|
|
1732
|
-
function parseArgs(argv) {
|
|
1826
|
+
export function parseArgs(argv) {
|
|
1827
|
+
let failClosedProbe = false;
|
|
1733
1828
|
for (const token of argv) {
|
|
1734
1829
|
if (token === '--help' || token === '-h') {
|
|
1735
1830
|
console.log(usage());
|
|
1736
1831
|
process.exit(0);
|
|
1737
1832
|
}
|
|
1833
|
+
if (token === '--fail-closed-probe') {
|
|
1834
|
+
failClosedProbe = true;
|
|
1835
|
+
continue;
|
|
1836
|
+
}
|
|
1738
1837
|
throw new Error(`Unknown argument: ${token}\n${usage()}`);
|
|
1739
1838
|
}
|
|
1839
|
+
return { failClosedProbe };
|
|
1740
1840
|
}
|
|
1741
1841
|
function run(cmd, args, options = {}) {
|
|
1742
1842
|
const result = spawnSync(cmd, [...args], {
|
|
1743
1843
|
encoding: 'utf-8',
|
|
1744
1844
|
stdio: 'pipe',
|
|
1845
|
+
timeout: PACKED_INSTALL_COMMAND_TIMEOUT_MS,
|
|
1846
|
+
killSignal: 'SIGKILL',
|
|
1745
1847
|
...options,
|
|
1746
1848
|
});
|
|
1849
|
+
if (result.error?.code === 'ETIMEDOUT') {
|
|
1850
|
+
throw new Error(`${cmd} ${args.join(' ')} exceeded ${PACKED_INSTALL_COMMAND_TIMEOUT_MS}ms`);
|
|
1851
|
+
}
|
|
1747
1852
|
if (result.status !== 0) {
|
|
1748
1853
|
throw new Error(formatCommandFailure(cmd, [...args], result));
|
|
1749
1854
|
}
|
|
@@ -1845,7 +1950,7 @@ function requireNativeHookPermissionDeny(probe, output, reason) {
|
|
|
1845
1950
|
throw new Error(`native hook ${probe} denial did not match ${reason.source}`);
|
|
1846
1951
|
}
|
|
1847
1952
|
}
|
|
1848
|
-
function smokeInstalledNativeHookDist(prefixDir) {
|
|
1953
|
+
function smokeInstalledNativeHookDist(prefixDir, runtimeBinary) {
|
|
1849
1954
|
function runPackedTransportRegressions(hookScript, smokeCwd) {
|
|
1850
1955
|
const invoke = (cwd, environment, payload) => run(process.execPath, [realpathSync(hookScript)], {
|
|
1851
1956
|
cwd, env: environment, input: JSON.stringify(payload),
|
|
@@ -1932,7 +2037,7 @@ function smokeInstalledNativeHookDist(prefixDir) {
|
|
|
1932
2037
|
const g2cPayload = { ...PACKED_CODEX_01445_NO_POINTER_NO_TRACKER_FIXTURE, cwd: g2cCwd };
|
|
1933
2038
|
const g2cResult = invoke(g2cCwd, buildPackedRegressionEnvironment({ name: 'g2c-01445' }), g2cPayload);
|
|
1934
2039
|
const g2cStdout = String(g2cResult.stdout || '');
|
|
1935
|
-
const g2cExpected = '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"unsupported_documented_leader_proof: Codex
|
|
2040
|
+
const g2cExpected = '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"unsupported_documented_leader_proof: Codex hooks do not expose a documented, non-user-mintable root identity required for adapted Ralplan."}}\n';
|
|
1936
2041
|
if (g2cStdout !== g2cExpected)
|
|
1937
2042
|
throw new Error('packed Codex 0.144.5 fixture returned unexpected PreToolUse bytes');
|
|
1938
2043
|
if (existsSync(join(g2cCwd, '.omx', 'state')))
|
|
@@ -1953,11 +2058,49 @@ function smokeInstalledNativeHookDist(prefixDir) {
|
|
|
1953
2058
|
OMX_SESSION_ID: `packed-install-smoke-${eventName}`,
|
|
1954
2059
|
OMX_SOURCE_CWD: smokeCwd,
|
|
1955
2060
|
OMX_STARTUP_CWD: smokeCwd,
|
|
1956
|
-
}),
|
|
2061
|
+
}, { runtimeBinary: null }),
|
|
1957
2062
|
input: JSON.stringify(payload),
|
|
1958
2063
|
});
|
|
1959
2064
|
validateHookStdout(eventName, result.stdout);
|
|
1960
2065
|
}
|
|
2066
|
+
const collaborationCwd = join(smokeCwd, 'flattened-collaboration-nested-lifecycle');
|
|
2067
|
+
mkdirSync(collaborationCwd, { recursive: true });
|
|
2068
|
+
const collaborationResult = run(process.execPath, [realpathSync(hookScript)], {
|
|
2069
|
+
cwd: collaborationCwd,
|
|
2070
|
+
env: buildPackedProbeEnv({
|
|
2071
|
+
OMX_SOURCE_CWD: collaborationCwd,
|
|
2072
|
+
OMX_STARTUP_CWD: collaborationCwd,
|
|
2073
|
+
}, { runtimeBinary: null }),
|
|
2074
|
+
input: JSON.stringify({
|
|
2075
|
+
hook_event_name: 'PostToolUse',
|
|
2076
|
+
cwd: collaborationCwd,
|
|
2077
|
+
session_id: 'packed-flattened-collaboration-nested-lifecycle',
|
|
2078
|
+
thread_id: 'packed-flattened-collaboration-nested-lifecycle-thread',
|
|
2079
|
+
tool_name: 'collaborationlist_agents',
|
|
2080
|
+
tool_response: {
|
|
2081
|
+
agents: [
|
|
2082
|
+
{ agent_name: '/root', agent_status: 'running' },
|
|
2083
|
+
{
|
|
2084
|
+
agent_name: '/root/reviewer',
|
|
2085
|
+
agent_status: {
|
|
2086
|
+
completed: 'Child report discusses an unavailable and unsupported optional adapter.',
|
|
2087
|
+
},
|
|
2088
|
+
},
|
|
2089
|
+
],
|
|
2090
|
+
},
|
|
2091
|
+
}),
|
|
2092
|
+
});
|
|
2093
|
+
if (collaborationResult.status !== 0 || String(collaborationResult.stderr) !== '') {
|
|
2094
|
+
throw new Error('packed flattened collaboration nested lifecycle hook invocation failed');
|
|
2095
|
+
}
|
|
2096
|
+
validateHookStdout('PostToolUse', String(collaborationResult.stdout));
|
|
2097
|
+
const collaborationStateDir = join(collaborationCwd, '.omx', 'state');
|
|
2098
|
+
if (existsSync(join(collaborationStateDir, 'native-subagent-support.json'))) {
|
|
2099
|
+
throw new Error('packed flattened collaboration nested lifecycle persisted a native support blocker');
|
|
2100
|
+
}
|
|
2101
|
+
if (existsSync(join(collaborationStateDir, 'native-subagent-capacity-blocker.json'))) {
|
|
2102
|
+
throw new Error('packed flattened collaboration nested lifecycle persisted a capacity blocker');
|
|
2103
|
+
}
|
|
1961
2104
|
const pluginHookScript = join(packageRoot, 'plugins', 'oh-my-codex', 'hooks', 'codex-native-hook.mjs');
|
|
1962
2105
|
const pluginChildScript = join(smokeCwd, 'packed-plugin-oversized-child.mjs');
|
|
1963
2106
|
const pluginLauncher = join(smokeCwd, process.platform === 'win32' ? 'packed-plugin-oversized.cmd' : 'packed-plugin-oversized.sh');
|
|
@@ -2086,13 +2229,15 @@ function smokeInstalledNativeHookDist(prefixDir) {
|
|
|
2086
2229
|
worktree_path: smokeCwd,
|
|
2087
2230
|
}));
|
|
2088
2231
|
const invokeAuthorizationProbe = (payload, env) => run(process.execPath, [realpathSync(hookScript)], { cwd: smokeCwd, env, input: JSON.stringify(payload) });
|
|
2089
|
-
const hookEnv = {
|
|
2090
|
-
|
|
2232
|
+
const hookEnv = buildPackedProbeEnv({
|
|
2233
|
+
BASH_ENV: undefined,
|
|
2234
|
+
ENV: undefined,
|
|
2235
|
+
ZDOTDIR: undefined,
|
|
2091
2236
|
OMX_NATIVE_HOOK_DOCTOR_SMOKE: '1',
|
|
2092
2237
|
OMX_ROOT: hookRoot,
|
|
2093
2238
|
OMX_SOURCE_CWD: smokeCwd,
|
|
2094
2239
|
OMX_STARTUP_CWD: smokeCwd,
|
|
2095
|
-
};
|
|
2240
|
+
}, { runtimeBinary: null });
|
|
2096
2241
|
const officialTeamRootPayload = {
|
|
2097
2242
|
hook_event_name: 'PreToolUse',
|
|
2098
2243
|
cwd: smokeCwd,
|
|
@@ -2128,6 +2273,11 @@ function smokeInstalledNativeHookDist(prefixDir) {
|
|
|
2128
2273
|
OMX_TEAM_STATE_ROOT: '',
|
|
2129
2274
|
};
|
|
2130
2275
|
const runActorProbeResult = (actor, probe, toolName, toolInput, inheritedEnv = {}) => {
|
|
2276
|
+
const probeEnv = { ...childEnv, ...inheritedEnv };
|
|
2277
|
+
for (const [key, value] of Object.entries(probeEnv)) {
|
|
2278
|
+
if (value === undefined)
|
|
2279
|
+
delete probeEnv[key];
|
|
2280
|
+
}
|
|
2131
2281
|
const result = invokeAuthorizationProbe({
|
|
2132
2282
|
hook_event_name: 'PreToolUse',
|
|
2133
2283
|
cwd: smokeCwd,
|
|
@@ -2138,7 +2288,7 @@ function smokeInstalledNativeHookDist(prefixDir) {
|
|
|
2138
2288
|
tool_name: toolName,
|
|
2139
2289
|
tool_use_id: `packed-install-${actor}-${probe.replace(/\W+/g, '-')}`,
|
|
2140
2290
|
tool_input: toolInput,
|
|
2141
|
-
},
|
|
2291
|
+
}, probeEnv);
|
|
2142
2292
|
const stdout = String(result.stdout);
|
|
2143
2293
|
return { output: parseNativeHookSmokeOutput(`PreToolUse ${actor} ${probe}`, stdout), stdout };
|
|
2144
2294
|
};
|
|
@@ -2305,10 +2455,10 @@ function smokeInstalledNativeHookDist(prefixDir) {
|
|
|
2305
2455
|
hook_event_name: 'PreToolUse',
|
|
2306
2456
|
cwd: smokeCwd,
|
|
2307
2457
|
session_id: leaderAgentId,
|
|
2308
|
-
tool_name: '
|
|
2458
|
+
tool_name: 'mcp__omx_wiki__wiki_delete',
|
|
2309
2459
|
tool_use_id: 'packed-install-identityless-native-session-remote-mutation',
|
|
2310
|
-
tool_input: {
|
|
2311
|
-
}, childEnv).stdout)), /Main-root Conductor mode is active/);
|
|
2460
|
+
tool_input: { path: 'src/session-bypass.ts' },
|
|
2461
|
+
}, childEnv).stdout)), /OWNER_CONFIRMATION_REQUIRED|Main-root Conductor mode is active/);
|
|
2312
2462
|
if (Object.keys(runActorProbe('main-root', 'finite cp metadata leaf control', 'Bash', {
|
|
2313
2463
|
command: 'cp .omx/state/payload .omx/handoffs/run-1/payload',
|
|
2314
2464
|
})).length !== 0) {
|
|
@@ -2331,9 +2481,18 @@ function smokeInstalledNativeHookDist(prefixDir) {
|
|
|
2331
2481
|
}
|
|
2332
2482
|
if (Object.keys(runActorProbe('main-root', 'zsh fast startup control', 'Bash', {
|
|
2333
2483
|
command: `zsh -f -c ':'`,
|
|
2334
|
-
})).length !== 0) {
|
|
2484
|
+
}, { OMX_RUNTIME_BINARY: runtimeBinary })).length !== 0) {
|
|
2335
2485
|
throw new Error('packed main-root zsh fast startup control should be allowed');
|
|
2336
2486
|
}
|
|
2487
|
+
if (Object.keys(runActorProbe('main-root', 'zsh fast startup control ambient startup environment', 'Bash', {
|
|
2488
|
+
command: `zsh -f -c ':'`,
|
|
2489
|
+
}, {
|
|
2490
|
+
OMX_RUNTIME_BINARY: runtimeBinary,
|
|
2491
|
+
ENV: '/dev/null',
|
|
2492
|
+
ZDOTDIR: join(smokeCwd, '.omx', 'state', 'zsh-home'),
|
|
2493
|
+
})).length !== 0) {
|
|
2494
|
+
throw new Error('packed main-root zsh fast startup control should remain allowed with ambient shell-startup environment');
|
|
2495
|
+
}
|
|
2337
2496
|
const boxedPlanningRoot = join(smokeCwd, 'boxed-planning-root');
|
|
2338
2497
|
const boxedPlanningStateDir = join(boxedPlanningRoot, '.omx', 'state');
|
|
2339
2498
|
const boxedPlanningStatePath = join(boxedPlanningStateDir, 'sessions', leaderAgentId, 'ralplan-state.json');
|
|
@@ -3093,6 +3252,81 @@ PY`],
|
|
|
3093
3252
|
symlinkSync(workspacePackageCli, packedNpmOmxShim);
|
|
3094
3253
|
const packedNpmPath = `${packedNpmBinDir}:${process.env.PATH || '/usr/bin:/bin'}`;
|
|
3095
3254
|
const packedNpmCommandPrefix = `PATH="${packedNpmBinDir}:/usr/bin:/bin"`;
|
|
3255
|
+
const packedCancelCwd = join(smokeCwd, 'issue-3280-packed-cancel');
|
|
3256
|
+
const packedCancelStateDir = join(packedCancelCwd, '.omx', 'state');
|
|
3257
|
+
const packedCancelSessionId = 'issue-3280-current';
|
|
3258
|
+
const packedCancelNativeId = 'issue-3280-native';
|
|
3259
|
+
const packedCancelStaleOwner = 'issue-3280-stale';
|
|
3260
|
+
const packedCancelSessionDir = join(packedCancelStateDir, 'sessions', packedCancelSessionId);
|
|
3261
|
+
mkdirSync(packedCancelSessionDir, { recursive: true });
|
|
3262
|
+
writeFileSync(join(packedCancelStateDir, 'session.json'), JSON.stringify({
|
|
3263
|
+
session_id: packedCancelSessionId,
|
|
3264
|
+
native_session_id: packedCancelNativeId,
|
|
3265
|
+
cwd: packedCancelCwd,
|
|
3266
|
+
state_root: packedCancelStateDir,
|
|
3267
|
+
}));
|
|
3268
|
+
const packedCancelOwnerDir = join(packedCancelStateDir, 'sessions', packedCancelNativeId);
|
|
3269
|
+
mkdirSync(packedCancelOwnerDir, { recursive: true });
|
|
3270
|
+
writeFileSync(join(packedCancelOwnerDir, 'session-owner.json'), JSON.stringify({
|
|
3271
|
+
session_id: packedCancelNativeId,
|
|
3272
|
+
native_session_id: packedCancelNativeId,
|
|
3273
|
+
cwd: packedCancelCwd,
|
|
3274
|
+
platform: process.platform,
|
|
3275
|
+
}));
|
|
3276
|
+
writeFileSync(join(packedCancelSessionDir, 'skill-active-state.json'), JSON.stringify({
|
|
3277
|
+
active: true,
|
|
3278
|
+
skill: 'ultragoal',
|
|
3279
|
+
session_id: packedCancelSessionId,
|
|
3280
|
+
owner_codex_session_id: packedCancelStaleOwner,
|
|
3281
|
+
active_skills: [{
|
|
3282
|
+
skill: 'ultragoal',
|
|
3283
|
+
active: true,
|
|
3284
|
+
session_id: packedCancelSessionId,
|
|
3285
|
+
owner_codex_session_id: packedCancelNativeId,
|
|
3286
|
+
}],
|
|
3287
|
+
}, null, 2));
|
|
3288
|
+
writeFileSync(join(packedCancelSessionDir, 'ultragoal-state.json'), JSON.stringify({
|
|
3289
|
+
active: true,
|
|
3290
|
+
mode: 'ultragoal',
|
|
3291
|
+
session_id: packedCancelSessionId,
|
|
3292
|
+
}, null, 2));
|
|
3293
|
+
const packedCancelHookResult = invokeAuthorizationProbe({
|
|
3294
|
+
hook_event_name: 'PreToolUse',
|
|
3295
|
+
cwd: packedCancelCwd,
|
|
3296
|
+
session_id: packedCancelSessionId,
|
|
3297
|
+
agent_id: packedCancelNativeId,
|
|
3298
|
+
thread_id: packedCancelNativeId,
|
|
3299
|
+
tool_name: 'Bash',
|
|
3300
|
+
tool_use_id: 'packed-install-issue-3280-cancel',
|
|
3301
|
+
tool_input: { command: 'omx cancel --force' },
|
|
3302
|
+
}, {
|
|
3303
|
+
...childEnv,
|
|
3304
|
+
OMX_ROOT: packedCancelCwd,
|
|
3305
|
+
OMX_SOURCE_CWD: packedCancelCwd,
|
|
3306
|
+
OMX_STARTUP_CWD: packedCancelCwd,
|
|
3307
|
+
PATH: packedNpmPath,
|
|
3308
|
+
NODE_EXTRA_CA_CERTS: '/nonexistent/enterprise-ca.pem',
|
|
3309
|
+
});
|
|
3310
|
+
if (Object.keys(parseNativeHookSmokeOutput('PreToolUse packed issue 3280 cancel', String(packedCancelHookResult.stdout))).length !== 0) {
|
|
3311
|
+
throw new Error('packed native hook blocked exact canonical cancel with inherited NODE_EXTRA_CA_CERTS');
|
|
3312
|
+
}
|
|
3313
|
+
const packedCancelResult = spawnSync(process.execPath, [workspacePackageCli, 'cancel', '--force'], {
|
|
3314
|
+
cwd: packedCancelCwd,
|
|
3315
|
+
encoding: 'utf-8',
|
|
3316
|
+
env: {
|
|
3317
|
+
...process.env,
|
|
3318
|
+
PATH: packedNpmPath,
|
|
3319
|
+
NODE_EXTRA_CA_CERTS: '/nonexistent/enterprise-ca.pem',
|
|
3320
|
+
},
|
|
3321
|
+
});
|
|
3322
|
+
assertBoundedProbeExit('packed issue 3280 exact-session cancel', packedCancelResult, 0);
|
|
3323
|
+
const packedCancelledSkill = JSON.parse(readFileSync(join(packedCancelSessionDir, 'skill-active-state.json'), 'utf-8'));
|
|
3324
|
+
if (packedCancelledSkill.active !== false || packedCancelledSkill.owner_codex_session_id !== packedCancelNativeId) {
|
|
3325
|
+
throw new Error('packed issue 3280 cancellation did not reconcile and terminalize the exact skill state');
|
|
3326
|
+
}
|
|
3327
|
+
if (existsSync(join(packedCancelStateDir, 'skill-active-state.json'))) {
|
|
3328
|
+
throw new Error('packed issue 3280 cancellation mutated root compatibility state');
|
|
3329
|
+
}
|
|
3096
3330
|
requireNativeHookPermissionDeny('main-root boxed planning CLI poisoned state root', runActorProbe('main-root', 'boxed planning CLI poisoned state root', 'Bash', { command: `OMX_STATE_ROOT=${join(smokeCwd, 'src', 'state')} ${packedNpmCommandPrefix} omx state write --input '{"mode":"ralplan","active":true}' --json` }, { OMX_ROOT: boxedPlanningRoot, OMX_TEAM_STATE_ROOT: '' }), /(?:Ralplan is active|Main-root Conductor mode is active)/);
|
|
3097
3331
|
const npmBinPathShadow = join(smokeCwd, '.omx', 'state', 'inbox', 'cat');
|
|
3098
3332
|
symlinkSync('/usr/bin/touch', npmBinPathShadow);
|
|
@@ -3706,9 +3940,9 @@ PY`],
|
|
|
3706
3940
|
if (Object.keys(childReadOutput).length !== 0) {
|
|
3707
3941
|
throw new Error('native hook blocked a positively classified native-child read-only operation');
|
|
3708
3942
|
}
|
|
3709
|
-
// #3194: the installed
|
|
3710
|
-
// authority state or
|
|
3711
|
-
const roleIntentCwd = join(smokeCwd, 'issue-
|
|
3943
|
+
// #3194/#3212: the installed documented surface fails closed before any
|
|
3944
|
+
// same-user-mintable authority state or adapted role intent can be created.
|
|
3945
|
+
const roleIntentCwd = join(smokeCwd, 'issue-3212-role-intent');
|
|
3712
3946
|
const roleIntentHome = join(roleIntentCwd, 'home');
|
|
3713
3947
|
const roleIntentCodexHome = join(roleIntentCwd, 'codex-home');
|
|
3714
3948
|
const roleIntentNativeSessionId = 'synthetic-3194-session';
|
|
@@ -3719,15 +3953,6 @@ PY`],
|
|
|
3719
3953
|
HOME: roleIntentHome,
|
|
3720
3954
|
CODEX_HOME: roleIntentCodexHome,
|
|
3721
3955
|
};
|
|
3722
|
-
const sessionStartResult = run(process.execPath, [realpathSync(hookScript)], {
|
|
3723
|
-
cwd: roleIntentCwd,
|
|
3724
|
-
env: roleIntentEnvironment,
|
|
3725
|
-
input: JSON.stringify({ hook_event_name: 'SessionStart', cwd: roleIntentCwd, session_id: roleIntentNativeSessionId }),
|
|
3726
|
-
});
|
|
3727
|
-
validateHookStdout('SessionStart', String(sessionStartResult.stdout || ''));
|
|
3728
|
-
const trackingPath = join(roleIntentCwd, '.omx', 'state', 'subagent-tracking.json');
|
|
3729
|
-
if (existsSync(trackingPath))
|
|
3730
|
-
throw new Error('installed #3194 SessionStart unexpectedly created tracker authority');
|
|
3731
3956
|
const preToolUseResult = run(process.execPath, [realpathSync(hookScript)], {
|
|
3732
3957
|
cwd: roleIntentCwd,
|
|
3733
3958
|
env: roleIntentEnvironment,
|
|
@@ -3741,12 +3966,13 @@ PY`],
|
|
|
3741
3966
|
tool_input: { command: 'omx ralplan role-intent write --role architect --parent-thread "$CODEX_THREAD_ID" --json' },
|
|
3742
3967
|
}),
|
|
3743
3968
|
});
|
|
3744
|
-
const preToolUseExpected = '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"unsupported_documented_leader_proof: Codex
|
|
3969
|
+
const preToolUseExpected = '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"unsupported_documented_leader_proof: Codex hooks do not expose a documented, non-user-mintable root identity required for adapted Ralplan."}}\n';
|
|
3745
3970
|
if (String(preToolUseResult.stdout || '') !== preToolUseExpected) {
|
|
3746
|
-
throw new Error('installed #
|
|
3971
|
+
throw new Error('installed #3212 PreToolUse did not emit the exact unsupported denial');
|
|
3747
3972
|
}
|
|
3748
|
-
|
|
3749
|
-
|
|
3973
|
+
const authorityStateRoot = join(roleIntentCwd, '.omx', 'state');
|
|
3974
|
+
if (existsSync(authorityStateRoot))
|
|
3975
|
+
throw new Error('installed #3212 PreToolUse created authority-sensitive state');
|
|
3750
3976
|
const roleIntentCliResult = spawnSync(process.execPath, [realpathSync(join(packageRoot, 'dist', 'cli', 'omx.js')), 'ralplan', 'role-intent', 'write', '--role', 'architect', '--parent-thread', roleIntentNativeSessionId, '--json'], {
|
|
3751
3977
|
cwd: roleIntentCwd,
|
|
3752
3978
|
env: roleIntentEnvironment,
|
|
@@ -3754,12 +3980,12 @@ PY`],
|
|
|
3754
3980
|
stdio: 'pipe',
|
|
3755
3981
|
});
|
|
3756
3982
|
if (roleIntentCliResult.status === 0)
|
|
3757
|
-
throw new Error('installed #
|
|
3983
|
+
throw new Error('installed #3212 role-intent CLI unexpectedly authorized an Architect request');
|
|
3758
3984
|
if (String(roleIntentCliResult.stdout || '') !== '{"ok":false,"reason":"unsupported_documented_leader_proof"}\n') {
|
|
3759
|
-
throw new Error('installed #
|
|
3985
|
+
throw new Error('installed #3212 role-intent CLI returned an unexpected fail-closed denial');
|
|
3760
3986
|
}
|
|
3761
|
-
if (existsSync(
|
|
3762
|
-
throw new Error('installed #
|
|
3987
|
+
if (existsSync(authorityStateRoot))
|
|
3988
|
+
throw new Error('installed #3212 role-intent CLI created authority-sensitive state');
|
|
3763
3989
|
for (const [caseIndex, testCase] of PACKED_INSTALL_NATIVE_HOOK_REGRESSION_PROMPTS.entries()) {
|
|
3764
3990
|
const caseCwd = join(smokeCwd, testCase.name);
|
|
3765
3991
|
const sessionId = `packed-regression-${caseIndex}`;
|
|
@@ -3789,9 +4015,7 @@ PY`],
|
|
|
3789
4015
|
if (!existsSync(skillStatePath))
|
|
3790
4016
|
throw new Error(`packed regression ${testCase.name} did not create workflow state`);
|
|
3791
4017
|
const skillState = JSON.parse(readFileSync(skillStatePath, 'utf-8'));
|
|
3792
|
-
|
|
3793
|
-
throw new Error(`packed regression ${testCase.name} persisted unexpected workflow state`);
|
|
3794
|
-
}
|
|
4018
|
+
assertPackedRegressionWorkflowState(testCase, skillState);
|
|
3795
4019
|
if ('expectedDeferredSkills' in testCase && JSON.stringify(skillState.deferred_skills ?? []) !== JSON.stringify(testCase.expectedDeferredSkills)) {
|
|
3796
4020
|
throw new Error(`packed regression ${testCase.name} persisted unexpected deferred workflows`);
|
|
3797
4021
|
}
|
|
@@ -3805,10 +4029,11 @@ PY`],
|
|
|
3805
4029
|
input: JSON.stringify({ ...promptPayload, hook_event_name: 'Stop', turn_id: `stop-${caseIndex}` }),
|
|
3806
4030
|
});
|
|
3807
4031
|
const stopOutput = JSON.parse(String(stopResult.stdout || '{}'));
|
|
3808
|
-
|
|
4032
|
+
const expectedStopBlock = shouldPackedRegressionStopBlock(testCase);
|
|
4033
|
+
if (expectedStopBlock && stopOutput.decision !== 'block') {
|
|
3809
4034
|
throw new Error(`packed regression ${testCase.name} did not block Stop`);
|
|
3810
4035
|
}
|
|
3811
|
-
if (!
|
|
4036
|
+
if (!expectedStopBlock && stopOutput.decision === 'block') {
|
|
3812
4037
|
throw new Error(`packed regression ${testCase.name} blocked Stop: ${JSON.stringify(stopOutput)}`);
|
|
3813
4038
|
}
|
|
3814
4039
|
}
|
|
@@ -4299,7 +4524,7 @@ function smokeInstalledPluginHookLauncher(packageRoot, omxPath) {
|
|
|
4299
4524
|
OMX_ENTRY_PATH: omxPath,
|
|
4300
4525
|
OMX_CODEX_LAUNCH_ID: 'packed-plugin-hook-launch',
|
|
4301
4526
|
OMX_PACKED_PLUGIN_HOOK_CAPTURE_PATH: capturePath,
|
|
4302
|
-
});
|
|
4527
|
+
}, { runtimeBinary: null });
|
|
4303
4528
|
const runProbe = (name, payload, expectedStatus, expectedStdout) => {
|
|
4304
4529
|
writeFileSync(capturePath, '');
|
|
4305
4530
|
const stdin = JSON.stringify(payload);
|
|
@@ -4327,6 +4552,35 @@ function smokeInstalledPluginHookLauncher(packageRoot, omxPath) {
|
|
|
4327
4552
|
cwd: hookCwd,
|
|
4328
4553
|
prompt: 'packed plugin non-Stop probe',
|
|
4329
4554
|
}, 0, '{"hookSpecificOutput":{"additionalContext":"pinned non-stop delegate"}}\n');
|
|
4555
|
+
const childSessionId = `${sessionId}-child`;
|
|
4556
|
+
const childTranscriptPath = join(hookCwd, 'packed-child-transcript.jsonl');
|
|
4557
|
+
writeFileSync(childTranscriptPath, `${JSON.stringify({
|
|
4558
|
+
type: 'session_meta',
|
|
4559
|
+
payload: {
|
|
4560
|
+
id: childSessionId,
|
|
4561
|
+
source: { subagent: { thread_spawn: { parent_thread_id: sessionId, task_name: 'omx_role_intent_aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } } },
|
|
4562
|
+
},
|
|
4563
|
+
})}\n`);
|
|
4564
|
+
runProbe('claimed child SessionStart', {
|
|
4565
|
+
hookEventName: 'SessionStart',
|
|
4566
|
+
sessionId: childSessionId,
|
|
4567
|
+
transcriptPath: childTranscriptPath,
|
|
4568
|
+
cwd: hookCwd,
|
|
4569
|
+
}, 0, '{"hookSpecificOutput":{"additionalContext":"pinned non-stop delegate"}}\n');
|
|
4570
|
+
const routingPath = join(smokeRoot, '.omx-root', 'state', 'plugin-hook-routing', 'packed-plugin-hook-launch.json');
|
|
4571
|
+
if (!existsSync(routingPath))
|
|
4572
|
+
throw new Error('installed plugin launcher did not create its routing-only record');
|
|
4573
|
+
assert.deepStrictEqual(JSON.parse(readFileSync(routingPath, 'utf-8')), {
|
|
4574
|
+
routing: 'omx-plugin-hook-routing-only:v1',
|
|
4575
|
+
ownerSessionId: sessionId,
|
|
4576
|
+
}, 'installed plugin launcher routing record changed shape');
|
|
4577
|
+
for (const forbiddenPath of [
|
|
4578
|
+
join(smokeRoot, '.omx-root', 'native-anchor-auth.key'),
|
|
4579
|
+
join(smokeRoot, '.omx-root', 'state', 'plugin-hook-launches'),
|
|
4580
|
+
]) {
|
|
4581
|
+
if (existsSync(forbiddenPath))
|
|
4582
|
+
throw new Error(`installed plugin launcher created forbidden authority state: ${forbiddenPath}`);
|
|
4583
|
+
}
|
|
4330
4584
|
runProbe('Stop', {
|
|
4331
4585
|
hook_event_name: 'Stop',
|
|
4332
4586
|
session_id: sessionId,
|
|
@@ -4412,7 +4666,7 @@ function smokeInstalledMcpTargets(omxPath) {
|
|
|
4412
4666
|
OMX_TEAM_WORKER: '',
|
|
4413
4667
|
OMX_TEAM_WORKER_LAUNCH_ARGS: '',
|
|
4414
4668
|
OMX_NOTIFY_TEMP_CONTRACT: '',
|
|
4415
|
-
});
|
|
4669
|
+
}, { runtimeBinary: null });
|
|
4416
4670
|
for (const [serverName, target, expectedServerName] of PACKED_INSTALL_PLUGIN_MCP_TARGETS) {
|
|
4417
4671
|
const result = spawnSync(omxPath, ['mcp-serve', target], {
|
|
4418
4672
|
cwd: smokeRoot,
|
|
@@ -4448,6 +4702,99 @@ function smokeInstalledMcpTargets(omxPath) {
|
|
|
4448
4702
|
rmSync(smokeRoot, { recursive: true, force: true });
|
|
4449
4703
|
}
|
|
4450
4704
|
}
|
|
4705
|
+
function smokeInstalledFailClosedDenial(omxPath, packageRoot) {
|
|
4706
|
+
if (process.platform === 'linux') {
|
|
4707
|
+
console.log('fail-closed probe: skipped on linux');
|
|
4708
|
+
return;
|
|
4709
|
+
}
|
|
4710
|
+
const smokeRoot = mkdtempSync(join(tmpdir(), 'omx-packed-fail-closed-'));
|
|
4711
|
+
try {
|
|
4712
|
+
const fakeBinDir = join(smokeRoot, 'bin');
|
|
4713
|
+
const launchCwd = join(smokeRoot, 'cwd');
|
|
4714
|
+
const codexHome = join(smokeRoot, 'codex-home');
|
|
4715
|
+
const isolatedHome = join(smokeRoot, 'home');
|
|
4716
|
+
const capturePath = join(smokeRoot, 'fake-codex-argv.jsonl');
|
|
4717
|
+
const modelInstructionsPath = join(smokeRoot, 'model-instructions.md');
|
|
4718
|
+
mkdirSync(fakeBinDir, { recursive: true });
|
|
4719
|
+
mkdirSync(launchCwd, { recursive: true });
|
|
4720
|
+
mkdirSync(codexHome, { recursive: true });
|
|
4721
|
+
mkdirSync(isolatedHome, { recursive: true });
|
|
4722
|
+
writeFileSync(modelInstructionsPath, '# Packed fail-closed probe instructions\n');
|
|
4723
|
+
const fakeCodexSource = [
|
|
4724
|
+
'const { appendFileSync, existsSync } = require("node:fs");',
|
|
4725
|
+
'const path = require("node:path");',
|
|
4726
|
+
'const capturePath = process.env.OMX_PACKED_FAKE_CODEX_CAPTURE_PATH;',
|
|
4727
|
+
'if (!capturePath) process.exit(2);',
|
|
4728
|
+
'appendFileSync(capturePath, `${JSON.stringify({',
|
|
4729
|
+
' argv: process.argv.slice(2),',
|
|
4730
|
+
' cwd: process.cwd(),',
|
|
4731
|
+
' hasResumeSqlite: existsSync(path.join(process.env.CODEX_HOME ?? "", "state_5.sqlite")),',
|
|
4732
|
+
' OMX_NOTIFY_TEMP_CONTRACT: process.env.OMX_NOTIFY_TEMP_CONTRACT ?? null,',
|
|
4733
|
+
' OMX_TEAM_WORKER_LAUNCH_ARGS: process.env.OMX_TEAM_WORKER_LAUNCH_ARGS ?? null,',
|
|
4734
|
+
'})}\\n`);',
|
|
4735
|
+
].join('\n');
|
|
4736
|
+
if (process.platform === 'win32') {
|
|
4737
|
+
const fakeCodexScript = join(fakeBinDir, 'codex.cjs');
|
|
4738
|
+
writeFileSync(fakeCodexScript, fakeCodexSource);
|
|
4739
|
+
writeFileSync(join(fakeBinDir, 'codex.cmd'), [
|
|
4740
|
+
'@echo off',
|
|
4741
|
+
`"${process.execPath}" "${fakeCodexScript}" %*`,
|
|
4742
|
+
].join('\r\n'));
|
|
4743
|
+
}
|
|
4744
|
+
else {
|
|
4745
|
+
const fakeCodexPath = join(fakeBinDir, 'codex');
|
|
4746
|
+
writeFileSync(fakeCodexPath, `#!/usr/bin/env node\n${fakeCodexSource}\n`);
|
|
4747
|
+
chmodSync(fakeCodexPath, 0o755);
|
|
4748
|
+
}
|
|
4749
|
+
const systemPathEntries = process.platform === 'win32'
|
|
4750
|
+
? [join(process.env.SystemRoot ?? 'C:\\Windows', 'System32')]
|
|
4751
|
+
: ['/usr/bin', '/bin'];
|
|
4752
|
+
const isolatedPathEntries = [fakeBinDir, dirname(process.execPath), ...systemPathEntries];
|
|
4753
|
+
const runtimeName = runtimeBinaryName(process.platform);
|
|
4754
|
+
for (const entry of isolatedPathEntries) {
|
|
4755
|
+
if (existsSync(join(entry, runtimeName))) {
|
|
4756
|
+
throw new Error(`fail-closed probe PATH unexpectedly contains ${runtimeName}: ${entry}`);
|
|
4757
|
+
}
|
|
4758
|
+
}
|
|
4759
|
+
for (const profile of ['debug', 'release']) {
|
|
4760
|
+
const workspaceCandidate = join(packageRoot, 'target', profile, runtimeName);
|
|
4761
|
+
if (existsSync(workspaceCandidate)) {
|
|
4762
|
+
throw new Error(`fail-closed probe installed package unexpectedly contains runtime candidate: ${workspaceCandidate}`);
|
|
4763
|
+
}
|
|
4764
|
+
}
|
|
4765
|
+
let env = buildPackedProbeEnv({
|
|
4766
|
+
CODEX_HOME: codexHome,
|
|
4767
|
+
HOME: isolatedHome,
|
|
4768
|
+
USERPROFILE: isolatedHome,
|
|
4769
|
+
OMX_BYPASS_DEFAULT_SYSTEM_PROMPT: '1',
|
|
4770
|
+
OMX_MODEL_INSTRUCTIONS_FILE: modelInstructionsPath,
|
|
4771
|
+
OMX_LAUNCH_POLICY: 'direct',
|
|
4772
|
+
OMX_PACKED_FAKE_CODEX_CAPTURE_PATH: capturePath,
|
|
4773
|
+
}, { runtimeBinary: null });
|
|
4774
|
+
env = replacePathKeyCaseInsensitive(env, isolatedPathEntries.join(delimiter));
|
|
4775
|
+
console.log(`fail-closed probe PATH: ${isolatedPathEntries.join(delimiter)}`);
|
|
4776
|
+
const result = spawnSync(omxPath, ['--', 'packed-fail-closed-probe'], {
|
|
4777
|
+
cwd: launchCwd,
|
|
4778
|
+
encoding: 'utf-8',
|
|
4779
|
+
env,
|
|
4780
|
+
timeout: PACKED_INSTALL_OPERATIONAL_PROBE_TIMEOUT_MS,
|
|
4781
|
+
killSignal: 'SIGKILL',
|
|
4782
|
+
});
|
|
4783
|
+
const launches = readFakeCodexLaunches(capturePath);
|
|
4784
|
+
if (launches.length !== 1) {
|
|
4785
|
+
throw new Error(`fail-closed probe must launch fake Codex exactly once: ${JSON.stringify(launches)}`);
|
|
4786
|
+
}
|
|
4787
|
+
const stderr = String(result.stderr ?? '');
|
|
4788
|
+
if (result.status === 0 || !stderr.includes('session_pointer_unusable')) {
|
|
4789
|
+
throw new Error(`fail-closed probe expected session_pointer_unusable denial, received status ${String(result.status)}\n${stderr}`);
|
|
4790
|
+
}
|
|
4791
|
+
console.log(`fail-closed probe denial: ${stderr.trim()}`);
|
|
4792
|
+
console.log('fail-closed probe: denial observed');
|
|
4793
|
+
}
|
|
4794
|
+
finally {
|
|
4795
|
+
rmSync(smokeRoot, { recursive: true, force: true });
|
|
4796
|
+
}
|
|
4797
|
+
}
|
|
4451
4798
|
export function parseNpmPackJsonOutput(stdout) {
|
|
4452
4799
|
const start = stdout.lastIndexOf('\n[');
|
|
4453
4800
|
const jsonText = (start >= 0 ? stdout.slice(start + 1) : stdout).trim();
|
|
@@ -4457,7 +4804,7 @@ export function parseNpmPackJsonOutput(stdout) {
|
|
|
4457
4804
|
return JSON.parse(jsonText);
|
|
4458
4805
|
}
|
|
4459
4806
|
async function main() {
|
|
4460
|
-
parseArgs(process.argv.slice(2));
|
|
4807
|
+
const { failClosedProbe } = parseArgs(process.argv.slice(2));
|
|
4461
4808
|
const repoRoot = process.cwd();
|
|
4462
4809
|
const tempRoot = mkdtempSync(join(tmpdir(), 'omx-packed-install-'));
|
|
4463
4810
|
const prefixDir = join(tempRoot, 'prefix');
|
|
@@ -4474,7 +4821,7 @@ async function main() {
|
|
|
4474
4821
|
CODEX_HOME: installCodexHome,
|
|
4475
4822
|
npm_config_cache: installNpmCache,
|
|
4476
4823
|
NPM_CONFIG_CACHE: installNpmCache,
|
|
4477
|
-
});
|
|
4824
|
+
}, { runtimeBinary: null });
|
|
4478
4825
|
let tarballPath;
|
|
4479
4826
|
try {
|
|
4480
4827
|
ensureRepoDependencies(repoRoot, {
|
|
@@ -4496,14 +4843,20 @@ async function main() {
|
|
|
4496
4843
|
assertInstalledRequiredArtifacts(packageRoot);
|
|
4497
4844
|
await assertInstalledReasoningArtifacts(packageRoot);
|
|
4498
4845
|
const omxPath = join(prefixDir, process.platform === 'win32' ? '' : 'bin', npmBinName('omx'));
|
|
4846
|
+
if (failClosedProbe) {
|
|
4847
|
+
smokeInstalledFailClosedDenial(omxPath, packageRoot);
|
|
4848
|
+
return;
|
|
4849
|
+
}
|
|
4850
|
+
const runtimeBinary = resolvePackedSmokeRuntimeBinary(repoRoot);
|
|
4851
|
+
console.log(`packed smoke runtime: ${runtimeBinary}`);
|
|
4499
4852
|
smokeInstalledRootReasoningRejections(omxPath, repoRoot);
|
|
4500
|
-
smokeInstalledLaunchArgumentBoundary(omxPath);
|
|
4853
|
+
smokeInstalledLaunchArgumentBoundary(omxPath, runtimeBinary);
|
|
4501
4854
|
smokeInstalledPluginHookLauncher(packageRoot, omxPath);
|
|
4502
4855
|
smokeInstalledMcpTargets(omxPath);
|
|
4503
4856
|
for (const argv of PACKED_INSTALL_SMOKE_CORE_COMMANDS) {
|
|
4504
4857
|
run(omxPath, argv, { cwd: repoRoot, env: installEnv });
|
|
4505
4858
|
}
|
|
4506
|
-
smokeInstalledNativeHookDist(prefixDir);
|
|
4859
|
+
smokeInstalledNativeHookDist(prefixDir, runtimeBinary);
|
|
4507
4860
|
const lifecycle = await smokePackedHookTrustLifecycle(omxPath);
|
|
4508
4861
|
console.log(lifecycle.codexVersion !== null
|
|
4509
4862
|
? `packed install smoke: installed Codex 0.142.5 lifecycle passed (${lifecycle.codexVersion})`
|