story-kit: accept 96_story_reset_agent_lozenge_to_idle_state_when_returning_to_roster
This commit is contained in:
@@ -51,7 +51,7 @@ system_prompt = "You are a supervisor agent. Read CLAUDE.md and .story_kit/READM
|
||||
[[agent]]
|
||||
name = "coder-1"
|
||||
role = "Full-stack engineer. Implements features across all components."
|
||||
model = "claude-sonnet-4-5-20241022"
|
||||
model = "sonnet"
|
||||
max_turns = 50
|
||||
max_budget_usd = 5.00
|
||||
prompt = "You are working in a git worktree on story {{story_id}}. Read CLAUDE.md first, then .story_kit/README.md to understand the dev process. The story details are in your prompt above. Follow the SDTW process through implementation and verification (Steps 1-3). The worktree and feature branch already exist - do not create them. Check .mcp.json for MCP tools. Do NOT accept the story or merge - commit your work and stop. If the user asks to review your changes, tell them to run: cd \"{{worktree_path}}\" && git difftool {{base_branch}}...HEAD\n\nIMPORTANT: Commit all your work before your process exits. The server will automatically run acceptance gates (cargo clippy + tests) when your process exits and advance the pipeline based on the results."
|
||||
@@ -60,7 +60,7 @@ system_prompt = "You are a full-stack engineer working autonomously in a git wor
|
||||
[[agent]]
|
||||
name = "coder-2"
|
||||
role = "Full-stack engineer. Implements features across all components."
|
||||
model = "claude-sonnet-4-5-20241022"
|
||||
model = "sonnet"
|
||||
max_turns = 50
|
||||
max_budget_usd = 5.00
|
||||
prompt = "You are working in a git worktree on story {{story_id}}. Read CLAUDE.md first, then .story_kit/README.md to understand the dev process. The story details are in your prompt above. Follow the SDTW process through implementation and verification (Steps 1-3). The worktree and feature branch already exist - do not create them. Check .mcp.json for MCP tools. Do NOT accept the story or merge - commit your work and stop. If the user asks to review your changes, tell them to run: cd \"{{worktree_path}}\" && git difftool {{base_branch}}...HEAD\n\nIMPORTANT: Commit all your work before your process exits. The server will automatically run acceptance gates (cargo clippy + tests) when your process exits and advance the pipeline based on the results."
|
||||
@@ -69,7 +69,7 @@ system_prompt = "You are a full-stack engineer working autonomously in a git wor
|
||||
[[agent]]
|
||||
name = "coder-3"
|
||||
role = "Full-stack engineer. Implements features across all components."
|
||||
model = "claude-sonnet-4-5-20241022"
|
||||
model = "sonnet"
|
||||
max_turns = 50
|
||||
max_budget_usd = 5.00
|
||||
prompt = "You are working in a git worktree on story {{story_id}}. Read CLAUDE.md first, then .story_kit/README.md to understand the dev process. The story details are in your prompt above. Follow the SDTW process through implementation and verification (Steps 1-3). The worktree and feature branch already exist - do not create them. Check .mcp.json for MCP tools. Do NOT accept the story or merge - commit your work and stop. If the user asks to review your changes, tell them to run: cd \"{{worktree_path}}\" && git difftool {{base_branch}}...HEAD\n\nIMPORTANT: Commit all your work before your process exits. The server will automatically run acceptance gates (cargo clippy + tests) when your process exits and advance the pipeline based on the results."
|
||||
@@ -87,7 +87,7 @@ system_prompt = "You are a senior full-stack engineer working autonomously in a
|
||||
[[agent]]
|
||||
name = "qa"
|
||||
role = "Reviews coder work in worktrees: runs quality gates, generates testing plans, and reports findings."
|
||||
model = "claude-sonnet-4-5-20241022"
|
||||
model = "sonnet"
|
||||
max_turns = 40
|
||||
max_budget_usd = 4.00
|
||||
prompt = """You are the QA agent for story {{story_id}}. Your job is to review the coder's work in the worktree and produce a structured QA report.
|
||||
@@ -153,7 +153,7 @@ system_prompt = "You are a QA agent. Your job is read-only: review code quality,
|
||||
[[agent]]
|
||||
name = "mergemaster"
|
||||
role = "Merges completed coder work into master, runs quality gates, archives stories, and cleans up worktrees."
|
||||
model = "claude-sonnet-4-5-20241022"
|
||||
model = "sonnet"
|
||||
max_turns = 30
|
||||
max_budget_usd = 3.00
|
||||
prompt = """You are the mergemaster agent for story {{story_id}}. Your job is to merge the completed coder work into master using the merge_agent_work MCP tool.
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
---
|
||||
name: "Persistent per-session agent logs"
|
||||
---
|
||||
|
||||
# Story 89: Persistent per-session agent logs
|
||||
|
||||
## User Story
|
||||
|
||||
As a user, I want each agent session to write its output to a persistent log file so I can inspect what an agent did after it completes, even across server restarts.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] Each agent session writes output to a log file at .story_kit/logs/{story_id}/{agent_name}-{session_id}.log
|
||||
- [ ] Log files persist across server restarts and agent completions
|
||||
- [ ] The get_agent_output MCP tool falls back to reading the log file when the in-memory stream is empty or the agent has completed
|
||||
- [ ] Log files include timestamps, tool calls, text output, and status events
|
||||
- [ ] Different sessions for the same agent on the same story produce separate log files (no mixing)
|
||||
|
||||
## Out of Scope
|
||||
|
||||
- TBD
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
name: "Persistent per-session agent logs"
|
||||
---
|
||||
|
||||
# Story 89: Persistent per-session agent logs
|
||||
|
||||
## User Story
|
||||
|
||||
As a user, I want each agent session to write its output to a persistent log file so I can inspect what an agent did after it completes, even across server restarts.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] Each agent session writes output to a log file at .story_kit/logs/{story_id}/{agent_name}-{session_id}.log
|
||||
- [ ] Log files persist across server restarts and agent completions
|
||||
- [ ] The get_agent_output MCP tool falls back to reading the log file when the in-memory stream is empty or the agent has completed
|
||||
- [ ] Log files include timestamps, tool calls, text output, and status events
|
||||
- [ ] Different sessions for the same agent on the same story produce separate log files (no mixing)
|
||||
|
||||
## Test Plan
|
||||
|
||||
### Unit Tests (server/src/agent_log.rs)
|
||||
|
||||
1. **test_log_writer_creates_directory_and_file** — AC1: Verify `AgentLogWriter::new()` creates `.story_kit/logs/{story_id}/` and the log file `{agent_name}-{session_id}.log`.
|
||||
2. **test_log_writer_writes_jsonl_with_timestamps** — AC4: Verify `write_event()` writes valid JSONL with ISO 8601 timestamps including type, data, and timestamp fields.
|
||||
3. **test_read_log_parses_written_events** — AC3/AC4: Verify `read_log()` can round-trip events written by `write_event()`.
|
||||
4. **test_separate_sessions_produce_separate_files** — AC5: Verify two `AgentLogWriter` instances for the same story_id+agent_name but different session_ids write to different files without mixing.
|
||||
5. **test_find_latest_log_returns_most_recent** — AC3: Verify `find_latest_log()` returns the correct most-recent log for a given story_id+agent_name pair.
|
||||
6. **test_log_files_persist_on_disk** — AC2: Verify that after writer is dropped, the file still exists and is readable.
|
||||
|
||||
### Unit Tests (server/src/agents.rs)
|
||||
|
||||
7. **test_emit_event_writes_to_log_writer** — AC1/AC4: Verify that `emit_event` with a log writer writes to the log file in addition to broadcast+event_log.
|
||||
|
||||
### Integration Tests (server/src/http/mcp.rs)
|
||||
|
||||
8. **test_get_agent_output_falls_back_to_log_file** — AC3: Verify that when in-memory events are empty and agent is completed, `get_agent_output` reads from the log file.
|
||||
|
||||
## Out of Scope
|
||||
|
||||
- Log rotation or cleanup of old log files
|
||||
- Frontend UI for viewing log files
|
||||
- Log file compression
|
||||
Reference in New Issue
Block a user