Incubator Server Setup
The Incubator is an optional, stateless FastAPI + SQLModel + Alembic server that coordinates multiple developers, repositories, and AI agents around one authoritative database (Neon PostgreSQL, MySQL 8+ / MariaDB 10.6+, or SQLite).
1. Choose & Configure Your Database (Server / Operator Only)
Section titled “1. Choose & Configure Your Database (Server / Operator Only)”Security Note — Server & Superuser Operator Secret Only:
SPECHATCH_DATABASE_URLis a server-side secret of the Incubator service itself (configured in your hosting platform’s secret manager or container runtime environment). Only the Incubator operator / superuser needs temporary local access toSPECHATCH_DATABASE_URLwhen running one-time DB-direct bootstrap (spechatch admin init) or break-glass recovery commands (spechatch admin ...). Regular developers and AI agents should NEVER setSPECHATCH_DATABASE_URL— they only storeSPECHATCH_URLand their personalSPECHATCH_API_KEY(shk_*) and communicate with the Incubator strictly over HTTPS.
spechatch normalizes database URLs automatically (postgres:// / postgresql:// → postgresql+psycopg://; mysql:// / mariadb:// → mysql+pymysql:// with the [mysql] extra) and namespaces every table with SPECHATCH_TABLE_PREFIX (default spechatch_).
# On the Incubator server (or operator machine for one-time `spechatch admin init` only):# Store in your server secret manager, or locally in ~/.config/spechatch/.env (0600 permissions)spechatch secret put DATABASE_URL --shared
# Verify DB connectivity (and wake scale-to-zero Neon instances)spechatch ping --dbOn first startup, Alembic automatically runs all bundled migrations (0001–0008), creating the 15 spechatch_* tables:

2. Bootstrap Your First Superuser (Production / Authenticated Mode)
Section titled “2. Bootstrap Your First Superuser (Production / Authenticated Mode)”For shared team deployments, always enable authentication (SPECHATCH_AUTH_ENABLED=true). Run the one-time DB-direct bootstrap command to create the initial superuser and mint your first shk_* human API key:
spechatch admin init --username admin --full-name "Platform Admin"Store the one-time printed shk_* key and server URL locally:
spechatch secret put URL https://incubator.example.com --sharedspechatch secret put API_KEY --sharedBreak-glass recovery: If a superuser loses their key or leaves the team, DB-direct operators can run
spechatch admin reset-password <user> --rotate-keyorspechatch admin transfer-superuser --from <old> --to <new>.
3. Run the Server (Local Process or Docker)
Section titled “3. Run the Server (Local Process or Docker)”Option A — Local Process (spechatch serve)
Section titled “Option A — Local Process (spechatch serve)”# Local development (127.0.0.1:8787)spechatch serve
# Production bind (requires SPECHATCH_AUTH_ENABLED=true)SPECHATCH_AUTH_ENABLED=true spechatch serve --host 0.0.0.0 --port 8787Option B — Stateless Docker Container (spechatch incubator init)
Section titled “Option B — Stateless Docker Container (spechatch incubator init)”In any directory or deployment repo, scaffold a ready-to-build PyPI-based Dockerfile (non-root USER spechatch, [incubator,mysql] drivers, /api/spechatch/v1/health HEALTHCHECK) and .dockerignore:
spechatch incubator init
# Build locallydocker build --load -t spechatch-incubator .
# Run using your stored ~/.config/spechatch/.env (or explicit -e flags)docker run --rm -p 8787:8787 \ --env-file ~/.config/spechatch/.env \ -e SPECHATCH_AUTH_ENABLED=true \ spechatch-incubatorVerify the running server:
spechatch healthcheck4. Manage Projects, Users, Roles & API Keys from the CLI
Section titled “4. Manage Projects, Users, Roles & API Keys from the CLI”Everything can be administered directly through spechatch incubator (all subcommands support --json, and accept either a usr_* ID or username):
# 1. Create a project (superuser only)spechatch incubator project create my-app --name "My App" --description "Core platform"
# 2. Create a teammate account (superuser only; prompts for password securely)spechatch incubator user create alice --full-name "Alice Dev" --role member
# 3. Assign project role (owner | maintainer | developer | viewer)spechatch incubator member add my-app alice --role developer
# 4. Mint a personal API key (actor_type: human | agent | ci)spechatch incubator key create alice --name alice-laptop --actor-type humanspechatch incubator key create alice --name alice-agent --actor-type agentOn her workstation, Alice only configures the Incubator URL and her personal API key (never DATABASE_URL):
spechatch secret put URL https://incubator.example.comspechatch secret put API_KEY # paste shk_... when promptedDay-2 Administration
Section titled “Day-2 Administration”# List & inspectspechatch incubator user listspechatch incubator project listspechatch incubator project show my-appspechatch incubator member list my-appspechatch incubator key list alice
# Update, deactivate, or reactivate users & projects (last active superuser is protected with 409)spechatch incubator user update alice --role superuserspechatch incubator user deactivate bobspechatch incubator project deactivate legacy-appspechatch incubator project activate legacy-app
# Revoke a compromised key or inspect the immutable audit trailspechatch incubator key revoke key_01abc...spechatch incubator audit --limit 50RBAC Quick Reference
Section titled “RBAC Quick Reference”| Action | Allowed Roles |
|---|---|
Create / list / update / deactivate users, view /audit |
superuser only |
| Create projects | superuser only |
| Update / deactivate / reactivate a project, update project settings | Project owner or superuser |
| Add / remove project members, bootstrap project, manage webhooks | Project maintainer+ or superuser |
| Allocate IDs, upsert roadmap, claim/revise specs, ingest tests, bump version | Project developer+ or superuser |
Approve human checkpoints (spechatch approve) |
Project maintainer+ with actor_type=human key |
| Read roadmap, context, epics, health, version | Project viewer+ or superuser |
5. Bootstrap Existing Specs & Sync Test Health
Section titled “5. Bootstrap Existing Specs & Sync Test Health”Inside your repository (with spechatch.project.yml configured):
# Seed monotonic counters (highest + 1) and import existing specs into the ledgerspechatch bootstrap
# Run configured test runners and ingest per-spec health into the Incubatorspechatch test run --remote
# Atomically bump the project's version on the Incubator + local manifestsspechatch version bump minor --remoteEvery spec’s status, version, owner, content_hash, and health (healthy / regressed) is tracked live in spechatch_spec_ledger:

And running spechatch test run --remote attributes JUnit results directly to each spec while streaming 200 OK updates to the Incubator:

Next Steps
Section titled “Next Steps”- Webhooks & Notifications — Receive rich Slack, Discord, or Microsoft Teams cards whenever specs transition, regress, or bump versions.
- AI Agents & Native MCP — Enable
SPECHATCH_INCUBATOR_AUTO_SYNC=trueso AI agents sync seamlessly with your Incubator.