story-kit: merge 287_story_rename_upcoming_pipeline_stage_to_backlog
This commit is contained in:
@@ -212,7 +212,7 @@ impl AgentPool {
|
||||
let event_log: Arc<Mutex<Vec<AgentEvent>>> = Arc::new(Mutex::new(Vec::new()));
|
||||
let log_session_id = uuid::Uuid::new_v4().to_string();
|
||||
|
||||
// Move story from upcoming/ to current/ before checking agent
|
||||
// Move story from backlog/ to current/ before checking agent
|
||||
// availability so that auto_assign_available_work can pick it up even
|
||||
// when all coders are currently busy (story 203). This is idempotent:
|
||||
// if the story is already in 2_current/ or a later stage, the call is
|
||||
@@ -1430,7 +1430,7 @@ impl AgentPool {
|
||||
///
|
||||
/// Scans `work/2_current/`, `work/3_qa/`, and `work/4_merge/` for items that have no
|
||||
/// active agent and assigns the first free agent of the appropriate role. Items in
|
||||
/// `work/1_upcoming/` are never auto-started.
|
||||
/// `work/1_backlog/` are never auto-started.
|
||||
///
|
||||
/// Respects the configured agent roster: the maximum number of concurrently active agents
|
||||
/// per role is bounded by the count of agents of that role defined in `project.toml`.
|
||||
@@ -1603,7 +1603,7 @@ impl AgentPool {
|
||||
// Determine which active stage the story is in.
|
||||
let stage_dir = match find_active_story_stage(project_root, story_id) {
|
||||
Some(s) => s,
|
||||
None => continue, // Not in any active stage (upcoming/archived or unknown).
|
||||
None => continue, // Not in any active stage (backlog/archived or unknown).
|
||||
};
|
||||
|
||||
// 4_merge/ is left for auto_assign to handle with a fresh mergemaster.
|
||||
@@ -2728,8 +2728,8 @@ mod tests {
|
||||
fs::write(current.join("173_story_test.md"), "test").unwrap();
|
||||
// Ensure 3_qa/ exists for the move target
|
||||
fs::create_dir_all(root.join(".story_kit/work/3_qa")).unwrap();
|
||||
// Ensure 1_upcoming/ exists (start_agent calls move_story_to_current)
|
||||
fs::create_dir_all(root.join(".story_kit/work/1_upcoming")).unwrap();
|
||||
// Ensure 1_backlog/ exists (start_agent calls move_story_to_current)
|
||||
fs::create_dir_all(root.join(".story_kit/work/1_backlog")).unwrap();
|
||||
|
||||
// Write a project.toml with a qa agent so start_agent can resolve it.
|
||||
fs::create_dir_all(root.join(".story_kit")).unwrap();
|
||||
@@ -3498,14 +3498,14 @@ stage = "coder"
|
||||
}
|
||||
|
||||
/// Story 203: when all coders are busy the story file must be moved from
|
||||
/// 1_upcoming/ to 2_current/ so that auto_assign_available_work can pick
|
||||
/// 1_backlog/ to 2_current/ so that auto_assign_available_work can pick
|
||||
/// it up once a coder finishes.
|
||||
#[tokio::test]
|
||||
async fn start_agent_moves_story_to_current_when_coders_busy() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let sk = tmp.path().join(".story_kit");
|
||||
let upcoming = sk.join("work/1_upcoming");
|
||||
std::fs::create_dir_all(&upcoming).unwrap();
|
||||
let backlog = sk.join("work/1_backlog");
|
||||
std::fs::create_dir_all(&backlog).unwrap();
|
||||
std::fs::write(
|
||||
sk.join("project.toml"),
|
||||
r#"
|
||||
@@ -3515,9 +3515,9 @@ stage = "coder"
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
// Place the story in 1_upcoming/.
|
||||
// Place the story in 1_backlog/.
|
||||
std::fs::write(
|
||||
upcoming.join("story-3.md"),
|
||||
backlog.join("story-3.md"),
|
||||
"---\nname: Story 3\n---\n",
|
||||
)
|
||||
.unwrap();
|
||||
@@ -3547,10 +3547,10 @@ stage = "coder"
|
||||
current_path.exists(),
|
||||
"story should be in 2_current/ after busy error, but was not"
|
||||
);
|
||||
let upcoming_path = upcoming.join("story-3.md");
|
||||
let backlog_path = backlog.join("story-3.md");
|
||||
assert!(
|
||||
!upcoming_path.exists(),
|
||||
"story should no longer be in 1_upcoming/"
|
||||
!backlog_path.exists(),
|
||||
"story should no longer be in 1_backlog/"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3774,7 +3774,7 @@ stage = "coder"
|
||||
|
||||
// Create the story in upcoming so `move_story_to_current` succeeds,
|
||||
// but do NOT init a git repo — `create_worktree` will fail in the spawn.
|
||||
let upcoming = root.join(".story_kit/work/1_upcoming");
|
||||
let upcoming = root.join(".story_kit/work/1_backlog");
|
||||
fs::create_dir_all(&upcoming).unwrap();
|
||||
fs::write(
|
||||
upcoming.join("50_story_test.md"),
|
||||
@@ -3924,7 +3924,7 @@ stage = "coder"
|
||||
let root = tmp.path().to_path_buf();
|
||||
|
||||
let sk_dir = root.join(".story_kit");
|
||||
fs::create_dir_all(sk_dir.join("work/1_upcoming")).unwrap();
|
||||
fs::create_dir_all(sk_dir.join("work/1_backlog")).unwrap();
|
||||
fs::write(
|
||||
root.join(".story_kit/project.toml"),
|
||||
"[[agent]]\nname = \"coder-1\"\n",
|
||||
@@ -3933,12 +3933,12 @@ stage = "coder"
|
||||
// Both stories must exist in upcoming so move_story_to_current can run
|
||||
// (only the winner reaches that point, but we set both up defensively).
|
||||
fs::write(
|
||||
root.join(".story_kit/work/1_upcoming/86_story_foo.md"),
|
||||
root.join(".story_kit/work/1_backlog/86_story_foo.md"),
|
||||
"---\nname: Foo\n---\n",
|
||||
)
|
||||
.unwrap();
|
||||
fs::write(
|
||||
root.join(".story_kit/work/1_upcoming/130_story_bar.md"),
|
||||
root.join(".story_kit/work/1_backlog/130_story_bar.md"),
|
||||
"---\nname: Bar\n---\n",
|
||||
)
|
||||
.unwrap();
|
||||
@@ -4138,14 +4138,14 @@ stage = "coder"
|
||||
let root = tmp.path();
|
||||
|
||||
let sk_dir = root.join(".story_kit");
|
||||
fs::create_dir_all(sk_dir.join("work/1_upcoming")).unwrap();
|
||||
fs::create_dir_all(sk_dir.join("work/1_backlog")).unwrap();
|
||||
fs::write(
|
||||
root.join(".story_kit/project.toml"),
|
||||
"[[agent]]\nname = \"coder-1\"\n\n[[agent]]\nname = \"coder-2\"\n",
|
||||
)
|
||||
.unwrap();
|
||||
fs::write(
|
||||
root.join(".story_kit/work/1_upcoming/99_story_baz.md"),
|
||||
root.join(".story_kit/work/1_backlog/99_story_baz.md"),
|
||||
"---\nname: Baz\n---\n",
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
Reference in New Issue
Block a user