Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
208 commits
Select commit Hold shift + click to select a range
690bc00
chore(ralph): configure orchestration for Mission Control
Danm72 Feb 3, 2026
41b5e15
feat(phase-00): install vitest and testing dependencies
Danm72 Feb 3, 2026
a37831d
feat(phase-00): add vitest.config.ts for testing foundation
Danm72 Feb 3, 2026
57464c1
feat(phase-00): add tests/setup.ts with global test utilities
Danm72 Feb 3, 2026
3a2d424
feat(phase-00): add vitest test scripts to root package.json
Danm72 Feb 3, 2026
e0d7509
feat(phase-00): add Supabase test client and database types
Danm72 Feb 3, 2026
86f752c
feat(phase-00): add test data seeding fixtures
Danm72 Feb 3, 2026
cb706bd
feat(phase-00): add docker-compose.test.yml for local Supabase testing
Danm72 Feb 3, 2026
bd3403f
feat(phase-00): install Playwright for E2E testing
Danm72 Feb 3, 2026
480a333
feat(phase-00): create Playwright E2E config
Danm72 Feb 3, 2026
23f23fb
feat(phase-00): add Playwright auth fixture for authenticated E2E tests
Danm72 Feb 3, 2026
e4fffd9
feat(phase-00): add Playwright E2E test scripts
Danm72 Feb 3, 2026
fb35fcb
feat(phase-00): add Chrome MCP visual test configuration
Danm72 Feb 3, 2026
c0bf007
feat(phase-00): add Chrome MCP visual testing documentation
Danm72 Feb 3, 2026
8526d3e
feat(phase-00): add AI/LLM test harness
Danm72 Feb 3, 2026
b4bcd56
feat(phase-00): add AI onboarding chat tests and test scripts
Danm72 Feb 3, 2026
942ba51
feat(phase-00): add API integration test setup
Danm72 Feb 3, 2026
0ed119e
feat(phase-00): add component test render utility
Danm72 Feb 3, 2026
d919d35
feat(phase-00): add common test mocks utility
Danm72 Feb 3, 2026
7729204
feat(phase-00): add CI/CD GitHub Actions workflow
Danm72 Feb 3, 2026
a09132b
feat(phase-00): add testing documentation
Danm72 Feb 3, 2026
537b048
feat(phase-01): add Atomic Design component structure
Danm72 Feb 3, 2026
e2fde03
feat(phase-01): apply Supabase migrations and generate types
Danm72 Feb 3, 2026
1838d44
feat(phase-01): verify RLS policies and cross-tenant isolation
Danm72 Feb 3, 2026
99ddaf5
feat(phase-01): add root layout with sidebar structure
Danm72 Feb 3, 2026
fe2a82d
feat(phase-01): add Text atom component with typography variants
Danm72 Feb 3, 2026
e594319
feat(phase-01): add Button atom component with variants
Danm72 Feb 3, 2026
e7ccfe0
feat(phase-01): add Icon atom component wrapping lucide-react
Danm72 Feb 3, 2026
0341b44
feat(phase-01): add Avatar atom component with color support
Danm72 Feb 3, 2026
39b7b28
feat(phase-01): add Badge atom component with status and priority var…
Danm72 Feb 3, 2026
fa18f56
feat(phase-01): add Skeleton atom component for loading states
Danm72 Feb 3, 2026
81d23a9
feat(phase-01): add StatusDot atom component for agent status
Danm72 Feb 3, 2026
30ea25d
feat(phase-01): verify environment variables configured in .env.local
Danm72 Feb 3, 2026
f4ccde2
feat(phase-01): verify authentication setup tasks already implemented
Danm72 Feb 3, 2026
0ef88b5
feat(phase-01): verify email/password signup functionality
Danm72 Feb 3, 2026
00d3624
feat(phase-01): verify login flow with dashboard and RLS filtering
Danm72 Feb 3, 2026
29d6630
feat(phase-01): verify unauthenticated users redirected to /login
Danm72 Feb 3, 2026
384a545
feat(phase-01): verify session persists across page refreshes
Danm72 Feb 3, 2026
7f3b936
feat(phase-01): install Upstash Redis packages for rate limiting
Danm72 Feb 3, 2026
88ed38a
feat(phase-01): add rate limiting middleware with Upstash Redis
Danm72 Feb 4, 2026
5b6e908
feat(phase-01): add API key verification helper with bcrypt hash comp…
Danm72 Feb 4, 2026
c1d9e3e
feat(phase-02): add onboarding page with split-screen layout
Danm72 Feb 4, 2026
d4e0139
feat(phase-02): add SquadChat component with AI SDK useChat hook
Danm72 Feb 4, 2026
35c2f52
feat(phase-02): add SquadPreview component with live visual preview
Danm72 Feb 4, 2026
830a1c7
feat(phase-02): add editable AgentCard component with validation
Danm72 Feb 4, 2026
1579157
feat(phase-02): add SetupInstructions component for squad creation
Danm72 Feb 4, 2026
26e5bda
feat(phase-02): add AI chat endpoint for onboarding
Danm72 Feb 4, 2026
9c2010a
feat(phase-02): add pre-built squad templates for onboarding
Danm72 Feb 4, 2026
be570a2
feat(phase-02): add Zod schemas for squad extraction in onboarding
Danm72 Feb 4, 2026
97b91c2
feat(phase-02): implement updateSquadConfig tool for real-time previe…
Danm72 Feb 4, 2026
799692d
feat(phase-03): add Mission Control setup skill documentation
Danm72 Feb 4, 2026
a72bd0b
feat(phase-03): add Mission Control runtime skill documentation
Danm72 Feb 4, 2026
5049478
feat(phase-03): add setup API endpoint for one-time squad configuration
Danm72 Feb 4, 2026
29c4fae
feat(phase-03): add agent profile API and verifyApiKeyWithAgent auth …
Danm72 Feb 4, 2026
a2be54f
feat(phase-03): add heartbeat API endpoint for agent check-ins
Danm72 Feb 4, 2026
a4b4202
feat(phase-03): add tasks API endpoint for list and create operations
Danm72 Feb 4, 2026
87461e3
feat(phase-03): add task detail API endpoint for GET, PATCH, DELETE
Danm72 Feb 4, 2026
99a8d11
feat(phase-03): add task comments API endpoint for GET and POST
Danm72 Feb 4, 2026
fd4ffaa
feat(phase-00): verify testing foundation infrastructure
Danm72 Feb 4, 2026
90ade58
feat(phase-01): add @mention sanitization with 5 mention limit
Danm72 Feb 4, 2026
17b0186
feat(phase-01): add request body size validation (10KB max for comments)
Danm72 Feb 4, 2026
d0160d9
feat(phase-01): add Text atom unit tests
Danm72 Feb 4, 2026
8babef1
feat(phase-01): add Button atom unit tests
Danm72 Feb 4, 2026
974a5fe
feat(phase-01): add Icon atom unit tests
Danm72 Feb 4, 2026
a390703
feat(phase-01): add Avatar atom unit tests
Danm72 Feb 4, 2026
1b93535
feat(phase-01): add Badge atom unit tests
Danm72 Feb 4, 2026
d4a60ac
feat(phase-01): add Skeleton atom unit tests
Danm72 Feb 4, 2026
e137f0c
feat(phase-01): add Skeleton atom unit tests
Danm72 Feb 4, 2026
8ba305a
feat(phase-01): add StatusDot atom unit tests
Danm72 Feb 4, 2026
fa5491e
feat(phase-01): add database client integration tests
Danm72 Feb 4, 2026
83b4c4f
feat(phase-01): add RLS policies integration tests
Danm72 Feb 4, 2026
eb40967
feat(phase-01): add rate limiting middleware integration tests
Danm72 Feb 4, 2026
f8c7a2f
feat(phase-01): add API key verification integration tests
Danm72 Feb 4, 2026
2014ebd
feat(phase-01): add auth helper functions integration tests
Danm72 Feb 4, 2026
cfe5967
feat(phase-01): add middleware route protection tests
Danm72 Feb 4, 2026
b94ad7f
feat(phase-01): add signup E2E tests
Danm72 Feb 4, 2026
be96130
feat(phase-01): add login E2E tests
Danm72 Feb 4, 2026
4ba5de3
feat(phase-01): add session persistence E2E tests
Danm72 Feb 4, 2026
ccda5cc
feat(phase-01): add auth visual test scenarios documentation
Danm72 Feb 4, 2026
5899c70
feat(phase-01): verify test coverage thresholds met
Danm72 Feb 4, 2026
de13989
feat(phase-01): verify foundation infrastructure complete
Danm72 Feb 4, 2026
63b9c64
feat(phase-01): foundation infrastructure with tests
Danm72 Feb 4, 2026
3e306cf
feat(phase-02): verify AgentCard validation requirements complete
Danm72 Feb 4, 2026
f426744
feat(phase-02): make agent cards keyboard navigable
Danm72 Feb 4, 2026
a06f019
feat(phase-03): add task assignees API endpoint
Danm72 Feb 4, 2026
aadeaff
feat(phase-03): add notifications API endpoint
Danm72 Feb 4, 2026
8841b27
feat(phase-03): add notifications detail API endpoint
Danm72 Feb 4, 2026
f72635c
feat(phase-02): add focus management for onboarding panel switching
Danm72 Feb 4, 2026
b520ce1
fix(ci): update pnpm version from 8 to 9
Danm72 Feb 4, 2026
0e8489c
feat(phase-02): add POST /api/squads endpoint for squad creation
Danm72 Feb 4, 2026
24c0220
feat(phase-03): add notifications health monitoring endpoint
Danm72 Feb 4, 2026
25c7f6a
fix(e2e): use production server in CI for faster startup
Danm72 Feb 4, 2026
1844357
feat(phase-03): add squad agents API endpoint
Danm72 Feb 4, 2026
8a8ba96
feat(phase-02): add POST /api/squads/[id]/agents endpoint for agent s…
Danm72 Feb 4, 2026
88be143
feat(phase-03): add squad tasks Kanban board API endpoint
Danm72 Feb 4, 2026
82fc837
feat(phase-03): add squad activities API endpoint
Danm72 Feb 4, 2026
e0b4d93
feat(phase-02): add DashboardLayout template component
Danm72 Feb 4, 2026
6a49a4e
feat(phase-03): add OpenAPI schema documentation endpoint
Danm72 Feb 4, 2026
72691a6
feat(phase-02): add Header organism component
Danm72 Feb 4, 2026
719af5a
feat(phase-03): add documents API endpoint
Danm72 Feb 4, 2026
8e88da9
feat(phase-02): add AgentSidebar organism component
Danm72 Feb 4, 2026
b55c8c7
feat(phase-03): add watch items API endpoint
Danm72 Feb 4, 2026
73e6fce
feat(phase-02): add LiveFeed organism component
Danm72 Feb 4, 2026
5c0f99c
feat(phase-02): add StatBadge molecule component
Danm72 Feb 4, 2026
2fde1f1
feat(phase-02): add Clock molecule component
Danm72 Feb 4, 2026
68bb16f
feat(phase-03): add squads API endpoint for onboarding
Danm72 Feb 4, 2026
3cb8e70
feat(phase-02): add browser theme-color meta tag
Danm72 Feb 4, 2026
667f898
feat(phase-03): add squad agents management API endpoint
Danm72 Feb 4, 2026
a8b6b3a
refactor(phase-02): improve Clock component with useSyncExternalStore
Danm72 Feb 4, 2026
58db8f5
docs(phase-02): update progress with Clock component refactor
Danm72 Feb 4, 2026
ca01c16
feat(phase-03): add squad-chat API endpoint for team-wide messaging
Danm72 Feb 4, 2026
27d4a96
feat(phase-02): add KanbanBoard organism with 5 columns
Danm72 Feb 4, 2026
1961a48
test(phase-03): add Setup API endpoint unit tests
Danm72 Feb 4, 2026
4bc5c73
feat(phase-02): add KanbanColumn organism with drop zone support
Danm72 Feb 4, 2026
f8c8bc3
test(phase-03): add Agent Profile API endpoint unit tests
Danm72 Feb 4, 2026
77dae84
feat(phase-02): extract TaskCard into standalone organism component
Danm72 Feb 4, 2026
0138a25
test(phase-03): add Heartbeat API endpoint unit tests
Danm72 Feb 4, 2026
f7d563f
feat(phase-02): add TaskCardContainer organism with data fetching
Danm72 Feb 4, 2026
f2f2caf
feat(phase-02): add TaskCardSkeleton organism for loading states
Danm72 Feb 4, 2026
dc3be08
test(phase-03): add Tasks API endpoint unit tests
Danm72 Feb 4, 2026
60476ce
feat(phase-02): add TaskMeta molecule for task card metadata
Danm72 Feb 4, 2026
c9061ea
test(phase-03): add Task Detail API endpoint unit tests
Danm72 Feb 4, 2026
721c669
feat(phase-02): add PriorityBorder atom for task priority borders
Danm72 Feb 4, 2026
fecb3a4
fix(onboarding): make suggestion chips clickable and add error handling
Danm72 Feb 4, 2026
0dc54f2
test(phase-03): add Comments API endpoint unit tests
Danm72 Feb 4, 2026
5ee8715
feat(phase-02): implement drag-and-drop for KanbanBoard with @dnd-kit
Danm72 Feb 4, 2026
73c754d
feat(phase-02): implement optimistic updates for KanbanBoard drag-and…
Danm72 Feb 4, 2026
ef86b06
test(phase-03): add Notifications API endpoint unit tests
Danm72 Feb 4, 2026
562ac83
chore: remove legacy AI test harness and onboarding-related tests
Danm72 Feb 4, 2026
a268e3f
feat(phase-02): add StatusSelect for keyboard-accessible task status …
Danm72 Feb 4, 2026
f951a7d
test(phase-03): add Notification Detail API endpoint unit tests
Danm72 Feb 4, 2026
2587526
test(phase-03): add Notifications Health API endpoint unit tests
Danm72 Feb 4, 2026
561b87d
Merge phase-03: Notifications Health API endpoint unit tests
Danm72 Feb 4, 2026
5af87be
feat(phase-03): enhance Ralph orchestration workflow and add API endp…
Danm72 Feb 4, 2026
f05cf5a
test(phase-03): add comprehensive unit tests for Watch Items API endp…
Danm72 Feb 4, 2026
987185f
test(phase-03): add unit tests for AgentSidebar, Clock, and useActivi…
Danm72 Feb 4, 2026
5c3b6ac
test(phase-03): add comprehensive unit tests for useTaskDetail, Comme…
Danm72 Feb 4, 2026
f301fa3
feat(phase-03): verify Notifications API tests checkpoint
Danm72 Feb 4, 2026
a5795cd
feat(phase-03): verify Squad Agents API unit tests
Danm72 Feb 4, 2026
132cca1
feat(phase-03): verify Squad Tasks API unit tests
Danm72 Feb 4, 2026
2227d27
test(phase-03): add integration test for full agent workflow
Danm72 Feb 4, 2026
67286a2
feat(phase-03): verify Squad Activities API unit tests
Danm72 Feb 4, 2026
ea0f8ff
test(phase-03): add integration test for notification delivery and ac…
Danm72 Feb 4, 2026
ea57e3b
feat(phase-03): verify Squad API tests checkpoint
Danm72 Feb 4, 2026
33f7e9b
feat(phase-03): verify Documents API unit tests
Danm72 Feb 4, 2026
a96483b
test(phase-03): add integration test for SOUL.md sync mechanism
Danm72 Feb 4, 2026
52a2fe5
feat(phase-03): verify Watch Items API unit tests
Danm72 Feb 4, 2026
7720cf0
test(phase-03): update mock query functions to handle `null` data in …
Danm72 Feb 4, 2026
6b629ee
test(phase-03): add integration test for rate limiting behavior
Danm72 Feb 4, 2026
4bc97b9
chore(phase-03): mark completed tests and skip verification tasks
Danm72 Feb 4, 2026
d2ee698
feat(phase-03): enhance TaskCard components and integrate TaskModal i…
Danm72 Feb 4, 2026
692bf1a
feat(phase-02): add task modal/form with Zod validation
Danm72 Feb 4, 2026
8479bd9
feat(phase-02): add GroupedTaskView organism for task grouping by agent
Danm72 Feb 4, 2026
998558e
feat(phase-02): add ViewToggle molecule for Kanban/Grouped view switc…
Danm72 Feb 4, 2026
9e51134
feat(phase-02): persist view preference in URL with useUrlState hook
Danm72 Feb 4, 2026
46b02df
feat(phase-02): add TaskDetailPanel template with slide-over and focu…
Danm72 Feb 4, 2026
d35c3d5
feat(phase-02): add CommentThread organism for task detail panel
Danm72 Feb 4, 2026
675abbd
feat(phase-02): add CommentItem molecule with markdown support
Danm72 Feb 4, 2026
1f99bbd
feat(phase-02): add CommentInput molecule with @mention support
Danm72 Feb 4, 2026
262b6c4
feat(phase-02): add MentionHighlight atom for clickable @mentions
Danm72 Feb 4, 2026
2e6e287
feat(phase-02): add DocumentList organism for task attachments
Danm72 Feb 4, 2026
1712045
feat(phase-02): add focus trap tests for TaskDetailPanel
Danm72 Feb 4, 2026
e25e094
feat(phase-02): add AgentProfilePanel template with Timeline/Messages…
Danm72 Feb 4, 2026
d6247c2
feat(phase-02): add AgentSpecEditor molecule with SOUL.md preview
Danm72 Feb 4, 2026
842a41e
feat(phase-02): add filtered task view when agent selected in sidebar
Danm72 Feb 4, 2026
a5d6515
feat(phase-02): add DirectMessageInput molecule for agent messaging
Danm72 Feb 4, 2026
4336930
feat(phase-02): add UnreadMentions molecule for agent mention counts
Danm72 Feb 4, 2026
6f251d7
feat(phase-02): add TagPill atom for expertise/skills display
Danm72 Feb 4, 2026
850bb4c
feat(phase-02): add extended bio/description section to AgentProfileP…
Danm72 Feb 4, 2026
b136eb5
feat(phase-02): add ActivityDetailPanel template for expandable activ…
Danm72 Feb 4, 2026
5e563ef
feat(phase-02): add ActivityComments organism for activity comment se…
Danm72 Feb 4, 2026
9937fbf
feat(phase-02): add SquadChatModal template for team-wide chat
Danm72 Feb 4, 2026
a9c7435
docs(phase-02): update progress for SquadChatModal template
Danm72 Feb 4, 2026
178995a
feat(phase-02): add WatchList organism for monitored items
Danm72 Feb 4, 2026
cccc443
docs(phase-02): update progress for WatchList organism
Danm72 Feb 4, 2026
76df24f
feat(phase-02): add Supabase realtime client for live subscriptions
Danm72 Feb 4, 2026
d347774
docs(phase-02): update progress for Supabase realtime client
Danm72 Feb 4, 2026
26a73ef
feat(phase-02): add useAgents hook for agent data with realtime updates
Danm72 Feb 4, 2026
51ed0fc
docs(phase-02): update progress for useAgents hook
Danm72 Feb 4, 2026
ee96864
feat(phase-02): add useTaskDetail hook for task data with realtime up…
Danm72 Feb 4, 2026
ee55c74
feat(phase-02): add useTasks hook for task data with realtime updates
Danm72 Feb 4, 2026
9d0b18e
feat(phase-02): add useActivities hook for activity feed with pagination
Danm72 Feb 4, 2026
fee3658
feat(phase-02): add useSquadChat hook for squad chat with realtime up…
Danm72 Feb 4, 2026
a2233f1
feat(phase-02): add useDelayedLoading hook for flicker prevention
Danm72 Feb 4, 2026
a9d7a63
docs(phase-02): mark useUrlState hook task complete
Danm72 Feb 4, 2026
2fe9028
feat(phase-02): add route-level error boundaries with recovery UI
Danm72 Feb 4, 2026
98781fb
feat(phase-02): add error boundary for KanbanBoard organism
Danm72 Feb 4, 2026
9a22968
feat(phase-02): implement Agent details page, refactor dashboard layout
Danm72 Feb 4, 2026
69652f9
feat(phase-02): add error boundary for AgentSidebar organism
Danm72 Feb 4, 2026
66e384d
feat(phase-02): add error boundary for LiveFeed organism
Danm72 Feb 4, 2026
fc3a604
feat(phase-02): verify all error states have recovery buttons
Danm72 Feb 4, 2026
6524493
feat(phase-02): enhance task and agent interactions with navigation u…
Danm72 Feb 4, 2026
37d2461
feat(phase-02): add SquadChat component tests
Danm72 Feb 4, 2026
98ac909
feat(phase-02): add SquadPreview component tests
Danm72 Feb 4, 2026
e934416
feat(phase-02): add AgentCard component tests
Danm72 Feb 4, 2026
d7b08f3
feat(phase-02): add DashboardLayout collapsible sidebar and activity …
Danm72 Feb 4, 2026
bbc9cba
feat(phase-02): introduce notification system and security utilities …
Danm72 Feb 4, 2026
45969c2
feat(phase-02): add query utilities, circuit breaker, and comprehensi…
Danm72 Feb 5, 2026
de64b85
feat(phase-04): add daily standup cron, vercel config, and fix activi…
Danm72 Feb 5, 2026
6fc4c5b
feat(phase-01): prepare OpenClaw agent integration and refine SKILL.md
Danm72 Feb 5, 2026
4378002
feat(integration): add OpenClaw agent integration test suite
Danm72 Feb 5, 2026
1caa1b3
fix(tests): align 18 test files with actual implementations
Danm72 Feb 5, 2026
e560c03
fix(auth): replace anon client with service role in agent auth middle…
Danm72 Feb 5, 2026
779ef2e
feat(integration): overhaul OpenClaw test infra, replace config & add…
Danm72 Feb 5, 2026
81313f3
fix(a11y): render DialogTitle unconditionally in AgentProfilePanel
Danm72 Feb 5, 2026
48ca7ab
feat(integration): improve Docker Compose and config for OpenClaw + S…
Danm72 Feb 5, 2026
f5a0275
feat(integration): standardize per-agent HEARTBEAT.md and update conf…
Danm72 Feb 5, 2026
8e5eef4
feat(dashboard): redesign UI to match production design
Danm72 Feb 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,190 changes: 1,190 additions & 0 deletions .claude/rules/10-docker-integration-prevention-strategies.md

