Commit Graph

38 Commits

Author SHA1 Message Date
Dave
9352443555 story-kit: merge 247_story_human_qa_gate_with_rejection_flow 2026-03-18 15:47:48 +00:00
Dave
e8ec84668f story-kit: merge 284_story_matrix_bot_status_command_shows_pipeline_and_agent_availability 2026-03-18 15:22:19 +00:00
Dave
10a5bea2b1 story-kit: merge 275_story_matrix_bot_surfaces_claude_code_permission_prompts_to_chat 2026-03-18 09:32:17 +00:00
Dave
901f7a65d3 story-kit: merge 270_bug_qa_test_server_overwrites_root_mcp_json_with_wrong_port 2026-03-17 18:16:13 +00:00
Dave
a4affca9be story-kit: merge 261_story_bot_notifications_when_stories_move_between_stages 2026-03-17 14:05:02 +00:00
Dave
2148531a46 fix: auto-assign after merge, persistent server logs, remove duplicate pnpm install
- Call auto_assign_available_work at end of merge_agent_work so the next
  story gets picked up without waiting for the PTY exit handler
- Add persistent file logging to .story_kit/logs/server.log so server
  logs survive restarts
- Remove duplicate pnpm install block in run_squash_merge

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 18:24:27 +00:00
Dave
ac087f1a58 chore: add MERGE-DEBUG traces for project_root lifecycle
Temporary diagnostic logging to track why project_root becomes None
during merge pipeline operations. Tagged with MERGE-DEBUG for easy
grep-and-remove once the root cause is confirmed fixed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 17:01:38 +00:00
Dave
8e0082f6cd story-209: accept optional positional path argument on startup
Add CLI path argument support: `story-kit-server /path/to/project` opens
the given project directly (scaffolding .story_kit/ if needed) instead of
relying on auto-detection. Resolves conflict with story-208's port parameter.

Squash merge of feature/story-209

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 15:17:40 +00:00
Dave
17fd3b2dc2 story-kit: merge 208_bug_project_scaffold_does_not_write_mcp_json_to_project_root 2026-02-26 14:59:19 +00:00
Dave
2dbfd42c6e story-kit: done 199_story_web_ui_submits_all_queued_items_at_once 2026-02-26 12:16:07 +00:00
Dave
08e23e3830 feat: enable Matrix E2EE with cross-signing verification on bot
Add end-to-end encryption support to the Matrix bot using the matrix-sdk
crypto features. The bot now:
- Enables E2EE on the Matrix client with cross-signing bootstrapping
- Auto-verifies its own cross-signing identity on startup
- Handles key verification requests from other users automatically
- Sends encrypted messages in E2EE-enabled rooms
- Adds MATRIX_STORE_PATH config for persistent crypto store

