@elevasis/sdk 1.20.2 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/dist/cli.cjs +4220 -1583
  2. package/dist/index.d.ts +1035 -481
  3. package/dist/index.js +7381 -4187
  4. package/dist/node/index.d.ts +1 -3
  5. package/dist/node/index.js +40 -49
  6. package/dist/test-utils/index.d.ts +699 -123
  7. package/dist/test-utils/index.js +3826 -630
  8. package/dist/worker/index.js +3616 -442
  9. package/package.json +3 -3
  10. package/reference/_navigation.md +9 -7
  11. package/reference/_reference-manifest.json +1 -1
  12. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  13. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  14. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  15. package/reference/claude-config/registries/graph-skills.json +4 -4
  16. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  17. package/reference/claude-config/rules/active-change-index.md +80 -80
  18. package/reference/claude-config/rules/agent-start-here.md +277 -273
  19. package/reference/claude-config/rules/deployment.md +57 -57
  20. package/reference/claude-config/rules/error-handling.md +56 -56
  21. package/reference/claude-config/rules/execution.md +40 -40
  22. package/reference/claude-config/rules/frontend.md +4 -4
  23. package/reference/claude-config/rules/observability.md +31 -31
  24. package/reference/claude-config/rules/operations.md +29 -17
  25. package/reference/claude-config/rules/organization-model.md +108 -40
  26. package/reference/claude-config/rules/organization-os.md +115 -113
  27. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  28. package/reference/claude-config/rules/platform.md +42 -42
  29. package/reference/claude-config/rules/shared-types.md +49 -46
  30. package/reference/claude-config/rules/task-tracking.md +47 -47
  31. package/reference/claude-config/rules/ui.md +200 -200
  32. package/reference/claude-config/rules/vibe.md +235 -231
  33. package/reference/claude-config/scripts/statusline-command.js +18 -18
  34. package/reference/claude-config/settings.json +34 -34
  35. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  36. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  37. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  38. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  39. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  40. package/reference/claude-config/skills/knowledge/SKILL.md +330 -271
  41. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  42. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -158
  43. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  44. package/reference/claude-config/skills/knowledge/operations/features.md +76 -113
  45. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  46. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  47. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -89
  48. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  49. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  50. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  51. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  52. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  53. package/reference/claude-config/skills/save/SKILL.md +3 -3
  54. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  55. package/reference/claude-config/skills/status/SKILL.md +59 -59
  56. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  57. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  58. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  59. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  60. package/reference/claude-config/skills/tutorial/technical.md +1303 -1306
  61. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  62. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  63. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  64. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  65. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  66. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  67. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  68. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  69. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  70. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  71. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  72. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  73. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  74. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  75. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  76. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  77. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  78. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  79. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  80. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  81. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  82. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  83. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -0
  84. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  85. package/reference/claude-config/sync-notes/README.md +43 -43
  86. package/reference/cli.mdx +808 -668
  87. package/reference/concepts.mdx +146 -146
  88. package/reference/deployment/api.mdx +297 -297
  89. package/reference/deployment/command-center.mdx +209 -209
  90. package/reference/deployment/index.mdx +195 -195
  91. package/reference/deployment/provided-features.mdx +107 -93
  92. package/reference/deployment/ui-execution.mdx +250 -250
  93. package/reference/examples/organization-model.ts +147 -84
  94. package/reference/framework/agent.mdx +156 -156
  95. package/reference/framework/index.mdx +195 -195
  96. package/reference/framework/interaction-guidance.mdx +182 -182
  97. package/reference/framework/memory.mdx +326 -326
  98. package/reference/framework/project-structure.mdx +282 -282
  99. package/reference/framework/tutorial-system.mdx +135 -135
  100. package/reference/getting-started.mdx +142 -142
  101. package/reference/index.mdx +106 -106
  102. package/reference/packages/core/src/README.md +14 -14
  103. package/reference/packages/core/src/business/README.md +2 -2
  104. package/reference/packages/core/src/knowledge/README.md +33 -32
  105. package/reference/packages/core/src/organization-model/README.md +149 -109
  106. package/reference/packages/core/src/test-utils/README.md +37 -37
  107. package/reference/packages/ui/src/api/README.md +18 -18
  108. package/reference/packages/ui/src/app/README.md +24 -24
  109. package/reference/packages/ui/src/auth/README.md +18 -18
  110. package/reference/packages/ui/src/components/README.md +24 -24
  111. package/reference/packages/ui/src/execution/README.md +16 -16
  112. package/reference/packages/ui/src/features/README.md +28 -28
  113. package/reference/packages/ui/src/graph/README.md +16 -16
  114. package/reference/packages/ui/src/hooks/README.md +23 -23
  115. package/reference/packages/ui/src/initialization/README.md +19 -19
  116. package/reference/packages/ui/src/knowledge/README.md +31 -31
  117. package/reference/packages/ui/src/organization/README.md +18 -18
  118. package/reference/packages/ui/src/profile/README.md +19 -19
  119. package/reference/packages/ui/src/provider/README.md +32 -32
  120. package/reference/packages/ui/src/router/README.md +18 -18
  121. package/reference/packages/ui/src/sse/README.md +13 -13
  122. package/reference/packages/ui/src/test-utils/README.md +7 -7
  123. package/reference/packages/ui/src/theme/README.md +23 -23
  124. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  125. package/reference/packages/ui/src/types/README.md +16 -16
  126. package/reference/packages/ui/src/utils/README.md +18 -18
  127. package/reference/packages/ui/src/zustand/README.md +18 -18
  128. package/reference/platform-tools/adapters-integration.mdx +301 -301
  129. package/reference/platform-tools/adapters-platform.mdx +553 -553
  130. package/reference/platform-tools/index.mdx +217 -217
  131. package/reference/platform-tools/type-safety.mdx +82 -82
  132. package/reference/resources/index.mdx +349 -349
  133. package/reference/resources/patterns.mdx +449 -449
  134. package/reference/resources/types.mdx +116 -116
  135. package/reference/roadmap.mdx +165 -165
  136. package/reference/runtime.mdx +173 -173
  137. package/reference/scaffold/core/organization-graph.mdx +110 -89
  138. package/reference/scaffold/core/organization-model.mdx +226 -171
  139. package/reference/scaffold/index.mdx +67 -67
  140. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  141. package/reference/scaffold/operations/scaffold-maintenance.md +10 -10
  142. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  143. package/reference/scaffold/recipes/add-a-feature.md +310 -88
  144. package/reference/scaffold/recipes/add-a-resource.md +137 -117
  145. package/reference/scaffold/recipes/customize-crm-actions.md +439 -439
  146. package/reference/scaffold/recipes/customize-knowledge-browser.md +384 -0
  147. package/reference/scaffold/recipes/customize-organization-model.md +281 -118
  148. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  149. package/reference/scaffold/recipes/extend-crm.md +40 -39
  150. package/reference/scaffold/recipes/extend-lead-gen.md +400 -401
  151. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -114
  152. package/reference/scaffold/recipes/index.md +47 -46
  153. package/reference/scaffold/recipes/query-the-knowledge-graph.md +227 -0
  154. package/reference/scaffold/reference/contracts.md +2389 -2121
  155. package/reference/scaffold/reference/feature-registry.md +9 -20
  156. package/reference/scaffold/reference/glossary.md +76 -76
  157. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  158. package/reference/scaffold/ui/customization.md +243 -243
  159. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  160. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  161. package/reference/scaffold/ui/recipes.md +221 -213
  162. package/reference/spine/spine-primer.md +96 -96
  163. package/reference/templates/index.mdx +47 -47
  164. 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,89 +1,94 @@
