@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,93 +1,93 @@
1
- # Identity domain
2
-
3
- The `identity` domain captures the organization's legal identity, purpose, and operational anchors.
4
- It is distinct from `branding` (display identity: logos, product names) — editing identity fields
5
- here does not touch any visual or branding configuration.
6
-
7
- ## Schema
8
-
9
- Source: `packages/core/src/organization-model/domains/identity.ts`
10
-
11
- ```typescript
12
- IdentityDomainSchema = z.object({
13
- mission: z.string().trim().max(1000).default(''),
14
- vision: z.string().trim().max(1000).default(''),
15
- legalName: z.string().trim().max(200).default(''),
16
- entityType: z.string().trim().max(100).default(''), // e.g. "LLC", "Corporation"
17
- jurisdiction: z.string().trim().max(200).default(''), // e.g. "United States – Delaware"
18
- industryCategory: z.string().trim().max(200).default(''), // e.g. "Marketing Agency"
19
- geographicFocus: z.string().trim().max(200).default(''), // e.g. "North America"
20
- timeZone: z.string().trim().max(100).default('UTC'), // IANA identifier
21
- businessHours: BusinessHoursSchema // per-day { open, close } in HH:MM
22
- })
23
- ```
24
-
25
- `BusinessHoursSchema` is an object with optional keys `monday` through `sunday`, each holding
26
- `{ open: "HH:MM", close: "HH:MM" }`. An empty object `{}` means not configured.
27
-
28
- ## Field reference
29
-
30
- | Field | Type | Max | Notes |
31
- | ------------------ | ------ | ---- | -------------------------------------------------------- |
32
- | `mission` | string | 1000 | Why the organization exists |
33
- | `vision` | string | 1000 | Where the organization is headed long-term |
34
- | `legalName` | string | 200 | Registered legal name |
35
- | `entityType` | string | 100 | e.g. "LLC", "Corporation", "Sole Proprietor" |
36
- | `jurisdiction` | string | 200 | e.g. "United States – Delaware", "Canada – Ontario" |
37
- | `industryCategory` | string | 200 | e.g. "Marketing Agency", "SaaS", "Professional Services" |
38
- | `geographicFocus` | string | 200 | e.g. "North America", "Global", "Southeast Asia" |
39
- | `timeZone` | string | 100 | IANA identifier, e.g. `America/Los_Angeles` |
40
- | `businessHours` | object | -- | Per-day `{ open: "HH:MM", close: "HH:MM" }` |
41
-
42
- ## Validation rules
43
-
44
- - All string fields default to empty string `''`; none are required to be non-empty at schema level
45
- - `timeZone` defaults to `"UTC"` when not set; agents should treat a value of `"UTC"` as
46
- potentially unconfigured and surface it for review
47
- - `businessHours` defaults to `{}` (not configured); an empty object is valid
48
- - Per-day entries must follow `"HH:MM"` 24-hour format; the schema does not enforce range bounds
49
- but convention is `00:00`–`23:59`
50
- - `jurisdiction` should use the format `"Country – Region"` (em dash, not hyphen) for
51
- consistency across agents that parse it
52
-
53
- ## Examples
54
-
55
- ```typescript
56
- identity: {
57
- mission: "We help SMBs automate complex operations using AI.",
58
- vision: "A world where every business operates at the efficiency of a Fortune 500.",
59
- legalName: "Acme Operations LLC",
60
- entityType: "LLC",
61
- jurisdiction: "United States – Delaware",
62
- industryCategory: "AI Automation / Professional Services",
63
- geographicFocus: "North America",
64
- timeZone: "America/Chicago",
65
- businessHours: {
66
- monday: { open: "09:00", close: "17:00" },
67
- tuesday: { open: "09:00", close: "17:00" },
68
- wednesday: { open: "09:00", close: "17:00" },
69
- thursday: { open: "09:00", close: "17:00" },
70
- friday: { open: "09:00", close: "17:00" }
71
- }
72
- }
73
- ```
74
-
75
- ## Where it lives in the adapter
76
-
77
- `core/config/organization-model.ts` under the `identity` key of
78
- `defineOrganizationModel({...})`.
79
-
80
- To read the current values: open the adapter file and inspect the `identity` block directly, or
81
- use `pnpm exec elevasis-sdk knowledge:cat identity` (external project).
82
-
83
- ## Write path
84
-
85
- To edit any field, the `/knowledge` skill runs the codify ceremony
86
- (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck → Zod parse →
87
- rollback on failure. Only the confirmed fields are written; no other top-level keys in the adapter
88
- are touched.
89
-
90
- ---
91
-
92
- **Read via `/knowledge`** — natural-language queries like "what's our identity set to?" or
93
- "what timezone are we in?" route to this domain via the skill's intent classifier.
1
+ # Identity domain
2
+
3
+ The `identity` domain captures the organization's legal identity, purpose, and operational anchors.
4
+ It is distinct from `branding` (display identity: logos, product names) — editing identity fields
5
+ here does not touch any visual or branding configuration.
6
+
7
+ ## Schema
8
+
9
+ Source: `packages/core/src/organization-model/domains/identity.ts`
10
+
11
+ ```typescript
12
+ IdentityDomainSchema = z.object({
13
+ mission: z.string().trim().max(1000).default(''),
14
+ vision: z.string().trim().max(1000).default(''),
15
+ legalName: z.string().trim().max(200).default(''),
16
+ entityType: z.string().trim().max(100).default(''), // e.g. "LLC", "Corporation"
17
+ jurisdiction: z.string().trim().max(200).default(''), // e.g. "United States – Delaware"
18
+ industryCategory: z.string().trim().max(200).default(''), // e.g. "Marketing Agency"
19
+ geographicFocus: z.string().trim().max(200).default(''), // e.g. "North America"
20
+ timeZone: z.string().trim().max(100).default('UTC'), // IANA identifier
21
+ businessHours: BusinessHoursSchema // per-day { open, close } in HH:MM
22
+ })
23
+ ```
24
+
25
+ `BusinessHoursSchema` is an object with optional keys `monday` through `sunday`, each holding
26
+ `{ open: "HH:MM", close: "HH:MM" }`. An empty object `{}` means not configured.
27
+
28
+ ## Field reference
29
+
30
+ | Field | Type | Max | Notes |
31
+ | ------------------ | ------ | ---- | -------------------------------------------------------- |
32
+ | `mission` | string | 1000 | Why the organization exists |
33
+ | `vision` | string | 1000 | Where the organization is headed long-term |
34
+ | `legalName` | string | 200 | Registered legal name |
35
+ | `entityType` | string | 100 | e.g. "LLC", "Corporation", "Sole Proprietor" |
36
+ | `jurisdiction` | string | 200 | e.g. "United States – Delaware", "Canada – Ontario" |
37
+ | `industryCategory` | string | 200 | e.g. "Marketing Agency", "SaaS", "Professional Services" |
38
+ | `geographicFocus` | string | 200 | e.g. "North America", "Global", "Southeast Asia" |
39
+ | `timeZone` | string | 100 | IANA identifier, e.g. `America/Los_Angeles` |
40
+ | `businessHours` | object | -- | Per-day `{ open: "HH:MM", close: "HH:MM" }` |
41
+
42
+ ## Validation rules
43
+
44
+ - All string fields default to empty string `''`; none are required to be non-empty at schema level
45
+ - `timeZone` defaults to `"UTC"` when not set; agents should treat a value of `"UTC"` as
46
+ potentially unconfigured and surface it for review
47
+ - `businessHours` defaults to `{}` (not configured); an empty object is valid
48
+ - Per-day entries must follow `"HH:MM"` 24-hour format; the schema does not enforce range bounds
49
+ but convention is `00:00`–`23:59`
50
+ - `jurisdiction` should use the format `"Country – Region"` (em dash, not hyphen) for
51
+ consistency across agents that parse it
52
+
53
+ ## Examples
54
+
55
+ ```typescript
56
+ identity: {
57
+ mission: "We help SMBs automate complex operations using AI.",
58
+ vision: "A world where every business operates at the efficiency of a Fortune 500.",
59
+ legalName: "Acme Operations LLC",
60
+ entityType: "LLC",
61
+ jurisdiction: "United States – Delaware",
62
+ industryCategory: "AI Automation / Professional Services",
63
+ geographicFocus: "North America",
64
+ timeZone: "America/Chicago",
65
+ businessHours: {
66
+ monday: { open: "09:00", close: "17:00" },
67
+ tuesday: { open: "09:00", close: "17:00" },
68
+ wednesday: { open: "09:00", close: "17:00" },
69
+ thursday: { open: "09:00", close: "17:00" },
70
+ friday: { open: "09:00", close: "17:00" }
71
+ }
72
+ }
73
+ ```
74
+
75
+ ## Where it lives in the adapter
76
+
77
+ `core/config/organization-model.ts` under the `identity` key of
78
+ `defineOrganizationModel({...})`.
79
+
80
+ To read the current values: open the adapter file and inspect the `identity` block directly, or
81
+ use `pnpm exec elevasis-sdk knowledge:cat identity` (external project).
82
+
83
+ ## Write path
84
+
85
+ To edit any field, the `/knowledge` skill runs the codify ceremony
86
+ (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck → Zod parse →
87
+ rollback on failure. Only the confirmed fields are written; no other top-level keys in the adapter
88
+ are touched.
89
+
90
+ ---
91
+
92
+ **Read via `/knowledge`** — natural-language queries like "what's our identity set to?" or
93
+ "what timezone are we in?" route to this domain via the skill's intent classifier.
@@ -1,94 +1,94 @@
1
- # Labels domain
2
-
3
- `label` is an inline display field carried by status entries, stage entries, System entries,
4
- knowledge nodes, registry entries, and sidebar surfaces in the OrganizationModel. Labels control what users see in the UI and what
5
- agents say when narrating state. Editing a label does not change the entry's `id` or
6
- `semanticClass` -- only the human-readable display string. This is Level A only (config-only
7
- edits to `core/config/organization-model.ts`).
8
-
9
- ## What carries labels
10
-
11
- The following model elements have editable inline `label` fields:
12
-
13
- **Status / stage entries.** Each domain that carries an enum-like array exposes per-entry labels:
14
-
15
- - `sales.statuses` -- deal pipeline stages.
16
- - `prospecting.statuses` -- lead lifecycle stages.
17
- - `projects.statuses` -- project and task stages.
18
-
19
- Source of platform defaults: `packages/core/src/organization-model/domains/{sales,prospecting,projects}.ts`.
20
-
21
- Each status entry shape:
22
-
23
- ```typescript
24
- { id: 'new', label: 'New Lead', semanticClass: 'active', color: 'blue' }
25
- ```
26
-
27
- **Systems.** The `label` field on a System entry. Editing it changes agent narration and any
28
- System-derived shell text, but it does not change the System `id`, route path, or graph node id.
29
-
30
- **Sidebar surfaces.** Routeable leaves under `navigation.sidebar.primary` and
31
- `navigation.sidebar.bottom` carry labels. Editing changes nav item and breadcrumb display without
32
- changing the route path or target System refs.
33
-
34
- **Knowledge/domain entries.** Knowledge nodes, customers, offerings, goals, roles, resources,
35
- actions, entities, and policies may carry labels or titles depending on the domain. Edit only the
36
- display field that already exists on the entry.
37
-
38
- ## What is NOT in scope
39
-
40
- `id` and `semanticClass` of any entry must never change in a label edit -- they are structural
41
- anchors used by code, hooks, and workflow adapters. Only `label` (and optionally `color` or
42
- `icon`) are in scope. To rename an `id`, escalate to a separate Level B refactor with explicit
43
- confirmation, because every consumer that references the old `id` must be updated in the same
44
- change.
45
-
46
- ## Validation rules
47
-
48
- - `label` is non-empty, max 120 characters.
49
- - `id` and `semanticClass` are unchanged from the previous state.
50
- - Entries not being edited remain byte-identical in the output -- partial array rewrites are
51
- preferred over wholesale array replacement to minimize diff surface.
52
-
53
- ## Realistic examples
54
-
55
- Rename two sales statuses:
56
-
57
- ```
58
- Domain: sales (deal pipeline)
59
- new: "New Lead" -> "Inbound Lead"
60
- proposal: "Proposal Sent" -> "Proposal Out"
61
- negotiation: (unchanged)
62
- ```
63
-
64
- Rename a System label without changing its ID:
65
-
66
- ```
67
- systems:
68
- sales.crm: label "CRM" -> "Sales Pipeline"
69
- (id stays 'sales.crm'; graph node remains 'system:sales.crm')
70
- ```
71
-
72
- Rename a sidebar surface:
73
-
74
- ```
75
- navigation.sidebar.primary:
76
- sales.crm: label "Pipeline" -> "Deal Pipeline"
77
- ```
78
-
79
- ## Validation gate
80
-
81
- Every label change must pass before codify completes:
82
-
83
- 1. `pnpm -C operations check-types`.
84
- 2. `resolveOrganizationModel()` and `OrganizationModelSchema.parse()` succeed on the merged result.
85
-
86
- On failure, the codify ceremony rolls back. See `operations/codify-level-a.md` for the rollback
87
- procedure.
88
-
89
- ---
90
-
91
- > **Read via `/knowledge`** -- natural-language queries like "what's the label for the proposal
92
- > stage?" or "what do we call the SEO System?" route to this domain via the skill's intent
93
- > classifier. To rename one or more labels, the `/knowledge` skill triggers the codify ceremony
94
- > when intent classifies as Codify.
1
+ # Labels domain
2
+
3
+ `label` is an inline display field carried by status entries, stage entries, System entries,
4
+ knowledge nodes, registry entries, and sidebar surfaces in the OrganizationModel. Labels control what users see in the UI and what
5
+ agents say when narrating state. Editing a label does not change the entry's `id` or
6
+ `semanticClass` -- only the human-readable display string. This is Level A only (config-only
7
+ edits to `core/config/organization-model.ts`).
8
+
9
+ ## What carries labels
10
+
11
+ The following model elements have editable inline `label` fields:
12
+
13
+ **Status / stage entries.** Each domain that carries an enum-like array exposes per-entry labels:
14
+
15
+ - `sales.statuses` -- deal pipeline stages.
16
+ - `prospecting.statuses` -- lead lifecycle stages.
17
+ - `projects.statuses` -- project and task stages.
18
+
19
+ Source of platform defaults: `packages/core/src/organization-model/domains/{sales,prospecting,projects}.ts`.
20
+
21
+ Each status entry shape:
22
+
23
+ ```typescript
24
+ { id: 'new', label: 'New Lead', semanticClass: 'active', color: 'blue' }
25
+ ```
26
+
27
+ **Systems.** The `label` field on a System entry. Editing it changes agent narration and any
28
+ System-derived shell text, but it does not change the System `id`, route path, or graph node id.
29
+
30
+ **Sidebar surfaces.** Routeable leaves under `navigation.sidebar.primary` and
31
+ `navigation.sidebar.bottom` carry labels. Editing changes nav item and breadcrumb display without
32
+ changing the route path or target System refs.
33
+
34
+ **Knowledge/domain entries.** Knowledge nodes, customers, offerings, goals, roles, resources,
35
+ actions, entities, and policies may carry labels or titles depending on the domain. Edit only the
36
+ display field that already exists on the entry.
37
+
38
+ ## What is NOT in scope
39
+
40
+ `id` and `semanticClass` of any entry must never change in a label edit -- they are structural
41
+ anchors used by code, hooks, and workflow adapters. Only `label` (and optionally `color` or
42
+ `icon`) are in scope. To rename an `id`, escalate to a separate Level B refactor with explicit
43
+ confirmation, because every consumer that references the old `id` must be updated in the same
44
+ change.
45
+
46
+ ## Validation rules
47
+
48
+ - `label` is non-empty, max 120 characters.
49
+ - `id` and `semanticClass` are unchanged from the previous state.
50
+ - Entries not being edited remain byte-identical in the output -- partial array rewrites are
51
+ preferred over wholesale array replacement to minimize diff surface.
52
+
53
+ ## Realistic examples
54
+
55
+ Rename two sales statuses:
56
+
57
+ ```
58
+ Domain: sales (deal pipeline)
59
+ new: "New Lead" -> "Inbound Lead"
60
+ proposal: "Proposal Sent" -> "Proposal Out"
61
+ negotiation: (unchanged)
62
+ ```
63
+
64
+ Rename a System label without changing its ID:
65
+
66
+ ```
67
+ systems:
68
+ sales.crm: label "CRM" -> "Sales Pipeline"
69
+ (id stays 'sales.crm'; graph node remains 'system:sales.crm')
70
+ ```
71
+
72
+ Rename a sidebar surface:
73
+
74
+ ```
75
+ navigation.sidebar.primary:
76
+ sales.crm: label "Pipeline" -> "Deal Pipeline"
77
+ ```
78
+
79
+ ## Validation gate
80
+
81
+ Every label change must pass before codify completes:
82
+
83
+ 1. `pnpm -C operations check-types`.
84
+ 2. `resolveOrganizationModel()` and `OrganizationModelSchema.parse()` succeed on the merged result.
85
+
86
+ On failure, the codify ceremony rolls back. See `operations/codify-level-a.md` for the rollback
87
+ procedure.
88
+
89
+ ---
90
+
91
+ > **Read via `/knowledge`** -- natural-language queries like "what's the label for the proposal
92
+ > stage?" or "what do we call the SEO System?" route to this domain via the skill's intent
93
+ > classifier. To rename one or more labels, the `/knowledge` skill triggers the codify ceremony
94
+ > when intent classifies as Codify.
@@ -1,109 +1,109 @@
1
- # Offerings domain
2
-
3
- The `offerings` domain describes what the organization sells or delivers — a catalog of products
4
- and services modeled after the Business Model Canvas "Value Propositions". Agents use offerings
5
- for quoting, proposal generation, and scope-of-work reasoning.
6
-
7
- ## Schema
8
-
9
- Source: `packages/core/src/organization-model/domains/offerings.ts`
10
-
11
- ```typescript
12
- OfferingsDomainSchema = z.object({
13
- products: z.array(ProductSchema).default([])
14
- })
15
-
16
- ProductSchema = z.object({
17
- id: z.string().trim().min(1).max(100), // stable ID, e.g. "product-starter-plan"
18
- name: z.string().trim().max(200).default(''), // display name
19
- description: z.string().trim().max(2000).default(''), // what it delivers
20
- pricingModel: PricingModelSchema.default('custom'), // 'one-time' | 'subscription' | 'usage-based' | 'custom'
21
- price: z.number().min(0).default(0), // base price amount (>= 0)
22
- currency: z.string().trim().max(10).default('USD'),// ISO 4217, e.g. "USD", "EUR"
23
- targetSegmentIds: z.array(z.string()).default([]), // must ref customers.segments[].id
24
- deliverySystemId: z.string().optional() // optional ref to systems[].id
25
- })
26
- ```
27
-
28
- `pricingModel` values:
29
-
30
- - `one-time` -- single purchase (setup fee, project fee)
31
- - `subscription` -- recurring (monthly/annual SaaS, retainer)
32
- - `usage-based` -- metered by consumption (API calls, seats)
33
- - `custom` -- negotiated or bespoke pricing
34
-
35
- ## Field reference
36
-
37
- | Field | Type | Max | Notes |
38
- | ------------------- | -------- | ---- | -------------------------------------------------------- |
39
- | `id` | string | 100 | Stable key, min 1 char; e.g. `"product-starter-plan"` |
40
- | `name` | string | 200 | Display name |
41
- | `description` | string | 2000 | What this product or service delivers |
42
- | `pricingModel` | enum | -- | `one-time`, `subscription`, `usage-based`, or `custom` |
43
- | `price` | number | -- | Base price amount, min 0; use 0 for fully custom pricing |
44
- | `currency` | string | 10 | ISO 4217 code; defaults to `"USD"` |
45
- | `targetSegmentIds` | string[] | -- | Each entry must reference a `customers.segments[].id` |
46
- | `deliverySystemId` | string | -- | Optional reference to a `systems[].id` |
47
-
48
- ## Validation rules
49
-
50
- - `id` is the stable key; changing it after creation is a breaking change for any downstream
51
- references
52
- - `targetSegmentIds` entries must exist in `customers.segments[].id`; the schema enforces this
53
- at parse time — missing references cause `resolveOrganizationModel()` to fail
54
- - `deliverySystemId` (when present) must exist in `systems[].id`; same parse-time enforcement
55
- - `price` must be >= 0; use 0 when pricing is fully custom or not yet set
56
- - `currency` must be a valid ISO 4217 code by convention (the schema only validates length)
57
- - Cross-reference: if a product is removed, surface any `targetSegmentIds` in other products
58
- that reference the removed ID
59
-
60
- ## Examples
61
-
62
- ```typescript
63
- offerings: {
64
- products: [
65
- {
66
- id: "product-full-service-retainer",
67
- name: "Full-Service Retainer",
68
- description: "End-to-end campaign delivery, reporting, and optimization for SMB clients.",
69
- pricingModel: "subscription",
70
- price: 2500,
71
- currency: "USD",
72
- targetSegmentIds: ["segment-smb-agencies"],
73
- deliverySystemId: undefined
74
- },
75
- {
76
- id: "product-one-time-audit",
77
- name: "One-Time Operations Audit",
78
- description: "Single-engagement review of current workflows with a remediation roadmap.",
79
- pricingModel: "one-time",
80
- price: 1500,
81
- currency: "USD",
82
- targetSegmentIds: ["segment-smb-agencies"],
83
- deliverySystemId: undefined
84
- }
85
- ]
86
- }
87
- ```
88
-
89
- ## Where it lives in the adapter
90
-
91
- `core/config/organization-model.ts` under the `offerings` key of
92
- `defineOrganizationModel({...})`.
93
-
94
- To read current products: open the adapter file and inspect the `offerings.products` array, or
95
- use `pnpm exec elevasis-sdk knowledge:cat offerings` (external project).
96
-
97
- ## Write path
98
-
99
- To add, edit, or remove a product, the `/knowledge` skill runs the codify ceremony
100
- (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck → Zod parse →
101
- rollback on failure. Only the `products` array is written; no other keys in the adapter are
102
- touched. Before writing, the skill verifies all `targetSegmentIds` and `deliverySystemId`
103
- references resolve. When adding, append to the array. When editing, replace by `id`. When
104
- removing, filter out — and surface any dangling references first.
105
-
106
- ---
107
-
108
- **Read via `/knowledge`** — natural-language queries like "what do we sell?" or "what's the
109
- pricing on the retainer?" route to this domain via the skill's intent classifier.
1
+ # Offerings domain
2
+
3
+ The `offerings` domain describes what the organization sells or delivers — a catalog of products
4
+ and services modeled after the Business Model Canvas "Value Propositions". Agents use offerings
5
+ for quoting, proposal generation, and scope-of-work reasoning.
6
+
7
+ ## Schema
8
+
9
+ Source: `packages/core/src/organization-model/domains/offerings.ts`
10
+
11
+ ```typescript
12
+ OfferingsDomainSchema = z.object({
13
+ products: z.array(ProductSchema).default([])
14
+ })
15
+
16
+ ProductSchema = z.object({
17
+ id: z.string().trim().min(1).max(100), // stable ID, e.g. "product-starter-plan"
18
+ name: z.string().trim().max(200).default(''), // display name
19
+ description: z.string().trim().max(2000).default(''), // what it delivers
20
+ pricingModel: PricingModelSchema.default('custom'), // 'one-time' | 'subscription' | 'usage-based' | 'custom'
21
+ price: z.number().min(0).default(0), // base price amount (>= 0)
22
+ currency: z.string().trim().max(10).default('USD'),// ISO 4217, e.g. "USD", "EUR"
23
+ targetSegmentIds: z.array(z.string()).default([]), // must ref customers.segments[].id
24
+ deliverySystemId: z.string().optional() // optional ref to systems[].id
25
+ })
26
+ ```
27
+
28
+ `pricingModel` values:
29
+
30
+ - `one-time` -- single purchase (setup fee, project fee)
31
+ - `subscription` -- recurring (monthly/annual SaaS, retainer)
32
+ - `usage-based` -- metered by consumption (API calls, seats)
33
+ - `custom` -- negotiated or bespoke pricing
34
+
35
+ ## Field reference
36
+
37
+ | Field | Type | Max | Notes |
38
+ | ------------------- | -------- | ---- | -------------------------------------------------------- |
39
+ | `id` | string | 100 | Stable key, min 1 char; e.g. `"product-starter-plan"` |
40
+ | `name` | string | 200 | Display name |
41
+ | `description` | string | 2000 | What this product or service delivers |
42
+ | `pricingModel` | enum | -- | `one-time`, `subscription`, `usage-based`, or `custom` |
43
+ | `price` | number | -- | Base price amount, min 0; use 0 for fully custom pricing |
44
+ | `currency` | string | 10 | ISO 4217 code; defaults to `"USD"` |
45
+ | `targetSegmentIds` | string[] | -- | Each entry must reference a `customers.segments[].id` |
46
+ | `deliverySystemId` | string | -- | Optional reference to a `systems[].id` |
47
+
48
+ ## Validation rules
49
+
50
+ - `id` is the stable key; changing it after creation is a breaking change for any downstream
51
+ references
52
+ - `targetSegmentIds` entries must exist in `customers.segments[].id`; the schema enforces this
53
+ at parse time — missing references cause `resolveOrganizationModel()` to fail
54
+ - `deliverySystemId` (when present) must exist in `systems[].id`; same parse-time enforcement
55
+ - `price` must be >= 0; use 0 when pricing is fully custom or not yet set
56
+ - `currency` must be a valid ISO 4217 code by convention (the schema only validates length)
57
+ - Cross-reference: if a product is removed, surface any `targetSegmentIds` in other products
58
+ that reference the removed ID
59
+
60
+ ## Examples
61
+
62
+ ```typescript
63
+ offerings: {
64
+ products: [
65
+ {
66
+ id: "product-full-service-retainer",
67
+ name: "Full-Service Retainer",
68
+ description: "End-to-end campaign delivery, reporting, and optimization for SMB clients.",
69
+ pricingModel: "subscription",
70
+ price: 2500,
71
+ currency: "USD",
72
+ targetSegmentIds: ["segment-smb-agencies"],
73
+ deliverySystemId: undefined
74
+ },
75
+ {
76
+ id: "product-one-time-audit",
77
+ name: "One-Time Operations Audit",
78
+ description: "Single-engagement review of current workflows with a remediation roadmap.",
79
+ pricingModel: "one-time",
80
+ price: 1500,
81
+ currency: "USD",
82
+ targetSegmentIds: ["segment-smb-agencies"],
83
+ deliverySystemId: undefined
84
+ }
85
+ ]
86
+ }
87
+ ```
88
+
89
+ ## Where it lives in the adapter
90
+
91
+ `core/config/organization-model.ts` under the `offerings` key of
92
+ `defineOrganizationModel({...})`.
93
+
94
+ To read current products: open the adapter file and inspect the `offerings.products` array, or
95
+ use `pnpm exec elevasis-sdk knowledge:cat offerings` (external project).
96
+
97
+ ## Write path
98
+
99
+ To add, edit, or remove a product, the `/knowledge` skill runs the codify ceremony
100
+ (`operations/codify-level-a.md`): snapshot → propose → confirm → write → typecheck → Zod parse →
101
+ rollback on failure. Only the `products` array is written; no other keys in the adapter are
102
+ touched. Before writing, the skill verifies all `targetSegmentIds` and `deliverySystemId`
103
+ references resolve. When adding, append to the array. When editing, replace by `id`. When
104
+ removing, filter out — and surface any dangling references first.
105
+
106
+ ---
107
+
108
+ **Read via `/knowledge`** — natural-language queries like "what do we sell?" or "what's the
109
+ pricing on the retainer?" route to this domain via the skill's intent classifier.