@elevasis/core 0.1.0 → 0.2.1
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/dist/index.js +195 -3
- package/dist/organization-model/index.js +195 -3
- package/package.json +1 -1
- package/src/README.md +24 -17
- package/src/__tests__/template-foundations-compatibility.test.ts +95 -14
- package/src/auth/multi-tenancy/types.ts +2 -1
- package/src/execution/engine/__tests__/fixtures/test-agents.ts +4 -4
- package/src/execution/engine/index.ts +5 -19
- package/src/execution/engine/tools/platform/index.ts +9 -33
- package/src/execution/engine/tools/registry.ts +109 -2
- package/src/execution/engine/tools/tool-maps.ts +88 -0
- package/src/organization-model/README.md +19 -4
- package/src/organization-model/__tests__/graph.test.ts +612 -0
- package/src/organization-model/__tests__/resolve.test.ts +208 -0
- package/src/organization-model/defaults.ts +1 -1
- package/src/organization-model/organization-graph.mdx +262 -0
- package/src/organization-model/organization-model.mdx +257 -0
- package/src/organization-model/resolve.ts +26 -2
- package/src/organization-model/schema.ts +203 -1
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/registry/__tests__/resource-registry.integration.test.ts +24 -0
- package/src/platform/registry/__tests__/resource-registry.test.ts +63 -0
- package/src/platform/registry/resource-registry.ts +98 -10
- package/src/projects/api-schemas.ts +2 -1
- package/src/reference/_generated/contracts.md +1044 -0
- package/src/reference/glossary.md +88 -0
- package/src/server.ts +2 -3
- package/src/execution/engine/tools/platform/resource-invocation/__tests__/edge-cases.test.ts +0 -507
- package/src/execution/engine/tools/platform/resource-invocation/__tests__/resource-invocation-service.test.ts +0 -500
- package/src/execution/engine/tools/platform/resource-invocation/__tests__/tool.test.ts +0 -555
- package/src/execution/engine/tools/platform/resource-invocation/dynamic-tool.ts +0 -94
- package/src/execution/engine/tools/platform/resource-invocation/index.ts +0 -14
- package/src/execution/engine/tools/platform/resource-invocation/resource-invocation-service.ts +0 -147
- package/src/execution/engine/tools/platform/resource-invocation/tool.ts +0 -115
- package/src/execution/engine/tools/platform/resource-invocation/types.ts +0 -31
|
@@ -22,6 +22,18 @@ describe('organization-model', () => {
|
|
|
22
22
|
|
|
23
23
|
it('replaces arrays when a downstream override supplies a full slice', () => {
|
|
24
24
|
const model = resolveOrganizationModel({
|
|
25
|
+
domains: [
|
|
26
|
+
{
|
|
27
|
+
id: 'crm',
|
|
28
|
+
label: 'CRM',
|
|
29
|
+
description: 'Custom CRM workspace',
|
|
30
|
+
color: 'blue',
|
|
31
|
+
entityIds: [],
|
|
32
|
+
surfaceIds: ['custom.home'],
|
|
33
|
+
resourceIds: [],
|
|
34
|
+
capabilityIds: []
|
|
35
|
+
}
|
|
36
|
+
],
|
|
25
37
|
navigation: {
|
|
26
38
|
defaultSurfaceId: 'custom.home',
|
|
27
39
|
surfaces: [
|
|
@@ -44,4 +56,200 @@ describe('organization-model', () => {
|
|
|
44
56
|
expect(model.navigation.surfaces).toHaveLength(1)
|
|
45
57
|
expect(model.navigation.surfaces[0]?.path).toBe('/home')
|
|
46
58
|
})
|
|
59
|
+
|
|
60
|
+
describe('deepMerge semantics', () => {
|
|
61
|
+
it('returns defaults when no override is provided', () => {
|
|
62
|
+
const model = resolveOrganizationModel(undefined)
|
|
63
|
+
|
|
64
|
+
expect(model.version).toBe(1)
|
|
65
|
+
expect(model.branding.organizationName).toBe('Default Organization')
|
|
66
|
+
expect(model.branding.productName).toBe('Elevasis')
|
|
67
|
+
expect(model.branding.shortName).toBe('Elevasis')
|
|
68
|
+
expect(model.domains).toHaveLength(4)
|
|
69
|
+
expect(model.navigation.defaultSurfaceId).toBe('crm.pipeline')
|
|
70
|
+
expect(model.navigation.surfaces).toHaveLength(5)
|
|
71
|
+
expect(model.navigation.groups).toHaveLength(2)
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
it('preserves sibling fields when overriding a nested property', () => {
|
|
75
|
+
const model = resolveOrganizationModel({
|
|
76
|
+
branding: {
|
|
77
|
+
organizationName: 'OverriddenOrg'
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
expect(model.branding.organizationName).toBe('OverriddenOrg')
|
|
82
|
+
expect(model.branding.productName).toBe('Elevasis')
|
|
83
|
+
expect(model.branding.shortName).toBe('Elevasis')
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('replaces arrays entirely rather than merging', () => {
|
|
87
|
+
// Override domains with a single-item array that has no surfaceIds, so no
|
|
88
|
+
// cross-reference validation is needed. This proves the array is replaced (1 item)
|
|
89
|
+
// rather than merged/concatenated (would be 5 = 4 defaults + 1).
|
|
90
|
+
const model = resolveOrganizationModel({
|
|
91
|
+
domains: [
|
|
92
|
+
{
|
|
93
|
+
id: 'crm',
|
|
94
|
+
label: 'CRM',
|
|
95
|
+
description: 'CRM only',
|
|
96
|
+
color: 'blue',
|
|
97
|
+
entityIds: [],
|
|
98
|
+
surfaceIds: [],
|
|
99
|
+
resourceIds: [],
|
|
100
|
+
capabilityIds: []
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
navigation: {
|
|
104
|
+
defaultSurfaceId: 'home',
|
|
105
|
+
surfaces: [
|
|
106
|
+
{
|
|
107
|
+
id: 'home',
|
|
108
|
+
label: 'Home',
|
|
109
|
+
path: '/home',
|
|
110
|
+
surfaceType: 'page',
|
|
111
|
+
domainIds: [],
|
|
112
|
+
entityIds: [],
|
|
113
|
+
resourceIds: [],
|
|
114
|
+
capabilityIds: []
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
groups: []
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
expect(model.domains).toHaveLength(1)
|
|
122
|
+
expect(model.domains[0]?.id).toBe('crm')
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
it('ignores undefined values in the override', () => {
|
|
126
|
+
const model = resolveOrganizationModel({
|
|
127
|
+
branding: {
|
|
128
|
+
organizationName: 'Test',
|
|
129
|
+
productName: undefined
|
|
130
|
+
}
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
expect(model.branding.organizationName).toBe('Test')
|
|
134
|
+
expect(model.branding.productName).toBe('Elevasis')
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
describe('navigation group normalization', () => {
|
|
139
|
+
// A self-consistent single-surface override: one domain pointing at one surface,
|
|
140
|
+
// one surface pointing back at that domain. Groups are intentionally NOT overridden
|
|
141
|
+
// so normalization fires.
|
|
142
|
+
const singleSurfaceOverride = {
|
|
143
|
+
domains: [
|
|
144
|
+
{
|
|
145
|
+
id: 'crm',
|
|
146
|
+
label: 'CRM',
|
|
147
|
+
description: 'CRM workspace',
|
|
148
|
+
color: 'blue',
|
|
149
|
+
entityIds: [],
|
|
150
|
+
surfaceIds: ['crm.pipeline'],
|
|
151
|
+
resourceIds: [],
|
|
152
|
+
capabilityIds: []
|
|
153
|
+
}
|
|
154
|
+
],
|
|
155
|
+
navigation: {
|
|
156
|
+
defaultSurfaceId: 'crm.pipeline',
|
|
157
|
+
surfaces: [
|
|
158
|
+
{
|
|
159
|
+
id: 'crm.pipeline',
|
|
160
|
+
label: 'Pipeline',
|
|
161
|
+
path: '/crm/pipeline',
|
|
162
|
+
surfaceType: 'graph' as const,
|
|
163
|
+
domainIds: ['crm'],
|
|
164
|
+
entityIds: [],
|
|
165
|
+
resourceIds: [],
|
|
166
|
+
capabilityIds: []
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
// groups intentionally omitted — normalization must filter inherited groups
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
it('filters inherited groups to match overridden surfaces', () => {
|
|
174
|
+
// Only crm.pipeline is present. The default 'primary-workspace' group references
|
|
175
|
+
// crm.pipeline, lead-gen.lists, and projects.index. After normalization it should
|
|
176
|
+
// only contain crm.pipeline.
|
|
177
|
+
// The 'primary-operations' group references operations surfaces that are now gone,
|
|
178
|
+
// so it should be dropped entirely.
|
|
179
|
+
const model = resolveOrganizationModel(singleSurfaceOverride)
|
|
180
|
+
|
|
181
|
+
expect(model.navigation.surfaces).toHaveLength(1)
|
|
182
|
+
expect(model.navigation.surfaces[0]?.id).toBe('crm.pipeline')
|
|
183
|
+
|
|
184
|
+
// Only the workspace group survives (it has crm.pipeline); operations group is gone
|
|
185
|
+
expect(model.navigation.groups).toHaveLength(1)
|
|
186
|
+
expect(model.navigation.groups[0]?.id).toBe('primary-workspace')
|
|
187
|
+
expect(model.navigation.groups[0]?.surfaceIds).toEqual(['crm.pipeline'])
|
|
188
|
+
})
|
|
189
|
+
|
|
190
|
+
it('removes groups with no valid surface references', () => {
|
|
191
|
+
const model = resolveOrganizationModel(singleSurfaceOverride)
|
|
192
|
+
|
|
193
|
+
// The operations group (operations.organization-graph, operations.command-view)
|
|
194
|
+
// references surfaces not present in the override — it must be removed entirely
|
|
195
|
+
const operationsGroup = model.navigation.groups.find((g) => g.id === 'primary-operations')
|
|
196
|
+
expect(operationsGroup).toBeUndefined()
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
it('skips normalization when groups are explicitly overridden', () => {
|
|
200
|
+
// When groups are explicitly provided alongside surfaces, normalization is skipped.
|
|
201
|
+
// The group references only crm.pipeline (which is in the surface list).
|
|
202
|
+
const model = resolveOrganizationModel({
|
|
203
|
+
domains: [
|
|
204
|
+
{
|
|
205
|
+
id: 'crm',
|
|
206
|
+
label: 'CRM',
|
|
207
|
+
description: 'CRM workspace',
|
|
208
|
+
color: 'blue',
|
|
209
|
+
entityIds: [],
|
|
210
|
+
surfaceIds: ['crm.pipeline'],
|
|
211
|
+
resourceIds: [],
|
|
212
|
+
capabilityIds: []
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
navigation: {
|
|
216
|
+
defaultSurfaceId: 'crm.pipeline',
|
|
217
|
+
surfaces: [
|
|
218
|
+
{
|
|
219
|
+
id: 'crm.pipeline',
|
|
220
|
+
label: 'Pipeline',
|
|
221
|
+
path: '/crm/pipeline',
|
|
222
|
+
surfaceType: 'graph',
|
|
223
|
+
domainIds: ['crm'],
|
|
224
|
+
entityIds: [],
|
|
225
|
+
resourceIds: [],
|
|
226
|
+
capabilityIds: []
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
groups: [
|
|
230
|
+
{
|
|
231
|
+
id: 'custom-group',
|
|
232
|
+
label: 'Custom',
|
|
233
|
+
placement: 'primary',
|
|
234
|
+
surfaceIds: ['crm.pipeline']
|
|
235
|
+
}
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
// Groups come from the override exactly — no filtering applied
|
|
241
|
+
expect(model.navigation.groups).toHaveLength(1)
|
|
242
|
+
expect(model.navigation.groups[0]?.id).toBe('custom-group')
|
|
243
|
+
expect(model.navigation.groups[0]?.surfaceIds).toEqual(['crm.pipeline'])
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
|
|
247
|
+
describe('defineOrganizationModel', () => {
|
|
248
|
+
it('returns the input unchanged', () => {
|
|
249
|
+
const input = { branding: { organizationName: 'Test', productName: 'TestOS', shortName: 'T' } }
|
|
250
|
+
const output = defineOrganizationModel(input)
|
|
251
|
+
|
|
252
|
+
expect(output).toBe(input)
|
|
253
|
+
})
|
|
254
|
+
})
|
|
47
255
|
})
|
|
@@ -31,7 +31,7 @@ export const DEFAULT_ORGANIZATION_MODEL: OrganizationModel = {
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
id: 'delivery',
|
|
34
|
-
label: '
|
|
34
|
+
label: 'Projects',
|
|
35
35
|
description: 'Projects, milestones, and client work execution',
|
|
36
36
|
color: 'orange',
|
|
37
37
|
entityIds: ['delivery.project', 'delivery.milestone', 'delivery.task'],
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Organization Graph
|
|
3
|
+
description: Organization OS Graph layer documentation for the Cytoscape-based organization graph, derived from the organization model and bridged with Command View runtime topology through the shared feature provider.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
Within Organization OS, the organization graph is the dedicated **Graph** layer. It treats the organization model as the top-level ontology and bridges in Command View runtime topology so one graph can support semantic exploration and operations-oriented tracing. It is not a replacement renderer for Command View; it is a shared graph product that subsumes Command View as one operational lens.
|
|
9
|
+
|
|
10
|
+
Graph contracts live in `@repo/core` alongside the organization model. Rendering lives in `@repo/ui` with Cytoscape.js. The command-center route is a thin wrapper over the shared page.
|
|
11
|
+
|
|
12
|
+
## Status
|
|
13
|
+
|
|
14
|
+
First implementation slices are live end-to-end. Command View now delegates to the graph through a command-view lens preset. Layout iteration on the one-panel graph + command surface is ongoing; graph contracts and provider bridge are stable.
|
|
15
|
+
|
|
16
|
+
Graph types are intentionally **not** part of the published `@elevasis/core` surface yet. Graph adoption remains monorepo-first.
|
|
17
|
+
|
|
18
|
+
## Source of Truth
|
|
19
|
+
|
|
20
|
+
- `packages/core/src/organization-model/graph/types.ts` -- node/edge DTO shapes
|
|
21
|
+
- `packages/core/src/organization-model/graph/schema.ts` -- runtime validation
|
|
22
|
+
- `packages/core/src/organization-model/graph/build.ts` -- `buildOrganizationGraph(...)` derivation
|
|
23
|
+
- `packages/core/src/organization-model/__tests__/graph.test.ts` -- derivation and bridge tests
|
|
24
|
+
- `packages/ui/src/features/operations/OrganizationGraphPage.tsx` -- shared Cytoscape page
|
|
25
|
+
- `packages/ui/src/features/operations/CommandViewPage.tsx` -- command-view lens delegating to the graph
|
|
26
|
+
- `packages/ui/src/features/operations/organization-graph/` -- filter helpers, detail-state helpers, path tracing, operational summary
|
|
27
|
+
- `packages/ui/src/features/operations/manifest.ts` -- `organizationGraph.surfaceId = 'operations.organization-graph'`
|
|
28
|
+
- `apps/command-center/src/routes/operations/organization-graph.index.tsx` -- route wrapper
|
|
29
|
+
|
|
30
|
+
## Product Jobs
|
|
31
|
+
|
|
32
|
+
The graph helps users:
|
|
33
|
+
|
|
34
|
+
- orient themselves in the organization model
|
|
35
|
+
- discover how domains, capabilities, surfaces, entities, resources, and workflows connect
|
|
36
|
+
- trace upstream/downstream dependencies
|
|
37
|
+
- understand ownership and implementation boundaries
|
|
38
|
+
- assess blast radius before changing a workflow, agent, feature, or integration
|
|
39
|
+
- operate across strategy, operations, and debugging through different lenses on the same graph
|
|
40
|
+
|
|
41
|
+
The graph does not replace workflow editors, execution-run visualizers, or builder-style authoring canvases. React Flow remains the better fit for editor/execution visuals; Cytoscape fits the exploration-oriented ontology graph.
|
|
42
|
+
|
|
43
|
+
## Architecture
|
|
44
|
+
|
|
45
|
+
### Unified graph model
|
|
46
|
+
|
|
47
|
+
The implementation uses one typed graph, not separate semantic and implementation taxonomies.
|
|
48
|
+
|
|
49
|
+
- Node kinds: `organization`, `feature`, `domain`, `surface`, `entity`, `capability`, `resource`
|
|
50
|
+
- Edge kinds: `contains`, `references`, `exposes`, `maps_to`
|
|
51
|
+
- `resource` nodes carry `resourceType` metadata: `workflow`, `agent`, `trigger`, `integration`, `external`, or `human_checkpoint`
|
|
52
|
+
- `references` edges may also carry `relationshipType`: `triggers`, `uses`, or `approval`
|
|
53
|
+
|
|
54
|
+
This means runtime topology is represented as bridged `resource` nodes plus relationship metadata on shared edge types, rather than as a second disconnected edge/node vocabulary.
|
|
55
|
+
|
|
56
|
+
### Compatibility rules with the organization model
|
|
57
|
+
|
|
58
|
+
- `OrganizationModelSchema` is the source of truth for semantic structure. The graph does not introduce a second ontology.
|
|
59
|
+
- Graph node IDs and references reuse organization-model IDs wherever those IDs already exist.
|
|
60
|
+
- `domain` nodes derive from `organizationModel.domains`.
|
|
61
|
+
- `surface` nodes derive from `organizationModel.navigation.surfaces`; graph routing respects surface `path` and `defaultSurfaceId`.
|
|
62
|
+
- Feature gating and labels respect `organizationModel.features.enabled` and `.labels`.
|
|
63
|
+
- Implementation-resource bridging prefers `organizationModel.resourceMappings`.
|
|
64
|
+
- Graph defaults remain valid when produced by `resolveOrganizationModel()`.
|
|
65
|
+
- If the graph needs a concept the model cannot express, extend the model first.
|
|
66
|
+
|
|
67
|
+
### Shared DTO
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
type OrganizationGraphNodeKind =
|
|
71
|
+
| 'organization'
|
|
72
|
+
| 'feature'
|
|
73
|
+
| 'domain'
|
|
74
|
+
| 'surface'
|
|
75
|
+
| 'entity'
|
|
76
|
+
| 'capability'
|
|
77
|
+
| 'resource'
|
|
78
|
+
|
|
79
|
+
type OrganizationGraphEdgeKind = 'contains' | 'references' | 'exposes' | 'maps_to'
|
|
80
|
+
|
|
81
|
+
interface OrganizationGraph {
|
|
82
|
+
version: 1
|
|
83
|
+
organizationModelVersion: OrganizationModel['version']
|
|
84
|
+
nodes: OrganizationGraphNode[]
|
|
85
|
+
edges: OrganizationGraphEdge[]
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`OrganizationGraphNode` also includes optional `sourceId`, `description`, `enabled`, `featureKey`, `surfaceType`, and `resourceType`. `OrganizationGraphEdge` includes optional `label` and `relationshipType`.
|
|
90
|
+
|
|
91
|
+
### Build pipeline
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
interface BuildOrganizationGraphInput {
|
|
95
|
+
organizationModel: OrganizationModel
|
|
96
|
+
commandViewData?: CommandViewData
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
`buildOrganizationGraph` accepts optional topology input so the semantic graph still renders when operational bridging is sparse. The derivation flow is additive and upsert-oriented:
|
|
101
|
+
|
|
102
|
+
1. Resolve the active organization model.
|
|
103
|
+
2. Derive semantic nodes and edges from domains, features, surfaces, entities, capabilities, and resource mappings.
|
|
104
|
+
3. Upsert bridged runtime resources from Command View data into shared `resource` nodes.
|
|
105
|
+
4. Merge topology relationships onto the same DTO using `references` or `maps_to` edges plus optional `relationshipType`.
|
|
106
|
+
5. Hand the resulting graph to UI-level lensing, filtering, and Cytoscape projection.
|
|
107
|
+
|
|
108
|
+
Keeping assembly outside the renderer keeps graph semantics testable without UI and prevents Cytoscape concepts from leaking into business logic.
|
|
109
|
+
|
|
110
|
+
### Ownership split
|
|
111
|
+
|
|
112
|
+
- `@repo/core` owns normalized node/edge types, schemas, and build/derivation helpers.
|
|
113
|
+
- `@repo/ui` owns Cytoscape element conversion, layout presets, selection/hover/expansion/viewport state, detail panels, and presentation helpers.
|
|
114
|
+
- `apps/command-center` owns route wiring and page-level integration.
|
|
115
|
+
|
|
116
|
+
## Interaction Model
|
|
117
|
+
|
|
118
|
+
### Lenses
|
|
119
|
+
|
|
120
|
+
The graph ships with two lens presets in UI code:
|
|
121
|
+
|
|
122
|
+
- `default` -- title "Organization Graph", initial mode `map`, no preset filters
|
|
123
|
+
- `command-view` -- title "Command View", initial mode `trace`, filters preset to `nodeKinds: ['resource']` and `topologyPresence: 'topology-only'`
|
|
124
|
+
|
|
125
|
+
Lenses do not change the core DTO. They configure how the shared graph is initially presented.
|
|
126
|
+
|
|
127
|
+
### Modes
|
|
128
|
+
|
|
129
|
+
- **Map mode** -- clustered for broad graph orientation
|
|
130
|
+
- **Trace mode** -- directed layout that privileges path readability
|
|
131
|
+
- **Impact mode** -- centered radial/concentric layout around the current focus
|
|
132
|
+
|
|
133
|
+
Layouts are deterministic presets, not unconstrained force simulation:
|
|
134
|
+
|
|
135
|
+
- `map` uses Cytoscape `cose`
|
|
136
|
+
- `trace` uses directed `breadthfirst`
|
|
137
|
+
- `impact` uses degree-based `concentric`
|
|
138
|
+
|
|
139
|
+
### Interactions
|
|
140
|
+
|
|
141
|
+
Primary set, kept small and high-value:
|
|
142
|
+
|
|
143
|
+
- click node for detail panel
|
|
144
|
+
- click edge for relationship meaning
|
|
145
|
+
- hover for adjacency preview
|
|
146
|
+
- search and jump to node
|
|
147
|
+
- expand immediate neighbors
|
|
148
|
+
- isolate selected node + N-hop neighborhood
|
|
149
|
+
- switch mode
|
|
150
|
+
- pin selected nodes
|
|
151
|
+
- highlight shortest or most relevant path between two nodes
|
|
152
|
+
- filter by node kind, domain, capability, feature, status, environment
|
|
153
|
+
|
|
154
|
+
Deferred: freeform node placement, collaborative annotations, graph editing/authoring, arbitrary canvas drawing.
|
|
155
|
+
|
|
156
|
+
### Filtering
|
|
157
|
+
|
|
158
|
+
The filter state lives in `useOrganizationGraphFilters()` and the toolbar UI in `OrganizationGraphFilterToolbar`.
|
|
159
|
+
|
|
160
|
+
Filter inputs:
|
|
161
|
+
|
|
162
|
+
- `search`
|
|
163
|
+
- `nodeKinds`
|
|
164
|
+
- `topologyPresence: 'all' | 'semantic-only' | 'topology-only'`
|
|
165
|
+
|
|
166
|
+
Presence is derived per node:
|
|
167
|
+
|
|
168
|
+
- `resource` nodes are `topology-only`
|
|
169
|
+
- nodes with only semantic edges are `semantic-only`
|
|
170
|
+
- nodes with both semantic and topology edges are treated as bridge nodes internally
|
|
171
|
+
|
|
172
|
+
Search matches node IDs, labels, descriptions, source IDs, feature keys, surface/resource types, edge labels, edge kinds, and `relationshipType`.
|
|
173
|
+
|
|
174
|
+
The page applies `useDeferredValue()` to the active filters so graph search stays responsive while typing.
|
|
175
|
+
|
|
176
|
+
### Path tracing
|
|
177
|
+
|
|
178
|
+
The visible Cytoscape surface projects a **filtered** shared graph DTO rather than rendering the full graph unconditionally. Path tracing resolves and highlights directed paths inside the current visible projection, so filtering and tracing stay coherent.
|
|
179
|
+
|
|
180
|
+
Renderer-agnostic helpers under `packages/ui/src/features/operations/organization-graph/path-tracing/` implement shortest-path logic independent of Cytoscape.
|
|
181
|
+
|
|
182
|
+
## Provider Integration
|
|
183
|
+
|
|
184
|
+
The graph is exposed through `ElevasisFeaturesProvider` rather than as app-local glue:
|
|
185
|
+
|
|
186
|
+
- `FeatureModule.organizationGraph.surfaceId` declares a manifest's bridge point.
|
|
187
|
+
- `operationsManifest` declares `organizationGraph.surfaceId = 'operations.organization-graph'`.
|
|
188
|
+
- The provider resolves that against `organizationModel.navigation.surfaces` and exposes the result as `organizationGraph` in context.
|
|
189
|
+
- Shared UI/operations code stays manifest-driven while remaining aware of semantic organization topology.
|
|
190
|
+
|
|
191
|
+
## Command View Integration
|
|
192
|
+
|
|
193
|
+
`CommandViewPage` now delegates to `OrganizationGraphPage` through a command-view lens preset. The lens restores high-value operational context through:
|
|
194
|
+
|
|
195
|
+
- route-level execution-health cards
|
|
196
|
+
- selection-aware resource and human-checkpoint summaries inside the shared graph detail panel
|
|
197
|
+
- follow-up actions for recent executions and pending tasks inside the detail panel
|
|
198
|
+
- dedicated command-view sidebar content (`Command View` labeling and node filters live in the subshell sidebar, not on the graph canvas)
|
|
199
|
+
|
|
200
|
+
Operational summary and drill-down derivation is covered by tests under `packages/ui/src/features/operations/organization-graph/__tests__/`.
|
|
201
|
+
|
|
202
|
+
The detail experience is shared through `OrganizationGraphDetailPanel`, which can render both semantic context and command-view-specific follow-up sections.
|
|
203
|
+
|
|
204
|
+
## Cytoscape Responsibility Split
|
|
205
|
+
|
|
206
|
+
Cytoscape owns:
|
|
207
|
+
|
|
208
|
+
- element rendering
|
|
209
|
+
- compound/group visualization
|
|
210
|
+
- neighborhood traversal and selection state
|
|
211
|
+
- path highlighting
|
|
212
|
+
- collapsed/expanded cluster behavior
|
|
213
|
+
- layout execution
|
|
214
|
+
- viewport mechanics (pan, zoom, fit, focus)
|
|
215
|
+
|
|
216
|
+
React owns:
|
|
217
|
+
|
|
218
|
+
- mode switching
|
|
219
|
+
- side panels and inspectors
|
|
220
|
+
- search and command-palette entry
|
|
221
|
+
- route state and deep-linking
|
|
222
|
+
- server data fetching
|
|
223
|
+
- persistence of saved filters and views
|
|
224
|
+
|
|
225
|
+
## Package Boundary
|
|
226
|
+
|
|
227
|
+
- `packages/ui/package.json` declares Cytoscape on the published UI surface.
|
|
228
|
+
- `packages/ui/tsup.config.ts` and `packages/ui/rollup.dts.config.mjs` keep Cytoscape **externalized** for publish output.
|
|
229
|
+
- Graph DTO types are internal to `@repo/core`. The published `@elevasis/core` wrapper still exposes only the narrow organization-model API. External graph adoption should not be assumed.
|
|
230
|
+
|
|
231
|
+
## Theming
|
|
232
|
+
|
|
233
|
+
The shared Cytoscape page reads CSS custom properties at runtime via `window.getComputedStyle(document.documentElement)`. Nodes, edges, overlays, and glass panels stay aligned with the active UI theme instead of relying on a fixed graph-only palette.
|
|
234
|
+
|
|
235
|
+
## Cytoscape States
|
|
236
|
+
|
|
237
|
+
The renderer applies CSS-class-style state markers to highlight context and traces:
|
|
238
|
+
|
|
239
|
+
- `.is-faded`
|
|
240
|
+
- `.is-context`
|
|
241
|
+
- `.is-selected`
|
|
242
|
+
- `.is-connected`
|
|
243
|
+
- `.is-trace-node`
|
|
244
|
+
- `.is-trace-endpoint`
|
|
245
|
+
- `.is-trace-edge`
|
|
246
|
+
|
|
247
|
+
These classes drive neighborhood focus, selection emphasis, and trace-path highlighting without changing the underlying DTO.
|
|
248
|
+
|
|
249
|
+
## Migration Guardrails
|
|
250
|
+
|
|
251
|
+
- Do not move canonical graph interfaces into `packages/ui`.
|
|
252
|
+
- Do not redefine organization-model semantics in app-local graph config.
|
|
253
|
+
- Do not make the graph contract depend on Cytoscape-specific types.
|
|
254
|
+
- Existing Command View relationships bridge into `relationshipType = triggers | uses | approval` -- do not overload those operational labels with new semantic meaning.
|
|
255
|
+
|
|
256
|
+
## Verification
|
|
257
|
+
|
|
258
|
+
- `pnpm --filter @repo/core test -- organization-model graph`
|
|
259
|
+
- `pnpm --filter @repo/ui test -- commandViewDrillDown commandViewOperationalSummary organizationGraphDetail`
|
|
260
|
+
- `pnpm --filter @repo/ui build`
|
|
261
|
+
- `pnpm --filter @repo/ui build:publish`
|
|
262
|
+
- `pnpm --filter command-center build`
|