@elevasis/sdk 1.21.0 → 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.
Files changed (160) hide show
  1. package/dist/cli.cjs +951 -171
  2. package/dist/index.d.ts +632 -341
  3. package/dist/index.js +3102 -142
  4. package/dist/node/index.d.ts +1 -0
  5. package/dist/node/index.js +19 -1
  6. package/dist/test-utils/index.d.ts +313 -4
  7. package/dist/test-utils/index.js +3246 -281
  8. package/dist/worker/index.js +3041 -80
  9. package/package.json +3 -3
  10. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  11. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  12. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  13. package/reference/claude-config/registries/graph-skills.json +4 -4
  14. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  15. package/reference/claude-config/rules/active-change-index.md +80 -80
  16. package/reference/claude-config/rules/agent-start-here.md +277 -277
  17. package/reference/claude-config/rules/deployment.md +57 -57
  18. package/reference/claude-config/rules/error-handling.md +56 -56
  19. package/reference/claude-config/rules/execution.md +40 -40
  20. package/reference/claude-config/rules/frontend.md +4 -4
  21. package/reference/claude-config/rules/observability.md +31 -31
  22. package/reference/claude-config/rules/operations.md +29 -17
  23. package/reference/claude-config/rules/organization-model.md +110 -84
  24. package/reference/claude-config/rules/organization-os.md +115 -113
  25. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  26. package/reference/claude-config/rules/platform.md +42 -42
  27. package/reference/claude-config/rules/shared-types.md +49 -46
  28. package/reference/claude-config/rules/task-tracking.md +47 -47
  29. package/reference/claude-config/rules/ui.md +200 -200
  30. package/reference/claude-config/rules/vibe.md +235 -235
  31. package/reference/claude-config/scripts/statusline-command.js +18 -18
  32. package/reference/claude-config/settings.json +34 -34
  33. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  34. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  35. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  36. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  37. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  38. package/reference/claude-config/skills/knowledge/SKILL.md +314 -299
  39. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  40. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -159
  41. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  42. package/reference/claude-config/skills/knowledge/operations/features.md +76 -76
  43. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  44. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  45. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -94
  46. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  47. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  48. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  49. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  50. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  51. package/reference/claude-config/skills/save/SKILL.md +3 -3
  52. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  53. package/reference/claude-config/skills/status/SKILL.md +59 -59
  54. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  55. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  56. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  57. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  58. package/reference/claude-config/skills/tutorial/technical.md +1303 -1303
  59. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  60. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  61. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  62. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  63. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  64. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  65. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  66. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  67. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  68. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  69. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  70. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  71. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  72. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  73. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  74. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  75. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  76. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  77. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  78. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  79. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  80. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  81. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -30
  82. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  83. package/reference/claude-config/sync-notes/README.md +43 -43
  84. package/reference/cli.mdx +808 -808
  85. package/reference/concepts.mdx +146 -146
  86. package/reference/deployment/api.mdx +297 -297
  87. package/reference/deployment/command-center.mdx +209 -209
  88. package/reference/deployment/index.mdx +195 -195
  89. package/reference/deployment/provided-features.mdx +107 -107
  90. package/reference/deployment/ui-execution.mdx +250 -250
  91. package/reference/examples/organization-model.ts +146 -83
  92. package/reference/framework/agent.mdx +156 -156
  93. package/reference/framework/index.mdx +195 -195
  94. package/reference/framework/interaction-guidance.mdx +182 -182
  95. package/reference/framework/memory.mdx +326 -326
  96. package/reference/framework/project-structure.mdx +282 -282
  97. package/reference/framework/tutorial-system.mdx +135 -135
  98. package/reference/getting-started.mdx +142 -142
  99. package/reference/index.mdx +106 -106
  100. package/reference/packages/core/src/README.md +14 -14
  101. package/reference/packages/core/src/business/README.md +2 -2
  102. package/reference/packages/core/src/knowledge/README.md +32 -32
  103. package/reference/packages/core/src/organization-model/README.md +149 -149
  104. package/reference/packages/core/src/test-utils/README.md +37 -37
  105. package/reference/packages/ui/src/api/README.md +18 -18
  106. package/reference/packages/ui/src/app/README.md +24 -24
  107. package/reference/packages/ui/src/auth/README.md +18 -18
  108. package/reference/packages/ui/src/components/README.md +24 -24
  109. package/reference/packages/ui/src/execution/README.md +16 -16
  110. package/reference/packages/ui/src/features/README.md +28 -28
  111. package/reference/packages/ui/src/graph/README.md +16 -16
  112. package/reference/packages/ui/src/hooks/README.md +23 -23
  113. package/reference/packages/ui/src/initialization/README.md +19 -19
  114. package/reference/packages/ui/src/knowledge/README.md +31 -31
  115. package/reference/packages/ui/src/organization/README.md +18 -18
  116. package/reference/packages/ui/src/profile/README.md +19 -19
  117. package/reference/packages/ui/src/provider/README.md +32 -32
  118. package/reference/packages/ui/src/router/README.md +18 -18
  119. package/reference/packages/ui/src/sse/README.md +13 -13
  120. package/reference/packages/ui/src/test-utils/README.md +7 -7
  121. package/reference/packages/ui/src/theme/README.md +23 -23
  122. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  123. package/reference/packages/ui/src/types/README.md +16 -16
  124. package/reference/packages/ui/src/utils/README.md +18 -18
  125. package/reference/packages/ui/src/zustand/README.md +18 -18
  126. package/reference/platform-tools/adapters-integration.mdx +301 -301
  127. package/reference/platform-tools/adapters-platform.mdx +553 -553
  128. package/reference/platform-tools/index.mdx +217 -217
  129. package/reference/platform-tools/type-safety.mdx +82 -82
  130. package/reference/resources/index.mdx +349 -349
  131. package/reference/resources/patterns.mdx +449 -449
  132. package/reference/resources/types.mdx +116 -116
  133. package/reference/roadmap.mdx +165 -165
  134. package/reference/runtime.mdx +173 -173
  135. package/reference/scaffold/core/organization-graph.mdx +110 -90
  136. package/reference/scaffold/core/organization-model.mdx +226 -219
  137. package/reference/scaffold/index.mdx +67 -67
  138. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  139. package/reference/scaffold/operations/scaffold-maintenance.md +12 -12
  140. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  141. package/reference/scaffold/recipes/add-a-feature.md +308 -88
  142. package/reference/scaffold/recipes/add-a-resource.md +134 -110
  143. package/reference/scaffold/recipes/customize-knowledge-browser.md +5 -5
  144. package/reference/scaffold/recipes/customize-organization-model.md +273 -138
  145. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  146. package/reference/scaffold/recipes/extend-crm.md +3 -3
  147. package/reference/scaffold/recipes/extend-lead-gen.md +400 -400
  148. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -118
  149. package/reference/scaffold/recipes/index.md +46 -46
  150. package/reference/scaffold/recipes/query-the-knowledge-graph.md +197 -170
  151. package/reference/scaffold/reference/contracts.md +2101 -2096
  152. package/reference/scaffold/reference/glossary.md +76 -76
  153. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  154. package/reference/scaffold/ui/customization.md +243 -243
  155. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  156. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  157. package/reference/scaffold/ui/recipes.md +221 -214
  158. package/reference/spine/spine-primer.md +96 -96
  159. package/reference/templates/index.mdx +47 -47
  160. package/reference/troubleshooting.mdx +223 -223
