fix(core): expand merge-blocker statuses to cover all transient states

Audit of task.status assignments across packages/core and packages/engine
surfaced five additional transient/in-flight statuses that should block
auto-merge but weren't in BLOCKING_TASK_STATUSES:

- awaiting-approval — triage spec awaiting user approval
- needs-replan — scheduler/executor/triage signaled re-plan needed
- mission-validation — mission-level validation in flight
- queued — scheduler-side transient state
- stuck-killed — defensive guard; task killed by stuck detector

Each represents a state where finalizing the merge violates user intent
or invariants. Group the set with comments explaining the intent of each
group so future additions can be slotted appropriately.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-28 17:21:12 -07:00
parent 07a11437c0
commit 971175755e
2 changed files with 41 additions and 0 deletions

View File

@@ -60,6 +60,34 @@ describe("getTaskMergeBlocker", () => {
.toContain("specifying");
});
it("returns reason when task is awaiting-approval", () => {
expect(getTaskMergeBlocker({ ...baseTask, status: "awaiting-approval" }))
.toContain("awaiting-approval");
});
it("returns reason when task needs-replan", () => {
// scheduler/executor/triage move a task here when its plan must be revisited.
expect(getTaskMergeBlocker({ ...baseTask, status: "needs-replan" }))
.toContain("needs-replan");
});
it("returns reason when task is in mission-validation", () => {
expect(getTaskMergeBlocker({ ...baseTask, status: "mission-validation" }))
.toContain("mission-validation");
});
it("returns reason when task is queued (scheduler transient)", () => {
expect(getTaskMergeBlocker({ ...baseTask, status: "queued" }))
.toContain("queued");
});
it("returns reason when task is stuck-killed", () => {
// Defensive: if this transient marker surfaces in in-review, the task
// needs investigation rather than auto-merge.
expect(getTaskMergeBlocker({ ...baseTask, status: "stuck-killed" }))
.toContain("stuck-killed");
});
it("returns reason when task has incomplete steps", () => {
expect(getTaskMergeBlocker({
...baseTask,