@on-par/factory-core 0.9.11-next.7 → 0.9.11-next.71
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/dist/blockers/declared-prerequisites.d.ts +3 -0
- package/dist/blockers/declared-prerequisites.d.ts.map +1 -0
- package/dist/blockers/declared-prerequisites.js +26 -0
- package/dist/blockers/declared-prerequisites.js.map +1 -0
- package/dist/blockers/index.d.ts +1 -0
- package/dist/blockers/index.d.ts.map +1 -1
- package/dist/blockers/index.js +1 -0
- package/dist/blockers/index.js.map +1 -1
- package/dist/checkers/base-health.d.ts +6 -0
- package/dist/checkers/base-health.d.ts.map +1 -1
- package/dist/checkers/base-health.js +89 -10
- package/dist/checkers/base-health.js.map +1 -1
- package/dist/checkers/baseline-cache.d.ts.map +1 -1
- package/dist/checkers/baseline-cache.js +5 -0
- package/dist/checkers/baseline-cache.js.map +1 -1
- package/dist/checkers/baseline.d.ts +2 -0
- package/dist/checkers/baseline.d.ts.map +1 -1
- package/dist/checkers/baseline.js +2 -2
- package/dist/checkers/baseline.js.map +1 -1
- package/dist/checkers/design-smells.d.ts.map +1 -1
- package/dist/checkers/design-smells.js +1 -0
- package/dist/checkers/design-smells.js.map +1 -1
- package/dist/checkers/evidence-allowlist.d.ts +5 -0
- package/dist/checkers/evidence-allowlist.d.ts.map +1 -0
- package/dist/checkers/evidence-allowlist.js +96 -0
- package/dist/checkers/evidence-allowlist.js.map +1 -0
- package/dist/checkers/evidence-plan-false-pass.d.ts +4 -0
- package/dist/checkers/evidence-plan-false-pass.d.ts.map +1 -0
- package/dist/checkers/evidence-plan-false-pass.js +141 -0
- package/dist/checkers/evidence-plan-false-pass.js.map +1 -0
- package/dist/checkers/evidence-plan.d.ts +27 -0
- package/dist/checkers/evidence-plan.d.ts.map +1 -0
- package/dist/checkers/evidence-plan.js +185 -0
- package/dist/checkers/evidence-plan.js.map +1 -0
- package/dist/checkers/index.d.ts +4 -0
- package/dist/checkers/index.d.ts.map +1 -1
- package/dist/checkers/index.js +2 -0
- package/dist/checkers/index.js.map +1 -1
- package/dist/checkers/side-effects.d.ts +11 -0
- package/dist/checkers/side-effects.d.ts.map +1 -0
- package/dist/checkers/side-effects.js +137 -0
- package/dist/checkers/side-effects.js.map +1 -0
- package/dist/config/base-health.d.ts +29 -0
- package/dist/config/base-health.d.ts.map +1 -0
- package/dist/config/base-health.js +34 -0
- package/dist/config/base-health.js.map +1 -0
- package/dist/config/example.d.ts.map +1 -1
- package/dist/config/example.js +15 -1
- package/dist/config/example.js.map +1 -1
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +11 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/repo.d.ts +10 -2
- package/dist/config/repo.d.ts.map +1 -1
- package/dist/config/repo.js +10 -9
- package/dist/config/repo.js.map +1 -1
- package/dist/config/v2.d.ts +2 -0
- package/dist/config/v2.d.ts.map +1 -1
- package/dist/config/v2.js +5 -0
- package/dist/config/v2.js.map +1 -1
- package/dist/constitutions/index.d.ts.map +1 -1
- package/dist/constitutions/index.js +2 -0
- package/dist/constitutions/index.js.map +1 -1
- package/dist/daemon/checkout-validation.d.ts +1 -1
- package/dist/daemon/checkout-validation.d.ts.map +1 -1
- package/dist/daemon/checkout-validation.js +19 -6
- package/dist/daemon/checkout-validation.js.map +1 -1
- package/dist/daemon/execution-config.d.ts +8 -0
- package/dist/daemon/execution-config.d.ts.map +1 -1
- package/dist/daemon/factoryd-http.d.ts.map +1 -1
- package/dist/daemon/factoryd-http.js +8 -2
- package/dist/daemon/factoryd-http.js.map +1 -1
- package/dist/daemon/repos-attach.d.ts +7 -1
- package/dist/daemon/repos-attach.d.ts.map +1 -1
- package/dist/daemon/repos-attach.js +35 -10
- package/dist/daemon/repos-attach.js.map +1 -1
- package/dist/daemon/run-runtime.d.ts +8 -0
- package/dist/daemon/run-runtime.d.ts.map +1 -1
- package/dist/environment/index.d.ts +4 -0
- package/dist/environment/index.d.ts.map +1 -1
- package/dist/environment/index.js +6 -0
- package/dist/environment/index.js.map +1 -1
- package/dist/eval/judge.d.ts +2 -0
- package/dist/eval/judge.d.ts.map +1 -1
- package/dist/eval/judge.js +1 -0
- package/dist/eval/judge.js.map +1 -1
- package/dist/events/kinds.d.ts +8 -54
- package/dist/events/kinds.d.ts.map +1 -1
- package/dist/events/kinds.js +23 -24
- package/dist/events/kinds.js.map +1 -1
- package/dist/events/payloads.d.ts +41 -0
- package/dist/events/payloads.d.ts.map +1 -0
- package/dist/events/payloads.js +3 -0
- package/dist/events/payloads.js.map +1 -0
- package/dist/harness/check.d.ts +2 -0
- package/dist/harness/check.d.ts.map +1 -1
- package/dist/harness/check.js +55 -1
- package/dist/harness/check.js.map +1 -1
- package/dist/harness/codex-cli.d.ts +20 -4
- package/dist/harness/codex-cli.d.ts.map +1 -1
- package/dist/harness/codex-cli.js +204 -35
- package/dist/harness/codex-cli.js.map +1 -1
- package/dist/harness/codex-context-ceiling.d.ts +15 -0
- package/dist/harness/codex-context-ceiling.d.ts.map +1 -0
- package/dist/harness/codex-context-ceiling.js +27 -0
- package/dist/harness/codex-context-ceiling.js.map +1 -0
- package/dist/harness/codex-live-usage.d.ts +18 -0
- package/dist/harness/codex-live-usage.d.ts.map +1 -0
- package/dist/harness/codex-live-usage.js +87 -0
- package/dist/harness/codex-live-usage.js.map +1 -0
- package/dist/harness/codex-policy.d.ts +12 -0
- package/dist/harness/codex-policy.d.ts.map +1 -0
- package/dist/harness/codex-policy.js +38 -0
- package/dist/harness/codex-policy.js.map +1 -0
- package/dist/harness/index.d.ts +19 -1
- package/dist/harness/index.d.ts.map +1 -1
- package/dist/harness/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/internal.d.ts +20 -18
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +16 -6
- package/dist/internal.js.map +1 -1
- package/dist/kpis/steerability.d.ts +43 -0
- package/dist/kpis/steerability.d.ts.map +1 -0
- package/dist/kpis/steerability.js +129 -0
- package/dist/kpis/steerability.js.map +1 -0
- package/dist/logger/index.d.ts +4 -0
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +2 -0
- package/dist/logger/index.js.map +1 -1
- package/dist/models/cost.d.ts +23 -0
- package/dist/models/cost.d.ts.map +1 -0
- package/dist/models/cost.js +26 -0
- package/dist/models/cost.js.map +1 -0
- package/dist/models/index.d.ts +4 -2
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +5 -5
- package/dist/models/index.js.map +1 -1
- package/dist/phases/build-lint-rules.d.ts +1 -0
- package/dist/phases/build-lint-rules.d.ts.map +1 -1
- package/dist/phases/build-lint-rules.js +2 -0
- package/dist/phases/build-lint-rules.js.map +1 -1
- package/dist/phases/build-no-diff.d.ts +15 -0
- package/dist/phases/build-no-diff.d.ts.map +1 -0
- package/dist/phases/build-no-diff.js +52 -0
- package/dist/phases/build-no-diff.js.map +1 -0
- package/dist/phases/build-prompts.d.ts +32 -0
- package/dist/phases/build-prompts.d.ts.map +1 -0
- package/dist/phases/build-prompts.js +102 -0
- package/dist/phases/build-prompts.js.map +1 -0
- package/dist/phases/build.d.ts +18 -33
- package/dist/phases/build.d.ts.map +1 -1
- package/dist/phases/build.js +48 -106
- package/dist/phases/build.js.map +1 -1
- package/dist/phases/check-environment.d.ts +7 -0
- package/dist/phases/check-environment.d.ts.map +1 -0
- package/dist/phases/check-environment.js +35 -0
- package/dist/phases/check-environment.js.map +1 -0
- package/dist/phases/check-evidence.d.ts +6 -0
- package/dist/phases/check-evidence.d.ts.map +1 -0
- package/dist/phases/check-evidence.js +127 -0
- package/dist/phases/check-evidence.js.map +1 -0
- package/dist/phases/check-intent-to-add.d.ts +3 -0
- package/dist/phases/check-intent-to-add.d.ts.map +1 -0
- package/dist/phases/check-intent-to-add.js +50 -0
- package/dist/phases/check-intent-to-add.js.map +1 -0
- package/dist/phases/check.d.ts +11 -0
- package/dist/phases/check.d.ts.map +1 -1
- package/dist/phases/check.js +30 -42
- package/dist/phases/check.js.map +1 -1
- package/dist/phases/plan-spec-guards.d.ts +14 -0
- package/dist/phases/plan-spec-guards.d.ts.map +1 -0
- package/dist/phases/plan-spec-guards.js +45 -0
- package/dist/phases/plan-spec-guards.js.map +1 -0
- package/dist/phases/plan-steps.d.ts +3 -0
- package/dist/phases/plan-steps.d.ts.map +1 -0
- package/dist/phases/plan-steps.js +17 -0
- package/dist/phases/plan-steps.js.map +1 -0
- package/dist/phases/plan.d.ts +27 -0
- package/dist/phases/plan.d.ts.map +1 -1
- package/dist/phases/plan.js +112 -108
- package/dist/phases/plan.js.map +1 -1
- package/dist/phases/ship-git.d.ts +1 -2
- package/dist/phases/ship-git.d.ts.map +1 -1
- package/dist/phases/ship-git.js +7 -5
- package/dist/phases/ship-git.js.map +1 -1
- package/dist/phases/ship.d.ts +3 -2
- package/dist/phases/ship.d.ts.map +1 -1
- package/dist/phases/ship.js +31 -8
- package/dist/phases/ship.js.map +1 -1
- package/dist/phases/stack-approval.d.ts +37 -0
- package/dist/phases/stack-approval.d.ts.map +1 -0
- package/dist/phases/stack-approval.js +77 -0
- package/dist/phases/stack-approval.js.map +1 -0
- package/dist/phases/stack-order.d.ts +31 -0
- package/dist/phases/stack-order.d.ts.map +1 -0
- package/dist/phases/stack-order.js +71 -0
- package/dist/phases/stack-order.js.map +1 -0
- package/dist/queue/github-queue.d.ts +5 -5
- package/dist/queue/github-queue.d.ts.map +1 -1
- package/dist/queue/github-queue.js +13 -9
- package/dist/queue/github-queue.js.map +1 -1
- package/dist/queue/index.d.ts +1 -1
- package/dist/queue/index.d.ts.map +1 -1
- package/dist/queue/queue-order.d.ts +10 -5
- package/dist/queue/queue-order.d.ts.map +1 -1
- package/dist/queue/queue-order.js +30 -12
- package/dist/queue/queue-order.js.map +1 -1
- package/dist/queue/release-queued.d.ts +8 -0
- package/dist/queue/release-queued.d.ts.map +1 -0
- package/dist/queue/release-queued.js +43 -0
- package/dist/queue/release-queued.js.map +1 -0
- package/dist/readiness/decompose-prompt.d.ts +9 -0
- package/dist/readiness/decompose-prompt.d.ts.map +1 -0
- package/dist/readiness/decompose-prompt.js +68 -0
- package/dist/readiness/decompose-prompt.js.map +1 -0
- package/dist/readiness/decompose.d.ts +7 -8
- package/dist/readiness/decompose.d.ts.map +1 -1
- package/dist/readiness/decompose.js +26 -65
- package/dist/readiness/decompose.js.map +1 -1
- package/dist/readiness/size.d.ts +28 -10
- package/dist/readiness/size.d.ts.map +1 -1
- package/dist/readiness/size.js +82 -11
- package/dist/readiness/size.js.map +1 -1
- package/dist/readiness/slice-gate.d.ts +17 -0
- package/dist/readiness/slice-gate.d.ts.map +1 -1
- package/dist/readiness/slice-gate.js +67 -7
- package/dist/readiness/slice-gate.js.map +1 -1
- package/dist/readiness/slice-overlap.d.ts +21 -0
- package/dist/readiness/slice-overlap.d.ts.map +1 -0
- package/dist/readiness/slice-overlap.js +45 -0
- package/dist/readiness/slice-overlap.js.map +1 -0
- package/dist/readiness/slice-plan.d.ts +4 -2
- package/dist/readiness/slice-plan.d.ts.map +1 -1
- package/dist/readiness/slice-plan.js +20 -7
- package/dist/readiness/slice-plan.js.map +1 -1
- package/dist/reports/evidence-pack.d.ts.map +1 -1
- package/dist/reports/evidence-pack.js +24 -0
- package/dist/reports/evidence-pack.js.map +1 -1
- package/dist/reports/pr-body.d.ts +2 -0
- package/dist/reports/pr-body.d.ts.map +1 -1
- package/dist/reports/pr-body.js +1 -0
- package/dist/reports/pr-body.js.map +1 -1
- package/dist/review/classifier.d.ts +2 -0
- package/dist/review/classifier.d.ts.map +1 -1
- package/dist/review/classifier.js +5 -1
- package/dist/review/classifier.js.map +1 -1
- package/dist/review/floor.d.ts +1 -0
- package/dist/review/floor.d.ts.map +1 -1
- package/dist/review/floor.js +1 -1
- package/dist/review/floor.js.map +1 -1
- package/dist/review/risk-receipt.d.ts +34 -0
- package/dist/review/risk-receipt.d.ts.map +1 -0
- package/dist/review/risk-receipt.js +96 -0
- package/dist/review/risk-receipt.js.map +1 -0
- package/dist/review/risk.d.ts +16 -0
- package/dist/review/risk.d.ts.map +1 -0
- package/dist/review/risk.js +66 -0
- package/dist/review/risk.js.map +1 -0
- package/dist/router/budget-guard.d.ts +28 -0
- package/dist/router/budget-guard.d.ts.map +1 -0
- package/dist/router/budget-guard.js +40 -0
- package/dist/router/budget-guard.js.map +1 -0
- package/dist/router/cost-row.d.ts +15 -0
- package/dist/router/cost-row.d.ts.map +1 -0
- package/dist/router/cost-row.js +42 -0
- package/dist/router/cost-row.js.map +1 -0
- package/dist/router/index.d.ts +21 -18
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js +32 -35
- package/dist/router/index.js.map +1 -1
- package/dist/router/missing-worktree.d.ts +10 -5
- package/dist/router/missing-worktree.d.ts.map +1 -1
- package/dist/router/missing-worktree.js +18 -6
- package/dist/router/missing-worktree.js.map +1 -1
- package/dist/run/adopt-pr.d.ts +31 -0
- package/dist/run/adopt-pr.d.ts.map +1 -0
- package/dist/run/adopt-pr.js +40 -0
- package/dist/run/adopt-pr.js.map +1 -0
- package/dist/run/attribution.d.ts +26 -0
- package/dist/run/attribution.d.ts.map +1 -0
- package/dist/run/attribution.js +64 -0
- package/dist/run/attribution.js.map +1 -0
- package/dist/run/budget.d.ts +36 -0
- package/dist/run/budget.d.ts.map +1 -0
- package/dist/run/budget.js +50 -0
- package/dist/run/budget.js.map +1 -0
- package/dist/run/ci-rework-loop.d.ts.map +1 -1
- package/dist/run/ci-rework-loop.js +4 -0
- package/dist/run/ci-rework-loop.js.map +1 -1
- package/dist/run/flaky-tests.d.ts +1 -1
- package/dist/run/flaky-tests.d.ts.map +1 -1
- package/dist/run/flaky-tests.js +3 -2
- package/dist/run/flaky-tests.js.map +1 -1
- package/dist/run/lane-file-guard.d.ts +6 -2
- package/dist/run/lane-file-guard.d.ts.map +1 -1
- package/dist/run/lane-file-guard.js +19 -4
- package/dist/run/lane-file-guard.js.map +1 -1
- package/dist/run/local-finish.d.ts +13 -0
- package/dist/run/local-finish.d.ts.map +1 -0
- package/dist/run/local-finish.js +42 -0
- package/dist/run/local-finish.js.map +1 -0
- package/dist/run/outcome.d.ts +34 -0
- package/dist/run/outcome.d.ts.map +1 -1
- package/dist/run/outcome.js.map +1 -1
- package/dist/run/previous-attempt.d.ts +5 -0
- package/dist/run/previous-attempt.d.ts.map +1 -0
- package/dist/run/previous-attempt.js +60 -0
- package/dist/run/previous-attempt.js.map +1 -0
- package/dist/run/run-issue.d.ts +26 -18
- package/dist/run/run-issue.d.ts.map +1 -1
- package/dist/run/run-issue.js +96 -70
- package/dist/run/run-issue.js.map +1 -1
- package/dist/run/run-state-record.d.ts +15 -0
- package/dist/run/run-state-record.d.ts.map +1 -0
- package/dist/run/run-state-record.js +43 -0
- package/dist/run/run-state-record.js.map +1 -0
- package/dist/run/slice-ship-record.d.ts +19 -0
- package/dist/run/slice-ship-record.d.ts.map +1 -0
- package/dist/run/slice-ship-record.js +33 -0
- package/dist/run/slice-ship-record.js.map +1 -0
- package/dist/run/stack-slice-entry.d.ts +3 -6
- package/dist/run/stack-slice-entry.d.ts.map +1 -1
- package/dist/run/stack-slice-entry.js +16 -23
- package/dist/run/stack-slice-entry.js.map +1 -1
- package/dist/run/state.d.ts +25 -1
- package/dist/run/state.d.ts.map +1 -1
- package/dist/run/state.js +45 -0
- package/dist/run/state.js.map +1 -1
- package/dist/run/steer.d.ts +36 -0
- package/dist/run/steer.d.ts.map +1 -0
- package/dist/run/steer.js +54 -0
- package/dist/run/steer.js.map +1 -0
- package/dist/sandbox/index.d.ts +2 -0
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +5 -1
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sim/pipeline.js +1 -0
- package/dist/sim/pipeline.js.map +1 -1
- package/dist/steward/diagnose.d.ts.map +1 -1
- package/dist/steward/diagnose.js +4 -3
- package/dist/steward/diagnose.js.map +1 -1
- package/dist/types/index.d.ts +25 -16
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +1 -1
- package/dist/usage/index.d.ts.map +1 -1
- package/dist/usage/index.js +11 -1
- package/dist/usage/index.js.map +1 -1
- package/dist/utils/ci-watch-no-ci.d.ts +13 -0
- package/dist/utils/ci-watch-no-ci.d.ts.map +1 -0
- package/dist/utils/ci-watch-no-ci.js +57 -0
- package/dist/utils/ci-watch-no-ci.js.map +1 -0
- package/dist/utils/ci-watch-required.d.ts +22 -0
- package/dist/utils/ci-watch-required.d.ts.map +1 -0
- package/dist/utils/ci-watch-required.js +47 -0
- package/dist/utils/ci-watch-required.js.map +1 -0
- package/dist/utils/ci-watch.d.ts +19 -11
- package/dist/utils/ci-watch.d.ts.map +1 -1
- package/dist/utils/ci-watch.js +23 -62
- package/dist/utils/ci-watch.js.map +1 -1
- package/dist/utils/exec.d.ts +3 -0
- package/dist/utils/exec.d.ts.map +1 -1
- package/dist/utils/exec.js +14 -0
- package/dist/utils/exec.js.map +1 -1
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/required-checks.d.ts +38 -1
- package/dist/utils/required-checks.d.ts.map +1 -1
- package/dist/utils/required-checks.js +122 -8
- package/dist/utils/required-checks.js.map +1 -1
- package/dist/utils/stop-marker.d.ts +15 -0
- package/dist/utils/stop-marker.d.ts.map +1 -0
- package/dist/utils/stop-marker.js +60 -0
- package/dist/utils/stop-marker.js.map +1 -0
- package/dist/utils/untrusted-input.d.ts +4 -0
- package/dist/utils/untrusted-input.d.ts.map +1 -1
- package/dist/utils/untrusted-input.js +9 -0
- package/dist/utils/untrusted-input.js.map +1 -1
- package/dist/utils/worktree-gc.d.ts +11 -0
- package/dist/utils/worktree-gc.d.ts.map +1 -1
- package/dist/utils/worktree-gc.js +31 -3
- package/dist/utils/worktree-gc.js.map +1 -1
- package/dist/utils/worktree-keeps.d.ts +20 -0
- package/dist/utils/worktree-keeps.d.ts.map +1 -0
- package/dist/utils/worktree-keeps.js +65 -0
- package/dist/utils/worktree-keeps.js.map +1 -0
- package/package.json +5 -5
- package/dist/phases/ship-stack.d.ts +0 -49
- package/dist/phases/ship-stack.d.ts.map +0 -1
- package/dist/phases/ship-stack.js +0 -110
- package/dist/phases/ship-stack.js.map +0 -1
- package/dist/phases/stack-check-failure.d.ts +0 -42
- package/dist/phases/stack-check-failure.d.ts.map +0 -1
- package/dist/phases/stack-check-failure.js +0 -47
- package/dist/phases/stack-check-failure.js.map +0 -1
- package/dist/phases/stack-fallback.d.ts +0 -33
- package/dist/phases/stack-fallback.d.ts.map +0 -1
- package/dist/phases/stack-fallback.js +0 -47
- package/dist/phases/stack-fallback.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname } from 'node:path';
|
|
3
|
+
const SPEC_WRITE_DENIAL = /sandbox denied|operation not permitted|\bEACCES\b|\bEPERM\b|outside the writable|read-only file system/i;
|
|
4
|
+
/** True when a planner output reports that writing specPath was denied (#3269). Needs both the path and a denial phrase. */
|
|
5
|
+
export function specWriteDenied(output, specPath) {
|
|
6
|
+
if (!SPEC_WRITE_DENIAL.test(output))
|
|
7
|
+
return false;
|
|
8
|
+
const names = [specPath, dirname(specPath), `plans/${basename(specPath)}`];
|
|
9
|
+
return names.some((n) => n.length > 1 && output.includes(n));
|
|
10
|
+
}
|
|
11
|
+
export function blockedNoChangeSpecReason(body) {
|
|
12
|
+
const looksBlocked = /^\s*Blocked(?::|\s+by\b)/im.test(body);
|
|
13
|
+
if (!looksBlocked)
|
|
14
|
+
return null;
|
|
15
|
+
const saysNoChanges = /\bno files? (?:were )?changed\b/i.test(body) || /\bno changes? (?:were )?made\b/i.test(body);
|
|
16
|
+
const pointsAtSandbox = /\bsandbox\b/i.test(body) || /\boutside (?:the )?(?:worktree|workspace|checkout)\b/i.test(body);
|
|
17
|
+
if (!saysNoChanges && !pointsAtSandbox)
|
|
18
|
+
return null;
|
|
19
|
+
return 'PLAN returned a blocked/no-change note instead of a frozen spec';
|
|
20
|
+
}
|
|
21
|
+
/** Parks `config` when the planner's output reports a denied spec write and no spec file exists (#3269). */
|
|
22
|
+
export function specWriteDeniedResult(result, specPath, route, log) {
|
|
23
|
+
if (existsSync(specPath) || !specWriteDenied(result.output, specPath))
|
|
24
|
+
return null;
|
|
25
|
+
const message = `PLAN could not write its spec to ${specPath}: the planner (model ${result.model}) reported the write was denied by its harness sandbox or file permissions`;
|
|
26
|
+
log('config', message);
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
route,
|
|
30
|
+
specPath,
|
|
31
|
+
model: result.model,
|
|
32
|
+
escalate: message,
|
|
33
|
+
parkReason: 'config',
|
|
34
|
+
designArtifact: null,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function planSummary(r) {
|
|
38
|
+
if (r.ok)
|
|
39
|
+
return `plan complete (route ${r.route}, model ${r.model})`;
|
|
40
|
+
return `${r.parkReason === 'config' ? 'plan parked (config)' : 'plan escalated'}: ${r.escalate ?? 'unknown'}`;
|
|
41
|
+
}
|
|
42
|
+
export function planConfigParkMessage(plan, issue) {
|
|
43
|
+
return `${plan.escalate}\nthen fix the harness writable roots and run factory unpark ${issue}`;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=plan-spec-guards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-spec-guards.js","sourceRoot":"","sources":["../../src/phases/plan-spec-guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAM9C,MAAM,iBAAiB,GACrB,yGAAyG,CAAC;AAE5G,4HAA4H;AAC5H,MAAM,UAAU,eAAe,C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;IACvB,OAAO;QACL,EAAE,EAAE,KAAK;QACT,KAAK;QACL,QAAQ;QACR,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,QAAQ,EAAE,OAAO;QACjB,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,IAAI;KACrB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAa;IACvC,IAAI,CAAC,CAAC,EAAE;QAAE,OAAO,wBAAwB,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,KAAK,GAAG,CAAC;IACtE,OAAO,GAAG,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,gBAAgB,KAAK,CAAC,CAAC,QAAQ,IAAI,SAAS,EAAE,CAAC;AAChH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAgB,EAAE,KAAa;IACnE,OAAO,GAAG,IAAI,CAAC,QAAQ,gEAAgE,KAAK,EAAE,CAAC;AACjG,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const RIGHT_SIZE_STEP = "4. RIGHT-SIZE THE SLICE. A single BUILD pass must be bounded: aim for roughly\n 5-15 minutes of agent work, a handful of files, at most ~6 target types /\n ~8 signatures / ~10 call edges in the design block. If the issue genuinely\n needs more surface than that, do NOT write a mega-spec \u2014 instead print a line\n starting with ESCALATE: asking to split the issue into smaller slices first,\n and do not write the spec file. A slice that takes 40 minutes to build is a\n planning failure, not a build problem.";
|
|
2
|
+
export declare const RIGHT_SIZE_STEP_GATE_PASSED = "4. RIGHT-SIZE THE SLICE. The factory's deterministic size gate passed this issue: size is\n the gate's call, not yours. Do NOT print ESCALATE: about size or to ask for a split.\n Still aim for a bounded BUILD pass (roughly 5-15 minutes of agent work, a handful of\n files). If the scope really is bigger, write the full design block anyway: the factory's\n post-plan build-scope gate measures it and slices or decomposes it. You may escalate only\n for missing information or a contradiction, and must name which, as\n \"ESCALATE: missing-info: <question>\" or \"ESCALATE: contradiction: <what conflicts>\";\n then do not write the spec file.";
|
|
3
|
+
//# sourceMappingURL=plan-steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-steps.d.ts","sourceRoot":"","sources":["../../src/phases/plan-steps.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,khBAMc,CAAC;AAE3C,eAAO,MAAM,2BAA2B,qpBAOJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// src/phases/plan-steps.ts — PLAN prompt step 4 variants, split out of plan.ts to stay under the max-lines ceiling (#3373)
|
|
2
|
+
export const RIGHT_SIZE_STEP = `4. RIGHT-SIZE THE SLICE. A single BUILD pass must be bounded: aim for roughly
|
|
3
|
+
5-15 minutes of agent work, a handful of files, at most ~6 target types /
|
|
4
|
+
~8 signatures / ~10 call edges in the design block. If the issue genuinely
|
|
5
|
+
needs more surface than that, do NOT write a mega-spec — instead print a line
|
|
6
|
+
starting with ESCALATE: asking to split the issue into smaller slices first,
|
|
7
|
+
and do not write the spec file. A slice that takes 40 minutes to build is a
|
|
8
|
+
planning failure, not a build problem.`;
|
|
9
|
+
export const RIGHT_SIZE_STEP_GATE_PASSED = `4. RIGHT-SIZE THE SLICE. The factory's deterministic size gate passed this issue: size is
|
|
10
|
+
the gate's call, not yours. Do NOT print ESCALATE: about size or to ask for a split.
|
|
11
|
+
Still aim for a bounded BUILD pass (roughly 5-15 minutes of agent work, a handful of
|
|
12
|
+
files). If the scope really is bigger, write the full design block anyway: the factory's
|
|
13
|
+
post-plan build-scope gate measures it and slices or decomposes it. You may escalate only
|
|
14
|
+
for missing information or a contradiction, and must name which, as
|
|
15
|
+
"ESCALATE: missing-info: <question>" or "ESCALATE: contradiction: <what conflicts>";
|
|
16
|
+
then do not write the spec file.`;
|
|
17
|
+
//# sourceMappingURL=plan-steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-steps.js","sourceRoot":"","sources":["../../src/phases/plan-steps.ts"],"names":[],"mappings":"AAAA,2HAA2H;AAE3H,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;0CAMW,CAAC;AAE3C,MAAM,CAAC,MAAM,2BAA2B,GAAG;;;;;;;oCAOP,CAAC"}
|
package/dist/phases/plan.d.ts
CHANGED
|
@@ -5,8 +5,11 @@ import type { EventKind } from '../events/kinds.js';
|
|
|
5
5
|
import type { SizeGateMode } from '../config/index.js';
|
|
6
6
|
import type { BuildRoutePin } from '../config/repo.js';
|
|
7
7
|
import { type SlicePlan } from '../readiness/slice-plan.js';
|
|
8
|
+
import { type SizeBudget } from '../readiness/size.js';
|
|
8
9
|
import type { ModelRouter } from '../router/index.js';
|
|
10
|
+
import type { SandboxPolicy } from '../sandbox/index.js';
|
|
9
11
|
import { type ConsumedSteering } from '../steering/index.js';
|
|
12
|
+
import type { EscalateKind } from '../types/index.js';
|
|
10
13
|
import type { Constitution, DesignArtifact, FailoverReason, ReadinessInfo } from '../types/index.js';
|
|
11
14
|
import { type WorkRequestSourceKind, type WorkSourceRegistry } from '../work/index.js';
|
|
12
15
|
import { buildDesignArtifactRetryPrompt, MAX_DESIGN_ARTIFACT_RETRIES } from './plan-design-retry.js';
|
|
@@ -19,6 +22,8 @@ export interface PlanResult {
|
|
|
19
22
|
specPath: string;
|
|
20
23
|
model: string;
|
|
21
24
|
escalate?: string;
|
|
25
|
+
/** Set when the planner could not write its spec (#3269): `ok` is false and the caller parks `config`. */
|
|
26
|
+
parkReason?: 'config';
|
|
22
27
|
designArtifact: DesignArtifact | null;
|
|
23
28
|
/** Set by either file-mode size gate (pre-flight or post-plan build-scope) when the oversized
|
|
24
29
|
* issue was decomposed into real filed sub-issues. `ok` stays false: this run is over, but the caller can
|
|
@@ -38,6 +43,12 @@ export interface PlanResult {
|
|
|
38
43
|
plan: SlicePlan;
|
|
39
44
|
index: number;
|
|
40
45
|
};
|
|
46
|
+
/** ADR-0161: set with `ok: false` when the stack slice below is not yet approved or merged. */
|
|
47
|
+
stackWait?: {
|
|
48
|
+
index: number;
|
|
49
|
+
count: number;
|
|
50
|
+
prNumber: number;
|
|
51
|
+
};
|
|
41
52
|
}
|
|
42
53
|
export interface PlanPromptOpts {
|
|
43
54
|
issue: number;
|
|
@@ -48,16 +59,29 @@ export interface PlanPromptOpts {
|
|
|
48
59
|
adrCtx?: string;
|
|
49
60
|
/** Build routes with at least one runnable model on this machine. Empty or omitted = the CLI routes; command only when listed. */
|
|
50
61
|
runnableRoutes?: readonly BuildRouteName[];
|
|
62
|
+
/** Pre-flight size-gate verdict (#3275). passed && enforced drops step 4's size ESCALATE. */
|
|
63
|
+
sizeGate?: {
|
|
64
|
+
passed: boolean;
|
|
65
|
+
reason?: string;
|
|
66
|
+
enforced: boolean;
|
|
67
|
+
};
|
|
68
|
+
/** Rendered "## Previous attempt" note (#3373); empty or absent = first run. */
|
|
69
|
+
previousAttempt?: string;
|
|
51
70
|
}
|
|
71
|
+
/** Classify a planner ESCALATE line for the escalate event (#3275). */
|
|
72
|
+
export declare function classifyEscalation(line: string | undefined): EscalateKind | undefined;
|
|
52
73
|
export declare function buildPlanPrompt(opts: PlanPromptOpts): string;
|
|
53
74
|
export declare function planPhase(opts: Parameters<typeof planPhaseImpl>[0]): Promise<PlanResult>;
|
|
54
75
|
declare function planPhaseImpl(opts: {
|
|
76
|
+
/** Rendered "## Previous attempt" note (#3373); empty or absent = first run. */
|
|
77
|
+
previousAttempt?: string;
|
|
55
78
|
issue: number;
|
|
56
79
|
repo: string;
|
|
57
80
|
worktree: string;
|
|
58
81
|
specPath: string;
|
|
59
82
|
constitution: Constitution | null;
|
|
60
83
|
router: ModelRouter;
|
|
84
|
+
sandbox?: SandboxPolicy;
|
|
61
85
|
octokit: Octokit;
|
|
62
86
|
log: (type: EventKind, msg: string, extra?: {
|
|
63
87
|
failoverReason?: FailoverReason;
|
|
@@ -67,6 +91,7 @@ declare function planPhaseImpl(opts: {
|
|
|
67
91
|
output: number;
|
|
68
92
|
};
|
|
69
93
|
readiness?: ReadinessInfo;
|
|
94
|
+
escalateKind?: EscalateKind;
|
|
70
95
|
durationMs?: number;
|
|
71
96
|
}) => void;
|
|
72
97
|
timeoutSeconds?: number;
|
|
@@ -99,6 +124,8 @@ declare function planPhaseImpl(opts: {
|
|
|
99
124
|
sizeGateMode?: SizeGateMode;
|
|
100
125
|
/** Slice cap for sizeGate.mode 'slice' (ADR-0156); default DEFAULT_MAX_SLICES. */
|
|
101
126
|
maxSlices?: number;
|
|
127
|
+
/** sizeGate.tokenBudget / maxFiles (#3350); default DEFAULT_TOKEN_BUDGET / DEFAULT_MAX_FILES. */
|
|
128
|
+
sizeBudget?: SizeBudget;
|
|
102
129
|
/** ADR-0161 stack mode: plan this 1-based slice of the trusted slice plan. Default: the current slice. Ignored outside stack mode. */
|
|
103
130
|
sliceIndex?: number;
|
|
104
131
|
/** Stop PLAN before BUILD when a worse/unknown behaviorDelta row is not in openQuestions (#1819). Default false = log only. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/phases/plan.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,iBAAiB,CAAC;AAInE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AASpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"plan.d.ts","sourceRoot":"","sources":["../../src/phases/plan.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;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CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gFAAgF;IAChF,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,qBAAqB,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC;IAC9D,sFAAsF;IACtF,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,sFAAsF;IACtF,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,8FAA8F;IAC9F,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,0NAA0N;IAC1N,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,sIAAsI;IACtI,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+HAA+H;IAC/H,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,2HAA2H;IAC3H,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;qEACiE;IACjE,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB,GAAG,OAAO,CAAC,UAAU,CAAC,CAqkBtB"}
|
package/dist/phases/plan.js
CHANGED
|
@@ -10,16 +10,19 @@ import { findUnresolvedRegressions, parseDesignArtifact, renderDesignArtifact }
|
|
|
10
10
|
import { buildFastPathSpec, isFastPathEligible } from '../efficiency/fast-path.js';
|
|
11
11
|
import { buildReadinessEnrichmentPrompt, buildReadinessEnrichmentRetryPrompt, composeEnrichedIssueBody, scoreEnrichedIssueReadiness, stripEnrichedBlock, } from '../readiness/enrich.js';
|
|
12
12
|
import { settlePlanRoute } from './plan-route.js';
|
|
13
|
+
import { blockedNoChangeSpecReason, planSummary, specWriteDeniedResult } from './plan-spec-guards.js';
|
|
13
14
|
import { decomposeOversizedIssue, renderChildIssueBody } from '../readiness/decompose.js';
|
|
14
15
|
import { resolveSliceGate } from '../readiness/slice-gate.js';
|
|
16
|
+
import { octokitStackSliceGateReader } from './stack-approval.js';
|
|
15
17
|
import { DEFAULT_MAX_SLICES } from '../readiness/slice-plan.js';
|
|
16
|
-
import {
|
|
18
|
+
import { DEFAULT_MAX_FILES, DEFAULT_TOKEN_BUDGET, estimatePlanSize, planOverBudget, } from '../readiness/size.js';
|
|
17
19
|
import { scoreIssueReadiness } from '../readiness/index.js';
|
|
18
20
|
import { failoversFrom } from '../router/index.js';
|
|
19
21
|
import { applySteering, describeSteering } from '../steering/index.js';
|
|
20
22
|
import { archiveSpec, readSpec, writeSpec } from '../spec/index.js';
|
|
21
23
|
import { escalationLine, isEscalation } from '../utils/index.js';
|
|
22
24
|
import { UNTRUSTED_ISSUE_BODY_NOTICE, wrapUntrustedIssueBody } from '../utils/untrusted-input.js';
|
|
25
|
+
import { RIGHT_SIZE_STEP, RIGHT_SIZE_STEP_GATE_PASSED } from './plan-steps.js';
|
|
23
26
|
import { GITHUB_ISSUE_SOURCE } from '../work/github-issue.js';
|
|
24
27
|
import { createDefaultWorkSourceRegistry } from '../work/index.js';
|
|
25
28
|
import { buildDesignArtifactRetryPrompt, designArtifactInvalidMessage, MAX_DESIGN_ARTIFACT_RETRIES, } from './plan-design-retry.js';
|
|
@@ -32,6 +35,19 @@ export { defaultBuildRoute, resolveRunnableBuildRoute, runnableBuildRoutes };
|
|
|
32
35
|
* on other endpoints (e.g. merge_commit_sha, singular assignee).
|
|
33
36
|
*/
|
|
34
37
|
const GITHUB_ISSUE_UPDATE_API_VERSION = '2026-03-10';
|
|
38
|
+
/** Classify a planner ESCALATE line for the escalate event (#3275). */
|
|
39
|
+
export function classifyEscalation(line) {
|
|
40
|
+
if (!line)
|
|
41
|
+
return undefined;
|
|
42
|
+
const rest = line.replace(/^\s*ESCALATE:\s*/i, '');
|
|
43
|
+
if (/^missing-info:/i.test(rest))
|
|
44
|
+
return 'missing-info';
|
|
45
|
+
if (/^contradiction:/i.test(rest))
|
|
46
|
+
return 'contradiction';
|
|
47
|
+
if (/\b(split|slices?|smaller|too (big|large)|size)\b/i.test(rest))
|
|
48
|
+
return 'split';
|
|
49
|
+
return undefined;
|
|
50
|
+
}
|
|
35
51
|
export function buildPlanPrompt(opts) {
|
|
36
52
|
const { issue, issueTitle, issueBody, specPath, constitutionCtx, adrCtx } = opts;
|
|
37
53
|
const runnable = opts.runnableRoutes ?? [];
|
|
@@ -61,7 +77,7 @@ ${UNTRUSTED_ISSUE_BODY_NOTICE}
|
|
|
61
77
|
|
|
62
78
|
${wrapUntrustedIssueBody(issueBody)}
|
|
63
79
|
|
|
64
|
-
Steps:
|
|
80
|
+
${opts.previousAttempt ? `${opts.previousAttempt}\n\n` : ''}Steps:
|
|
65
81
|
1. Read the issue above fully. Read CONTEXT.md if present. Any Accepted ADRs in this checkout
|
|
66
82
|
are already summarized above — treat them as binding constraints and open docs/adr/<file>
|
|
67
83
|
only if you need the full text. (Any CLAUDE.md/AGENTS.md standards are already included
|
|
@@ -72,13 +88,7 @@ Steps:
|
|
|
72
88
|
${routeBullets}
|
|
73
89
|
A pinned build worker's harness always wins over your judgment: the factory forces the
|
|
74
90
|
route to match it after PLAN. Default to route: ${fallbackRoute} when genuinely unsure.${runnableNote}
|
|
75
|
-
|
|
76
|
-
5-15 minutes of agent work, a handful of files, at most ~6 target types /
|
|
77
|
-
~8 signatures / ~10 call edges in the design block. If the issue genuinely
|
|
78
|
-
needs more surface than that, do NOT write a mega-spec — instead print a line
|
|
79
|
-
starting with ESCALATE: asking to split the issue into smaller slices first,
|
|
80
|
-
and do not write the spec file. A slice that takes 40 minutes to build is a
|
|
81
|
-
planning failure, not a build problem.
|
|
91
|
+
${opts.sizeGate?.passed && opts.sizeGate.enforced ? RIGHT_SIZE_STEP_GATE_PASSED : RIGHT_SIZE_STEP}
|
|
82
92
|
${constitutionCtx ? '5. The constitution above defines the standards for this product. Your spec MUST satisfy every standard.' : '5. No constitution loaded — use your best judgment.'}
|
|
83
93
|
6. RISKY-CHANGE FIELDS. If the plan changes a dispatch, switch, or match; a default branch
|
|
84
94
|
or fallthrough; or the flags passed to an external tool, you MUST fill the design fields
|
|
@@ -99,7 +109,7 @@ ${constitutionCtx ? '5. The constitution above defines the standards for this pr
|
|
|
99
109
|
Each entry has a kind, and each kind has required fields:
|
|
100
110
|
- fail-to-pass-test: claim, test — a test (file path plus test name) that fails before
|
|
101
111
|
the change and passes after it.
|
|
102
|
-
- command: claim, command, passWhen —
|
|
112
|
+
- command: claim, command, passWhen — exact command and human explanation; passWhen alone is not machine-checked. Add optional expect when output matters: exitCode defaults to 0; stdoutContains requires every case-sensitive literal substring in stdout.
|
|
103
113
|
- screenshot: claim, route — the concrete app route or page to capture.
|
|
104
114
|
- none: claim, reason — why no evidence can honestly prove this criterion.
|
|
105
115
|
Choosing a kind:
|
|
@@ -149,6 +159,9 @@ design:
|
|
|
149
159
|
claim: <acceptance criterion>
|
|
150
160
|
command: <exact command>
|
|
151
161
|
passWhen: <what a pass looks like>
|
|
162
|
+
expect:
|
|
163
|
+
exitCode: 0
|
|
164
|
+
stdoutContains: [<literal output required when relevant>]
|
|
152
165
|
- kind: screenshot
|
|
153
166
|
claim: <user-visible acceptance criterion>
|
|
154
167
|
route: <concrete route, e.g. /settings>
|
|
@@ -203,35 +216,7 @@ export async function planPhase(opts) {
|
|
|
203
216
|
issueId: opts.issue,
|
|
204
217
|
worktreePath: opts.worktree,
|
|
205
218
|
log: opts.log,
|
|
206
|
-
}, () => planPhaseImpl(opts), (r) => r.ok,
|
|
207
|
-
}
|
|
208
|
-
function blockedNoChangeSpecReason(body) {
|
|
209
|
-
const looksBlocked = /^\s*Blocked(?::|\s+by\b)/im.test(body);
|
|
210
|
-
if (!looksBlocked)
|
|
211
|
-
return null;
|
|
212
|
-
const saysNoChanges = /\bno files? (?:were )?changed\b/i.test(body) || /\bno changes? (?:were )?made\b/i.test(body);
|
|
213
|
-
const pointsAtSandbox = /\bsandbox\b/i.test(body) || /\boutside (?:the )?(?:worktree|workspace|checkout)\b/i.test(body);
|
|
214
|
-
if (!saysNoChanges && !pointsAtSandbox)
|
|
215
|
-
return null;
|
|
216
|
-
return 'PLAN returned a blocked/no-change note instead of a frozen spec';
|
|
217
|
-
}
|
|
218
|
-
/** The file-mode size-gate escalation: logs size-gate-decomposed when children were filed and
|
|
219
|
-
* size-gate-escalated otherwise, and builds the parked (or decomposed) PlanResult. */
|
|
220
|
-
function fileModeEscalation(childIssues, readiness, specPath, route, log, prefix = '') {
|
|
221
|
-
const reason = prefix +
|
|
222
|
-
(childIssues.length > 0
|
|
223
|
-
? `issue exceeds the size gate (${readiness.sizeReason ?? 'too big'}) — decomposed into ${childIssues.map((n) => `#${n}`).join(', ')}`
|
|
224
|
-
: `issue exceeds the size gate (${readiness.sizeReason ?? 'too big'}) — parked for decomposition`);
|
|
225
|
-
log(childIssues.length > 0 ? 'size-gate-decomposed' : 'size-gate-escalated', reason, { readiness });
|
|
226
|
-
return {
|
|
227
|
-
ok: false,
|
|
228
|
-
route,
|
|
229
|
-
specPath,
|
|
230
|
-
model: '',
|
|
231
|
-
escalate: reason,
|
|
232
|
-
designArtifact: null,
|
|
233
|
-
...(childIssues.length > 0 ? { decomposed: { childIssues } } : {}),
|
|
234
|
-
};
|
|
219
|
+
}, () => planPhaseImpl(opts), (r) => r.ok, planSummary);
|
|
235
220
|
}
|
|
236
221
|
async function planPhaseImpl(opts) {
|
|
237
222
|
const { issue, repo, worktree, specPath, constitution, router, octokit, log, timeoutSeconds, modelOverride, modelFallbacks, onProviderFailure, branch, approvalGate, drainSteering, } = opts;
|
|
@@ -273,6 +258,7 @@ async function planPhaseImpl(opts) {
|
|
|
273
258
|
: buildReadinessEnrichmentRetryPrompt(input, previous);
|
|
274
259
|
const enrichment = await router.run('readiness_enrich', prompt, {
|
|
275
260
|
worktree,
|
|
261
|
+
sandbox: opts.sandbox,
|
|
276
262
|
timeoutSeconds: Math.min(timeoutSeconds ?? 1800, 300),
|
|
277
263
|
onLog: (msg) => log('router', msg),
|
|
278
264
|
});
|
|
@@ -330,6 +316,7 @@ async function planPhaseImpl(opts) {
|
|
|
330
316
|
}
|
|
331
317
|
}
|
|
332
318
|
// ADR-0161: stack uses the slice-mode gates; it may plan an explicit slice.
|
|
319
|
+
const sizeBudget = opts.sizeBudget ?? { tokenBudget: DEFAULT_TOKEN_BUDGET, maxFiles: DEFAULT_MAX_FILES };
|
|
333
320
|
const sliceMode = opts.sizeGateMode === 'slice' || opts.sizeGateMode === 'stack';
|
|
334
321
|
let planningSlice = false;
|
|
335
322
|
let sliceLabel = '';
|
|
@@ -341,10 +328,11 @@ async function planPhaseImpl(opts) {
|
|
|
341
328
|
repo: params.repo,
|
|
342
329
|
title: issueTitle,
|
|
343
330
|
body: issueBody,
|
|
344
|
-
|
|
345
|
-
|
|
331
|
+
// #3350: issue prose never slices; only an existing trusted slice plan selects a slice here.
|
|
332
|
+
oversized: false,
|
|
346
333
|
maxSlices: opts.maxSlices ?? DEFAULT_MAX_SLICES,
|
|
347
334
|
...(opts.sizeGateMode === 'stack' && opts.sliceIndex !== undefined ? { sliceIndex: opts.sliceIndex } : {}),
|
|
335
|
+
...(opts.sizeGateMode === 'stack' ? { stackReader: octokitStackSliceGateReader(octokit, params.repo) } : {}),
|
|
348
336
|
worktree,
|
|
349
337
|
router,
|
|
350
338
|
octokit,
|
|
@@ -364,6 +352,11 @@ async function planPhaseImpl(opts) {
|
|
|
364
352
|
log('escalate', gate.reason);
|
|
365
353
|
return park(gate.reason);
|
|
366
354
|
}
|
|
355
|
+
if (gate.kind === 'wait') {
|
|
356
|
+
log('plan', gate.reason);
|
|
357
|
+
const { index, prNumber } = gate;
|
|
358
|
+
return { ...park(gate.reason), stackWait: { index, count: gate.plan.slices.length, prNumber } };
|
|
359
|
+
}
|
|
367
360
|
if (gate.kind === 'over-cap' || gate.kind === 'unsliceable') {
|
|
368
361
|
log('size-gate-escalated', gate.reason);
|
|
369
362
|
return park(gate.reason);
|
|
@@ -378,33 +371,24 @@ async function planPhaseImpl(opts) {
|
|
|
378
371
|
sliceLabel = `slice ${slice.index}/${plan.slices.length} of #${params.issue}`;
|
|
379
372
|
log('plan', `planning slice ${slice.index}/${plan.slices.length} of #${params.issue}: ${slice.title}`);
|
|
380
373
|
if (readiness.sizeOk === false) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
374
|
+
log('size_hint', `slice reads as large (${readiness.sizeReason ?? 'too big'}) — not parked; the post-plan size estimate decides (#3350)`, {
|
|
375
|
+
readiness,
|
|
376
|
+
});
|
|
384
377
|
}
|
|
385
378
|
}
|
|
386
379
|
}
|
|
387
|
-
if (enforceSizeGate &&
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
readiness.template === 'factory-task' &&
|
|
391
|
-
readiness.sizeOk === false) {
|
|
392
|
-
const params = source.params;
|
|
393
|
-
const decomposeResult = await decomposeOversizedIssue({
|
|
394
|
-
issue: params.issue,
|
|
395
|
-
repo: params.repo,
|
|
396
|
-
title: issueTitle,
|
|
397
|
-
body: issueBody,
|
|
398
|
-
worktree,
|
|
399
|
-
router,
|
|
400
|
-
octokit,
|
|
401
|
-
log: (type, msg) => log(type, msg),
|
|
402
|
-
timeoutSeconds: Math.min(timeoutSeconds ?? 1800, 300),
|
|
403
|
-
onProviderFailure,
|
|
404
|
-
fileSubIssues: true,
|
|
380
|
+
if (enforceSizeGate && readiness.template === 'factory-task' && readiness.sizeOk === false) {
|
|
381
|
+
log('size_hint', `issue reads as large (${readiness.sizeReason ?? 'too big'}) — not split; the post-plan size estimate decides (#3350)`, {
|
|
382
|
+
readiness,
|
|
405
383
|
});
|
|
406
|
-
return fileModeEscalation(decomposeResult.childIssues, readiness, specPath, failureRoute, log);
|
|
407
384
|
}
|
|
385
|
+
const sizeGate = readiness.template === 'factory-task'
|
|
386
|
+
? {
|
|
387
|
+
passed: readiness.sizeOk !== false,
|
|
388
|
+
...(readiness.sizeReason ? { reason: readiness.sizeReason } : {}),
|
|
389
|
+
enforced: enforceSizeGate,
|
|
390
|
+
}
|
|
391
|
+
: undefined;
|
|
408
392
|
// The fast path emits a compact Codex spec, so it is only valid when the route may be codex:
|
|
409
393
|
// a pinned claude/opencode build route (#1367) must go through model PLAN like any other issue.
|
|
410
394
|
const fastPathRouteOk = !opts.preferredRoute || opts.preferredRoute === 'codex';
|
|
@@ -463,7 +447,17 @@ async function planPhaseImpl(opts) {
|
|
|
463
447
|
let steering;
|
|
464
448
|
let replans = 0;
|
|
465
449
|
while (true) {
|
|
466
|
-
const basePrompt = applySteering(buildPlanPrompt({
|
|
450
|
+
const basePrompt = applySteering(buildPlanPrompt({
|
|
451
|
+
issue,
|
|
452
|
+
issueTitle,
|
|
453
|
+
issueBody,
|
|
454
|
+
specPath,
|
|
455
|
+
constitutionCtx,
|
|
456
|
+
adrCtx,
|
|
457
|
+
runnableRoutes,
|
|
458
|
+
sizeGate,
|
|
459
|
+
previousAttempt: opts.previousAttempt,
|
|
460
|
+
}), steering);
|
|
467
461
|
if (replans > 0) {
|
|
468
462
|
log('plan', `Re-planning after operator redirect (attempt ${replans + 1})`);
|
|
469
463
|
}
|
|
@@ -479,6 +473,7 @@ async function planPhaseImpl(opts) {
|
|
|
479
473
|
}
|
|
480
474
|
result = await router.run('plan', prompt, {
|
|
481
475
|
worktree,
|
|
476
|
+
sandbox: opts.sandbox,
|
|
482
477
|
timeoutSeconds: timeoutSeconds ?? 1800,
|
|
483
478
|
modelOverride,
|
|
484
479
|
modelFallbacks,
|
|
@@ -490,10 +485,14 @@ async function planPhaseImpl(opts) {
|
|
|
490
485
|
failoverReason: f.reason,
|
|
491
486
|
});
|
|
492
487
|
}
|
|
488
|
+
const denied = specWriteDeniedResult(result, specPath, failureRoute, log);
|
|
489
|
+
if (denied)
|
|
490
|
+
return denied;
|
|
493
491
|
// Check for escalation
|
|
494
492
|
if (isEscalation(result.output)) {
|
|
495
493
|
const escalateLine = escalationLine(result.output);
|
|
496
|
-
|
|
494
|
+
const escalateKind = classifyEscalation(escalateLine);
|
|
495
|
+
log('escalate', escalateLine ?? 'plan escalated', escalateKind ? { escalateKind } : undefined);
|
|
497
496
|
return {
|
|
498
497
|
ok: false,
|
|
499
498
|
route: failureRoute,
|
|
@@ -555,19 +554,15 @@ async function planPhaseImpl(opts) {
|
|
|
555
554
|
const truncated = summary.length > 300 ? `${summary.slice(0, 300)}…` : summary;
|
|
556
555
|
log('design_open_questions', `plan has ${designArtifact.openQuestions.length} open question(s): ${truncated}`);
|
|
557
556
|
}
|
|
558
|
-
// Build-scope gate: a plan whose
|
|
559
|
-
//
|
|
560
|
-
//
|
|
561
|
-
//
|
|
562
|
-
//
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
(designArtifact.targetTypes.length > MAX_BUILD_TARGET_TYPES ||
|
|
566
|
-
designArtifact.signatures.length > MAX_BUILD_SIGNATURES ||
|
|
567
|
-
designArtifact.callGraph.length > MAX_BUILD_CALL_EDGES)) {
|
|
557
|
+
// Build-scope gate (#3350): a plan whose estimated size (changed files, and tokens from the
|
|
558
|
+
// bytes of the files it names) is over sizeGate.tokenBudget / maxFiles is too big for one
|
|
559
|
+
// bounded BUILD pass; a plan changing 3 files or fewer never splits. Decompose the issue
|
|
560
|
+
// instead of handing a mega-slice to BUILD. File mode files the decomposition as sub-issues
|
|
561
|
+
// and re-queues them (#2662).
|
|
562
|
+
const overBudget = planOverBudget(estimatePlanSize(designArtifact, { worktree }), sizeBudget);
|
|
563
|
+
if (enforceSizeGate && source.kind === GITHUB_ISSUE_SOURCE && overBudget !== null) {
|
|
568
564
|
const params = source.params;
|
|
569
|
-
const scope =
|
|
570
|
-
`${designArtifact.callGraph.length} call edges`;
|
|
565
|
+
const scope = overBudget;
|
|
571
566
|
const fileReason = `plan scope exceeds the bounded-build budget (${scope}) — parked for decomposition`;
|
|
572
567
|
const park = (reason) => ({
|
|
573
568
|
ok: false,
|
|
@@ -599,40 +594,49 @@ async function planPhaseImpl(opts) {
|
|
|
599
594
|
timeoutSeconds: Math.min(timeoutSeconds ?? 1800, 300),
|
|
600
595
|
onProviderFailure,
|
|
601
596
|
});
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
597
|
+
// #3351: slices that mostly edit the same files keep the issue whole; PLAN continues.
|
|
598
|
+
if (gate.kind !== 'cohesive') {
|
|
599
|
+
if (gate.kind === 'slice') {
|
|
600
|
+
const reason = `plan scope exceeds the bounded-build budget (${scope}) — sliced into ${gate.plan.slices.length} slice(s); the next run plans slice ${gate.slice.index}`;
|
|
601
|
+
return { ...park(reason), sliced: { sliceCount: gate.plan.slices.length } };
|
|
602
|
+
}
|
|
603
|
+
if (gate.kind === 'over-cap' || gate.kind === 'unsliceable') {
|
|
604
|
+
log('size-gate-escalated', gate.reason);
|
|
605
|
+
return park(gate.reason);
|
|
606
|
+
}
|
|
607
|
+
const reason = gate.kind === 'park' ? gate.reason : fileReason;
|
|
608
|
+
log('escalate', reason);
|
|
609
|
+
return park(reason);
|
|
609
610
|
}
|
|
610
|
-
const reason = gate.kind === 'park' ? gate.reason : fileReason;
|
|
611
|
-
log('escalate', reason);
|
|
612
|
-
return park(reason);
|
|
613
611
|
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
612
|
+
else {
|
|
613
|
+
// File mode (#2662): file the decomposition as sub-issues and re-queue them instead of parking.
|
|
614
|
+
const decomposeResult = await decomposeOversizedIssue({
|
|
615
|
+
issue: params.issue,
|
|
616
|
+
repo: params.repo,
|
|
617
|
+
title: issueTitle,
|
|
618
|
+
body: issueBody,
|
|
619
|
+
worktree,
|
|
620
|
+
router,
|
|
621
|
+
sandbox: opts.sandbox,
|
|
622
|
+
octokit,
|
|
623
|
+
log: (type, msg) => log(type, msg),
|
|
624
|
+
timeoutSeconds: Math.min(timeoutSeconds ?? 1800, 300),
|
|
625
|
+
onProviderFailure,
|
|
626
|
+
fileSubIssues: true,
|
|
627
|
+
});
|
|
628
|
+
// #3351: slices that mostly edit the same files keep the issue whole; PLAN continues.
|
|
629
|
+
if (decomposeResult.cohesive === undefined) {
|
|
630
|
+
const { childIssues } = decomposeResult;
|
|
631
|
+
if (childIssues.length > 0) {
|
|
632
|
+
const reason = `plan scope exceeds the bounded-build budget (${scope}) — decomposed into ${childIssues.map((n) => `#${n}`).join(', ')}`;
|
|
633
|
+
log('size-gate-decomposed', reason);
|
|
634
|
+
return { ...park(reason), decomposed: { childIssues } };
|
|
635
|
+
}
|
|
636
|
+
log('size-gate-escalated', fileReason);
|
|
637
|
+
return park(fileReason);
|
|
638
|
+
}
|
|
633
639
|
}
|
|
634
|
-
log('size-gate-escalated', fileReason);
|
|
635
|
-
return park(fileReason);
|
|
636
640
|
}
|
|
637
641
|
const unresolved = findUnresolvedRegressions(designArtifact);
|
|
638
642
|
for (const row of unresolved) {
|