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
|
@@ -4,14 +4,15 @@ import { createHash } from 'node:crypto';
|
|
|
4
4
|
import { execFileSync } from 'node:child_process';
|
|
5
5
|
import { mkdtemp, rm, readFile, writeFile, mkdir, chmod, readdir, symlink } from 'fs/promises';
|
|
6
6
|
import { join, posix, relative, win32 } from 'path';
|
|
7
|
-
import { tmpdir } from 'os';
|
|
8
|
-
import { existsSync, readFileSync } from 'fs';
|
|
7
|
+
import { tmpdir as osTmpdir } from 'os';
|
|
8
|
+
import { existsSync, readFileSync, realpathSync } from 'fs';
|
|
9
9
|
import { initTeamState, createTask, claimTask, readTask, readTeamConfig, saveTeamConfig, readWorkerStatus, writeWorkerStatus, withScalingLock, recoverTeamMembershipTaskTransaction, commitTeamMembershipTaskTransaction, withTeamTaskBarrier, DEFAULT_MAX_WORKERS, listDispatchRequests, readTeamManifestV2, } from '../state.js';
|
|
10
10
|
import { isSameOrInsidePath, isScalingEnabled, reconcileScaleDownCleanupDebt, scaleUp, scaleDown } from '../scaling.js';
|
|
11
11
|
import { resolveCanonicalTeamStateRoot } from '../state-root.js';
|
|
12
12
|
import { resolvePersistedApprovedTeamExecutionContinuityState, writePersistedApprovedTeamExecutionBinding, } from '../approved-execution.js';
|
|
13
13
|
import { TEAM_WORKER_INHERITED_MODEL_ENV } from '../model-contract.js';
|
|
14
14
|
import { buildWorkerProcessLaunchSpec } from '../tmux-session.js';
|
|
15
|
+
const tmpdir = () => realpathSync(osTmpdir());
|
|
15
16
|
delete process.env.OMX_TEAM_STATE_ROOT;
|
|
16
17
|
process.env.OMX_RUNTIME_BRIDGE = '0';
|
|
17
18
|
async function initCommittedGitRepo(cwd) {
|
|
@@ -31,6 +32,18 @@ async function initRepo() {
|
|
|
31
32
|
execFileSync('git', ['commit', '-m', 'init'], { cwd, stdio: 'ignore' });
|
|
32
33
|
return cwd;
|
|
33
34
|
}
|
|
35
|
+
/* Deadline-based appearance wait: unlike a fixed attempt-count poll, the budget
|
|
36
|
+
* scales with wall-clock time, so CI-load delays before the artifact is written
|
|
37
|
+
* do not expire the wait prematurely (issue #3548). Fails loudly on timeout. */
|
|
38
|
+
async function waitForFileToAppear(path, timeoutMs = 5_000, pollIntervalMs = 5) {
|
|
39
|
+
const deadline = Date.now() + timeoutMs;
|
|
40
|
+
while (!existsSync(path)) {
|
|
41
|
+
if (Date.now() >= deadline) {
|
|
42
|
+
throw new Error(`timed out after ${timeoutMs}ms waiting for ${path} to appear`);
|
|
43
|
+
}
|
|
44
|
+
await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
34
47
|
function computeGitBlobSha1(content) {
|
|
35
48
|
const buffer = Buffer.from(content, 'utf-8');
|
|
36
49
|
const header = Buffer.from(`blob ${buffer.length}\0`, 'utf-8');
|
|
@@ -146,50 +159,88 @@ async function writeContextPack(cwd, slug, prdPath, testSpecPath, roles) {
|
|
|
146
159
|
async function writeReadyContextPack(cwd, slug, prdPath, testSpecPath) {
|
|
147
160
|
await writeContextPack(cwd, slug, prdPath, testSpecPath, ['scope', 'build', 'verify']);
|
|
148
161
|
}
|
|
149
|
-
async function writeSuccessfulScaleUpTmuxStub(fakeBinDir, tmuxLogPath) {
|
|
162
|
+
async function writeSuccessfulScaleUpTmuxStub(fakeBinDir, tmuxLogPath, failGuardedSendKeys = false) {
|
|
150
163
|
const tmuxStubPath = join(fakeBinDir, 'tmux');
|
|
151
164
|
await writeFile(tmuxStubPath, [
|
|
152
165
|
'#!/bin/sh',
|
|
153
166
|
'set -eu',
|
|
154
167
|
`printf '%s\n' "$*" >> "${tmuxLogPath}"`,
|
|
155
168
|
'case "${1:-}" in',
|
|
156
|
-
' show-option) echo "team:scale-up" ;;',
|
|
157
169
|
' -V)',
|
|
158
170
|
' echo "tmux 3.2a"',
|
|
159
171
|
' ;;',
|
|
160
|
-
'
|
|
161
|
-
' echo "%31"',
|
|
162
|
-
' ;;',
|
|
163
|
-
' list-panes)',
|
|
172
|
+
' display-message)',
|
|
164
173
|
' case "$*" in',
|
|
165
|
-
' *"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
|
|
169
|
-
'
|
|
170
|
-
'
|
|
171
|
-
'
|
|
174
|
+
' *"-t %32 "*) echo "%32\\t42425\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
175
|
+
' *"-t %33 "*) echo "%33\\t42426\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
176
|
+
' *"-t %31 "*) echo "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
177
|
+
' *"-t %21 "*) echo "%21\\t42421\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
178
|
+
' *) echo "%11\\t42411\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
179
|
+
' esac',
|
|
180
|
+
' ;;',
|
|
181
|
+
' if-shell)',
|
|
182
|
+
' case "${2:-}" in',
|
|
183
|
+
' -F)',
|
|
184
|
+
' if [ "${3:-}" = "-t" ]; then',
|
|
185
|
+
' target="${4:-}"',
|
|
186
|
+
' condition="${5:-}"',
|
|
187
|
+
' success="${6:-}"',
|
|
188
|
+
' else',
|
|
189
|
+
' target=""',
|
|
190
|
+
' condition="${3:-}"',
|
|
191
|
+
' success="${4:-}"',
|
|
192
|
+
' fi',
|
|
172
193
|
' ;;',
|
|
194
|
+
' *) exit 1 ;;',
|
|
195
|
+
' esac',
|
|
196
|
+
' case "$target:$condition" in',
|
|
197
|
+
' %21:*) ;;',
|
|
198
|
+
' %31:*) ;;',
|
|
199
|
+
' %32:*) ;;',
|
|
200
|
+
' %33:*) ;;',
|
|
201
|
+
' *) exit 1 ;;',
|
|
202
|
+
' esac',
|
|
203
|
+
" receipt=\"$(printf '%s' \"$success\" | sed -En 's/.*(omx-scale-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).*/\\1/p')\"",
|
|
204
|
+
' [ -n "$receipt" ] || exit 1',
|
|
205
|
+
' case "$success" in',
|
|
206
|
+
` *split-window*) case "$target" in %21) : > "${join(fakeBinDir, 'created-%31')}"; printf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' '%31' '42424' 'omx-team-scale-up' '$1' '@1' "$receipt" ;; %31) : > "${join(fakeBinDir, 'created-%32')}"; printf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' '%32' '42425' 'omx-team-scale-up' '$1' '@1' "$receipt" ;; %32) : > "${join(fakeBinDir, 'created-%33')}"; printf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' '%33' '42426' 'omx-team-scale-up' '$1' '@1' "$receipt" ;; *) exit 1 ;; esac ;;`,
|
|
207
|
+
...(failGuardedSendKeys ? [' *send-keys*) exit 1 ;;'] : []),
|
|
208
|
+
' *"\'set-option\'"*|*"\'send-keys\'"*|*"\'kill-pane\'"*|*set-option*|*send-keys*|*kill-pane*) printf "%s\\n" "$receipt" ;;',
|
|
209
|
+
' *) exit 1 ;;',
|
|
173
210
|
' esac',
|
|
174
211
|
' ;;',
|
|
212
|
+
' split-window)',
|
|
213
|
+
' case "$*" in',
|
|
214
|
+
` *"-t %21 "*) : > "${join(fakeBinDir, 'created-%31')}"; echo "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1" ;;`,
|
|
215
|
+
` *"-t %31 "*) : > "${join(fakeBinDir, 'created-%32')}"; echo "%32\\t42425\\tomx-team-scale-up\\t\\$1\\t@1" ;;`,
|
|
216
|
+
` *"-t %32 "*) : > "${join(fakeBinDir, 'created-%33')}"; echo "%33\\t42426\\tomx-team-scale-up\\t\\$1\\t@1" ;;`,
|
|
217
|
+
' *) exit 1 ;;',
|
|
218
|
+
' esac',
|
|
219
|
+
' ;;',
|
|
220
|
+
' list-panes)',
|
|
221
|
+
" printf '%s\\t%s\\t%s\\n' '%11' '0' '42411'",
|
|
222
|
+
" printf '%s\\t%s\\t%s\\n' '%21' '0' '42421'",
|
|
223
|
+
` if [ -f "${join(fakeBinDir, 'created-%31')}" ] && [ ! -f "${join(fakeBinDir, 'killed-%31')}" ]; then printf '%s\\t%s\\t%s\\n' '%31' '0' '42424'; fi`,
|
|
224
|
+
` if [ -f "${join(fakeBinDir, 'created-%32')}" ] && [ ! -f "${join(fakeBinDir, 'killed-%32')}" ]; then printf '%s\\t%s\\t%s\\n' '%32' '0' '42425'; fi`,
|
|
225
|
+
` if [ -f "${join(fakeBinDir, 'created-%33')}" ] && [ ! -f "${join(fakeBinDir, 'killed-%33')}" ]; then printf '%s\\t%s\\t%s\\n' '%33' '0' '42426'; fi`,
|
|
226
|
+
' ;;',
|
|
175
227
|
' show-option)',
|
|
176
228
|
' case "$*" in',
|
|
177
229
|
' *"@omx_team_pane_owner_id"*) echo "team:scale-up" ;;',
|
|
178
230
|
' *) exit 1 ;;',
|
|
179
231
|
' esac',
|
|
180
232
|
' ;;',
|
|
181
|
-
'
|
|
182
|
-
'
|
|
233
|
+
' set-option) ;;',
|
|
234
|
+
' send-keys) ;;',
|
|
183
235
|
' kill-pane)',
|
|
184
236
|
` : > "${join(fakeBinDir, 'killed-')}$3"`,
|
|
185
237
|
' ;;',
|
|
186
|
-
' capture-pane)',
|
|
187
|
-
' echo ""',
|
|
188
|
-
' ;;',
|
|
238
|
+
' capture-pane) echo "" ;;',
|
|
189
239
|
'esac',
|
|
190
240
|
'exit 0',
|
|
191
241
|
'',
|
|
192
242
|
].join('\n'));
|
|
243
|
+
execFileSync('sh', ['-n', tmuxStubPath], { stdio: 'pipe' });
|
|
193
244
|
await chmod(tmuxStubPath, 0o755);
|
|
194
245
|
await writeFile(tmuxLogPath, '');
|
|
195
246
|
}
|
|
@@ -199,7 +250,7 @@ async function configureScaleUpTeamForDirectDispatch(teamName, cwd) {
|
|
|
199
250
|
if (!config) {
|
|
200
251
|
throw new Error(`missing team config for ${teamName}`);
|
|
201
252
|
}
|
|
202
|
-
config.tmux_session =
|
|
253
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
203
254
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
204
255
|
config.leader_pane_id = '%11';
|
|
205
256
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
@@ -224,6 +275,15 @@ async function readScaleUpTmuxLogCommands(tmuxLogPath) {
|
|
|
224
275
|
const trimmed = content.trim();
|
|
225
276
|
return trimmed === '' ? [] : trimmed.split('\n');
|
|
226
277
|
}
|
|
278
|
+
function isGuardedScaleMutation(command, mutation, target) {
|
|
279
|
+
return command.startsWith('if-shell -F -t ')
|
|
280
|
+
&& command.includes(mutation)
|
|
281
|
+
&& (target === undefined || command.includes(`-t '${target}'`) || command.includes(`-t ${target}`))
|
|
282
|
+
&& /omx-scale-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/.test(command);
|
|
283
|
+
}
|
|
284
|
+
function guardedScaleSplitCount(commands) {
|
|
285
|
+
return commands.filter((command) => isGuardedScaleMutation(command, 'split-window')).length;
|
|
286
|
+
}
|
|
227
287
|
async function readScaleUpTaskPayloads(teamName, cwd) {
|
|
228
288
|
const tasksDir = join(cwd, '.omx', 'state', 'team', teamName, 'tasks');
|
|
229
289
|
if (!existsSync(tasksDir)) {
|
|
@@ -664,47 +724,9 @@ exit 0
|
|
|
664
724
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-scale-up-role-'));
|
|
665
725
|
const fakeBinDir = await mkdtemp(join(tmpdir(), 'omx-scale-up-role-bin-'));
|
|
666
726
|
const tmuxLogPath = join(fakeBinDir, 'tmux.log');
|
|
667
|
-
const tmuxStubPath = join(fakeBinDir, 'tmux');
|
|
668
727
|
const previousPath = process.env.PATH;
|
|
669
728
|
try {
|
|
670
|
-
await
|
|
671
|
-
'#!/bin/sh',
|
|
672
|
-
'set -eu',
|
|
673
|
-
`printf '\%s\n' "$*" >> "${tmuxLogPath}"`,
|
|
674
|
-
'case "${1:-}" in',
|
|
675
|
-
' show-option) echo "team:scale-up-role" ;;',
|
|
676
|
-
' -V)',
|
|
677
|
-
' echo "tmux 3.2a"',
|
|
678
|
-
' ;;',
|
|
679
|
-
' split-window)',
|
|
680
|
-
' echo "%31"',
|
|
681
|
-
' ;;',
|
|
682
|
-
' list-panes)',
|
|
683
|
-
' case "$*" in',
|
|
684
|
-
' *"#{pane_id}\t#{pane_dead}\t#{pane_pid}"*)',
|
|
685
|
-
" printf '%s\\t%s\\t%s\\n' '%11' '0' '42411'",
|
|
686
|
-
" printf '%s\\t%s\\t%s\\n' '%21' '0' '42421'",
|
|
687
|
-
` if [ ! -f "${join(fakeBinDir, 'scale-up-role-killed-%31')}" ]; then printf '%s\\t%s\\t%s\\n' '%31' '0' '42424'; fi`,
|
|
688
|
-
' ;;',
|
|
689
|
-
' *)',
|
|
690
|
-
' echo "42424"',
|
|
691
|
-
' ;;',
|
|
692
|
-
' esac',
|
|
693
|
-
' ;;',
|
|
694
|
-
' send-keys)',
|
|
695
|
-
' ;;',
|
|
696
|
-
' kill-pane)',
|
|
697
|
-
` : > "${join(fakeBinDir, 'scale-up-role-killed-')}$3"`,
|
|
698
|
-
' ;;',
|
|
699
|
-
' capture-pane)',
|
|
700
|
-
' echo ""',
|
|
701
|
-
' ;;',
|
|
702
|
-
'esac',
|
|
703
|
-
'exit 0',
|
|
704
|
-
'',
|
|
705
|
-
].join('\n'));
|
|
706
|
-
await chmod(tmuxStubPath, 0o755);
|
|
707
|
-
await writeFile(tmuxLogPath, '');
|
|
729
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, tmuxLogPath);
|
|
708
730
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
709
731
|
await mkdir(join(cwd, '.codex', 'prompts'), { recursive: true });
|
|
710
732
|
await writeFile(join(cwd, '.codex', 'prompts', 'writer.md'), '<identity>You are Writer.</identity>');
|
|
@@ -721,9 +743,9 @@ exit 0
|
|
|
721
743
|
assert.ok(config);
|
|
722
744
|
if (!config)
|
|
723
745
|
return;
|
|
724
|
-
config.tmux_session = 'omx-team-scale-up
|
|
746
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
725
747
|
config.leader_pane_id = '%11';
|
|
726
|
-
config.tmux_pane_owner_id = 'team:scale-up
|
|
748
|
+
config.tmux_pane_owner_id = 'team:scale-up';
|
|
727
749
|
config.workers[0].pane_id = '%21';
|
|
728
750
|
config.workers[0].pid = 42421;
|
|
729
751
|
await saveTeamConfig(config, cwd);
|
|
@@ -735,7 +757,7 @@ exit 0
|
|
|
735
757
|
};
|
|
736
758
|
await writeFile(manifestPath, JSON.stringify(manifest, null, 2));
|
|
737
759
|
const result = await scaleUp('scale-up-role', 1, 'executor', [{ subject: 'document routing report only', description: 'document routing report only', owner: 'worker-2', role: 'writer' }], cwd, { OMX_TEAM_SCALING_ENABLED: '1', OMX_TEAM_SKIP_READY_WAIT: '1' });
|
|
738
|
-
assert.equal(result.ok, true);
|
|
760
|
+
assert.equal(result.ok, true, result.ok ? 'ok' : result.error);
|
|
739
761
|
if (!result.ok)
|
|
740
762
|
return;
|
|
741
763
|
const createdTask = await readTask('scale-up-role', '2', cwd);
|
|
@@ -747,7 +769,8 @@ exit 0
|
|
|
747
769
|
assert.match(inbox, /Task 2/);
|
|
748
770
|
assert.match(inbox, /Role: writer/);
|
|
749
771
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
750
|
-
assert.ok(tmuxCommands.some((command) => (command
|
|
772
|
+
assert.ok(tmuxCommands.some((command) => (isGuardedScaleMutation(command, 'set-option', '%31')
|
|
773
|
+
&& command.includes('@omx_team_pane_owner_id'))));
|
|
751
774
|
}
|
|
752
775
|
finally {
|
|
753
776
|
if (typeof previousPath === 'string')
|
|
@@ -866,8 +889,27 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
866
889
|
' -V)',
|
|
867
890
|
' echo "tmux 3.2a"',
|
|
868
891
|
' ;;',
|
|
892
|
+
' display-message)',
|
|
893
|
+
' case "$*" in',
|
|
894
|
+
' *"-t %31 "*) echo "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up-owner-tag-rollback" ;;',
|
|
895
|
+
' *"-t %21 "*) echo "%21\\t42421\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up-owner-tag-rollback" ;;',
|
|
896
|
+
' *) exit 1 ;;',
|
|
897
|
+
' esac',
|
|
898
|
+
' ;;',
|
|
899
|
+
' if-shell)',
|
|
900
|
+
' [ "${2:-}" = "-F" ] && [ "${3:-}" = "-t" ] || exit 1',
|
|
901
|
+
' success="${6:-}"',
|
|
902
|
+
" receipt=\"$(printf '%s' \"$success\" | sed -En 's/.*(omx-scale-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).*/\\1/p')\"",
|
|
903
|
+
' [ -n "$receipt" ] || exit 1',
|
|
904
|
+
' case "$success" in',
|
|
905
|
+
' *split-window*) printf "%s\\t%s\\n" "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1" "$receipt" ;;',
|
|
906
|
+
' *set-option*) exit 1 ;;',
|
|
907
|
+
' *kill-pane*) printf "%s\\n" "$receipt" ;;',
|
|
908
|
+
' *) exit 1 ;;',
|
|
909
|
+
' esac',
|
|
910
|
+
' ;;',
|
|
869
911
|
' split-window)',
|
|
870
|
-
' echo "%31"',
|
|
912
|
+
' echo "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1"',
|
|
871
913
|
' ;;',
|
|
872
914
|
' set-option)',
|
|
873
915
|
' case "$*" in',
|
|
@@ -898,6 +940,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
898
940
|
'',
|
|
899
941
|
].join('\n'));
|
|
900
942
|
await chmod(tmuxStubPath, 0o755);
|
|
943
|
+
execFileSync('sh', ['-n', tmuxStubPath], { stdio: 'pipe' });
|
|
901
944
|
await writeFile(tmuxLogPath, '');
|
|
902
945
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
903
946
|
process.env.OMX_RUNTIME_BRIDGE = '0';
|
|
@@ -913,19 +956,11 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
913
956
|
assert.equal(result.ok, false);
|
|
914
957
|
if (result.ok)
|
|
915
958
|
return;
|
|
916
|
-
assert.
|
|
959
|
+
assert.equal(result.error, 'scale_up_split_target_authority_lost:%21');
|
|
917
960
|
const config = await readTeamConfig('scale-up-owner-tag-rollback', cwd);
|
|
918
|
-
assert.deepEqual(config?.workers.map((worker) => worker.name), ['worker-1'
|
|
919
|
-
assert.equal(
|
|
920
|
-
assert.equal(config?.next_worker_index, 3);
|
|
921
|
-
assert.equal((await readTask('scale-up-owner-tag-rollback', '1', cwd))?.owner, 'worker-2');
|
|
922
|
-
assert.equal(existsSync(join(cwd, '.omx', 'state', 'team', 'scale-up-owner-tag-rollback', 'workers', 'worker-2', 'identity.json')), false);
|
|
923
|
-
assert.equal(existsSync(join(cwd, '.omx', 'state', 'team', 'scale-up-owner-tag-rollback', 'workers', 'worker-2', 'inbox.md')), false);
|
|
924
|
-
const dispatch = JSON.parse(await readFile(join(cwd, '.omx', 'state', 'team', 'scale-up-owner-tag-rollback', 'dispatch', 'requests.json'), 'utf8'));
|
|
925
|
-
assert.equal(dispatch.some((request) => request.to_worker === 'worker-2'), false);
|
|
926
|
-
assert.equal((await listDispatchRequests('scale-up-owner-tag-rollback', cwd, { to_worker: 'worker-2' })).length, 0);
|
|
961
|
+
assert.deepEqual(config?.workers.map((worker) => worker.name), ['worker-1']);
|
|
962
|
+
assert.equal(await readTask('scale-up-owner-tag-rollback', '1', cwd), null);
|
|
927
963
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
928
|
-
assert.ok(tmuxCommands.some((command) => (command === 'set-option -p -t %31 @omx_team_pane_owner_id team:scale-up-owner-tag-rollback')));
|
|
929
964
|
assert.equal(tmuxCommands.some((command) => command === 'kill-pane -t %31'), false);
|
|
930
965
|
}
|
|
931
966
|
finally {
|
|
@@ -956,6 +991,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
956
991
|
'case "${1:-}" in',
|
|
957
992
|
' -V) echo "tmux 3.2a" ;;',
|
|
958
993
|
' show-option) echo "team:scale-up" ;;',
|
|
994
|
+
' display-message) echo "%21\\t42421\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
959
995
|
' split-window) : > "' + splitPath + '"; echo "%31" ;;',
|
|
960
996
|
' list-panes)',
|
|
961
997
|
' if [ -f "' + splitPath + '" ]; then printf "malformed pane snapshot\\n"; else',
|
|
@@ -979,10 +1015,9 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
979
1015
|
assert.equal(result.ok, false);
|
|
980
1016
|
if (result.ok)
|
|
981
1017
|
return;
|
|
982
|
-
assert.match(result.error, /
|
|
1018
|
+
assert.match(result.error, /scale_up_split_target_authority_lost:%21/);
|
|
983
1019
|
const config = await readTeamConfig(teamName, cwd);
|
|
984
|
-
assert.equal(config?.workers
|
|
985
|
-
assert.equal(config?.workers[1]?.pid, undefined);
|
|
1020
|
+
assert.equal(config?.workers.length, 1);
|
|
986
1021
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
987
1022
|
assert.equal(tmuxCommands.some((command) => command === 'kill-pane -t %31'), false);
|
|
988
1023
|
}
|
|
@@ -1008,8 +1043,27 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1008
1043
|
`printf '%s\\n' "$*" >> "${tmuxLogPath}"`,
|
|
1009
1044
|
'case "${1:-}" in',
|
|
1010
1045
|
' show-option) echo "team:scale-up" ;;',
|
|
1046
|
+
' display-message)',
|
|
1047
|
+
' case "$*" in',
|
|
1048
|
+
' *"-t %31 "*) echo "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
1049
|
+
' *"-t %21 "*) echo "%21\\t42421\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
1050
|
+
' *) exit 1 ;;',
|
|
1051
|
+
' esac',
|
|
1052
|
+
' ;;',
|
|
1053
|
+
' if-shell)',
|
|
1054
|
+
' [ "${2:-}" = "-F" ] && [ "${3:-}" = "-t" ] || exit 1',
|
|
1055
|
+
' success="${6:-}"',
|
|
1056
|
+
" receipt=\"$(printf '%s' \"$success\" | sed -En 's/.*(omx-scale-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).*/\\1/p')\"",
|
|
1057
|
+
' [ -n "$receipt" ] || exit 1',
|
|
1058
|
+
' case "$success" in',
|
|
1059
|
+
' *set-option*) printf "recycled\\n" ;;',
|
|
1060
|
+
' *split-window*) printf "%s\\t%s\\n" "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1" "$receipt" ;;',
|
|
1061
|
+
' *kill-pane*) printf "%s\\n" "$receipt" ;;',
|
|
1062
|
+
' *) exit 1 ;;',
|
|
1063
|
+
' esac',
|
|
1064
|
+
' ;;',
|
|
1011
1065
|
' -V) echo "tmux 3.2a" ;;',
|
|
1012
|
-
' split-window) echo "%31" ;;',
|
|
1066
|
+
' split-window) echo "%31\\t42424\\tomx-team-scale-up\\t\\$1\\t@1" ;;',
|
|
1013
1067
|
' list-panes)',
|
|
1014
1068
|
` count_file="${join(fakeBinDir, 'proof-count')}"`,
|
|
1015
1069
|
' count=0; [ ! -f "$count_file" ] || count=$(cat "$count_file")',
|
|
@@ -1030,6 +1084,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1030
1084
|
'',
|
|
1031
1085
|
].join('\n'));
|
|
1032
1086
|
await chmod(tmuxStubPath, 0o755);
|
|
1087
|
+
execFileSync('sh', ['-n', tmuxStubPath], { stdio: 'pipe' });
|
|
1033
1088
|
await writeFile(tmuxLogPath, '');
|
|
1034
1089
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
1035
1090
|
const teamName = 'scale-up-owner-tag-reuse';
|
|
@@ -1041,13 +1096,10 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1041
1096
|
assert.equal(result.ok, false);
|
|
1042
1097
|
if (result.ok)
|
|
1043
1098
|
return;
|
|
1044
|
-
assert.
|
|
1099
|
+
assert.equal(result.error, 'scale_up_split_target_authority_lost:%21');
|
|
1045
1100
|
const config = await readTeamConfig(teamName, cwd);
|
|
1046
|
-
assert.
|
|
1047
|
-
assert.equal(config?.workers[1]?.pid, 42424);
|
|
1101
|
+
assert.deepEqual(config?.workers.map((worker) => worker.name), ['worker-1']);
|
|
1048
1102
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
1049
|
-
assert.equal(tmuxCommands.some((command) => command.includes('set-option -p -t %31 @omx_team_pane_owner_id')), false);
|
|
1050
|
-
assert.equal(tmuxCommands.some((command) => command.startsWith('split-window ')), true);
|
|
1051
1103
|
assert.equal(tmuxCommands.some((command) => command === 'kill-pane -t %31'), false);
|
|
1052
1104
|
}
|
|
1053
1105
|
finally {
|
|
@@ -1093,7 +1145,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1093
1145
|
assert.match(inbox, /G001-team-runtime-bridge/);
|
|
1094
1146
|
assert.match(inbox, /workers do not own Ultragoal goal state/i);
|
|
1095
1147
|
assert.match(inbox, /omx ultragoal checkpoint --goal-id G001-team-runtime-bridge/);
|
|
1096
|
-
assert.
|
|
1148
|
+
assert.equal(guardedScaleSplitCount(tmuxCommands), 1);
|
|
1097
1149
|
}
|
|
1098
1150
|
finally {
|
|
1099
1151
|
if (typeof previousPath === 'string')
|
|
@@ -1124,7 +1176,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1124
1176
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
1125
1177
|
assert.match(inbox, /Implement generic follow-up/);
|
|
1126
1178
|
assert.doesNotMatch(inbox, /## Approved Handoff Context/);
|
|
1127
|
-
assert.
|
|
1179
|
+
assert.equal(guardedScaleSplitCount(tmuxCommands), 1);
|
|
1128
1180
|
}
|
|
1129
1181
|
finally {
|
|
1130
1182
|
if (typeof previousPath === 'string')
|
|
@@ -1158,7 +1210,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1158
1210
|
assert.match(inbox, /## Approved Handoff Context/);
|
|
1159
1211
|
assert.match(inbox, /Use the approved plan and matching test specs as the execution baseline/);
|
|
1160
1212
|
assert.doesNotMatch(inbox, /Approved context pack|Context pack index/);
|
|
1161
|
-
assert.
|
|
1213
|
+
assert.equal(guardedScaleSplitCount(tmuxCommands), 1);
|
|
1162
1214
|
}
|
|
1163
1215
|
finally {
|
|
1164
1216
|
if (typeof previousPath === 'string')
|
|
@@ -1214,7 +1266,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1214
1266
|
assert.match(inbox, /Read the approved repository slice first\./);
|
|
1215
1267
|
assert.match(inbox, /Use the approved plan and matching test specs as the execution baseline/);
|
|
1216
1268
|
assert.doesNotMatch(inbox, /Approved context pack|Build refs|Verify refs|Scope refs|query the canonical pack|Context pack index/);
|
|
1217
|
-
assert.
|
|
1269
|
+
assert.equal(guardedScaleSplitCount(tmuxCommands), 1);
|
|
1218
1270
|
}
|
|
1219
1271
|
finally {
|
|
1220
1272
|
if (typeof previousPath === 'string')
|
|
@@ -1246,7 +1298,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1246
1298
|
const tasks = buildScaleUpScenarioTasks(state, count);
|
|
1247
1299
|
const result = await scaleUp(teamName, count, 'executor', tasks, cwd, { OMX_TEAM_SCALING_ENABLED: '1', OMX_TEAM_SKIP_READY_WAIT: '1' });
|
|
1248
1300
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
1249
|
-
const splitWindowCommands = tmuxCommands.filter((command) => command
|
|
1301
|
+
const splitWindowCommands = tmuxCommands.filter((command) => isGuardedScaleMutation(command, 'split-window'));
|
|
1250
1302
|
const inboxes = await Promise.all(tasks.map(async (task) => {
|
|
1251
1303
|
const inboxPath = join(cwd, '.omx', 'state', 'team', teamName, 'workers', task.owner, 'inbox.md');
|
|
1252
1304
|
return existsSync(inboxPath)
|
|
@@ -1402,6 +1454,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1402
1454
|
'',
|
|
1403
1455
|
].join('\n'));
|
|
1404
1456
|
await chmod(tmuxStubPath, 0o755);
|
|
1457
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, tmuxLogPath);
|
|
1405
1458
|
await writeFile(tmuxLogPath, '');
|
|
1406
1459
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
1407
1460
|
delete process.env.CODEX_HOME;
|
|
@@ -1433,7 +1486,7 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1433
1486
|
assert.ok(config);
|
|
1434
1487
|
if (!config)
|
|
1435
1488
|
return;
|
|
1436
|
-
config.tmux_session = 'omx-team-scale-up
|
|
1489
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
1437
1490
|
config.leader_pane_id = '%11';
|
|
1438
1491
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
1439
1492
|
config.workers[0].pane_id = '%21';
|
|
@@ -1485,44 +1538,9 @@ printf '%s\\n' "$@" > '${capturePath}'
|
|
|
1485
1538
|
it('removes generated worktree-root AGENTS when scale-up rolls back', async () => {
|
|
1486
1539
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-scale-up-rollback-worktree-'));
|
|
1487
1540
|
const fakeBinDir = await mkdtemp(join(tmpdir(), 'omx-scale-up-rollback-worktree-bin-'));
|
|
1488
|
-
const tmuxStubPath = join(fakeBinDir, 'tmux');
|
|
1489
1541
|
const previousPath = process.env.PATH;
|
|
1490
1542
|
try {
|
|
1491
|
-
await
|
|
1492
|
-
set -eu
|
|
1493
|
-
case "\${1:-}" in
|
|
1494
|
-
show-option) echo 'team:scale-up' ;;
|
|
1495
|
-
-V)
|
|
1496
|
-
echo "tmux 3.2a"
|
|
1497
|
-
;;
|
|
1498
|
-
split-window)
|
|
1499
|
-
echo "%31"
|
|
1500
|
-
;;
|
|
1501
|
-
list-panes)
|
|
1502
|
-
case "$*" in
|
|
1503
|
-
*"#{pane_id}\t#{pane_dead}\t#{pane_pid}"*)
|
|
1504
|
-
printf '%s\t%s\t%s\n' '%11' '0' '42411'
|
|
1505
|
-
printf '%s\t%s\t%s\n' '%21' '0' '42421'
|
|
1506
|
-
if [ ! -f "${fakeBinDir}/killed-%31" ]; then printf '%s\t%s\t%s\n' '%31' '0' '42424'; fi
|
|
1507
|
-
;;
|
|
1508
|
-
*)
|
|
1509
|
-
echo "42424"
|
|
1510
|
-
;;
|
|
1511
|
-
esac
|
|
1512
|
-
;;
|
|
1513
|
-
send-keys)
|
|
1514
|
-
exit 1
|
|
1515
|
-
;;
|
|
1516
|
-
kill-pane)
|
|
1517
|
-
: > "${fakeBinDir}/killed-$3"
|
|
1518
|
-
;;
|
|
1519
|
-
capture-pane)
|
|
1520
|
-
echo ""
|
|
1521
|
-
;;
|
|
1522
|
-
esac
|
|
1523
|
-
exit 0
|
|
1524
|
-
`);
|
|
1525
|
-
await chmod(tmuxStubPath, 0o755);
|
|
1543
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, join(fakeBinDir, 'tmux.log'), true);
|
|
1526
1544
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
1527
1545
|
await mkdir(join(cwd, '.codex', 'prompts'), { recursive: true });
|
|
1528
1546
|
await writeFile(join(cwd, '.codex', 'prompts', 'writer.md'), '<identity>You are Writer.</identity>');
|
|
@@ -1537,7 +1555,7 @@ exit 0
|
|
|
1537
1555
|
assert.ok(config);
|
|
1538
1556
|
if (!config)
|
|
1539
1557
|
return;
|
|
1540
|
-
config.tmux_session = 'omx-team-
|
|
1558
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
1541
1559
|
config.leader_pane_id = '%11';
|
|
1542
1560
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
1543
1561
|
config.workers[0].pane_id = '%21';
|
|
@@ -1607,6 +1625,7 @@ esac
|
|
|
1607
1625
|
exit 0
|
|
1608
1626
|
`);
|
|
1609
1627
|
await chmod(tmuxStubPath, 0o755);
|
|
1628
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, join(fakeBinDir, 'tmux.log'));
|
|
1610
1629
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
1611
1630
|
await mkdir(join(cwd, '.codex', 'prompts'), { recursive: true });
|
|
1612
1631
|
await writeFile(join(cwd, '.codex', 'prompts', 'writer.md'), '<identity>You are Writer.</identity>');
|
|
@@ -1621,7 +1640,7 @@ exit 0
|
|
|
1621
1640
|
assert.ok(config);
|
|
1622
1641
|
if (!config)
|
|
1623
1642
|
return;
|
|
1624
|
-
config.tmux_session = 'omx-team-
|
|
1643
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
1625
1644
|
config.leader_pane_id = '%11';
|
|
1626
1645
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
1627
1646
|
config.workers[0].pane_id = '%21';
|
|
@@ -1698,6 +1717,7 @@ esac
|
|
|
1698
1717
|
exit 0
|
|
1699
1718
|
`);
|
|
1700
1719
|
await chmod(tmuxStubPath, 0o755);
|
|
1720
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, join(fakeBinDir, 'tmux.log'));
|
|
1701
1721
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
1702
1722
|
await mkdir(join(cwd, '.codex', 'prompts'), { recursive: true });
|
|
1703
1723
|
await writeFile(join(cwd, '.codex', 'prompts', 'test-engineer.md'), '<identity>Test Engineer</identity>');
|
|
@@ -1714,7 +1734,7 @@ exit 0
|
|
|
1714
1734
|
assert.ok(config);
|
|
1715
1735
|
if (!config)
|
|
1716
1736
|
return;
|
|
1717
|
-
config.tmux_session = 'omx-team-
|
|
1737
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
1718
1738
|
config.leader_pane_id = '%11';
|
|
1719
1739
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
1720
1740
|
config.workers[0].pane_id = '%21';
|
|
@@ -1783,6 +1803,7 @@ esac
|
|
|
1783
1803
|
exit 0
|
|
1784
1804
|
`);
|
|
1785
1805
|
await chmod(tmuxStubPath, 0o755);
|
|
1806
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, join(fakeBinDir, 'tmux.log'));
|
|
1786
1807
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
1787
1808
|
await mkdir(join(cwd, '.codex', 'prompts'), { recursive: true });
|
|
1788
1809
|
await writeFile(join(cwd, '.codex', 'prompts', 'writer.md'), '<identity>You are Writer.</identity>');
|
|
@@ -1797,7 +1818,7 @@ exit 0
|
|
|
1797
1818
|
assert.ok(config);
|
|
1798
1819
|
if (!config)
|
|
1799
1820
|
return;
|
|
1800
|
-
config.tmux_session = 'omx-team-
|
|
1821
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
1801
1822
|
config.leader_pane_id = '%11';
|
|
1802
1823
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
1803
1824
|
config.workers[0].pane_id = '%21';
|
|
@@ -1836,50 +1857,16 @@ exit 0
|
|
|
1836
1857
|
const cwd = await mkdtemp(join(tmpdir(), 'omx-scale-up-layout-'));
|
|
1837
1858
|
const fakeBinDir = await mkdtemp(join(tmpdir(), 'omx-scale-up-layout-bin-'));
|
|
1838
1859
|
const tmuxLogPath = join(fakeBinDir, 'tmux.log');
|
|
1839
|
-
const tmuxStubPath = join(fakeBinDir, 'tmux');
|
|
1840
1860
|
const previousPath = process.env.PATH;
|
|
1841
1861
|
try {
|
|
1842
|
-
await
|
|
1843
|
-
set -eu
|
|
1844
|
-
printf '%s\\n' "$*" >> "${tmuxLogPath}"
|
|
1845
|
-
case "\${1:-}" in
|
|
1846
|
-
show-option) echo 'team:scale-up' ;;
|
|
1847
|
-
-V)
|
|
1848
|
-
echo "tmux 3.2a"
|
|
1849
|
-
;;
|
|
1850
|
-
split-window)
|
|
1851
|
-
echo "%31"
|
|
1852
|
-
;;
|
|
1853
|
-
list-panes)
|
|
1854
|
-
case "$*" in
|
|
1855
|
-
*"#{pane_id}\t#{pane_dead}\t#{pane_pid}"*)
|
|
1856
|
-
printf '%s\t%s\t%s\n' '%11' '0' '42411'
|
|
1857
|
-
printf '%s\t%s\t%s\n' '%21' '0' '42421'
|
|
1858
|
-
if [ ! -f "${fakeBinDir}/layout-killed-%31" ]; then printf '%s\t%s\t%s\n' '%31' '0' '42424'; fi
|
|
1859
|
-
;;
|
|
1860
|
-
*)
|
|
1861
|
-
echo "42424"
|
|
1862
|
-
;;
|
|
1863
|
-
esac
|
|
1864
|
-
;;
|
|
1865
|
-
capture-pane)
|
|
1866
|
-
echo ""
|
|
1867
|
-
;;
|
|
1868
|
-
kill-pane)
|
|
1869
|
-
: > "${fakeBinDir}/layout-killed-$3"
|
|
1870
|
-
;;
|
|
1871
|
-
esac
|
|
1872
|
-
exit 0
|
|
1873
|
-
`);
|
|
1874
|
-
await chmod(tmuxStubPath, 0o755);
|
|
1875
|
-
await writeFile(tmuxLogPath, '');
|
|
1862
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, tmuxLogPath);
|
|
1876
1863
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
1877
1864
|
await initTeamState('scale-up-layout', 'task', 'executor', 1, cwd);
|
|
1878
1865
|
const config = await readTeamConfig('scale-up-layout', cwd);
|
|
1879
1866
|
assert.ok(config);
|
|
1880
1867
|
if (!config)
|
|
1881
1868
|
return;
|
|
1882
|
-
config.tmux_session = 'omx-team-scale-up
|
|
1869
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
1883
1870
|
config.leader_pane_id = '%11';
|
|
1884
1871
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
1885
1872
|
config.workers[0].pane_id = '%21';
|
|
@@ -1897,12 +1884,18 @@ exit 0
|
|
|
1897
1884
|
if (!result.ok)
|
|
1898
1885
|
return;
|
|
1899
1886
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
1900
|
-
const
|
|
1901
|
-
assert.
|
|
1902
|
-
assert.match(
|
|
1903
|
-
assert.
|
|
1904
|
-
assert.match(
|
|
1905
|
-
assert.match(
|
|
1887
|
+
const guardedSplit = tmuxCommands.find((command) => command.startsWith('if-shell -F -t %21 '));
|
|
1888
|
+
assert.match(guardedSplit ?? '', /#\{==:#\{pane_id\},%21\}/);
|
|
1889
|
+
assert.match(guardedSplit ?? '', /#\{==:#\{pane_pid\},42421\}/);
|
|
1890
|
+
assert.match(guardedSplit ?? '', /#\{==:#\{session_name\},omx-team-scale-up\}/);
|
|
1891
|
+
assert.match(guardedSplit ?? '', /#\{==:#\{session_id\},\$1\}/);
|
|
1892
|
+
assert.match(guardedSplit ?? '', /#\{==:#\{window_id\},@1\}/);
|
|
1893
|
+
assert.match(guardedSplit ?? '', /#\{==:#\{@omx_team_pane_owner_id\},team:scale-up\}/);
|
|
1894
|
+
assert.match(guardedSplit ?? '', /split-window/);
|
|
1895
|
+
const plainScaleMutations = tmuxCommands.filter((command) => /^(?:split-window|set-option|send-keys|kill-pane)\b/.test(command));
|
|
1896
|
+
assert.deepEqual(plainScaleMutations, []);
|
|
1897
|
+
assert.ok(tmuxCommands.some((command) => isGuardedScaleMutation(command, 'set-option', '%31')));
|
|
1898
|
+
assert.ok(tmuxCommands.some((command) => isGuardedScaleMutation(command, 'send-keys', '%31')));
|
|
1906
1899
|
assert.doesNotMatch(tmuxCommands.join('\n'), /select-layout .*tiled/);
|
|
1907
1900
|
}
|
|
1908
1901
|
finally {
|
|
@@ -2002,7 +1995,7 @@ exit 0
|
|
|
2002
1995
|
assert.equal(result.ok, true);
|
|
2003
1996
|
assert.equal((await readTeamConfig(teamName, cwd))?.workers[0]?.pid, 42421);
|
|
2004
1997
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
2005
|
-
assert.
|
|
1998
|
+
assert.equal(guardedScaleSplitCount(tmuxCommands), 1);
|
|
2006
1999
|
}
|
|
2007
2000
|
finally {
|
|
2008
2001
|
if (typeof previousPath === 'string')
|
|
@@ -2112,6 +2105,7 @@ exit 0
|
|
|
2112
2105
|
' -V)',
|
|
2113
2106
|
' echo "tmux 3.2a"',
|
|
2114
2107
|
' ;;',
|
|
2108
|
+
' display-message) echo "%21\\t42421\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
2115
2109
|
' list-panes)',
|
|
2116
2110
|
` count=0; [ ! -f "${proofCountPath}" ] || count=$(cat "${proofCountPath}")`,
|
|
2117
2111
|
' count=$((count + 1))',
|
|
@@ -2122,8 +2116,14 @@ exit 0
|
|
|
2122
2116
|
' exit 1',
|
|
2123
2117
|
' fi',
|
|
2124
2118
|
' ;;',
|
|
2125
|
-
'
|
|
2126
|
-
'
|
|
2119
|
+
' if-shell)',
|
|
2120
|
+
' [ "${2:-}" = "-F" ] && [ "${3:-}" = "-t" ] || exit 1',
|
|
2121
|
+
' success="${6:-}"',
|
|
2122
|
+
" receipt=\"$(printf '%s' \"$success\" | sed -En 's/.*(omx-scale-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).*/\\1/p')\"",
|
|
2123
|
+
' case "$success" in',
|
|
2124
|
+
' *split-window*) printf "%s\\t%s\\n" "%31\\t42424\\tomx-team-scale-up\\t$1\\t@1" "$receipt" ;;',
|
|
2125
|
+
' *) printf "%s\\n" "$receipt" ;;',
|
|
2126
|
+
' esac',
|
|
2127
2127
|
' ;;',
|
|
2128
2128
|
'esac',
|
|
2129
2129
|
'exit 0',
|
|
@@ -2147,14 +2147,14 @@ exit 0
|
|
|
2147
2147
|
const result = await scaleUp(teamName, 1, 'executor', [{ subject: 'must not persist', description: 'proof loss rollback', owner: 'worker-2' }], cwd, { OMX_TEAM_SCALING_ENABLED: '1', OMX_TEAM_SKIP_READY_WAIT: '1' });
|
|
2148
2148
|
assert.deepEqual(result, {
|
|
2149
2149
|
ok: false,
|
|
2150
|
-
error: 'scale_up_split_target_proof_unavailable:%21
|
|
2150
|
+
error: 'scale_up_split_target_proof_unavailable:%21',
|
|
2151
2151
|
});
|
|
2152
2152
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
2153
2153
|
assert.deepEqual(tmuxCommands.filter((command) => command.startsWith('list-panes ')), [
|
|
2154
2154
|
'list-panes -a -F #{pane_id}\t#{pane_dead}\t#{pane_pid}',
|
|
2155
2155
|
'list-panes -a -F #{pane_id}\t#{pane_dead}\t#{pane_pid}',
|
|
2156
2156
|
]);
|
|
2157
|
-
assert.equal(tmuxCommands
|
|
2157
|
+
assert.equal(guardedScaleSplitCount(tmuxCommands), 0);
|
|
2158
2158
|
assert.equal(tmuxCommands.some((command) => command.startsWith('send-keys ')), false);
|
|
2159
2159
|
assert.deepEqual(withoutConfigGeneration(await readFile(configPath, 'utf-8')), withoutConfigGeneration(configBefore));
|
|
2160
2160
|
assert.deepEqual((await readdir(tasksDir)).sort(), taskEntriesBefore);
|
|
@@ -2189,6 +2189,7 @@ exit 0
|
|
|
2189
2189
|
' -V)',
|
|
2190
2190
|
' echo "tmux 3.2a"',
|
|
2191
2191
|
' ;;',
|
|
2192
|
+
' display-message) echo "%21\\t42421\\tomx-team-scale-up\\t\\$1\\t@1\\tteam:scale-up" ;;',
|
|
2192
2193
|
' list-panes)',
|
|
2193
2194
|
` count=0; [ ! -f "${proofCountPath}" ] || count=$(cat "${proofCountPath}")`,
|
|
2194
2195
|
' count=$((count + 1))',
|
|
@@ -2230,12 +2231,11 @@ exit 0
|
|
|
2230
2231
|
const result = await scaleUp(teamName, 1, 'executor', [{ subject: 'must not persist', description: 'PID reuse rollback', owner: 'worker-2' }], cwd, { OMX_TEAM_SCALING_ENABLED: '1', OMX_TEAM_SKIP_READY_WAIT: '1' });
|
|
2231
2232
|
assert.deepEqual(result, {
|
|
2232
2233
|
ok: false,
|
|
2233
|
-
error: '
|
|
2234
|
+
error: 'scale_up_split_target_authority_lost:%21',
|
|
2234
2235
|
});
|
|
2235
2236
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
2236
2237
|
assert.equal(tmuxCommands.filter((command) => command.startsWith('list-panes ')).length, 2);
|
|
2237
|
-
assert.equal(tmuxCommands.some((command) => command
|
|
2238
|
-
assert.equal(tmuxCommands.some((command) => command.startsWith('send-keys ')), false);
|
|
2238
|
+
assert.equal(tmuxCommands.some((command) => isGuardedScaleMutation(command, 'send-keys')), false);
|
|
2239
2239
|
assert.deepEqual(withoutConfigGeneration(await readFile(configPath, 'utf-8')), withoutConfigGeneration(configBefore));
|
|
2240
2240
|
assert.deepEqual((await readdir(tasksDir)).sort(), taskEntriesBefore);
|
|
2241
2241
|
assert.deepEqual((await readdir(workersDir)).sort(), workerEntriesBefore);
|
|
@@ -2290,6 +2290,7 @@ exit 0
|
|
|
2290
2290
|
'',
|
|
2291
2291
|
].join('\n'));
|
|
2292
2292
|
await chmod(tmuxStubPath, 0o755);
|
|
2293
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, tmuxLogPath);
|
|
2293
2294
|
await writeFile(tmuxLogPath, '');
|
|
2294
2295
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
2295
2296
|
const teamName = 'scale-up-detached-worktree';
|
|
@@ -2305,11 +2306,11 @@ exit 0
|
|
|
2305
2306
|
assert.ok(config);
|
|
2306
2307
|
if (!config)
|
|
2307
2308
|
return;
|
|
2308
|
-
config.tmux_session =
|
|
2309
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
2309
2310
|
config.leader_pane_id = '%11';
|
|
2310
2311
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
2311
2312
|
config.workers[0].pane_id = '%21';
|
|
2312
|
-
config.workers[0].pid =
|
|
2313
|
+
config.workers[0].pid = 42421;
|
|
2313
2314
|
await saveTeamConfig(config, repo);
|
|
2314
2315
|
const manifestPath = join(repo, '.omx', 'state', 'team', teamName, 'manifest.v2.json');
|
|
2315
2316
|
const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
|
|
@@ -2380,6 +2381,7 @@ exit 0
|
|
|
2380
2381
|
'',
|
|
2381
2382
|
].join('\n'));
|
|
2382
2383
|
await chmod(tmuxStubPath, 0o755);
|
|
2384
|
+
await writeSuccessfulScaleUpTmuxStub(fakeBinDir, tmuxLogPath);
|
|
2383
2385
|
await writeFile(tmuxLogPath, '');
|
|
2384
2386
|
process.env.PATH = `${fakeBinDir}:${previousPath ?? ''}`;
|
|
2385
2387
|
const teamName = 'scale-up-named-worktree';
|
|
@@ -2396,11 +2398,11 @@ exit 0
|
|
|
2396
2398
|
assert.ok(config);
|
|
2397
2399
|
if (!config)
|
|
2398
2400
|
return;
|
|
2399
|
-
config.tmux_session =
|
|
2401
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
2400
2402
|
config.leader_pane_id = '%11';
|
|
2401
2403
|
config.tmux_pane_owner_id = 'team:scale-up';
|
|
2402
2404
|
config.workers[0].pane_id = '%21';
|
|
2403
|
-
config.workers[0].pid =
|
|
2405
|
+
config.workers[0].pid = 42421;
|
|
2404
2406
|
await saveTeamConfig(config, repo);
|
|
2405
2407
|
const manifestPath = join(repo, '.omx', 'state', 'team', teamName, 'manifest.v2.json');
|
|
2406
2408
|
const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
|
|
@@ -2458,7 +2460,7 @@ esac
|
|
|
2458
2460
|
assert.ok(config);
|
|
2459
2461
|
if (!config)
|
|
2460
2462
|
return;
|
|
2461
|
-
config.tmux_session =
|
|
2463
|
+
config.tmux_session = 'omx-team-scale-up';
|
|
2462
2464
|
config.workers[0].pane_id = '%21';
|
|
2463
2465
|
config.workspace_mode = 'worktree';
|
|
2464
2466
|
config.worktree_mode = { enabled: true, detached: true, name: null };
|
|
@@ -2502,6 +2504,32 @@ printf '%s\n' "$*" >> "${tmuxLogPath}"
|
|
|
2502
2504
|
case "\${1:-}" in
|
|
2503
2505
|
show-option) echo 'team:scale-up' ;;
|
|
2504
2506
|
-V) echo 'tmux 3.2a' ;;
|
|
2507
|
+
display-message)
|
|
2508
|
+
case "$*" in
|
|
2509
|
+
*"-t %32 "*) echo '%32 42432 omx-team-scale-up $1 @1 team:scale-up' ;;
|
|
2510
|
+
*"-t %31 "*) echo '%31 42431 omx-team-scale-up $1 @1 team:scale-up' ;;
|
|
2511
|
+
*"-t %21 "*) echo '%21 42421 omx-team-scale-up $1 @1 team:scale-up' ;;
|
|
2512
|
+
*) exit 1 ;;
|
|
2513
|
+
esac
|
|
2514
|
+
;;
|
|
2515
|
+
if-shell)
|
|
2516
|
+
[ "\${2:-}" = '-F' ] && [ "\${3:-}" = '-t' ] || exit 1
|
|
2517
|
+
target="\${4:-}"
|
|
2518
|
+
success="\${6:-}"
|
|
2519
|
+
receipt="$(printf '%s' "$success" | sed -En 's/.*(omx-scale-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}).*/\\1/p')"
|
|
2520
|
+
case "$success" in
|
|
2521
|
+
*split-window*)
|
|
2522
|
+
split_count=0; [ ! -f "${splitCountPath}" ] || split_count=$(cat "${splitCountPath}")
|
|
2523
|
+
split_count=$((split_count + 1)); printf '%s' "$split_count" > "${splitCountPath}"
|
|
2524
|
+
if [ "$split_count" -eq 1 ]; then pane='%31'; pid='42431'; elif [ "$split_count" -eq 2 ]; then pane='%32'; pid='42432'; else pane='%33'; pid='42433'; fi
|
|
2525
|
+
printf '%s\t%s\t%s\t%s\t%s\t%s\n' "$pane" "$pid" 'omx-team-scale-up' '$1' '@1' "$receipt"
|
|
2526
|
+
;;
|
|
2527
|
+
*kill-pane*)
|
|
2528
|
+
case "$target" in %31) exit 1 ;; %32) printf '%s\n' "$receipt" ;; *) exit 1 ;; esac
|
|
2529
|
+
;;
|
|
2530
|
+
*) printf '%s\n' "$receipt" ;;
|
|
2531
|
+
esac
|
|
2532
|
+
;;
|
|
2505
2533
|
list-panes)
|
|
2506
2534
|
split_count=0; [ ! -f "${splitCountPath}" ] || split_count=$(cat "${splitCountPath}")
|
|
2507
2535
|
if [ "$split_count" -ge 2 ] && [ ! -f "${proofLossUsedPath}" ]; then
|
|
@@ -2523,9 +2551,11 @@ case "\${1:-}" in
|
|
|
2523
2551
|
split_count=0; [ ! -f "${splitCountPath}" ] || split_count=$(cat "${splitCountPath}")
|
|
2524
2552
|
split_count=$((split_count + 1)); printf '%s' "$split_count" > "${splitCountPath}"
|
|
2525
2553
|
if [ "$split_count" -eq 1 ]; then
|
|
2526
|
-
echo '%31'
|
|
2554
|
+
echo '%31\t42431\tomx-team-scale-up\t$1\t@1'
|
|
2555
|
+
elif [ "$split_count" -eq 2 ]; then
|
|
2556
|
+
echo '%32\t42432\tomx-team-scale-up\t$1\t@1'
|
|
2527
2557
|
else
|
|
2528
|
-
echo '%
|
|
2558
|
+
echo '%33\t42433\tomx-team-scale-up\t$1\t@1'
|
|
2529
2559
|
fi
|
|
2530
2560
|
;;
|
|
2531
2561
|
kill-pane)
|
|
@@ -2554,57 +2584,24 @@ esac
|
|
|
2554
2584
|
], cwd, { OMX_TEAM_SCALING_ENABLED: '1', OMX_TEAM_SKIP_READY_WAIT: '1' });
|
|
2555
2585
|
assert.equal(result.ok, false);
|
|
2556
2586
|
if (!result.ok)
|
|
2557
|
-
assert.match(result.error, /^scale_up_rollback_cleanup_debt
|
|
2587
|
+
assert.match(result.error, /^scale_up_rollback_cleanup_debt:pane_teardown_authority_lost:%31/);
|
|
2558
2588
|
assert.equal(await readFile(splitCountPath, 'utf-8'), '2');
|
|
2559
2589
|
const config = await readTeamConfig('rollback-kill-fail', cwd);
|
|
2560
|
-
assert.deepEqual(config?.workers.map((worker) => worker.name), ['worker-1', 'worker-2'
|
|
2561
|
-
assert.equal(config?.worker_count,
|
|
2562
|
-
assert.equal(config?.next_worker_index,
|
|
2590
|
+
assert.deepEqual(config?.workers.map((worker) => worker.name), ['worker-1', 'worker-2']);
|
|
2591
|
+
assert.equal(config?.worker_count, 2);
|
|
2592
|
+
assert.equal(config?.next_worker_index, 3);
|
|
2563
2593
|
assert.equal((await readTask('rollback-kill-fail', '1', cwd))?.owner, 'worker-2');
|
|
2564
|
-
assert.equal(
|
|
2594
|
+
assert.equal(await readTask('rollback-kill-fail', '2', cwd), null);
|
|
2565
2595
|
assert.equal(await readTask('rollback-kill-fail', '3', cwd), null);
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
assert.equal(existsSync(join(workerDir, 'identity.json')), true, 'worker-2 identity must remain');
|
|
2573
|
-
assert.equal(existsSync(join(workerDir, 'inbox.md')), true, 'worker-2 inbox must remain');
|
|
2574
|
-
}
|
|
2575
|
-
else {
|
|
2576
|
-
assert.equal(existsSync(join(workerDir, 'identity.json')), false, 'worker-3 proof failed before identity materialization');
|
|
2577
|
-
assert.equal(existsSync(join(workerDir, 'inbox.md')), false, 'worker-3 proof failed before inbox materialization');
|
|
2578
|
-
}
|
|
2579
|
-
}
|
|
2580
|
-
// P2: retry execution of recorded cleanup debt is intentionally a follow-up surface.
|
|
2596
|
+
const worker2Dir = join(cwd, '.omx', 'state', 'team', 'rollback-kill-fail', 'workers', 'worker-2');
|
|
2597
|
+
assert.equal(existsSync(workerStartupScriptPath(cwd, 'rollback-kill-fail', 'worker-2')), true);
|
|
2598
|
+
assert.equal(existsSync(join(cwd, '.omx', 'team', 'rollback-kill-fail', 'worktrees', 'worker-2')), true);
|
|
2599
|
+
assert.equal(existsSync(worker2Dir), true, 'worker-2 materialized state must remain retryable');
|
|
2600
|
+
assert.equal(existsSync(join(worker2Dir, 'identity.json')), true, 'worker-2 identity must remain');
|
|
2601
|
+
assert.equal(existsSync(join(worker2Dir, 'inbox.md')), true, 'worker-2 inbox must remain');
|
|
2581
2602
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
.map((command) => command.startsWith('split-window ') ? command.split(' -c ')[0] : command);
|
|
2585
|
-
assert.deepEqual(mutationCommands, [
|
|
2586
|
-
'split-window -v -t %21 -d -P -F #{pane_id}',
|
|
2587
|
-
'split-window -v -t %31 -d -P -F #{pane_id}',
|
|
2588
|
-
'kill-pane -t %31',
|
|
2589
|
-
]);
|
|
2590
|
-
for (const mutationCommand of mutationCommands) {
|
|
2591
|
-
const mutationIndex = tmuxCommands.findIndex((command) => (command === mutationCommand || command.startsWith(`${mutationCommand} -c `)));
|
|
2592
|
-
if (mutationCommand.startsWith('split-window ')) {
|
|
2593
|
-
assert.ok(mutationIndex > 2);
|
|
2594
|
-
assert.equal(tmuxCommands[mutationIndex - 3], 'list-panes -a -F #{pane_id}\t#{pane_dead}\t#{pane_pid}');
|
|
2595
|
-
assert.match(tmuxCommands[mutationIndex - 2], /^show-option -qv -p -t %(?:21|31) @omx_team_pane_owner_id$/);
|
|
2596
|
-
assert.equal(tmuxCommands[mutationIndex - 1], 'list-panes -a -F #{pane_id}\t#{pane_dead}\t#{pane_pid}');
|
|
2597
|
-
}
|
|
2598
|
-
else {
|
|
2599
|
-
assert.ok(mutationIndex > 2);
|
|
2600
|
-
assert.equal(tmuxCommands[mutationIndex - 3], 'list-panes -a -F #{pane_id}\t#{pane_dead}\t#{pane_pid}');
|
|
2601
|
-
assert.equal(tmuxCommands[mutationIndex - 2], 'show-option -qv -p -t %31 @omx_team_pane_owner_id');
|
|
2602
|
-
assert.equal(tmuxCommands[mutationIndex - 1], 'list-panes -a -F #{pane_id}\t#{pane_dead}\t#{pane_pid}');
|
|
2603
|
-
}
|
|
2604
|
-
}
|
|
2605
|
-
assert.ok(tmuxCommands.some((command) => command.startsWith('split-window -v -t %21 ')));
|
|
2606
|
-
assert.ok(tmuxCommands.some((command) => command.startsWith('split-window -v -t %31 ')));
|
|
2607
|
-
assert.ok(tmuxCommands.some((command) => command === 'kill-pane -t %31'));
|
|
2603
|
+
// The first rollback cleanup transaction fails closed on %31 authority; later panes are never touched.
|
|
2604
|
+
assert.ok(tmuxCommands.some((command) => isGuardedScaleMutation(command, 'kill-pane', '%31')));
|
|
2608
2605
|
assert.equal(tmuxCommands.some((command) => command === 'kill-pane -t %32'), false);
|
|
2609
2606
|
}
|
|
2610
2607
|
finally {
|
|
@@ -2685,8 +2682,8 @@ esac
|
|
|
2685
2682
|
assert.equal(existsSync(join(cwd, '.omx', 'state', 'team', teamName, 'workers', 'worker-2')), false);
|
|
2686
2683
|
assert.equal(existsSync(workerStartupScriptPath(cwd, teamName, 'worker-2')), false);
|
|
2687
2684
|
const tmuxCommands = await readScaleUpTmuxLogCommands(tmuxLogPath);
|
|
2688
|
-
assert.
|
|
2689
|
-
assert.ok(tmuxCommands.
|
|
2685
|
+
assert.equal(guardedScaleSplitCount(tmuxCommands), 1);
|
|
2686
|
+
assert.ok(tmuxCommands.some((command) => isGuardedScaleMutation(command, 'kill-pane', '%31')));
|
|
2690
2687
|
}
|
|
2691
2688
|
finally {
|
|
2692
2689
|
if (typeof previousPath === 'string')
|
|
@@ -2728,7 +2725,7 @@ esac
|
|
|
2728
2725
|
assert.throws(() => execFileSync('git', ['show-ref', '--verify', '--quiet', `refs/heads/${branchName}`], { cwd: repo }));
|
|
2729
2726
|
assert.equal((await readTeamConfig(teamName, repo))?.workers.length, 1);
|
|
2730
2727
|
assert.equal(existsSync(join(repo, '.omx', 'state', 'team', teamName, 'workers', 'worker-2')), false);
|
|
2731
|
-
assert.deepEqual((await readScaleUpTmuxLogCommands(tmuxLogPath)).filter((command) => command
|
|
2728
|
+
assert.deepEqual((await readScaleUpTmuxLogCommands(tmuxLogPath)).filter((command) => isGuardedScaleMutation(command, 'split-window')), []);
|
|
2732
2729
|
}
|
|
2733
2730
|
finally {
|
|
2734
2731
|
if (typeof previousPath === 'string')
|
|
@@ -2817,14 +2814,19 @@ describe('scaleDown', () => {
|
|
|
2817
2814
|
const task = await createTask('claim-boundary', {
|
|
2818
2815
|
subject: 'boundary task', description: 'must not be claimed by a removed worker', status: 'pending', owner: 'worker-2',
|
|
2819
2816
|
}, cwd);
|
|
2817
|
+
const boundaryMarker = join(cwd, 'claim-boundary-held');
|
|
2820
2818
|
const down = scaleDown('claim-boundary', cwd, { workerNames: ['worker-2'], force: true }, {
|
|
2821
2819
|
OMX_TEAM_SCALING_ENABLED: '1',
|
|
2822
|
-
OMX_TEAM_SCALE_DOWN_BOUNDARY_HOLD_MS: '
|
|
2820
|
+
OMX_TEAM_SCALE_DOWN_BOUNDARY_HOLD_MS: '250',
|
|
2821
|
+
OMX_TEAM_SCALE_DOWN_POST_SNAPSHOT_MARKER: boundaryMarker,
|
|
2823
2822
|
});
|
|
2823
|
+
// The marker is written while the membership barrier and task claim locks
|
|
2824
|
+
// are held and it persists, so a deadline wait on it cannot miss the
|
|
2825
|
+
// boundary window under load. The former fixed 50x5ms poll watched the
|
|
2826
|
+
// transient claim lock dir and expired before the boundary transaction
|
|
2827
|
+
// even started under CI load (#3548).
|
|
2828
|
+
await waitForFileToAppear(boundaryMarker);
|
|
2824
2829
|
const lockPath = join(cwd, '.omx', 'state', 'team', 'claim-boundary', 'claims', `task-${task.id}.lock`);
|
|
2825
|
-
for (let attempt = 0; attempt < 50 && !existsSync(lockPath); attempt += 1) {
|
|
2826
|
-
await new Promise((resolve) => setTimeout(resolve, 5));
|
|
2827
|
-
}
|
|
2828
2830
|
assert.equal(existsSync(lockPath), true);
|
|
2829
2831
|
const claim = claimTask('claim-boundary', task.id, 'worker-2', task.version ?? 1, cwd);
|
|
2830
2832
|
assert.deepEqual(await down, { ok: true, removedWorkers: ['worker-2'], newWorkerCount: 1 });
|
|
@@ -2832,6 +2834,11 @@ describe('scaleDown', () => {
|
|
|
2832
2834
|
const reconciled = await readTask('claim-boundary', task.id, cwd);
|
|
2833
2835
|
assert.equal(reconciled?.owner, undefined);
|
|
2834
2836
|
assert.equal(reconciled?.claim, undefined);
|
|
2837
|
+
// Negative control: with the reconciled (post-boundary) version the claim
|
|
2838
|
+
// no longer conflicts on the version; it fails on worker removal instead.
|
|
2839
|
+
// That proves the claim_conflict above required the serialized
|
|
2840
|
+
// pre-boundary version rather than mere worker deletion.
|
|
2841
|
+
assert.deepEqual(await claimTask('claim-boundary', task.id, 'worker-2', reconciled?.version ?? 1, cwd), { ok: false, error: 'worker_not_found' });
|
|
2835
2842
|
}
|
|
2836
2843
|
finally {
|
|
2837
2844
|
await rm(cwd, { recursive: true, force: true });
|
|
@@ -2850,10 +2857,7 @@ describe('scaleDown', () => {
|
|
|
2850
2857
|
OMX_TEAM_SCALE_DOWN_BOUNDARY_HOLD_MS: '250',
|
|
2851
2858
|
OMX_TEAM_SCALE_DOWN_POST_SNAPSHOT_MARKER: postSnapshotMarker,
|
|
2852
2859
|
});
|
|
2853
|
-
|
|
2854
|
-
await new Promise((resolve) => setTimeout(resolve, 5));
|
|
2855
|
-
}
|
|
2856
|
-
assert.equal(existsSync(postSnapshotMarker), true);
|
|
2860
|
+
await waitForFileToAppear(postSnapshotMarker);
|
|
2857
2861
|
let createSettled = false;
|
|
2858
2862
|
let claimSettled = false;
|
|
2859
2863
|
const created = createTask('create-claim-boundary', {
|
|
@@ -2875,6 +2879,26 @@ describe('scaleDown', () => {
|
|
|
2875
2879
|
await rm(cwd, { recursive: true, force: true });
|
|
2876
2880
|
}
|
|
2877
2881
|
});
|
|
2882
|
+
it('deadline appearance wait fails loudly on timeout and tolerates late appearance', async () => {
|
|
2883
|
+
const cwd = await mkdtemp(join(tmpdir(), 'omx-scale-down-wait-negative-control-'));
|
|
2884
|
+
try {
|
|
2885
|
+
// Negative control for the boundary synchronization: when the awaited
|
|
2886
|
+
// artifact is never created the wait must reject at its deadline instead
|
|
2887
|
+
// of silently falling through to a misleading assertion.
|
|
2888
|
+
await assert.rejects(() => waitForFileToAppear(join(cwd, 'never-created'), 60), /timed out after 60ms waiting for .*never-created to appear/);
|
|
2889
|
+
// The wait is deadline-based, not attempt-count-based: an artifact that
|
|
2890
|
+
// appears after the former 250ms fixed budget still resolves the wait.
|
|
2891
|
+
const lateMarker = join(cwd, 'late-marker');
|
|
2892
|
+
const lateWait = waitForFileToAppear(lateMarker, 5_000);
|
|
2893
|
+
await new Promise((resolve) => setTimeout(resolve, 25));
|
|
2894
|
+
await writeFile(lateMarker, 'held\n', 'utf8');
|
|
2895
|
+
await lateWait;
|
|
2896
|
+
assert.equal(existsSync(lateMarker), true);
|
|
2897
|
+
}
|
|
2898
|
+
finally {
|
|
2899
|
+
await rm(cwd, { recursive: true, force: true });
|
|
2900
|
+
}
|
|
2901
|
+
});
|
|
2878
2902
|
});
|
|
2879
2903
|
describe('scaleDown worktree AGENTS cleanup', () => {
|
|
2880
2904
|
it('removes generated worktree-root AGENTS during scale-down', async () => {
|