Add worktree port configuration docs to STACK.md

Documents STORYKIT_PORT env var for running multiple instances
in parallel worktrees without port conflicts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dave
2026-02-20 11:37:29 +00:00
parent 8724ec1cbc
commit cff7f5fe7f

View File

@@ -110,6 +110,15 @@ To support both Remote and Local models, the system implements a `ModelProvider`
* `vitest`: Unit/component testing.
* `playwright`: End-to-end testing.
## Running the App (Worktrees & Ports)
Multiple instances can run simultaneously in different worktrees. To avoid port conflicts:
- **Backend:** Set `STORYKIT_PORT` to a unique port (default is 3001). Example: `STORYKIT_PORT=3002 cargo run`
- **Frontend:** Run `pnpm dev` from `frontend/`. It auto-selects the next unused port. It reads `STORYKIT_PORT` to know which backend to talk to, so export it before running: `export STORYKIT_PORT=3002 && cd frontend && pnpm dev`
When running in a worktree, use a port that won't conflict with the main instance (3001). Ports 3002+ are good choices.
## Safety & Sandbox
1. **Project Scope:** The application must strictly enforce that it does not read/write outside the `project_root` selected by the user.
2. **Human in the Loop:**