Commit Graph

21 Commits

Author SHA1 Message Date
Dave
f3a4d2f258 Adding stage to project.toml 2026-02-24 14:59:20 +00:00
Dave
8005397fd5 story-kit: merge 135_story_update_mergemaster_prompt_to_allow_conflict_resolution_and_code_fixes 2026-02-24 12:22:42 +00:00
Dave
b928eace9c story-kit: merge 119_story_mergemaster_should_resolve_merge_conflicts_instead_of_leaving_conflict_markers_on_master 2026-02-23 23:22:24 +00:00
Dave
2a5862c59d Replace coder-3 with qa-2 to reduce QA bottleneck
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 22:16:46 +00:00
Dave
bed46fea1b story-kit: accept 96_story_reset_agent_lozenge_to_idle_state_when_returning_to_roster 2026-02-23 20:52:06 +00:00
Dave
d1d7ce47ac Switch all Sonnet agents from 4.6 to 4.5 for speed
Sonnet 4.6 is too slow for small stories — agents burn through turns
without completing. Reverting coders, QA, and mergemaster to Sonnet 4.5.
Supervisor and coder-opus remain on Opus.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 19:50:10 +00:00
Dave
3f008b7777 Fix invalid model names and preserve worktrees for debugging
model = "sonnet-4.6" is not a valid Claude CLI model identifier,
causing all coder/qa/mergemaster agents to get 404 errors from the
API and exit immediately with no work done. Change to
"claude-sonnet-4-6". Also disable automatic worktree cleanup on
archive so agent work can be inspected post-mortem.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 18:05:26 +00:00
Dave
2eb5bfb8fe Sparse checkout excludes .story_kit/work/ from agent worktrees
Configures sparse checkout on new and existing worktrees to exclude
the pipeline state directory. This prevents feature branches from
containing .story_kit/work/ file moves that cause rename/delete merge
conflicts when merging back to master.

Also removes "pick up the story from .story_kit/work/" instruction
from agent prompts since the story content is already in the prompt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:36:15 +00:00
Dave
0a404a7b88 Update sonnet agents to sonnet-4.6
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:22:33 +00:00
Dave
eaa3453395 Add coder-opus agent to project.toml
Adds an opus-tier coder agent for complex tasks requiring deep
architectural understanding (80 max turns, $20 budget).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:18:29 +00:00
Dave
9bd266eb3f Server-owned agent completion: remove report_completion dependency
When an agent process exits normally, the server now automatically runs
acceptance gates (uncommitted changes check + cargo clippy + tests) and
advances the pipeline based on results. This replaces the previous model
where agents had to explicitly call report_completion as an MCP tool.

Changes:
- Add run_server_owned_completion() free function in agents.rs that runs
  gates on process exit, stores a CompletionReport, and advances pipeline
- Wire it into start_agent's spawned task (replaces simple status setting)
- Remove report_completion from MCP tools list and handler (mcp.rs)
- Update default_agent_prompt() to not reference report_completion
- Update all agent prompts in project.toml (supervisor, coders, qa,
  mergemaster) to reflect server-owned completion
- Add guard: skip gates if completion was already recorded (legacy path)
- Add 4 new tests for server-owned completion behavior
- Update tools_list test (26 tools, report_completion excluded)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:00:10 +00:00
Dave
122f481ab9 Story 53: Add QA agent role with request_qa MCP tool
- Add `qa` agent entry to `.story_kit/project.toml` with a detailed
  prompt covering code quality scan, test verification, manual testing
  support, and structured report generation
- Add `move_story_to_qa` function in `agents.rs` that moves a work item
  from `work/2_current/` to `work/3_qa/` and auto-commits (idempotent)
- Add `request_qa` MCP tool in `mcp.rs` that moves the story to
  `work/3_qa/` and starts the QA agent on the existing worktree
- Add unit tests for `move_story_to_qa` (moves, idempotent, error cases)
- Update `tools_list_returns_all_tools` test to expect 27 tools

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 17:45:43 +00:00
Dave
9dab18d597 Story 52: Mergemaster agent role with merge_agent_work MCP tool
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 17:36:35 +00:00
Dave
e1e0d49759 Story 60: Status-Based Directory Layout with work/ pipeline
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 17:17:12 +00:00
Dave
1b71449dd0 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>
2026-02-20 15:02:34 +00:00
Dave
f6f4d84c54 Add coder-3 agent to project config
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:37:10 +00:00
Dave
39b67ff754 Story 33: Copy-paste diff commands for agent worktrees
- Add base_branch detection to WorktreeInfo (from project root HEAD)
- Expose base_branch in AgentInfo API response
- Add {{base_branch}} template variable to agent config rendering
- Show git difftool command with copy-to-clipboard in AgentPanel UI
- Add diff command instruction to coder agent prompts
- Add AgentPanel tests for diff command rendering and clipboard

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:48:50 +00:00
Dave
1064b50f86 Update agent prompts: read README, commit work, tiered acceptance
- Supervisor reads CLAUDE.md and README before coordinating
- Coders commit their work before finishing
- All agents stop at "gates green" - never accept or merge
- Human always does final acceptance and merge to master

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:42:19 +00:00
Dave
db2d055f60 Spike 3: Sub-agent infrastructure fixes for multi-agent coordination
- Fix CLAUDECODE env var blocking nested Claude Code sessions
- Add drain-based event_log for reliable get_agent_output polling
- Add non-SSE get_agent_output fallback (critical for MCP tool calls)
- Preserve worktrees on agent stop instead of destroying work
- Reap zombie processes with child.wait() after kill
- Increase broadcast buffer from 256 to 1024
- Engineer supervisor and coder prompts in project.toml
- Point .mcp.json to test port 3002

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 12:14:36 +00:00
Dave
6d57b06636 Accept story 34: Per-Project Agent Configuration and Role Definitions
Replace single [agent] config with multi-agent [[agent]] roster system.
Each agent has name, role, model, allowed_tools, max_turns, max_budget_usd,
and system_prompt fields that map to Claude CLI flags at spawn time.

- AgentConfig expanded with structured fields, validated at startup (panics
  on duplicate names, empty names, non-positive budgets/turns)
- Backwards-compatible: legacy [agent] format auto-wraps with deprecation warning
- AgentPool uses composite "story_id:agent_name" keys for concurrent agents
- agent_name added to AgentEvent variants, AgentInfo, start/stop/subscribe APIs
- GET /agents/config returns roster, POST /agents/config/reload hot-reloads
- POST /agents/start accepts optional agent_name, /agents/stop requires it
- SSE route updated to /agents/:story_id/:agent_name/stream
- Frontend: roster badges, agent selector dropdown, composite-key state
- Project root initialized to cwd at startup so config endpoints work immediately

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 18:46:14 +00:00
Dave
5e5cdd9b2f Accept story 30: Worktree-based agent orchestration
Add git worktree isolation for concurrent story agents. Each agent now
runs in its own worktree with setup/teardown commands driven by
.story_kit/project.toml config. Agents stream output via SSE and support
start/stop lifecycle with Pending/Running/Completed/Failed statuses.

Backend: config.rs (TOML parsing), worktree.rs (git worktree lifecycle),
refactored agents.rs (broadcast streaming), agents_sse.rs (SSE endpoint).
Frontend: AgentPanel.tsx with Run/Stop buttons and streaming output log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:58:53 +00:00