chore(orchestrator): bootstrap MS20 Site Stabilization mission (#535)

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #535.
This commit is contained in:
2026-02-27 10:12:24 +00:00
committed by jason.woltje
parent 11f22a7e96
commit 8964226163
4 changed files with 223 additions and 112 deletions

View File

@@ -1,51 +1,53 @@
# Mission Manifest — MS19 Chat & Terminal System # Mission Manifest — MS20 Site Stabilization
> Persistent document tracking full mission scope, status, and session history. > Persistent document tracking full mission scope, status, and session history.
> Updated by the orchestrator at each phase transition and milestone completion. > Updated by the orchestrator at each phase transition and milestone completion.
## Mission ## Mission
**ID:** ms19-chat-terminal-20260225 **ID:** ms20-site-stabilization-20260227
**Statement:** Implement MS19 (Chat & Terminal System) — real terminal with PTY backend, chat streaming, master chat polish, project-level orchestrator chat, and agent output integration **Statement:** Fix runtime bugs, missing API endpoints, orchestrator connectivity, and feature gaps discovered during live site testing at mosaic.woltje.com
**Phase:** Completion **Phase:** Planning
**Current Milestone:** MS19-ChatTerminal **Current Milestone:** MS20-SiteStabilization
**Progress:** 1 / 1 milestones **Progress:** 0 / 1 milestones
**Status:** completed **Status:** active
**Last Updated:** 2026-02-26T04:20Z **Last Updated:** 2026-02-27T05:30Z
## Success Criteria ## Success Criteria
1. Terminal panel has real xterm.js with PTY backend via WebSocket — **DONE** (PR #518) 1. Domains page: can create and list domains without workspace errors
2. Terminal supports multiple named sessions (create/close/rename tabs) — **DONE** (PR #520) 2. Projects page: can create new projects without workspace errors
3. Terminal sessions persist in PostgreSQL and recover on reconnect — **DONE** (PR #517) 3. Personalities page: full CRUD works with proper dark mode theming
4. Chat streaming renders tokens in real-time via SSE — **DONE** (PR #516) 4. User preferences endpoint (`/users/me/preferences`) returns data
5. Master chat sidebar accessible from any page (Cmd+Shift+J / Cmd+K) — **DONE** (PR #519) 5. Credentials page: can add, view credentials (not just disabled stub)
6. Master chat supports model selection, temperature, conversation management — **DONE** (PR #519) 6. Orchestrator proxy endpoints return real data (no 502)
7. Project-level chat can trigger orchestrator actions (/spawn, /status, /jobs) — **DONE** (PR #521) 7. Orchestrator WebSocket connects successfully
8. Agent output from orchestrator viewable in terminal tabs — **DONE** (PR #522) 8. Dashboard Agent Status, Task Progress, Orchestrator Events widgets work
9. All features support all 5 themes (Dark, Light, Nord, Dracula, Solarized) — **DONE** (CSS variables) 9. Terminal has dedicated `/terminal` page route
10. Lint, typecheck, and tests pass — **DONE** (1441 web + 3303 API = 4744 tests) 10. favicon.ico serves correctly (no 404)
11. Deployed and smoke-tested at mosaic.woltje.com — **DONE** (CI #635 green, web image sha:7165e7a deployed) 11. `useWorkspaceId` warning resolved — workspace ID persists in localStorage
12. All 5 themes render correctly on all affected pages
13. Lint, typecheck, and tests pass
14. Deployed and verified at mosaic.woltje.com
## Existing Infrastructure ## Existing Infrastructure
Key components already built that MS19 builds upon: Key components already built that MS20 builds upon:
| Component | Status | Location | | Component | Status | Location |
| --------------------------------- | ------------------- | ------------------------------------ | | ------------------------- | --------------- | ----------------------------------------------- |
| ChatOverlay + ConversationSidebar | ~95% complete | `apps/web/src/components/chat/` | | WorkspaceGuard | Working | `apps/api/src/common/guards/workspace.guard.ts` |
| LLM Controller with SSE | Working | `apps/api/src/llm/` | | Auto-detect workspace ID | Working (reads) | `apps/web/src/lib/api/client.ts` |
| WebSocket Gateway | Production | `apps/api/src/websocket/` | | Credentials API backend | Built (M7) | `apps/api/src/credentials/` |
| TerminalPanel UI (mock) | UI-only, no backend | `apps/web/src/components/terminal/` | | Orchestrator proxy routes | Built (MS19) | `apps/web/src/app/api/orchestrator/` |
| Orchestrator proxy routes | Working | `apps/web/src/app/api/orchestrator/` | | Terminal components | Built (MS19) | `apps/web/src/components/terminal/` |
| Speech Gateway (pattern ref) | Production | `apps/api/src/speech/` | | Theme system | Working (MS18) | `apps/web/src/lib/themes/` |
| Ideas API (chat persistence) | Working | `apps/api/src/ideas/` |
## Milestones ## Milestones
| # | ID | Name | Status | Branch | Issue | Started | Completed | | # | ID | Name | Status | Branch | Issue | Started | Completed |
| --- | ---- | ---------------------- | --------- | ------------------------- | ------------------------ | ---------- | ---------- | | --- | ---- | ------------------ | ----------- | ------------------------- | ----- | ---------- | --------- |
| 1 | MS19 | Chat & Terminal System | completed | per-task feature branches | #508,#509,#510,#511,#512 | 2026-02-25 | 2026-02-25 | | 1 | MS20 | Site Stabilization | not-started | per-task feature branches | TBD | 2026-02-27 | |
## Deployment ## Deployment
@@ -57,32 +59,16 @@ Key components already built that MS19 builds upon:
| Metric | Value | | Metric | Value |
| ------ | ----------------- | | ------ | ----------------- |
| Budget | ~300K (estimated) | | Budget | ~400K (estimated) |
| Used | ~220K | | Used | 0 |
| Mode | normal | | Mode | normal |
## Session History ## Session History
| Session | Runtime | Started | Duration | Ended Reason | Last Task | | Session | Runtime | Started | Duration | Ended Reason | Last Task |
| ------- | --------------- | ----------------- | -------- | ------------ | ------------------------------------------------- | | ------- | --------------- | ----------------- | -------- | ------------ | --------- |
| S1 | Claude Opus 4.6 | 2026-02-25T20:00Z | ~1h | context | Planning (PLAN-001) | | S1 | Claude Opus 4.6 | 2026-02-27T05:30Z | | | Planning |
| S2 | Claude Opus 4.6 | 2026-02-25T21:00Z | ~2h | context | Wave 1+2 (5 tasks, PRs #515-518) |
| S3 | Claude Opus 4.6 | 2026-02-25T23:00Z | ~1.5h | context | Wave 3+4 (TERM-004, CHAT-002, ORCH-001, ORCH-002) |
| S4 | Claude Opus 4.6 | 2026-02-26T04:00Z | ~30m | completed | VER-001, DOC-001, VER-002 — mission complete |
## PRs Merged
| PR | Commit | Task | Description |
| ---- | ------- | -------- | ---------------------------------------- |
| #515 | 6290fc3 | TERM-001 | Terminal WebSocket gateway & PTY service |
| #516 | 7de0e73 | CHAT-001 | SSE chat streaming |
| #517 | 8128eb7 | TERM-002 | Terminal session persistence |
| #518 | 417c6ab | TERM-003 | xterm.js integration |
| #519 | 13aa52a | CHAT-002 | Master chat polish |
| #520 | 859dcfc | TERM-004 | Terminal tab management |
| #521 | b110c46 | ORCH-001 | Orchestrator command system |
| #522 | 9b2520c | ORCH-002 | Agent output terminal tabs |
## Scratchpad ## Scratchpad
Path: `docs/scratchpads/ms19-chat-terminal-20260225.md` Path: `docs/scratchpads/ms20-site-stabilization-20260227.md`

View File

@@ -134,21 +134,28 @@ This is the active mission scope. MS16 (Pages) and MS17 (Backend Integration) ar
13. Global terminal: project/orchestrator level, smart (MS19) 13. Global terminal: project/orchestrator level, smart (MS19)
14. Project-level orchestrator chat (MS19) 14. Project-level orchestrator chat (MS19)
15. Master chat session: collapsible sidebar/slideout, always available (MS19) 15. Master chat session: collapsible sidebar/slideout, always available (MS19)
16. Settings page for ALL environment variables, dynamically configurable via webUI (MS20) 16. Site stabilization: workspace context propagation for mutations (MS20)
17. Multi-tenant configuration with admin user management (MS20) 17. Site stabilization: personalities API + UI (MS20)
18. Team management with shared data spaces and chat rooms (MS20) 18. Site stabilization: user preferences API endpoint (MS20)
19. RBAC for file access, resources, models (MS20) 19. Site stabilization: orchestrator 502 and WebSocket connectivity (MS20)
20. Federation: master-master and master-slave with key exchange (MS21) 20. Site stabilization: credential management UI (MS20)
21. Federation testing: 3 instances on Portainer (woltje.com domain) (MS21) 21. Site stabilization: terminal page route (MS20)
22. Agent task mapping configuration: system-level defaults, user-level overrides (MS22) 22. Site stabilization: favicon, dark mode dropdown fix (MS20)
23. Telemetry: opt-out, customizable endpoint, sanitized data (MS22) 23. Settings page for ALL environment variables, dynamically configurable via webUI (MS21)
24. File manager with WYSIWYG editing: system/user/project levels (MS18) 24. Multi-tenant configuration with admin user management (MS21)
25. User-level and project-level Kanban with filtering (MS18) 25. Team management with shared data spaces and chat rooms (MS21)
26. Break-glass authentication user (MS20) 26. RBAC for file access, resources, models (MS21)
27. Playwright E2E tests for all pages (MS23) 27. Federation: master-master and master-slave with key exchange (MS22)
28. API documentation via Swagger (MS23) 28. Federation testing: 3 instances on Portainer (woltje.com domain) (MS22)
29. Backend endpoints for all dashboard data (MS17 — already complete for existing modules) 29. Agent task mapping configuration: system-level defaults, user-level overrides (MS23)
30. Profile page linked from user card (MS16) 30. Telemetry: opt-out, customizable endpoint, sanitized data (MS23)
31. File manager with WYSIWYG editing: system/user/project levels (MS18)
32. User-level and project-level Kanban with filtering (MS18)
33. Break-glass authentication user (MS20)
34. Playwright E2E tests for all pages (MS23)
35. API documentation via Swagger (MS23)
36. Backend endpoints for all dashboard data (MS17 — already complete for existing modules)
37. Profile page linked from user card (MS16)
### Out of Scope ### Out of Scope
@@ -334,7 +341,46 @@ This is the active mission scope. MS16 (Pages) and MS17 (Backend Integration) ar
- ASSUMPTION: Orchestrator commands route through existing web proxy (/api/orchestrator/\*) to orchestrator service. Rationale: Proxy routes already exist and handle auth. - ASSUMPTION: Orchestrator commands route through existing web proxy (/api/orchestrator/\*) to orchestrator service. Rationale: Proxy routes already exist and handle auth.
- **Status: COMPLETE (MS19) — PRs #521 (commands), #522 (agent terminal). /status, /agents, /jobs, /pause, /resume, /help commands. Agent output streaming via SSE. 113 web tests.** - **Status: COMPLETE (MS19) — PRs #521 (commands), #522 (agent terminal). /status, /agents, /jobs, /pause, /resume, /help commands. Agent output streaming via SSE. 113 web tests.**
### FR-020: Settings Configuration (Future — MS20) ### FR-020: Site Stabilization & Feature Gaps (MS20) — IN PROGRESS
Runtime bugs and feature gaps discovered during live testing of mosaic.woltje.com.
**Workspace Context Propagation:**
- Domains page: "Workspace ID is required" when creating domains
- Projects page: "Workspace ID is required" when creating projects
- Credentials page: unable to add credentials (button disabled, feature stub)
- ASSUMPTION: The `useWorkspaceId()` hook + auto-detect in `apiRequest` from PR #532 handles reads, but mutation endpoints on some pages don't pass workspace ID correctly. Rationale: GET requests work after PR #532 but POST/mutation requests still fail on domains and projects pages.
**Missing API Endpoints:**
- `/api/personalities` — no controller/service exists; frontend expects GET/POST/PATCH/DELETE
- `/users/me/preferences` — listed in PRD API table but returns 404; frontend profile page depends on it
- ASSUMPTION: Personalities API follows existing NestJS module patterns (controller + service + DTO + Prisma model). Rationale: Consistent with all other API modules in the codebase.
- ASSUMPTION: User preferences endpoint is part of the existing users module but route is not registered. Rationale: PRD lists it as an existing endpoint.
**Orchestrator Connectivity:**
- All orchestrator-proxied endpoints return HTTP 502
- Orchestrator WebSocket connection fails ("Reconnecting to server...")
- Dashboard widgets: Agent Status, Task Progress, Orchestrator Events all error
- ASSUMPTION: The orchestrator service container runs but the Next.js API proxy cannot reach it. Root cause is likely environment variable or network configuration in Docker Swarm. Rationale: The orchestrator container exists in the compose file and has Traefik labels.
**UI/UX Issues:**
- Dark mode theming on Formality Level dropdown in Personalities page incorrect
- favicon.ico missing (404)
- Terminal sidebar link uses `#terminal` anchor instead of page route
- `useWorkspaceId` warning in console: no workspace ID in localStorage on fresh sessions
- ASSUMPTION: Terminal should have a dedicated page route `/terminal` that renders the terminal panel full-screen. Rationale: The sidebar has a Terminal link in the Operations section alongside Logs, implying it should be a navigable page.
**Credential Management:**
- "Add Credential" button is `disabled` in code — feature was stubbed as "coming soon"
- Need to implement credential creation UI and wire to existing `/api/credentials` CRUD endpoints
- ASSUMPTION: Credential CRUD frontend can use the existing `/api/credentials` API which was built during M7-CredentialSecurity. Rationale: Backend endpoints exist per audit.
### FR-021: Settings Configuration (Future — MS21)
- All environment variables configurable via UI - All environment variables configurable via UI
- Minimal launch env vars, rest configurable dynamically - Minimal launch env vars, rest configurable dynamically
@@ -496,10 +542,11 @@ These 19 NestJS modules are already implemented with Prisma and available for fr
| MS16+MS17-PagesDataIntegration | 0.0.17 | All pages built + wired to real API data | COMPLETE | | MS16+MS17-PagesDataIntegration | 0.0.17 | All pages built + wired to real API data | COMPLETE |
| MS18-ThemeWidgets | 0.0.18 | Theme package system, widget registry, WYSIWYG, Kanban filtering | COMPLETE | | MS18-ThemeWidgets | 0.0.18 | Theme package system, widget registry, WYSIWYG, Kanban filtering | COMPLETE |
| MS19-ChatTerminal | 0.0.19 | Global terminal, project chat, master chat session | COMPLETE | | MS19-ChatTerminal | 0.0.19 | Global terminal, project chat, master chat session | COMPLETE |
| MS20-MultiTenant | 0.0.20 | Multi-tenant, teams, RBAC, RLS enforcement, break-glass auth | NOT STARTED | | MS20-SiteStabilization | 0.0.20 | Runtime bug fixes, missing endpoints, orchestrator connectivity | IN PROGRESS |
| MS21-Federation | 0.0.21 | Federation (M-M, M-S), 3 instances, key exchange, data separation | NOT STARTED | | MS21-MultiTenant | 0.0.21 | Multi-tenant, teams, RBAC, RLS enforcement, break-glass auth | NOT STARTED |
| MS22-AgentTelemetry | 0.0.22 | Agent task mapping, telemetry, wide-event logging | NOT STARTED | | MS22-Federation | 0.0.22 | Federation (M-M, M-S), 3 instances, key exchange, data separation | NOT STARTED |
| MS23-Testing | 0.0.23 | Playwright E2E, federation tests, documentation finalization | NOT STARTED | | MS23-AgentTelemetry | 0.0.23 | Agent task mapping, telemetry, wide-event logging | NOT STARTED |
| MS24-Testing | 0.0.24 | Playwright E2E, federation tests, documentation finalization | NOT STARTED |
## Assumptions ## Assumptions
@@ -511,3 +558,9 @@ These 19 NestJS modules are already implemented with Prisma and available for fr
6. ASSUMPTION: Theme packages are code-level TypeScript files (not runtime-installable npm packages). Each theme exports CSS variable overrides. Rationale: Keeps the system simple for MS18; runtime package loading can be added in a future milestone. 6. ASSUMPTION: Theme packages are code-level TypeScript files (not runtime-installable npm packages). Each theme exports CSS variable overrides. Rationale: Keeps the system simple for MS18; runtime package loading can be added in a future milestone.
7. ASSUMPTION: WYSIWYG editor uses Tiptap (ProseMirror-based, headless). Rationale: Headless approach integrates naturally with the CSS variable design system, excellent markdown import/export, TypeScript-first, battle-tested. 7. ASSUMPTION: WYSIWYG editor uses Tiptap (ProseMirror-based, headless). Rationale: Headless approach integrates naturally with the CSS variable design system, excellent markdown import/export, TypeScript-first, battle-tested.
8. ASSUMPTION: MS18 includes WYSIWYG editing for knowledge entries and Kanban filtering enhancements in addition to themes and widgets. These were originally listed separately but are grouped into MS18 per PRD scope items 24-25. Rationale: All are frontend-focused enhancements that build on the existing page infrastructure. 8. ASSUMPTION: MS18 includes WYSIWYG editing for knowledge entries and Kanban filtering enhancements in addition to themes and widgets. These were originally listed separately but are grouped into MS18 per PRD scope items 24-25. Rationale: All are frontend-focused enhancements that build on the existing page infrastructure.
9. ASSUMPTION: The `useWorkspaceId()` hook + auto-detect in `apiRequest` from PR #532 handles reads, but mutation endpoints on some pages don't pass workspace ID correctly. Rationale: GET requests work after PR #532 but POST/mutation requests still fail on domains and projects pages.
10. ASSUMPTION: Personalities API follows existing NestJS module patterns (controller + service + DTO + Prisma model). Rationale: Consistent with all other API modules in the codebase.
11. ASSUMPTION: User preferences endpoint is part of the existing users module but route is not registered. Rationale: PRD lists it as an existing endpoint.
12. ASSUMPTION: The orchestrator service container runs but the Next.js API proxy cannot reach it. Root cause is likely environment variable or network configuration in Docker Swarm. Rationale: The orchestrator container exists in the compose file and has Traefik labels.
13. ASSUMPTION: Terminal should have a dedicated page route `/terminal` that renders the terminal panel full-screen. Rationale: The sidebar has a Terminal link in the Operations section alongside Logs, implying it should be a navigable page.
14. ASSUMPTION: Credential CRUD frontend can use the existing `/api/credentials` API which was built during M7-CredentialSecurity. Rationale: Backend endpoints exist per audit.

View File

@@ -1,54 +1,59 @@
# Tasks — MS19 Chat & Terminal System # Tasks — MS20 Site Stabilization
> Single-writer: orchestrator only. Workers read but never modify. > Single-writer: orchestrator only. Workers read but never modify.
| id | status | description | issue | repo | branch | depends_on | blocks | agent | started_at | completed_at | estimate | used | notes | | id | status | description | issue | repo | branch | depends_on | blocks | agent | started_at | completed_at | estimate | used | notes |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | ------- | ------------------------------ | ----------------------------------------------- | ----------------------------------------------- | ------------ | ---------- | ------------ | -------- | ---- | ----------------------------------------------------------------- | | ----------- | ----------- | ---------------------------------------------------------------------------------------- | ----- | ------- | ----------------------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------ | ------------ | ---------- | ------------ | -------- | ---- | --------------------------------------------------------------------------------------- |
| CT-PLAN-001 | done | Plan MS19 task breakdown, create milestone + issues, populate TASKS.md | | — | — | | CT-TERM-001,CT-TERM-002,CT-CHAT-001,CT-CHAT-002 | orchestrator | 2026-02-25 | 2026-02-25 | 15K | ~15K | Planning complete | | SS-PLAN-001 | done | Plan MS20 task breakdown, create milestone + issues, populate TASKS.md | — | — | — | | SS-WS-001,SS-ORCH-001,SS-API-001,SS-UI-001 | orchestrator | 2026-02-27 | 2026-02-27 | 15K | ~15K | Planning complete |
| CT-TERM-001 | done | Terminal WebSocket gateway & PTY session service — NestJS gateway (namespace: /terminal), node-pty spawn/kill/resize, workspace-scoped rooms, auth via token | #508 | api | feat/ms19-terminal-gateway | CT-PLAN-001 | CT-TERM-003,CT-TERM-004,CT-ORCH-002 | sonnet | 2026-02-25 | 2026-02-25 | 30K | ~30K | PR #515 merged (6290fc3), 48 tests | | SS-WS-001 | not-started | Fix workspace context for domain creation — domains page POST sends workspace ID | #534 | web,api | fix/workspace-domain-project-create | SS-PLAN-001 | SS-WS-002 | | | | 15K | | Domains page "Workspace ID is required" on create |
| CT-TERM-002 | done | Terminal session persistence — Prisma model (TerminalSession: id, workspaceId, name, status, createdAt, closedAt), migration, CRUD service | #508 | api | feat/ms19-terminal-persistence | CT-PLAN-001 | CT-TERM-004 | sonnet | 2026-02-25 | 2026-02-25 | 15K | ~15K | PR #517 merged (8128eb7), 12 tests, #508 closed | | SS-WS-002 | not-started | Fix workspace context for project creation — projects page POST sends workspace ID | #534 | web,api | fix/workspace-domain-project-create | SS-WS-001 | SS-VER-001 | | | | 10K | | Projects page "Workspace ID is required" on create. May be same root cause as SS-WS-001 |
| CT-TERM-003 | done | xterm.js integration — Replace mock TerminalPanel with real xterm.js, WebSocket connection to /terminal namespace, resize handling, copy/paste, theme support | #509 | web | feat/ms19-xterm-integration | CT-TERM-001 | CT-TERM-004 | sonnet | 2026-02-25 | 2026-02-25 | 30K | ~30K | PR #518 merged (417c6ab), 40 tests | | SS-WS-003 | not-started | Fix useWorkspaceId localStorage initialization — ensure workspace ID persists from login | #534 | web | fix/workspace-id-persistence | SS-PLAN-001 | SS-VER-001 | | | | 15K | | Console warning: no workspace ID in localStorage |
| CT-TERM-004 | done | Terminal tab management — Multiple named sessions, create/close/rename tabs, tab switching, session list from API, reconnect on page reload | #509 | web | feat/ms19-terminal-tabs | CT-TERM-001,CT-TERM-002,CT-TERM-003 | CT-VER-001 | sonnet | 2026-02-25 | 2026-02-25 | 20K | ~20K | PR #520 merged (859dcfc), 76 tests, #509 closed | | SS-ORCH-001 | not-started | Fix orchestrator 502 — diagnose and fix proxy connectivity to orchestrator service | #534 | web,api | fix/orchestrator-connectivity | SS-PLAN-001 | SS-ORCH-002 | | | | 25K | | All orchestrator endpoints return 502 |
| CT-CHAT-001 | done | Complete SSE chat streaming — Wire streamChatMessage() in frontend, token-by-token rendering in MessageList, streaming state indicators, abort/cancel support | #510 | web | feat/ms19-chat-streaming-v2 | CT-PLAN-001 | CT-CHAT-002,CT-ORCH-001 | sonnet | 2026-02-25 | 2026-02-25 | 25K | ~25K | PR #516 merged (7de0e73), streaming+fallback+abort | | SS-ORCH-002 | not-started | Fix orchestrator WebSocket connection — "Reconnecting to server..." in chat panel | #534 | web | fix/orchestrator-websocket | SS-ORCH-001 | SS-VER-001 | | | | 15K | | Depends on orchestrator proxy fix |
| CT-CHAT-002 | done | Master chat polish — Model selector dropdown, temperature/params config, conversation search in sidebar, keyboard shortcut improvements, empty state design | #510 | web | feat/ms19-chat-polish | CT-CHAT-001 | CT-VER-001 | sonnet | 2026-02-25 | 2026-02-25 | 15K | ~15K | PR #519 merged (13aa52a), 46 tests, #510 closed | | SS-API-001 | not-started | Implement personalities API — controller, service, DTOs, Prisma model for CRUD | #534 | api | feat/personalities-api | SS-PLAN-001 | SS-UI-002 | | | | 30K | | Cannot GET /api/personalities?isActive=true |
| CT-ORCH-001 | done | Project-level orchestrator chat — Chat context scoped to project, command prefix parsing (/spawn, /status, /jobs, /kill), route commands through orchestrator proxy, display structured responses | #511 | web | feat/ms19-orchestrator-chat | CT-CHAT-001 | CT-ORCH-002,CT-VER-001 | sonnet | 2026-02-25 | 2026-02-25 | 30K | ~25K | PR #521 merged (b110c46), 34 tests | | SS-API-002 | not-started | Implement /users/me/preferences endpoint — wire to UserPreference model | #534 | api | feat/user-preferences-endpoint | SS-PLAN-001 | SS-VER-001 | | | | 15K | | Profile page: "Preferences unavailable" |
| CT-ORCH-002 | done | Agent output in terminal — View orchestrator agent sessions as terminal tabs, stream agent stdout/stderr via SSE (/agents/events), agent lifecycle indicators (spawning/running/done) | #511 | web | feat/ms19-agent-terminal | CT-TERM-001,CT-ORCH-001 | CT-VER-001 | sonnet | 2026-02-25 | 2026-02-25 | 25K | ~25K | PR #522 merged (9b2520c), 79 tests, #511 closed | | SS-UI-001 | not-started | Credential management UI — enable Add Credential button, create/view forms, wire to API | #534 | web | feat/credential-management-ui | SS-PLAN-001 | SS-VER-001 | | | | 25K | | Button currently disabled, feature stubbed |
| CT-VER-001 | done | Unit tests — Tests for terminal gateway, xterm component, chat streaming, orchestrator chat, agent terminal integration | #512 | web,api | — | CT-TERM-004,CT-CHAT-002,CT-ORCH-001,CT-ORCH-002 | CT-DOC-001 | orchestrator | 2026-02-25 | 2026-02-25 | 20K | ~5K | 328 MS19 tests (268 web + 60 API), all inline with tasks | | SS-UI-002 | not-started | Fix personalities page — dark mode Formality dropdown, save functionality, wire to API | #534 | web | fix/personalities-page | SS-API-001 | SS-VER-001 | | | | 15K | | Dark mode theming broken, unable to save |
| CT-DOC-001 | done | Documentation updatesTASKS.md, manifest, scratchpad, PRD status updates | #512 | — | — | CT-VER-001 | CT-VER-002 | orchestrator | 2026-02-25 | 2026-02-25 | 10K | ~5K | Updated PRD, manifest, scratchpad, TASKS.md | | SS-UI-003 | not-started | Terminal page route — create /terminal page with full-screen terminal panel | #534 | web | feat/terminal-page-route | SS-PLAN-001 | SS-VER-001 | | | | 10K | | Sidebar Terminal link goes to #terminal anchor |
| CT-VER-002 | done | Deploy + smoke test — Deploy to Portainer, verify terminal, chat streaming, orchestrator chat, agent output all functional | #512 | — | — | CT-DOC-001 | | orchestrator | 2026-02-25 | 2026-02-25 | 15K | ~5K | CI #635 green, web deployed (sha:7165e7a), API crash pre-existing | | SS-UI-004 | not-started | Add favicon.ico and fix dark mode polish | #534 | web | fix/favicon-polish | SS-PLAN-001 | SS-VER-001 | | | | 5K | | favicon.ico 404 |
| SS-VER-001 | not-started | Verification — full site test, all pages load without errors, deploy + smoke test | #534 | web,api | — | SS-WS-002,SS-WS-003,SS-ORCH-002,SS-API-002,SS-UI-001,SS-UI-002,SS-UI-003,SS-UI-004 | SS-DOC-001 | | | | 15K | | Primary validation gate |
| SS-DOC-001 | not-started | Documentation — update PRD status, manifest, scratchpad, close mission | #534 | — | — | SS-VER-001 | | | | | 5K | | |
## Summary ## Summary
| Metric | Value | | Metric | Value |
| --------------- | ----------------- | | --------------- | ---------------------- |
| Total tasks | 12 | | Total tasks | 14 |
| Completed | 12 | | Completed | 1 |
| In Progress | 0 | | In Progress | 0 |
| Remaining | 0 | | Remaining | 13 |
| Estimated total | ~250K tokens | | Estimated total | ~215K tokens |
| Used | ~215K tokens | | Used | ~15K tokens |
| Milestone | MS19-ChatTerminal | | Milestone | MS20-SiteStabilization |
## Dependency Graph ## Dependency Graph
``` ```
PLAN-001 ──┬──→ TERM-001 ──┬──→ TERM-003 ──→ TERM-004 ──→ VER-001 ──→ DOC-001 ──→ VER-002 PLAN-001 ──┬──→ WS-001 ──→ WS-002 ──→ VER-001 ──→ DOC-001
│ │ ↑
│ └──→ ORCH-002 ───────┘
│ ↑
├──→ TERM-002 ────────→ TERM-004
├──→ CHAT-001 ──┬──→ CHAT-002 ──→ VER-001 ├──→ WS-003 ──→ VER-001
│ │
│ └──→ ORCH-001 ──→ ORCH-002
──→ CHAT-002 (also depends on CHAT-001) ──→ ORCH-001 ──→ ORCH-002 ──→ VER-001
├──→ API-001 ──→ UI-002 ──→ VER-001
├──→ API-002 ──→ VER-001
├──→ UI-001 ──→ VER-001
├──→ UI-003 ──→ VER-001
└──→ UI-004 ──→ VER-001
``` ```
## Parallel Execution Opportunities ## Parallel Execution Opportunities
- **Wave 1** (after PLAN-001): TERM-001 + TERM-002 + CHAT-001 can run in parallel (3 independent tracks) - **Wave 1** (after PLAN-001): WS-001 + WS-003 + ORCH-001 + API-001 + API-002 + UI-001 + UI-003 + UI-004 (all independent)
- **Wave 2**: TERM-003 (after TERM-001) + CHAT-002 (after CHAT-001) + ORCH-001 (after CHAT-001) can overlap - **Wave 2**: WS-002 (after WS-001) + ORCH-002 (after ORCH-001) + UI-002 (after API-001)
- **Wave 3**: TERM-004 (after TERM-001+002+003) + ORCH-002 (after TERM-001+ORCH-001) - **Wave 3**: VER-001 (after all implementation)
- **Wave 4**: VER-001 (after all implementation) - **Wave 4**: DOC-001 (after verification)
- **Wave 5**: DOC-001 → VER-002 (sequential)

View File

@@ -0,0 +1,67 @@
# Mission Scratchpad — MS20 Site Stabilization
> Append-only log. NEVER delete entries. NEVER overwrite sections.
> This is the orchestrator's working memory across sessions.
## Original Mission Prompt
```
User tested every aspect of mosaic.woltje.com and found:
settings/personalities:
- Unable to save new personality
- Dark mode theming on Formality Level dropdown not correct
- Error: Cannot GET /api/personalities?isActive=true
settings/credentials:
- "Loading credentials" displayed, none populated, unable to add
- favicon.ico 404
- useWorkspaceId warning in console
settings/domains:
- Workspace ID is required error
projects:
- Unable to create new project
- Workspace ID is required error
Additional:
- Fix Orchestrator 502
- Fix Orchestrator WebSocket connection
- /users/me/preferences endpoint needs implemented
- #terminal anchor panel toggle needs page route
```
## Planning Decisions
### S1 — 2026-02-27
1. **Mission scope**: Stabilization mission covering runtime bugs and feature gaps from live testing. NOT the originally planned MS20-MultiTenant. Bumped MultiTenant to MS21.
2. **Task categorization**:
- P1 (Critical — blocking core functionality): Workspace context for mutations, orchestrator 502
- P2 (High — important features): Personalities API, preferences endpoint, credentials UI, terminal route
- P3 (Medium — polish): Dark mode dropdown, favicon, workspace ID warning
3. **PRD updated**: Added FR-020 (Site Stabilization) with 6 new assumptions. Shifted MS20-MultiTenant to MS21, renumbered subsequent milestones.
4. **Prior fixes already merged**:
- PR #531: RLS context SQL, workspace guard crash, projects response unwrapping
- PR #532: Widget endpoints workspace context + auto-detect workspace ID + credentials pages
- PR #533: Knowledge entry query DTO — sortBy, sortOrder, search, visibility
## Session Log
| Session | Date | Milestone | Tasks Done | Outcome |
| ------- | ---------- | --------- | ---------- | ----------- |
| S1 | 2026-02-27 | MS20 | Planning | In progress |
## Open Questions
- Orchestrator 502: Is the orchestrator container actually running? Need to check Docker service status.
- Workspace ID lifecycle: When does the workspace ID first get set in localStorage? Is it during login/auth callback?
- Credentials backend: Do the M7 credential CRUD endpoints still work, or has something changed since?
## Corrections
<!-- Record any corrections to earlier decisions or assumptions. -->