@elevasis/sdk 1.20.2 → 1.22.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/dist/cli.cjs +4220 -1583
- package/dist/index.d.ts +1035 -481
- package/dist/index.js +7381 -4187
- package/dist/node/index.d.ts +1 -3
- package/dist/node/index.js +40 -49
- package/dist/test-utils/index.d.ts +699 -123
- package/dist/test-utils/index.js +3826 -630
- package/dist/worker/index.js +3616 -442
- package/package.json +3 -3
- package/reference/_navigation.md +9 -7
- package/reference/_reference-manifest.json +1 -1
- package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
- package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
- package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
- package/reference/claude-config/registries/graph-skills.json +4 -4
- package/reference/claude-config/registries/knowledge-flags.json +0 -2
- package/reference/claude-config/rules/active-change-index.md +80 -80
- package/reference/claude-config/rules/agent-start-here.md +277 -273
- package/reference/claude-config/rules/deployment.md +57 -57
- package/reference/claude-config/rules/error-handling.md +56 -56
- package/reference/claude-config/rules/execution.md +40 -40
- package/reference/claude-config/rules/frontend.md +4 -4
- package/reference/claude-config/rules/observability.md +31 -31
- package/reference/claude-config/rules/operations.md +29 -17
- package/reference/claude-config/rules/organization-model.md +108 -40
- package/reference/claude-config/rules/organization-os.md +115 -113
- package/reference/claude-config/rules/package-taxonomy.md +33 -33
- package/reference/claude-config/rules/platform.md +42 -42
- package/reference/claude-config/rules/shared-types.md +49 -46
- package/reference/claude-config/rules/task-tracking.md +47 -47
- package/reference/claude-config/rules/ui.md +200 -200
- package/reference/claude-config/rules/vibe.md +235 -231
- package/reference/claude-config/scripts/statusline-command.js +18 -18
- package/reference/claude-config/settings.json +34 -34
- package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
- package/reference/claude-config/skills/dsp/SKILL.md +66 -66
- package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
- package/reference/claude-config/skills/explore/SKILL.md +6 -6
- package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
- package/reference/claude-config/skills/knowledge/SKILL.md +330 -271
- package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
- package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -158
- package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
- package/reference/claude-config/skills/knowledge/operations/features.md +76 -113
- package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
- package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
- package/reference/claude-config/skills/knowledge/operations/labels.md +94 -89
- package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
- package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
- package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
- package/reference/claude-config/skills/project/SKILL.md +1088 -1088
- package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
- package/reference/claude-config/skills/save/SKILL.md +3 -3
- package/reference/claude-config/skills/setup/SKILL.md +275 -275
- package/reference/claude-config/skills/status/SKILL.md +59 -59
- package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
- package/reference/claude-config/skills/sync/SKILL.md +47 -47
- package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
- package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
- package/reference/claude-config/skills/tutorial/technical.md +1303 -1306
- package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
- package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
- package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
- package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
- package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
- package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
- package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
- package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
- package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
- package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
- package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
- package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
- package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
- package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
- package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
- package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
- package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
- package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
- package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
- package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
- package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
- package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
- package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -0
- package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
- package/reference/claude-config/sync-notes/README.md +43 -43
- package/reference/cli.mdx +808 -668
- package/reference/concepts.mdx +146 -146
- package/reference/deployment/api.mdx +297 -297
- package/reference/deployment/command-center.mdx +209 -209
- package/reference/deployment/index.mdx +195 -195
- package/reference/deployment/provided-features.mdx +107 -93
- package/reference/deployment/ui-execution.mdx +250 -250
- package/reference/examples/organization-model.ts +147 -84
- package/reference/framework/agent.mdx +156 -156
- package/reference/framework/index.mdx +195 -195
- package/reference/framework/interaction-guidance.mdx +182 -182
- package/reference/framework/memory.mdx +326 -326
- package/reference/framework/project-structure.mdx +282 -282
- package/reference/framework/tutorial-system.mdx +135 -135
- package/reference/getting-started.mdx +142 -142
- package/reference/index.mdx +106 -106
- package/reference/packages/core/src/README.md +14 -14
- package/reference/packages/core/src/business/README.md +2 -2
- package/reference/packages/core/src/knowledge/README.md +33 -32
- package/reference/packages/core/src/organization-model/README.md +149 -109
- package/reference/packages/core/src/test-utils/README.md +37 -37
- package/reference/packages/ui/src/api/README.md +18 -18
- package/reference/packages/ui/src/app/README.md +24 -24
- package/reference/packages/ui/src/auth/README.md +18 -18
- package/reference/packages/ui/src/components/README.md +24 -24
- package/reference/packages/ui/src/execution/README.md +16 -16
- package/reference/packages/ui/src/features/README.md +28 -28
- package/reference/packages/ui/src/graph/README.md +16 -16
- package/reference/packages/ui/src/hooks/README.md +23 -23
- package/reference/packages/ui/src/initialization/README.md +19 -19
- package/reference/packages/ui/src/knowledge/README.md +31 -31
- package/reference/packages/ui/src/organization/README.md +18 -18
- package/reference/packages/ui/src/profile/README.md +19 -19
- package/reference/packages/ui/src/provider/README.md +32 -32
- package/reference/packages/ui/src/router/README.md +18 -18
- package/reference/packages/ui/src/sse/README.md +13 -13
- package/reference/packages/ui/src/test-utils/README.md +7 -7
- package/reference/packages/ui/src/theme/README.md +23 -23
- package/reference/packages/ui/src/theme/presets/README.md +19 -19
- package/reference/packages/ui/src/types/README.md +16 -16
- package/reference/packages/ui/src/utils/README.md +18 -18
- package/reference/packages/ui/src/zustand/README.md +18 -18
- package/reference/platform-tools/adapters-integration.mdx +301 -301
- package/reference/platform-tools/adapters-platform.mdx +553 -553
- package/reference/platform-tools/index.mdx +217 -217
- package/reference/platform-tools/type-safety.mdx +82 -82
- package/reference/resources/index.mdx +349 -349
- package/reference/resources/patterns.mdx +449 -449
- package/reference/resources/types.mdx +116 -116
- package/reference/roadmap.mdx +165 -165
- package/reference/runtime.mdx +173 -173
- package/reference/scaffold/core/organization-graph.mdx +110 -89
- package/reference/scaffold/core/organization-model.mdx +226 -171
- package/reference/scaffold/index.mdx +67 -67
- package/reference/scaffold/operations/propagation-pipeline.md +77 -77
- package/reference/scaffold/operations/scaffold-maintenance.md +10 -10
- package/reference/scaffold/operations/workflow-recipes.md +138 -138
- package/reference/scaffold/recipes/add-a-feature.md +310 -88
- package/reference/scaffold/recipes/add-a-resource.md +137 -117
- package/reference/scaffold/recipes/customize-crm-actions.md +439 -439
- package/reference/scaffold/recipes/customize-knowledge-browser.md +384 -0
- package/reference/scaffold/recipes/customize-organization-model.md +281 -118
- package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
- package/reference/scaffold/recipes/extend-crm.md +40 -39
- package/reference/scaffold/recipes/extend-lead-gen.md +400 -401
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -114
- package/reference/scaffold/recipes/index.md +47 -46
- package/reference/scaffold/recipes/query-the-knowledge-graph.md +227 -0
- package/reference/scaffold/reference/contracts.md +2389 -2121
- package/reference/scaffold/reference/feature-registry.md +9 -20
- package/reference/scaffold/reference/glossary.md +76 -76
- package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
- package/reference/scaffold/ui/customization.md +243 -243
- package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
- package/reference/scaffold/ui/feature-shell.mdx +72 -72
- package/reference/scaffold/ui/recipes.md +221 -213
- package/reference/spine/spine-primer.md +96 -96
- package/reference/templates/index.mdx +47 -47
- package/reference/troubleshooting.mdx +223 -223
|
@@ -1,120 +1,342 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Add
|
|
3
|
-
description: Add a
|
|
4
|
-
---
|
|
1
|
+
---
|
|
2
|
+
title: Add an OM-Backed System
|
|
3
|
+
description: Add a system through the Organization Model, runtime resource descriptors, UI wiring, and alignment tests.
|
|
4
|
+
---
|
|
5
5
|
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
|
|
6
6
|
<!-- Regenerate: pnpm scaffold:sync -->
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
# Add
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
|
|
9
|
+
# Add an OM-Backed System
|
|
10
|
+
|
|
11
|
+
Use this recipe when a project needs a new bounded system with semantic model entries, executable resources, and optional UI presence. The correct shape is model-first: define the Organization Model boundary, then attach workflows, agents, routes, and tests to the same IDs.
|
|
12
|
+
|
|
13
|
+
Do not create a second identity catalog in operations or UI code. System IDs, resource IDs, and ontology IDs should come from the Organization Model.
|
|
14
|
+
|
|
15
|
+
## 1. Add the System
|
|
16
|
+
|
|
17
|
+
Edit `core/config/organization-model.ts` and add the system to the `systems` override. Use nested `systems` plus dotted IDs for hierarchy.
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const organizationOverride = defineOrganizationModel({
|
|
21
|
+
systems: {
|
|
22
|
+
operations: {
|
|
23
|
+
id: 'operations',
|
|
24
|
+
order: 10,
|
|
25
|
+
label: 'Operations',
|
|
26
|
+
description: 'Operational work orchestration.',
|
|
27
|
+
kind: 'operational',
|
|
28
|
+
lifecycle: 'active',
|
|
29
|
+
ui: {
|
|
30
|
+
path: '/operations',
|
|
31
|
+
surfaces: []
|
|
32
|
+
},
|
|
33
|
+
systems: {
|
|
34
|
+
review: {
|
|
35
|
+
id: 'operations.review',
|
|
36
|
+
order: 20,
|
|
37
|
+
label: 'Review',
|
|
38
|
+
description: 'Human review and approval work.',
|
|
39
|
+
kind: 'operational',
|
|
40
|
+
parentSystemId: 'operations',
|
|
41
|
+
lifecycle: 'active',
|
|
42
|
+
ui: {
|
|
43
|
+
path: '/operations/review',
|
|
44
|
+
surfaces: []
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
27
48
|
}
|
|
28
|
-
|
|
49
|
+
}
|
|
29
50
|
})
|
|
30
51
|
```
|
|
31
52
|
|
|
32
|
-
|
|
53
|
+
If the local project already uses recursive `subsystems`, treat that as compatibility authoring. Do not mix `systems` and `subsystems` in the same branch; prefer moving new examples to `systems`.
|
|
54
|
+
|
|
55
|
+
## 2. Add Ontology Object Types for Durable Business Nouns
|
|
56
|
+
|
|
57
|
+
Add ontology object types only for stable business objects the system owns. Object types are semantic contracts; they are not every DTO, provider payload, or workflow step shape.
|
|
33
58
|
|
|
34
59
|
```ts
|
|
35
|
-
|
|
36
|
-
|
|
60
|
+
systems: {
|
|
61
|
+
operations: {
|
|
62
|
+
id: 'operations',
|
|
63
|
+
order: 10,
|
|
64
|
+
label: 'Operations',
|
|
65
|
+
lifecycle: 'active',
|
|
66
|
+
systems: {
|
|
67
|
+
review: {
|
|
68
|
+
id: 'operations.review',
|
|
69
|
+
order: 20,
|
|
70
|
+
label: 'Review',
|
|
71
|
+
lifecycle: 'active',
|
|
72
|
+
ontology: {
|
|
73
|
+
objectTypes: {
|
|
74
|
+
'operations.review:object/review-item': {
|
|
75
|
+
id: 'operations.review:object/review-item',
|
|
76
|
+
label: 'Review Item',
|
|
77
|
+
description: 'A human-reviewable work item produced by an automation.',
|
|
78
|
+
ownerSystemId: 'operations.review',
|
|
79
|
+
storage: { kind: 'table', table: 'review_items' }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
37
87
|
```
|
|
38
88
|
|
|
39
|
-
|
|
89
|
+
Use ontology `linkTypes` when the object has durable relationships to other modeled object types. Top-level `entities` still work for existing consumers, but they are compatibility inputs that compile into object and link types. New authoring belongs in `System.ontology.objectTypes` and `System.ontology.linkTypes`.
|
|
40
90
|
|
|
41
|
-
##
|
|
91
|
+
## 3. Add Ontology Action Types for Stable Business Verbs
|
|
42
92
|
|
|
43
|
-
|
|
93
|
+
Add ontology action types for verbs that operators, policies, Command View, or agents should reason about.
|
|
44
94
|
|
|
45
95
|
```ts
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
96
|
+
systems: {
|
|
97
|
+
operations: {
|
|
98
|
+
id: 'operations',
|
|
99
|
+
order: 10,
|
|
100
|
+
label: 'Operations',
|
|
101
|
+
lifecycle: 'active',
|
|
102
|
+
systems: {
|
|
103
|
+
review: {
|
|
104
|
+
id: 'operations.review',
|
|
105
|
+
order: 20,
|
|
106
|
+
label: 'Review',
|
|
107
|
+
lifecycle: 'active',
|
|
108
|
+
ontology: {
|
|
109
|
+
actionTypes: {
|
|
110
|
+
'operations.review:action/review-item.approve': {
|
|
111
|
+
id: 'operations.review:action/review-item.approve',
|
|
112
|
+
label: 'Approve Review Item',
|
|
113
|
+
description: 'Approve a pending human review item.',
|
|
114
|
+
ownerSystemId: 'operations.review',
|
|
115
|
+
actsOn: ['operations.review:object/review-item'],
|
|
116
|
+
effects: [{ kind: 'emitEvent', eventType: 'operations.review:event/review-item.approved' }]
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
55
123
|
}
|
|
56
124
|
```
|
|
57
125
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## 3. Add routes
|
|
61
|
-
|
|
62
|
-
Create TanStack routes whose paths match the feature nodes.
|
|
126
|
+
Runtime availability, payload schemas, prioritization, and side effects stay in runtime code. The action type is the stable semantic verb. Top-level `actions` still work for existing consumers, but they are compatibility inputs. New authoring belongs in `System.ontology.actionTypes`.
|
|
63
127
|
|
|
64
|
-
|
|
65
|
-
import { createFileRoute, Outlet } from '@tanstack/react-router'
|
|
66
|
-
import { ProtectedRoute, FeatureGuard } from '@elevasis/ui/features/auth'
|
|
128
|
+
## 4. Add Ontology Catalog Types for Local Catalogs
|
|
67
129
|
|
|
68
|
-
|
|
69
|
-
component: AnalyticsLayout
|
|
70
|
-
})
|
|
130
|
+
Use `System.ontology.catalogTypes` for pipelines, stages, templates, template steps, status flows, status entries, and small config vocabularies owned by the system.
|
|
71
131
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
132
|
+
```ts
|
|
133
|
+
systems: {
|
|
134
|
+
operations: {
|
|
135
|
+
id: 'operations',
|
|
136
|
+
order: 10,
|
|
137
|
+
label: 'Operations',
|
|
138
|
+
lifecycle: 'active',
|
|
139
|
+
systems: {
|
|
140
|
+
review: {
|
|
141
|
+
id: 'operations.review',
|
|
142
|
+
order: 20,
|
|
143
|
+
label: 'Review',
|
|
144
|
+
lifecycle: 'active',
|
|
145
|
+
parentSystemId: 'operations',
|
|
146
|
+
ontology: {
|
|
147
|
+
catalogTypes: {
|
|
148
|
+
'operations.review:catalog/review-flow': {
|
|
149
|
+
id: 'operations.review:catalog/review-flow',
|
|
150
|
+
kind: 'status-flow',
|
|
151
|
+
label: 'Review Statuses',
|
|
152
|
+
ownerSystemId: 'operations.review',
|
|
153
|
+
appliesTo: 'operations.review:object/review-item',
|
|
154
|
+
entries: {
|
|
155
|
+
pending: { label: 'Pending', semanticClass: 'open', order: 10 },
|
|
156
|
+
approved: { label: 'Approved', semanticClass: 'completed', order: 20 }
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
80
164
|
}
|
|
81
165
|
```
|
|
82
166
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
For workflows or agents that power the feature, author an OM Resource descriptor first, then derive runtime metadata from it:
|
|
167
|
+
Do not use catalog entries as an action registry. If a template step invokes a canonical action, store the action ID in the catalog entry metadata and keep the action contract in `actionTypes`.
|
|
86
168
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
169
|
+
`System.content kind: "schema"` still works for existing consumers and projects into ontology catalog types. Use it only when maintaining code that has not moved yet; new authoring belongs in `System.ontology.catalogTypes`.
|
|
170
|
+
|
|
171
|
+
## 5. Add Resource Descriptors
|
|
172
|
+
|
|
173
|
+
Resources are governed descriptors for executable workflows, agents, integrations, and scripts. Operations imports them and derives runtime identity from them.
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
import { defineResources } from '@elevasis/core/organization-model'
|
|
177
|
+
|
|
178
|
+
export const resourceDescriptors = defineResources({
|
|
179
|
+
approveReviewItem: {
|
|
180
|
+
id: 'approve-review-item-workflow',
|
|
181
|
+
order: 10,
|
|
182
|
+
kind: 'workflow',
|
|
183
|
+
systemPath: 'operations.review',
|
|
184
|
+
ownerRoleId: 'role-ops-lead',
|
|
185
|
+
status: 'active',
|
|
186
|
+
actionKey: 'operations.review.approve',
|
|
187
|
+
codeRefs: [
|
|
188
|
+
{
|
|
189
|
+
path: 'operations/src/review/approve-review-item/index.ts',
|
|
190
|
+
role: 'entrypoint',
|
|
191
|
+
symbol: 'approveReviewItemWorkflow'
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
path: 'operations/src/review/approve-review-item/approve-review-item.test.ts',
|
|
195
|
+
role: 'test'
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
ontology: {
|
|
199
|
+
implements: ['operations.review:action/review-item.approve'],
|
|
200
|
+
reads: ['operations.review:object/review-item'],
|
|
201
|
+
writes: ['operations.review:object/review-item'],
|
|
202
|
+
emits: ['operations.review:event/review-item.approved']
|
|
203
|
+
}
|
|
98
204
|
}
|
|
99
205
|
})
|
|
100
|
-
|
|
101
|
-
// operations/src/analytics-refresh/index.ts
|
|
102
|
-
config: {
|
|
103
|
-
resource: resourceDescriptors.analyticsRefresh,
|
|
104
|
-
resourceId: resourceDescriptors.analyticsRefresh.id,
|
|
105
|
-
name: 'Analytics Refresh',
|
|
106
|
-
type: resourceDescriptors.analyticsRefresh.kind,
|
|
107
|
-
version: '1.0.0',
|
|
108
|
-
status: 'prod',
|
|
109
|
-
links: [{ nodeId: 'feature:analytics', kind: 'operates-on' }],
|
|
110
|
-
category: 'production'
|
|
111
|
-
}
|
|
112
206
|
```
|
|
113
207
|
|
|
114
|
-
|
|
208
|
+
Use `actionKey` only when a Resource implements a stable action contract. Keep it URL-safe because some runtimes expose action keys in route params. Resource-only workflows, diagnostics, and helper scripts can stay unbound.
|
|
115
209
|
|
|
116
|
-
|
|
210
|
+
Use nested `resource.ontology` bindings for the semantic actions, objects, catalogs, and events a Resource implements, reads, writes, uses, or emits. Top-level resource `emits` remains readable for bridge-era descriptors, but new descriptors should keep event bindings in `resource.ontology.emits`.
|
|
211
|
+
|
|
212
|
+
Use `codeRefs` as repo-relative breadcrumbs for agents and operators. They point from the governed Resource descriptor to implementation files; they do not define resource identity, System membership, runtime topology, or graph links.
|
|
213
|
+
|
|
214
|
+
## 6. Bind Runtime to the Descriptor
|
|
215
|
+
|
|
216
|
+
Workflow and agent code owns schemas, handlers, steps, and runtime behavior. It should import the descriptor and derive `resourceId`, `type`, and `actionKey`.
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
import type { WorkflowDefinition } from '@elevasis/sdk'
|
|
220
|
+
import { resourceDescriptors } from '@core/config/organization-model'
|
|
221
|
+
|
|
222
|
+
export const approveReviewItemWorkflow: WorkflowDefinition = {
|
|
223
|
+
config: {
|
|
224
|
+
resource: resourceDescriptors.approveReviewItem,
|
|
225
|
+
resourceId: resourceDescriptors.approveReviewItem.id,
|
|
226
|
+
name: 'Approve review item',
|
|
227
|
+
type: resourceDescriptors.approveReviewItem.kind,
|
|
228
|
+
version: '1.0.0',
|
|
229
|
+
status: 'dev',
|
|
230
|
+
category: 'production',
|
|
231
|
+
actionKey: resourceDescriptors.approveReviewItem.actionKey
|
|
232
|
+
},
|
|
233
|
+
contract: {
|
|
234
|
+
inputSchema,
|
|
235
|
+
outputSchema
|
|
236
|
+
},
|
|
237
|
+
steps,
|
|
238
|
+
entryPoint: 'approve'
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Register runtime resources in the deployment assembly, usually `operations/src/index.ts`:
|
|
243
|
+
|
|
244
|
+
```ts
|
|
245
|
+
export const org = {
|
|
246
|
+
version: '0.1.0',
|
|
247
|
+
organizationModel: resourceGovernanceModel,
|
|
248
|
+
workflows: [approveReviewItemWorkflow],
|
|
249
|
+
agents: [],
|
|
250
|
+
relationships: {
|
|
251
|
+
'approve-review-item-workflow': {
|
|
252
|
+
uses: { integrations: ['email'] }
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Use `relationships` for execution topology. Use `systemPath`, `resource.ontology`, and `actionKey` for semantic topology. Existing compatibility graph links can stay readable while old consumers migrate.
|
|
259
|
+
|
|
260
|
+
## 7. Add UI Wiring
|
|
261
|
+
|
|
262
|
+
If the system needs UI, add shell wiring after the OM IDs are stable.
|
|
263
|
+
|
|
264
|
+
1. Create a `SystemModule` manifest with `systemId` equal to the OM System ID.
|
|
265
|
+
2. Register the manifest in the project manifest array.
|
|
266
|
+
3. Add TanStack routes whose paths match the system or sidebar surface path.
|
|
267
|
+
4. Wrap pages in the existing auth guard and `SystemGuard`.
|
|
268
|
+
5. Query OM resources, compiled ontology indexes, compatibility actions, and graph data where possible instead of hardcoding a page-local registry.
|
|
269
|
+
|
|
270
|
+
```tsx
|
|
271
|
+
import type { SystemModule } from '@elevasis/ui/provider'
|
|
272
|
+
import { IconClipboardCheck } from '@tabler/icons-react'
|
|
273
|
+
import { ReviewSidebar } from './sidebar'
|
|
274
|
+
|
|
275
|
+
export const reviewManifest: SystemModule = {
|
|
276
|
+
key: 'operations.review',
|
|
277
|
+
systemId: 'operations.review',
|
|
278
|
+
icon: IconClipboardCheck,
|
|
279
|
+
sidebar: ReviewSidebar
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
import { createFileRoute, Outlet } from '@tanstack/react-router'
|
|
285
|
+
import { ProtectedRoute, SystemGuard } from '@elevasis/ui/features/auth'
|
|
286
|
+
|
|
287
|
+
export const Route = createFileRoute('/operations/review')({
|
|
288
|
+
component: ReviewLayout
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
function ReviewLayout() {
|
|
292
|
+
return (
|
|
293
|
+
<ProtectedRoute>
|
|
294
|
+
<SystemGuard systemKey="operations.review">
|
|
295
|
+
<Outlet />
|
|
296
|
+
</SystemGuard>
|
|
297
|
+
</ProtectedRoute>
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## 8. Test Alignment
|
|
303
|
+
|
|
304
|
+
Add tests for the boundaries you changed:
|
|
305
|
+
|
|
306
|
+
- OM config tests for systems, ontology object/action/catalog records, resources, and any compatibility `System.content`.
|
|
307
|
+
- Runtime registry tests that deployed workflows import descriptors and keep `resourceId`, `type`, and `actionKey` aligned.
|
|
308
|
+
- UI tests or type checks for route, manifest, and guard wiring.
|
|
309
|
+
- Graph or knowledge tests when new ontology records, resources, compatibility content nodes, or emitted events should appear in Command View.
|
|
310
|
+
- Scaffold sync when new docs or generated scaffold references are affected.
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
pnpm -C core test
|
|
314
|
+
pnpm -C operations check-types
|
|
117
315
|
pnpm -C ui check-types
|
|
118
|
-
pnpm
|
|
119
|
-
pnpm
|
|
316
|
+
pnpm knowledge:generate
|
|
317
|
+
pnpm scaffold:sync
|
|
318
|
+
pnpm scaffold:verify
|
|
319
|
+
pnpm verify:scaffold-reference
|
|
120
320
|
```
|
|
321
|
+
|
|
322
|
+
## Finish Checklist
|
|
323
|
+
|
|
324
|
+
- The System exists once in the OM.
|
|
325
|
+
- Ontology object types represent durable business nouns, not transient data shapes.
|
|
326
|
+
- Ontology action types represent stable business verbs.
|
|
327
|
+
- Ontology catalog types contain local vocabularies such as pipelines, stages, templates, and status flows.
|
|
328
|
+
- Compatibility `System.content` is used only for existing bridge-era local catalogs or schemas.
|
|
329
|
+
- Each executable workflow or agent has an OM Resource descriptor with `systemPath`.
|
|
330
|
+
- `actionKey` is present only when the Resource implements a stable action contract.
|
|
331
|
+
- `codeRefs` point to useful entrypoints, handlers, schemas, tests, docs, or config.
|
|
332
|
+
- Runtime assembly imports descriptors and derives identity from them.
|
|
333
|
+
- UI routes, manifests, and guards use the same System ID.
|
|
334
|
+
- Tests prove OM, runtime, and UI stay aligned.
|
|
335
|
+
|
|
336
|
+
## Related References
|
|
337
|
+
|
|
338
|
+
- [Add a Resource](add-a-resource.md)
|
|
339
|
+
- [Customize organization-model.ts](customize-organization-model.md)
|
|
340
|
+
- [Gate by System or Admin](gate-by-feature-or-admin.md)
|
|
341
|
+
- [Organization Model](../core/organization-model.mdx)
|
|
342
|
+
- [System Shell and Provider](../ui/feature-shell.mdx)
|