@@ -1,122 +1,342 @@
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
+ ---
1
5
  <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
2
6
  <!-- Regenerate: pnpm scaffold:sync -->
3
7
 
4
- ---
5
- title: Add a System
6
- description: Add a shell system using the Organization Model system list, manifest registration, routes, and guards.
7
- ---
8
-
9
- # Add a System
10
-
11
- Shell navigation is derived from `OrganizationModel.systems`. System manifests attach implementation details to those system IDs; they do not declare sidebar nav structure.
12
-
13
- ## 1. Add the system node
14
-
15
- Edit `core/config/organization-model.ts` and add a system to the id-keyed `systems` override.
16
-
17
- ```ts
18
- const organizationOverride = defineOrganizationModel({
19
- systems: {
20
- analytics: {
21
- id: 'analytics',
22
- order: 10,
23
- label: 'Analytics',
24
- enabled: true,
25
- path: '/analytics',
26
- icon: 'custom.analytics',
27
- uiPosition: 'sidebar-primary'
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
+ }
28
48
  }
29
49
  }
30
50
  })
31
51
  ```
32
52
 
33
- Use dotted IDs for hierarchy:
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.
34
58
 
35
59
  ```ts
36
- analytics: { id: 'analytics', order: 10, label: 'Analytics', enabled: true, uiPosition: 'sidebar-primary' },
37
- 'analytics.reports': { id: 'analytics.reports', order: 20, label: 'Reports', enabled: true, path: '/analytics/reports' }
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
+ }
38
87
  ```
