codex-orchestrator 0.1.51 → 2.0.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/CHANGELOG.md +21 -0
- package/README.md +45 -389
- package/dist/src/index.d.ts +16 -46
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +8 -24
- package/dist/src/index.js.map +1 -1
- package/dist/src/v2/acceptance-proof.d.ts +111 -0
- package/dist/src/v2/acceptance-proof.d.ts.map +1 -0
- package/dist/src/v2/acceptance-proof.js +427 -0
- package/dist/src/v2/acceptance-proof.js.map +1 -0
- package/dist/src/v2/adapters/command.d.ts.map +1 -0
- package/dist/src/v2/adapters/command.js.map +1 -0
- package/dist/src/v2/adapters/durable-atomic-file.d.ts.map +1 -0
- package/dist/src/v2/adapters/durable-atomic-file.js.map +1 -0
- package/dist/src/v2/adapters/gh-cli.d.ts.map +1 -0
- package/dist/src/v2/adapters/gh-cli.js.map +1 -0
- package/dist/src/v2/adapters/gh-issue-adapter.d.ts.map +1 -0
- package/dist/src/v2/adapters/gh-issue-adapter.js.map +1 -0
- package/dist/src/v2/adapters/gh-pull-request-adapter.d.ts.map +1 -0
- package/dist/src/v2/adapters/gh-pull-request-adapter.js.map +1 -0
- package/dist/src/v2/adapters/issues.d.ts.map +1 -0
- package/dist/src/v2/adapters/issues.js.map +1 -0
- package/dist/src/v2/adapters/mission-coordinator-lock.d.ts.map +1 -0
- package/dist/src/v2/adapters/mission-coordinator-lock.js.map +1 -0
- package/dist/src/v2/adapters/path-policy.d.ts.map +1 -0
- package/dist/src/v2/adapters/path-policy.js.map +1 -0
- package/dist/src/v2/adapters/pull-requests.d.ts.map +1 -0
- package/dist/src/v2/adapters/pull-requests.js.map +1 -0
- package/dist/src/v2/adapters/target-activity-fence.d.ts.map +1 -0
- package/dist/src/{runner → v2/adapters}/target-activity-fence.js +1 -1
- package/dist/src/v2/adapters/target-activity-fence.js.map +1 -0
- package/dist/src/{git → v2/adapters}/worktree.d.ts +1 -1
- package/dist/src/v2/adapters/worktree.d.ts.map +1 -0
- package/dist/src/{git → v2/adapters}/worktree.js +2 -2
- package/dist/src/v2/adapters/worktree.js.map +1 -0
- package/dist/src/v2/atomic-store.d.ts +36 -0
- package/dist/src/v2/atomic-store.d.ts.map +1 -0
- package/dist/src/v2/atomic-store.js +328 -0
- package/dist/src/v2/atomic-store.js.map +1 -0
- package/dist/src/v2/candidate-cli.d.ts +22 -0
- package/dist/src/v2/candidate-cli.d.ts.map +1 -0
- package/dist/src/v2/candidate-cli.js +161 -0
- package/dist/src/v2/candidate-cli.js.map +1 -0
- package/dist/src/v2/checked-change.d.ts +49 -0
- package/dist/src/v2/checked-change.d.ts.map +1 -0
- package/dist/src/v2/checked-change.js +139 -0
- package/dist/src/v2/checked-change.js.map +1 -0
- package/dist/src/v2/cli-contract.d.ts +8 -0
- package/dist/src/v2/cli-contract.d.ts.map +1 -0
- package/dist/src/v2/cli-contract.js +32 -0
- package/dist/src/v2/cli-contract.js.map +1 -0
- package/dist/src/v2/codex-process.d.ts +71 -0
- package/dist/src/v2/codex-process.d.ts.map +1 -0
- package/dist/src/v2/codex-process.js +404 -0
- package/dist/src/v2/codex-process.js.map +1 -0
- package/dist/src/v2/config.d.ts +45 -0
- package/dist/src/v2/config.d.ts.map +1 -0
- package/dist/src/v2/config.js +139 -0
- package/dist/src/v2/config.js.map +1 -0
- package/dist/src/v2/containment.d.ts +55 -0
- package/dist/src/v2/containment.d.ts.map +1 -0
- package/dist/src/v2/containment.js +370 -0
- package/dist/src/v2/containment.js.map +1 -0
- package/dist/src/v2/implementation-report.d.ts +18 -0
- package/dist/src/v2/implementation-report.d.ts.map +1 -0
- package/dist/src/v2/implementation-report.js +147 -0
- package/dist/src/v2/implementation-report.js.map +1 -0
- package/dist/src/v2/legacy-cutover.d.ts +52 -0
- package/dist/src/v2/legacy-cutover.d.ts.map +1 -0
- package/dist/src/v2/legacy-cutover.js +87 -0
- package/dist/src/v2/legacy-cutover.js.map +1 -0
- package/dist/src/v2/mobile-lease.d.ts +97 -0
- package/dist/src/v2/mobile-lease.d.ts.map +1 -0
- package/dist/src/v2/mobile-lease.js +253 -0
- package/dist/src/v2/mobile-lease.js.map +1 -0
- package/dist/src/v2/proof-report.d.ts +118 -0
- package/dist/src/v2/proof-report.d.ts.map +1 -0
- package/dist/src/v2/proof-report.js +703 -0
- package/dist/src/v2/proof-report.js.map +1 -0
- package/dist/src/v2/proof-store.d.ts +42 -0
- package/dist/src/v2/proof-store.d.ts.map +1 -0
- package/dist/src/v2/proof-store.js +180 -0
- package/dist/src/v2/proof-store.js.map +1 -0
- package/dist/src/v2/report-envelope.d.ts +4 -0
- package/dist/src/v2/report-envelope.d.ts.map +1 -0
- package/dist/src/v2/report-envelope.js +46 -0
- package/dist/src/v2/report-envelope.js.map +1 -0
- package/dist/src/v2/run-issue.d.ts +213 -0
- package/dist/src/v2/run-issue.d.ts.map +1 -0
- package/dist/src/v2/run-issue.js +906 -0
- package/dist/src/v2/run-issue.js.map +1 -0
- package/dist/src/v2/run-store.d.ts +136 -0
- package/dist/src/v2/run-store.d.ts.map +1 -0
- package/dist/src/v2/run-store.js +346 -0
- package/dist/src/v2/run-store.js.map +1 -0
- package/dist/src/v2/runtime-assets.d.ts +31 -0
- package/dist/src/v2/runtime-assets.d.ts.map +1 -0
- package/dist/src/v2/runtime-assets.js +473 -0
- package/dist/src/v2/runtime-assets.js.map +1 -0
- package/dist/src/v2/runtime.d.ts +137 -0
- package/dist/src/v2/runtime.d.ts.map +1 -0
- package/dist/src/v2/runtime.js +847 -0
- package/dist/src/v2/runtime.js.map +1 -0
- package/dist/src/v2/setup-cli.d.ts +5 -0
- package/dist/src/v2/setup-cli.d.ts.map +1 -0
- package/dist/src/v2/setup-cli.js +83 -0
- package/dist/src/v2/setup-cli.js.map +1 -0
- package/dist/src/v2/setup-runtime.d.ts +6 -0
- package/dist/src/v2/setup-runtime.d.ts.map +1 -0
- package/dist/src/v2/setup-runtime.js +213 -0
- package/dist/src/v2/setup-runtime.js.map +1 -0
- package/dist/src/v2/setup-store.d.ts +19 -0
- package/dist/src/v2/setup-store.d.ts.map +1 -0
- package/dist/src/v2/setup-store.js +208 -0
- package/dist/src/v2/setup-store.js.map +1 -0
- package/dist/src/v2/setup.d.ts +147 -0
- package/dist/src/v2/setup.d.ts.map +1 -0
- package/dist/src/v2/setup.js +529 -0
- package/dist/src/v2/setup.js.map +1 -0
- package/docs/deep-dive.md +54 -803
- package/internal-skills/acceptance-proof/SKILL.md +14 -0
- package/internal-skills/acceptance-proof/references/android.md +14 -0
- package/internal-skills/acceptance-proof/references/browser.md +13 -0
- package/internal-skills/acceptance-proof/references/ios.md +14 -0
- package/internal-skills/acceptance-proof/tools/android-lease.mjs +280 -0
- package/internal-skills/acceptance-proof/tools/ios-lease.mjs +288 -0
- package/internal-skills/agent-auto/SKILL.md +14 -0
- package/package.json +11 -18
- package/bridge-runtime.json +0 -2719
- package/dist/src/bridge-runtime.d.ts +0 -17
- package/dist/src/bridge-runtime.d.ts.map +0 -1
- package/dist/src/bridge-runtime.js +0 -170
- package/dist/src/bridge-runtime.js.map +0 -1
- package/dist/src/cli.d.ts +0 -3
- package/dist/src/cli.d.ts.map +0 -1
- package/dist/src/cli.js +0 -569
- package/dist/src/cli.js.map +0 -1
- package/dist/src/codex/command-adapter.d.ts +0 -47
- package/dist/src/codex/command-adapter.d.ts.map +0 -1
- package/dist/src/codex/command-adapter.js +0 -169
- package/dist/src/codex/command-adapter.js.map +0 -1
- package/dist/src/codex/mobile-device-guard.d.ts +0 -7
- package/dist/src/codex/mobile-device-guard.d.ts.map +0 -1
- package/dist/src/codex/mobile-device-guard.js +0 -63
- package/dist/src/codex/mobile-device-guard.js.map +0 -1
- package/dist/src/config/constants.d.ts +0 -6
- package/dist/src/config/constants.d.ts.map +0 -1
- package/dist/src/config/constants.js +0 -19
- package/dist/src/config/constants.js.map +0 -1
- package/dist/src/config/schema.d.ts +0 -234
- package/dist/src/config/schema.d.ts.map +0 -1
- package/dist/src/config/schema.js +0 -673
- package/dist/src/config/schema.js.map +0 -1
- package/dist/src/fs/durable-atomic-file.d.ts.map +0 -1
- package/dist/src/fs/durable-atomic-file.js.map +0 -1
- package/dist/src/git/base-branch.d.ts +0 -26
- package/dist/src/git/base-branch.d.ts.map +0 -1
- package/dist/src/git/base-branch.js +0 -45
- package/dist/src/git/base-branch.js.map +0 -1
- package/dist/src/git/worktree.d.ts.map +0 -1
- package/dist/src/git/worktree.js.map +0 -1
- package/dist/src/github/gh-cli.d.ts.map +0 -1
- package/dist/src/github/gh-cli.js.map +0 -1
- package/dist/src/github/gh-issue-adapter.d.ts.map +0 -1
- package/dist/src/github/gh-issue-adapter.js.map +0 -1
- package/dist/src/github/gh-pull-request-adapter.d.ts.map +0 -1
- package/dist/src/github/gh-pull-request-adapter.js.map +0 -1
- package/dist/src/github/issues.d.ts.map +0 -1
- package/dist/src/github/issues.js.map +0 -1
- package/dist/src/github/pull-requests.d.ts.map +0 -1
- package/dist/src/github/pull-requests.js.map +0 -1
- package/dist/src/package-info.d.ts +0 -6
- package/dist/src/package-info.d.ts.map +0 -1
- package/dist/src/package-info.js +0 -13
- package/dist/src/package-info.js.map +0 -1
- package/dist/src/path-policy.d.ts.map +0 -1
- package/dist/src/path-policy.js.map +0 -1
- package/dist/src/process/command.d.ts.map +0 -1
- package/dist/src/process/command.js.map +0 -1
- package/dist/src/review-handoff.d.ts +0 -3
- package/dist/src/review-handoff.d.ts.map +0 -1
- package/dist/src/review-handoff.js +0 -8
- package/dist/src/review-handoff.js.map +0 -1
- package/dist/src/runner/acceptance-proof-loop.d.ts +0 -97
- package/dist/src/runner/acceptance-proof-loop.d.ts.map +0 -1
- package/dist/src/runner/acceptance-proof-loop.js +0 -404
- package/dist/src/runner/acceptance-proof-loop.js.map +0 -1
- package/dist/src/runner/acceptance-proof-runner.d.ts +0 -24
- package/dist/src/runner/acceptance-proof-runner.d.ts.map +0 -1
- package/dist/src/runner/acceptance-proof-runner.js +0 -121
- package/dist/src/runner/acceptance-proof-runner.js.map +0 -1
- package/dist/src/runner/acceptance-proof.d.ts +0 -189
- package/dist/src/runner/acceptance-proof.d.ts.map +0 -1
- package/dist/src/runner/acceptance-proof.js +0 -594
- package/dist/src/runner/acceptance-proof.js.map +0 -1
- package/dist/src/runner/agent-attempt.d.ts +0 -105
- package/dist/src/runner/agent-attempt.d.ts.map +0 -1
- package/dist/src/runner/agent-attempt.js +0 -245
- package/dist/src/runner/agent-attempt.js.map +0 -1
- package/dist/src/runner/android-visual-proof-command.d.ts +0 -26
- package/dist/src/runner/android-visual-proof-command.d.ts.map +0 -1
- package/dist/src/runner/android-visual-proof-command.js +0 -592
- package/dist/src/runner/android-visual-proof-command.js.map +0 -1
- package/dist/src/runner/auto-visual-proof-command.d.ts +0 -15
- package/dist/src/runner/auto-visual-proof-command.d.ts.map +0 -1
- package/dist/src/runner/auto-visual-proof-command.js +0 -64
- package/dist/src/runner/auto-visual-proof-command.js.map +0 -1
- package/dist/src/runner/browser-proof-contract.d.ts +0 -134
- package/dist/src/runner/browser-proof-contract.d.ts.map +0 -1
- package/dist/src/runner/browser-proof-contract.js +0 -400
- package/dist/src/runner/browser-proof-contract.js.map +0 -1
- package/dist/src/runner/browser-visual-proof-command.d.ts +0 -101
- package/dist/src/runner/browser-visual-proof-command.d.ts.map +0 -1
- package/dist/src/runner/browser-visual-proof-command.js +0 -532
- package/dist/src/runner/browser-visual-proof-command.js.map +0 -1
- package/dist/src/runner/command-utils.d.ts +0 -15
- package/dist/src/runner/command-utils.d.ts.map +0 -1
- package/dist/src/runner/command-utils.js +0 -228
- package/dist/src/runner/command-utils.js.map +0 -1
- package/dist/src/runner/completion-report.d.ts +0 -121
- package/dist/src/runner/completion-report.d.ts.map +0 -1
- package/dist/src/runner/completion-report.js +0 -381
- package/dist/src/runner/completion-report.js.map +0 -1
- package/dist/src/runner/context-snapshot.d.ts +0 -33
- package/dist/src/runner/context-snapshot.d.ts.map +0 -1
- package/dist/src/runner/context-snapshot.js +0 -99
- package/dist/src/runner/context-snapshot.js.map +0 -1
- package/dist/src/runner/daemon-command.d.ts +0 -30
- package/dist/src/runner/daemon-command.d.ts.map +0 -1
- package/dist/src/runner/daemon-command.js +0 -262
- package/dist/src/runner/daemon-command.js.map +0 -1
- package/dist/src/runner/doctor-command.d.ts +0 -41
- package/dist/src/runner/doctor-command.d.ts.map +0 -1
- package/dist/src/runner/doctor-command.js +0 -177
- package/dist/src/runner/doctor-command.js.map +0 -1
- package/dist/src/runner/durable-run-summary.d.ts +0 -80
- package/dist/src/runner/durable-run-summary.d.ts.map +0 -1
- package/dist/src/runner/durable-run-summary.js +0 -200
- package/dist/src/runner/durable-run-summary.js.map +0 -1
- package/dist/src/runner/flutter-sdk-discovery.d.ts +0 -5
- package/dist/src/runner/flutter-sdk-discovery.d.ts.map +0 -1
- package/dist/src/runner/flutter-sdk-discovery.js +0 -103
- package/dist/src/runner/flutter-sdk-discovery.js.map +0 -1
- package/dist/src/runner/fresh-context-review.d.ts +0 -22
- package/dist/src/runner/fresh-context-review.d.ts.map +0 -1
- package/dist/src/runner/fresh-context-review.js +0 -177
- package/dist/src/runner/fresh-context-review.js.map +0 -1
- package/dist/src/runner/handoff-evidence.d.ts +0 -141
- package/dist/src/runner/handoff-evidence.d.ts.map +0 -1
- package/dist/src/runner/handoff-evidence.js +0 -543
- package/dist/src/runner/handoff-evidence.js.map +0 -1
- package/dist/src/runner/hygiene-cleanup.d.ts +0 -15
- package/dist/src/runner/hygiene-cleanup.d.ts.map +0 -1
- package/dist/src/runner/hygiene-cleanup.js +0 -25
- package/dist/src/runner/hygiene-cleanup.js.map +0 -1
- package/dist/src/runner/ios-visual-proof-command.d.ts +0 -25
- package/dist/src/runner/ios-visual-proof-command.d.ts.map +0 -1
- package/dist/src/runner/ios-visual-proof-command.js +0 -353
- package/dist/src/runner/ios-visual-proof-command.js.map +0 -1
- package/dist/src/runner/issue-state-machine.d.ts +0 -39
- package/dist/src/runner/issue-state-machine.d.ts.map +0 -1
- package/dist/src/runner/issue-state-machine.js +0 -124
- package/dist/src/runner/issue-state-machine.js.map +0 -1
- package/dist/src/runner/issue-tree.d.ts +0 -65
- package/dist/src/runner/issue-tree.d.ts.map +0 -1
- package/dist/src/runner/issue-tree.js +0 -474
- package/dist/src/runner/issue-tree.js.map +0 -1
- package/dist/src/runner/lifecycle-events.d.ts +0 -44
- package/dist/src/runner/lifecycle-events.d.ts.map +0 -1
- package/dist/src/runner/lifecycle-events.js +0 -108
- package/dist/src/runner/lifecycle-events.js.map +0 -1
- package/dist/src/runner/local-execution-session.d.ts +0 -112
- package/dist/src/runner/local-execution-session.d.ts.map +0 -1
- package/dist/src/runner/local-execution-session.js +0 -1064
- package/dist/src/runner/local-execution-session.js.map +0 -1
- package/dist/src/runner/local-state.d.ts +0 -44
- package/dist/src/runner/local-state.d.ts.map +0 -1
- package/dist/src/runner/local-state.js +0 -150
- package/dist/src/runner/local-state.js.map +0 -1
- package/dist/src/runner/mission-activation.d.ts +0 -29
- package/dist/src/runner/mission-activation.d.ts.map +0 -1
- package/dist/src/runner/mission-activation.js +0 -54
- package/dist/src/runner/mission-activation.js.map +0 -1
- package/dist/src/runner/mission-agent-broker.d.ts +0 -53
- package/dist/src/runner/mission-agent-broker.d.ts.map +0 -1
- package/dist/src/runner/mission-agent-broker.js +0 -182
- package/dist/src/runner/mission-agent-broker.js.map +0 -1
- package/dist/src/runner/mission-cancellation.d.ts +0 -77
- package/dist/src/runner/mission-cancellation.d.ts.map +0 -1
- package/dist/src/runner/mission-cancellation.js +0 -180
- package/dist/src/runner/mission-cancellation.js.map +0 -1
- package/dist/src/runner/mission-canonical-path.d.ts +0 -34
- package/dist/src/runner/mission-canonical-path.d.ts.map +0 -1
- package/dist/src/runner/mission-canonical-path.js +0 -121
- package/dist/src/runner/mission-canonical-path.js.map +0 -1
- package/dist/src/runner/mission-capability-kernel.d.ts +0 -34
- package/dist/src/runner/mission-capability-kernel.d.ts.map +0 -1
- package/dist/src/runner/mission-capability-kernel.js +0 -158
- package/dist/src/runner/mission-capability-kernel.js.map +0 -1
- package/dist/src/runner/mission-check-policy.d.ts +0 -17
- package/dist/src/runner/mission-check-policy.d.ts.map +0 -1
- package/dist/src/runner/mission-check-policy.js +0 -31
- package/dist/src/runner/mission-check-policy.js.map +0 -1
- package/dist/src/runner/mission-coordinator-lock.d.ts.map +0 -1
- package/dist/src/runner/mission-coordinator-lock.js.map +0 -1
- package/dist/src/runner/mission-deployment.d.ts +0 -21
- package/dist/src/runner/mission-deployment.d.ts.map +0 -1
- package/dist/src/runner/mission-deployment.js +0 -108
- package/dist/src/runner/mission-deployment.js.map +0 -1
- package/dist/src/runner/mission-evaluation.d.ts +0 -61
- package/dist/src/runner/mission-evaluation.d.ts.map +0 -1
- package/dist/src/runner/mission-evaluation.js +0 -183
- package/dist/src/runner/mission-evaluation.js.map +0 -1
- package/dist/src/runner/mission-executor-probe.d.ts +0 -10
- package/dist/src/runner/mission-executor-probe.d.ts.map +0 -1
- package/dist/src/runner/mission-executor-probe.js +0 -180
- package/dist/src/runner/mission-executor-probe.js.map +0 -1
- package/dist/src/runner/mission-git-contracts.d.ts +0 -75
- package/dist/src/runner/mission-git-contracts.d.ts.map +0 -1
- package/dist/src/runner/mission-git-contracts.js +0 -201
- package/dist/src/runner/mission-git-contracts.js.map +0 -1
- package/dist/src/runner/mission-git-runtime-owner-ref.d.ts +0 -13
- package/dist/src/runner/mission-git-runtime-owner-ref.d.ts.map +0 -1
- package/dist/src/runner/mission-git-runtime-owner-ref.js +0 -111
- package/dist/src/runner/mission-git-runtime-owner-ref.js.map +0 -1
- package/dist/src/runner/mission-git-transaction.d.ts +0 -97
- package/dist/src/runner/mission-git-transaction.d.ts.map +0 -1
- package/dist/src/runner/mission-git-transaction.js +0 -1009
- package/dist/src/runner/mission-git-transaction.js.map +0 -1
- package/dist/src/runner/mission-identifiers.d.ts +0 -31
- package/dist/src/runner/mission-identifiers.d.ts.map +0 -1
- package/dist/src/runner/mission-identifiers.js +0 -75
- package/dist/src/runner/mission-identifiers.js.map +0 -1
- package/dist/src/runner/mission-input-snapshot.d.ts +0 -21
- package/dist/src/runner/mission-input-snapshot.d.ts.map +0 -1
- package/dist/src/runner/mission-input-snapshot.js +0 -63
- package/dist/src/runner/mission-input-snapshot.js.map +0 -1
- package/dist/src/runner/mission-ownership.d.ts +0 -38
- package/dist/src/runner/mission-ownership.d.ts.map +0 -1
- package/dist/src/runner/mission-ownership.js +0 -88
- package/dist/src/runner/mission-ownership.js.map +0 -1
- package/dist/src/runner/mission-patch-audit.d.ts +0 -21
- package/dist/src/runner/mission-patch-audit.d.ts.map +0 -1
- package/dist/src/runner/mission-patch-audit.js +0 -186
- package/dist/src/runner/mission-patch-audit.js.map +0 -1
- package/dist/src/runner/mission-path-language.d.ts +0 -6
- package/dist/src/runner/mission-path-language.d.ts.map +0 -1
- package/dist/src/runner/mission-path-language.js +0 -106
- package/dist/src/runner/mission-path-language.js.map +0 -1
- package/dist/src/runner/mission-permit-authority.d.ts +0 -26
- package/dist/src/runner/mission-permit-authority.d.ts.map +0 -1
- package/dist/src/runner/mission-permit-authority.js +0 -145
- package/dist/src/runner/mission-permit-authority.js.map +0 -1
- package/dist/src/runner/mission-plan-parent-coordinator.d.ts +0 -87
- package/dist/src/runner/mission-plan-parent-coordinator.d.ts.map +0 -1
- package/dist/src/runner/mission-plan-parent-coordinator.js +0 -441
- package/dist/src/runner/mission-plan-parent-coordinator.js.map +0 -1
- package/dist/src/runner/mission-plan-parent.d.ts +0 -156
- package/dist/src/runner/mission-plan-parent.d.ts.map +0 -1
- package/dist/src/runner/mission-plan-parent.js +0 -589
- package/dist/src/runner/mission-plan-parent.js.map +0 -1
- package/dist/src/runner/mission-process-executor.d.ts +0 -25
- package/dist/src/runner/mission-process-executor.d.ts.map +0 -1
- package/dist/src/runner/mission-process-executor.js +0 -182
- package/dist/src/runner/mission-process-executor.js.map +0 -1
- package/dist/src/runner/mission-publication-git.d.ts +0 -21
- package/dist/src/runner/mission-publication-git.d.ts.map +0 -1
- package/dist/src/runner/mission-publication-git.js +0 -61
- package/dist/src/runner/mission-publication-git.js.map +0 -1
- package/dist/src/runner/mission-publication.d.ts +0 -192
- package/dist/src/runner/mission-publication.d.ts.map +0 -1
- package/dist/src/runner/mission-publication.js +0 -1001
- package/dist/src/runner/mission-publication.js.map +0 -1
- package/dist/src/runner/mission-quarantine-patch-executor.d.ts +0 -29
- package/dist/src/runner/mission-quarantine-patch-executor.d.ts.map +0 -1
- package/dist/src/runner/mission-quarantine-patch-executor.js +0 -121
- package/dist/src/runner/mission-quarantine-patch-executor.js.map +0 -1
- package/dist/src/runner/mission-repository-executor.d.ts +0 -54
- package/dist/src/runner/mission-repository-executor.d.ts.map +0 -1
- package/dist/src/runner/mission-repository-executor.js +0 -192
- package/dist/src/runner/mission-repository-executor.js.map +0 -1
- package/dist/src/runner/mission-repository-observer.d.ts +0 -8
- package/dist/src/runner/mission-repository-observer.d.ts.map +0 -1
- package/dist/src/runner/mission-repository-observer.js +0 -24
- package/dist/src/runner/mission-repository-observer.js.map +0 -1
- package/dist/src/runner/mission-reservations.d.ts +0 -15
- package/dist/src/runner/mission-reservations.d.ts.map +0 -1
- package/dist/src/runner/mission-reservations.js +0 -116
- package/dist/src/runner/mission-reservations.js.map +0 -1
- package/dist/src/runner/mission-resolution-loop.d.ts +0 -172
- package/dist/src/runner/mission-resolution-loop.d.ts.map +0 -1
- package/dist/src/runner/mission-resolution-loop.js +0 -318
- package/dist/src/runner/mission-resolution-loop.js.map +0 -1
- package/dist/src/runner/mission-runtime-owner.d.ts +0 -36
- package/dist/src/runner/mission-runtime-owner.d.ts.map +0 -1
- package/dist/src/runner/mission-runtime-owner.js +0 -174
- package/dist/src/runner/mission-runtime-owner.js.map +0 -1
- package/dist/src/runner/mission-safe-executor.d.ts +0 -96
- package/dist/src/runner/mission-safe-executor.d.ts.map +0 -1
- package/dist/src/runner/mission-safe-executor.js +0 -288
- package/dist/src/runner/mission-safe-executor.js.map +0 -1
- package/dist/src/runner/mission-sandbox.d.ts +0 -16
- package/dist/src/runner/mission-sandbox.d.ts.map +0 -1
- package/dist/src/runner/mission-sandbox.js +0 -91
- package/dist/src/runner/mission-sandbox.js.map +0 -1
- package/dist/src/runner/mission-scheduler.d.ts +0 -57
- package/dist/src/runner/mission-scheduler.d.ts.map +0 -1
- package/dist/src/runner/mission-scheduler.js +0 -205
- package/dist/src/runner/mission-scheduler.js.map +0 -1
- package/dist/src/runner/mission-scope-expansion.d.ts +0 -47
- package/dist/src/runner/mission-scope-expansion.d.ts.map +0 -1
- package/dist/src/runner/mission-scope-expansion.js +0 -147
- package/dist/src/runner/mission-scope-expansion.js.map +0 -1
- package/dist/src/runner/mission-state-machine.d.ts +0 -118
- package/dist/src/runner/mission-state-machine.d.ts.map +0 -1
- package/dist/src/runner/mission-state-machine.js +0 -316
- package/dist/src/runner/mission-state-machine.js.map +0 -1
- package/dist/src/runner/mission-state-store.d.ts +0 -70
- package/dist/src/runner/mission-state-store.d.ts.map +0 -1
- package/dist/src/runner/mission-state-store.js +0 -916
- package/dist/src/runner/mission-state-store.js.map +0 -1
- package/dist/src/runner/mobile-device-lease.d.ts +0 -11
- package/dist/src/runner/mobile-device-lease.d.ts.map +0 -1
- package/dist/src/runner/mobile-device-lease.js +0 -121
- package/dist/src/runner/mobile-device-lease.js.map +0 -1
- package/dist/src/runner/mobile-visual-proof-command.d.ts +0 -17
- package/dist/src/runner/mobile-visual-proof-command.d.ts.map +0 -1
- package/dist/src/runner/mobile-visual-proof-command.js +0 -168
- package/dist/src/runner/mobile-visual-proof-command.js.map +0 -1
- package/dist/src/runner/plan-auto-command.d.ts +0 -35
- package/dist/src/runner/plan-auto-command.d.ts.map +0 -1
- package/dist/src/runner/plan-auto-command.js +0 -918
- package/dist/src/runner/plan-auto-command.js.map +0 -1
- package/dist/src/runner/plan-auto-recovery.d.ts +0 -83
- package/dist/src/runner/plan-auto-recovery.d.ts.map +0 -1
- package/dist/src/runner/plan-auto-recovery.js +0 -303
- package/dist/src/runner/plan-auto-recovery.js.map +0 -1
- package/dist/src/runner/prompt.d.ts +0 -68
- package/dist/src/runner/prompt.d.ts.map +0 -1
- package/dist/src/runner/prompt.js +0 -202
- package/dist/src/runner/prompt.js.map +0 -1
- package/dist/src/runner/proof-routing.d.ts +0 -73
- package/dist/src/runner/proof-routing.d.ts.map +0 -1
- package/dist/src/runner/proof-routing.js +0 -182
- package/dist/src/runner/proof-routing.js.map +0 -1
- package/dist/src/runner/proof-strategy.d.ts +0 -21
- package/dist/src/runner/proof-strategy.d.ts.map +0 -1
- package/dist/src/runner/proof-strategy.js +0 -26
- package/dist/src/runner/proof-strategy.js.map +0 -1
- package/dist/src/runner/recovery.d.ts +0 -25
- package/dist/src/runner/recovery.d.ts.map +0 -1
- package/dist/src/runner/recovery.js +0 -89
- package/dist/src/runner/recovery.js.map +0 -1
- package/dist/src/runner/review-gate-policy.d.ts +0 -13
- package/dist/src/runner/review-gate-policy.d.ts.map +0 -1
- package/dist/src/runner/review-gate-policy.js +0 -241
- package/dist/src/runner/review-gate-policy.js.map +0 -1
- package/dist/src/runner/review-gates.d.ts +0 -28
- package/dist/src/runner/review-gates.d.ts.map +0 -1
- package/dist/src/runner/review-gates.js +0 -328
- package/dist/src/runner/review-gates.js.map +0 -1
- package/dist/src/runner/rework-policy.d.ts +0 -48
- package/dist/src/runner/rework-policy.d.ts.map +0 -1
- package/dist/src/runner/rework-policy.js +0 -150
- package/dist/src/runner/rework-policy.js.map +0 -1
- package/dist/src/runner/run-log.d.ts +0 -18
- package/dist/src/runner/run-log.d.ts.map +0 -1
- package/dist/src/runner/run-log.js +0 -53
- package/dist/src/runner/run-log.js.map +0 -1
- package/dist/src/runner/runner-handoff-decision.d.ts +0 -48
- package/dist/src/runner/runner-handoff-decision.d.ts.map +0 -1
- package/dist/src/runner/runner-handoff-decision.js +0 -93
- package/dist/src/runner/runner-handoff-decision.js.map +0 -1
- package/dist/src/runner/safety.d.ts +0 -14
- package/dist/src/runner/safety.d.ts.map +0 -1
- package/dist/src/runner/safety.js +0 -31
- package/dist/src/runner/safety.js.map +0 -1
- package/dist/src/runner/scope-isolation-policy.d.ts +0 -17
- package/dist/src/runner/scope-isolation-policy.d.ts.map +0 -1
- package/dist/src/runner/scope-isolation-policy.js +0 -82
- package/dist/src/runner/scope-isolation-policy.js.map +0 -1
- package/dist/src/runner/scoped-auto-command.d.ts +0 -90
- package/dist/src/runner/scoped-auto-command.d.ts.map +0 -1
- package/dist/src/runner/scoped-auto-command.js +0 -561
- package/dist/src/runner/scoped-auto-command.js.map +0 -1
- package/dist/src/runner/scoped-recovery.d.ts +0 -78
- package/dist/src/runner/scoped-recovery.d.ts.map +0 -1
- package/dist/src/runner/scoped-recovery.js +0 -601
- package/dist/src/runner/scoped-recovery.js.map +0 -1
- package/dist/src/runner/session-home.d.ts +0 -8
- package/dist/src/runner/session-home.d.ts.map +0 -1
- package/dist/src/runner/session-home.js +0 -18
- package/dist/src/runner/session-home.js.map +0 -1
- package/dist/src/runner/status-command.d.ts +0 -38
- package/dist/src/runner/status-command.d.ts.map +0 -1
- package/dist/src/runner/status-command.js +0 -97
- package/dist/src/runner/status-command.js.map +0 -1
- package/dist/src/runner/target-activity-fence.d.ts.map +0 -1
- package/dist/src/runner/target-activity-fence.js.map +0 -1
- package/dist/src/runner/terminal-outcome.d.ts +0 -58
- package/dist/src/runner/terminal-outcome.d.ts.map +0 -1
- package/dist/src/runner/terminal-outcome.js +0 -73
- package/dist/src/runner/terminal-outcome.js.map +0 -1
- package/dist/src/runner/visual-proof-runner.d.ts +0 -27
- package/dist/src/runner/visual-proof-runner.d.ts.map +0 -1
- package/dist/src/runner/visual-proof-runner.js +0 -379
- package/dist/src/runner/visual-proof-runner.js.map +0 -1
- package/dist/src/runner/worktree-cleanup.d.ts +0 -27
- package/dist/src/runner/worktree-cleanup.d.ts.map +0 -1
- package/dist/src/runner/worktree-cleanup.js +0 -63
- package/dist/src/runner/worktree-cleanup.js.map +0 -1
- package/dist/src/setup/codex-command-resolver.d.ts +0 -10
- package/dist/src/setup/codex-command-resolver.d.ts.map +0 -1
- package/dist/src/setup/codex-command-resolver.js +0 -91
- package/dist/src/setup/codex-command-resolver.js.map +0 -1
- package/dist/src/setup/github-label-adapter.d.ts +0 -13
- package/dist/src/setup/github-label-adapter.d.ts.map +0 -1
- package/dist/src/setup/github-label-adapter.js +0 -28
- package/dist/src/setup/github-label-adapter.js.map +0 -1
- package/dist/src/setup/labels.d.ts +0 -27
- package/dist/src/setup/labels.d.ts.map +0 -1
- package/dist/src/setup/labels.js +0 -42
- package/dist/src/setup/labels.js.map +0 -1
- package/dist/src/setup/project-config.d.ts +0 -24
- package/dist/src/setup/project-config.d.ts.map +0 -1
- package/dist/src/setup/project-config.js +0 -678
- package/dist/src/setup/project-config.js.map +0 -1
- package/dist/src/setup/prompt-sync.d.ts +0 -14
- package/dist/src/setup/prompt-sync.d.ts.map +0 -1
- package/dist/src/setup/prompt-sync.js +0 -228
- package/dist/src/setup/prompt-sync.js.map +0 -1
- package/dist/src/setup/setup-command.d.ts +0 -29
- package/dist/src/setup/setup-command.d.ts.map +0 -1
- package/dist/src/setup/setup-command.js +0 -304
- package/dist/src/setup/setup-command.js.map +0 -1
- package/dist/src/setup/skill-runtime-v2-preparation.d.ts +0 -56
- package/dist/src/setup/skill-runtime-v2-preparation.d.ts.map +0 -1
- package/dist/src/setup/skill-runtime-v2-preparation.js +0 -304
- package/dist/src/setup/skill-runtime-v2-preparation.js.map +0 -1
- package/dist/src/setup/workflows.d.ts +0 -10
- package/dist/src/setup/workflows.d.ts.map +0 -1
- package/dist/src/setup/workflows.js +0 -41
- package/dist/src/setup/workflows.js.map +0 -1
- package/prompts/setup-skill.md +0 -12
- package/prompts/workflows/acceptance-proof.md +0 -29
- package/prompts/workflows/breakdown-review.md +0 -48
- package/prompts/workflows/issue-breakdown.md +0 -155
- package/prompts/workflows/issue-tree-orchestration.md +0 -163
- package/prompts/workflows/prd.md +0 -80
- package/prompts/workflows/scoped-implementation.md +0 -129
- package/prompts/workflows/triage.md +0 -149
- /package/dist/src/{process → v2/adapters}/command.d.ts +0 -0
- /package/dist/src/{process → v2/adapters}/command.js +0 -0
- /package/dist/src/{fs → v2/adapters}/durable-atomic-file.d.ts +0 -0
- /package/dist/src/{fs → v2/adapters}/durable-atomic-file.js +0 -0
- /package/dist/src/{github → v2/adapters}/gh-cli.d.ts +0 -0
- /package/dist/src/{github → v2/adapters}/gh-cli.js +0 -0
- /package/dist/src/{github → v2/adapters}/gh-issue-adapter.d.ts +0 -0
- /package/dist/src/{github → v2/adapters}/gh-issue-adapter.js +0 -0
- /package/dist/src/{github → v2/adapters}/gh-pull-request-adapter.d.ts +0 -0
- /package/dist/src/{github → v2/adapters}/gh-pull-request-adapter.js +0 -0
- /package/dist/src/{github → v2/adapters}/issues.d.ts +0 -0
- /package/dist/src/{github → v2/adapters}/issues.js +0 -0
- /package/dist/src/{runner → v2/adapters}/mission-coordinator-lock.d.ts +0 -0
- /package/dist/src/{runner → v2/adapters}/mission-coordinator-lock.js +0 -0
- /package/dist/src/{path-policy.d.ts → v2/adapters/path-policy.d.ts} +0 -0
- /package/dist/src/{path-policy.js → v2/adapters/path-policy.js} +0 -0
- /package/dist/src/{github → v2/adapters}/pull-requests.d.ts +0 -0
- /package/dist/src/{github → v2/adapters}/pull-requests.js +0 -0
- /package/dist/src/{runner → v2/adapters}/target-activity-fence.d.ts +0 -0
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { type CodexCommandRunInput, type CodexCommandRunResult } from '../codex/command-adapter.js';
|
|
2
|
-
import type { CodexOrchestratorConfig } from '../config/schema.js';
|
|
3
|
-
import type { GitHubIssue, GitHubIssueAdapter } from '../github/issues.js';
|
|
4
|
-
import type { GitHubPullRequestAdapter } from '../github/pull-requests.js';
|
|
5
|
-
import { GitWorktreeManager } from '../git/worktree.js';
|
|
6
|
-
import { type ShellCommandExecutor } from '../process/command.js';
|
|
7
|
-
import { type LocalExecutionPhaseExecutor } from './local-execution-session.js';
|
|
8
|
-
import { type RunnerProcessMetadata } from './local-state.js';
|
|
9
|
-
import { type ScopedAutoCommandResult } from './scoped-auto-command.js';
|
|
10
|
-
export declare const SCOPED_RECOVERY_LEASE_STALE_MS: number;
|
|
11
|
-
export declare const SCOPED_RECOVERY_BLOCKED_MARKER_PREFIX = "<!-- codex-orchestrator:recovery-blocked";
|
|
12
|
-
export type ScopedRecoveryInvocation = 'status' | 'daemon' | 'targeted';
|
|
13
|
-
export type ProcessProbeResult = 'alive' | 'missing' | 'unknown';
|
|
14
|
-
export type ScopedRecoveryStatus = 'active' | 'unknown-or-foreign' | 'completed-pending-handoff' | 'failed-pending-block';
|
|
15
|
-
export interface ScopedRecoveryClassification {
|
|
16
|
-
issueNumber: number;
|
|
17
|
-
status: ScopedRecoveryStatus;
|
|
18
|
-
reason: string;
|
|
19
|
-
canMutate: boolean;
|
|
20
|
-
beforeHead?: string;
|
|
21
|
-
reportState: 'completed' | 'needs-promotion' | 'missing' | 'invalid';
|
|
22
|
-
}
|
|
23
|
-
export interface ClassifyScopedRecoveryRunInput {
|
|
24
|
-
targetRoot: string;
|
|
25
|
-
config: CodexOrchestratorConfig;
|
|
26
|
-
run: RunnerProcessMetadata;
|
|
27
|
-
issue?: GitHubIssue;
|
|
28
|
-
invocation: ScopedRecoveryInvocation;
|
|
29
|
-
now: Date;
|
|
30
|
-
hostname?: () => string;
|
|
31
|
-
processProbe?: (pid: number) => Promise<ProcessProbeResult> | ProcessProbeResult;
|
|
32
|
-
}
|
|
33
|
-
export interface RecoverScopedRunInput {
|
|
34
|
-
targetRoot: string;
|
|
35
|
-
issueNumber: number;
|
|
36
|
-
invocation: 'daemon' | 'targeted';
|
|
37
|
-
issueAdapter?: GitHubIssueAdapter;
|
|
38
|
-
pullRequestAdapter?: GitHubPullRequestAdapter;
|
|
39
|
-
git?: GitWorktreeManager;
|
|
40
|
-
codexAdapter?: {
|
|
41
|
-
run(input: CodexCommandRunInput): Promise<CodexCommandRunResult>;
|
|
42
|
-
};
|
|
43
|
-
shellExecutor?: ShellCommandExecutor;
|
|
44
|
-
localPhases?: string[];
|
|
45
|
-
localPhaseExecutor?: LocalExecutionPhaseExecutor;
|
|
46
|
-
now?: Date;
|
|
47
|
-
hostname?: () => string;
|
|
48
|
-
processProbe?: (pid: number) => Promise<ProcessProbeResult> | ProcessProbeResult;
|
|
49
|
-
}
|
|
50
|
-
export type ScopedRecoveryRunResult = {
|
|
51
|
-
status: 'not-recoverable';
|
|
52
|
-
classification: ScopedRecoveryClassification;
|
|
53
|
-
} | (ScopedAutoCommandResult & {
|
|
54
|
-
recovered: true;
|
|
55
|
-
classification: ScopedRecoveryClassification;
|
|
56
|
-
});
|
|
57
|
-
export interface RecoveryOwnershipState {
|
|
58
|
-
kind: 'same-host' | 'cross-host' | 'legacy' | 'unknown';
|
|
59
|
-
stale: boolean;
|
|
60
|
-
process: ProcessProbeResult;
|
|
61
|
-
localHost?: string;
|
|
62
|
-
remoteHost?: string;
|
|
63
|
-
}
|
|
64
|
-
export declare function classifyScopedRecoveryRun(input: ClassifyScopedRecoveryRunInput): Promise<ScopedRecoveryClassification>;
|
|
65
|
-
export declare function recoverScopedRun(input: RecoverScopedRunInput): Promise<ScopedRecoveryRunResult>;
|
|
66
|
-
export declare function defaultProcessProbe(pid: number): ProcessProbeResult;
|
|
67
|
-
export declare function buildRecoveredCodexResult(reportPath: string): {
|
|
68
|
-
stdout: string;
|
|
69
|
-
stderr: string;
|
|
70
|
-
exitCode: number;
|
|
71
|
-
};
|
|
72
|
-
export declare function classifyRecoveryOwnership(input: {
|
|
73
|
-
run: RunnerProcessMetadata;
|
|
74
|
-
now: Date;
|
|
75
|
-
hostname?: () => string;
|
|
76
|
-
processProbe?: (pid: number) => Promise<ProcessProbeResult> | ProcessProbeResult;
|
|
77
|
-
}): Promise<RecoveryOwnershipState>;
|
|
78
|
-
//# sourceMappingURL=scoped-recovery.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-recovery.d.ts","sourceRoot":"","sources":["../../../src/runner/scoped-recovery.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,601 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { hostname as osHostname } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { CodexCommandAdapter } from '../codex/command-adapter.js';
|
|
5
|
-
import { GhCliIssueAdapter } from '../github/gh-issue-adapter.js';
|
|
6
|
-
import { GhCliPullRequestAdapter } from '../github/gh-pull-request-adapter.js';
|
|
7
|
-
import { resolveBaseBranch } from '../git/base-branch.js';
|
|
8
|
-
import { GitWorktreeManager } from '../git/worktree.js';
|
|
9
|
-
import { defaultShellCommandExecutor } from '../process/command.js';
|
|
10
|
-
import { readRunnerConfig, rereadRunnerConfigUnderFence } from './command-utils.js';
|
|
11
|
-
import { readScopedCompletionReport } from './completion-report.js';
|
|
12
|
-
import { writeDurableRunSummary } from './durable-run-summary.js';
|
|
13
|
-
import { runFreshContextReviewIfEnabled } from './fresh-context-review.js';
|
|
14
|
-
import { runImplementationPublishabilityCheck } from './local-execution-session.js';
|
|
15
|
-
import { RunnerStateStore } from './local-state.js';
|
|
16
|
-
import { RunnerLifecycleEventStore } from './lifecycle-events.js';
|
|
17
|
-
import { buildBlockedHandoffEvidence, buildPromotionAsBlockedHandoffEvidence, buildReviewReadyHandoffEvidence, } from './runner-handoff-decision.js';
|
|
18
|
-
import { finishScopedBlockedHandoff, finishScopedReviewReadyHandoff, runScopedRecoveryRetry, } from './scoped-auto-command.js';
|
|
19
|
-
import { decideImplementationRework, MISSING_COMPLETION_REPORT_REASON, } from './rework-policy.js';
|
|
20
|
-
import { acquireTargetActivityFence } from './target-activity-fence.js';
|
|
21
|
-
export const SCOPED_RECOVERY_LEASE_STALE_MS = 30 * 60 * 1000;
|
|
22
|
-
export const SCOPED_RECOVERY_BLOCKED_MARKER_PREFIX = '<!-- codex-orchestrator:recovery-blocked';
|
|
23
|
-
export async function classifyScopedRecoveryRun(input) {
|
|
24
|
-
const beforeHead = await resolveBeforeHead(input.targetRoot, input.config, input.run);
|
|
25
|
-
const reportState = await readReportState(input.run);
|
|
26
|
-
const invalidReason = basicInvalidReason(input.run, input.issue, input.config);
|
|
27
|
-
if (invalidReason) {
|
|
28
|
-
return classification(input.run, 'unknown-or-foreign', invalidReason, false, beforeHead, reportState);
|
|
29
|
-
}
|
|
30
|
-
if (!beforeHead) {
|
|
31
|
-
return classification(input.run, 'unknown-or-foreign', 'deterministic base evidence is missing', false, undefined, reportState);
|
|
32
|
-
}
|
|
33
|
-
const ownership = await classifyRecoveryOwnership(input);
|
|
34
|
-
if (ownership.kind === 'unknown') {
|
|
35
|
-
return classification(input.run, 'unknown-or-foreign', 'lease ownership evidence is invalid or from the future', false, beforeHead, reportState);
|
|
36
|
-
}
|
|
37
|
-
if (ownership.kind === 'same-host' && (ownership.process === 'alive' || ownership.process === 'unknown')) {
|
|
38
|
-
return classification(input.run, 'active', `same-host process is ${ownership.process}`, false, beforeHead, reportState);
|
|
39
|
-
}
|
|
40
|
-
if (ownership.kind === 'same-host' && ownership.process === 'missing' && reportState === 'completed') {
|
|
41
|
-
const canMutate = input.invocation !== 'status';
|
|
42
|
-
return classification(input.run, 'completed-pending-handoff', 'same-host missing PID with completed report', canMutate, beforeHead, reportState);
|
|
43
|
-
}
|
|
44
|
-
if (ownership.kind === 'same-host' && !ownership.stale) {
|
|
45
|
-
return classification(input.run, 'active', 'same-host lease is still fresh', false, beforeHead, reportState);
|
|
46
|
-
}
|
|
47
|
-
if (input.invocation === 'status') {
|
|
48
|
-
return readOnlyStatusClassification(input.run, beforeHead, reportState, ownership);
|
|
49
|
-
}
|
|
50
|
-
if (input.invocation === 'daemon') {
|
|
51
|
-
if (ownership.kind !== 'same-host' || ownership.process !== 'missing' || !ownership.stale) {
|
|
52
|
-
return classification(input.run, 'unknown-or-foreign', 'daemon recovery requires same-host missing-PID stale lease proof', false, beforeHead, reportState);
|
|
53
|
-
}
|
|
54
|
-
return staleMutatingClassification(input.run, beforeHead, reportState);
|
|
55
|
-
}
|
|
56
|
-
if (reportState === 'completed' && (ownership.kind === 'legacy' || ownership.stale)) {
|
|
57
|
-
return classification(input.run, 'completed-pending-handoff', 'completed report can be recovered by targeted run', true, beforeHead, reportState);
|
|
58
|
-
}
|
|
59
|
-
if (reportState !== 'completed' && ownership.stale) {
|
|
60
|
-
return classification(input.run, 'failed-pending-block', 'stale runner-owned run lacks a completed report', true, beforeHead, reportState);
|
|
61
|
-
}
|
|
62
|
-
return classification(input.run, 'unknown-or-foreign', 'targeted recovery requires stale lease or legacy completed report', false, beforeHead, reportState);
|
|
63
|
-
}
|
|
64
|
-
export async function recoverScopedRun(input) {
|
|
65
|
-
const targetRoot = input.targetRoot;
|
|
66
|
-
const config = await readRunnerConfig(targetRoot);
|
|
67
|
-
const lease = await acquireTargetActivityFence({
|
|
68
|
-
targetRoot,
|
|
69
|
-
stateDir: config.runner.stateDir,
|
|
70
|
-
mode: 'shared',
|
|
71
|
-
purpose: 'claim',
|
|
72
|
-
});
|
|
73
|
-
try {
|
|
74
|
-
const fencedConfig = await rereadRunnerConfigUnderFence(targetRoot, config.runner.stateDir);
|
|
75
|
-
return await recoverScopedRunFenced(input, fencedConfig);
|
|
76
|
-
}
|
|
77
|
-
finally {
|
|
78
|
-
await lease.release();
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
async function recoverScopedRunFenced(input, config) {
|
|
82
|
-
const targetRoot = input.targetRoot;
|
|
83
|
-
const now = input.now ?? new Date();
|
|
84
|
-
const issueAdapter = input.issueAdapter ?? new GhCliIssueAdapter(config.github.owner, config.github.repo);
|
|
85
|
-
const pullRequestAdapter = input.pullRequestAdapter ?? new GhCliPullRequestAdapter(config.github.owner, config.github.repo);
|
|
86
|
-
const git = input.git ?? new GitWorktreeManager();
|
|
87
|
-
const codexAdapter = input.codexAdapter ?? new CodexCommandAdapter(config);
|
|
88
|
-
const shellExecutor = input.shellExecutor ?? defaultShellCommandExecutor;
|
|
89
|
-
const store = new RunnerStateStore(targetRoot, config);
|
|
90
|
-
const state = await store.load();
|
|
91
|
-
const run = state.runs.find((candidate) => candidate.issueNumber === input.issueNumber);
|
|
92
|
-
const issue = await issueAdapter.getIssue(input.issueNumber);
|
|
93
|
-
if (!run || !issue) {
|
|
94
|
-
return {
|
|
95
|
-
status: 'not-recoverable',
|
|
96
|
-
classification: classification(run ?? minimalMissingRun(input.issueNumber), 'unknown-or-foreign', run ? 'matching GitHub issue is missing' : 'local runner metadata is missing', false, undefined, 'missing'),
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
const scoped = await classifyScopedRecoveryRun({
|
|
100
|
-
targetRoot,
|
|
101
|
-
config,
|
|
102
|
-
run,
|
|
103
|
-
issue,
|
|
104
|
-
invocation: input.invocation,
|
|
105
|
-
now,
|
|
106
|
-
hostname: input.hostname,
|
|
107
|
-
processProbe: input.processProbe,
|
|
108
|
-
});
|
|
109
|
-
if (!scoped.canMutate || !scoped.beforeHead) {
|
|
110
|
-
if (hasRecoveryBlockedMarker(issue, run) && scoped.reportState !== 'completed') {
|
|
111
|
-
await store.upsertRun({ ...run, lastRecoveredAt: now.toISOString() });
|
|
112
|
-
}
|
|
113
|
-
return { status: 'not-recoverable', classification: scoped };
|
|
114
|
-
}
|
|
115
|
-
if (scoped.status === 'completed-pending-handoff') {
|
|
116
|
-
return recoverCompletedHandoff({
|
|
117
|
-
targetRoot,
|
|
118
|
-
config,
|
|
119
|
-
run,
|
|
120
|
-
issue,
|
|
121
|
-
classification: { ...scoped, beforeHead: scoped.beforeHead },
|
|
122
|
-
issueAdapter,
|
|
123
|
-
pullRequestAdapter,
|
|
124
|
-
git,
|
|
125
|
-
codexAdapter,
|
|
126
|
-
shellExecutor,
|
|
127
|
-
localPhases: input.localPhases,
|
|
128
|
-
localPhaseExecutor: input.localPhaseExecutor,
|
|
129
|
-
now,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
if (scoped.status === 'failed-pending-block') {
|
|
133
|
-
if (scoped.reportState === 'missing') {
|
|
134
|
-
const retryResult = await recoverMissingCompletionReport({
|
|
135
|
-
targetRoot,
|
|
136
|
-
config,
|
|
137
|
-
run,
|
|
138
|
-
issue,
|
|
139
|
-
classification: { ...scoped, beforeHead: scoped.beforeHead },
|
|
140
|
-
issueAdapter,
|
|
141
|
-
pullRequestAdapter,
|
|
142
|
-
git,
|
|
143
|
-
codexAdapter,
|
|
144
|
-
shellExecutor,
|
|
145
|
-
localPhases: input.localPhases,
|
|
146
|
-
localPhaseExecutor: input.localPhaseExecutor,
|
|
147
|
-
now,
|
|
148
|
-
localHost: (input.hostname ?? osHostname)(),
|
|
149
|
-
});
|
|
150
|
-
if (retryResult) {
|
|
151
|
-
return retryResult;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return blockRecoveredRun({
|
|
155
|
-
targetRoot,
|
|
156
|
-
config,
|
|
157
|
-
run,
|
|
158
|
-
classification: scoped,
|
|
159
|
-
issueAdapter,
|
|
160
|
-
reasons: [blockedReason(scoped.reportState)],
|
|
161
|
-
changedFiles: [],
|
|
162
|
-
validation: [],
|
|
163
|
-
skippedChecks: [],
|
|
164
|
-
residualRisks: [],
|
|
165
|
-
now,
|
|
166
|
-
logPath: run.logPath ?? '',
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
return { status: 'not-recoverable', classification: scoped };
|
|
170
|
-
}
|
|
171
|
-
async function recoverMissingCompletionReport(input) {
|
|
172
|
-
const reasons = [MISSING_COMPLETION_REPORT_REASON];
|
|
173
|
-
const startAttempt = input.run.retryCount + 1;
|
|
174
|
-
const reworkDecision = decideImplementationRework({
|
|
175
|
-
reasons,
|
|
176
|
-
config: input.config,
|
|
177
|
-
attempt: startAttempt - 1,
|
|
178
|
-
});
|
|
179
|
-
if (input.run.host !== input.localHost
|
|
180
|
-
|| typeof input.run.ownerPid !== 'number'
|
|
181
|
-
|| !Number.isInteger(input.run.ownerPid)
|
|
182
|
-
|| reworkDecision.kind !== 'retry'
|
|
183
|
-
|| reworkDecision.nextAttempt !== startAttempt) {
|
|
184
|
-
return undefined;
|
|
185
|
-
}
|
|
186
|
-
let changeSet;
|
|
187
|
-
try {
|
|
188
|
-
changeSet = await input.git.collectSessionChangeSet({
|
|
189
|
-
worktreePath: input.run.workspacePath,
|
|
190
|
-
baseHead: input.classification.beforeHead,
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
catch {
|
|
194
|
-
return undefined;
|
|
195
|
-
}
|
|
196
|
-
if (changeSet.hasChanges) {
|
|
197
|
-
return undefined;
|
|
198
|
-
}
|
|
199
|
-
const result = await runScopedRecoveryRetry({
|
|
200
|
-
targetRoot: input.targetRoot,
|
|
201
|
-
issueNumber: input.run.issueNumber,
|
|
202
|
-
issueAdapter: input.issueAdapter,
|
|
203
|
-
pullRequestAdapter: input.pullRequestAdapter,
|
|
204
|
-
git: input.git,
|
|
205
|
-
codexAdapter: input.codexAdapter,
|
|
206
|
-
localPhases: input.localPhases,
|
|
207
|
-
localPhaseExecutor: input.localPhaseExecutor,
|
|
208
|
-
shellExecutor: input.shellExecutor,
|
|
209
|
-
now: input.now,
|
|
210
|
-
issue: input.issue,
|
|
211
|
-
startAttempt,
|
|
212
|
-
initialRework: reworkDecision.rework,
|
|
213
|
-
});
|
|
214
|
-
return { ...result, recovered: true, classification: input.classification };
|
|
215
|
-
}
|
|
216
|
-
export function defaultProcessProbe(pid) {
|
|
217
|
-
try {
|
|
218
|
-
process.kill(pid, 0);
|
|
219
|
-
return 'alive';
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
if (error instanceof Error && 'code' in error) {
|
|
223
|
-
if (error.code === 'EPERM') {
|
|
224
|
-
return 'alive';
|
|
225
|
-
}
|
|
226
|
-
if (error.code === 'ESRCH') {
|
|
227
|
-
return 'missing';
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return 'unknown';
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
export function buildRecoveredCodexResult(reportPath) {
|
|
234
|
-
return {
|
|
235
|
-
stdout: `codex-orchestrator recovery reused completed report ${reportPath}`,
|
|
236
|
-
stderr: '',
|
|
237
|
-
exitCode: 0,
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
async function recoverCompletedHandoff(input) {
|
|
241
|
-
const reportPath = input.run.reportPath ?? '';
|
|
242
|
-
const logPath = input.run.logPath ?? '';
|
|
243
|
-
const afterHead = await input.git.getHead(input.run.workspacePath);
|
|
244
|
-
const publishability = await runImplementationPublishabilityCheck({
|
|
245
|
-
config: input.config,
|
|
246
|
-
issue: input.issue,
|
|
247
|
-
targetRoot: input.targetRoot,
|
|
248
|
-
worktreePath: input.run.workspacePath,
|
|
249
|
-
reportPath,
|
|
250
|
-
beforeHead: input.classification.beforeHead,
|
|
251
|
-
afterHead,
|
|
252
|
-
codexResult: buildRecoveredCodexResult(reportPath),
|
|
253
|
-
git: input.git,
|
|
254
|
-
shellExecutor: input.shellExecutor,
|
|
255
|
-
commitMessage: `Codex: implement issue #${input.run.issueNumber}`,
|
|
256
|
-
localPhases: input.localPhases,
|
|
257
|
-
localPhaseExecutor: input.localPhaseExecutor,
|
|
258
|
-
});
|
|
259
|
-
const baseResult = {
|
|
260
|
-
issueNumber: input.run.issueNumber,
|
|
261
|
-
branchName: input.run.branchName ?? '',
|
|
262
|
-
worktreePath: input.run.workspacePath,
|
|
263
|
-
promptPath: input.run.promptPath ?? '',
|
|
264
|
-
reportPath,
|
|
265
|
-
logPath,
|
|
266
|
-
};
|
|
267
|
-
if (publishability.status !== 'publish-ready') {
|
|
268
|
-
const evidence = publishability.status === 'blocked'
|
|
269
|
-
? buildBlockedHandoffEvidence({
|
|
270
|
-
publishability,
|
|
271
|
-
nextAction: 'Maintainer input or a corrected agent run is required before draft PR handoff.',
|
|
272
|
-
})
|
|
273
|
-
: buildPromotionAsBlockedHandoffEvidence({
|
|
274
|
-
publishability,
|
|
275
|
-
fallbackReason: 'Recovered report requested promotion',
|
|
276
|
-
nextAction: 'Maintainer input or a corrected agent run is required before draft PR handoff.',
|
|
277
|
-
});
|
|
278
|
-
return blockRecoveredRun({
|
|
279
|
-
targetRoot: input.targetRoot,
|
|
280
|
-
config: input.config,
|
|
281
|
-
run: input.run,
|
|
282
|
-
classification: input.classification,
|
|
283
|
-
issueAdapter: input.issueAdapter,
|
|
284
|
-
reasons: evidence.blockers,
|
|
285
|
-
changedFiles: evidence.changedFiles,
|
|
286
|
-
validation: evidence.validation,
|
|
287
|
-
skippedChecks: evidence.skippedChecks,
|
|
288
|
-
residualRisks: evidence.residualRisks,
|
|
289
|
-
now: input.now,
|
|
290
|
-
logPath,
|
|
291
|
-
nextAction: evidence.nextAction,
|
|
292
|
-
suggestionEvidence: evidence.suggestionEvidence,
|
|
293
|
-
acceptanceProof: evidence.acceptanceProof,
|
|
294
|
-
});
|
|
295
|
-
}
|
|
296
|
-
const freshContextReview = await runFreshContextReviewIfEnabled({
|
|
297
|
-
targetRoot: input.targetRoot,
|
|
298
|
-
config: input.config,
|
|
299
|
-
issue: input.issue,
|
|
300
|
-
codexAdapter: input.codexAdapter,
|
|
301
|
-
worktreePath: input.run.workspacePath,
|
|
302
|
-
isolatedSessionId: `${input.run.sessionId}-fresh-review`,
|
|
303
|
-
branchName: input.run.branchName ?? '',
|
|
304
|
-
publishability,
|
|
305
|
-
});
|
|
306
|
-
if (freshContextReview?.status === 'blocked') {
|
|
307
|
-
const evidence = buildBlockedHandoffEvidence({
|
|
308
|
-
publishability,
|
|
309
|
-
freshContextReview,
|
|
310
|
-
nextAction: 'Review the Fresh-Context Review blocker before draft PR handoff.',
|
|
311
|
-
});
|
|
312
|
-
return blockRecoveredRun({
|
|
313
|
-
targetRoot: input.targetRoot,
|
|
314
|
-
config: input.config,
|
|
315
|
-
run: input.run,
|
|
316
|
-
classification: input.classification,
|
|
317
|
-
issueAdapter: input.issueAdapter,
|
|
318
|
-
reasons: evidence.blockers,
|
|
319
|
-
changedFiles: evidence.changedFiles,
|
|
320
|
-
validation: evidence.validation,
|
|
321
|
-
skippedChecks: evidence.skippedChecks,
|
|
322
|
-
residualRisks: evidence.residualRisks,
|
|
323
|
-
now: input.now,
|
|
324
|
-
logPath,
|
|
325
|
-
freshContextReview,
|
|
326
|
-
nextAction: evidence.nextAction,
|
|
327
|
-
suggestionEvidence: evidence.suggestionEvidence,
|
|
328
|
-
acceptanceProof: evidence.acceptanceProof,
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
const evidence = buildReviewReadyHandoffEvidence({
|
|
332
|
-
publishability,
|
|
333
|
-
freshContextReview,
|
|
334
|
-
nextAction: 'Review the draft pull request before merge.',
|
|
335
|
-
});
|
|
336
|
-
const durableRunSummary = await writeDurableRunSummary({
|
|
337
|
-
targetRoot: input.targetRoot,
|
|
338
|
-
config: input.config,
|
|
339
|
-
issueNumber: input.run.issueNumber,
|
|
340
|
-
sessionId: input.run.sessionId,
|
|
341
|
-
outcome: evidence.outcome,
|
|
342
|
-
changedFiles: evidence.changedFiles,
|
|
343
|
-
validation: evidence.validation,
|
|
344
|
-
blockers: evidence.blockers,
|
|
345
|
-
skippedChecks: evidence.skippedChecks,
|
|
346
|
-
residualRisks: evidence.residualRisks,
|
|
347
|
-
suggestionEvidence: evidence.suggestionEvidence,
|
|
348
|
-
nextAction: evidence.nextAction,
|
|
349
|
-
logPath,
|
|
350
|
-
reportPath,
|
|
351
|
-
acceptanceProof: evidence.acceptanceProof,
|
|
352
|
-
});
|
|
353
|
-
const resolvedBase = await resolveBaseBranch({ targetRoot: input.targetRoot, base: input.config.branches.base });
|
|
354
|
-
const handoff = await finishScopedReviewReadyHandoff({
|
|
355
|
-
issueNumber: input.run.issueNumber,
|
|
356
|
-
branchName: input.run.branchName ?? '',
|
|
357
|
-
baseBranch: resolvedBase.prBaseBranch,
|
|
358
|
-
worktreePath: input.run.workspacePath,
|
|
359
|
-
logPath,
|
|
360
|
-
config: input.config,
|
|
361
|
-
git: input.git,
|
|
362
|
-
pullRequestAdapter: input.pullRequestAdapter,
|
|
363
|
-
issueAdapter: input.issueAdapter,
|
|
364
|
-
publishability,
|
|
365
|
-
freshContextReview,
|
|
366
|
-
durableRunSummary,
|
|
367
|
-
acceptanceProof: evidence.acceptanceProof,
|
|
368
|
-
});
|
|
369
|
-
await new RunnerStateStore(input.targetRoot, input.config).removeRun(input.run.issueNumber);
|
|
370
|
-
await safeAppendRecoveryEvent(input.targetRoot, input.config, {
|
|
371
|
-
issueNumber: input.run.issueNumber,
|
|
372
|
-
sessionId: input.run.sessionId,
|
|
373
|
-
status: 'completed',
|
|
374
|
-
summary: 'Recovered interrupted scoped run and completed draft PR handoff.',
|
|
375
|
-
pullRequest: handoff.pullRequest,
|
|
376
|
-
});
|
|
377
|
-
return {
|
|
378
|
-
...baseResult,
|
|
379
|
-
status: 'review-ready',
|
|
380
|
-
pullRequest: handoff.pullRequest,
|
|
381
|
-
reportComment: handoff.reportComment,
|
|
382
|
-
recovered: true,
|
|
383
|
-
classification: input.classification,
|
|
384
|
-
};
|
|
385
|
-
}
|
|
386
|
-
async function blockRecoveredRun(input) {
|
|
387
|
-
const marker = recoveryBlockedMarker(input.run);
|
|
388
|
-
const durableRunSummary = await writeDurableRunSummary({
|
|
389
|
-
targetRoot: input.targetRoot,
|
|
390
|
-
config: input.config,
|
|
391
|
-
issueNumber: input.run.issueNumber,
|
|
392
|
-
sessionId: input.run.sessionId,
|
|
393
|
-
outcome: 'blocked',
|
|
394
|
-
changedFiles: input.changedFiles,
|
|
395
|
-
validation: input.validation,
|
|
396
|
-
blockers: input.reasons,
|
|
397
|
-
skippedChecks: input.skippedChecks,
|
|
398
|
-
residualRisks: input.residualRisks,
|
|
399
|
-
suggestionEvidence: input.suggestionEvidence,
|
|
400
|
-
nextAction: input.nextAction ?? 'Maintainer input or a corrected agent run is required before draft PR handoff.',
|
|
401
|
-
logPath: input.logPath,
|
|
402
|
-
reportPath: input.run.reportPath ?? '',
|
|
403
|
-
acceptanceProof: input.acceptanceProof,
|
|
404
|
-
});
|
|
405
|
-
const handoff = await finishScopedBlockedHandoff({
|
|
406
|
-
issueNumber: input.run.issueNumber,
|
|
407
|
-
logPath: input.logPath,
|
|
408
|
-
issueAdapter: input.issueAdapter,
|
|
409
|
-
config: input.config,
|
|
410
|
-
reasons: input.reasons,
|
|
411
|
-
changedFiles: input.changedFiles,
|
|
412
|
-
skippedChecks: input.skippedChecks,
|
|
413
|
-
residualRisks: input.residualRisks,
|
|
414
|
-
freshContextReview: input.freshContextReview,
|
|
415
|
-
durableRunSummary,
|
|
416
|
-
acceptanceProof: input.acceptanceProof,
|
|
417
|
-
commentPrefix: marker,
|
|
418
|
-
skipCommentIfIncludes: marker,
|
|
419
|
-
});
|
|
420
|
-
await new RunnerStateStore(input.targetRoot, input.config).upsertRun({
|
|
421
|
-
...input.run,
|
|
422
|
-
lastRecoveredAt: input.now.toISOString(),
|
|
423
|
-
});
|
|
424
|
-
await safeAppendRecoveryEvent(input.targetRoot, input.config, {
|
|
425
|
-
issueNumber: input.run.issueNumber,
|
|
426
|
-
sessionId: input.run.sessionId,
|
|
427
|
-
status: 'blocked',
|
|
428
|
-
summary: 'Recovered interrupted scoped run and posted blocked handoff evidence.',
|
|
429
|
-
});
|
|
430
|
-
return {
|
|
431
|
-
issueNumber: input.run.issueNumber,
|
|
432
|
-
branchName: input.run.branchName ?? '',
|
|
433
|
-
worktreePath: input.run.workspacePath,
|
|
434
|
-
promptPath: input.run.promptPath ?? '',
|
|
435
|
-
reportPath: input.run.reportPath ?? '',
|
|
436
|
-
logPath: input.logPath,
|
|
437
|
-
status: 'blocked',
|
|
438
|
-
reportComment: handoff.reportComment,
|
|
439
|
-
recovered: true,
|
|
440
|
-
classification: input.classification,
|
|
441
|
-
};
|
|
442
|
-
}
|
|
443
|
-
async function readOnlyStatusClassification(run, beforeHead, reportState, ownership) {
|
|
444
|
-
if (reportState === 'completed' && (ownership.kind === 'legacy' || ownership.stale)) {
|
|
445
|
-
return classification(run, 'completed-pending-handoff', 'completed scoped run is pending runner-owned handoff', false, beforeHead, reportState);
|
|
446
|
-
}
|
|
447
|
-
if (reportState !== 'completed' && ownership.stale) {
|
|
448
|
-
return classification(run, 'failed-pending-block', 'stale scoped run is pending blocked recovery', false, beforeHead, reportState);
|
|
449
|
-
}
|
|
450
|
-
return classification(run, 'active', 'scoped run is not stale enough for recovery', false, beforeHead, reportState);
|
|
451
|
-
}
|
|
452
|
-
function staleMutatingClassification(run, beforeHead, reportState) {
|
|
453
|
-
if (reportState === 'completed') {
|
|
454
|
-
return classification(run, 'completed-pending-handoff', 'same-host missing-PID stale lease with completed report', true, beforeHead, reportState);
|
|
455
|
-
}
|
|
456
|
-
return classification(run, 'failed-pending-block', 'same-host missing-PID stale lease without completed report', true, beforeHead, reportState);
|
|
457
|
-
}
|
|
458
|
-
function basicInvalidReason(run, issue, config) {
|
|
459
|
-
if (run.mode !== 'scoped-issue') {
|
|
460
|
-
return 'local metadata is not scoped-issue mode';
|
|
461
|
-
}
|
|
462
|
-
if (!run.branchName || !run.workspacePath || !run.reportPath) {
|
|
463
|
-
return 'local metadata is missing branch, worktree, or report path';
|
|
464
|
-
}
|
|
465
|
-
if (!issue) {
|
|
466
|
-
return 'matching GitHub issue is missing';
|
|
467
|
-
}
|
|
468
|
-
if (issue.number !== run.issueNumber) {
|
|
469
|
-
return 'local metadata issue number does not match GitHub issue';
|
|
470
|
-
}
|
|
471
|
-
const labels = new Set(issue.labels.map((label) => label.name));
|
|
472
|
-
if (issue.state !== 'OPEN' || !labels.has(config.github.labels.running.name)) {
|
|
473
|
-
return 'GitHub issue is not open with the running label';
|
|
474
|
-
}
|
|
475
|
-
return undefined;
|
|
476
|
-
}
|
|
477
|
-
export async function classifyRecoveryOwnership(input) {
|
|
478
|
-
const localHost = (input.hostname ?? osHostname)();
|
|
479
|
-
const timestamp = input.run.leaseUpdatedAt ? Date.parse(input.run.leaseUpdatedAt) : Number.NaN;
|
|
480
|
-
const hasLease = Number.isFinite(timestamp);
|
|
481
|
-
const stale = hasLease
|
|
482
|
-
? input.now.getTime() - timestamp >= SCOPED_RECOVERY_LEASE_STALE_MS
|
|
483
|
-
: false;
|
|
484
|
-
if (hasLease && timestamp > input.now.getTime()) {
|
|
485
|
-
return { kind: 'unknown', stale: false, process: 'unknown', localHost };
|
|
486
|
-
}
|
|
487
|
-
if (!input.run.host && !input.run.ownerPid && !input.run.leaseUpdatedAt) {
|
|
488
|
-
return { kind: 'legacy', stale: false, process: 'unknown', localHost };
|
|
489
|
-
}
|
|
490
|
-
const ownerPid = input.run.ownerPid;
|
|
491
|
-
if (!input.run.host || typeof ownerPid !== 'number' || !Number.isInteger(ownerPid) || !hasLease) {
|
|
492
|
-
return { kind: 'unknown', stale: false, process: 'unknown', localHost, remoteHost: input.run.host };
|
|
493
|
-
}
|
|
494
|
-
if (input.run.host !== localHost) {
|
|
495
|
-
return { kind: 'cross-host', stale, process: 'unknown', localHost, remoteHost: input.run.host };
|
|
496
|
-
}
|
|
497
|
-
const probe = input.processProbe ?? defaultProcessProbe;
|
|
498
|
-
return { kind: 'same-host', stale, process: await probe(ownerPid), localHost, remoteHost: input.run.host };
|
|
499
|
-
}
|
|
500
|
-
async function readReportState(run) {
|
|
501
|
-
if (!run.reportPath) {
|
|
502
|
-
return 'missing';
|
|
503
|
-
}
|
|
504
|
-
try {
|
|
505
|
-
const result = await readScopedCompletionReport(run.reportPath);
|
|
506
|
-
if (result.kind === 'missing') {
|
|
507
|
-
return 'missing';
|
|
508
|
-
}
|
|
509
|
-
return result.report.status === 'completed' ? 'completed' : 'needs-promotion';
|
|
510
|
-
}
|
|
511
|
-
catch {
|
|
512
|
-
return 'invalid';
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
async function resolveBeforeHead(targetRoot, config, run) {
|
|
516
|
-
if (isNonEmpty(run.baseSha)) {
|
|
517
|
-
return run.baseSha;
|
|
518
|
-
}
|
|
519
|
-
const snapshotBase = run.snapshotPath ? await readSnapshotBaseSha(run.snapshotPath) : undefined;
|
|
520
|
-
if (snapshotBase) {
|
|
521
|
-
return snapshotBase;
|
|
522
|
-
}
|
|
523
|
-
return readSnapshotBaseSha(join(targetRoot, config.runner.stateDir, 'snapshots', `issue-${run.issueNumber}-${run.sessionId}.json`));
|
|
524
|
-
}
|
|
525
|
-
async function readSnapshotBaseSha(path) {
|
|
526
|
-
try {
|
|
527
|
-
const parsed = JSON.parse(await readFile(path, 'utf8'));
|
|
528
|
-
if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
|
|
529
|
-
return undefined;
|
|
530
|
-
}
|
|
531
|
-
const repository = parsed.repository;
|
|
532
|
-
if (typeof repository !== 'object' || repository === null || Array.isArray(repository)) {
|
|
533
|
-
return undefined;
|
|
534
|
-
}
|
|
535
|
-
const base = repository.base;
|
|
536
|
-
if (typeof base !== 'object' || base === null || Array.isArray(base)) {
|
|
537
|
-
return undefined;
|
|
538
|
-
}
|
|
539
|
-
const sha = base.sha;
|
|
540
|
-
return isNonEmpty(sha) ? sha : undefined;
|
|
541
|
-
}
|
|
542
|
-
catch {
|
|
543
|
-
return undefined;
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
function classification(run, status, reason, canMutate, beforeHead, reportState) {
|
|
547
|
-
return { issueNumber: run.issueNumber, status, reason, canMutate, beforeHead, reportState };
|
|
548
|
-
}
|
|
549
|
-
function isNonEmpty(value) {
|
|
550
|
-
return typeof value === 'string' && value.length > 0;
|
|
551
|
-
}
|
|
552
|
-
function recoveryBlockedMarker(run) {
|
|
553
|
-
return `${SCOPED_RECOVERY_BLOCKED_MARKER_PREFIX} issue=${run.issueNumber} session=${run.sessionId} -->`;
|
|
554
|
-
}
|
|
555
|
-
function hasRecoveryBlockedMarker(issue, run) {
|
|
556
|
-
const marker = recoveryBlockedMarker(run);
|
|
557
|
-
return issue.comments.some((comment) => comment.body.includes(marker));
|
|
558
|
-
}
|
|
559
|
-
function blockedReason(reportState) {
|
|
560
|
-
if (reportState === 'missing') {
|
|
561
|
-
return 'Recovered scoped run is stale, but the completion report is missing.';
|
|
562
|
-
}
|
|
563
|
-
if (reportState === 'needs-promotion') {
|
|
564
|
-
return 'Recovered scoped run is stale, but the completion report requested promotion.';
|
|
565
|
-
}
|
|
566
|
-
if (reportState === 'invalid') {
|
|
567
|
-
return 'Recovered scoped run is stale, but the completion report is invalid.';
|
|
568
|
-
}
|
|
569
|
-
return 'Recovered scoped run could not be safely published.';
|
|
570
|
-
}
|
|
571
|
-
function minimalMissingRun(issueNumber) {
|
|
572
|
-
return {
|
|
573
|
-
issueNumber,
|
|
574
|
-
mode: 'scoped-issue',
|
|
575
|
-
workspacePath: '',
|
|
576
|
-
sessionId: '',
|
|
577
|
-
retryCount: 0,
|
|
578
|
-
createdAt: '',
|
|
579
|
-
updatedAt: '',
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
async function safeAppendRecoveryEvent(targetRoot, config, input) {
|
|
583
|
-
try {
|
|
584
|
-
await new RunnerLifecycleEventStore(targetRoot, config).append({
|
|
585
|
-
timestamp: new Date(),
|
|
586
|
-
issueNumber: input.issueNumber,
|
|
587
|
-
mode: 'scoped-issue',
|
|
588
|
-
sessionId: input.sessionId,
|
|
589
|
-
phase: 'scoped-issue',
|
|
590
|
-
status: input.status,
|
|
591
|
-
summary: input.summary,
|
|
592
|
-
artifacts: input.pullRequest
|
|
593
|
-
? [{ kind: 'pr', url: input.pullRequest.url, description: 'Draft pull request' }]
|
|
594
|
-
: [],
|
|
595
|
-
});
|
|
596
|
-
}
|
|
597
|
-
catch {
|
|
598
|
-
// Recovery lifecycle evidence should not turn a proven handoff into a blocker.
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
//# sourceMappingURL=scoped-recovery.js.map
|