Large diffs are not rendered by default.

385 changes: 385 additions & 0 deletions .claude/rules/11-docker-integration-quick-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,385 @@
# Docker Integration Quick Reference

**Quick answers for common integration test failures. For detailed explanations, see rule 10.**

---

## TL;DR Startup Verification

```bash
# Check all services health
docker-compose -f docker-compose.integration.yml ps

# Watch logs for startup
docker-compose -f docker-compose.integration.yml logs -f

# Quick health check after all services report "healthy"
curl http://localhost:3100/api/health && \
curl http://localhost:18789 -H "Authorization: Bearer test-integration-token"
```

---

## Common Failures & Fixes

### "function digest() does not exist" (GoTrue or PostgREST)

**Fix:**
```bash
docker exec mission-control-supabase-db-1 psql -U postgres -d postgres -c "
ALTER ROLE authenticator SET search_path TO \"\$user\", public, extensions;
ALTER ROLE service_role SET search_path TO \"\$user\", public, extensions;
"
```

**Or:** Verify `99-service-role-passwords.sql` is mounted and contains these lines.

---

### "password authentication failed" (GoTrue/PostgREST → PostgreSQL)

**Fix:**
```bash
# Verify service role passwords exist
docker exec mission-control-supabase-db-1 psql -U authenticator -d postgres -c "SELECT 1;"

# If that fails, set passwords:
docker exec mission-control-supabase-db-1 psql -U postgres -d postgres -c "
ALTER USER authenticator WITH PASSWORD 'postgres';
ALTER USER supabase_auth_admin WITH PASSWORD 'postgres';
"
```

