ef728331cfe24c46c63a17d6ea8b77071eeec8aa
Implements Story 74: agent lozenges now animate as fixed-position overlays that fly from the roster badge in AgentPanel to the story slot in StagePanel (and back when the agent is removed), satisfying all acceptance criteria. Key changes: - LozengeFlyContext.tsx (new): coordinates FLIP animations via React context. LozengeFlyProvider tracks pipeline changes, hides slot lozenges during fly-in (useLayoutEffect before paint), then creates a portal-rendered fixed-position clone that transitions from roster → slot (or reverse). z-index 9999 ensures the clone travels above all other UI elements. - AgentPanel.tsx: RosterBadge registers its DOM element with the context so fly animations know the correct start/end coordinates. - StagePanel.tsx: AgentLozenge registers its DOMRect on every render via useLayoutEffect (for fly-out) and reads pendingFlyIns to stay hidden while a fly-in clone is in flight. Added align-self: flex-start so the lozenge maintains its intrinsic width and never stretches in the panel. - Chat.tsx: right-column panels wrapped in LozengeFlyProvider. - LozengeFlyContext.test.tsx (new): 10 tests covering fixed width, fly-in/fly-out clone creation, portal placement, opacity lifecycle, and idle vs active visual distinction. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Cross-Platform Distribution
Story Kit ships as a single self-contained binary with the React frontend embedded via
rust-embed. No Rust toolchain, Node.js, or extra libraries are required on the target machine.
macOS
# Native build – no extra tools required beyond Rust + pnpm
make build-macos
# Output: target/release/story-kit-server
# Verify only system frameworks are linked (Security.framework, libSystem.B.dylib, etc.)
otool -L target/release/story-kit-server
Linux (static x86_64, zero dynamic deps)
The Linux build uses the x86_64-unknown-linux-musl target to produce a fully static binary.
Prerequisites:
# Install cross – a Rust cross-compilation tool backed by Docker
cargo install cross
# Ensure Docker Desktop (or Docker Engine) is running
Build:
make build-linux
# Output: target/x86_64-unknown-linux-musl/release/story-kit-server
# Verify the binary is statically linked
file target/x86_64-unknown-linux-musl/release/story-kit-server
# Expected: ELF 64-bit LSB executable, x86-64, statically linked
ldd target/x86_64-unknown-linux-musl/release/story-kit-server
# Expected: not a dynamic executable
Running on any Linux x86_64 machine:
# No Rust, Node, glibc, or any other library needed – just copy and run
./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