story-kit: merge 151_story_split_archived_into_done_and_archived_with_time_based_promotion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -61,7 +61,7 @@ struct WorktreeListEntry {
|
||||
path: String,
|
||||
}
|
||||
|
||||
/// Returns true if the story file exists in `work/5_archived/`.
|
||||
/// Returns true if the story file exists in `work/5_done/` or `work/6_archived/`.
|
||||
///
|
||||
/// Used to exclude agents for already-archived stories from the `list_agents`
|
||||
/// response so the agents panel is not cluttered with old completed items on
|
||||
@@ -139,7 +139,7 @@ impl AgentsApi {
|
||||
|
||||
/// List all agents with their status.
|
||||
///
|
||||
/// Agents for stories that have been archived (`work/5_archived/`) are
|
||||
/// Agents for stories that have been completed (`work/5_done/` or `work/6_archived/`) are
|
||||
/// excluded so the agents panel is not cluttered with old completed items
|
||||
/// on frontend startup.
|
||||
#[oai(path = "/agents", method = "get")]
|
||||
|
||||
@@ -586,7 +586,7 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
|
||||
},
|
||||
{
|
||||
"name": "accept_story",
|
||||
"description": "Accept a story: moves it from current/ to archived/ and auto-commits to master.",
|
||||
"description": "Accept a story: moves it from current/ to done/ and auto-commits to master.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -693,7 +693,7 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
|
||||
},
|
||||
{
|
||||
"name": "merge_agent_work",
|
||||
"description": "Trigger the mergemaster pipeline for a completed story: squash-merge the feature branch into master, run quality gates (cargo clippy, cargo test, pnpm build, pnpm test), archive the story from work/4_merge/ or work/2_current/ to work/5_archived/, and clean up the worktree and branch. Reports success/failure with details including any conflicts found and gate output.",
|
||||
"description": "Trigger the mergemaster pipeline for a completed story: squash-merge the feature branch into master, run quality gates (cargo clippy, cargo test, pnpm build, pnpm test), move the story from work/4_merge/ or work/2_current/ to work/5_done/, and clean up the worktree and branch. Reports success/failure with details including any conflicts found and gate output.",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -1301,7 +1301,7 @@ fn tool_accept_story(args: &Value, ctx: &AppContext) -> Result<String, String> {
|
||||
ctx.agents.remove_agents_for_story(story_id);
|
||||
|
||||
Ok(format!(
|
||||
"Story '{story_id}' accepted, moved to archived/, and committed to master."
|
||||
"Story '{story_id}' accepted, moved to done/, and committed to master."
|
||||
))
|
||||
}
|
||||
|
||||
@@ -2251,7 +2251,7 @@ mod tests {
|
||||
let result = tool_close_bug(&json!({"bug_id": "1_bug_crash"}), &ctx).unwrap();
|
||||
assert!(result.contains("1_bug_crash"));
|
||||
assert!(!bug_file.exists());
|
||||
assert!(tmp.path().join(".story_kit/work/5_archived/1_bug_crash.md").exists());
|
||||
assert!(tmp.path().join(".story_kit/work/5_done/1_bug_crash.md").exists());
|
||||
}
|
||||
|
||||
// ── Spike lifecycle tool tests ─────────────────────────────────────────
|
||||
|
||||
@@ -505,7 +505,7 @@ fn next_item_number(root: &std::path::Path) -> Result<u32, String> {
|
||||
let work_base = root.join(".story_kit").join("work");
|
||||
let mut max_num: u32 = 0;
|
||||
|
||||
for subdir in &["1_upcoming", "2_current", "3_qa", "4_merge", "5_archived"] {
|
||||
for subdir in &["1_upcoming", "2_current", "3_qa", "4_merge", "5_done", "6_archived"] {
|
||||
let dir = work_base.join(subdir);
|
||||
if !dir.exists() {
|
||||
continue;
|
||||
@@ -869,7 +869,7 @@ mod tests {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let upcoming = tmp.path().join(".story_kit/work/1_upcoming");
|
||||
let current = tmp.path().join(".story_kit/work/2_current");
|
||||
let archived = tmp.path().join(".story_kit/work/5_archived");
|
||||
let archived = tmp.path().join(".story_kit/work/5_done");
|
||||
fs::create_dir_all(&upcoming).unwrap();
|
||||
fs::create_dir_all(¤t).unwrap();
|
||||
fs::create_dir_all(&archived).unwrap();
|
||||
@@ -1116,7 +1116,7 @@ mod tests {
|
||||
fn next_item_number_scans_archived_too() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let upcoming = tmp.path().join(".story_kit/work/1_upcoming");
|
||||
let archived = tmp.path().join(".story_kit/work/5_archived");
|
||||
let archived = tmp.path().join(".story_kit/work/5_done");
|
||||
fs::create_dir_all(&upcoming).unwrap();
|
||||
fs::create_dir_all(&archived).unwrap();
|
||||
fs::write(archived.join("5_bug_old.md"), "").unwrap();
|
||||
@@ -1134,7 +1134,7 @@ mod tests {
|
||||
fn list_bug_files_excludes_archive_subdir() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let upcoming_dir = tmp.path().join(".story_kit/work/1_upcoming");
|
||||
let archived_dir = tmp.path().join(".story_kit/work/5_archived");
|
||||
let archived_dir = tmp.path().join(".story_kit/work/5_done");
|
||||
fs::create_dir_all(&upcoming_dir).unwrap();
|
||||
fs::create_dir_all(&archived_dir).unwrap();
|
||||
fs::write(upcoming_dir.join("1_bug_open.md"), "# Bug 1: Open Bug\n").unwrap();
|
||||
|
||||
Reference in New Issue
Block a user