---

### "Port 3001 already in use" (PostgREST port conflict)

**Fix:**
```bash
# Kill process on port
lsof -i :3001 | grep -v PID | awk '{print $2}' | xargs kill -9

# Or change docker port in docker-compose.integration.yml:
# ports:
# - "3002:3000" # <- use 3002 instead of 3001
```

---

### "Mission Control API health check failing" after 2 min

**Check logs:**
```bash
docker-compose -f docker-compose.integration.yml logs mission-control | tail -20
```

**Common issues:**
- Supabase URL wrong? (should be `http://supabase-kong:8000`)
- Kong not started? (check `docker-compose ps supabase-kong`)
- Build failed? (check for TypeScript errors in logs)

---

### "Kong not routing /auth/v1/" (401 on auth endpoints)

**Fix:**
```bash
# Verify kong.yml exists and has auth routes
cat tests/integration/kong/kong.yml | grep -A2 "auth-v1"

# Restart Kong to reload config
docker-compose -f docker-compose.integration.yml restart supabase-kong

# Test routing
curl http://localhost:8000/auth/v1/health
```

---

### "OpenClaw gateway fails to start" (generic error)

**Check logs:**
```bash
docker-compose -f docker-compose.integration.yml logs openclaw-gateway | tail -50
```

**Most likely causes (in order):**