Squash merge of feature/story-194_story_enable_matrix_e2ee_with_cross_signing_verification_on_bot

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-26 10:41:29 +00:00
Dave
ebcd627a45 Fix: remove agent from pool immediately on completion and add Matrix bot user allowlist 2026-02-25 14:59:20 +00:00
Dave
a1d25d756b story-kit: merge 183_story_refactor_matrix_bot_to_use_claude_code_provider_instead_of_direct_anthropic_api 2026-02-25 12:42:11 +00:00
Dave
dc631d1933 story-kit: merge 149_bug_web_ui_does_not_update_when_agents_are_started_or_stopped 2026-02-24 23:09:13 +00:00
Dave
e6662c8f8e story-kit: merge 159_bug_server_restart_leaves_orphaned_claude_code_pty_processes_running 2026-02-24 17:56:40 +00:00
Dave
fb91096b09 story-kit: merge 161_bug_auto_assign_only_triggers_on_agent_completion_not_on_failure_or_periodically 2026-02-24 17:28:45 +00:00
Dave
6170a7d984 story-kit: merge 133_story_clean_up_agent_state_on_story_archive_and_add_ttl_for_completed_entries 2026-02-24 13:20:59 +00:00
Dave
560c731869 story-kit: merge 134_story_add_process_health_monitoring_and_timeout_to_agent_pty_sessions 2026-02-24 13:13:16 +00:00
Dave
85fddcb71a story-kit: merge 117_story_show_startup_reconciliation_progress_in_ui 2026-02-23 22:50:57 +00:00
Dave
3087297b88 story-kit: merge 91_bug_permissions_dialog_never_triggers_in_web_ui 2026-02-23 21:38:45 +00:00
Dave
a0f317292c story-kit: merge 93_story_expose_server_logs_to_agents_via_mcp
Adds log_buffer ring buffer and slog! macro for in-memory server log
capture, plus get_server_logs MCP tool for agents to read recent logs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 20:53:37 +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
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
cd902ff219 story-kit: merge 94_bug_stale_agent_state_persists_after_server_restart 2026-02-23 20:38:17 +00:00
Dave
225073649b story-kit: start 88_story_auto_assign_agents_to_available_work_on_server_startup 2026-02-23 18:20:24 +00:00
Dave
1487092216 Refactored a few things from main into modules 2026-02-23 11:39:22 +00:00
Dave
810608d3d8 Spike 61: filesystem watcher and UI simplification
Add notify-based filesystem watcher for .story_kit/work/ that
auto-commits changes with deterministic messages and broadcasts
events over WebSocket. Push full pipeline state (Upcoming, Current,
QA, To Merge) to frontend on connect and after every watcher event.

Strip dead UI: remove ReviewPanel, GatePanel, TodoPanel,
UpcomingPanel and all associated REST polling. Replace with 4
generic StagePanel components driven by WebSocket. Simplify
AgentPanel to roster-only.

Delete all 11 workflow HTTP endpoints and 16 request/response types
from the server. Clean dead code from workflow module. MCP tools
call Rust functions directly and need none of the HTTP layer.

Net: ~4,100 lines deleted, ~400 added.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 19:39:19 +00:00
Dave
91534b4a59 Accept story 38: Auto-Open Project on Server Startup
Server detects .story_kit/ in cwd or parent directories at startup and
automatically opens the project. MCP tools work immediately without
manual project-open step. Falls back to cwd when no .story_kit/ found.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:11:53 +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
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
Dave
e54209eb5a Story 32: Multi-Instance Worktree Support
Add configurable port via STORYKIT_PORT env var (default 3001). Server
prints machine-readable STORYKIT_PORT=<port> on startup and writes
.story_kit_port file for discovery. Frontend proxy and WebSocket read
VITE_STORYKIT_PORT env var instead of hardcoding port 3001.

7 new tests (4 backend, 3 frontend) all passing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 17:14:33 +00:00
Dave
f17cd63d2f Revert spike ports to 3001/5173, add stories 32 and 33
Reverts port changes made during the spike back to default (3001/5173).
Adds two new stories for multi-worktree support: dynamic port management
(story 32) and worktree diff inspection with editor integration (story 33).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:30:23 +00:00
Dave
68a19c393e Spike: PTY-based Claude Code integration with multi-agent concurrency
Proves that spawning `claude -p` in a pseudo-terminal from Rust gets Max
subscription billing (apiKeySource: "none", rateLimitType: "five_hour")
instead of per-token API charges. Concurrent agents run in parallel PTY
sessions with session resumption via --resume for multi-turn conversations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 15:25:22 +00:00
Dave
013b28d77f Story 26: Establish TDD workflow and quality gates
Add workflow engine with acceptance gates, test recording, and review
queue. Frontend displays gate status (blocked/ready), test summaries,
failing badges, and warnings. Proceed action is disabled when gates
are not met. Includes 13 unit tests (Vitest) and 9 E2E tests
(Playwright) covering all five acceptance criteria.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 12:54:04 +00:00
Dave
2bb987d629 Happier startup message 2026-02-16 17:10:23 +00:00
Dave
5923165fcf Refactoring the structure a bit 2026-02-16 16:24:21 +00:00
Dave
0876c53e17 moved from tauri to a server with embedded UI 2026-02-13 12:31:36 +00:00