39
88
 
40
- Containers omit `path`; leaves provide `path`.
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`.
41
90
 
42
- ## 2. Add the manifest
91
+ ## 3. Add Ontology Action Types for Stable Business Verbs
43
92
 
44
- Create `ui/src/features/analytics/manifest.ts`.
93
+ Add ontology action types for verbs that operators, policies, Command View, or agents should reason about.
45
94
 
46
95
  ```ts
47
- import type { SystemModule } from '@elevasis/ui/provider'
48
- import { IconChartBar } from '@tabler/icons-react'
49
- import { AnalyticsSidebar } from './sidebar'
50
-
51
- export const analyticsManifest: SystemModule = {
52
- key: 'analytics',
53
- systemId: 'analytics',
54
- icon: IconChartBar,
55
- sidebar: AnalyticsSidebar
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
+ }
56
123
  }
57
124
  ```
58
125
 
59
- Register it in the `SYSTEM_MANIFESTS` array in `ui/src/routes/__root.tsx`.
60
-
61
- ## 3. Add routes
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`.
62
127
 
63
- Create TanStack routes whose paths match the system nodes.
128
+ ## 4. Add Ontology Catalog Types for Local Catalogs
64
129
 
65
- ```tsx
66
- import { createFileRoute, Outlet } from '@tanstack/react-router'
67
- import { ProtectedRoute, SystemGuard } from '@elevasis/ui/features/auth'
68
-
69
- export const Route = createFileRoute('/analytics')({
70
- component: AnalyticsLayout
71
- })
130
+ Use `System.ontology.catalogTypes` for pipelines, stages, templates, template steps, status flows, status entries, and small config vocabularies owned by the system.
72
131
 
73
- function AnalyticsLayout() {
74
- return (
75
- <ProtectedRoute>
76
- <SystemGuard systemKey="analytics">
77
- <Outlet />
78
- </SystemGuard>
79
- </ProtectedRoute>
80
- )
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
+ }
81
164
  }
82
165
  ```
83
166
 
84
- ## 4. Add backing resources
85
-
86
- For workflows or agents that power the system, author an OM Resource descriptor first, then derive runtime metadata from it:
87
-
88
- ```ts
89
- // core/config/organization-model.ts
90
- import { defineResources } from '@elevasis/core/organization-model'
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`.
91
168
 
92
- export const resourceDescriptors = defineResources({
93
- analyticsRefresh: {
94
- id: 'analytics-refresh',
95
- order: 10,
96
- kind: 'workflow',
97
- systemId: 'analytics',
98
- ownerRoleId: 'role-ops-lead',
99
- status: 'active'
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
+ }
100
204
  }
101
205
  })
102
-
103
- // operations/src/analytics-refresh/index.ts
104
- config: {
105
- resource: resourceDescriptors.analyticsRefresh,
106
- resourceId: resourceDescriptors.analyticsRefresh.id,
107
- name: 'Analytics Refresh',
108
- type: resourceDescriptors.analyticsRefresh.kind,
109
- version: '1.0.0',
110
- status: 'prod',
111
- category: 'production'
112
- }
113
206
  ```
114
207
 
115
- ## 5. Verify
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.
116
209
 
117
- ```bash
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
118
315
  pnpm -C ui check-types
119
- pnpm -C ui test
120
- pnpm -C operations check
316
+ pnpm knowledge:generate
317
+ pnpm scaffold:sync
318
+ pnpm scaffold:verify
319
+ pnpm verify:scaffold-reference
121
320
  ```
122
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)