1. **Invalid JSON in openclaw.json**
```bash
node -e "JSON.parse(require('fs').readFileSync('tests/integration/openclaw/config/openclaw.json'))"
```

2. **gateway.mode not "local"**
```bash
grep '"mode"' tests/integration/openclaw/config/openclaw.json
# Should show: "mode": "local"
```

3. **model is string, not object**
```bash
grep '"model"' tests/integration/openclaw/config/openclaw.json
# Should show: "model": { "primary": "..." }, not "model": "..."
```

4. **auth mode is invalid**
```bash
grep '"auth"' tests/integration/openclaw/config/openclaw.json
# Should show: "auth": "token" or "auth": "password", NOT "none"
```

---

### "OpenClaw: Unauthorized" (token rejected)

**Fix:**
```bash
# Check your auth header
curl -H "Authorization: Bearer test-integration-token" http://localhost:18789/

# Verify token in startup command
grep "token test-integration-token" tests/integration/scripts/entrypoint-openclaw.sh
```

---

### "OpenClaw: Mission Control API unreachable"

**Check logs:**
```bash
docker-compose -f docker-compose.integration.yml logs openclaw-gateway | grep -i "api\|connect\|unreachable"
```

**Fix:**
```bash
# Verify Mission Control is running and healthy
docker-compose -f docker-compose.integration.yml ps mission-control

# Verify URL is correct (should point to mission-control service, not localhost)
grep MISSION_CONTROL_API_URL docker-compose.integration.yml
# Should be: http://mission-control:3000 (not http://localhost:3000)

# Test from inside OpenClaw container
docker exec mission-control-openclaw-gateway-1 \
curl http://mission-control:3000/api/health
```

