Commit Graph

15 Commits

Author SHA1 Message Date
Dave
2dbfd42c6e story-kit: done 199_story_web_ui_submits_all_queued_items_at_once 2026-02-26 12:16:07 +00:00
Dave
ba8dde1aa8 story-kit: merge 172_bug_setup_command_failure_prevents_agent_from_starting_creating_unrecoverable_deadlock 2026-02-24 23:29:56 +00:00
Dave
9b2969fdba story-kit: merge 128_story_test_coverage_worktree_rs 2026-02-24 00:26:49 +00:00
Dave
8c6bd4cf74 feat(story-93): expose server logs to agents via get_server_logs MCP tool
- Add log_buffer module: bounded 1000-line ring buffer with push/get_recent API
- Add slog! macro: drop-in for eprintln! that also captures to ring buffer
- Replace all eprintln! calls across agents, watcher, search, chat, worktree, claude_code with slog!
- Add get_server_logs MCP tool: accepts count (1-500) and optional filter params
- 5 unit tests for log_buffer covering push/retrieve, eviction, filtering, count limits, empty buffer
- 262 tests passing, clippy clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 20:38:19 +00:00
Dave
f99d6ee287 Disable worktree isolation of .story_kit/work/ (no-op)
Both sparse checkout and skip-worktree leak state from worktrees back
to the main checkout's config/index, corrupting the working tree.
Disable the isolation for now — merge conflicts from pipeline file
moves will be handled at merge time by the mergemaster instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:47:34 +00:00
Dave
b56281c6ba Replace sparse checkout with skip-worktree for pipeline isolation
Sparse checkout (both manual config and git sparse-checkout set) kept
leaking config to the main checkout, hiding .story_kit/work/ and
breaking the IDE. Replace with git update-index --skip-worktree which
marks work files as unchanged without removing them from the worktree.
Files are present (builds work), but changes are invisible to git
(no merge conflicts).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:41:07 +00:00
Dave
3da8e19516 Fix sparse checkout leaking to main repo by using git sparse-checkout set
Replace manual git config + file write + read-tree with
`git sparse-checkout set --no-cone` which correctly isolates
sparse checkout config to the worktree without polluting the
shared .git/config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:34:45 +00:00
Dave
4240696489 Fix sparse checkout leaking from worktrees to main checkout
Use extensions.worktreeConfig + --worktree flag so core.sparseCheckout
is set per-worktree only, preventing the main checkout from losing its
.story_kit/work/ directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:55:56 +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
a9d45bbcd5 Story 42: Deterministic worktree management via REST/MCP API
Add REST and MCP endpoints for creating, listing, and removing worktrees.
Includes worktree lifecycle management and cleanup operations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:22:09 +00:00
Dave
a3c20eb4d4 Accept story 40: MCP Server Obeys STORYKIT_PORT
Agent worktrees now get a .mcp.json written with the correct port from
the running server. AgentPool receives the port at construction and
passes it through to create_worktree, which writes .mcp.json on both
new creation and reuse.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:24:35 +00:00
Dave
1eae2410f3 Fix bugs 2 and 3: agent panel expand and stale worktree references
Bug 2: Expand triangle now works when no agents are started - shows
"No agents started" message. AgentPanel moved to top of panels.

Bug 3: Run `git worktree prune` before `git worktree add` to clean
stale references from externally-deleted worktree directories.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 13:17:20 +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
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
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