oh-my-codex 0.20.3 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +35 -18
- package/Cargo.toml +1 -1
- package/README.md +22 -19
- 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/agents/__tests__/definitions.test.js +0 -27
- package/dist/agents/__tests__/definitions.test.js.map +1 -1
- package/dist/agents/__tests__/native-config.test.js +3 -8
- package/dist/agents/__tests__/native-config.test.js.map +1 -1
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +0 -41
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/policy.d.ts.map +1 -1
- package/dist/agents/policy.js +0 -1
- package/dist/agents/policy.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__/completion-gate-advisory.test.d.ts +2 -0
- package/dist/autopilot/__tests__/completion-gate-advisory.test.d.ts.map +1 -0
- package/dist/autopilot/__tests__/completion-gate-advisory.test.js +383 -0
- package/dist/autopilot/__tests__/completion-gate-advisory.test.js.map +1 -0
- package/dist/autopilot/completion-gate.d.ts +6 -1
- package/dist/autopilot/completion-gate.d.ts.map +1 -1
- package/dist/autopilot/completion-gate.js +247 -7
- package/dist/autopilot/completion-gate.js.map +1 -1
- package/dist/catalog/__tests__/generator.test.js +15 -10
- package/dist/catalog/__tests__/generator.test.js.map +1 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +13 -7
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +1 -1
- package/dist/catalog/__tests__/schema.test.js +3 -5
- package/dist/catalog/__tests__/schema.test.js.map +1 -1
- package/dist/catalog/schema.js +1 -1
- package/dist/catalog/schema.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__/autopilot.test.d.ts +2 -0
- package/dist/cli/__tests__/autopilot.test.d.ts.map +1 -0
- package/dist/cli/__tests__/autopilot.test.js +143 -0
- package/dist/cli/__tests__/autopilot.test.js.map +1 -0
- 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 +76 -4
- 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 +206 -0
- package/dist/cli/__tests__/doctor-state-root-binding.test.js.map +1 -0
- package/dist/cli/__tests__/doctor-team.test.js +85 -0
- package/dist/cli/__tests__/doctor-team.test.js.map +1 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +38 -6
- 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 +1125 -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__/package-bin-contract.test.js +5 -8
- package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-deslop-contract.test.js +4 -18
- package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js +4 -30
- package/dist/cli/__tests__/ralph-goal-mode-contract.test.js.map +1 -1
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +4 -15
- package/dist/cli/__tests__/ralph-prd-deep-interview.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 +131 -14
- package/dist/cli/__tests__/ralplan.test.js.map +1 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +1153 -43
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +1 -1
- package/dist/cli/__tests__/session-search-help.test.js +65 -3
- package/dist/cli/__tests__/session-search-help.test.js.map +1 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +57 -55
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +34 -0
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +1 -1
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js +1 -1
- package/dist/cli/__tests__/setup-hooks-trust-e2e.test.js.map +1 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +258 -26
- package/dist/cli/__tests__/setup-install-mode.test.js.map +1 -1
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js +1 -1
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +1 -1
- package/dist/cli/__tests__/setup-refresh.test.js +3 -6
- package/dist/cli/__tests__/setup-refresh.test.js.map +1 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +180 -21
- package/dist/cli/__tests__/setup-skills-overwrite.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 +161 -2
- package/dist/cli/__tests__/ultragoal.test.js.map +1 -1
- package/dist/cli/__tests__/uninstall.test.js +73 -28
- package/dist/cli/__tests__/uninstall.test.js.map +1 -1
- package/dist/cli/__tests__/update.test.js +749 -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/autopilot.d.ts +8 -0
- package/dist/cli/autopilot.d.ts.map +1 -0
- package/dist/cli/autopilot.js +160 -0
- package/dist/cli/autopilot.js.map +1 -0
- 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 +29 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +433 -19
- 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 +2354 -724
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp-parity.d.ts.map +1 -1
- package/dist/cli/mcp-parity.js +7 -3
- package/dist/cli/mcp-parity.js.map +1 -1
- package/dist/cli/native-assets.d.ts +26 -1
- 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 +69 -0
- package/dist/cli/package-manager-ownership.d.ts.map +1 -0
- package/dist/cli/package-manager-ownership.js +338 -0
- package/dist/cli/package-manager-ownership.js.map +1 -0
- package/dist/cli/plugin-marketplace.d.ts +1 -0
- package/dist/cli/plugin-marketplace.d.ts.map +1 -1
- package/dist/cli/plugin-marketplace.js +123 -55
- package/dist/cli/plugin-marketplace.js.map +1 -1
- package/dist/cli/ralph.js +2 -2
- package/dist/cli/ralph.js.map +1 -1
- package/dist/cli/ralplan.d.ts +6 -2
- package/dist/cli/ralplan.d.ts.map +1 -1
- package/dist/cli/ralplan.js +134 -34
- package/dist/cli/ralplan.js.map +1 -1
- package/dist/cli/session-search.d.ts.map +1 -1
- package/dist/cli/session-search.js +38 -1
- package/dist/cli/session-search.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 +6 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +425 -215
- 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 +1 -1
- package/dist/cli/ultragoal.d.ts.map +1 -1
- package/dist/cli/ultragoal.js +10 -7
- 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 +16 -23
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +212 -241
- package/dist/cli/update.js.map +1 -1
- package/dist/compat/__tests__/upgrade-from-0-20.test.d.ts +2 -0
- package/dist/compat/__tests__/upgrade-from-0-20.test.d.ts.map +1 -0
- package/dist/compat/__tests__/upgrade-from-0-20.test.js +109 -0
- package/dist/compat/__tests__/upgrade-from-0-20.test.js.map +1 -0
- package/dist/compat/upgrade-from-0-20.d.ts +64 -0
- package/dist/compat/upgrade-from-0-20.d.ts.map +1 -0
- package/dist/compat/upgrade-from-0-20.js +276 -0
- package/dist/compat/upgrade-from-0-20.js.map +1 -0
- 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__/analyze-skill-contract.test.js +24 -31
- package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/anti-slop-workflow.test.js +66 -135
- package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +1 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +47 -106
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.js +16 -18
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +2 -14
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +1 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js +56 -234
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +1 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +1 -3
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/design-skill.test.js +18 -16
- package/dist/hooks/__tests__/design-skill.test.js.map +1 -1
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +24 -20
- package/dist/hooks/__tests__/explore-sparkshell-guidance-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 +164 -0
- package/dist/hooks/__tests__/issue-3293-autopilot-handoff.test.js.map +1 -0
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.d.ts +2 -0
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.js +169 -0
- package/dist/hooks/__tests__/issue-3497-hook-simplification.test.js.map +1 -0
- package/dist/hooks/__tests__/keyword-detector.test.js +226 -858
- package/dist/hooks/__tests__/keyword-detector.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +176 -14
- 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 +33 -21
- 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-ralph-resume.test.js +14 -904
- package/dist/hooks/__tests__/notify-hook-ralph-resume.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-session-scope.test.js +5 -5
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +7 -7
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +11 -8
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +1 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +7 -6
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.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__/pre-context-gate-skills.test.js +19 -21
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js +23 -3
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +23 -28
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
- package/dist/hooks/__tests__/research-workflow-boundaries.test.js +9 -8
- package/dist/hooks/__tests__/research-workflow-boundaries.test.js.map +1 -1
- package/dist/hooks/__tests__/session.test.js +3656 -656
- package/dist/hooks/__tests__/session.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.js +13 -22
- package/dist/hooks/__tests__/skill-catalog-hygiene.test.js.map +1 -1
- package/dist/hooks/__tests__/skill-guidance-contract.test.js +3 -13
- package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/sunset-routing-contract.test.d.ts +2 -0
- package/dist/hooks/__tests__/sunset-routing-contract.test.d.ts.map +1 -0
- package/dist/hooks/__tests__/sunset-routing-contract.test.js +172 -0
- package/dist/hooks/__tests__/sunset-routing-contract.test.js.map +1 -0
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +2 -2
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +1 -1
- package/dist/hooks/__tests__/tmux-hook-engine.test.js +18 -3
- package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.js +20 -17
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +1 -1
- package/dist/hooks/__tests__/visual-verdict-loop.test.js +17 -18
- package/dist/hooks/__tests__/visual-verdict-loop.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 +6 -47
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +156 -268
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/keyword-registry.d.ts.map +1 -1
- package/dist/hooks/keyword-registry.js +14 -26
- package/dist/hooks/keyword-registry.js.map +1 -1
- package/dist/hooks/native/capability-warnings.d.ts +16 -0
- package/dist/hooks/native/capability-warnings.d.ts.map +1 -0
- package/dist/hooks/native/capability-warnings.js +40 -0
- package/dist/hooks/native/capability-warnings.js.map +1 -0
- package/dist/hooks/native/index.d.ts +17 -0
- package/dist/hooks/native/index.d.ts.map +1 -0
- package/dist/hooks/native/index.js +17 -0
- package/dist/hooks/native/index.js.map +1 -0
- package/dist/hooks/native/pre-tool-use-advisory.d.ts +17 -0
- package/dist/hooks/native/pre-tool-use-advisory.d.ts.map +1 -0
- package/dist/hooks/native/pre-tool-use-advisory.js +112 -0
- package/dist/hooks/native/pre-tool-use-advisory.js.map +1 -0
- package/dist/hooks/native/types.d.ts +30 -0
- package/dist/hooks/native/types.d.ts.map +1 -0
- package/dist/hooks/native/types.js +22 -0
- package/dist/hooks/native/types.js.map +1 -0
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +46 -93
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/session.d.ts +197 -18
- package/dist/hooks/session.d.ts.map +1 -1
- package/dist/hooks/session.js +1939 -271
- package/dist/hooks/session.js.map +1 -1
- package/dist/hooks/sunset-stub.d.ts +17 -0
- package/dist/hooks/sunset-stub.d.ts.map +1 -0
- package/dist/hooks/sunset-stub.js +125 -0
- package/dist/hooks/sunset-stub.js.map +1 -0
- 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-split-realtmux.test.d.ts +2 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.d.ts.map +1 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.js +112 -0
- package/dist/hud/__tests__/tmux-split-realtmux.test.js.map +1 -0
- package/dist/hud/__tests__/tmux.test.js +217 -198
- package/dist/hud/__tests__/tmux.test.js.map +1 -1
- package/dist/hud/tmux.d.ts +43 -4
- package/dist/hud/tmux.d.ts.map +1 -1
- package/dist/hud/tmux.js +1025 -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-ralph-phase.test.js +29 -4
- package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server-schema.test.js +13 -3
- package/dist/mcp/__tests__/state-server-schema.test.js.map +1 -1
- package/dist/mcp/__tests__/state-server.test.js +11 -1033
- 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 +68 -97
- package/dist/mcp/state-server.d.ts.map +1 -1
- package/dist/mcp/state-server.js +116 -67
- package/dist/mcp/state-server.js.map +1 -1
- package/dist/modes/__tests__/base-autopilot-gates.test.js +1 -168
- package/dist/modes/__tests__/base-autopilot-gates.test.js.map +1 -1
- package/dist/modes/__tests__/base-autoresearch-contract.test.js +1 -85
- package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +1 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.js +1 -35
- package/dist/modes/__tests__/base-multi-state-compat.test.js.map +1 -1
- package/dist/modes/__tests__/base-session-scope.test.js +10 -158
- package/dist/modes/__tests__/base-session-scope.test.js.map +1 -1
- package/dist/modes/base.d.ts +6 -6
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +116 -90
- 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/notifications/__tests__/formatter.test.js +8 -0
- package/dist/notifications/__tests__/formatter.test.js.map +1 -1
- package/dist/notifications/__tests__/template-engine.test.js +8 -0
- package/dist/notifications/__tests__/template-engine.test.js.map +1 -1
- package/dist/notifications/formatter.js +1 -1
- package/dist/notifications/formatter.js.map +1 -1
- package/dist/notifications/template-engine.js +1 -1
- package/dist/notifications/template-engine.js.map +1 -1
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js +0 -21
- package/dist/planning/__tests__/approved-execution-lifecycle-matrix.test.js.map +1 -1
- package/dist/question/autopilot-wait.d.ts.map +1 -1
- package/dist/question/autopilot-wait.js +2 -2
- package/dist/question/autopilot-wait.js.map +1 -1
- package/dist/question/deep-interview.d.ts +1 -2
- package/dist/question/deep-interview.d.ts.map +1 -1
- package/dist/question/deep-interview.js +4 -4
- package/dist/question/deep-interview.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 +56 -821
- package/dist/ralplan/__tests__/runtime.test.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 +2 -2
- package/dist/ralplan/runtime.d.ts.map +1 -1
- package/dist/ralplan/runtime.js +145 -163
- package/dist/ralplan/runtime.js.map +1 -1
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +45 -0
- package/dist/runtime/bridge.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 +12490 -19414
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +1 -1
- package/dist/scripts/__tests__/docs-site-contract.test.js +2 -2
- package/dist/scripts/__tests__/docs-site-contract.test.js.map +1 -1
- package/dist/scripts/__tests__/generated-artifact-drift.test.d.ts +2 -0
- package/dist/scripts/__tests__/generated-artifact-drift.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/generated-artifact-drift.test.js +84 -0
- package/dist/scripts/__tests__/generated-artifact-drift.test.js.map +1 -0
- 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 +235 -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 +207 -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 +156 -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 +191 -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 +40 -0
- package/dist/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.js +63 -0
- package/dist/scripts/__tests__/issue-3481-conductor-deadlock.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.js +65 -0
- package/dist/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.js.map +1 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.d.ts +2 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.d.ts.map +1 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.test.js +189 -0
- package/dist/scripts/__tests__/issue-3536-external-team-state-root.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__/prompt-inventory.test.js +54 -1
- package/dist/scripts/__tests__/prompt-inventory.test.js.map +1 -1
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js +2 -2
- package/dist/scripts/__tests__/reasoning-artifact-contract.test.js.map +1 -1
- package/dist/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.js +46 -60
- 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 +168 -20
- 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 +51 -2
- package/dist/scripts/codex-native-hook.d.ts.map +1 -1
- package/dist/scripts/codex-native-hook.js +3648 -1332
- 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 +33 -22
- 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/auto-nudge.d.ts +2 -48
- package/dist/scripts/notify-hook/auto-nudge.d.ts.map +1 -1
- package/dist/scripts/notify-hook/auto-nudge.js +1 -0
- package/dist/scripts/notify-hook/auto-nudge.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-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +8 -5
- package/dist/scripts/notify-hook/team-dispatch.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-tmux-guard.d.ts +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-tmux-guard.js +3 -2
- package/dist/scripts/notify-hook/team-tmux-guard.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.d.ts.map +1 -1
- package/dist/scripts/notify-hook.js +71 -124
- 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/prompt-inventory.d.ts +39 -0
- package/dist/scripts/prompt-inventory.d.ts.map +1 -1
- package/dist/scripts/prompt-inventory.js +108 -3
- package/dist/scripts/prompt-inventory.js.map +1 -1
- package/dist/scripts/run-compiled-ci.js +2 -0
- package/dist/scripts/run-compiled-ci.js.map +1 -1
- package/dist/scripts/run-test-files.js +1 -0
- package/dist/scripts/run-test-files.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 +407 -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/sync-prompt-guidance-fragments.js +62 -20
- package/dist/scripts/sync-prompt-guidance-fragments.js.map +1 -1
- package/dist/scripts/tmux-hook-engine.d.ts +1 -1
- package/dist/scripts/tmux-hook-engine.d.ts.map +1 -1
- package/dist/scripts/tmux-hook-engine.js +3 -3
- package/dist/scripts/tmux-hook-engine.js.map +1 -1
- package/dist/scripts/verify-capabilities-lock.d.ts +3 -0
- package/dist/scripts/verify-capabilities-lock.d.ts.map +1 -0
- package/dist/scripts/verify-capabilities-lock.js +22 -0
- package/dist/scripts/verify-capabilities-lock.js.map +1 -0
- 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__/authority-decreasing.test.d.ts +2 -0
- package/dist/state/__tests__/authority-decreasing.test.d.ts.map +1 -0
- package/dist/state/__tests__/authority-decreasing.test.js +78 -0
- package/dist/state/__tests__/authority-decreasing.test.js.map +1 -0
- package/dist/state/__tests__/handoff-carrier.test.d.ts +2 -0
- package/dist/state/__tests__/handoff-carrier.test.d.ts.map +1 -0
- package/dist/state/__tests__/handoff-carrier.test.js +96 -0
- package/dist/state/__tests__/handoff-carrier.test.js.map +1 -0
- 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 +870 -2517
- package/dist/state/__tests__/operations.test.js.map +1 -1
- package/dist/state/__tests__/single-writer-invariant.test.d.ts +2 -0
- package/dist/state/__tests__/single-writer-invariant.test.d.ts.map +1 -0
- package/dist/state/__tests__/single-writer-invariant.test.js +342 -0
- package/dist/state/__tests__/single-writer-invariant.test.js.map +1 -0
- package/dist/state/__tests__/skill-active.test.js +400 -2
- package/dist/state/__tests__/skill-active.test.js.map +1 -1
- package/dist/state/__tests__/stale-state-neutralization.test.d.ts +2 -0
- package/dist/state/__tests__/stale-state-neutralization.test.d.ts.map +1 -0
- package/dist/state/__tests__/stale-state-neutralization.test.js +84 -0
- package/dist/state/__tests__/stale-state-neutralization.test.js.map +1 -0
- package/dist/state/__tests__/workflow-transition.test.js +20 -33
- package/dist/state/__tests__/workflow-transition.test.js.map +1 -1
- package/dist/state/handoff-carrier.d.ts +46 -0
- package/dist/state/handoff-carrier.d.ts.map +1 -0
- package/dist/state/handoff-carrier.js +85 -0
- package/dist/state/handoff-carrier.js.map +1 -0
- 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/namespace-owners.d.ts +34 -0
- package/dist/state/namespace-owners.d.ts.map +1 -0
- package/dist/state/namespace-owners.js +127 -0
- package/dist/state/namespace-owners.js.map +1 -0
- package/dist/state/operations.d.ts +9 -4
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +194 -235
- 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 +421 -31
- 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 +11 -31
- package/dist/state/workflow-transition-reconcile.js.map +1 -1
- package/dist/state/workflow-transition.d.ts +1 -27
- package/dist/state/workflow-transition.d.ts.map +1 -1
- package/dist/state/workflow-transition.js +9 -790
- 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__/api-interop.test.js +1 -0
- package/dist/team/__tests__/api-interop.test.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 +269 -245
- 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__/team-ops-contract.test.js +1 -0
- package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
- package/dist/team/__tests__/tmux-session.test.js +1093 -101
- 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 +159 -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-bootstrap.test.js +11 -13
- package/dist/team/__tests__/worker-bootstrap.test.js.map +1 -1
- package/dist/team/__tests__/worker-provenance.test.d.ts +2 -0
- package/dist/team/__tests__/worker-provenance.test.d.ts.map +1 -0
- package/dist/team/__tests__/worker-provenance.test.js +251 -0
- package/dist/team/__tests__/worker-provenance.test.js.map +1 -0
- 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/api-interop.d.ts.map +1 -1
- package/dist/team/api-interop.js +14 -8
- package/dist/team/api-interop.js.map +1 -1
- package/dist/team/mcp-comm.d.ts.map +1 -1
- package/dist/team/mcp-comm.js +3 -8
- package/dist/team/mcp-comm.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 +19 -0
- package/dist/team/state.d.ts.map +1 -1
- package/dist/team/state.js +47 -1
- package/dist/team/state.js.map +1 -1
- package/dist/team/team-ops.d.ts +1 -0
- package/dist/team/team-ops.d.ts.map +1 -1
- package/dist/team/team-ops.js +1 -0
- package/dist/team/team-ops.js.map +1 -1
- package/dist/team/tmux-session.d.ts +42 -4
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +572 -196
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/ultragoal-context.d.ts +1 -0
- package/dist/team/ultragoal-context.d.ts.map +1 -1
- package/dist/team/ultragoal-context.js +2 -0
- package/dist/team/ultragoal-context.js.map +1 -1
- package/dist/team/worker-provenance.d.ts +35 -0
- package/dist/team/worker-provenance.d.ts.map +1 -0
- package/dist/team/worker-provenance.js +213 -0
- package/dist/team/worker-provenance.js.map +1 -0
- package/dist/ultragoal/__tests__/artifacts.test.js +1053 -2
- package/dist/ultragoal/__tests__/artifacts.test.js.map +1 -1
- package/dist/ultragoal/__tests__/docs-contract.test.js +89 -59
- package/dist/ultragoal/__tests__/docs-contract.test.js.map +1 -1
- package/dist/ultragoal/artifacts.d.ts +36 -1
- package/dist/ultragoal/artifacts.d.ts.map +1 -1
- package/dist/ultragoal/artifacts.js +267 -51
- package/dist/ultragoal/artifacts.js.map +1 -1
- package/dist/url-reader/__tests__/url-reader.test.js +14 -0
- package/dist/url-reader/__tests__/url-reader.test.js.map +1 -1
- package/dist/url-reader/index.js +5 -3
- package/dist/url-reader/index.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/__tests__/version.test.js +17 -0
- package/dist/utils/__tests__/version.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/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +2 -1
- package/dist/utils/version.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 +17 -6
- 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/ai-slop-cleaner/SKILL.md +60 -135
- package/plugins/oh-my-codex/skills/analyze/SKILL.md +35 -111
- package/plugins/oh-my-codex/skills/autopilot/SKILL.md +72 -163
- package/plugins/oh-my-codex/skills/cancel/SKILL.md +33 -392
- package/plugins/oh-my-codex/skills/code-review/SKILL.md +66 -256
- package/plugins/oh-my-codex/skills/configure-notifications/SKILL.md +30 -216
- package/plugins/oh-my-codex/skills/deep-interview/SKILL.md +11 -10
- package/plugins/oh-my-codex/skills/design/SKILL.md +32 -132
- package/plugins/oh-my-codex/skills/doctor/SKILL.md +56 -177
- package/plugins/oh-my-codex/skills/omx-setup/SKILL.md +35 -116
- package/plugins/oh-my-codex/skills/plan/SKILL.md +45 -228
- package/plugins/oh-my-codex/skills/ralplan/SKILL.md +20 -22
- package/plugins/oh-my-codex/skills/skill/SKILL.md +82 -807
- package/plugins/oh-my-codex/skills/team/SKILL.md +32 -520
- package/plugins/oh-my-codex/skills/ultragoal/SKILL.md +47 -150
- package/plugins/oh-my-codex/skills/ultraqa/SKILL.md +75 -252
- package/plugins/oh-my-codex/skills/visual-ralph/SKILL.md +33 -111
- package/plugins/oh-my-codex/skills/worker/SKILL.md +40 -113
- package/prompts/analyst.md +27 -107
- package/prompts/api-reviewer.md +17 -84
- package/prompts/architect.md +31 -70
- package/prompts/code-reviewer.md +18 -107
- package/prompts/code-simplifier.md +32 -110
- package/prompts/critic.md +32 -54
- package/prompts/dependency-expert.md +37 -107
- package/prompts/designer.md +40 -107
- package/prompts/executor.md +26 -75
- package/prompts/information-architect.md +51 -200
- package/prompts/performance-reviewer.md +17 -81
- package/prompts/planner.md +33 -76
- package/prompts/product-analyst.md +65 -280
- package/prompts/product-manager.md +48 -216
- package/prompts/qa-tester.md +33 -104
- package/prompts/quality-reviewer.md +17 -93
- package/prompts/quality-strategist.md +31 -255
- package/prompts/researcher.md +32 -89
- package/prompts/security-reviewer.md +12 -98
- package/prompts/test-engineer.md +29 -110
- package/prompts/ux-researcher.md +46 -300
- package/prompts/verifier.md +23 -51
- package/skills/ai-slop-cleaner/SKILL.md +60 -135
- package/skills/analyze/SKILL.md +35 -111
- package/skills/autopilot/SKILL.md +72 -163
- package/skills/autoresearch-goal/SKILL.md +6 -31
- package/skills/cancel/SKILL.md +33 -392
- package/skills/code-review/SKILL.md +66 -256
- package/skills/configure-notifications/SKILL.md +30 -216
- package/skills/deep-interview/SKILL.md +11 -10
- package/skills/design/SKILL.md +32 -132
- package/skills/doctor/SKILL.md +56 -177
- package/skills/omx-setup/SKILL.md +35 -116
- package/skills/pipeline/SKILL.md +6 -89
- package/skills/plan/SKILL.md +45 -228
- package/skills/ralph/SKILL.md +6 -290
- package/skills/ralplan/SKILL.md +20 -22
- package/skills/skill/SKILL.md +82 -807
- package/skills/team/SKILL.md +32 -520
- package/skills/ultragoal/SKILL.md +47 -150
- package/skills/ultraqa/SKILL.md +75 -252
- package/skills/ultrawork/SKILL.md +6 -182
- package/skills/visual-ralph/SKILL.md +33 -111
- package/skills/worker/SKILL.md +40 -113
- package/src/scripts/__tests__/codex-native-hook.test.ts +18888 -28799
- package/src/scripts/__tests__/docs-site-contract.test.ts +2 -2
- package/src/scripts/__tests__/generated-artifact-drift.test.ts +97 -0
- package/src/scripts/__tests__/issue-3293-callsite-parity.test.ts +197 -0
- package/src/scripts/__tests__/issue-3293-cancel-transaction.test.ts +189 -0
- package/src/scripts/__tests__/issue-3293-hook-owned-cancel.test.ts +186 -0
- package/src/scripts/__tests__/issue-3311-ultragoal-native-outside-tmux.test.ts +177 -0
- package/src/scripts/__tests__/issue-3358-ultragoal-cancel-lifecycle.test.ts +201 -0
- package/src/scripts/__tests__/issue-3369-autopilot-ralplan-state-machine.test.ts +43 -0
- package/src/scripts/__tests__/issue-3481-conductor-deadlock.test.ts +77 -0
- package/src/scripts/__tests__/issue-3486-pretooluse-lock-regression.test.ts +95 -0
- package/src/scripts/__tests__/issue-3536-external-team-state-root.test.ts +216 -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__/prompt-inventory.test.ts +62 -1
- package/src/scripts/__tests__/reasoning-artifact-contract.test.ts +1 -2
- package/src/scripts/__tests__/role-intent-bootstrap-e2e-3181.test.ts +49 -59
- package/src/scripts/__tests__/role-intent-durable-recovery-3181.test.ts +61 -27
- package/src/scripts/__tests__/smoke-packed-install.test.ts +223 -23
- package/src/scripts/__tests__/verify-native-release-assets.test.ts +240 -0
- package/src/scripts/codex-native-hook.ts +3618 -1383
- package/src/scripts/codex-native-pre-post.ts +50 -24
- package/src/scripts/generate-native-release-manifest.ts +83 -79
- package/src/scripts/notify-fallback-watcher.ts +38 -38
- package/src/scripts/notify-hook/auto-nudge.ts +1 -0
- package/src/scripts/notify-hook/state-io.ts +11 -0
- package/src/scripts/notify-hook/team-dispatch.ts +8 -5
- package/src/scripts/notify-hook/team-leader-nudge.ts +32 -4
- package/src/scripts/notify-hook/team-tmux-guard.ts +3 -1
- 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 +76 -124
- package/src/scripts/postinstall-advisory.ts +67 -0
- package/src/scripts/postinstall.ts +1 -1
- package/src/scripts/prompt-inventory.ts +142 -3
- package/src/scripts/run-compiled-ci.ts +2 -0
- package/src/scripts/run-test-files.ts +1 -0
- package/src/scripts/smoke-packed-install.ts +440 -59
- package/src/scripts/sync-plugin-mirror.ts +17 -1
- package/src/scripts/sync-prompt-guidance-fragments.ts +59 -22
- package/src/scripts/tmux-hook-engine.ts +3 -3
- package/src/scripts/verify-capabilities-lock.ts +23 -0
- package/src/scripts/verify-native-release-assets.ts +39 -31
- package/templates/AGENTS.md +45 -9
- package/templates/catalog-manifest.json +6 -146
- package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts +0 -2
- package/dist/autopilot/__tests__/deep-interview-gate.test.d.ts.map +0 -1
- package/dist/autopilot/__tests__/deep-interview-gate.test.js +0 -215
- package/dist/autopilot/__tests__/deep-interview-gate.test.js.map +0 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.d.ts +0 -2
- package/dist/autopilot/__tests__/ralplan-gate.test.d.ts.map +0 -1
- package/dist/autopilot/__tests__/ralplan-gate.test.js +0 -1361
- package/dist/autopilot/__tests__/ralplan-gate.test.js.map +0 -1
- package/dist/autopilot/deep-interview-gate.d.ts +0 -18
- package/dist/autopilot/deep-interview-gate.d.ts.map +0 -1
- package/dist/autopilot/deep-interview-gate.js +0 -396
- package/dist/autopilot/deep-interview-gate.js.map +0 -1
- package/dist/autopilot/ralplan-gate.d.ts +0 -18
- package/dist/autopilot/ralplan-gate.d.ts.map +0 -1
- package/dist/autopilot/ralplan-gate.js +0 -148
- package/dist/autopilot/ralplan-gate.js.map +0 -1
- package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/prometheus-strict-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prometheus-strict-contract.test.js +0 -320
- package/dist/hooks/__tests__/prometheus-strict-contract.test.js.map +0 -1
- package/dist/pipeline/__tests__/orchestrator.test.d.ts +0 -2
- package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +0 -1
- package/dist/pipeline/__tests__/orchestrator.test.js +0 -770
- package/dist/pipeline/__tests__/orchestrator.test.js.map +0 -1
- package/dist/pipeline/__tests__/stages.test.d.ts +0 -2
- package/dist/pipeline/__tests__/stages.test.d.ts.map +0 -1
- package/dist/pipeline/__tests__/stages.test.js +0 -1778
- package/dist/pipeline/__tests__/stages.test.js.map +0 -1
- package/dist/pipeline/index.d.ts +0 -25
- package/dist/pipeline/index.d.ts.map +0 -1
- package/dist/pipeline/index.js +0 -17
- package/dist/pipeline/index.js.map +0 -1
- package/dist/pipeline/orchestrator.d.ts +0 -52
- package/dist/pipeline/orchestrator.d.ts.map +0 -1
- package/dist/pipeline/orchestrator.js +0 -399
- package/dist/pipeline/orchestrator.js.map +0 -1
- package/dist/pipeline/review-verdict.d.ts +0 -3
- package/dist/pipeline/review-verdict.d.ts.map +0 -1
- package/dist/pipeline/review-verdict.js +0 -14
- package/dist/pipeline/review-verdict.js.map +0 -1
- package/dist/pipeline/stages/code-review.d.ts +0 -35
- package/dist/pipeline/stages/code-review.d.ts.map +0 -1
- package/dist/pipeline/stages/code-review.js +0 -55
- package/dist/pipeline/stages/code-review.js.map +0 -1
- package/dist/pipeline/stages/deep-interview.d.ts +0 -15
- package/dist/pipeline/stages/deep-interview.d.ts.map +0 -1
- package/dist/pipeline/stages/deep-interview.js +0 -32
- package/dist/pipeline/stages/deep-interview.js.map +0 -1
- package/dist/pipeline/stages/ralph-verify.d.ts +0 -53
- package/dist/pipeline/stages/ralph-verify.d.ts.map +0 -1
- package/dist/pipeline/stages/ralph-verify.js +0 -89
- package/dist/pipeline/stages/ralph-verify.js.map +0 -1
- package/dist/pipeline/stages/ralplan.d.ts +0 -27
- package/dist/pipeline/stages/ralplan.d.ts.map +0 -1
- package/dist/pipeline/stages/ralplan.js +0 -152
- package/dist/pipeline/stages/ralplan.js.map +0 -1
- package/dist/pipeline/stages/team-exec.d.ts +0 -52
- package/dist/pipeline/stages/team-exec.d.ts.map +0 -1
- package/dist/pipeline/stages/team-exec.js +0 -266
- package/dist/pipeline/stages/team-exec.js.map +0 -1
- package/dist/pipeline/stages/ultragoal.d.ts +0 -23
- package/dist/pipeline/stages/ultragoal.d.ts.map +0 -1
- package/dist/pipeline/stages/ultragoal.js +0 -53
- package/dist/pipeline/stages/ultragoal.js.map +0 -1
- package/dist/pipeline/stages/ultraqa.d.ts +0 -33
- package/dist/pipeline/stages/ultraqa.d.ts.map +0 -1
- package/dist/pipeline/stages/ultraqa.js +0 -49
- package/dist/pipeline/stages/ultraqa.js.map +0 -1
- package/dist/pipeline/types.d.ts +0 -124
- package/dist/pipeline/types.d.ts.map +0 -1
- package/dist/pipeline/types.js +0 -8
- package/dist/pipeline/types.js.map +0 -1
- package/dist/ralplan/__tests__/consensus-gate.test.d.ts +0 -2
- package/dist/ralplan/__tests__/consensus-gate.test.d.ts.map +0 -1
- package/dist/ralplan/__tests__/consensus-gate.test.js +0 -1455
- package/dist/ralplan/__tests__/consensus-gate.test.js.map +0 -1
- package/dist/ralplan/consensus-gate.d.ts +0 -62
- package/dist/ralplan/consensus-gate.d.ts.map +0 -1
- package/dist/ralplan/consensus-gate.js +0 -760
- package/dist/ralplan/consensus-gate.js.map +0 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts +0 -25
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts.map +0 -1
- package/dist/scripts/notify-hook/ralph-session-resume.js +0 -377
- package/dist/scripts/notify-hook/ralph-session-resume.js.map +0 -1
- package/dist/state/__tests__/planning-gate.test.d.ts +0 -2
- package/dist/state/__tests__/planning-gate.test.d.ts.map +0 -1
- package/dist/state/__tests__/planning-gate.test.js +0 -629
- package/dist/state/__tests__/planning-gate.test.js.map +0 -1
- package/plugins/oh-my-codex/skills/autoresearch-goal/SKILL.md +0 -39
- package/plugins/oh-my-codex/skills/pipeline/SKILL.md +0 -97
- package/plugins/oh-my-codex/skills/prometheus-strict/README.md +0 -35
- package/plugins/oh-my-codex/skills/prometheus-strict/SKILL.md +0 -219
- package/plugins/oh-my-codex/skills/ralph/SKILL.md +0 -298
- package/plugins/oh-my-codex/skills/ultrawork/SKILL.md +0 -190
- package/plugins/oh-my-codex/skills/ultrawork/references/agent-tiers.md +0 -62
- package/prompts/prometheus-strict-metis.md +0 -274
- package/prompts/prometheus-strict-momus.md +0 -82
- package/prompts/prometheus-strict-oracle.md +0 -107
- package/prompts/scholastic.md +0 -11
- package/prompts/sisyphus-lite.md +0 -111
- package/skills/ask-claude/SKILL.md +0 -12
- package/skills/ask-gemini/SKILL.md +0 -12
- package/skills/build-fix/SKILL.md +0 -10
- package/skills/deepsearch/SKILL.md +0 -10
- package/skills/ecomode/SKILL.md +0 -114
- package/skills/ecomode/references/agent-tiers.md +0 -61
- package/skills/frontend-ui-ux/SKILL.md +0 -16
- package/skills/help/SKILL.md +0 -10
- package/skills/note/SKILL.md +0 -10
- package/skills/prometheus-strict/README.md +0 -35
- package/skills/prometheus-strict/SKILL.md +0 -219
- package/skills/ralph-init/SKILL.md +0 -10
- package/skills/review/SKILL.md +0 -10
- package/skills/security-review/SKILL.md +0 -10
- package/skills/swarm/SKILL.md +0 -12
- package/skills/tdd/SKILL.md +0 -104
- package/skills/trace/SKILL.md +0 -10
- package/skills/visual-verdict/SKILL.md +0 -10
- package/skills/web-clone/SKILL.md +0 -357
- package/src/scripts/notify-hook/ralph-session-resume.ts +0 -466
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
import { describe, it } from 'node:test';
|
|
2
2
|
import assert from 'node:assert/strict';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { createHash } from 'node:crypto';
|
|
4
|
+
import { existsSync, realpathSync } from 'node:fs';
|
|
5
|
+
import { chmod, mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
|
|
6
|
+
import { spawnSync } from 'node:child_process';
|
|
7
|
+
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { tmpdir as osTmpdir } from 'node:os';
|
|
5
9
|
import { dirname, join } from 'node:path';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
10
|
+
import { isInstallVersionBump, isNewerVersion, maybeCheckAndPromptUpdate, readUserInstallStamp, resolveAutoUpdateMode, resolveInstalledCliEntry, formatDeferredSetupCommand, resolveSetupRefreshArgs, runDeferredGlobalUpdate, runGlobalUpdate, runImmediateUpdate, shouldCheckForUpdates, spawnInstalledSetupRefresh, writeUserInstallStamp, } from '../update.js';
|
|
11
|
+
import { isWorkingTreeInstall, resolveBunGlobalBin, resolvePackageManagerOwnership, } from '../package-manager-ownership.js';
|
|
12
|
+
const tmpdir = () => realpathSync(osTmpdir());
|
|
8
13
|
const PACKAGE_NAME = 'oh-my-codex';
|
|
14
|
+
const frozenNpmOwnership = {
|
|
15
|
+
manager: 'npm',
|
|
16
|
+
npmCommand: { kind: 'node-script', command: process.execPath, commandArgs: ['/configured/npm-cli.js'] },
|
|
17
|
+
npmPrefix: '/configured',
|
|
18
|
+
globalInstallRoot: '/configured/node_modules',
|
|
19
|
+
packageRoot: '/configured/node_modules/oh-my-codex',
|
|
20
|
+
environment: { OMX_UPDATE_TEST: '1' },
|
|
21
|
+
};
|
|
9
22
|
describe('isNewerVersion', () => {
|
|
10
23
|
it('returns true when latest has higher major', () => {
|
|
11
24
|
assert.equal(isNewerVersion('1.0.0', '2.0.0'), true);
|
|
@@ -150,6 +163,45 @@ describe('maybeCheckAndPromptUpdate', () => {
|
|
|
150
163
|
});
|
|
151
164
|
}
|
|
152
165
|
}
|
|
166
|
+
it('stays silent and stamps the cadence for an unowned working-tree build', async () => {
|
|
167
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-worktree-check-'));
|
|
168
|
+
const statePath = join(cwd, '.omx', 'state', 'update-check.json');
|
|
169
|
+
const originalMode = process.env.OMX_AUTO_UPDATE;
|
|
170
|
+
const originalLog = console.log;
|
|
171
|
+
const logs = [];
|
|
172
|
+
let latestCalls = 0;
|
|
173
|
+
console.log = (...args) => {
|
|
174
|
+
logs.push(args.map((arg) => String(arg)).join(' '));
|
|
175
|
+
};
|
|
176
|
+
delete process.env.OMX_AUTO_UPDATE;
|
|
177
|
+
try {
|
|
178
|
+
await withInteractiveTty(async () => {
|
|
179
|
+
await maybeCheckAndPromptUpdate(cwd, {
|
|
180
|
+
getCurrentVersion: async () => '0.14.0',
|
|
181
|
+
fetchLatestVersion: async () => {
|
|
182
|
+
latestCalls += 1;
|
|
183
|
+
return '0.14.1';
|
|
184
|
+
},
|
|
185
|
+
isWorkingTreeInstall: () => true,
|
|
186
|
+
resolvePackageManagerOwnership: async () => null,
|
|
187
|
+
askYesNo: async () => {
|
|
188
|
+
throw new Error('an unowned build must never prompt for an update');
|
|
189
|
+
},
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
assert.deepEqual(logs, []);
|
|
193
|
+
assert.equal(latestCalls, 0);
|
|
194
|
+
const state = JSON.parse(await readFile(statePath, 'utf-8'));
|
|
195
|
+
assert.ok(state.last_checked_at, 'the cadence must be stamped so the skip is not re-probed each launch');
|
|
196
|
+
}
|
|
197
|
+
finally {
|
|
198
|
+
if (typeof originalMode === 'string') {
|
|
199
|
+
process.env.OMX_AUTO_UPDATE = originalMode;
|
|
200
|
+
}
|
|
201
|
+
console.log = originalLog;
|
|
202
|
+
await rm(cwd, { recursive: true, force: true });
|
|
203
|
+
}
|
|
204
|
+
});
|
|
153
205
|
it('schedules a deferred update after a successful startup prompt', async () => {
|
|
154
206
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-update-'));
|
|
155
207
|
const originalMode = process.env.OMX_AUTO_UPDATE;
|
|
@@ -523,165 +575,48 @@ describe('maybeCheckAndPromptUpdate', () => {
|
|
|
523
575
|
}
|
|
524
576
|
});
|
|
525
577
|
});
|
|
526
|
-
describe('
|
|
527
|
-
function spawnErrorResult(code) {
|
|
528
|
-
const error = Object.assign(new Error(`spawnSync npm ${code}`), { code });
|
|
529
|
-
return { status: null, signal: null, error, stdout: '', stderr: '', output: [null, '', ''], pid: 0 };
|
|
530
|
-
}
|
|
531
|
-
function enoentResult() {
|
|
532
|
-
return spawnErrorResult('ENOENT');
|
|
533
|
-
}
|
|
534
|
-
function einvalResult() {
|
|
535
|
-
return spawnErrorResult('EINVAL');
|
|
536
|
-
}
|
|
578
|
+
describe('frozen package-manager update ownership', () => {
|
|
537
579
|
function okResult(stdout = '') {
|
|
538
580
|
return { status: 0, signal: null, error: undefined, stdout, stderr: '', output: [null, stdout, ''], pid: 0 };
|
|
539
581
|
}
|
|
540
|
-
it('
|
|
541
|
-
const calls = [];
|
|
542
|
-
const result = runGlobalUpdate(((command, args) => {
|
|
543
|
-
calls.push({ command, args: args });
|
|
544
|
-
return command === 'npm' ? enoentResult() : okResult();
|
|
545
|
-
}), 'win32');
|
|
546
|
-
assert.equal(result.ok, true);
|
|
547
|
-
assert.deepEqual(calls.map((call) => call.command), ['npm', 'npm.cmd']);
|
|
548
|
-
assert.deepEqual(calls[0].args, ['install', '-g', 'oh-my-codex@latest']);
|
|
549
|
-
assert.deepEqual(calls[1].args, ['install', '-g', 'oh-my-codex@latest']);
|
|
550
|
-
});
|
|
551
|
-
it('falls back through cmd.exe when win32 npm.cmd cannot be spawned', () => {
|
|
552
|
-
const calls = [];
|
|
553
|
-
const result = runGlobalUpdate(((command, args) => {
|
|
554
|
-
calls.push({ command, args: args });
|
|
555
|
-
if (command === 'npm')
|
|
556
|
-
return enoentResult();
|
|
557
|
-
if (command === 'npm.cmd')
|
|
558
|
-
return einvalResult();
|
|
559
|
-
return okResult();
|
|
560
|
-
}), 'win32');
|
|
561
|
-
assert.equal(result.ok, true);
|
|
562
|
-
assert.deepEqual(calls.map((call) => call.command), ['npm', 'npm.cmd', 'cmd.exe']);
|
|
563
|
-
assert.deepEqual(calls[0].args, ['install', '-g', 'oh-my-codex@latest']);
|
|
564
|
-
assert.deepEqual(calls[1].args, ['install', '-g', 'oh-my-codex@latest']);
|
|
565
|
-
assert.deepEqual(calls[2].args, ['/d', '/s', '/c', 'npm', 'install', '-g', 'oh-my-codex@latest']);
|
|
566
|
-
});
|
|
567
|
-
it('uses cmd.exe for win32 global installs when direct npm returns EINVAL', () => {
|
|
568
|
-
const calls = [];
|
|
569
|
-
const result = runGlobalUpdate(((command, args) => {
|
|
570
|
-
calls.push({ command, args: args });
|
|
571
|
-
return command === 'npm' ? einvalResult() : okResult();
|
|
572
|
-
}), 'win32');
|
|
573
|
-
assert.equal(result.ok, true);
|
|
574
|
-
assert.deepEqual(calls.map((call) => call.command), ['npm', 'cmd.exe']);
|
|
575
|
-
assert.deepEqual(calls[1].args, ['/d', '/s', '/c', 'npm', 'install', '-g', 'oh-my-codex@latest']);
|
|
576
|
-
});
|
|
577
|
-
it('does not shell-wrap non-target win32 npm operations when npm.cmd returns EINVAL', () => {
|
|
578
|
-
const calls = [];
|
|
579
|
-
const root = resolveGlobalInstallRoot(((command, args) => {
|
|
580
|
-
calls.push({ command, args: args });
|
|
581
|
-
if (command === 'npm')
|
|
582
|
-
return enoentResult();
|
|
583
|
-
if (command === 'npm.cmd')
|
|
584
|
-
return einvalResult();
|
|
585
|
-
return okResult('unexpected');
|
|
586
|
-
}), 'win32');
|
|
587
|
-
assert.equal(root, null);
|
|
588
|
-
assert.deepEqual(calls.map((call) => call.command), ['npm', 'npm.cmd']);
|
|
589
|
-
assert.deepEqual(calls[0].args, ['root', '-g']);
|
|
590
|
-
assert.deepEqual(calls[1].args, ['root', '-g']);
|
|
591
|
-
});
|
|
592
|
-
it('keeps the direct npm path when it succeeds', () => {
|
|
593
|
-
const calls = [];
|
|
594
|
-
const result = runGlobalUpdate(((command, args) => {
|
|
595
|
-
calls.push({ command, args: args });
|
|
596
|
-
return okResult();
|
|
597
|
-
}), 'win32');
|
|
598
|
-
assert.equal(result.ok, true);
|
|
599
|
-
assert.deepEqual(calls.map((call) => call.command), ['npm']);
|
|
600
|
-
assert.deepEqual(calls[0].args, ['install', '-g', 'oh-my-codex@latest']);
|
|
601
|
-
});
|
|
602
|
-
it('does not fall back to npm.cmd for non-Windows ENOENT failures', () => {
|
|
582
|
+
it('rejects legacy unowned update calls without selecting an ambient manager', () => {
|
|
603
583
|
const calls = [];
|
|
604
584
|
const result = runGlobalUpdate(((command) => {
|
|
605
585
|
calls.push(command);
|
|
606
|
-
return
|
|
607
|
-
})
|
|
586
|
+
return okResult();
|
|
587
|
+
}));
|
|
608
588
|
assert.equal(result.ok, false);
|
|
609
|
-
assert.match(result.stderr, /
|
|
610
|
-
assert.deepEqual(calls, [
|
|
589
|
+
assert.match(result.stderr, /validated package-manager ownership/);
|
|
590
|
+
assert.deepEqual(calls, []);
|
|
611
591
|
});
|
|
612
|
-
it('
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
if (command === 'git' && args[0] === 'rev-parse') {
|
|
623
|
-
return okResult('1234567890abcdef\n');
|
|
624
|
-
}
|
|
625
|
-
if (command === 'npm' && args[0] === 'pack') {
|
|
626
|
-
writeFileSync(join(options?.cwd ?? process.cwd(), 'oh-my-codex-0.18.9.tgz'), 'packed');
|
|
627
|
-
return okResult(JSON.stringify([{ filename: 'oh-my-codex-0.18.9.tgz' }]));
|
|
628
|
-
}
|
|
629
|
-
return okResult();
|
|
630
|
-
}), 'linux');
|
|
631
|
-
assert.equal(result.ok, true);
|
|
632
|
-
assert.deepEqual(calls.map((call) => [call.command, ...call.args.slice(0, 3)]), [
|
|
633
|
-
['git', 'clone', '--depth', '1'],
|
|
634
|
-
['git', 'rev-parse', 'HEAD'],
|
|
635
|
-
['npm', 'install', '--global=false', '--location=project'],
|
|
636
|
-
['npm', 'run', 'prepack'],
|
|
637
|
-
['npm', 'pack', '--ignore-scripts', '--json'],
|
|
638
|
-
['npm', 'install', '-g', join(calls[2].cwd ?? '', 'oh-my-codex-0.18.9.tgz')],
|
|
639
|
-
]);
|
|
640
|
-
const dependencyInstall = calls.find((call) => call.command === 'npm' && call.args[0] === 'install' && call.args.includes('--include=dev'));
|
|
641
|
-
assert.equal(dependencyInstall?.env?.npm_config_global, 'false');
|
|
642
|
-
assert.equal(dependencyInstall?.env?.npm_config_location, 'project');
|
|
643
|
-
assert.equal(calls.some((call) => call.args.includes('github:Yeachan-Heo/oh-my-codex#dev')), false);
|
|
644
|
-
}
|
|
645
|
-
finally {
|
|
646
|
-
if (typeof originalNpmLocation === 'string') {
|
|
647
|
-
process.env.npm_config_location = originalNpmLocation;
|
|
648
|
-
}
|
|
649
|
-
else {
|
|
650
|
-
delete process.env.npm_config_location;
|
|
651
|
-
}
|
|
652
|
-
}
|
|
592
|
+
it('requires ownership when the native updater remains selected beside an explicit setup seam', async () => {
|
|
593
|
+
const result = await runImmediateUpdate('/tmp/omx-unowned-update', {
|
|
594
|
+
getCurrentVersion: async () => '0.14.0',
|
|
595
|
+
fetchLatestVersion: async () => '0.14.1',
|
|
596
|
+
isWorkingTreeInstall: () => false,
|
|
597
|
+
resolvePackageManagerOwnership: async () => null,
|
|
598
|
+
runSetupRefresh: async () => ({ ok: true, stderr: '' }),
|
|
599
|
+
});
|
|
600
|
+
assert.equal(result.status, 'failed');
|
|
653
601
|
});
|
|
654
|
-
it('
|
|
602
|
+
it('uses only the selected frozen npm command for dev packaging and installation', () => {
|
|
655
603
|
const calls = [];
|
|
604
|
+
const owner = {
|
|
605
|
+
...frozenNpmOwnership,
|
|
606
|
+
npmCommand: { kind: 'node-script', command: '/configured/node', commandArgs: ['/configured/npm-cli.js'] },
|
|
607
|
+
};
|
|
656
608
|
const result = runGlobalUpdate('github:Yeachan-Heo/oh-my-codex#dev', ((command, args) => {
|
|
657
|
-
calls.push({ command, args: args });
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
return okResult();
|
|
661
|
-
}
|
|
662
|
-
if (command === 'git' && args[0] === 'rev-parse')
|
|
663
|
-
return okResult('1234567890abcdef\n');
|
|
664
|
-
if (command === 'npm')
|
|
665
|
-
return enoentResult();
|
|
666
|
-
if (command === 'npm.cmd')
|
|
667
|
-
return einvalResult();
|
|
668
|
-
return okResult();
|
|
669
|
-
}), 'win32');
|
|
609
|
+
calls.push({ command, args: [...args] });
|
|
610
|
+
return command === 'git' ? { ...okResult(), stdout: args[0] === 'rev-parse' ? '1234567890abcdef\n' : '' } : okResult();
|
|
611
|
+
}), 'win32', owner);
|
|
670
612
|
assert.equal(result.ok, false);
|
|
671
|
-
assert.match(result.stderr, /
|
|
672
|
-
assert.deepEqual(calls.map((call) => call.command), [
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
calls.push({ command, args: args });
|
|
679
|
-
return command === 'npm' ? enoentResult() : okResult('C:\\Users\\alice\\AppData\\Roaming\\npm\\node_modules\r\n');
|
|
680
|
-
}), 'win32');
|
|
681
|
-
assert.equal(root, 'C:\\Users\\alice\\AppData\\Roaming\\npm\\node_modules');
|
|
682
|
-
assert.deepEqual(calls.map((call) => call.command), ['npm', 'npm.cmd']);
|
|
683
|
-
assert.deepEqual(calls[0].args, ['root', '-g']);
|
|
684
|
-
assert.deepEqual(calls[1].args, ['root', '-g']);
|
|
613
|
+
assert.match(result.stderr, /npm pack did not produce/);
|
|
614
|
+
assert.deepEqual(calls.map((call) => call.command), [
|
|
615
|
+
'git', 'git', '/configured/node', '/configured/node', '/configured/node',
|
|
616
|
+
]);
|
|
617
|
+
for (const call of calls.slice(2)) {
|
|
618
|
+
assert.deepEqual(call.args.slice(0, 1), ['/configured/npm-cli.js']);
|
|
619
|
+
}
|
|
685
620
|
});
|
|
686
621
|
});
|
|
687
622
|
describe('runImmediateUpdate', () => {
|
|
@@ -1054,9 +989,37 @@ describe('runImmediateUpdate failure diagnostics', () => {
|
|
|
1054
989
|
});
|
|
1055
990
|
assert.equal(result.status, 'failed');
|
|
1056
991
|
assert.equal(refreshCalls, 0);
|
|
1057
|
-
assert.match(logs.join('\n'), /Update failed while running npm install -g oh-my-codex@latest/);
|
|
992
|
+
assert.match(logs.join('\n'), /Update failed while running the selected npm transaction \(npm install -g oh-my-codex@latest\)/);
|
|
1058
993
|
assert.match(logs.join('\n'), /npm stderr: EPERM: file is locked/);
|
|
1059
|
-
assert.match(logs.join('\n'), /
|
|
994
|
+
assert.match(logs.join('\n'), /ownership-safe recovery command: omx update/);
|
|
995
|
+
}
|
|
996
|
+
finally {
|
|
997
|
+
console.log = originalLog;
|
|
998
|
+
await rm(cwd, { recursive: true, force: true });
|
|
999
|
+
}
|
|
1000
|
+
});
|
|
1001
|
+
it('refuses an explicit update on an unowned working-tree build instead of demanding a reinstall', async () => {
|
|
1002
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-worktree-update-'));
|
|
1003
|
+
const originalLog = console.log;
|
|
1004
|
+
const logs = [];
|
|
1005
|
+
let latestCalls = 0;
|
|
1006
|
+
console.log = (...args) => {
|
|
1007
|
+
logs.push(args.map((arg) => String(arg)).join(' '));
|
|
1008
|
+
};
|
|
1009
|
+
try {
|
|
1010
|
+
const result = await runImmediateUpdate(cwd, {
|
|
1011
|
+
getCurrentVersion: async () => '0.14.0',
|
|
1012
|
+
fetchLatestVersion: async () => {
|
|
1013
|
+
latestCalls += 1;
|
|
1014
|
+
return '0.14.1';
|
|
1015
|
+
},
|
|
1016
|
+
isWorkingTreeInstall: () => true,
|
|
1017
|
+
resolvePackageManagerOwnership: async () => null,
|
|
1018
|
+
});
|
|
1019
|
+
assert.equal(result.status, 'skipped');
|
|
1020
|
+
assert.equal(latestCalls, 0);
|
|
1021
|
+
assert.match(logs.join('\n'), /runs from a working tree/);
|
|
1022
|
+
assert.doesNotMatch(logs.join('\n'), /Reinstall OMX globally/);
|
|
1060
1023
|
}
|
|
1061
1024
|
finally {
|
|
1062
1025
|
console.log = originalLog;
|
|
@@ -1065,7 +1028,7 @@ describe('runImmediateUpdate failure diagnostics', () => {
|
|
|
1065
1028
|
});
|
|
1066
1029
|
});
|
|
1067
1030
|
describe('runDeferredGlobalUpdate', () => {
|
|
1068
|
-
it('launches a detached
|
|
1031
|
+
it('launches a detached Node worker with a frozen ownership payload on Windows', async () => {
|
|
1069
1032
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-deferred-update-'));
|
|
1070
1033
|
const calls = [];
|
|
1071
1034
|
const listeners = [];
|
|
@@ -1079,23 +1042,50 @@ describe('runDeferredGlobalUpdate', () => {
|
|
|
1079
1042
|
},
|
|
1080
1043
|
unref() { },
|
|
1081
1044
|
};
|
|
1082
|
-
}), 'win32', 12345);
|
|
1045
|
+
}), 'win32', 12345, frozenNpmOwnership);
|
|
1083
1046
|
assert.equal(result.ok, true);
|
|
1084
1047
|
assert.match(result.logPath ?? '', /\.omx[\\/]logs[\\/]update-/);
|
|
1085
1048
|
assert.equal(calls.length, 1);
|
|
1086
|
-
assert.equal(calls[0]
|
|
1087
|
-
assert.
|
|
1049
|
+
assert.equal(calls[0]?.command, process.execPath);
|
|
1050
|
+
assert.match(calls[0]?.args[0] ?? '', /update-worker\.js$/);
|
|
1051
|
+
const payloadPath = calls[0]?.args[1];
|
|
1052
|
+
assert.equal(typeof payloadPath, 'string');
|
|
1053
|
+
const payload = JSON.parse(await readFile(String(payloadPath), 'utf-8'));
|
|
1054
|
+
assert.deepEqual(payload, {
|
|
1055
|
+
cwd,
|
|
1056
|
+
logPath: result.logPath,
|
|
1057
|
+
parentPid: 12345,
|
|
1058
|
+
ownership: frozenNpmOwnership,
|
|
1059
|
+
setupArgs: ['setup'],
|
|
1060
|
+
});
|
|
1088
1061
|
assert.deepEqual(listeners, ['error']);
|
|
1089
|
-
assert.equal(calls[0]
|
|
1090
|
-
assert.equal(calls[0]
|
|
1091
|
-
assert.equal(calls[0]
|
|
1092
|
-
assert.equal(calls[0]
|
|
1093
|
-
assert.
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1062
|
+
assert.equal(calls[0]?.options.detached, true);
|
|
1063
|
+
assert.equal(calls[0]?.options.stdio, 'ignore');
|
|
1064
|
+
assert.equal(calls[0]?.options.windowsHide, true);
|
|
1065
|
+
assert.equal(calls[0]?.options.cwd, cwd);
|
|
1066
|
+
assert.deepEqual(calls[0]?.options.env, { OMX_UPDATE_TEST: '1', OMX_SKIP_NATIVE_AGENT_REFRESH: '1' });
|
|
1067
|
+
}
|
|
1068
|
+
finally {
|
|
1069
|
+
await rm(cwd, { recursive: true, force: true });
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
1072
|
+
it('removes the frozen staged payload when the detached launcher emits an error', async () => {
|
|
1073
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-deferred-update-launcher-error-'));
|
|
1074
|
+
let payloadPath = '';
|
|
1075
|
+
try {
|
|
1076
|
+
const result = runDeferredGlobalUpdate(cwd, ((_command, args) => {
|
|
1077
|
+
payloadPath = String(args[1]);
|
|
1078
|
+
return {
|
|
1079
|
+
once(event, listener) {
|
|
1080
|
+
if (event === 'error')
|
|
1081
|
+
listener(new Error('launcher failed'));
|
|
1082
|
+
return this;
|
|
1083
|
+
},
|
|
1084
|
+
unref() { },
|
|
1085
|
+
};
|
|
1086
|
+
}), 'linux', 12345, frozenNpmOwnership);
|
|
1087
|
+
assert.equal(result.ok, true);
|
|
1088
|
+
assert.equal(existsSync(payloadPath), false);
|
|
1099
1089
|
}
|
|
1100
1090
|
finally {
|
|
1101
1091
|
await rm(cwd, { recursive: true, force: true });
|
|
@@ -1115,10 +1105,11 @@ describe('runDeferredGlobalUpdate', () => {
|
|
|
1115
1105
|
},
|
|
1116
1106
|
unref() { },
|
|
1117
1107
|
};
|
|
1118
|
-
}), 'linux', 12345);
|
|
1108
|
+
}), 'linux', 12345, frozenNpmOwnership);
|
|
1119
1109
|
assert.equal(result.ok, true);
|
|
1120
1110
|
assert.equal(calls.length, 1);
|
|
1121
|
-
|
|
1111
|
+
const payload = JSON.parse(await readFile(calls[0]?.args[1] ?? '', 'utf-8'));
|
|
1112
|
+
assert.deepEqual(payload.setupArgs, ['setup', '--scope', 'user', '--plugin', '--mcp', 'none', '--disable-team']);
|
|
1122
1113
|
assert.equal(calls[0].options?.env?.OMX_SKIP_NATIVE_AGENT_REFRESH, '1');
|
|
1123
1114
|
}
|
|
1124
1115
|
finally {
|
|
@@ -1140,13 +1131,12 @@ describe('runDeferredGlobalUpdate', () => {
|
|
|
1140
1131
|
},
|
|
1141
1132
|
unref() { },
|
|
1142
1133
|
};
|
|
1143
|
-
}), 'linux', 12345);
|
|
1134
|
+
}), 'linux', 12345, frozenNpmOwnership);
|
|
1144
1135
|
await writeFile(setupScopePath, JSON.stringify({ scope: 'project', installMode: 'legacy', mcpMode: 'compat' }, null, 2));
|
|
1145
1136
|
assert.equal(result.ok, true);
|
|
1146
1137
|
assert.equal(calls.length, 1);
|
|
1147
|
-
|
|
1148
|
-
assert.
|
|
1149
|
-
assert.doesNotMatch(calls[0].args[1], /legacy/);
|
|
1138
|
+
const payload = JSON.parse(await readFile(calls[0]?.args[1] ?? '', 'utf-8'));
|
|
1139
|
+
assert.deepEqual(payload.setupArgs, ['setup', '--scope', 'user', '--plugin', '--mcp', 'none', '--disable-team']);
|
|
1150
1140
|
}
|
|
1151
1141
|
finally {
|
|
1152
1142
|
await rm(cwd, { recursive: true, force: true });
|
|
@@ -1157,6 +1147,176 @@ describe('runDeferredGlobalUpdate', () => {
|
|
|
1157
1147
|
assert.equal(formatDeferredSetupCommand('linux', 'omx tool', args), "'omx tool' 'setup' '--scope' 'user project' '--mcp' 'none'\\''; echo pwned #' '--flag' ''");
|
|
1158
1148
|
assert.equal(formatDeferredSetupCommand('win32', 'omx tool', args), "& 'omx tool' 'setup' '--scope' 'user project' '--mcp' 'none''; echo pwned #' '--flag' ''");
|
|
1159
1149
|
});
|
|
1150
|
+
describe('deferred update worker', () => {
|
|
1151
|
+
it('retains refresh suppression and removes the verified staging directory after execution', async () => {
|
|
1152
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-update-worker-'));
|
|
1153
|
+
const globalRoot = join(root, 'global');
|
|
1154
|
+
const packageRoot = join(globalRoot, PACKAGE_NAME);
|
|
1155
|
+
const stage = join(root, 'omx-update-stage');
|
|
1156
|
+
const payloadPath = join(stage, 'transaction.json');
|
|
1157
|
+
const capturePath = join(root, 'setup-capture.json');
|
|
1158
|
+
const codexHome = join(root, 'codex-home');
|
|
1159
|
+
const stampPath = join(codexHome, '.omx', 'install-state.json');
|
|
1160
|
+
const npmCliPath = join(root, 'npm-cli.js');
|
|
1161
|
+
const cliPath = join(packageRoot, 'dist', 'cli.js');
|
|
1162
|
+
const workerPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'update-worker.js');
|
|
1163
|
+
try {
|
|
1164
|
+
await mkdir(dirname(cliPath), { recursive: true });
|
|
1165
|
+
await writeFile(join(packageRoot, 'package.json'), JSON.stringify({ name: PACKAGE_NAME, version: '0.14.1', bin: { omx: 'dist/cli.js' } }));
|
|
1166
|
+
await writeFile(cliPath, [
|
|
1167
|
+
"import { existsSync, writeFileSync } from 'node:fs';",
|
|
1168
|
+
"writeFileSync(process.env.OMX_UPDATE_CAPTURE_PATH, JSON.stringify({ args: process.argv.slice(2), skip: process.env.OMX_SKIP_NATIVE_AGENT_REFRESH, stampPresent: existsSync(process.env.OMX_UPDATE_STAMP_PATH) }));",
|
|
1169
|
+
].join('\n'));
|
|
1170
|
+
await writeFile(npmCliPath, [
|
|
1171
|
+
"const args = process.argv.slice(2);",
|
|
1172
|
+
"if (args[0] === 'root') process.stdout.write(process.env.OMX_UPDATE_GLOBAL_ROOT + '\\n');",
|
|
1173
|
+
"else if (args[0] === 'prefix') process.stdout.write(process.env.OMX_UPDATE_PREFIX + '\\n');",
|
|
1174
|
+
].join('\n'));
|
|
1175
|
+
await mkdir(stage, { recursive: true });
|
|
1176
|
+
await chmod(stage, 0o700);
|
|
1177
|
+
const ownership = {
|
|
1178
|
+
manager: 'npm',
|
|
1179
|
+
npmCommand: { kind: 'node-script', command: process.execPath, commandArgs: [npmCliPath] },
|
|
1180
|
+
npmPrefix: root,
|
|
1181
|
+
globalInstallRoot: globalRoot,
|
|
1182
|
+
packageRoot,
|
|
1183
|
+
environment: {
|
|
1184
|
+
OMX_UPDATE_CAPTURE_PATH: capturePath,
|
|
1185
|
+
OMX_UPDATE_GLOBAL_ROOT: globalRoot,
|
|
1186
|
+
OMX_UPDATE_PREFIX: root,
|
|
1187
|
+
CODEX_HOME: codexHome,
|
|
1188
|
+
OMX_UPDATE_STAMP_PATH: stampPath,
|
|
1189
|
+
},
|
|
1190
|
+
};
|
|
1191
|
+
const serialized = JSON.stringify({ cwd: root, logPath: join(root, 'update.log'), parentPid: 999999, ownership, setupArgs: ['setup', '--scope', 'project'] });
|
|
1192
|
+
await writeFile(payloadPath, serialized, { mode: 0o600 });
|
|
1193
|
+
const digest = (contents) => createHash('sha256').update(contents).digest('hex');
|
|
1194
|
+
const result = spawnSync(process.execPath, [workerPath, payloadPath, digest(serialized), digest(await readFile(workerPath))], {
|
|
1195
|
+
encoding: 'utf-8',
|
|
1196
|
+
timeout: 10000,
|
|
1197
|
+
});
|
|
1198
|
+
assert.equal(result.status, 0, result.stderr);
|
|
1199
|
+
assert.deepEqual(JSON.parse(await readFile(capturePath, 'utf-8')), {
|
|
1200
|
+
args: ['setup', '--scope', 'project'],
|
|
1201
|
+
skip: '1',
|
|
1202
|
+
stampPresent: false,
|
|
1203
|
+
});
|
|
1204
|
+
const stamp = JSON.parse(await readFile(stampPath, 'utf-8'));
|
|
1205
|
+
assert.deepEqual({ ...stamp, updated_at: undefined }, {
|
|
1206
|
+
installed_version: '0.14.1',
|
|
1207
|
+
setup_completed_version: '0.14.1',
|
|
1208
|
+
install_channel: 'stable',
|
|
1209
|
+
install_source: 'oh-my-codex@latest',
|
|
1210
|
+
package_manager: 'npm',
|
|
1211
|
+
updated_at: undefined,
|
|
1212
|
+
});
|
|
1213
|
+
assert.match(stamp.updated_at, /^\d{4}-\d{2}-\d{2}T/);
|
|
1214
|
+
await assert.rejects(readFile(payloadPath), { code: 'ENOENT' });
|
|
1215
|
+
await assert.rejects(readFile(stage), { code: 'ENOENT' });
|
|
1216
|
+
await writeFile(join(packageRoot, 'package.json'), JSON.stringify({ name: 'unexpected-package', version: '0.14.1', bin: { omx: 'dist/cli.js' } }));
|
|
1217
|
+
await mkdir(stage, { recursive: true });
|
|
1218
|
+
await chmod(stage, 0o700);
|
|
1219
|
+
await writeFile(payloadPath, serialized, { mode: 0o600 });
|
|
1220
|
+
const rejected = spawnSync(process.execPath, [workerPath, payloadPath, digest(serialized), digest(await readFile(workerPath))], {
|
|
1221
|
+
encoding: 'utf-8',
|
|
1222
|
+
timeout: 10000,
|
|
1223
|
+
});
|
|
1224
|
+
assert.equal(rejected.status, 1, rejected.stderr);
|
|
1225
|
+
await assert.rejects(readFile(stage), { code: 'ENOENT' });
|
|
1226
|
+
}
|
|
1227
|
+
finally {
|
|
1228
|
+
await rm(root, { recursive: true, force: true });
|
|
1229
|
+
}
|
|
1230
|
+
});
|
|
1231
|
+
it('rejects a worker whose frozen identity digest no longer matches', async () => {
|
|
1232
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-update-worker-integrity-'));
|
|
1233
|
+
const stage = join(root, 'omx-update-integrity');
|
|
1234
|
+
const payloadPath = join(stage, 'transaction.json');
|
|
1235
|
+
const workerPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'update-worker.js');
|
|
1236
|
+
try {
|
|
1237
|
+
await mkdir(stage, { recursive: true });
|
|
1238
|
+
await chmod(stage, 0o700);
|
|
1239
|
+
const serialized = '{}';
|
|
1240
|
+
await writeFile(payloadPath, serialized, { mode: 0o600 });
|
|
1241
|
+
const digest = (contents) => createHash('sha256').update(contents).digest('hex');
|
|
1242
|
+
const result = spawnSync(process.execPath, [workerPath, payloadPath, digest(serialized), digest('different worker')], {
|
|
1243
|
+
encoding: 'utf-8',
|
|
1244
|
+
timeout: 10000,
|
|
1245
|
+
});
|
|
1246
|
+
assert.equal(result.status, 1);
|
|
1247
|
+
assert.equal(existsSync(join(root, 'update.log')), false);
|
|
1248
|
+
}
|
|
1249
|
+
finally {
|
|
1250
|
+
await rm(root, { recursive: true, force: true });
|
|
1251
|
+
}
|
|
1252
|
+
});
|
|
1253
|
+
it('rejects a signed deferred payload with an invalid parent transaction boundary', async () => {
|
|
1254
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-update-worker-payload-'));
|
|
1255
|
+
const stage = join(root, 'omx-update-payload');
|
|
1256
|
+
const payloadPath = join(stage, 'transaction.json');
|
|
1257
|
+
const workerPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'update-worker.js');
|
|
1258
|
+
try {
|
|
1259
|
+
await mkdir(stage, { recursive: true });
|
|
1260
|
+
await chmod(stage, 0o700);
|
|
1261
|
+
const serialized = JSON.stringify({ cwd: root, logPath: join(root, 'update.log'), parentPid: 0, setupArgs: [], ownership: frozenNpmOwnership });
|
|
1262
|
+
await writeFile(payloadPath, serialized, { mode: 0o600 });
|
|
1263
|
+
const digest = (contents) => createHash('sha256').update(contents).digest('hex');
|
|
1264
|
+
const result = spawnSync(process.execPath, [workerPath, payloadPath, digest(serialized), digest(await readFile(workerPath))], {
|
|
1265
|
+
encoding: 'utf-8',
|
|
1266
|
+
timeout: 10000,
|
|
1267
|
+
});
|
|
1268
|
+
assert.equal(result.status, 1, result.stderr);
|
|
1269
|
+
assert.equal(await readFile(payloadPath, 'utf-8'), serialized);
|
|
1270
|
+
}
|
|
1271
|
+
finally {
|
|
1272
|
+
await rm(root, { recursive: true, force: true });
|
|
1273
|
+
}
|
|
1274
|
+
});
|
|
1275
|
+
it('rejects a noncanonical payload path without removing its owner-only directory', async () => {
|
|
1276
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-update-worker-noncanonical-'));
|
|
1277
|
+
const stage = join(root, 'omx-update-noncanonical');
|
|
1278
|
+
const payloadPath = join(stage, 'unrelated.json');
|
|
1279
|
+
const workerPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'update-worker.js');
|
|
1280
|
+
try {
|
|
1281
|
+
await mkdir(stage, { recursive: true });
|
|
1282
|
+
await chmod(stage, 0o700);
|
|
1283
|
+
const serialized = '{}';
|
|
1284
|
+
await writeFile(payloadPath, serialized, { mode: 0o600 });
|
|
1285
|
+
const digest = (contents) => createHash('sha256').update(contents).digest('hex');
|
|
1286
|
+
const result = spawnSync(process.execPath, [workerPath, payloadPath, digest(serialized), digest(await readFile(workerPath))], {
|
|
1287
|
+
encoding: 'utf-8',
|
|
1288
|
+
timeout: 10000,
|
|
1289
|
+
});
|
|
1290
|
+
assert.equal(result.status, 1, result.stderr);
|
|
1291
|
+
assert.equal(await readFile(payloadPath, 'utf-8'), serialized);
|
|
1292
|
+
}
|
|
1293
|
+
finally {
|
|
1294
|
+
await rm(root, { recursive: true, force: true });
|
|
1295
|
+
}
|
|
1296
|
+
});
|
|
1297
|
+
it('preserves an owner-only directory outside the scheduler staging namespace', async () => {
|
|
1298
|
+
const root = await mkdtemp(join(tmpdir(), 'omx-update-worker-foreign-stage-'));
|
|
1299
|
+
const stage = join(root, 'foreign-stage');
|
|
1300
|
+
const payloadPath = join(stage, 'transaction.json');
|
|
1301
|
+
const workerPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'update-worker.js');
|
|
1302
|
+
try {
|
|
1303
|
+
await mkdir(stage, { recursive: true });
|
|
1304
|
+
await chmod(stage, 0o700);
|
|
1305
|
+
const serialized = '{}';
|
|
1306
|
+
await writeFile(payloadPath, serialized, { mode: 0o600 });
|
|
1307
|
+
const digest = (contents) => createHash('sha256').update(contents).digest('hex');
|
|
1308
|
+
const result = spawnSync(process.execPath, [workerPath, payloadPath, digest(serialized), digest(await readFile(workerPath))], {
|
|
1309
|
+
encoding: 'utf-8',
|
|
1310
|
+
timeout: 10000,
|
|
1311
|
+
});
|
|
1312
|
+
assert.equal(result.status, 1, result.stderr);
|
|
1313
|
+
assert.equal(await readFile(payloadPath, 'utf-8'), serialized);
|
|
1314
|
+
}
|
|
1315
|
+
finally {
|
|
1316
|
+
await rm(root, { recursive: true, force: true });
|
|
1317
|
+
}
|
|
1318
|
+
});
|
|
1319
|
+
});
|
|
1160
1320
|
});
|
|
1161
1321
|
describe('post-update setup refresh handoff', () => {
|
|
1162
1322
|
it('uses the installed package bin entry when resolving the refreshed CLI', async () => {
|
|
@@ -1206,6 +1366,20 @@ describe('post-update setup refresh handoff', () => {
|
|
|
1206
1366
|
assert.equal(result.ok, true);
|
|
1207
1367
|
assert.equal(receivedTimeout, undefined);
|
|
1208
1368
|
});
|
|
1369
|
+
it('passes only the frozen ownership environment to the immediate setup child', () => {
|
|
1370
|
+
const frozenEnvironment = {
|
|
1371
|
+
CODEX_HOME: '/frozen/codex-home',
|
|
1372
|
+
OMX_SKIP_NATIVE_AGENT_REFRESH: '1',
|
|
1373
|
+
};
|
|
1374
|
+
let receivedEnvironment;
|
|
1375
|
+
const result = spawnInstalledSetupRefresh('/tmp/omx.js', '/tmp/project', ((_command, _args, options) => {
|
|
1376
|
+
receivedEnvironment = options?.env;
|
|
1377
|
+
return { status: 0, error: undefined };
|
|
1378
|
+
}), process.execPath, frozenEnvironment);
|
|
1379
|
+
assert.equal(result.ok, true);
|
|
1380
|
+
assert.deepEqual(receivedEnvironment, frozenEnvironment);
|
|
1381
|
+
assert.equal(receivedEnvironment?.OMX_SKIP_NATIVE_AGENT_REFRESH, '1');
|
|
1382
|
+
});
|
|
1209
1383
|
it('passes persisted plugin setup choices to the updated CLI refresh', async () => {
|
|
1210
1384
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-update-plugin-refresh-'));
|
|
1211
1385
|
const received = [];
|
|
@@ -1297,7 +1471,7 @@ describe('persisted merge policy update replay', () => {
|
|
|
1297
1471
|
await rm(cwd, { recursive: true, force: true });
|
|
1298
1472
|
}
|
|
1299
1473
|
});
|
|
1300
|
-
it('snapshots
|
|
1474
|
+
it('snapshots merge-policy argv in the detached Node-worker payload on every platform', async () => {
|
|
1301
1475
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-update-merge-policy-snapshot-'));
|
|
1302
1476
|
const calls = [];
|
|
1303
1477
|
try {
|
|
@@ -1308,10 +1482,408 @@ describe('persisted merge policy update replay', () => {
|
|
|
1308
1482
|
const result = runDeferredGlobalUpdate(cwd, ((_, args) => {
|
|
1309
1483
|
calls.push({ args: args });
|
|
1310
1484
|
return { once() { return this; }, unref() { } };
|
|
1311
|
-
}), platform, 12345);
|
|
1485
|
+
}), platform, 12345, frozenNpmOwnership);
|
|
1312
1486
|
assert.equal(result.ok, true);
|
|
1313
|
-
|
|
1314
|
-
assert.
|
|
1487
|
+
const payload = JSON.parse(await readFile(calls[0]?.args[1] ?? '', 'utf-8'));
|
|
1488
|
+
assert.deepEqual(payload.setupArgs, ['setup', '--scope', 'user', '--no-merge-agents']);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
finally {
|
|
1492
|
+
await rm(cwd, { recursive: true, force: true });
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
});
|
|
1496
|
+
describe('package-manager ownership', () => {
|
|
1497
|
+
const executable = '/configured/node_modules/oh-my-codex/dist/cli/omx.js';
|
|
1498
|
+
const packageRoot = '/configured/node_modules/oh-my-codex';
|
|
1499
|
+
function ownershipDependencies(stamp, roots) {
|
|
1500
|
+
return {
|
|
1501
|
+
currentExecutable: executable,
|
|
1502
|
+
currentPackageRoot: packageRoot,
|
|
1503
|
+
readInstallStamp: async () => stamp
|
|
1504
|
+
? { installed_version: '0.20.3', updated_at: '2026-07-22T00:00:00.000Z', package_manager: stamp }
|
|
1505
|
+
: null,
|
|
1506
|
+
realpath: (path) => path,
|
|
1507
|
+
resolveNpmGlobalInstallRoot: () => roots.npm ?? null,
|
|
1508
|
+
resolveBunGlobalBin: () => roots.bunBin ?? null,
|
|
1509
|
+
resolveBunCommand: () => '/configured/runtime/bun',
|
|
1510
|
+
resolveNpmCommand: () => ({ kind: 'node-script', command: '/canonical/node', commandArgs: ['/canonical/npm-cli.js'] }),
|
|
1511
|
+
resolveNpmPrefix: () => '/configured',
|
|
1512
|
+
environment: { OMX_UPDATE_TEST: '1' },
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
it('classifies only package roots outside node_modules as working-tree builds', () => {
|
|
1516
|
+
const realpath = (path) => (path === '/opt/homebrew/lib/node_modules/oh-my-codex'
|
|
1517
|
+
? '/Users/dev/Workspace/oh-my-codex'
|
|
1518
|
+
: path);
|
|
1519
|
+
assert.equal(isWorkingTreeInstall('/opt/homebrew/lib/node_modules/oh-my-codex', 'darwin', realpath), true);
|
|
1520
|
+
assert.equal(isWorkingTreeInstall('/opt/homebrew/lib/node_modules/oh-my-codex', 'darwin', (path) => path), false);
|
|
1521
|
+
assert.equal(isWorkingTreeInstall('/root/.bun/install/global/node_modules/oh-my-codex', 'darwin', (path) => path), false);
|
|
1522
|
+
assert.equal(isWorkingTreeInstall('C:\\Users\\dev\\AppData\\Roaming\\npm\\node_modules\\oh-my-codex', 'win32', (path) => path), false);
|
|
1523
|
+
assert.equal(isWorkingTreeInstall('/Users/dev/Workspace/oh-my-codex', 'darwin', () => {
|
|
1524
|
+
throw new Error('unresolvable');
|
|
1525
|
+
}), false);
|
|
1526
|
+
});
|
|
1527
|
+
it('selects a validated npm owner from isolated roots', async () => {
|
|
1528
|
+
assert.deepEqual(await resolvePackageManagerOwnership(ownershipDependencies('npm', {
|
|
1529
|
+
npm: '/configured/node_modules',
|
|
1530
|
+
})), {
|
|
1531
|
+
manager: 'npm',
|
|
1532
|
+
npmCommand: { kind: 'node-script', command: '/canonical/node', commandArgs: ['/canonical/npm-cli.js'] },
|
|
1533
|
+
npmPrefix: '/configured',
|
|
1534
|
+
globalInstallRoot: '/configured/node_modules',
|
|
1535
|
+
packageRoot: '/configured/node_modules/oh-my-codex',
|
|
1536
|
+
environment: {},
|
|
1537
|
+
});
|
|
1538
|
+
});
|
|
1539
|
+
it('recovers an npm owner from a stale Bun stamp without deleting the stamp', async () => {
|
|
1540
|
+
const ownership = await resolvePackageManagerOwnership(ownershipDependencies('bun', {
|
|
1541
|
+
npm: '/configured/node_modules',
|
|
1542
|
+
}));
|
|
1543
|
+
assert.equal(ownership?.manager, 'npm');
|
|
1544
|
+
});
|
|
1545
|
+
it('freezes CODEX_HOME for deferred setup and update finalization', async () => {
|
|
1546
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1547
|
+
...ownershipDependencies('npm', { npm: '/configured/node_modules' }),
|
|
1548
|
+
environment: { CODEX_HOME: '/configured/codex-home' },
|
|
1549
|
+
});
|
|
1550
|
+
assert.deepEqual(ownership?.environment, { CODEX_HOME: '/configured/codex-home' });
|
|
1551
|
+
});
|
|
1552
|
+
it('resolves a normal npm Node-shebang launch from its installed npm CLI without lifecycle provenance', async () => {
|
|
1553
|
+
let npmCommand;
|
|
1554
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1555
|
+
...ownershipDependencies('npm', { npm: '/fake/npm/lib/node_modules' }),
|
|
1556
|
+
currentExecutable: '/fake/npm/lib/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1557
|
+
currentPackageRoot: '/fake/npm/lib/node_modules/oh-my-codex',
|
|
1558
|
+
currentNodeExecutable: '/fake/npm/bin/node',
|
|
1559
|
+
resolveNpmCommand: () => null,
|
|
1560
|
+
resolveNpmGlobalInstallRoot: (command) => {
|
|
1561
|
+
npmCommand = command;
|
|
1562
|
+
return '/fake/npm/lib/node_modules';
|
|
1563
|
+
},
|
|
1564
|
+
resolveNpmPrefix: () => '/fake/npm',
|
|
1565
|
+
environment: {},
|
|
1566
|
+
});
|
|
1567
|
+
assert.deepEqual(npmCommand, {
|
|
1568
|
+
kind: 'node-script', command: '/fake/npm/bin/node', commandArgs: ['/fake/npm/lib/node_modules/npm/bin/npm-cli.js'],
|
|
1569
|
+
});
|
|
1570
|
+
assert.deepEqual(ownership, {
|
|
1571
|
+
manager: 'npm',
|
|
1572
|
+
npmCommand: npmCommand,
|
|
1573
|
+
npmPrefix: '/fake/npm',
|
|
1574
|
+
globalInstallRoot: '/fake/npm/lib/node_modules',
|
|
1575
|
+
packageRoot: '/fake/npm/lib/node_modules/oh-my-codex',
|
|
1576
|
+
environment: {},
|
|
1577
|
+
});
|
|
1578
|
+
assert.equal(await resolvePackageManagerOwnership({
|
|
1579
|
+
...ownershipDependencies('npm', { npm: '/fake/npm/lib/node_modules' }),
|
|
1580
|
+
currentExecutable: '/fake/npm/lib/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1581
|
+
currentPackageRoot: '/fake/npm/lib/node_modules/oh-my-codex',
|
|
1582
|
+
currentNodeExecutable: '/fake/npm/bin/node',
|
|
1583
|
+
resolveNpmCommand: () => null,
|
|
1584
|
+
realpath: (path) => {
|
|
1585
|
+
if (path.endsWith('/npm/bin/npm-cli.js'))
|
|
1586
|
+
throw new Error('missing npm CLI');
|
|
1587
|
+
return path;
|
|
1588
|
+
},
|
|
1589
|
+
environment: {},
|
|
1590
|
+
}), null, 'missing installed npm CLI must fail closed');
|
|
1591
|
+
});
|
|
1592
|
+
it('resolves npm from the selected global OMX root before a Node runtime sibling on Windows', async () => {
|
|
1593
|
+
let npmCommand;
|
|
1594
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1595
|
+
...ownershipDependencies('npm', { npm: 'C:\\Users\\alice\\AppData\\Roaming\\npm\\node_modules' }),
|
|
1596
|
+
platform: 'win32',
|
|
1597
|
+
currentExecutable: 'C:\\Users\\alice\\AppData\\Roaming\\npm\\node_modules\\oh-my-codex\\dist\\cli\\omx.js',
|
|
1598
|
+
currentPackageRoot: 'C:\\Users\\alice\\AppData\\Roaming\\npm\\node_modules\\oh-my-codex',
|
|
1599
|
+
currentNodeExecutable: 'C:\\Program Files\\nodejs\\node.exe',
|
|
1600
|
+
resolveNpmCommand: () => null,
|
|
1601
|
+
resolveNpmGlobalInstallRoot: (command) => {
|
|
1602
|
+
npmCommand = command;
|
|
1603
|
+
return 'C:\\Users\\alice\\AppData\\Roaming\\npm\\node_modules';
|
|
1604
|
+
},
|
|
1605
|
+
resolveNpmPrefix: () => 'C:\\Users\\alice\\AppData\\Roaming\\npm',
|
|
1606
|
+
environment: {},
|
|
1607
|
+
});
|
|
1608
|
+
assert.deepEqual(npmCommand, {
|
|
1609
|
+
kind: 'node-script',
|
|
1610
|
+
command: 'C:\\Program Files\\nodejs\\node.exe',
|
|
1611
|
+
commandArgs: ['C:\\Users\\alice\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'],
|
|
1612
|
+
});
|
|
1613
|
+
assert.equal(ownership?.manager, 'npm');
|
|
1614
|
+
});
|
|
1615
|
+
it('resolves a normal Bun Node-shebang launch only from its configured install root and matching shim', async () => {
|
|
1616
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1617
|
+
...ownershipDependencies('bun', { bunBin: '/fake/bun/bin' }),
|
|
1618
|
+
currentExecutable: '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1619
|
+
currentPackageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1620
|
+
bunInstallRoot: '/fake/bun',
|
|
1621
|
+
resolveBunCommand: () => null,
|
|
1622
|
+
environment: {},
|
|
1623
|
+
realpath: (path) => ({
|
|
1624
|
+
'/fake/bun/bin/omx': '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1625
|
+
}[path] ?? path),
|
|
1626
|
+
});
|
|
1627
|
+
assert.deepEqual(ownership, {
|
|
1628
|
+
manager: 'bun',
|
|
1629
|
+
bunCommand: '/fake/bun/bin/bun',
|
|
1630
|
+
bunGlobalBin: '/fake/bun/bin',
|
|
1631
|
+
bunShim: '/fake/bun/bin/omx',
|
|
1632
|
+
bunInstallRoot: '/fake/bun',
|
|
1633
|
+
npmPrefix: '/fake/bun/install/global/node_modules',
|
|
1634
|
+
globalInstallRoot: '/fake/bun/install/global/node_modules',
|
|
1635
|
+
packageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1636
|
+
environment: { BUN_INSTALL: '/fake/bun' },
|
|
1637
|
+
});
|
|
1638
|
+
assert.equal(await resolvePackageManagerOwnership({
|
|
1639
|
+
...ownershipDependencies('bun', { bunBin: '/fake/bun/bin' }),
|
|
1640
|
+
currentExecutable: '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1641
|
+
currentPackageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1642
|
+
resolveBunCommand: () => null,
|
|
1643
|
+
bunInstallRoot: undefined,
|
|
1644
|
+
environment: {},
|
|
1645
|
+
}), null, 'missing Bun command provenance must fail closed');
|
|
1646
|
+
});
|
|
1647
|
+
it('queries Bun global-bin under the frozen configured environment', () => {
|
|
1648
|
+
const calls = [];
|
|
1649
|
+
const bin = resolveBunGlobalBin('/fake/bun/bin/bun', { BUN_INSTALL: '/fake/bun', PATH: '/frozen/path' }, ((command, args, options) => {
|
|
1650
|
+
calls.push({ command, args: args, environment: options?.env });
|
|
1651
|
+
return { status: 0, stdout: '/fake/bun/bin\n', stderr: '', error: undefined };
|
|
1652
|
+
}));
|
|
1653
|
+
assert.equal(bin, '/fake/bun/bin');
|
|
1654
|
+
assert.deepEqual(calls, [{
|
|
1655
|
+
command: '/fake/bun/bin/bun',
|
|
1656
|
+
args: ['pm', 'bin', '-g'],
|
|
1657
|
+
environment: { BUN_INSTALL: '/fake/bun', PATH: '/frozen/path' },
|
|
1658
|
+
}]);
|
|
1659
|
+
});
|
|
1660
|
+
it('resolves an unstamped Bun install after confirming its canonical shim and configured root', async () => {
|
|
1661
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1662
|
+
...ownershipDependencies(undefined, { bunBin: '/fake/bun/bin' }),
|
|
1663
|
+
currentExecutable: '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1664
|
+
currentPackageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1665
|
+
bunInstallRoot: '/fake/bun',
|
|
1666
|
+
resolveBunCommand: () => '/fake/bun/bin/bun',
|
|
1667
|
+
environment: {},
|
|
1668
|
+
realpath: (path) => ({
|
|
1669
|
+
'/fake/bun/bin/omx': '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1670
|
+
}[path] ?? path),
|
|
1671
|
+
});
|
|
1672
|
+
assert.deepEqual(ownership, {
|
|
1673
|
+
manager: 'bun',
|
|
1674
|
+
bunCommand: '/fake/bun/bin/bun',
|
|
1675
|
+
bunGlobalBin: '/fake/bun/bin',
|
|
1676
|
+
bunShim: '/fake/bun/bin/omx',
|
|
1677
|
+
bunInstallRoot: '/fake/bun',
|
|
1678
|
+
npmPrefix: '/fake/bun/install/global/node_modules',
|
|
1679
|
+
globalInstallRoot: '/fake/bun/install/global/node_modules',
|
|
1680
|
+
packageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1681
|
+
environment: { BUN_INSTALL: '/fake/bun' },
|
|
1682
|
+
});
|
|
1683
|
+
});
|
|
1684
|
+
it('recovers a Bun owner from a stale npm stamp without deleting the stamp', async () => {
|
|
1685
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1686
|
+
...ownershipDependencies('npm', { bunBin: '/fake/bun/bin' }),
|
|
1687
|
+
currentExecutable: '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1688
|
+
currentPackageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1689
|
+
bunInstallRoot: '/fake/bun',
|
|
1690
|
+
resolveBunCommand: () => '/fake/bun/bin/bun',
|
|
1691
|
+
environment: {},
|
|
1692
|
+
realpath: (path) => ({
|
|
1693
|
+
'/fake/bun/bin/omx': '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1694
|
+
}[path] ?? path),
|
|
1695
|
+
});
|
|
1696
|
+
assert.equal(ownership?.manager, 'bun');
|
|
1697
|
+
});
|
|
1698
|
+
it('fails closed when npm and Bun ownership both validate, even with a manager stamp', async () => {
|
|
1699
|
+
for (const stamp of [undefined, 'npm', 'bun']) {
|
|
1700
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1701
|
+
...ownershipDependencies(stamp, {
|
|
1702
|
+
npm: '/fake/bun/install/global/node_modules',
|
|
1703
|
+
bunBin: '/fake/bun/bin',
|
|
1704
|
+
}),
|
|
1705
|
+
currentExecutable: '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1706
|
+
currentPackageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1707
|
+
bunInstallRoot: '/fake/bun',
|
|
1708
|
+
resolveBunCommand: () => '/fake/bun/bin/bun',
|
|
1709
|
+
resolveNpmPrefix: () => '/fake/bun/install/global',
|
|
1710
|
+
environment: {},
|
|
1711
|
+
realpath: (path) => ({
|
|
1712
|
+
'/fake/bun/bin/omx': '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1713
|
+
}[path] ?? path),
|
|
1714
|
+
});
|
|
1715
|
+
assert.equal(ownership, null);
|
|
1716
|
+
}
|
|
1717
|
+
});
|
|
1718
|
+
it('uses platform-correct canonical paths for a Windows Bun .cmd shim', async () => {
|
|
1719
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1720
|
+
...ownershipDependencies('bun', { bunBin: 'C:\\Users\\alice\\.bun\\bin' }),
|
|
1721
|
+
platform: 'win32',
|
|
1722
|
+
bunInstallRoot: 'C:\\Users\\alice\\.bun',
|
|
1723
|
+
currentExecutable: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules\\oh-my-codex\\dist\\cli\\omx.js',
|
|
1724
|
+
currentPackageRoot: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules\\oh-my-codex',
|
|
1725
|
+
resolveBunCommand: () => null,
|
|
1726
|
+
environment: {},
|
|
1727
|
+
realpath: (path) => path,
|
|
1728
|
+
});
|
|
1729
|
+
assert.deepEqual(ownership, {
|
|
1730
|
+
manager: 'bun',
|
|
1731
|
+
bunCommand: 'C:\\Users\\alice\\.bun\\bin\\bun.exe',
|
|
1732
|
+
bunGlobalBin: 'C:\\Users\\alice\\.bun\\bin',
|
|
1733
|
+
bunShim: 'C:\\Users\\alice\\.bun\\bin\\omx.cmd',
|
|
1734
|
+
bunInstallRoot: 'C:\\Users\\alice\\.bun',
|
|
1735
|
+
npmPrefix: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules',
|
|
1736
|
+
globalInstallRoot: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules',
|
|
1737
|
+
packageRoot: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules\\oh-my-codex',
|
|
1738
|
+
environment: { BUN_INSTALL: 'C:\\Users\\alice\\.bun' },
|
|
1739
|
+
});
|
|
1740
|
+
});
|
|
1741
|
+
it('derives a fresh Bun installation root from its canonical executable without ambient PATH lookup', async () => {
|
|
1742
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1743
|
+
...ownershipDependencies('bun', { bunBin: 'C:\\Users\\alice\\.bun\\bin' }),
|
|
1744
|
+
platform: 'win32',
|
|
1745
|
+
currentExecutable: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules\\oh-my-codex\\dist\\cli\\omx.js',
|
|
1746
|
+
currentPackageRoot: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules\\oh-my-codex',
|
|
1747
|
+
bunInstallRoot: undefined,
|
|
1748
|
+
resolveBunCommand: () => 'C:\\Users\\alice\\.bun\\bin\\bun.exe',
|
|
1749
|
+
environment: {},
|
|
1750
|
+
realpath: (path) => path,
|
|
1751
|
+
});
|
|
1752
|
+
assert.deepEqual(ownership, {
|
|
1753
|
+
manager: 'bun',
|
|
1754
|
+
bunCommand: 'C:\\Users\\alice\\.bun\\bin\\bun.exe',
|
|
1755
|
+
bunGlobalBin: 'C:\\Users\\alice\\.bun\\bin',
|
|
1756
|
+
bunShim: 'C:\\Users\\alice\\.bun\\bin\\omx.cmd',
|
|
1757
|
+
bunInstallRoot: 'C:\\Users\\alice\\.bun',
|
|
1758
|
+
npmPrefix: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules',
|
|
1759
|
+
globalInstallRoot: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules',
|
|
1760
|
+
packageRoot: 'C:\\Users\\alice\\.bun\\install\\global\\node_modules\\oh-my-codex',
|
|
1761
|
+
environment: { BUN_INSTALL: 'C:\\Users\\alice\\.bun' },
|
|
1762
|
+
});
|
|
1763
|
+
});
|
|
1764
|
+
it('rejects Bun shim evidence when BUN_INSTALL cannot bind the command and global target', async () => {
|
|
1765
|
+
let npmCalls = 0;
|
|
1766
|
+
const ownership = await resolvePackageManagerOwnership({
|
|
1767
|
+
...ownershipDependencies('bun', { bunBin: '/configured/bun/bin' }),
|
|
1768
|
+
bunInstallRoot: '/missing/developer-bun',
|
|
1769
|
+
currentExecutable: '/links/omx.js',
|
|
1770
|
+
currentPackageRoot: '/links/package',
|
|
1771
|
+
realpath: (path) => {
|
|
1772
|
+
if (path === '/missing/developer-bun')
|
|
1773
|
+
throw new Error('missing BUN_INSTALL');
|
|
1774
|
+
return path;
|
|
1775
|
+
},
|
|
1776
|
+
resolveNpmGlobalInstallRoot: () => { npmCalls += 1; return null; },
|
|
1777
|
+
});
|
|
1778
|
+
assert.equal(ownership, null);
|
|
1779
|
+
assert.equal(npmCalls, 1, 'A stale stamp cannot suppress independent live ownership validation.');
|
|
1780
|
+
});
|
|
1781
|
+
it('fails closed for missing, ambiguous, stale, or non-shim Bun ownership evidence', async () => {
|
|
1782
|
+
assert.equal(await resolvePackageManagerOwnership(ownershipDependencies(undefined, {})), null);
|
|
1783
|
+
assert.equal((await resolvePackageManagerOwnership(ownershipDependencies('bun', {
|
|
1784
|
+
npm: '/configured/node_modules',
|
|
1785
|
+
})))?.manager, 'npm', 'a stale Bun stamp must yield to one uniquely validated npm owner');
|
|
1786
|
+
assert.equal(await resolvePackageManagerOwnership({
|
|
1787
|
+
...ownershipDependencies('bun', { bunBin: '/configured/bun/bin' }),
|
|
1788
|
+
resolveBunGlobalBin: () => '/configured/bun/bin',
|
|
1789
|
+
realpath: (path) => path,
|
|
1790
|
+
}), null);
|
|
1791
|
+
assert.equal(await resolvePackageManagerOwnership({
|
|
1792
|
+
...ownershipDependencies('bun', { bunBin: '/fake/bun/bin' }),
|
|
1793
|
+
currentExecutable: '/fake/bun/install/global/node_modules/oh-my-codex/dist/cli/omx.js',
|
|
1794
|
+
currentPackageRoot: '/fake/bun/install/global/node_modules/oh-my-codex',
|
|
1795
|
+
bunInstallRoot: '/fake/bun',
|
|
1796
|
+
resolveBunCommand: () => '/other/bun',
|
|
1797
|
+
environment: {},
|
|
1798
|
+
}), null, 'Bun executable provenance must bind to the configured installation target.');
|
|
1799
|
+
});
|
|
1800
|
+
it('uses the frozen Bun command for stable and deferred updates and rejects Bun dev before spawning', async () => {
|
|
1801
|
+
const owner = {
|
|
1802
|
+
manager: 'bun',
|
|
1803
|
+
bunCommand: '/configured/runtime/bun',
|
|
1804
|
+
bunGlobalBin: '/configured/bun/bin',
|
|
1805
|
+
bunShim: '/configured/bun/bin/omx',
|
|
1806
|
+
bunInstallRoot: '/configured/bun',
|
|
1807
|
+
globalInstallRoot: '/configured/node_modules',
|
|
1808
|
+
packageRoot: '/configured/node_modules/oh-my-codex',
|
|
1809
|
+
npmPrefix: '/configured',
|
|
1810
|
+
environment: { OMX_UPDATE_TEST: '1', BUN_INSTALL: '/configured/bun' },
|
|
1811
|
+
};
|
|
1812
|
+
const calls = [];
|
|
1813
|
+
const spawnProcess = ((command, args) => {
|
|
1814
|
+
calls.push({ command, args });
|
|
1815
|
+
return { status: 0, stdout: '', stderr: '' };
|
|
1816
|
+
});
|
|
1817
|
+
assert.deepEqual(runGlobalUpdate('oh-my-codex@latest', spawnProcess, 'linux', owner), { ok: true, stderr: '' });
|
|
1818
|
+
assert.deepEqual(calls, [{ command: '/configured/runtime/bun', args: ['add', '--global', '--ignore-scripts', 'oh-my-codex@latest'] }]);
|
|
1819
|
+
calls.length = 0;
|
|
1820
|
+
const incompleteOwner = {
|
|
1821
|
+
...owner,
|
|
1822
|
+
bunInstallRoot: undefined,
|
|
1823
|
+
environment: { OMX_UPDATE_TEST: '1' },
|
|
1824
|
+
};
|
|
1825
|
+
assert.deepEqual(runGlobalUpdate('oh-my-codex@latest', spawnProcess, 'linux', incompleteOwner), {
|
|
1826
|
+
ok: false,
|
|
1827
|
+
stderr: 'The package-manager ownership transaction is incomplete.',
|
|
1828
|
+
});
|
|
1829
|
+
assert.deepEqual(calls, []);
|
|
1830
|
+
assert.deepEqual(runGlobalUpdate('github:Yeachan-Heo/oh-my-codex#dev', spawnProcess, 'linux', owner), {
|
|
1831
|
+
ok: false, stderr: 'Bun dev updates are not yet supported',
|
|
1832
|
+
});
|
|
1833
|
+
assert.deepEqual(calls, []);
|
|
1834
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-deferred-bun-'));
|
|
1835
|
+
try {
|
|
1836
|
+
const deferredCalls = [];
|
|
1837
|
+
const deferred = runDeferredGlobalUpdate(cwd, ((command, args) => {
|
|
1838
|
+
deferredCalls.push({ command, args: args });
|
|
1839
|
+
return { once() { return this; }, unref() { } };
|
|
1840
|
+
}), 'linux', 12345, owner);
|
|
1841
|
+
assert.equal(deferred.ok, true);
|
|
1842
|
+
assert.equal(deferredCalls[0]?.command, process.execPath);
|
|
1843
|
+
assert.match(deferredCalls[0]?.args[0] ?? '', /update-worker\.js$/);
|
|
1844
|
+
const payload = JSON.parse(await readFile(deferredCalls[0]?.args[1] ?? '', 'utf-8'));
|
|
1845
|
+
assert.deepEqual(payload.ownership, owner);
|
|
1846
|
+
assert.deepEqual(payload.setupArgs, ['setup']);
|
|
1847
|
+
}
|
|
1848
|
+
finally {
|
|
1849
|
+
await rm(cwd, { recursive: true, force: true });
|
|
1850
|
+
}
|
|
1851
|
+
});
|
|
1852
|
+
it('rejects malformed frozen npm and Bun ownership before spawning a manager or deferred worker', async () => {
|
|
1853
|
+
const malformedOwners = [
|
|
1854
|
+
{
|
|
1855
|
+
...frozenNpmOwnership,
|
|
1856
|
+
npmCommand: { kind: 'node-script', command: '/untrusted/npm-launcher', commandArgs: [] },
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
manager: 'bun',
|
|
1860
|
+
bunCommand: '/untrusted/bun-launcher',
|
|
1861
|
+
bunGlobalBin: '',
|
|
1862
|
+
bunShim: '',
|
|
1863
|
+
bunInstallRoot: '/configured/bun',
|
|
1864
|
+
globalInstallRoot: '/configured/node_modules',
|
|
1865
|
+
packageRoot: '/configured/node_modules/oh-my-codex',
|
|
1866
|
+
npmPrefix: '/configured',
|
|
1867
|
+
environment: { BUN_INSTALL: '/configured/bun' },
|
|
1868
|
+
},
|
|
1869
|
+
];
|
|
1870
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-malformed-frozen-ownership-'));
|
|
1871
|
+
try {
|
|
1872
|
+
for (const ownership of malformedOwners) {
|
|
1873
|
+
const managerCalls = [];
|
|
1874
|
+
const result = runGlobalUpdate('oh-my-codex@latest', ((command) => {
|
|
1875
|
+
managerCalls.push(command);
|
|
1876
|
+
return { status: 0, signal: null, error: undefined, stdout: '', stderr: '', output: [null, '', ''], pid: 0 };
|
|
1877
|
+
}), 'linux', ownership);
|
|
1878
|
+
assert.deepEqual(result, { ok: false, stderr: 'The package-manager ownership transaction is incomplete.' });
|
|
1879
|
+
assert.deepEqual(managerCalls, []);
|
|
1880
|
+
const workerCalls = [];
|
|
1881
|
+
const deferred = runDeferredGlobalUpdate(cwd, ((command) => {
|
|
1882
|
+
workerCalls.push(command);
|
|
1883
|
+
return { once() { return this; }, unref() { } };
|
|
1884
|
+
}), 'linux', 12345, ownership);
|
|
1885
|
+
assert.deepEqual(deferred.ok, false);
|
|
1886
|
+
assert.deepEqual(workerCalls, []);
|
|
1315
1887
|
}
|
|
1316
1888
|
}
|
|
1317
1889
|
finally {
|