---

### "Database migration failed" (initial_schema migration error)

**Check:**
```bash
docker-compose -f docker-compose.integration.yml logs supabase-db | grep -i "migration\|error" | head -10
```

**Fix:**
```bash
# Verify migrations are mounted correctly
docker-compose -f docker-compose.integration.yml config | grep migrations

# Restart database to re-run migrations
docker-compose -f docker-compose.integration.yml down supabase-db
docker-compose -f docker-compose.integration.yml up -d supabase-db

# Wait for healthy
sleep 10 && docker-compose -f docker-compose.integration.yml ps supabase-db
```

---

### "curl: command not found" in health checks

**Not actually a failure.** PostgREST image doesn't have curl, so the health check uses:
```yaml
test: ["CMD-SHELL", "bash -c 'echo > /dev/tcp/localhost/3000'"]
```

This is correct. If you see actual health failures, look at the service logs instead.

---

## Port Cheat Sheet

| Service | Container Port | Host Port | URL |
|---------|---|---|---|
| PostgreSQL | 5432 | 54332 | `postgres://localhost:54332` |
| GoTrue (auth) | 9999 | 9998 | `http://localhost:9998` |
| PostgREST (data) | 3000 | 3001 | `http://localhost:3001` |
| Kong (gateway) | 8000 | 8000 | `http://localhost:8000` |
| Mission Control | 3000 | 3100 | `http://localhost:3100` |
| OpenClaw Gateway | 18789 | 18789 | `http://localhost:18789` |

