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
2026-02-19 12:58:40 +00:00

Living Spec Standalone (Web Server Binary)

This app runs as a single Rust web server binary that serves the Vite/React frontend and exposes APIs. The frontend lives in the frontend/ directory.

You can also run the frontend and backend separately in development (Vite dev server + Rust API).

Running it in development

# Build the frontend
cd frontend
pnpm install 
pnpm dev

# Run the server (serves embedded frontend/dist/)
cargo run

Production

# Build the release binary (also builds the frontend via build.rs)
cargo build --release

# Run the server (serves embedded frontend/dist/)
./target/release/story-kit-server

Testing

Frontend Tests

The frontend uses Vitest for unit tests and Playwright for end-to-end tests.

cd frontend

# Run unit tests
pnpm test

# Run end-to-end tests
pnpm test:e2e

Backend Tests

This project uses nextest for running tests and cargo-llvm-cov for code coverage.

Install Tools

cargo install cargo-nextest cargo-llvm-cov

Run Tests

# Run all tests
cargo nextest run

# Run specific module
cargo nextest run search_files

# Run with verbose output
cargo nextest run --no-capture

Generate Coverage

# HTML report (opens in browser)
cargo llvm-cov nextest --html --open

# Terminal output
cargo llvm-cov nextest

# LCOV format (for CI)
cargo llvm-cov nextest --lcov --output-path lcov.info

# Clean coverage data
cargo llvm-cov clean

Configuration

  • Nextest config: .config/nextest.toml
  • Coverage output: target/llvm-cov/html/index.html

Current Coverage (search_files module)

Module: commands/search.rs
├── Region Coverage:   75.36%
├── Function Coverage: 69.05%
└── Line Coverage:     72.55%

Available Test Profiles

# Development (default)
cargo nextest run

# CI with retries
cargo nextest run --profile ci

# Coverage optimized
cargo nextest run --profile coverage
Description
No description provided
Readme 9.3 MiB
v0.4.1 Latest
2026-03-20 12:58:04 +00:00
Languages
Rust 79.9%
TypeScript 19%
Shell 0.6%
Dockerfile 0.3%
CSS 0.2%