huskies: merge 893
This commit is contained in:
@@ -750,6 +750,34 @@ fn repeated_merge_failure_apply_transition_no_error_no_duplicate_notification()
|
||||
);
|
||||
}
|
||||
|
||||
// ── Story 893: MergeFailure + Unblock → Coding (retry) ─────────────
|
||||
|
||||
/// AC1: `MergeFailure + Unblock` transitions to `Coding` (retry), not `Backlog`.
|
||||
#[test]
|
||||
fn merge_failure_unblock_returns_to_coding() {
|
||||
let s = Stage::MergeFailure {
|
||||
reason: "conflicts in server/src/main.rs".into(),
|
||||
};
|
||||
let result = transition(s, PipelineEvent::Unblock).unwrap();
|
||||
assert!(
|
||||
matches!(result, Stage::Coding),
|
||||
"MergeFailure + Unblock should return to Coding for immediate retry, got: {result:?}"
|
||||
);
|
||||
}
|
||||
|
||||
/// AC1 (complement): `MergeFailure + Demote` still goes to `Backlog` for manual parking.
|
||||
#[test]
|
||||
fn merge_failure_demote_returns_to_backlog() {
|
||||
let s = Stage::MergeFailure {
|
||||
reason: "conflicts".into(),
|
||||
};
|
||||
let result = transition(s, PipelineEvent::Demote).unwrap();
|
||||
assert!(
|
||||
matches!(result, Stage::Backlog),
|
||||
"MergeFailure + Demote should park the story in Backlog, got: {result:?}"
|
||||
);
|
||||
}
|
||||
|
||||
// ── Story 892: MergeFailure → Done (manual recovery) ───────────────
|
||||
|
||||
/// Regression test (story 892): `accept_story` on a story in `MergeFailure`
|
||||
|
||||
@@ -242,8 +242,17 @@ pub fn transition(state: Stage, event: PipelineEvent) -> Result<Stage, Transitio
|
||||
// ── Unblock: Blocked → Coding ─────────────────────────────────
|
||||
(Blocked { .. }, Unblock) => Ok(Coding),
|
||||
|
||||
// ── Unblock MergeFailure → Backlog ───────────────────────────────
|
||||
(MergeFailure { .. }, Unblock) => Ok(Backlog),
|
||||
// ── Unblock MergeFailure → Coding (retry) ────────────────────────
|
||||
// `unblock_story` on a failed merge re-enters the coding stage so a
|
||||
// coder agent can rework the branch, rather than routing back through
|
||||
// the backlog (which would require an extra DepsMet promotion step).
|
||||
(MergeFailure { .. }, Unblock) => Ok(Coding),
|
||||
|
||||
// ── Demote MergeFailure → Backlog (manual parking) ───────────────
|
||||
// Lets operators park a failed-merge story in the backlog without an
|
||||
// agent retry. Complements `Unblock` (→ Coding) which triggers an
|
||||
// immediate retry by a coder agent.
|
||||
(MergeFailure { .. }, Demote) => Ok(Backlog),
|
||||
|
||||
// ── Legacy unblock: Archived(Blocked|MergeFailed) → Backlog ──
|
||||
(
|
||||
|
||||
@@ -108,7 +108,8 @@ pub enum Stage {
|
||||
|
||||
/// Merge pipeline failed (conflicts or gate failures). Story is held here
|
||||
/// awaiting human intervention or retry. Unlike `Archived(MergeFailed)`,
|
||||
/// this is a recoverable intermediate state — `Unblock` returns to `Backlog`.
|
||||
/// this is a recoverable intermediate state — `Unblock` returns to `Coding`
|
||||
/// (immediate agent retry) and `Demote` returns to `Backlog` (manual park).
|
||||
MergeFailure { reason: String },
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user