---

## One-Command Cleanup

```bash
# Stop all containers and remove volumes (WARNING: data loss)
docker-compose -f docker-compose.integration.yml down -v

# Remove dangling volumes
docker volume prune -f

# Fresh start
docker-compose -f docker-compose.integration.yml up -d
docker-compose -f docker-compose.integration.yml logs -f
```

---

## Verify Each Service (Sequential)

Run these in order to pinpoint which service is broken:

```bash
# 1. PostgreSQL
echo "1. PostgreSQL..."
docker exec mission-control-supabase-db-1 pg_isready -U postgres && echo "✓ OK" || echo "✗ FAIL"

# 2. GoTrue
echo "2. GoTrue..."
curl -sf http://localhost:9998/health > /dev/null && echo "✓ OK" || echo "✗ FAIL"

# 3. PostgREST
echo "3. PostgREST..."
bash -c "echo > /dev/tcp/localhost/3001" 2>/dev/null && echo "✓ OK" || echo "✗ FAIL"

# 4. Kong
echo "4. Kong..."
curl -sf http://localhost:8000/auth/v1/health > /dev/null && echo "✓ OK" || echo "✗ FAIL"

# 5. Mission Control
echo "5. Mission Control..."
curl -sf http://localhost:3100/api/health > /dev/null && echo "✓ OK" || echo "✗ FAIL"

# 6. OpenClaw
echo "6. OpenClaw..."
curl -sf -H "Authorization: Bearer test-integration-token" http://localhost:18789/ > /dev/null && echo "✓ OK" || echo "✗ FAIL"
```

