@elevasis/sdk 1.44.3 → 1.45.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 (246) hide show
  1. package/dist/cli.cjs +991 -650
  2. package/dist/index.d.ts +1045 -509
  3. package/dist/index.js +738 -688
  4. package/dist/node/index.d.ts +105 -97
  5. package/dist/test-utils/index.d.ts +42 -28
  6. package/dist/test-utils/index.js +514 -783
  7. package/dist/worker/index.d.ts +12112 -0
  8. package/dist/worker/index.js +121 -182
  9. package/package.json +6 -9
  10. package/reference/_navigation.md +151 -21
  11. package/reference/_reference-manifest.json +186 -4
  12. package/reference/claude-config.md +8 -0
  13. package/reference/core/index.mdx +3 -3
  14. package/reference/examples/organization-model.ts +117 -111
  15. package/reference/index.mdx +4 -4
  16. package/reference/rules/active-change-index.md +40 -54
  17. package/reference/rules/agent-runtime.md +81 -0
  18. package/reference/rules/agent-start-here.md +71 -163
  19. package/reference/rules/deployment.md +33 -10
  20. package/reference/rules/error-handling.md +26 -0
  21. package/reference/rules/execution.md +13 -0
  22. package/reference/rules/frontend.md +10 -3
  23. package/reference/rules/observability.md +9 -1
  24. package/reference/rules/operations.md +26 -17
  25. package/reference/rules/organization-model.md +74 -88
  26. package/reference/rules/organization-os.md +71 -88
  27. package/reference/rules/package-taxonomy.md +11 -2
  28. package/reference/rules/platform.md +13 -7
  29. package/reference/rules/shared-types.md +15 -0
  30. package/reference/rules/task-tracking.md +30 -5
  31. package/reference/rules/ui.md +145 -3
  32. package/reference/rules/vibe-intents.md +271 -0
  33. package/reference/rules/vibe.md +17 -243
  34. package/reference/scaffold/core/organization-graph.mdx +111 -97
  35. package/reference/scaffold/core/organization-model.mdx +234 -214
  36. package/reference/scaffold/operations/propagation-pipeline.md +1 -1
  37. package/reference/scaffold/operations/scaffold-maintenance.md +19 -18
  38. package/reference/scaffold/operations/workflow-recipes.md +71 -19
  39. package/reference/scaffold/recipes/add-a-feature.md +156 -146
  40. package/reference/scaffold/recipes/add-a-resource.md +123 -117
  41. package/reference/scaffold/recipes/customize-crm-actions.md +25 -10
  42. package/reference/scaffold/recipes/customize-knowledge-browser.md +52 -117
  43. package/reference/scaffold/recipes/customize-organization-model.md +161 -149
  44. package/reference/scaffold/recipes/extend-a-base-entity.md +156 -140
  45. package/reference/scaffold/recipes/extend-crm.md +16 -11
  46. package/reference/scaffold/recipes/extend-lead-gen.md +25 -7
  47. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +160 -118
  48. package/reference/scaffold/recipes/index.md +2 -2
  49. package/reference/scaffold/recipes/query-the-knowledge-graph.md +23 -23
  50. package/reference/scaffold/reference/contracts.md +12 -1
  51. package/reference/scaffold/reference/glossary.md +3 -3
  52. package/reference/scaffold/reference/system-interface-capabilities.md +5 -4
  53. package/reference/scaffold/ui/composition-extensibility.mdx +271 -232
  54. package/reference/scaffold/ui/feature-flags-and-gating.md +14 -6
  55. package/reference/scaffold/ui/feature-shell.mdx +279 -62
  56. package/reference/scaffold/ui/recipes.md +229 -197
  57. package/reference/sdk/cli-management.mdx +77 -29
  58. package/reference/sdk/concepts.mdx +2 -0
  59. package/reference/sdk/define-builders.mdx +76 -0
  60. package/reference/sdk/deployment/command-center.mdx +6 -2
  61. package/reference/sdk/deployment/execution-reference.mdx +64 -186
  62. package/reference/sdk/deployment/index.mdx +2 -0
  63. package/reference/sdk/exports.mdx +4 -4
  64. package/reference/sdk/framework/agent.mdx +49 -119
  65. package/reference/sdk/framework/index.mdx +46 -65
  66. package/reference/sdk/framework/project-structure.mdx +150 -205
  67. package/reference/sdk/framework/tutorial-system.mdx +2 -2
  68. package/reference/sdk/human-in-the-loop.mdx +152 -0
  69. package/reference/sdk/index.mdx +6 -7
  70. package/reference/sdk/platform-tools/index.mdx +12 -0
  71. package/reference/sdk/platform-tools/type-safety.mdx +4 -0
  72. package/reference/sdk/project-deployment-spec.mdx +131 -0
  73. package/reference/sdk/resources/index.mdx +21 -7
  74. package/reference/sdk/resources/patterns.mdx +54 -24
  75. package/reference/sdk/resources/types.mdx +7 -4
  76. package/reference/sdk/templates/data-enrichment.mdx +7 -3
  77. package/reference/sdk/templates/email-sender.mdx +139 -135
  78. package/reference/sdk/templates/lead-scorer.mdx +5 -1
  79. package/reference/sdk/templates/pdf-generator.mdx +155 -151
  80. package/reference/sdk/templates/recurring-job.mdx +195 -189
  81. package/reference/sdk/templates/text-classifier.mdx +4 -0
  82. package/reference/sdk/templates/web-scraper.mdx +139 -135
  83. package/reference/spine/spine-primer.md +135 -96
  84. package/reference/ui/index.mdx +14 -7
  85. package/dist/types/worker/adapters/anymailfinder.d.ts +0 -14
  86. package/dist/types/worker/adapters/apify.d.ts +0 -14
  87. package/dist/types/worker/adapters/approval.d.ts +0 -23
  88. package/dist/types/worker/adapters/attio.d.ts +0 -22
  89. package/dist/types/worker/adapters/clickup.d.ts +0 -22
  90. package/dist/types/worker/adapters/create-adapter.d.ts +0 -41
  91. package/dist/types/worker/adapters/crm.d.ts +0 -20
  92. package/dist/types/worker/adapters/dropbox.d.ts +0 -14
  93. package/dist/types/worker/adapters/email.d.ts +0 -25
  94. package/dist/types/worker/adapters/execution.d.ts +0 -22
  95. package/dist/types/worker/adapters/gmail.d.ts +0 -14
  96. package/dist/types/worker/adapters/google-sheets.d.ts +0 -14
  97. package/dist/types/worker/adapters/index.d.ts +0 -33
  98. package/dist/types/worker/adapters/instantly.d.ts +0 -14
  99. package/dist/types/worker/adapters/lead.d.ts +0 -28
  100. package/dist/types/worker/adapters/list.d.ts +0 -9
  101. package/dist/types/worker/adapters/llm.d.ts +0 -45
  102. package/dist/types/worker/adapters/millionverifier.d.ts +0 -14
  103. package/dist/types/worker/adapters/notification.d.ts +0 -28
  104. package/dist/types/worker/adapters/pdf.d.ts +0 -22
  105. package/dist/types/worker/adapters/projects.d.ts +0 -20
  106. package/dist/types/worker/adapters/resend.d.ts +0 -14
  107. package/dist/types/worker/adapters/scheduler.d.ts +0 -25
  108. package/dist/types/worker/adapters/signature-api.d.ts +0 -14
  109. package/dist/types/worker/adapters/storage.d.ts +0 -33
  110. package/dist/types/worker/adapters/stripe.d.ts +0 -14
  111. package/dist/types/worker/adapters/tomba.d.ts +0 -14
  112. package/dist/types/worker/index.d.ts +0 -60
  113. package/dist/types/worker/platform.d.ts +0 -90
  114. package/dist/types/worker/utils.d.ts +0 -9
  115. package/reference/claude-config/Overview.md +0 -230
  116. package/reference/claude-config/hooks/post-edit-validate.mjs +0 -98
  117. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +0 -187
  118. package/reference/claude-config/hooks/tool-failure-recovery.mjs +0 -73
  119. package/reference/claude-config/registries/graph-skills.json +0 -4
  120. package/reference/claude-config/registries/knowledge-flags.json +0 -154
  121. package/reference/claude-config/registries/skill-coverage.json +0 -20
  122. package/reference/claude-config/rules/active-change-index.md +0 -22
  123. package/reference/claude-config/rules/agent-start-here.md +0 -22
  124. package/reference/claude-config/rules/deployment.md +0 -22
  125. package/reference/claude-config/rules/error-handling.md +0 -22
  126. package/reference/claude-config/rules/execution.md +0 -22
  127. package/reference/claude-config/rules/frontend.md +0 -22
  128. package/reference/claude-config/rules/observability.md +0 -22
  129. package/reference/claude-config/rules/operations.md +0 -22
  130. package/reference/claude-config/rules/organization-model.md +0 -22
  131. package/reference/claude-config/rules/organization-os.md +0 -22
  132. package/reference/claude-config/rules/package-taxonomy.md +0 -22
  133. package/reference/claude-config/rules/platform.md +0 -22
  134. package/reference/claude-config/rules/shared-types.md +0 -22
  135. package/reference/claude-config/rules/task-tracking.md +0 -22
  136. package/reference/claude-config/rules/topbar-actions.md +0 -70
  137. package/reference/claude-config/rules/ui.md +0 -22
  138. package/reference/claude-config/rules/vibe.md +0 -22
  139. package/reference/claude-config/scripts/statusline-command.js +0 -18
  140. package/reference/claude-config/settings.json +0 -30
  141. package/reference/claude-config/skills/client/SKILL.md +0 -201
  142. package/reference/claude-config/skills/deploy/SKILL.md +0 -159
  143. package/reference/claude-config/skills/dsp/SKILL.md +0 -66
  144. package/reference/claude-config/skills/elevasis/SKILL.md +0 -251
  145. package/reference/claude-config/skills/explore/SKILL.md +0 -78
  146. package/reference/claude-config/skills/git-sync/SKILL.md +0 -166
  147. package/reference/claude-config/skills/om/SKILL.md +0 -475
  148. package/reference/claude-config/skills/om/operations/build.md +0 -237
  149. package/reference/claude-config/skills/om/operations/codify-level-a.md +0 -109
  150. package/reference/claude-config/skills/om/operations/codify-level-b.md +0 -159
  151. package/reference/claude-config/skills/om/operations/customers.md +0 -114
  152. package/reference/claude-config/skills/om/operations/features.md +0 -88
  153. package/reference/claude-config/skills/om/operations/goals.md +0 -123
  154. package/reference/claude-config/skills/om/operations/identity.md +0 -97
  155. package/reference/claude-config/skills/om/operations/labels.md +0 -110
  156. package/reference/claude-config/skills/om/operations/offerings.md +0 -114
  157. package/reference/claude-config/skills/om/operations/roles.md +0 -104
  158. package/reference/claude-config/skills/om/operations/scaffold.md +0 -163
  159. package/reference/claude-config/skills/om/operations/techStack.md +0 -38
  160. package/reference/claude-config/skills/project/SKILL.md +0 -1114
  161. package/reference/claude-config/skills/run-ui/SKILL.md +0 -73
  162. package/reference/claude-config/skills/save/SKILL.md +0 -183
  163. package/reference/claude-config/skills/setup/SKILL.md +0 -290
  164. package/reference/claude-config/skills/status/SKILL.md +0 -59
  165. package/reference/claude-config/skills/submit-request/SKILL.md +0 -180
  166. package/reference/claude-config/skills/sync/SKILL.md +0 -47
  167. package/reference/claude-config/skills/tutorial/SKILL.md +0 -259
  168. package/reference/claude-config/skills/tutorial/progress-template.md +0 -74
  169. package/reference/claude-config/skills/tutorial/technical.md +0 -1303
  170. package/reference/claude-config/skills/tutorial/vibe-coder.md +0 -890
  171. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +0 -27
  172. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +0 -30
  173. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +0 -73
  174. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +0 -86
  175. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +0 -55
  176. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +0 -97
  177. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +0 -112
  178. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +0 -93
  179. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +0 -58
  180. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +0 -56
  181. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +0 -71
  182. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +0 -83
  183. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +0 -59
  184. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +0 -42
  185. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +0 -60
  186. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +0 -37
  187. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +0 -34
  188. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +0 -38
  189. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +0 -32
  190. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +0 -33
  191. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +0 -69
  192. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +0 -30
  193. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +0 -45
  194. package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +0 -52
  195. package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +0 -33
  196. package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +0 -32
  197. package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +0 -43
  198. package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +0 -40
  199. package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +0 -61
  200. package/reference/claude-config/sync-notes/2026-05-23-branding-names-to-identity.md +0 -49
  201. package/reference/claude-config/sync-notes/2026-05-23-lead-gen-manage-access.md +0 -31
  202. package/reference/claude-config/sync-notes/2026-05-23-om-deployment-drift-detection.md +0 -42
  203. package/reference/claude-config/sync-notes/2026-05-23-om-full-model-deploy-contract.md +0 -33
  204. package/reference/claude-config/sync-notes/2026-05-23-ui-sdk-package-fixes.md +0 -37
  205. package/reference/claude-config/sync-notes/2026-05-24-platform-invite-router-core-baseline.md +0 -28
  206. package/reference/claude-config/sync-notes/2026-05-24-system-interface-readiness.md +0 -43
  207. package/reference/claude-config/sync-notes/2026-05-25-invitation-login-loader.md +0 -26
  208. package/reference/claude-config/sync-notes/2026-05-25-om-topbar-requests.md +0 -33
  209. package/reference/claude-config/sync-notes/2026-05-25-system-interface-profile-registry-and-substrate.md +0 -35
  210. package/reference/claude-config/sync-notes/2026-05-25-tenant-om-scaffold-cli.md +0 -49
  211. package/reference/claude-config/sync-notes/2026-05-25-vibe-operate-intent.md +0 -47
  212. package/reference/claude-config/sync-notes/2026-05-28-om-snapshot-sdk-workflow-config.md +0 -33
  213. package/reference/claude-config/sync-notes/2026-05-30-client-source-and-om-profiles.md +0 -39
  214. package/reference/claude-config/sync-notes/2026-06-02-knowledge-nested-group-routing.md +0 -27
  215. package/reference/claude-config/sync-notes/2026-06-02-nest-projects-under-platform.md +0 -45
  216. package/reference/claude-config/sync-notes/2026-06-03-skill-autogen-and-client-skill.md +0 -34
  217. package/reference/claude-config/sync-notes/2026-06-04-scaffold-registry-lane-severity.md +0 -34
  218. package/reference/claude-config/sync-notes/2026-06-05-appearance-app-mode-decouple.md +0 -29
  219. package/reference/claude-config/sync-notes/2026-06-05-ontology-endpoint-rename-and-knowledge-browser-ui.md +0 -86
  220. package/reference/claude-config/sync-notes/2026-06-06-om-build-systems-scaffold.md +0 -47
  221. package/reference/claude-config/sync-notes/2026-06-06-om-item-copy-references.md +0 -50
  222. package/reference/claude-config/sync-notes/2026-06-08-knowledge-base-page-not-found-fix.md +0 -76
  223. package/reference/claude-config/sync-notes/2026-06-09-agent-sessions-public-agent-chat-route.md +0 -75
  224. package/reference/claude-config/sync-notes/2026-06-09-sdk-cli-load-org-model-resolution.md +0 -42
  225. package/reference/claude-config/sync-notes/2026-06-12-agent-grants-visualizer-operations.md +0 -30
  226. package/reference/claude-config/sync-notes/2026-06-14-session-ux-and-project-cli-json.md +0 -33
  227. package/reference/claude-config/sync-notes/2026-06-14-shared-session-conversation-view.md +0 -26
  228. package/reference/claude-config/sync-notes/2026-06-15-session-chat-zero-wiring.md +0 -46
  229. package/reference/claude-config/sync-notes/2026-06-17-agent-session-ux-features.md +0 -34
  230. package/reference/claude-config/sync-notes/2026-06-25-shared-page-scroll-contract-guard.md +0 -52
  231. package/reference/claude-config/sync-notes/2026-06-26-leadgen-overview-om-telemetry.md +0 -47
  232. package/reference/claude-config/sync-notes/2026-07-21-agent-scaffold-hardening.md +0 -75
  233. package/reference/claude-config/sync-notes/2026-07-23-agent-session-memory.md +0 -49
  234. package/reference/claude-config/sync-notes/2026-07-23-workos-org-marker.md +0 -50
  235. package/reference/claude-config/sync-notes/2026-07-24-claude-5-models-and-session-surface-fixes.md +0 -116
  236. package/reference/claude-config/sync-notes/2026-07-27-agent-strict-output-and-turn-drift.md +0 -73
  237. package/reference/claude-config/sync-notes/2026-07-28-agent-reply-is-its-own-field.md +0 -84
  238. package/reference/claude-config/sync-notes/2026-07-30-login-screen-and-member-provisioning-state.md +0 -114
  239. package/reference/claude-config/sync-notes/2026-08-02-auth-guard-defaults-and-truncation-fix.md +0 -122
  240. package/reference/claude-config/sync-notes/2026-08-03-agent-prose-escape-normalization.md +0 -88
  241. package/reference/claude-config/sync-notes/2026-08-03-cli-gateway-errors-and-request-timeout.md +0 -120
  242. package/reference/claude-config/sync-notes/README.md +0 -43
  243. package/reference/sdk/framework/interaction-guidance.mdx +0 -182
  244. package/reference/sdk/framework/memory.mdx +0 -326
  245. package/reference/sdk/framework/resource-documentation.mdx +0 -90
  246. package/reference/sdk/roadmap.mdx +0 -164
