Story 44: Agent Completion Report via MCP

- report_completion MCP tool for agents to signal done
- Rejects if worktree has uncommitted changes
- Runs acceptance gates (clippy, tests) automatically
- Stores completion status on agent record
- 10 new tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-20 15:02:34 +00:00
parent 679370e48a
commit 1b71449dd0
5 changed files with 464 additions and 18 deletions

View File

@@ -59,7 +59,11 @@ fn default_agent_command() -> String {
}
fn default_agent_prompt() -> String {
"Read .story_kit/README.md, then pick up story {{story_id}}".to_string()
"You are working in a git worktree on story {{story_id}}. \
Read .story_kit/README.md to understand the dev process, then pick up the story. \
When all work is committed, call report_completion with story_id='{{story_id}}', \
agent_name='{{agent_name}}', and a brief summary as your final action."
.to_string()
}
/// Legacy config format with `agent` as an optional single table (`[agent]`).
@@ -187,10 +191,12 @@ impl ProjectConfig {
};
let bb = base_branch.unwrap_or("master");
let aname = agent.name.as_str();
let render = |s: &str| {
s.replace("{{worktree_path}}", worktree_path)
.replace("{{story_id}}", story_id)
.replace("{{base_branch}}", bb)
.replace("{{agent_name}}", aname)
};
let command = render(&agent.command);