coaia-visualizer 1.6.2 โ†’ 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/package.json +30 -1
  2. package/.dockerignore +0 -9
  3. package/COMPLETE_IMPLEMENTATION_REPORT.md +0 -215
  4. package/Dockerfile +0 -61
  5. package/Dockerfile.app +0 -50
  6. package/QUICK_START_MCP_TESTING.md +0 -236
  7. package/STC.md +0 -24
  8. package/STCGOAL.md +0 -0
  9. package/STCISSUE.md +0 -48
  10. package/STCKIN.md +0 -0
  11. package/STCMASTERY.md +0 -0
  12. package/STUDY_REPORT.md +0 -510
  13. package/direct-test.sh +0 -180
  14. package/docker-build-push.sh +0 -20
  15. package/docker-compose.test.yml +0 -69
  16. package/docker-entrypoint.sh +0 -27
  17. package/jgwill.coaia-visualizer-8--496dca71-d476-4ac9-ba9f-376add118dd8--260208.txt +0 -2612
  18. package/mcp/test_mcp/.gemini/settings.json +0 -18
  19. package/rispecs/README.md +0 -170
  20. package/rispecs/accountability-responsibility.rispec.md +0 -110
  21. package/rispecs/api-mcp-interface.spec.md +0 -287
  22. package/rispecs/app.spec.md +0 -364
  23. package/rispecs/chart-editing-workflow.spec.md +0 -297
  24. package/rispecs/chart-visualization-hierarchy.spec.md +0 -235
  25. package/rispecs/cli-mode.spec.md +0 -224
  26. package/rispecs/github-project-runtime-memory-integration.spec.md +0 -381
  27. package/rispecs/jsonl-parsing-data-types.spec.md +0 -243
  28. package/rispecs/narrative-beats-display.spec.md +0 -189
  29. package/rispecs/pde-integration.spec.md +0 -280
  30. package/rispecs/planning-integration.spec.md +0 -329
  31. package/rispecs/relation-graph-visualization.spec.md +0 -171
  32. package/rispecs/relation-to-mcp-structural-thinking.kin.md +0 -65
  33. package/rispecs/ui-component-library.spec.md +0 -258
  34. package/test-data/test-master.jsonl +0 -11
  35. package/test-results/.last-run.json +0 -4
  36. package/test-scripts/README.md +0 -325
  37. package/test-scripts/rich-jsonl-preservation.spec.ts +0 -118
  38. package/test-scripts/run-all-tests.sh +0 -38
  39. package/test-scripts/test-01-basic-operations.sh +0 -87
  40. package/test-scripts/test-02-telescope-creation.sh +0 -91
  41. package/test-scripts/test-03-navigation.sh +0 -87
  42. package/test-scripts/test-global-cli.spec.ts +0 -220
  43. package/test-scripts/verify-global-cli.sh +0 -87