@@ -1,146 +1,162 @@
1
- ---
2
- title: Organization Model
3
- description: Organization OS Model layer documentation for the System hierarchy, semantic domains, resource descriptors, and curated @elevasis/core public API.
4
- ---
1
+ ---
2
+ title: Organization Model
3
+ description: Organization OS Model layer documentation for the System hierarchy, semantic domains, resource descriptors, and curated @elevasis/core public API.
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
- ## Overview
10
-
11
- The organization model is the semantic contract that maps an organization's System hierarchy, business semantics, shell navigation, resource governance, action/entity vocabulary, and graph binding. It is schema-first, versioned, and validated.
12
-
13
- The model is authored in `@repo/core` and published through the curated `@elevasis/core/organization-model` surface.
14
-
15
- ## Source of Truth
16
-
17
- - `packages/core/src/organization-model/schema.ts`
18
- - `packages/core/src/organization-model/types.ts`
19
- - `packages/core/src/organization-model/defaults.ts`
20
- - `packages/core/src/organization-model/helpers.ts`
21
- - `packages/core/src/organization-model/graph/link.ts`
22
- - `packages/core/src/organization-model/published.ts`
23
- - `packages/core/src/__tests__/template-core-compatibility.test.ts`
24
-
25
- ## Contract Shape
26
-
27
- Top-level fields on `OrganizationModel`:
28
-
29
- - `version`
30
- - `domainMetadata`
31
- - `branding`
32
- - `navigation`
33
- - `identity`
34
- - `customers`
35
- - `offerings`
36
- - `roles`
37
- - `goals`
38
- - `systems`
39
- - `resources`
40
- - `actions`
41
- - `entities`
42
- - `policies`
43
- - `knowledge`
44
-
45
- The pure collection domains are id-keyed maps: `systems`, `roles`, `goals`, `customers`, `offerings`, `resources`, `actions`, `entities`, `policies`, and `knowledge`. The map key must match the entry `id`. Entries carry `order` for deterministic ordered views; use `listDomain(record)` when order matters.
46
-
47
- Resource identity is authored inside `OrganizationModel.resources`. Runtime workflows, agents, integrations, and scripts import those descriptors, derive `resourceId` and kind from them, and attach executable behavior in operations code.
48
-
49
- ## System Shape
50
-
51
- `OrganizationModel.systems` is the canonical semantic domain map. Hierarchy is authored with recursive `subsystems`; dotted paths such as `sales.crm` are derived from position in that tree. `parentSystemId` and `id` remain accepted compatibility fields during the migration.
52
-
53
- ```ts
54
- systems: {
55
- dashboard: { id: 'dashboard', order: 10, label: 'Dashboard', lifecycle: 'active' },
56
- sales: { id: 'sales', order: 20, label: 'Sales', lifecycle: 'active' },
57
- clients: { id: 'clients', order: 30, label: 'Clients', lifecycle: 'active' },
58
- projects: { id: 'projects', order: 40, label: 'Projects', lifecycle: 'active' }
59
- }
60
- ```
61
-
62
- Authored fields:
63
-
64
- - `id`
65
- - `label`
66
- - `description`
67
- - `kind`
68
- - `parentSystemId`
69
- - `ui`
70
- - `lifecycle`
71
- - `requiresAdmin`
72
- - `actions`
73
- - `policies`
74
- - `content`
75
- - `subsystems`
76
- - `order`
77
-
78
- Systems describe ownership, hierarchy, lifecycle, access, and governance. Sidebar presentation lives in `navigation.sidebar`, not on System entries. UI-backed Systems may still provide `ui.path` for route matching during the migration, but `ui.surfaces` is not an authored contract. `lifecycle` replaces the old feature enabled/dev-only split.
79
-
80
- ## Navigation Shape
81
-
82
- `OrganizationModel.navigation.sidebar` is the authored shell tree. It has `primary` and `bottom` sections whose records contain recursive group nodes and routeable surface nodes:
83
-
84
- ```ts
85
- navigation: {
86
- sidebar: {
87
- primary: {
88
- dashboard: {
89
- type: 'surface',
90
- order: 10,
91
- label: 'Dashboard',
92
- path: '/',
93
- surfaceType: 'dashboard',
94
- targets: { systems: ['dashboard'] }
95
- },
96
- business: {
97
- type: 'group',
98
- order: 20,
99
- label: 'Business',
100
- children: {
101
- sales: {
102
- type: 'surface',
103
- order: 10,
104
- label: 'Sales',
105
- path: '/sales',
106
- surfaceType: 'page',
107
- targets: { systems: ['sales'] }
108
- },
109
- clients: {
110
- type: 'surface',
111
- order: 20,
112
- label: 'Clients',
113
- path: '/clients',
114
- surfaceType: 'list',
115
- targets: { systems: ['clients'] }
116
- }
117
- }
118
- }
119
- },
120
- bottom: {}
121
- }
122
- }
123
- ```
124
-
125
- Dashboard is ordered before Business in the primary sidebar. Business is a navigation group only; it is not a System and it is not a URL namespace. Routeable leaves are projected into flat surface DTOs by `projectOrganizationSurfaces(model)`.
126
-
127
- ## Graph IDs and Resource Descriptors
128
-
129
- Cross-collection links use kind-prefixed graph IDs:
130
-
131
- - `system:sales.crm`
132
- - `integration:instantly`
133
- - `resource:lead-import`
134
- - `action:operations.queue.review`
135
-
136
- Resource identity is authored in the OM Resources domain. Operations imports descriptors from `organizationModel.resources` and derives runtime `resourceId` / `type` while attaching executable behavior.
137
-
138
- ```ts
139
- import { defineResources } from '@elevasis/core/organization-model'
140
-
8
+
9
+ ## Overview
10
+
11
+ The organization model is the semantic contract that maps an organization's System hierarchy, business semantics, shell navigation, resource governance, action/entity vocabulary, and graph binding. It is schema-first, versioned, and validated.
12
+
13
+ The model is authored in `@repo/core` and published through the curated `@elevasis/core/organization-model` surface.
14
+
15
+ ## Source of Truth
16
+
17
+ - `packages/core/src/organization-model/schema.ts`
18
+ - `packages/core/src/organization-model/types.ts`
19
+ - `packages/core/src/organization-model/defaults.ts`
20
+ - `packages/core/src/organization-model/helpers.ts`
21
+ - `packages/core/src/organization-model/graph/link.ts`
22
+ - `packages/core/src/organization-model/published.ts`
23
+ - `packages/core/src/__tests__/template-core-compatibility.test.ts`
24
+
25
+ ## Contract Shape
26
+
27
+ Top-level fields on `OrganizationModel`:
28
+
29
+ - `version`
30
+ - `snapshotHash`
31
+ - `domainMetadata`
32
+ - `branding`
33
+ - `navigation`
34
+ - `identity`
35
+ - `clients`
36
+ - `customers`
37
+ - `offerings`
38
+ - `roles`
39
+ - `goals`
40
+ - `systems`
41
+ - `ontology`
42
+ - `resources`
43
+ - `topology`
44
+ - `actions`
45
+ - `entities`
46
+ - `policies`
47
+ - `knowledge`
48
+
49
+ The pure collection domains are id-keyed maps: `systems`, `roles`, `goals`, `clients`, `customers`, `offerings`, `resources`, `actions`, `entities`, `policies`, and `knowledge`. `ontology` is an `OntologyScope` object (not an id-keyed map at the top level) and `topology` is a relationships record. The map key must match the entry `id` for id-keyed domains. Entries carry `order` for deterministic ordered views; use `listDomain(record)` when order matters. `sales`, `prospecting`, `projects`, and `statuses` were removed from the top-level contract; do not author against them.
50
+
51
+ Resource identity is authored inside `OrganizationModel.resources`. Runtime workflows, agents, integrations, and scripts import those descriptors, derive `resourceId` and kind from them, and attach executable behavior in operations code.
52
+
53
+ ## System Shape
54
+
55
+ `OrganizationModel.systems` is the canonical semantic domain map. Hierarchy is authored with recursive `systems`; dotted paths such as `sales.crm` are derived from position in that tree. `subsystems` is a deprecated compatibility alias — it is still accepted and kept in sync with `systems` during parse, but new authoring should use `systems`. `parentSystemId` and `id` remain accepted compatibility fields during the migration.
56
+
57
+ {/* doc-snippet:skip: illustrative excerpt, not a standalone compilable file */}
58
+
59
+ ```ts
60
+ systems: {
61
+ dashboard: { id: 'dashboard', order: 10, label: 'Dashboard', lifecycle: 'active' },
62
+ sales: { id: 'sales', order: 20, label: 'Sales', lifecycle: 'active' },
63
+ clients: { id: 'clients', order: 30, label: 'Clients', lifecycle: 'active' },
64
+ projects: { id: 'projects', order: 40, label: 'Projects', lifecycle: 'active' }
65
+ }
66
+ ```
67
+
68
+ Authored fields:
69
+
70
+ - `id`
71
+ - `label`
72
+ - `description`
73
+ - `kind`
74
+ - `parentSystemId`
75
+ - `ui`
76
+ - `lifecycle`
77
+ - `requiresAdmin`
78
+ - `responsibleRoleId`
79
+ - `governedByKnowledge`
80
+ - `actions`
81
+ - `policies`
82
+ - `drivesGoals`
83
+ - `apiInterface`
84
+ - `config`
85
+ - `ontology`
86
+ - `systems`
87
+ - `order`
88
+
89
+ Systems describe ownership, hierarchy, lifecycle, access, and governance. Sidebar presentation lives in `navigation.sidebar`, not on System entries. UI-backed Systems may still provide `ui.path` for route matching during the migration, but `ui.surfaces` is not an authored contract. `lifecycle` replaces the old feature enabled/dev-only split. `config` holds System-local JSON settings; `ontology` holds System-owned object, action, catalog, link, event, and other ontology records; `apiInterface` is the thin platform API-readiness marker (see `System Interface` in the glossary).
90
+
91
+ ## Navigation Shape
92
+
93
+ `OrganizationModel.navigation.sidebar` is the authored shell tree. It has `primary` and `bottom` sections whose records contain recursive group nodes and routeable surface nodes:
94
+
95
+ {/* doc-snippet:skip: illustrative excerpt, not a standalone compilable file */}
96
+
97
+ ```ts
98
+ navigation: {
99
+ sidebar: {
100
+ primary: {
101
+ dashboard: {
102
+ type: 'surface',
103
+ order: 10,
104
+ label: 'Dashboard',
105
+ path: '/',
106
+ surfaceType: 'dashboard',
107
+ targets: { systems: ['dashboard'] }
108
+ },
109
+ business: {
110
+ type: 'group',
111
+ order: 20,
112
+ label: 'Business',
113
+ children: {
114
+ sales: {
115
+ type: 'surface',
116
+ order: 10,
117
+ label: 'Sales',
118
+ path: '/sales',
119
+ surfaceType: 'page',
120
+ targets: { systems: ['sales'] }
121
+ },
122
+ clients: {
123
+ type: 'surface',
124
+ order: 20,
125
+ label: 'Clients',
126
+ path: '/clients',
127
+ surfaceType: 'list',
128
+ targets: { systems: ['clients'] }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ bottom: {}
134
+ }
135
+ }
136
+ ```
137
+
138
+ Dashboard is ordered before Business in the primary sidebar. Business is a navigation group only; it is not a System and it is not a URL namespace. Routeable leaves are projected into flat surface DTOs by `projectOrganizationSurfaces(model)`.
139
+
140
+ ## Graph IDs and Resource Descriptors
141
+
142
+ Cross-collection links use kind-prefixed graph IDs:
143
+
144
+ - `system:sales.crm`
145
+ - `integration:instantly`
146
+ - `resource:lead-import`
147
+ - `action:operations.queue.review`
148
+
149
+ Resource identity is authored in the OM Resources domain. Operations imports descriptors from `organizationModel.resources` and derives runtime `resourceId` / `type` while attaching executable behavior.
150
+
151
+ {/* doc-snippet:skip: `systems` in resourceGovernanceModel refers to the System map authored earlier in a tenant's own organization-model.ts, not a local declaration */}
152
+
153
+ ```ts
154
+ import { defineResources } from '@elevasis/core/organization-model'
155
+
141
156
  export const resourceDescriptors = defineResources({
142
157
  leadImport: {
143
158
  id: 'lgn-01c-apollo-import-workflow',
159
+ order: 10,
144
160
  title: 'Apollo Import',
145
161
  description: 'Imports Apollo company records into the lead generation pipeline.',
146
162
  kind: 'workflow',
@@ -154,81 +170,85 @@ export const resourceDescriptors = defineResources({
154
170
  codeRefs: [
155
171
  {
156
172
  path: 'packages/elevasis-operations/src/sales/prospecting/scrape/apollo-import.ts',
157
- role: 'entrypoint',
158
- symbol: 'lgnApolloImportWorkflow'
159
- }
160
- ]
161
- }
162
- })
163
-
164
- export const resourceGovernanceModel = {
165
- systems,
166
- resources: resourceDescriptors
167
- } as const
168
- ```
169
-
170
- Legacy `sys.*` paths may still appear in older examples and external compatibility mirrors.
171
- For new Organization OS examples, prefer the current semantic System path.
172
-
173
- ## Domain Semantics
174
-
175
- The model keeps business semantics in named domains:
176
-
177
- - `identity`, `customers`, `offerings`, `roles`, `goals` -- organizational reality
178
- - `systems` -- bounded contexts that group governed operational resources and system-local content
179
- - `actions` -- stable business verbs exposed or consumed by systems
180
- - `entities` -- durable business nouns and their semantic links
181
- - `resources` -- governance-only workflow, agent, integration, and script descriptors
182
- - `policies` -- operational governance rules over systems, actions, resources, and roles
183
- - `knowledge` -- playbooks, strategies, references, and graph-governing links
184
-
173
+ role: 'entrypoint',
174
+ symbol: 'lgnApolloImportWorkflow'
175
+ }
176
+ ]
177
+ }
178
+ })
179
+
180
+ export const resourceGovernanceModel = {
181
+ systems,
182
+ resources: resourceDescriptors
183
+ } as const
184
+ ```
185
+
186
+ Legacy `sys.*` paths may still appear in older examples and external compatibility mirrors.
187
+ For new Organization OS examples, prefer the current semantic System path.
188
+
189
+ ## Domain Semantics
190
+
191
+ The model keeps business semantics in named domains:
192
+
193
+ - `identity`, `customers`, `offerings`, `roles`, `goals` -- organizational reality
194
+ - `systems` -- bounded contexts that group governed operational resources and system-local content
195
+ - `actions` -- stable business verbs exposed or consumed by systems
196
+ - `entities` -- durable business nouns and their semantic links
197
+ - `resources` -- governance-only workflow, agent, integration, and script descriptors
198
+ - `policies` -- operational governance rules over systems, actions, resources, and roles
199
+ - `knowledge` -- playbooks, strategies, references, and graph-governing links
200
+
185
201
  System-local operational catalogs live under `System.ontology.catalogTypes`, including pipeline, stage, template, template-step, status-flow, and status records. System-local settings live in `System.config`. The legacy compound and status domains should not be used for new authoring.
186
-
187
- ## Authoring and Resolution
188
-
189
- - `defineOrganizationModel()` is a typed authoring helper.
190
- - `resolveOrganizationModel(partial)` deep-merges a partial override into `DEFAULT_ORGANIZATION_MODEL` and validates the result.
191
- - `createFoundationOrganizationModel(partial)` resolves the canonical model and returns template-facing helpers.
192
- - Plain objects merge recursively.
193
- - Id-keyed domain maps merge additively by key.
194
- - Arrays replace defaults.
195
-
196
- ## Referential Integrity
197
-
198
- `OrganizationModelSchema` validates:
199
-
200
- - unique System IDs
201
- - ancestor existence for dotted System IDs and `parentSystemId`
202
- - UI path rules for Systems with UI presence
203
- - valid sidebar positions
204
- - reality-domain cross references such as offering target segments and role reporting lines
205
- - system, resource, role, knowledge, and goal cross references used by resource governance
206
-
207
- `DeploymentSpec` remains the runtime/deploy assembly around these descriptors. It is not the source of resource identity.
208
-
209
- ## Provider Integration
210
-
211
- `ElevasisSystemsProvider` uses the organization model to:
212
-
213
- 1. validate each manifest's `systemId`
214
- 2. resolve effective system access
215
- 3. derive sidebar entries from `navigation.sidebar`
216
- 4. expose shell helpers such as `childrenOf`, `ancestorsOf`, and `findByPath`
217
- 5. bridge the operations graph into shared UI
218
-
219
- ## Published Package
220
-
221
- `@elevasis/core` exposes a curated browser-safe surface:
222
-
223
- - root barrel
224
- - `./organization-model`
225
-
226
- The organization graph builder remains monorepo-internal until there is a concrete external contract need.
227
-
228
- ## Verification
229
-
230
- ```bash
231
- pnpm --filter @repo/core test -- organization-model
232
- pnpm --filter @repo/core build:publish
233
- pnpm -C external/_template/core test
234
- ```
202
+
203
+ ## Authoring and Resolution
204
+
205
+ - `defineOrganizationModel()` is a typed authoring helper.
206
+ - `resolveOrganizationModel(partial)` deep-merges a partial override into `DEFAULT_ORGANIZATION_MODEL` and validates the result.
207
+ - `createFoundationOrganizationModel(partial)` resolves the canonical model and returns template-facing helpers.
208
+ - Plain objects merge recursively.
209
+ - Id-keyed domain maps merge additively by key.
210
+ - Arrays replace defaults.
211
+
212
+ ## Referential Integrity
213
+
214
+ `OrganizationModelSchema` validates:
215
+
216
+ - unique System IDs
217
+ - ancestor existence for dotted System IDs and `parentSystemId`
218
+ - UI path rules for Systems with UI presence
219
+ - valid sidebar positions
220
+ - reality-domain cross references such as offering target segments and role reporting lines
221
+ - system, resource, role, knowledge, and goal cross references used by resource governance
222
+
223
+ `DeploymentSpec` remains the runtime/deploy assembly around these descriptors. It is not the source of resource identity.
224
+
225
+ ## Provider Integration
226
+
227
+ `ElevasisSystemsProvider` uses the organization model to:
228
+
229
+ 1. validate each manifest's `systemId`
230
+ 2. resolve effective system access
231
+ 3. derive sidebar entries from `navigation.sidebar`
232
+ 4. expose shell helpers such as `childrenOf`, `ancestorsOf`, and `findByPath`
233
+ 5. bridge the operations graph into shared UI
234
+
235
+ ## Published Package
236
+
237
+ `@elevasis/core` exposes a curated browser-safe surface with six subpaths:
238
+
239
+ - `.` (root barrel)
240
+ - `./auth`
241
+ - `./test-utils`
242
+ - `./organization-model`
243
+ - `./entities`
244
+ - `./knowledge`
245
+
246
+ Only these subpaths are the legitimate published contract; any other `@repo/core/<subpath>` (`/server`, `/platform`, `/execution`, `/commands`, `/operations`, `/resilience`, `/supabase`, ...) is workspace-internal and not part of the SDK surface. The organization graph builder remains monorepo-internal until there is a concrete external contract need.
247
+
248
+ ## Verification
249
+
250
+ ```bash
251
+ pnpm --filter @repo/core test -- organization-model
252
+ pnpm --filter @repo/core build:publish
253
+ pnpm -C external/_template/core test
254
+ ```
@@ -127,7 +127,7 @@ The external skill doc (`.claude/skills/external/SKILL.md`) remains the workflow
127
127
  ```bash
128
128
  pnpm sync:verify # Post-sync assertion (exit 1 on failures)
129
129
  pnpm sync:verify --pre # Pre-sync drift report (always exit 0)
130
- pnpm sync:verify -- ZentaraHQ # Single project
130
+ pnpm sync:verify -- nirvana-marketing # Single project
131
131
  ```
132
132
 
133
133
  ### Integration Points
@@ -25,24 +25,24 @@ Scaffold docs are co-located with their owning package and copied into the SDK r
25
25
 
26
26
  ### Source-to-Destination Map
27
27
 
28
- | Content | Source | SDK Reference Destination |
29
- | --------------------------- | --------------------------------------------------------------- | --------------------------------------------- |
30
- | Organization Model | `packages/core/src/organization-model/organization-model.mdx` | `scaffold/core/organization-model.mdx` |
31
- | Organization Graph | `packages/core/src/organization-model/organization-graph.mdx` | `scaffold/core/organization-graph.mdx` |
32
- | Glossary | `packages/core/src/reference/glossary.md` | `scaffold/reference/glossary.md` |
33
- | Contracts (auto-gen) | `packages/core/src/reference/_generated/contracts.md` | `scaffold/reference/contracts.md` |
28
+ | Content | Source | SDK Reference Destination |
29
+ | ---------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------- |
30
+ | Organization Model | `packages/core/src/organization-model/organization-model.mdx` | `scaffold/core/organization-model.mdx` |
31
+ | Organization Graph | `packages/core/src/organization-model/organization-graph.mdx` | `scaffold/core/organization-graph.mdx` |
32
+ | Glossary | `packages/core/src/reference/glossary.md` | `scaffold/reference/glossary.md` |
33
+ | Contracts (auto-gen) | `packages/core/src/reference/_generated/contracts.md` | `scaffold/reference/contracts.md` |
34
34
  | System Interface Capabilities (auto-gen) | `packages/core/src/reference/_generated/system-interface-capabilities.md` | `scaffold/reference/system-interface-capabilities.md` |
35
- | UI Recipes | `packages/ui/src/scaffold/recipes.md` | `scaffold/ui/recipes.md` |
36
- | System Flags & Gating | `packages/ui/src/scaffold/feature-flags-and-gating.md` | `scaffold/ui/feature-flags-and-gating.md` |
37
- | Customization | `packages/ui/src/scaffold/customization.md` | `scaffold/ui/customization.md` |
38
- | System Shell | `packages/ui/src/scaffold/feature-shell.mdx` | `scaffold/ui/feature-shell.mdx` |
39
- | Composition & Extensibility | `packages/ui/src/scaffold/composition-extensibility.mdx` | `scaffold/ui/composition-extensibility.mdx` |
40
- | System Registry (auto-gen) | `packages/ui/src/scaffold/_generated/feature-registry.md` | `scaffold/reference/feature-registry.md` |
41
- | Scaffold Index | `packages/sdk/docs/scaffold/index.mdx` | `scaffold/index.mdx` |
42
- | Pathway Recipes | `packages/sdk/docs/scaffold/recipes/` | `scaffold/recipes/` |
43
- | Workflow Recipes | `packages/sdk/docs/scaffold/operations/workflow-recipes.md` | `scaffold/operations/workflow-recipes.md` |
44
- | Propagation Pipeline | `packages/sdk/docs/scaffold/operations/propagation-pipeline.md` | `scaffold/operations/propagation-pipeline.md` |
45
- | This doc | `packages/sdk/docs/scaffold/operations/scaffold-maintenance.md` | `scaffold/operations/scaffold-maintenance.md` |
35
+ | UI Recipes | `packages/ui/src/scaffold/recipes.md` | `scaffold/ui/recipes.md` |
36
+ | System Flags & Gating | `packages/ui/src/scaffold/feature-flags-and-gating.md` | `scaffold/ui/feature-flags-and-gating.md` |
37
+ | Customization | `packages/ui/src/scaffold/customization.md` | `scaffold/ui/customization.md` |
38
+ | System Shell | `packages/ui/src/scaffold/feature-shell.mdx` | `scaffold/ui/feature-shell.mdx` |
39
+ | Composition & Extensibility | `packages/ui/src/scaffold/composition-extensibility.mdx` | `scaffold/ui/composition-extensibility.mdx` |
40
+ | System Registry (auto-gen) | `packages/ui/src/scaffold/_generated/feature-registry.md` | `scaffold/reference/feature-registry.md` |
41
+ | Scaffold Index | `packages/sdk/docs/scaffold/index.mdx` | `scaffold/index.mdx` |
42
+ | Pathway Recipes | `packages/sdk/docs/scaffold/recipes/` | `scaffold/recipes/` |
43
+ | Workflow Recipes | `packages/sdk/docs/scaffold/operations/workflow-recipes.md` | `scaffold/operations/workflow-recipes.md` |
44
+ | Propagation Pipeline | `packages/sdk/docs/scaffold/operations/propagation-pipeline.md` | `scaffold/operations/propagation-pipeline.md` |
45
+ | This doc | `packages/sdk/docs/scaffold/operations/scaffold-maintenance.md` | `scaffold/operations/scaffold-maintenance.md` |
46
46
 
47
47
  ---
48
48
 
@@ -65,7 +65,8 @@ Output: `packages/core/src/reference/_generated/contracts.md`
65
65
  Generated by `scripts/monorepo/generate-scaffold-contracts.js` from:
66
66
 
67
67
  - `packages/core/src/organization-model/domains/systems.ts` -- `SYSTEM_INTERFACE_PROFILES`
68
- - `packages/core/src/business/acquisition/ontology-validation.ts` -- derived-readiness validation constants and checks
68
+ - `packages/core/src/organization-model/readiness/` -- generic derived-readiness engine (`computeInterfaceReadiness`)
69
+ - `packages/core/src/business/acquisition/ontology-validation.ts` -- built-in lead-gen/CRM readiness contracts and profile registration
69
70
 
70
71
  Output: `packages/core/src/reference/_generated/system-interface-capabilities.md`
71
72