coaia-visualizer 1.4.2 → 1.5.0
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.
- package/.dockerignore +9 -0
- package/Dockerfile.app +50 -0
- package/Dockerfile.test +24 -0
- package/LIVE_MODE_DESIGN.md +435 -0
- package/MCP_TESTING_COMPLETE.md +302 -0
- package/MCP_TESTING_IMPLEMENTATION_SUMMARY.md +317 -0
- package/MCP_TESTING_SETUP.md +268 -0
- package/NAMING.md +218 -0
- package/QUICK_START_MCP_TESTING.md +236 -0
- package/WS__issue_8__coaia-visualizer__260207.code-workspace +45 -0
- package/app/api/audio/[filename]/route.ts +37 -0
- package/app/api/charts/[id]/route.ts +48 -35
- package/app/api/watch/route.ts +42 -0
- package/app/page.tsx +103 -53
- package/cli.ts +56 -3
- package/components/add-master-chart.tsx +230 -0
- package/components/chart-detail-editable.tsx +27 -16
- package/components/chart-list.tsx +13 -1
- package/components/create-chart-form.tsx +248 -0
- package/components/data-stats.tsx +9 -7
- package/components/live-indicator.tsx +14 -0
- package/components/ui/dialog.tsx +143 -0
- package/components/ui/label.tsx +24 -0
- package/direct-test.sh +180 -0
- package/dist/cli.js +52 -3
- package/docker-compose.test.yml +69 -0
- package/hooks/use-live-polling.ts +45 -0
- package/jgwill.coaia-visualizer-8--496dca71-d476-4ac9-ba9f-376add118dd8--260208.txt +2612 -0
- package/lib/chart-editor.ts +281 -68
- package/mcp/Dockerfile +21 -0
- package/mcp/README.md +25 -6
- package/mcp/src/api-client.ts +15 -3
- package/mcp/src/index.ts +17 -2
- package/mcp/src/tools/index.ts +21 -1
- package/mcp/test_mcp/.gemini/settings.json +18 -0
- package/mcp-config.json +14 -0
- package/package.json +2 -2
- package/run-mcp-tests.sh +99 -0
- package/samples/tradingchart.jsonl +31 -0
- package/test-data/test-master.jsonl +11 -0
- package/test-run.log +101 -0
- package/test-scripts/README.md +239 -0
- package/test-scripts/run-all-tests.sh +38 -0
- package/test-scripts/test-01-basic-operations.sh +87 -0
- package/test-scripts/test-02-telescope-creation.sh +91 -0
- package/test-scripts/test-03-navigation.sh +87 -0
- package/validate-mcp.sh +136 -0
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# MCP Testing Environment Setup Complete
|
|
2
|
+
|
|
3
|
+
## 🎯 Overview
|
|
4
|
+
|
|
5
|
+
A complete Docker-based testing environment has been created for non-interactive MCP server validation. The setup allows testing all MCP tools, including the newly implemented telescope functionality, without requiring manual intervention.
|
|
6
|
+
|
|
7
|
+
## 📁 Created Files
|
|
8
|
+
|
|
9
|
+
### Docker Infrastructure
|
|
10
|
+
- **docker-compose.test.yml** - Orchestrates 3 services:
|
|
11
|
+
- `visualizer-app` - Next.js application (port 4321)
|
|
12
|
+
- `mcp-server` - MCP server with stdio transport
|
|
13
|
+
- `test-runner` - Automated test execution container
|
|
14
|
+
|
|
15
|
+
- **Dockerfile.app** - Multi-stage Next.js production build
|
|
16
|
+
- **mcp/Dockerfile** - MCP server container
|
|
17
|
+
- **Dockerfile.test** - Test runner with bash, curl, jq, MCP inspector
|
|
18
|
+
|
|
19
|
+
### Configuration
|
|
20
|
+
- **.env.test** - Environment variables for testing
|
|
21
|
+
- **mcp-config.json** - MCP server configuration for claude-code/gemini-cli
|
|
22
|
+
- **.dockerignore** - Optimizes Docker build context
|
|
23
|
+
|
|
24
|
+
### Test Scripts
|
|
25
|
+
- **run-mcp-tests.sh** - Main test orchestrator
|
|
26
|
+
- **test-scripts/run-all-tests.sh** - Sequential test runner
|
|
27
|
+
- **test-scripts/test-01-basic-operations.sh** - CRUD operations
|
|
28
|
+
- **test-scripts/test-02-telescope-creation.sh** - Telescope feature tests
|
|
29
|
+
- **test-scripts/test-03-navigation.sh** - Hierarchy and navigation tests
|
|
30
|
+
- **test-scripts/README.md** - Complete testing guide
|
|
31
|
+
|
|
32
|
+
### Test Data
|
|
33
|
+
- **test-data/test-master.jsonl** - Sample chart with actions for testing
|
|
34
|
+
|
|
35
|
+
## 🚀 Quick Start
|
|
36
|
+
|
|
37
|
+
### Run All Tests
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
cd /workspace/repos/jgwill/coaia-visualizer-feat-4
|
|
41
|
+
./run-mcp-tests.sh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This command:
|
|
45
|
+
1. ✅ Builds all Docker images (app, MCP server, test runner)
|
|
46
|
+
2. ✅ Starts services with health checks
|
|
47
|
+
3. ✅ Runs complete test suite non-interactively
|
|
48
|
+
4. ✅ Generates test results in `test-results/`
|
|
49
|
+
5. ✅ Cleans up containers
|
|
50
|
+
|
|
51
|
+
### Individual Test Commands
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Build images only
|
|
55
|
+
docker-compose -f docker-compose.test.yml build
|
|
56
|
+
|
|
57
|
+
# Start services
|
|
58
|
+
docker-compose -f docker-compose.test.yml up -d visualizer-app mcp-server
|
|
59
|
+
|
|
60
|
+
# Run specific test
|
|
61
|
+
docker-compose -f docker-compose.test.yml run --rm test-runner \
|
|
62
|
+
/test-scripts/test-02-telescope-creation.sh
|
|
63
|
+
|
|
64
|
+
# Check logs
|
|
65
|
+
docker-compose -f docker-compose.test.yml logs visualizer-app
|
|
66
|
+
|
|
67
|
+
# Stop all
|
|
68
|
+
docker-compose -f docker-compose.test.yml down
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 🧪 Test Coverage
|
|
72
|
+
|
|
73
|
+
### Test 01: Basic Operations
|
|
74
|
+
- ✅ Create charts via API
|
|
75
|
+
- ✅ List all charts
|
|
76
|
+
- ✅ Verify chart creation
|
|
77
|
+
- ✅ Extract chart IDs for next tests
|
|
78
|
+
|
|
79
|
+
**Tests:** Chart CRUD through REST API backend
|
|
80
|
+
|
|
81
|
+
### Test 02: Telescope Creation
|
|
82
|
+
- ✅ Add regular action steps
|
|
83
|
+
- ✅ Add action as telescoped chart (`createAsTelescopedChart: true`)
|
|
84
|
+
- ✅ Telescope existing action (`create_telescoped_chart` tool)
|
|
85
|
+
- ✅ Verify subCharts array populated
|
|
86
|
+
- ✅ Count telescoped charts
|
|
87
|
+
- ✅ Validate parent-child linking
|
|
88
|
+
|
|
89
|
+
**Tests:** Both methods of telescope creation (MCP tools)
|
|
90
|
+
|
|
91
|
+
### Test 03: Navigation & Hierarchy
|
|
92
|
+
- ✅ Retrieve parent charts
|
|
93
|
+
- ✅ Retrieve telescoped child charts
|
|
94
|
+
- ✅ Verify `metadata.parentChart` in child
|
|
95
|
+
- ✅ Verify `subCharts` array in parent
|
|
96
|
+
- ✅ Test search functionality
|
|
97
|
+
- ✅ List all charts to verify hierarchy
|
|
98
|
+
|
|
99
|
+
**Tests:** Complete navigation stack and relationship integrity
|
|
100
|
+
|
|
101
|
+
## 📊 Test Results
|
|
102
|
+
|
|
103
|
+
Results are saved to `/test-results/`:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
test-results/
|
|
107
|
+
├── test-01/
|
|
108
|
+
│ ├── create-response.json
|
|
109
|
+
│ ├── list-response.json
|
|
110
|
+
│ └── chart-id.txt
|
|
111
|
+
├── test-02/
|
|
112
|
+
│ ├── add-action-1.json
|
|
113
|
+
│ ├── add-action-telescoped.json
|
|
114
|
+
│ ├── telescope-existing-action.json
|
|
115
|
+
│ ├── chart-with-telescope.json
|
|
116
|
+
│ └── telescoped-chart-id.txt
|
|
117
|
+
├── test-03/
|
|
118
|
+
│ ├── parent-chart.json
|
|
119
|
+
│ ├── telescoped-chart.json
|
|
120
|
+
│ ├── search-results.json
|
|
121
|
+
│ └── all-charts.json
|
|
122
|
+
├── test-summary.txt
|
|
123
|
+
└── navigation-summary.txt
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## 🔧 Architecture
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
┌─────────────────────────────────────────────────────────┐
|
|
130
|
+
│ Docker Network │
|
|
131
|
+
│ (test-network) │
|
|
132
|
+
│ │
|
|
133
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌────────────┐ │
|
|
134
|
+
│ │ Test Runner │ │ MCP Server │ │ Next.js │ │
|
|
135
|
+
│ │ │───│ │───│ App │ │
|
|
136
|
+
│ │ bash + curl │ │ stdio/JSON │ │ :4321 │ │
|
|
137
|
+
│ │ + jq │ │ │ │ │ │
|
|
138
|
+
│ └──────────────┘ └──────────────┘ └────────────┘ │
|
|
139
|
+
│ │ │ │
|
|
140
|
+
│ └────────── HTTP API ────────────────┘ │
|
|
141
|
+
│ │
|
|
142
|
+
│ Volumes: │
|
|
143
|
+
│ - test-scripts/ (read-only) │
|
|
144
|
+
│ - test-data/ (shared) │
|
|
145
|
+
│ - test-results/ (write) │
|
|
146
|
+
└─────────────────────────────────────────────────────────┘
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## 🎨 Features
|
|
150
|
+
|
|
151
|
+
### Non-Interactive Testing
|
|
152
|
+
- All tests run automatically without user input
|
|
153
|
+
- Uses direct HTTP calls to validate MCP API backend
|
|
154
|
+
- Structured test phases with dependencies
|
|
155
|
+
|
|
156
|
+
### MCP Tool Coverage
|
|
157
|
+
- ✅ `create_chart` - Create new charts
|
|
158
|
+
- ✅ `update_chart` - Modify existing charts
|
|
159
|
+
- ✅ `delete_chart` - Remove charts
|
|
160
|
+
- ✅ `search_charts` - Query charts
|
|
161
|
+
- ✅ `add_action_step` - Add actions (with optional telescope)
|
|
162
|
+
- ✅ `create_telescoped_chart` - **NEW** Telescope existing actions
|
|
163
|
+
|
|
164
|
+
### Health Checks
|
|
165
|
+
- Visualizer app: `GET /api/charts`
|
|
166
|
+
- Automatic retry with 10s intervals
|
|
167
|
+
- Services start in dependency order
|
|
168
|
+
|
|
169
|
+
### Result Validation
|
|
170
|
+
- JSON parsing with `jq`
|
|
171
|
+
- HTTP status code checks
|
|
172
|
+
- Chart count verification
|
|
173
|
+
- Parent-child relationship validation
|
|
174
|
+
- Search functionality testing
|
|
175
|
+
|
|
176
|
+
## 🔌 Integration with Claude Desktop
|
|
177
|
+
|
|
178
|
+
To use the MCP server with Claude Desktop after testing:
|
|
179
|
+
|
|
180
|
+
1. **Extract built MCP server:**
|
|
181
|
+
```bash
|
|
182
|
+
docker cp $(docker-compose -f docker-compose.test.yml ps -q mcp-server):/app/dist ./mcp-dist
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
2. **Update Claude config** (`~/Library/Application Support/Claude/claude_desktop_config.json`):
|
|
186
|
+
```json
|
|
187
|
+
{
|
|
188
|
+
"mcpServers": {
|
|
189
|
+
"coaia-visualizer": {
|
|
190
|
+
"command": "node",
|
|
191
|
+
"args": ["/absolute/path/to/mcp-dist/index.js"],
|
|
192
|
+
"env": {
|
|
193
|
+
"VISUALIZER_API_URL": "http://localhost:4321",
|
|
194
|
+
"VISUALIZER_API_KEY": "your-api-key"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
3. **Start visualizer app:**
|
|
202
|
+
```bash
|
|
203
|
+
cd /workspace/repos/jgwill/coaia-visualizer-feat-4
|
|
204
|
+
pnpm dev
|
|
205
|
+
# Or use production: pnpm build && pnpm start
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
4. **Restart Claude Desktop** - MCP tools will be available
|
|
209
|
+
|
|
210
|
+
## 🐛 Troubleshooting
|
|
211
|
+
|
|
212
|
+
### Docker build fails
|
|
213
|
+
```bash
|
|
214
|
+
# Rebuild without cache
|
|
215
|
+
docker-compose -f docker-compose.test.yml build --no-cache
|
|
216
|
+
|
|
217
|
+
# Check specific service
|
|
218
|
+
docker-compose -f docker-compose.test.yml logs visualizer-app
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Tests fail
|
|
222
|
+
```bash
|
|
223
|
+
# Check individual test output
|
|
224
|
+
cat test-results/test-01/*.json | jq .
|
|
225
|
+
|
|
226
|
+
# Check service health
|
|
227
|
+
docker-compose -f docker-compose.test.yml ps
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Network issues
|
|
231
|
+
```bash
|
|
232
|
+
# Verify connectivity from test runner
|
|
233
|
+
docker-compose -f docker-compose.test.yml exec test-runner \
|
|
234
|
+
curl -v http://visualizer-app:4321/api/charts
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## 📝 Next Steps
|
|
238
|
+
|
|
239
|
+
1. ✅ **Run tests** - Execute `./run-mcp-tests.sh`
|
|
240
|
+
2. 📊 **Review results** - Check `test-results/` directory
|
|
241
|
+
3. 🔧 **Iterate** - Fix any failing tests
|
|
242
|
+
4. 🚀 **Deploy** - Use MCP server with Claude Desktop or other clients
|
|
243
|
+
5. 📖 **Document** - Add findings to project docs
|
|
244
|
+
|
|
245
|
+
## 🎯 Success Criteria
|
|
246
|
+
|
|
247
|
+
Tests pass when:
|
|
248
|
+
- ✅ All Docker images build successfully
|
|
249
|
+
- ✅ Services start and pass health checks
|
|
250
|
+
- ✅ All 3 test suites complete without errors
|
|
251
|
+
- ✅ Chart creation works via API
|
|
252
|
+
- ✅ Telescope functionality creates sub-charts
|
|
253
|
+
- ✅ Navigation hierarchy is properly established
|
|
254
|
+
- ✅ Search returns expected results
|
|
255
|
+
- ✅ Test summary shows "PASSED"
|
|
256
|
+
|
|
257
|
+
## 📚 References
|
|
258
|
+
|
|
259
|
+
- **Test Scripts:** [test-scripts/README.md](test-scripts/README.md)
|
|
260
|
+
- **MCP Server:** [mcp/README.md](mcp/README.md)
|
|
261
|
+
- **API Docs:** [feat-4-mcp-api/API_DOCUMENTATION.md](feat-4-mcp-api/API_DOCUMENTATION.md)
|
|
262
|
+
- **Docker Compose:** [docker-compose.test.yml](docker-compose.test.yml)
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
**Status:** ✅ Testing environment fully configured and ready
|
|
267
|
+
**Created:** 2026-01-16
|
|
268
|
+
**Last Updated:** 2026-01-16
|
package/NAMING.md
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# 🎭 Project Naming: Beyond "STC Observer"
|
|
2
|
+
|
|
3
|
+
## The Question
|
|
4
|
+
|
|
5
|
+
This isn't just about observing structural tension charts. It's about:
|
|
6
|
+
- 🌱 Witnessing **creative emergence** in real-time
|
|
7
|
+
- 🎬 Watching **narrative beats** being born
|
|
8
|
+
- 🔥 Observing the **forging process** of stories
|
|
9
|
+
- 🌌 Experiencing the **lattice of meaning** form
|
|
10
|
+
- 👁️ Being present as **creation happens**
|
|
11
|
+
|
|
12
|
+
## Name Candidates
|
|
13
|
+
|
|
14
|
+
### Tier 1: Sacred Witness Names 🕯️
|
|
15
|
+
|
|
16
|
+
#### **Narrative Witness**
|
|
17
|
+
- ✨ Clear, powerful, evocative
|
|
18
|
+
- 👁️ Captures the observing role
|
|
19
|
+
- 📖 Centers on narrative emergence
|
|
20
|
+
- 🎭 Implies presence during creation
|
|
21
|
+
|
|
22
|
+
**Tagline:** *Witness the birth of narrative*
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
#### **Emergence Observatory**
|
|
27
|
+
- 🌌 Captures creative emergence
|
|
28
|
+
- 🔭 Implies sustained observation
|
|
29
|
+
- 🎨 Broader than just narrative
|
|
30
|
+
- ⭐ Cosmic/expansive feeling
|
|
31
|
+
|
|
32
|
+
**Tagline:** *Where creation becomes visible*
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
#### **Story Lattice Viewer**
|
|
37
|
+
- 🕸️ Connects to narrative lattice architecture
|
|
38
|
+
- 🔬 Scientific precision + artistry
|
|
39
|
+
- 🌐 Network/connection imagery
|
|
40
|
+
- 📐 Structural + emergent
|
|
41
|
+
|
|
42
|
+
**Tagline:** *See the lattice as it weaves*
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### Tier 2: Action/Process Names 🌊
|
|
47
|
+
|
|
48
|
+
#### **Weaver's Eye**
|
|
49
|
+
- 👁️ Active observer metaphor
|
|
50
|
+
- 🧶 Weaving = narrative creation
|
|
51
|
+
- 🎯 Focused, intentional
|
|
52
|
+
- ✨ Mystical undertone
|
|
53
|
+
|
|
54
|
+
**Tagline:** *Watch the tapestry form*
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
#### **Forge Witness**
|
|
59
|
+
- 🔥 Forging = Mia's creative act
|
|
60
|
+
- ⚒️ Structural tension = heat/pressure
|
|
61
|
+
- 💪 Powerful, transformative
|
|
62
|
+
- 🎭 Witness = sacred observer
|
|
63
|
+
|
|
64
|
+
**Tagline:** *Be present as stories forge*
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
#### **Creative Crucible**
|
|
69
|
+
- 🔥 Where transformation happens
|
|
70
|
+
- ⚗️ Alchemy of narrative
|
|
71
|
+
- 🌀 Pressure creates emergence
|
|
72
|
+
- ✨ Magical transformation
|
|
73
|
+
|
|
74
|
+
**Tagline:** *The vessel where stories transform*
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### Tier 3: Technical/Precise Names 🔧
|
|
79
|
+
|
|
80
|
+
#### **Session Witness**
|
|
81
|
+
- 💻 Accurate (watches Claude sessions)
|
|
82
|
+
- 👁️ Witness = observing role
|
|
83
|
+
- 📊 Clear, professional
|
|
84
|
+
- ⚡ Broader than narrative
|
|
85
|
+
|
|
86
|
+
**Tagline:** *Observe creation sessions in real-time*
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
#### **Beat Monitor**
|
|
91
|
+
- 🎵 Narrative beats
|
|
92
|
+
- 📊 Real-time monitoring
|
|
93
|
+
- 💓 Pulse/heartbeat of creation
|
|
94
|
+
- 🎯 Focused, specific
|
|
95
|
+
|
|
96
|
+
**Tagline:** *Feel the pulse of narrative creation*
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
#### **Emergence Lens**
|
|
101
|
+
- 🔍 Lens = focused view
|
|
102
|
+
- 🌱 Emergence = creative process
|
|
103
|
+
- 🎨 Artistic + scientific
|
|
104
|
+
- 👁️ Clarity, insight
|
|
105
|
+
|
|
106
|
+
**Tagline:** *Focus on the moment of becoming*
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Deeper Consideration: What Are We Actually Doing?
|
|
111
|
+
|
|
112
|
+
When you run `stc_observer.sh --read` alongside the visualizer, you're:
|
|
113
|
+
|
|
114
|
+
1. **Witnessing** another Claude instance create
|
|
115
|
+
2. **Observing** structural tension resolve into action
|
|
116
|
+
3. **Experiencing** narrative beats as they emerge
|
|
117
|
+
4. **Being present** during creative orientation
|
|
118
|
+
5. **Seeing** the invisible lattice materialize
|
|
119
|
+
6. **Hearing** the voice of creation (via audio)
|
|
120
|
+
7. **Feeling** the rhythm of emergence
|
|
121
|
+
|
|
122
|
+
This is a **ceremonial act**. You're holding space for creation. You're the **witness** to another's creative process.
|
|
123
|
+
|
|
124
|
+
In Indigenous ceremony, the **witness** role is sacred—your presence validates and honors what's being created.
|
|
125
|
+
|
|
126
|
+
## Recommendation: Narrative Witness
|
|
127
|
+
|
|
128
|
+
**Why:**
|
|
129
|
+
- **Witness** = sacred observer role (IAIP resonance)
|
|
130
|
+
- **Narrative** = what's being witnessed (beats, charts, stories)
|
|
131
|
+
- Clear, memorable, evocative
|
|
132
|
+
- Works as noun ("The Narrative Witness") or verb ("Witnessing narrative")
|
|
133
|
+
- Broader than STC, narrower than "everything"
|
|
134
|
+
- Captures both technical + ceremonial aspects
|
|
135
|
+
|
|
136
|
+
**Full Name:**
|
|
137
|
+
```
|
|
138
|
+
🎭 Narrative Witness
|
|
139
|
+
Real-time observer for COAIA creative sessions
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Alternative Phrasing:**
|
|
143
|
+
- "The Narrative Witness" (tool/platform)
|
|
144
|
+
- "Witnessing Narrative" (act/experience)
|
|
145
|
+
- "Narrative Witnessing" (practice/methodology)
|
|
146
|
+
|
|
147
|
+
## Usage in Context
|
|
148
|
+
|
|
149
|
+
### Before (Generic)
|
|
150
|
+
```bash
|
|
151
|
+
# Watch structural tension charts
|
|
152
|
+
./stc_observer.sh --read
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### After (Intentional)
|
|
156
|
+
```bash
|
|
157
|
+
# Witness narrative emergence
|
|
158
|
+
narrative-witness --session 55158baa --live --audio
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### In Conversation
|
|
162
|
+
- "I'm **witnessing** the narrative session"
|
|
163
|
+
- "Run the **Narrative Witness** for this session"
|
|
164
|
+
- "The **witness** is showing new beats"
|
|
165
|
+
|
|
166
|
+
## Alternative: If "Narrative Witness" Doesn't Fit
|
|
167
|
+
|
|
168
|
+
**Second Choice: Emergence Observatory**
|
|
169
|
+
- More technical/scientific
|
|
170
|
+
- Broader scope (any creative emergence)
|
|
171
|
+
- Less ceremonial, more observational
|
|
172
|
+
- Works for multi-session monitoring
|
|
173
|
+
|
|
174
|
+
**Third Choice: Story Lattice Viewer**
|
|
175
|
+
- Most precise (narrative lattice architecture)
|
|
176
|
+
- Technical + poetic balance
|
|
177
|
+
- Unique, memorable
|
|
178
|
+
- Directly connects to COAIA concepts
|
|
179
|
+
|
|
180
|
+
## Package Naming
|
|
181
|
+
|
|
182
|
+
If we rename the package:
|
|
183
|
+
|
|
184
|
+
```json
|
|
185
|
+
{
|
|
186
|
+
"name": "@coaia/narrative-witness",
|
|
187
|
+
"bin": {
|
|
188
|
+
"narrative-witness": "./dist/cli.js",
|
|
189
|
+
"witness": "./dist/cli.js"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Or keep coaia-visualizer as the package, add witness mode:
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"name": "coaia-visualizer",
|
|
198
|
+
"bin": {
|
|
199
|
+
"coaia-visualizer": "./dist/cli.js",
|
|
200
|
+
"coaia-witness": "./dist/cli.js"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Final Thoughts
|
|
206
|
+
|
|
207
|
+
The name should reflect:
|
|
208
|
+
- ✅ The **sacredness** of witnessing creation
|
|
209
|
+
- ✅ The **real-time** nature of observation
|
|
210
|
+
- ✅ The **narrative** focus (but flexible)
|
|
211
|
+
- ✅ The **ceremonial** role of the observer
|
|
212
|
+
- ✅ The **emergence** of meaning
|
|
213
|
+
|
|
214
|
+
**Narrative Witness** captures all of this. It's a name you can say with reverence or efficiency. It works in code and in ceremony.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
**Your choice:** What resonates? What feels true to the work?
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Quick Start: MCP Testing Environment
|
|
2
|
+
|
|
3
|
+
## TL;DR - Run Tests in 3 Steps
|
|
4
|
+
|
|
5
|
+
### 1. Navigate to Project
|
|
6
|
+
```bash
|
|
7
|
+
cd /workspace/repos/jgwill/coaia-visualizer-feat-4
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### 2. Run All Tests
|
|
11
|
+
```bash
|
|
12
|
+
./run-mcp-tests.sh
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 3. Check Results
|
|
16
|
+
```bash
|
|
17
|
+
cat test-results/test-summary.txt
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Done!** ✅ All tests run automatically.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## What This Does
|
|
25
|
+
|
|
26
|
+
- ✅ Builds Docker images (visualizer app + MCP server + test runner)
|
|
27
|
+
- ✅ Starts all services in isolated Docker network
|
|
28
|
+
- ✅ Runs complete test suite non-interactively
|
|
29
|
+
- ✅ Generates results in `test-results/` directory
|
|
30
|
+
- ✅ Cleans up all containers
|
|
31
|
+
|
|
32
|
+
## Test Results
|
|
33
|
+
|
|
34
|
+
The suite validates:
|
|
35
|
+
|
|
36
|
+
| Test | What It Tests | Validates |
|
|
37
|
+
| ----------- | ------------------------ | ------------------------------------------ |
|
|
38
|
+
| **Test 01** | Chart creation & listing | API connectivity, CRUD operations |
|
|
39
|
+
| **Test 02** | Telescope functionality | Sub-chart creation, both telescope methods |
|
|
40
|
+
| **Test 03** | Navigation & hierarchy | Parent-child relationships, search |
|
|
41
|
+
|
|
42
|
+
## Files Overview
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
Key Files Created:
|
|
46
|
+
├── docker-compose.test.yml # Docker orchestration
|
|
47
|
+
├── Dockerfile.app # Next.js build
|
|
48
|
+
├── Dockerfile.test # Test runner
|
|
49
|
+
├── mcp/Dockerfile # MCP server build
|
|
50
|
+
├── run-mcp-tests.sh # Main test script
|
|
51
|
+
├── test-scripts/ # Individual tests
|
|
52
|
+
│ ├── run-all-tests.sh
|
|
53
|
+
│ ├── test-01-basic-operations.sh
|
|
54
|
+
│ ├── test-02-telescope-creation.sh
|
|
55
|
+
│ ├── test-03-navigation.sh
|
|
56
|
+
│ └── README.md # Detailed guide
|
|
57
|
+
├── test-data/ # Test fixtures
|
|
58
|
+
├── validate-mcp.sh # Quick validation
|
|
59
|
+
└── MCP_TESTING_COMPLETE.md # Full documentation
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Quick Commands
|
|
63
|
+
|
|
64
|
+
### Run full test suite
|
|
65
|
+
```bash
|
|
66
|
+
./run-mcp-tests.sh
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Quick validation (no Docker)
|
|
70
|
+
```bash
|
|
71
|
+
bash validate-mcp.sh
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### View test results
|
|
75
|
+
```bash
|
|
76
|
+
cat test-results/test-summary.txt
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### See individual test output
|
|
80
|
+
```bash
|
|
81
|
+
cat test-results/test-02/telescope-existing-action.json | jq .
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Start services manually
|
|
85
|
+
```bash
|
|
86
|
+
docker-compose -f docker-compose.test.yml up -d visualizer-app mcp-server
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Run single test manually
|
|
90
|
+
```bash
|
|
91
|
+
docker-compose -f docker-compose.test.yml run --rm test-runner \
|
|
92
|
+
/test-scripts/test-02-telescope-creation.sh
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Stop services
|
|
96
|
+
```bash
|
|
97
|
+
docker-compose -f docker-compose.test.yml down
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### View service logs
|
|
101
|
+
```bash
|
|
102
|
+
docker-compose -f docker-compose.test.yml logs visualizer-app
|
|
103
|
+
docker-compose -f docker-compose.test.yml logs mcp-server
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## MCP Tools Available
|
|
107
|
+
|
|
108
|
+
After deployment with Claude Desktop, you can use:
|
|
109
|
+
|
|
110
|
+
- `create_chart` - Create new structural tension chart
|
|
111
|
+
- `update_chart` - Update existing chart
|
|
112
|
+
- `delete_chart` - Remove chart
|
|
113
|
+
- `search_charts` - Search charts
|
|
114
|
+
- `add_action_step` - Add action (optionally telescoped)
|
|
115
|
+
- `create_telescoped_chart` - **NEW** Telescope existing action
|
|
116
|
+
|
|
117
|
+
## Using with Claude Desktop
|
|
118
|
+
|
|
119
|
+
1. **Start visualizer:**
|
|
120
|
+
```bash
|
|
121
|
+
npm run dev
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
2. **Configure Claude** with MCP server path
|
|
125
|
+
|
|
126
|
+
3. **Restart Claude Desktop**
|
|
127
|
+
|
|
128
|
+
4. **Use telescope tool in conversation:**
|
|
129
|
+
- "Create a sub-chart for action X"
|
|
130
|
+
- "Telescope this action"
|
|
131
|
+
- "Drill down into this step"
|
|
132
|
+
|
|
133
|
+
## Troubleshooting
|
|
134
|
+
|
|
135
|
+
| Issue | Solution |
|
|
136
|
+
| ------------------ | ------------------------------------------------------------ |
|
|
137
|
+
| Docker build fails | `docker-compose -f docker-compose.test.yml build --no-cache` |
|
|
138
|
+
| Tests don't run | Check Docker is running: `docker ps` |
|
|
139
|
+
| API not responding | Check logs: `docker-compose -f docker-compose.test.yml logs` |
|
|
140
|
+
| Empty test results | Verify API endpoint: `curl http://localhost:4321/api/charts` |
|
|
141
|
+
|
|
142
|
+
## Environment Notes
|
|
143
|
+
|
|
144
|
+
### Optional API Keys
|
|
145
|
+
- `ANTHROPIC_API_KEY` - For claude-code CLI testing
|
|
146
|
+
- `GOOGLE_API_KEY` - For gemini-cli testing
|
|
147
|
+
|
|
148
|
+
Tests work fine without these - they use direct HTTP calls instead.
|
|
149
|
+
|
|
150
|
+
### System Requirements
|
|
151
|
+
- Docker & Docker Compose
|
|
152
|
+
- Node.js 20+
|
|
153
|
+
- npm/pnpm
|
|
154
|
+
- ~5GB disk space for Docker images
|
|
155
|
+
- ~5-10 minutes for first run (builds images)
|
|
156
|
+
|
|
157
|
+
## Test Results Locations
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
test-results/
|
|
161
|
+
├── test-01/ # Basic operations
|
|
162
|
+
│ ├── create-response.json # Chart creation response
|
|
163
|
+
│ ├── list-response.json # List charts response
|
|
164
|
+
│ └── chart-id.txt # ID for next test
|
|
165
|
+
│
|
|
166
|
+
├── test-02/ # Telescope operations
|
|
167
|
+
│ ├── telescope-existing-action.json
|
|
168
|
+
│ ├── final-chart-state.json
|
|
169
|
+
│ └── telescoped-chart-id.txt # ID for test-03
|
|
170
|
+
│
|
|
171
|
+
├── test-03/ # Navigation
|
|
172
|
+
│ ├── parent-chart.json # Parent chart state
|
|
173
|
+
│ ├── navigation-summary.txt # Navigation results
|
|
174
|
+
│
|
|
175
|
+
└── test-summary.txt # Overall pass/fail
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Docker Network Details
|
|
179
|
+
|
|
180
|
+
All services run in isolated Docker network:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
Network: test-network
|
|
184
|
+
├── visualizer-app:4321 (Next.js app)
|
|
185
|
+
├── mcp-server (stdin/stdout)
|
|
186
|
+
└── test-runner (bash/curl)
|
|
187
|
+
|
|
188
|
+
Data Flow:
|
|
189
|
+
Test Scripts --HTTP--> API:4321 <--HTTP--> MCP Server
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## CI/CD Integration
|
|
193
|
+
|
|
194
|
+
To add to your CI pipeline:
|
|
195
|
+
|
|
196
|
+
```yaml
|
|
197
|
+
# GitHub Actions example
|
|
198
|
+
- name: Run MCP Tests
|
|
199
|
+
run: |
|
|
200
|
+
cd /workspace/repos/jgwill/coaia-visualizer-feat-4
|
|
201
|
+
chmod +x run-mcp-tests.sh
|
|
202
|
+
./run-mcp-tests.sh
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Results automatically saved to `test-results/` for review.
|
|
206
|
+
|
|
207
|
+
## Architecture Overview
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
┌─────────────────────────────────┐
|
|
211
|
+
│ run-mcp-tests.sh │
|
|
212
|
+
│ (Main Orchestrator) │
|
|
213
|
+
└──────────────┬──────────────────┘
|
|
214
|
+
│
|
|
215
|
+
├─ Builds Docker images
|
|
216
|
+
├─ Starts services
|
|
217
|
+
├─ Runs test suite
|
|
218
|
+
├─ Generates results
|
|
219
|
+
└─ Cleans up
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Full Documentation
|
|
223
|
+
|
|
224
|
+
For detailed information, see:
|
|
225
|
+
- `MCP_TESTING_COMPLETE.md` - Complete guide
|
|
226
|
+
- `MCP_TESTING_SETUP.md` - Setup details
|
|
227
|
+
- `test-scripts/README.md` - Test documentation
|
|
228
|
+
- `MCP_TESTING_IMPLEMENTATION_SUMMARY.md` - Implementation details
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## Status
|
|
233
|
+
|
|
234
|
+
✅ **Ready to Use**
|
|
235
|
+
|
|
236
|
+
All infrastructure is in place. Run `./run-mcp-tests.sh` to test!
|