@@ -1,258 +0,0 @@
1
- # UI Component Library
2
- ## RISE Specification for Shared UI Primitives, Theming, and Statistics Display
3
-
4
- **Component Purpose**: Provide consistent, accessible, and themed UI primitives across the entire visualizer โ€” built on Radix UI with shadcn patterns, supporting dark/light themes, and including statistical overview components.
5
-
6
- **Source Files**: `components/ui/*.tsx`, `components/theme-provider.tsx`, `components/theme-toggle.tsx`, `components/data-stats.tsx`, `components/live-indicator.tsx`, `components/file-upload.tsx`, `lib/utils.ts`
7
-
8
- ---
9
-
10
- ## ๐ŸŽฏ What This Component Enables Users to Create
11
-
12
- - A consistent visual language across all visualizer views
13
- - Dark/light theme support with system preference detection
14
- - Accessible UI interactions via Radix UI primitives
15
- - At-a-glance data statistics for quick structural assessment
16
- - Live polling status awareness
17
- - Drag-and-drop file upload experience
18
-
19
- ---
20
-
21
- ## ๐ŸŒŠ Structural Tension Dynamics
22
-
23
- ### Current Reality
24
- The visualizer needs 12+ distinct UI primitive types (buttons, cards, dialogs, inputs, tabs, etc.) plus application-specific components (stats, live indicator, file upload, theme toggle). Without a unified component library, each feature would implement its own styling, creating inconsistency.
25
-
26
- ### Desired Result
27
- A coherent component library where:
28
- - All primitives follow the same design tokens (colors, spacing, borders)
29
- - Dark/light themes switch seamlessly without component-level overrides
30
- - Accessibility is built into the foundation (Radix UI handles ARIA, focus management)
31
- - Application-specific components (DataStats, LiveIndicator, FileUpload) use the same primitives
32
-
33
- ### Natural Resolution
34
- Radix UI provides headless, accessible primitives. shadcn patterns add consistent styling via Tailwind CSS class variants (CVA). The `cn()` utility merges class names safely. `next-themes` handles theme persistence.
35
-
36
- ---
37
-
38
- ## ๐Ÿ“‹ Utility: `cn()` (lib/utils.ts)
39
-
40
- ```typescript
41
- import { clsx, type ClassValue } from 'clsx'
42
- import { twMerge } from 'tailwind-merge'
43
-
44
- export function cn(...inputs: ClassValue[]): string {
45
- return twMerge(clsx(inputs))
46
- }
47
- ```
48
-
49
- Used throughout all components to safely combine Tailwind classes with conflict resolution.
50
-
51
- ---
52
-
53
- ## ๐Ÿ“‹ UI Primitives (components/ui/)
54
-
55
- ### Badge
56
- - **Variants**: default, secondary, destructive, outline
57
- - **Usage**: Chart level indicators, relation type labels, universe tags, completion status
58
-
59
- ### Button
60
- - **Variants**: default, destructive, outline, secondary, ghost, link
61
- - **Sizes**: default, sm, lg, icon, icon-sm, icon-lg
62
- - **Usage**: All interactive triggers โ€” save, edit, cancel, add, delete, navigate
63
-
64
- ### Card (+ Header, Title, Description, Action, Content, Footer)
65
- - **Structure**: Container โ†’ Header (grid layout) โ†’ Content โ†’ Footer
66
- - **Usage**: Chart items, stat cards, narrative beat cards, form containers
67
- - **Notable**: Container queries for responsive header layout
68
-
69
- ### Dialog (+ Trigger, Content, Overlay, Header, Footer, Title, Description)
70
- - **Behavior**: Modal with overlay, close button, fade/zoom animations
71
- - **Usage**: AddMasterChart form, confirmation dialogs
72
-
73
- ### Input
74
- - **Features**: File input styling, focus rings, disabled states
75
- - **Usage**: Date inputs, text fields
76
-
77
- ### Label
78
- - **Features**: Radix UI label with icon support, disabled/readonly states
79
- - **Usage**: Form field labels
80
-
81
- ### Textarea
82
- - **Features**: Min-height 80px, focus rings, auto-resize support
83
- - **Usage**: Desired outcome editing, current reality observations, action descriptions
84
-
85
- ### Tabs (+ List, Trigger, Content)
86
- - **Features**: Pill-styled triggers, active state highlighting
87
- - **Usage**: Actions/Relations tabs in chart detail, Hierarchy/List view toggle, Upload/Create form toggle
88
-
89
- ### Calendar
90
- - **Features**: react-day-picker wrapper with custom styling
91
- - **Usage**: Due date selection in popovers
92
-
93
- ### Popover (+ Trigger, Content)
94
- - **Features**: Radix UI popover with portal, positioned relative to trigger
95
- - **Usage**: Date pickers, action toolbars
96
-
97
- ### ScrollArea (+ Scrollbar)
98
- - **Features**: Custom scrollbar styling, vertical/horizontal support
99
- - **Usage**: Chart list panel scrolling
100
-
101
- ### Separator
102
- - **Features**: Horizontal/vertical, decorative by default
103
- - **Usage**: Section dividers in chart detail
104
-
105
- ---
106
-
107
- ## ๐Ÿ“‹ Theme System
108
-
109
- ### ThemeProvider (`components/theme-provider.tsx`)
110
- - Wraps `next-themes` ThemeProvider
111
- - Default theme: dark
112
- - Attribute-based switching (`class` attribute on `<html>`)
113
- - System preference detection
114
-
115
- ### ThemeToggle (`components/theme-toggle.tsx`)
116
- - Sun icon (in dark mode) / Moon icon (in light mode)
117
- - Hydration-safe: renders placeholder before mount to avoid SSR mismatch
118
- - Uses `useTheme()` hook from next-themes
119
-
120
- ### Color Tokens
121
- The visualizer uses `chart-1` through `chart-4` color themes for semantic distinction:
122
- - **chart-1** (teal): Desired outcomes
123
- - **chart-2** (amber): Current reality
124
- - **chart-3**: Narrative beats, accents
125
- - **chart-4**: Statistics, misc
126
-
127
- ---
128
-
129
- ## ๐Ÿ“‹ DataStats Component
130
-
131
- ### Props
132
- ```typescript
133
- interface DataStatsProps {
134
- data: ParsedData
135
- }
136
- ```
137
-
138
- ### Render Structure
139
- ```
140
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
141
- โ”‚ ๐ŸŽฏ 12 โ”‚ โ”‚ โœ… 8/15 โ”‚ โ”‚ ๐Ÿ“„ 47 โ”‚ โ”‚ ๐Ÿ”— 32 โ”‚
142
- โ”‚ Charts โ”‚ โ”‚ Actions โ”‚ โ”‚ Entitiesโ”‚ โ”‚Relationsโ”‚
143
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
144
- ```
145
-
146
- **Lucide Icons**: `Target` (Charts), `BarChart3` (Actions), `FileText` (Entities), `Network` (Relations)
147
-
148
- **Computed Statistics**:
149
- 1. **Charts**: `data.charts.length`
150
- 2. **Actions**: `{completed}/{total}` โ€” iterates all charts, sums action counts, counts completion status
151
- 3. **Entities**: `data.entities.size`
152
- 4. **Relations**: `data.relations.length`
153
- 5. **Total Beats**: computed across all charts but currently unused in display
154
-
155
- Each card shows Lucide icon (color-coded chart-1 through chart-4), value, and label.
156
-
157
- > **Note**: Toast notifications use `sonner` (imported as `toast` from `sonner`), not the shadcn `use-toast` hook. Both exist in the codebase but `sonner` is the active integration.
158
-
159
- ---
160
-
161
- ## ๐Ÿ“‹ LiveIndicator Component
162
-
163
- ### Props
164
- ```typescript
165
- { isLive: boolean }
166
- ```
167
-
168
- ### Render
169
- ```
170
- When isLive=true: โ— LIVE (green pulse animation)
171
- When isLive=false: โ—‹ Monitoring (gray, no animation)
172
- ```
173
-
174
- - Animated green pulse dot when live data detected
175
- - Tailwind pulse + shadow animations
176
- - No interactivity โ€” pure display
177
-
178
- ### Integration
179
- Driven by `useLivePolling` hook which polls `/api/watch` and flashes `isLive=true` for 2 seconds when new data detected.
180
-
181
- ---
182
-
183
- ## ๐Ÿ“‹ FileUpload Component
184
-
185
- ### Props
186
- ```typescript
187
- interface FileUploadProps {
188
- onFileLoad: (content: string, fileName: string) => void
189
- }
190
- ```
191
-
192
- ### Render
193
- ```
194
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
195
- โ”‚ ๐Ÿ“ Upload Icon โ”‚
196
- โ”‚ โ”‚
197
- โ”‚ Drag & drop your .jsonl file โ”‚
198
- โ”‚ or click to browse โ”‚
199
- โ”‚ โ”‚
200
- โ”‚ Supports .jsonl and .txt files โ”‚
201
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
202
- ```
203
-
204
- **Behavior**:
205
- - Hidden `<input type="file" accept=".jsonl,.txt">` triggered by card click
206
- - Drag-and-drop: `handleDragOver` prevents default, `handleDrop` reads first file
207
- - `FileReader` API reads file as text
208
- - Passes content and filename to parent via `onFileLoad`
209
-
210
- ---
211
-
212
- ## ๐Ÿ“‹ Technology Stack
213
-
214
- | Library | Version | Purpose |
215
- |:---|:---|:---|
216
- | Radix UI | Various @radix-ui/* packages | Headless accessible primitives |
217
- | Tailwind CSS | 4.1.9 | Utility-first styling |
218
- | class-variance-authority (CVA) | โ€” | Component variant management |
219
- | clsx | โ€” | Conditional class joining |
220
- | tailwind-merge | โ€” | Conflict-free class merging |
221
- | next-themes | โ€” | Dark/light theme provider |
222
- | react-day-picker | โ€” | Calendar date selection |
223
- | lucide-react | โ€” | Icon library |
224
- | sonner | โ€” | Toast notifications |
225
- | recharts | 2.15.4 | Data visualization charts |
226
-
227
- ---
228
-
229
- ## โœ… Quality Criteria
230
-
231
- โœ… **Consistency**
232
- - All components use `cn()` for class management
233
- - CVA variants ensure consistent styling across instances
234
- - Color tokens used semantically (chart-1 for outcomes, chart-2 for reality)
235
-
236
- โœ… **Accessibility**
237
- - Radix UI provides ARIA attributes, keyboard navigation, and focus management
238
- - Labels associate correctly with inputs
239
- - Dialogs trap focus and handle escape key
240
-
241
- โœ… **Theme Support**
242
- - Dark mode is default, light mode available
243
- - Hydration-safe theme toggle (no flash of wrong theme)
244
- - All components respect theme context
245
-
246
- โœ… **Responsive Design**
247
- - Responsive typography (md: breakpoints)
248
- - Container queries for card header layout
249
- - ScrollArea for overflow handling
250
-
251
- ---
252
-
253
- ## ๐Ÿ”— Related Components
254
-
255
- - [chart-visualization-hierarchy.spec.md](./chart-visualization-hierarchy.spec.md) โ€” uses Card, Badge, ScrollArea, Tabs extensively
256
- - [chart-editing-workflow.spec.md](./chart-editing-workflow.spec.md) โ€” uses Button, Textarea, Dialog, Calendar, Popover
257
- - [narrative-beats-display.spec.md](./narrative-beats-display.spec.md) โ€” uses Card, Badge
258
- - [app.spec.md](./app.spec.md) โ€” full application context for all UI components
@@ -1,11 +0,0 @@
1
- {"type":"Entity","name":"chart_test_master_chart","entityType":"chart","observations":["Master test chart for MCP integration testing"],"metadata":{"createdAt":"2026-01-16T00:00:00.000Z","dueDate":"2026-02-15"}}
2
- {"type":"Entity","name":"action_Setup_test_environment","entityType":"action","observations":["Setup test environment"]}
3
- {"type":"Entity","name":"action_Test_basic_operations","entityType":"action","observations":["Test basic operations"]}
4
- {"type":"Entity","name":"action_Test_telescope_feature","entityType":"action","observations":["Test telescope feature"]}
5
- {"type":"Relation","from":"chart_test_master_chart","to":"action_Setup_test_environment","relationType":"hasAction"}
6
- {"type":"Relation","from":"chart_test_master_chart","to":"action_Test_basic_operations","relationType":"hasAction"}
7
- {"type":"Relation","from":"chart_test_master_chart","to":"action_Test_telescope_feature","relationType":"hasAction"}
8
- {"type":"Entity","name":"outcome_Complete_MCP_testing","entityType":"desiredOutcome","observations":["Complete MCP integration testing suite"]}
9
- {"type":"Relation","from":"chart_test_master_chart","to":"outcome_Complete_MCP_testing","relationType":"hasDesiredOutcome"}
10
- {"type":"Entity","name":"reality_Initial_state","entityType":"currentReality","observations":["Starting MCP test suite","No charts created yet","Need to validate all MCP tools"]}
11
- {"type":"Relation","from":"chart_test_master_chart","to":"reality_Initial_state","relationType":"hasCurrentReality"}
@@ -1,4 +0,0 @@
1
- {
2
- "status": "passed",
3
- "failedTests": []
4
- }
@@ -1,325 +0,0 @@
1
- # COAIA Visualizer MCP Testing Guide
2
-
3
- ## Overview
4
-
5
- This directory contains a complete Docker-based testing environment for the COAIA Visualizer MCP server. The test suite validates all MCP tools, including the telescope functionality.
6
-
7
- ## Architecture
8
-
9
- ```
10
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
11
- โ”‚ Test Runner โ”‚
12
- โ”‚ (test-scripts/) โ”‚
13
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
14
- โ”‚
15
- โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
16
- โ”‚ โ”‚
17
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
18
- โ”‚ MCP Server โ”‚ โ”‚ Next.js App โ”‚
19
- โ”‚ (stdio) โ”‚ โ”‚ (HTTP:4321) โ”‚
20
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
21
- โ”‚ โ”‚
22
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
23
- โ”‚
24
- โ”Œโ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”
25
- โ”‚ Data โ”‚
26
- โ”‚ (JSONL) โ”‚
27
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
28
- ```
29
-
30
- ## Quick Start
31
-
32
- ### 1. Set up environment variables (optional)
33
-
34
- ```bash
35
- # For Claude CLI testing
36
- export ANTHROPIC_API_KEY="your_key_here"
37
-
38
- # For Gemini CLI testing
39
- export GOOGLE_API_KEY="your_key_here"
40
- ```
41
-
42
- **Note:** API keys are optional. Tests will use direct HTTP calls if not provided.
43
-
44
- ### 2. Run all tests
45
-
46
- ```bash
47
- chmod +x run-mcp-tests.sh
48
- ./run-mcp-tests.sh
49
- ```
50
-
51
- This will:
52
- - Build Docker images for all services
53
- - Start the visualizer app and MCP server
54
- - Run the complete test suite
55
- - Generate test results
56
- - Clean up containers
57
-
58
- ## Test Suite
59
-
60
- ### Test 01: Basic Operations
61
- - Creates charts via API
62
- - Lists all charts
63
- - Verifies chart creation
64
-
65
- ### Test 02: Telescope Creation
66
- - Adds action steps to charts
67
- - Creates telescoped charts from actions
68
- - Tests both `add_action_step` (with createAsTelescopedChart flag)
69
- - Tests `create_telescoped_chart` tool
70
- - Verifies sub-chart creation
71
-
72
- ### Test 03: Navigation & Hierarchy
73
- - Retrieves parent charts
74
- - Retrieves telescoped child charts
75
- - Verifies parent-child relationships
76
- - Tests search functionality
77
- - Validates navigation metadata
78
-
79
- ## Test Results
80
-
81
- After running tests, check:
82
- - `test-results/test-01/` - Basic operations results
83
- - `test-results/test-02/` - Telescope creation results
84
- - `test-results/test-03/` - Navigation results
85
- - `test-results/test-summary.txt` - Overall summary
86
- - `test-results/navigation-summary.txt` - Navigation summary
87
-
88
- ## Manual Testing
89
-
90
- ### Start services only
91
-
92
- ```bash
93
- docker-compose -f docker-compose.test.yml up -d visualizer-app mcp-server
94
- ```
95
-
96
- ### Access the app
97
-
98
- ```bash
99
- # Web UI
100
- http://localhost:4321
101
-
102
- # API endpoint
103
- curl http://localhost:4321/api/charts
104
- ```
105
-
106
- ### Run individual tests
107
-
108
- ```bash
109
- docker-compose -f docker-compose.test.yml run --rm test-runner /test-scripts/test-01-basic-operations.sh
110
- ```
111
-
112
- ### Check logs
113
-
114
- ```bash
115
- docker-compose -f docker-compose.test.yml logs visualizer-app
116
- docker-compose -f docker-compose.test.yml logs mcp-server
117
- ```
118
-
119
- ### Stop services
120
-
121
- ```bash
122
- docker-compose -f docker-compose.test.yml down
123
- ```
124
-
125
- ## MCP Server Configuration
126
-
127
- The MCP server is configured via `mcp-config.json`:
128
-
129
- ```json
130
- {
131
- "mcpServers": {
132
- "coaia-visualizer": {
133
- "command": "node",
134
- "args": ["/app/dist/index.js"],
135
- "env": {
136
- "VISUALIZER_API_URL": "http://visualizer-app:4321",
137
- "VISUALIZER_API_KEY": "test-api-key"
138
- }
139
- }
140
- }
141
- }
142
- ```
143
-
144
- ## Connecting with Claude Desktop
145
-
146
- To use the MCP server with Claude Desktop:
147
-
148
- 1. Copy the built MCP server:
149
- ```bash
150
- docker cp $(docker-compose -f docker-compose.test.yml ps -q mcp-server):/app/dist ./mcp-dist
151
- ```
152
-
153
- 2. Update Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
154
- ```json
155
- {
156
- "mcpServers": {
157
- "coaia-visualizer": {
158
- "command": "node",
159
- "args": ["<path-to>/mcp-dist/index.js"],
160
- "env": {
161
- "VISUALIZER_API_URL": "http://localhost:4321",
162
- "VISUALIZER_API_KEY": "your-api-key"
163
- }
164
- }
165
- }
166
- }
167
- ```
168
-
169
- 3. Restart Claude Desktop
170
-
171
- ## Available MCP Tools
172
-
173
- - `create_chart` - Create new structural tension chart
174
- - `update_chart` - Update existing chart
175
- - `delete_chart` - Delete chart
176
- - `search_charts` - Search charts by query
177
- - `create_telescoped_chart` - **NEW** Telescope existing action into sub-chart
178
- - `add_action_step` - Add action (optionally as telescoped chart)
179
-
180
- ## Troubleshooting
181
-
182
- ### Services won't start
183
- ```bash
184
- # Check logs
185
- docker-compose -f docker-compose.test.yml logs
186
-
187
- # Rebuild images
188
- docker-compose -f docker-compose.test.yml build --no-cache
189
- ```
190
-
191
- ### Tests fail
192
- ```bash
193
- # Check individual test output
194
- cat test-results/test-01/*.json
195
- cat test-results/test-02/*.json
196
- cat test-results/test-03/*.json
197
- ```
198
-
199
- ### API connection issues
200
- ```bash
201
- # Verify network connectivity
202
- docker-compose -f docker-compose.test.yml exec test-runner curl -v http://visualizer-app:4321/api/charts
203
- ```
204
-
205
- ## Development
206
-
207
- ### Modify tests
208
-
209
- Edit files in `test-scripts/`:
210
- - `run-all-tests.sh` - Main test orchestrator
211
- - `test-01-basic-operations.sh` - Basic CRUD tests
212
- - `test-02-telescope-creation.sh` - Telescope feature tests
213
- - `test-03-navigation.sh` - Navigation and hierarchy tests
214
-
215
- ### Add test data
216
-
217
- Add JSONL files to `test-data/`:
218
- - `test-master.jsonl` - Sample chart with actions
219
-
220
- ### Update Docker images
221
-
222
- Modify:
223
- - `Dockerfile.app` - Next.js application
224
- - `mcp/Dockerfile` - MCP server
225
- - `Dockerfile.test` - Test runner environment
226
-
227
- ## CI/CD Integration
228
-
229
- This test suite can be integrated into CI/CD pipelines:
230
-
231
- ```yaml
232
- # Example GitHub Actions
233
- - name: Run MCP Tests
234
- run: |
235
- chmod +x run-mcp-tests.sh
236
- ./run-mcp-tests.sh
237
- env:
238
- ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
239
- ```
240
-
241
- ---
242
-
243
- ## Global CLI Testing
244
-
245
- ### Quick Test
246
-
247
- ```bash
248
- # Run the verification script
249
- ./test-scripts/verify-global-cli.sh
250
- ```
251
-
252
- ### Tests Included
253
-
254
- #### 1. Bash Verification Script
255
- **File:** `test-scripts/verify-global-cli.sh`
256
-
257
- **What it tests:**
258
- - โœ… CLI starts without errors
259
- - โœ… No file watch limit errors (Turbopack)
260
- - โœ… Server becomes ready within timeout
261
- - โœ… HTTP endpoint responds correctly
262
- - โœ… Turbopack uses correct project directory
263
-
264
- **Usage:**
265
- ```bash
266
- ./test-scripts/verify-global-cli.sh
267
- ```
268
-
269
- #### 2. Playwright End-to-End Tests
270
- **File:** `test-scripts/test-global-cli.spec.ts`
271
-
272
- **What it tests:**
273
- - โœ… CLI launches without file watch errors
274
- - โœ… Server starts and responds to HTTP requests
275
- - โœ… UI loads with correct content
276
- - โœ… Sample chart data loads correctly
277
- - โœ… Different port configurations work
278
-
279
- **Usage:**
280
- ```bash
281
- npm run test:global-cli
282
- ```
283
-
284
- ### Expected Output
285
-
286
- #### Successful Test
287
- ```
288
- ๐Ÿงช Testing globally installed coaia-visualizer CLI
289
- ๐Ÿ“ Sample file: /a/src/coaia-visualizer/samples/tradingchart.jsonl
290
- ๐ŸŒ Port: 3099
291
-
292
- โณ Waiting for server to start (PID: 123456)...
293
- โœ… Server started successfully
294
- ๐Ÿ” Testing HTTP response...
295
- โœ… Server responding correctly
296
- ๐Ÿ” Checking for file watch errors...
297
- โœ… No file watch errors detected
298
- ๐Ÿ” Verifying Turbopack project directory...
299
- โœ… Turbopack using correct project directory
300
-
301
- โœ… All tests passed! CLI works correctly without file watch errors.
302
- ```
303
-
304
- ### Testing After CLI Changes
305
-
306
- After making changes to the CLI, always:
307
-
308
- 1. **Rebuild the CLI:**
309
- ```bash
310
- npm run build:cli
311
- ```
312
-
313
- 2. **Reinstall globally:**
314
- ```bash
315
- npm install -g .
316
- ```
317
-
318
- 3. **Run verification:**
319
- ```bash
320
- ./test-scripts/verify-global-cli.sh
321
- ```
322
-
323
- ### Related Documentation
324
-
325
- - [CLI_FILE_WATCHING_FIX.md](../CLI_FILE_WATCHING_FIX.md) - Complete fix documentation