1
- # Labels domain
2
-
3
- `label` is an inline display field carried by status entries, stage entries, feature entries, and
4
- navigation 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
- **Features.** The `label` field on a feature entry. Editing it changes sidebar nav text and any
28
- agent narration that references the feature by label.
29
-
30
- **Navigation surfaces.** Surface entries in the `navigation.surfaces` array each carry a `label`.
31
- Editing changes breadcrumb text and nav item display.
32
-
33
- ## What is NOT in scope
34
-
35
- `id` and `semanticClass` of any entry must never change in a label edit -- they are structural
36
- anchors used by code, hooks, and workflow adapters. Only `label` (and optionally `color` or
37
- `icon`) are in scope. To rename an `id`, escalate to a separate Level B refactor with explicit
38
- confirmation, because every consumer that references the old `id` must be updated in the same
39
- change.
40
-
41
- ## Validation rules
42
-
43
- - `label` is non-empty, max 120 characters.
44
- - `id` and `semanticClass` are unchanged from the previous state.
45
- - Entries not being edited remain byte-identical in the output -- partial array rewrites are
46
- preferred over wholesale array replacement to minimize diff surface.
47
-
48
- ## Realistic examples
49
-
50
- Rename two sales statuses:
51
-
52
- ```
53
- Domain: sales (deal pipeline)
54
- new: "New Lead" -> "Inbound Lead"
55
- proposal: "Proposal Sent" -> "Proposal Out"
56
- negotiation: (unchanged)
57
- ```
58
-
59
- Rename a feature label without changing its ID:
60
-
61
- ```
62
- features:
63
- crm: label "CRM" -> "Sales Pipeline"
64
- (id stays 'crm'; CRM_FEATURE_ID constant unchanged)
65
- ```
66
-
67
- Rename a navigation surface:
68
-
69
- ```
70
- navigation.surfaces:
71
- crm-pipeline: label "Pipeline" -> "Deal Pipeline"
72
- ```
73
-
74
- ## Validation gate
75
-
76
- Every label change must pass before codify completes:
77
-
78
- 1. `pnpm -C operations check-types`.
79
- 2. `resolveOrganizationModel()` and `OrganizationModelSchema.parse()` succeed on the merged result.
80
-
81
- On failure, the codify ceremony rolls back. See `operations/codify-level-a.md` for the rollback
82
- procedure.
83
-
84
- ---
85
-
86
- > **Read via `/knowledge`** -- natural-language queries like "what's the label for the proposal
87
- > stage?" or "what do we call the SEO feature?" route to this domain via the skill's intent
88
- > classifier. To rename one or more labels, the `/knowledge` skill triggers the codify ceremony
89
- > 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
- deliveryFeatureId: z.string().optional() // optional ref to features[].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
- | `deliveryFeatureId` | string | -- | Optional reference to a `features[].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
- - `deliveryFeatureId` (when present) must exist in `features[].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
- deliveryFeatureId: 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
- deliveryFeatureId: 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 `deliveryFeatureId`
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.