---

## Debug Commands

```bash
# See what's listening on a port
lsof -i :3000

# Watch service startup in real-time
docker-compose -f docker-compose.integration.yml logs -f mission-control

# Run a one-off command in a container
docker exec mission-control-supabase-db-1 psql -U postgres -d postgres -c "..."

# Copy a file out of container
docker cp mission-control-supabase-db-1:/var/log/postgres.log /tmp/postgres.log

# Check container resource usage
docker stats mission-control-supabase-db-1

# Inspect network
docker network inspect mission-control_integration
```

---

## Config Validation One-Liners

```bash
# Validate OpenClaw JSON
node -e "JSON.parse(require('fs').readFileSync('tests/integration/openclaw/config/openclaw.json'))"

# Validate docker-compose YAML
docker-compose -f docker-compose.integration.yml config > /dev/null

# Validate mission-control Dockerfile
docker build --dry-run apps/web/Dockerfile .

# Check all JSON files in openclaw directory
find tests/integration/openclaw -name "*.json" -exec sh -c 'node -e "JSON.parse(require(\"fs\").readFileSync(\"$1\"))" _ {} \;
```

---

## Before Committing Changes

1. Validate configs:
```bash
docker-compose -f docker-compose.integration.yml config > /dev/null && \
node -e "JSON.parse(require('fs').readFileSync('tests/integration/openclaw/config/openclaw.json'))" && \
echo "✓ All configs valid"
```

