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,329 +0,0 @@
1
- # ๐Ÿ”ฎ Future Integration: Planning-Sourced Chart Visualization
2
-
3
- > How coaia-visualizer COULD surface the plan origin, confidence scores, sync state, and bidirectional editing bridge for charts born from Claude plan markdown transformations.
4
-
5
- **Status**: ๐Ÿ”ฎ FUTURE / ASPIRATIONAL
6
- **Framework**: RISE
7
- **Cross-references**:
8
- - [app.spec.md](./app.spec.md) โ€” current visualizer architecture
9
- - [chart-visualization-hierarchy.spec.md](./chart-visualization-hierarchy.spec.md) โ€” current chart rendering
10
- - [chart-editing-workflow.spec.md](./chart-editing-workflow.spec.md) โ€” current editing capabilities
11
- - [`coaia-planning/rispecs/app.spec.md`](../../coaia-planning/rispecs/app.spec.md) โ€” planning tools and metadata
12
- - [`coaia-planning/rispecs/bidirectional-sync.spec.md`](../../coaia-planning/rispecs/bidirectional-sync.spec.md) โ€” sync mechanics
13
- - [`coaia-planning/KINSHIP.md`](../../coaia-planning/KINSHIP.md) โ€” planning lineage
14
-
15
- ---
16
-
17
- ## ๐ŸŒŠ Structural Tension
18
-
19
- ### Current Reality
20
-
21
- coaia-visualizer consumes JSONL files from any source identically. Charts produced by coaia-planning's `plan_to_stc` tool carry metadata that the visualizer never reads:
22
-
23
- - **Confidence scores** (`metadata.confidence: 0โ€“1`) on desired outcomes, current reality, and action steps โ€” indicating how certain the parser was about its structural interpretation. The visualizer shows all elements with equal visual weight regardless of parse certainty.
24
- - **Source line references** (`metadata.sourceLines: { start, end }`) mapping each entity back to specific lines in the plan markdown โ€” invisible in the UI.
25
- - **Telescoping markers** (`metadata.canTelescope`) on action steps that the parser identified as rich enough to expand โ€” not surfaced.
26
- - **Plan file path** (`metadata.filePath`) linking the chart back to its source markdown โ€” no provenance displayed.
27
- - **Sync state**: coaia-planning supports bidirectional sync (`sync_plan_to_chart` / `sync_chart_to_plan`), but the visualizer has no awareness of whether a chart is synced, diverged, or in conflict with its source plan.
28
-
29
- The result: a chart born from a carefully parsed Claude plan looks identical to a hand-authored chart, and edits made in the visualizer have no path back to the plan markdown.
30
-
31
- ### Desired Result
32
-
33
- Practitioners **bridge between plan mode and structural tension** with full awareness. When a chart was born from a Claude plan, the visualizer:
34
- - Shows a plan source badge with the parse confidence score
35
- - Indicates whether the chart is synced with its source plan or has diverged
36
- - Maps each action step back to its plan section
37
- - Color-codes elements by confidence so practitioners focus review on uncertain interpretations
38
- - Offers a re-sync button to push visualizer edits back to plan markdown via coaia-planning
39
-
40
- This creates a **bidirectional creative surface** โ€” plans inform charts, charts advance plans, and the practitioner sees both views as aspects of the same structural tension.
41
-
42
- ---
43
-
44
- ## ๐ŸŽจ Design Approach
45
-
46
- ### 1. Plan Source Indicator
47
-
48
- **Concept**: Badge in the chart header showing this chart's plan origin and overall confidence.
49
-
50
- **Badge Design**:
51
- ```
52
- ๐Ÿ“‹ From Plan: deploy-pde.md ยท Confidence: 87% ยท โ— Synced
53
- ```
54
-
55
- **Visual States**:
56
- - `๐Ÿ“‹` Plan icon in `violet-500` (distinguishes from PDE's `๐Ÿ”ฌ` in amber)
57
- - Plan filename as link/tooltip showing full path
58
- - Confidence as percentage with color: `green-500` โ‰ฅ80%, `amber-500` โ‰ฅ50%, `red-500` <50%
59
- - Sync indicator dot: `green-500` synced, `amber-500` diverged, `red-500` conflict
60
-
61
- **Data Source**: Chart entity `metadata.filePath` and aggregate confidence from child entities.
62
-
63
- **Implementation Approach**:
64
- - Detect plan origin via `metadata.filePath` ending in `.md` or `metadata.source === "plan"`
65
- - New component: `PlanSourceBadge` in chart header, symmetric to PDE's `PdeSourceBadge`
66
- - Aggregate confidence: average of all child entity confidence scores
67
- - Sync state determined by comparing chart `metadata.updatedAt` against plan file mtime (requires API extension)
68
-
69
- ### 2. Bidirectional Sync Status
70
-
71
- **Concept**: Persistent visual indicator showing the relationship between the chart and its source plan.
72
-
73
- **Sync States**:
74
-
75
- | State | Icon | Color | Meaning |
76
- |-------|------|-------|---------|
77
- | **Synced** | โœ“ circle | `green-500` | Chart matches plan โ€” no divergence |
78
- | **Chart Ahead** | โ†‘ arrow | `blue-500` | Chart has changes not in plan |
79
- | **Plan Ahead** | โ†“ arrow | `amber-500` | Plan has changes not in chart |
80
- | **Diverged** | โ‡… arrows | `amber-600` | Both changed independently |
81
- | **Conflict** | โš  warning | `red-500` | Incompatible changes detected |
82
- | **Unknown** | ? circle | `slate-400` | Sync state cannot be determined |
83
-
84
- **Implementation Approach**:
85
- - New API endpoint: `GET /api/plan-sync-status?chartPath=...&planPath=...`
86
- - Calls coaia-planning's `sync_plan_to_chart` in dry-run mode
87
- - Returns change list + sync state classification
88
- - New component: `SyncStatusIndicator` โ€” icon + tooltip in chart header
89
- - Polling: optionally re-check sync status on interval (reuse existing live-reload pattern from `isLive` state)
90
-
91
- ### 3. Plan Section Mapping
92
-
93
- **Concept**: Show which section of the plan markdown each entity came from.
94
-
95
- **Visual Treatment**:
96
- - Each action step shows a subtle tag: `ยง Phase 2: Implementation` linking to its plan section
97
- - Desired outcome shows: `ยง Overview` or whichever heading it was parsed from
98
- - Current reality shows its source section similarly
99
-
100
- **Section Display**:
101
- ```
102
- โ˜ Implement authentication module
103
- ยง Phase 2: Implementation ยท Lines 42โ€“48 ยท Confidence: 92%
104
-
105
- โœ“ Configure CI pipeline
106
- ยง Phase 1: Infrastructure ยท Lines 15โ€“18 ยท Confidence: 98%
107
- ```
108
-
109
- **Implementation Approach**:
110
- - Read `metadata.sourceLines` from action_step entities
111
- - Read `metadata.planSection` (new, populated by coaia-planning parser with heading context)
112
- - New sub-component: `PlanSectionTag` โ€” subtle inline tag with section name
113
- - Click to expand: shows source line range and raw markdown excerpt (requires plan content access)
114
-
115
- ### 4. Confidence Visualization
116
-
117
- **Concept**: Color-code all chart elements by their parse confidence score, letting practitioners immediately spot elements that need human review.
118
-
119
- **Confidence Tiers**:
120
-
121
- | Range | Color | Border | Meaning |
122
- |-------|-------|--------|---------|
123
- | โ‰ฅ 0.9 | None (default) | Standard | High confidence โ€” parser is certain |
124
- | 0.7โ€“0.89 | `amber-50` bg | `amber-200` | Moderate โ€” likely correct, worth glancing |
125
- | 0.5โ€“0.69 | `amber-100` bg | `amber-400` | Low โ€” parser guessed, needs review |
126
- | < 0.5 | `red-50` bg | `red-300` | Very low โ€” likely wrong, needs human correction |
127
-
128
- **Applied To**:
129
- - Desired outcome card background
130
- - Current reality card background
131
- - Individual action step rows
132
- - Section headers in grouped view
133
-
134
- **Implementation Approach**:
135
- - Utility function: `getConfidenceStyle(confidence: number)` โ†’ Tailwind classes
136
- - Applied as conditional className in `ChartDetailEditable` sub-components
137
- - Toggle: "Show confidence highlighting" switch in view controls (off by default for clean view)
138
- - Aggregate confidence shown in `PlanSourceBadge`
139
-
140
- ### 5. Re-Sync Trigger
141
-
142
- **Concept**: Action button that pushes visualizer edits back to the plan markdown via coaia-planning's `sync_chart_to_plan` tool.
143
-
144
- **Button Placement**: In chart header, next to `SyncStatusIndicator`, visible only when chart has diverged from plan.
145
-
146
- **Workflow**:
147
- ```
148
- User edits chart in visualizer
149
- โ”‚
150
- โ–ผ
151
- SyncStatusIndicator shows "Chart Ahead โ†‘"
152
- โ”‚
153
- โ–ผ
154
- User clicks "Sync to Plan" button
155
- โ”‚
156
- โ”œโ”€ Preview mode (default):
157
- โ”‚ Shows diff of what would change in plan markdown
158
- โ”‚ User confirms or cancels
159
- โ”‚
160
- โ””โ”€ Apply:
161
- POST /api/plan-sync with { chartPath, planPath, direction: "chart-to-plan" }
162
- Server calls coaia-planning sync_chart_to_plan
163
- SyncStatusIndicator updates to "Synced โœ“"
164
- ```
165
-
166
- **Implementation Approach**:
167
- - New API endpoint: `POST /api/plan-sync`
168
- - `direction`: `"chart-to-plan"` or `"plan-to-chart"`
169
- - `dryRun`: boolean (default true for preview)
170
- - Calls coaia-planning MCP tools via stdio
171
- - New component: `SyncButton` with preview dialog
172
- - Preview dialog: `SyncPreviewDialog` showing change list (new/modified/removed actions)
173
- - Confirmation triggers actual sync and refreshes chart data
174
-
175
- ### 6. Plan-Aware Chart Creation
176
-
177
- **Concept**: Extend the "Add Chart" workflow to accept a plan file as input source.
178
-
179
- **Flow**:
180
- ```
181
- User clicks "Add Chart" โ†’ Tab: "From Plan"
182
- โ”‚
183
- โ–ผ
184
- File picker for .md plan files
185
- โ”‚
186
- โ–ผ
187
- Preview: parsed structural tension (desired outcome, current reality, actions)
188
- โ”‚
189
- โ–ผ
190
- User adjusts confidence thresholds, confirms
191
- โ”‚
192
- โ–ผ
193
- Chart created with full plan metadata attached
194
- ```
195
-
196
- **Implementation Approach**:
197
- - Extend `CreateChartForm` with a "From Plan" tab
198
- - New component: `PlanImportForm` โ€” file picker + structural preview
199
- - Calls `parse_plan_structural` for preview, then `plan_to_stc` on confirm
200
- - Created chart retains all planning metadata for sync lifecycle
201
-
202
- ---
203
-
204
- ## ๐Ÿ“Š Entity Metadata Requirements
205
-
206
- For this integration to work, coaia-planning JSONL must include these metadata fields (most already specified in the planning rispecs):
207
-
208
- ### On `structural_tension_chart` Entity
209
- ```typescript
210
- metadata: {
211
- source?: "plan" | "pde" | "manual" // Origin discriminator
212
- filePath?: string // Source plan path
213
- parsedAt?: string // ISO-8601 parse timestamp
214
- telescopeLevel?: number // 0=root, 1+=nested
215
- completionStatus?: string // "pending" | "in_progress" | "completed"
216
- syncState?: {
217
- lastSyncAt?: string // ISO-8601
218
- syncDirection?: "plan-to-chart" | "chart-to-plan"
219
- diverged?: boolean
220
- }
221
- }
222
- ```
223
-
224
- ### On `desired_outcome` / `current_reality` Entity
225
- ```typescript
226
- metadata: {
227
- confidence?: number // 0โ€“1 parse confidence
228
- sourceLines?: { start: number, end: number }
229
- planSection?: string // Heading context from plan
230
- }
231
- ```
232
-
233
- ### On `action_step` Entity
234
- ```typescript
235
- metadata: {
236
- confidence?: number // 0โ€“1
237
- sourceLines?: { start: number, end: number }
238
- planSection?: string // Which plan section
239
- canTelescope?: boolean // Parser's assessment
240
- completionStatus?: boolean
241
- order?: number
242
- }
243
- ```
244
-
245
- ---
246
-
247
- ## ๐Ÿงฉ UI Components Needed
248
-
249
- | Component | Purpose | Parent |
250
- |-----------|---------|--------|
251
- | `PlanSourceBadge` | Plan origin badge with confidence and sync state | `ChartDetailEditable` header |
252
- | `SyncStatusIndicator` | Sync state icon with tooltip | `PlanSourceBadge` or header |
253
- | `SyncButton` | Trigger bidirectional sync | Chart header, near sync indicator |
254
- | `SyncPreviewDialog` | Show changes before applying sync | Modal from `SyncButton` |
255
- | `PlanSectionTag` | Inline tag showing plan section origin | Action item row |
256
- | `ConfidenceOverlay` | Conditional background coloring by confidence | Wraps entity display components |
257
- | `PlanImportForm` | Import plan file to create chart | `CreateChartForm` tab |
258
- | `ConfidenceToggle` | Show/hide confidence highlighting | View controls area |
259
-
260
- ---
261
-
262
- ## ๐Ÿ”Œ API Extensions Needed
263
-
264
- | Endpoint | Method | Purpose |
265
- |----------|--------|---------|
266
- | `/api/plan-sync-status` | GET | Query sync state between chart and plan |
267
- | `/api/plan-sync` | POST | Execute bidirectional sync (with dry-run) |
268
- | `/api/plan-import` | POST | Import plan file and create chart |
269
- | `/api/plan-preview` | POST | Parse plan structurally for preview |
270
-
271
- These endpoints would proxy to coaia-planning MCP tools via stdio transport, consistent with the existing MCP integration pattern in [api-mcp-interface.spec.md](./api-mcp-interface.spec.md).
272
-
273
- ---
274
-
275
- ## ๐ŸŽฏ What This Enables
276
-
277
- ### For Practitioners
278
- - **Bridge two workflows**: Move fluidly between Claude's plan mode (familiar, markdown-native) and structural tension visualization (ceremonial, depth-oriented) without losing context
279
- - **Trust the parse**: Confidence highlighting shows exactly where the automated planโ†’chart transformation needs human review
280
- - **Stay synchronized**: Edits in the visualizer flow back to plan markdown; plan updates flow forward to charts. Neither view becomes stale
281
- - **Focused review**: Low-confidence elements draw the eye, letting practitioners spend energy where it matters most
282
-
283
- ### For the Ecosystem
284
- - **coaia-planning gains a face**: Its JSONL output becomes visually rich and interactive in the visualizer
285
- - **Bidirectional sync becomes tangible**: The sync mechanics specified in `bidirectional-sync.spec.md` get a user-facing interface
286
- - **Plan mode enters the ceremony**: Claude plans, which begin as utilitarian markdown, gain ceremonial structure when visualized as structural tension charts
287
- - **Multi-agent visibility**: When multiple agents work through a shared planโ†’chart, the visualizer becomes the human's window into collective structural advancement
288
-
289
- ---
290
-
291
- ## โœ… Quality Criteria
292
-
293
- โœ… **Structural Tension Preserved**
294
- - Confidence coloring enhances but never replaces the core desired outcome โ†” current reality display
295
- - Plan source indicator is informational โ€” it does not change how structural tension is held
296
- - Creative orientation language maintained in all new components
297
-
298
- โœ… **Graceful Degradation**
299
- - Charts without planning metadata render exactly as they do today โ€” zero regression
300
- - Missing confidence scores default to no highlighting (not zero confidence)
301
- - Sync features disabled when no plan path is available
302
- - All new components conditional on metadata presence
303
-
304
- โœ… **Sync Safety**
305
- - Re-sync always previews changes before applying (dry-run default)
306
- - Conflict states clearly communicated โ€” never auto-resolved silently
307
- - Backup created before every sync operation (consistent with existing API pattern)
308
-
309
- โœ… **Data Fidelity**
310
- - No new JSONL fields invented โ€” only existing coaia-planning metadata consumed
311
- - `planSection` is the only field that may need coaia-planning parser enhancement
312
- - Round-trip: editing a plan-sourced chart and exporting preserves all planning metadata
313
- - Sync operations are idempotent โ€” running twice produces same result
314
-
315
- โœ… **Consistency with PDE Integration**
316
- - Source badges follow same visual pattern (icon + source + confidence + state)
317
- - Both PDE and planning charts use the same `ChartDetailEditable` extension points
318
- - A chart could theoretically carry both PDE and planning metadata (PDE โ†’ Plan โ†’ Chart pipeline)
319
-
320
- ---
321
-
322
- ## ๐Ÿ”— Cross-References
323
-
324
- - [chart-visualization-hierarchy.spec.md](./chart-visualization-hierarchy.spec.md) โ€” ChartDetailEditable extension point
325
- - [chart-editing-workflow.spec.md](./chart-editing-workflow.spec.md) โ€” editing patterns that sync must preserve
326
- - [api-mcp-interface.spec.md](./api-mcp-interface.spec.md) โ€” API extension patterns
327
- - [jsonl-parsing-data-types.spec.md](./jsonl-parsing-data-types.spec.md) โ€” metadata parsing extension
328
- - [`coaia-planning/rispecs/bidirectional-sync.spec.md`](../../coaia-planning/rispecs/bidirectional-sync.spec.md) โ€” sync mechanics this spec surfaces
329
- - [pde-integration.spec.md](./pde-integration.spec.md) โ€” sibling future spec
@@ -1,171 +0,0 @@
1
- # Relation Graph Visualization
2
- ## RISE Specification for Inter-Entity Connection Display
3
-
4
- **Component Purpose**: Render the relational kinship between entities within a chart โ€” showing how desired outcomes, current realities, action steps, and narrative beats are connected through typed relations.
5
-
6
- **Source Files**: `components/relation-graph.tsx`
7
-
8
- ---
9
-
10
- ## ๐ŸŽฏ What This Component Enables Users to Create
11
-
12
- - Visible maps of kinship between chart elements
13
- - Understanding of how structural tension flows between entities
14
- - Awareness of which entities are connected and through what relation types
15
- - Entity observation previews without navigating away from the chart view
16
-
17
- ---
18
-
19
- ## ๐ŸŒŠ Structural Tension Dynamics
20
-
21
- ### Current Reality
22
- Relations exist as `RelationRecord` objects in the parsed data. They encode structural meaning โ€” "contains", "creates_tension_with", "advances_toward", "documents" โ€” but are invisible without a dedicated display. Users can see charts and their components but not the *connections* between them.
23
-
24
- ### Desired Result
25
- A card-based display within each chart's detail view that:
26
- - Groups relations by type (contains, creates_tension_with, advances_toward, documents)
27
- - Shows each relation as a fromโ†’to pair with entity previews
28
- - Uses badges to label relation types with counts
29
- - Provides at-a-glance understanding of the relational structure
30
-
31
- ### Natural Resolution
32
- The `RelationGraph` component reduces the chart's relations array into type-grouped sections, looking up entity details from the entities Map for preview text.
33
-
34
- ---
35
-
36
- ## ๐Ÿ“‹ RelationGraph Component
37
-
38
- ### Props
39
- ```typescript
40
- interface RelationGraphProps {
41
- chart: Chart // Chart whose relations to display
42
- data: ParsedData // Full data for entity lookups
43
- }
44
- ```
45
-
46
- ### Render Structure
47
-
48
- ```
49
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
50
- โ”‚ Entity Relations โ”‚
51
- โ”‚ Connections between chart entities โ”‚
52
- โ”‚ โ”‚
53
- โ”‚ [contains] (3) โ”‚
54
- โ”‚ chart_1 โ†’ chart_1_desired_outcome โ”‚
55
- โ”‚ "Build structural tension visualizer..." โ”‚
56
- โ”‚ chart_1 โ†’ chart_1_current_reality โ”‚
57
- โ”‚ "JSONL parser handles all entity types..." โ”‚
58
- โ”‚ chart_1 โ†’ chart_1_action_1 โ”‚
59
- โ”‚ "Design entity type system" โ”‚
60
- โ”‚ โ”‚
61
- โ”‚ [creates_tension_with] (1) โ”‚
62
- โ”‚ chart_1_current_reality โ†’ chart_1_desired_outc. โ”‚
63
- โ”‚ "JSONL parser handles..." โ†’ "Build struct..." โ”‚
64
- โ”‚ โ”‚
65
- โ”‚ [advances_toward] (2) โ”‚
66
- โ”‚ chart_4_desired_outcome โ†’ chart_1_desired_outc. โ”‚
67
- โ”‚ "Design entity types..." โ†’ "Build struct..." โ”‚
68
- โ”‚ chart_5_desired_outcome โ†’ chart_1_desired_outc. โ”‚
69
- โ”‚ "Implement parsing..." โ†’ "Build struct..." โ”‚
70
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
71
- ```
72
-
73
- **Card Wrapper**: Rendered inside a `Card` component with `CardHeader` title "Entity Relations" and description "Connections between chart entities".
74
-
75
- **Empty State**: When `relations.length === 0`, renders the Card with centered muted text: "No relations defined".
76
-
77
- **Badge Text Transform**: Relation type badges display with underscores replaced by spaces: `relationType.replace(/_/g, ' ')`
78
-
79
- ### Grouping Algorithm
80
- ```
81
- 1. Take chart.relations array
82
- 2. Reduce into object keyed by relationType:
83
- {
84
- "contains": [rel1, rel2, rel3],
85
- "creates_tension_with": [rel4],
86
- "advances_toward": [rel5, rel6]
87
- }
88
- 3. For each group:
89
- a. Render relation type badge with count
90
- b. For each relation in group:
91
- - Look up from entity in data.entities Map
92
- - Look up to entity in data.entities Map
93
- - Display: fromName โ†’ toName
94
- - Show observations[0] as preview text for each entity
95
- ```
96
-
97
- ### Relation Types
98
-
99
- | Relation Type | Meaning | Typical Fromโ†’To |
100
- |:---|:---|:---|
101
- | `contains` | Chart contains component | chart โ†’ desired_outcome, current_reality, action_step |
102
- | `creates_tension_with` | Reality creates tension with outcome | current_reality โ†’ desired_outcome |
103
- | `advances_toward` | Action/sub-chart advances toward parent outcome | sub-chart desired_outcome โ†’ parent desired_outcome |
104
- | `documents` | Beat documents chart activity | narrative_beat โ†’ chart |
105
-
106
- ### Entity Preview
107
- For each entity in a relation:
108
- - Display entity name (identifier)
109
- - Show `observations[0]` as preview text (first observation)
110
- - If entity not found in Map, show name only
111
-
112
- ---
113
-
114
- ## ๐Ÿ“‹ Integration Points
115
-
116
- ### Within ChartDetailEditable / ChartDetail
117
- ```
118
- <Tabs>
119
- <TabsTrigger value="actions">Actions ({chart.actions.length})</TabsTrigger>
120
- <TabsTrigger value="relations">Relations ({chart.relations.length})</TabsTrigger>
121
- </Tabs>
122
-
123
- <TabsContent value="relations">
124
- <RelationGraph chart={chart} data={data} />
125
- </TabsContent>
126
- ```
127
-
128
- The relation graph appears as a tab alongside the actions list, accessible in both read-only and editable chart detail views.
129
-
130
- ---
131
-
132
- ## ๐Ÿ“‹ Creative Advancement Scenario
133
-
134
- ### Scenario: Understanding Telescoped Structure
135
- **User Intent**: See how a sub-chart's actions advance toward the parent chart's desired outcome
136
- **Current Structural Reality**: Chart has 3 sub-charts but the advancement connections aren't visible
137
-
138
- **Natural Progression**:
139
- 1. User selects parent chart
140
- 2. Clicks "Relations" tab
141
- 3. Sees `advances_toward` group with 3 entries
142
- 4. Each entry shows: sub-chart desired outcome โ†’ parent desired outcome
143
- 5. Preview text reveals the specific advancement path
144
- 6. User understands how sub-charts contribute to the parent's creative vision
145
-
146
- ---
147
-
148
- ## โœ… Quality Criteria
149
-
150
- โœ… **Relational Clarity**
151
- - Relations grouped by type with badge labels
152
- - Count shows how many relations per type
153
- - Fromโ†’To direction clearly indicated
154
-
155
- โœ… **Entity Context**
156
- - Entity names displayed for identification
157
- - First observation shown as preview text
158
- - Missing entities handled gracefully (name-only display)
159
-
160
- โœ… **Structural Tension Visibility**
161
- - `creates_tension_with` relations make the fundamental tension visible
162
- - `advances_toward` relations show how actions drive resolution
163
- - `contains` relations reveal chart composition
164
-
165
- ---
166
-
167
- ## ๐Ÿ”— Related Components
168
-
169
- - [chart-visualization-hierarchy.spec.md](./chart-visualization-hierarchy.spec.md) โ€” hosts RelationGraph in chart detail tabs
170
- - [jsonl-parsing-data-types.spec.md](./jsonl-parsing-data-types.spec.md) โ€” RelationRecord type and entity lookups
171
- - [chart-editing-workflow.spec.md](./chart-editing-workflow.spec.md) โ€” ChartEditor creates/deletes relations during mutations
@@ -1,65 +0,0 @@
1
- # Relation to mcp-structural-thinking
2
-
3
- > Kinship document describing the envisioned relationship between **coaia-visualizer** (Web UI for STC visualization/editing) and **mcp-structural-thinking** (Structural Thinking diagnostic layer).
4
-
5
- ## The Relationship
6
-
7
- **coaia-visualizer** renders Structural Tension Charts as interactive web UIs โ€” displaying chart hierarchies, editing workflows, narrative beats, and relation graphs. **mcp-structural-thinking** provides validation data that could enrich the display: three-universe scores as visual badges, reactive pattern highlights, and PDE question overlays.
8
-
9
- ```
10
- coaia-narrative (JSONL)
11
- โ”‚
12
- โ–ผ
13
- coaia-visualizer (parseJSONL โ†’ organizeData โ†’ UI)
14
- โ”‚ Charts, Hierarchies, Relation Graphs
15
- โ”‚
16
- โ”œโ”€โ”€โ–ถ mcp-structural-thinking (validate_three_universe per chart)
17
- โ”‚ โ”‚ scores + flags + discrepancies
18
- โ”‚ โ–ผ
19
- โ”‚ Visual indicators:
20
- โ”‚ ๐ŸŸข Mia: 0.8 ๐ŸŸก Miette: 0.6 ๐Ÿ”ด Ava: 0.3
21
- โ”‚ โš ๏ธ Discrepancy: "Technically precise but relationally extractive"
22
- โ”‚
23
- โ–ผ
24
- Enhanced visualization with validation context
25
- ```
26
-
27
- ## What coaia-visualizer Offers to mcp-structural-thinking
28
-
29
- - **Human-readable rendering** โ€” makes three-universe validation scores visible and actionable
30
- - **Editing workflow** โ€” users can refine charts in response to validation flags, then re-validate
31
- - **Relation graph** โ€” could visualize which charts have consensus and which don't
32
- - **Narrative beats** โ€” could annotate beats with validation history
33
-
34
- ## What mcp-structural-thinking Offers to coaia-visualizer
35
-
36
- - **Three-universe scores** โ€” per-chart scores (Mia/Miette/Ava) as color-coded badges or progress bars
37
- - **Reactive pattern highlights** โ€” flagged language patterns shown inline in chart text
38
- - **PDE validation questions** โ€” embedded in chart detail views as expandable sections
39
- - **Consensus status** โ€” visual indicator (โœ…/โŒ) on each chart's header
40
- - **Behavioral pattern classification** โ€” oscillation/advancing badges on chart overview
41
-
42
- ## Envisioned UI Enhancements
43
-
44
- ### Chart List View
45
- - Consensus badge: โœ… or โŒ next to each chart name
46
- - Three-universe mini-bar: `Mia: โ–ˆโ–ˆโ–ˆโ–ˆ Miette: โ–ˆโ–ˆโ–ˆโ–‘ Ava: โ–ˆโ–ˆโ–‘โ–‘`
47
-
48
- ### Chart Detail View
49
- - Three-universe scores in sidebar
50
- - Reactive patterns highlighted in desired outcome / current reality text
51
- - PDE validation questions in collapsible section
52
- - Discrepancies displayed as alert banners
53
-
54
- ### Relation Graph View
55
- - Charts with FALSE consensus highlighted in different color
56
- - Edges annotated with cross-chart discrepancies
57
-
58
- ## Accountability
59
-
60
- - coaia-visualizer owns the rendering and editing UX โ€” mcp-structural-thinking provides data, never dictates display
61
- - Validation scores should be stored as entity metadata (via coaia-narrative) so they persist across sessions
62
-
63
- ---
64
-
65
- *Created: 2026-03-31 | Steward: Guillaume (jgwill)*