2. Test on clean environment:
```bash
docker-compose -f docker-compose.integration.yml down -v
docker-compose -f docker-compose.integration.yml up -d
sleep 60 # Let services start
curl http://localhost:3100/api/health # Should return 200
```

3. Check Git diff for unintended changes:
```bash
git diff docker-compose.integration.yml # Should be minimal
git diff tests/integration/openclaw/config/
```

---

## Integration Test Execution

```bash
# Run integration tests
docker-compose -f docker-compose.integration.yml up -d
sleep 60 # Wait for services to be healthy

# In another terminal:
pnpm test:integration

# Or specific test:
pnpm test tests/integration/api/heartbeat.test.ts

# Stop services
docker-compose -f docker-compose.integration.yml down
```

---

## When Nothing Works

**Nuclear option (complete reset):**

```bash
# Stop everything
docker-compose -f docker-compose.integration.yml down -v
docker volume prune -f
docker network prune -f

# Remove image to force rebuild
docker rmi openclaw:local 2>/dev/null || true

# Rebuild and start fresh
docker-compose -f docker-compose.integration.yml build --no-cache
docker-compose -f docker-compose.integration.yml up -d

# Wait and verify
sleep 120
docker-compose -f docker-compose.integration.yml ps
curl http://localhost:3100/api/health
```

---

## Still Stuck?

1. **Check the full prevention guide:** See `rule 10` for detailed explanations
2. **Read service logs:** `docker-compose logs <service-name>`
3. **Ask the team:** The 12 issues documented in rule 10 cover ~95% of failures

---

## Last Updated

- **2026-02-05** — Initial quick reference based on integration setup
- **Changes tested:** All 12 common issues and their fixes
Loading
Loading