@elevasis/sdk 1.44.3 → 1.46.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 (259) hide show
  1. package/dist/cli.cjs +35026 -30226
  2. package/dist/index.d.ts +1786 -808
  3. package/dist/index.js +789 -739
  4. package/dist/node/index.d.ts +105 -181
  5. package/dist/node/index.js +2 -2
  6. package/dist/test-utils/index.d.ts +901 -359
  7. package/dist/test-utils/index.js +587 -824
  8. package/dist/worker/index.d.ts +12685 -0
  9. package/dist/worker/index.js +188 -216
  10. package/package.json +4 -7
  11. package/reference/_navigation.md +161 -22
  12. package/reference/_reference-manifest.json +228 -4
  13. package/reference/claude-config.md +8 -0
  14. package/reference/core/exports.mdx +2 -0
  15. package/reference/core/index.mdx +3 -3
  16. package/reference/examples/organization-model.ts +117 -111
  17. package/reference/index.mdx +4 -4
  18. package/reference/packages/core/src/business/README.md +4 -1
  19. package/reference/packages/core/src/content/README.md +19 -0
  20. package/reference/packages/core/src/organization-model/README.md +148 -149
  21. package/reference/packages/core/src/organization-model/readiness/README.md +42 -0
  22. package/reference/packages/ui/src/features/README.md +28 -28
  23. package/reference/rules/active-change-index.md +40 -54
  24. package/reference/rules/agent-runtime.md +81 -0
  25. package/reference/rules/agent-start-here.md +71 -163
  26. package/reference/rules/deployment.md +33 -10
  27. package/reference/rules/error-handling.md +26 -0
  28. package/reference/rules/execution.md +13 -0
  29. package/reference/rules/frontend.md +10 -3
  30. package/reference/rules/observability.md +9 -1
  31. package/reference/rules/operations.md +26 -17
  32. package/reference/rules/organization-model.md +74 -88
  33. package/reference/rules/organization-os.md +71 -88
  34. package/reference/rules/package-taxonomy.md +11 -2
  35. package/reference/rules/platform.md +13 -7
  36. package/reference/rules/shared-types.md +36 -0
  37. package/reference/rules/task-tracking.md +30 -5
  38. package/reference/rules/ui.md +145 -3
  39. package/reference/rules/vibe-intents.md +271 -0
  40. package/reference/rules/vibe.md +17 -243
  41. package/reference/scaffold/core/organization-graph.mdx +112 -99
  42. package/reference/scaffold/core/organization-model.mdx +231 -215
  43. package/reference/scaffold/operations/propagation-pipeline.md +16 -17
  44. package/reference/scaffold/operations/scaffold-maintenance.md +22 -20
  45. package/reference/scaffold/operations/workflow-recipes.md +72 -20
  46. package/reference/scaffold/recipes/add-a-feature.md +156 -146
  47. package/reference/scaffold/recipes/add-a-resource.md +123 -117
  48. package/reference/scaffold/recipes/customize-crm-actions.md +28 -13
  49. package/reference/scaffold/recipes/customize-knowledge-browser.md +52 -117
  50. package/reference/scaffold/recipes/customize-organization-model.md +161 -149
  51. package/reference/scaffold/recipes/extend-a-base-entity.md +156 -140
  52. package/reference/scaffold/recipes/extend-content.md +265 -0
  53. package/reference/scaffold/recipes/extend-crm.md +16 -11
  54. package/reference/scaffold/recipes/extend-lead-gen.md +37 -21
  55. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +160 -118
  56. package/reference/scaffold/recipes/index.md +6 -3
  57. package/reference/scaffold/recipes/query-the-knowledge-graph.md +23 -23
  58. package/reference/scaffold/reference/contracts.md +30 -56
  59. package/reference/scaffold/reference/feature-registry.md +3 -0
  60. package/reference/scaffold/reference/glossary.md +4 -4
  61. package/reference/scaffold/reference/system-interface-capabilities.md +5 -4
  62. package/reference/scaffold/ui/composition-extensibility.mdx +271 -232
  63. package/reference/scaffold/ui/customization.md +2 -2
  64. package/reference/scaffold/ui/feature-flags-and-gating.md +14 -6
  65. package/reference/scaffold/ui/feature-shell.mdx +277 -62
  66. package/reference/scaffold/ui/recipes.md +229 -197
  67. package/reference/sdk/cli-management.mdx +166 -33
  68. package/reference/sdk/cli.mdx +90 -13
  69. package/reference/sdk/concepts.mdx +2 -0
  70. package/reference/sdk/define-builders.mdx +76 -0
  71. package/reference/sdk/deployment/command-center.mdx +6 -2
  72. package/reference/sdk/deployment/execution-reference.mdx +64 -186
  73. package/reference/sdk/deployment/index.mdx +2 -0
  74. package/reference/sdk/exports.mdx +4 -4
  75. package/reference/sdk/framework/agent.mdx +52 -116
  76. package/reference/sdk/framework/index.mdx +46 -65
  77. package/reference/sdk/framework/project-structure.mdx +150 -205
  78. package/reference/sdk/framework/tutorial-system.mdx +2 -2
  79. package/reference/sdk/human-in-the-loop.mdx +152 -0
  80. package/reference/sdk/index.mdx +6 -7
  81. package/reference/sdk/platform-tools/adapters-platform.mdx +3 -1
  82. package/reference/sdk/platform-tools/index.mdx +12 -0
  83. package/reference/sdk/platform-tools/type-safety.mdx +4 -0
  84. package/reference/sdk/project-deployment-spec.mdx +131 -0
  85. package/reference/sdk/resources/index.mdx +21 -7
  86. package/reference/sdk/resources/patterns.mdx +54 -24
  87. package/reference/sdk/resources/types.mdx +7 -4
  88. package/reference/sdk/templates/data-enrichment.mdx +7 -3
  89. package/reference/sdk/templates/email-sender.mdx +139 -135
  90. package/reference/sdk/templates/lead-scorer.mdx +5 -1
  91. package/reference/sdk/templates/pdf-generator.mdx +155 -151
  92. package/reference/sdk/templates/recurring-job.mdx +195 -189
  93. package/reference/sdk/templates/text-classifier.mdx +4 -0
  94. package/reference/sdk/templates/web-scraper.mdx +139 -135
  95. package/reference/spine/spine-primer.md +135 -96
  96. package/reference/ui/exports.mdx +1 -0
  97. package/reference/ui/index.mdx +14 -7
  98. package/dist/types/worker/adapters/anymailfinder.d.ts +0 -14
  99. package/dist/types/worker/adapters/apify.d.ts +0 -14
  100. package/dist/types/worker/adapters/approval.d.ts +0 -23
  101. package/dist/types/worker/adapters/attio.d.ts +0 -22
  102. package/dist/types/worker/adapters/clickup.d.ts +0 -22
  103. package/dist/types/worker/adapters/create-adapter.d.ts +0 -41
  104. package/dist/types/worker/adapters/crm.d.ts +0 -20
  105. package/dist/types/worker/adapters/dropbox.d.ts +0 -14
  106. package/dist/types/worker/adapters/email.d.ts +0 -25
  107. package/dist/types/worker/adapters/execution.d.ts +0 -22
  108. package/dist/types/worker/adapters/gmail.d.ts +0 -14
  109. package/dist/types/worker/adapters/google-sheets.d.ts +0 -14
  110. package/dist/types/worker/adapters/index.d.ts +0 -33
  111. package/dist/types/worker/adapters/instantly.d.ts +0 -14
  112. package/dist/types/worker/adapters/lead.d.ts +0 -28
  113. package/dist/types/worker/adapters/list.d.ts +0 -9
  114. package/dist/types/worker/adapters/llm.d.ts +0 -45
  115. package/dist/types/worker/adapters/millionverifier.d.ts +0 -14
  116. package/dist/types/worker/adapters/notification.d.ts +0 -28
  117. package/dist/types/worker/adapters/pdf.d.ts +0 -22
  118. package/dist/types/worker/adapters/projects.d.ts +0 -20
  119. package/dist/types/worker/adapters/resend.d.ts +0 -14
  120. package/dist/types/worker/adapters/scheduler.d.ts +0 -25
  121. package/dist/types/worker/adapters/signature-api.d.ts +0 -14
  122. package/dist/types/worker/adapters/storage.d.ts +0 -33
  123. package/dist/types/worker/adapters/stripe.d.ts +0 -14
  124. package/dist/types/worker/adapters/tomba.d.ts +0 -14
  125. package/dist/types/worker/index.d.ts +0 -60
  126. package/dist/types/worker/platform.d.ts +0 -90
  127. package/dist/types/worker/utils.d.ts +0 -9
  128. package/reference/claude-config/Overview.md +0 -230
  129. package/reference/claude-config/hooks/post-edit-validate.mjs +0 -98
  130. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +0 -187
  131. package/reference/claude-config/hooks/tool-failure-recovery.mjs +0 -73
  132. package/reference/claude-config/registries/graph-skills.json +0 -4
  133. package/reference/claude-config/registries/knowledge-flags.json +0 -154
  134. package/reference/claude-config/registries/skill-coverage.json +0 -20
  135. package/reference/claude-config/rules/active-change-index.md +0 -22
  136. package/reference/claude-config/rules/agent-start-here.md +0 -22
  137. package/reference/claude-config/rules/deployment.md +0 -22
  138. package/reference/claude-config/rules/error-handling.md +0 -22
  139. package/reference/claude-config/rules/execution.md +0 -22
  140. package/reference/claude-config/rules/frontend.md +0 -22
  141. package/reference/claude-config/rules/observability.md +0 -22
  142. package/reference/claude-config/rules/operations.md +0 -22
  143. package/reference/claude-config/rules/organization-model.md +0 -22
  144. package/reference/claude-config/rules/organization-os.md +0 -22
  145. package/reference/claude-config/rules/package-taxonomy.md +0 -22
  146. package/reference/claude-config/rules/platform.md +0 -22
  147. package/reference/claude-config/rules/shared-types.md +0 -22
  148. package/reference/claude-config/rules/task-tracking.md +0 -22
  149. package/reference/claude-config/rules/topbar-actions.md +0 -70
  150. package/reference/claude-config/rules/ui.md +0 -22
  151. package/reference/claude-config/rules/vibe.md +0 -22
  152. package/reference/claude-config/scripts/statusline-command.js +0 -18
  153. package/reference/claude-config/settings.json +0 -30
  154. package/reference/claude-config/skills/client/SKILL.md +0 -201
  155. package/reference/claude-config/skills/deploy/SKILL.md +0 -159
  156. package/reference/claude-config/skills/dsp/SKILL.md +0 -66
  157. package/reference/claude-config/skills/elevasis/SKILL.md +0 -251
  158. package/reference/claude-config/skills/explore/SKILL.md +0 -78
  159. package/reference/claude-config/skills/git-sync/SKILL.md +0 -166
  160. package/reference/claude-config/skills/om/SKILL.md +0 -475
  161. package/reference/claude-config/skills/om/operations/build.md +0 -237
  162. package/reference/claude-config/skills/om/operations/codify-level-a.md +0 -109
  163. package/reference/claude-config/skills/om/operations/codify-level-b.md +0 -159
  164. package/reference/claude-config/skills/om/operations/customers.md +0 -114
  165. package/reference/claude-config/skills/om/operations/features.md +0 -88
  166. package/reference/claude-config/skills/om/operations/goals.md +0 -123
  167. package/reference/claude-config/skills/om/operations/identity.md +0 -97
  168. package/reference/claude-config/skills/om/operations/labels.md +0 -110
  169. package/reference/claude-config/skills/om/operations/offerings.md +0 -114
  170. package/reference/claude-config/skills/om/operations/roles.md +0 -104
  171. package/reference/claude-config/skills/om/operations/scaffold.md +0 -163
  172. package/reference/claude-config/skills/om/operations/techStack.md +0 -38
  173. package/reference/claude-config/skills/project/SKILL.md +0 -1114
  174. package/reference/claude-config/skills/run-ui/SKILL.md +0 -73
  175. package/reference/claude-config/skills/save/SKILL.md +0 -183
  176. package/reference/claude-config/skills/setup/SKILL.md +0 -290
  177. package/reference/claude-config/skills/status/SKILL.md +0 -59
  178. package/reference/claude-config/skills/submit-request/SKILL.md +0 -180
  179. package/reference/claude-config/skills/sync/SKILL.md +0 -47
  180. package/reference/claude-config/skills/tutorial/SKILL.md +0 -259
  181. package/reference/claude-config/skills/tutorial/progress-template.md +0 -74
  182. package/reference/claude-config/skills/tutorial/technical.md +0 -1303
  183. package/reference/claude-config/skills/tutorial/vibe-coder.md +0 -890
  184. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +0 -27
  185. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +0 -30
  186. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +0 -73
  187. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +0 -86
  188. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +0 -55
  189. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +0 -97
  190. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +0 -112
  191. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +0 -93
  192. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +0 -58
  193. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +0 -56
  194. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +0 -71
  195. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +0 -83
  196. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +0 -59
  197. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +0 -42
  198. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +0 -60
  199. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +0 -37
  200. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +0 -34
  201. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +0 -38
  202. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +0 -32
  203. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +0 -33
  204. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +0 -69
  205. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +0 -30
  206. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +0 -45
  207. package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +0 -52
  208. package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +0 -33
  209. package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +0 -32
  210. package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +0 -43
  211. package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +0 -40
  212. package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +0 -61
  213. package/reference/claude-config/sync-notes/2026-05-23-branding-names-to-identity.md +0 -49
  214. package/reference/claude-config/sync-notes/2026-05-23-lead-gen-manage-access.md +0 -31
  215. package/reference/claude-config/sync-notes/2026-05-23-om-deployment-drift-detection.md +0 -42
  216. package/reference/claude-config/sync-notes/2026-05-23-om-full-model-deploy-contract.md +0 -33
  217. package/reference/claude-config/sync-notes/2026-05-23-ui-sdk-package-fixes.md +0 -37
  218. package/reference/claude-config/sync-notes/2026-05-24-platform-invite-router-core-baseline.md +0 -28
  219. package/reference/claude-config/sync-notes/2026-05-24-system-interface-readiness.md +0 -43
  220. package/reference/claude-config/sync-notes/2026-05-25-invitation-login-loader.md +0 -26
  221. package/reference/claude-config/sync-notes/2026-05-25-om-topbar-requests.md +0 -33
  222. package/reference/claude-config/sync-notes/2026-05-25-system-interface-profile-registry-and-substrate.md +0 -35
  223. package/reference/claude-config/sync-notes/2026-05-25-tenant-om-scaffold-cli.md +0 -49
  224. package/reference/claude-config/sync-notes/2026-05-25-vibe-operate-intent.md +0 -47
  225. package/reference/claude-config/sync-notes/2026-05-28-om-snapshot-sdk-workflow-config.md +0 -33
  226. package/reference/claude-config/sync-notes/2026-05-30-client-source-and-om-profiles.md +0 -39
  227. package/reference/claude-config/sync-notes/2026-06-02-knowledge-nested-group-routing.md +0 -27
  228. package/reference/claude-config/sync-notes/2026-06-02-nest-projects-under-platform.md +0 -45
  229. package/reference/claude-config/sync-notes/2026-06-03-skill-autogen-and-client-skill.md +0 -34
  230. package/reference/claude-config/sync-notes/2026-06-04-scaffold-registry-lane-severity.md +0 -34
  231. package/reference/claude-config/sync-notes/2026-06-05-appearance-app-mode-decouple.md +0 -29
  232. package/reference/claude-config/sync-notes/2026-06-05-ontology-endpoint-rename-and-knowledge-browser-ui.md +0 -86
  233. package/reference/claude-config/sync-notes/2026-06-06-om-build-systems-scaffold.md +0 -47
  234. package/reference/claude-config/sync-notes/2026-06-06-om-item-copy-references.md +0 -50
  235. package/reference/claude-config/sync-notes/2026-06-08-knowledge-base-page-not-found-fix.md +0 -76
  236. package/reference/claude-config/sync-notes/2026-06-09-agent-sessions-public-agent-chat-route.md +0 -75
  237. package/reference/claude-config/sync-notes/2026-06-09-sdk-cli-load-org-model-resolution.md +0 -42
  238. package/reference/claude-config/sync-notes/2026-06-12-agent-grants-visualizer-operations.md +0 -30
  239. package/reference/claude-config/sync-notes/2026-06-14-session-ux-and-project-cli-json.md +0 -33
  240. package/reference/claude-config/sync-notes/2026-06-14-shared-session-conversation-view.md +0 -26
  241. package/reference/claude-config/sync-notes/2026-06-15-session-chat-zero-wiring.md +0 -46
  242. package/reference/claude-config/sync-notes/2026-06-17-agent-session-ux-features.md +0 -34
  243. package/reference/claude-config/sync-notes/2026-06-25-shared-page-scroll-contract-guard.md +0 -52
  244. package/reference/claude-config/sync-notes/2026-06-26-leadgen-overview-om-telemetry.md +0 -47
  245. package/reference/claude-config/sync-notes/2026-07-21-agent-scaffold-hardening.md +0 -75
  246. package/reference/claude-config/sync-notes/2026-07-23-agent-session-memory.md +0 -49
  247. package/reference/claude-config/sync-notes/2026-07-23-workos-org-marker.md +0 -50
  248. package/reference/claude-config/sync-notes/2026-07-24-claude-5-models-and-session-surface-fixes.md +0 -116
  249. package/reference/claude-config/sync-notes/2026-07-27-agent-strict-output-and-turn-drift.md +0 -73
  250. package/reference/claude-config/sync-notes/2026-07-28-agent-reply-is-its-own-field.md +0 -84
  251. package/reference/claude-config/sync-notes/2026-07-30-login-screen-and-member-provisioning-state.md +0 -114
  252. package/reference/claude-config/sync-notes/2026-08-02-auth-guard-defaults-and-truncation-fix.md +0 -122
  253. package/reference/claude-config/sync-notes/2026-08-03-agent-prose-escape-normalization.md +0 -88
  254. package/reference/claude-config/sync-notes/2026-08-03-cli-gateway-errors-and-request-timeout.md +0 -120
  255. package/reference/claude-config/sync-notes/README.md +0 -43
  256. package/reference/sdk/framework/interaction-guidance.mdx +0 -182
  257. package/reference/sdk/framework/memory.mdx +0 -326
  258. package/reference/sdk/framework/resource-documentation.mdx +0 -90
  259. package/reference/sdk/roadmap.mdx +0 -164
@@ -1,27 +0,0 @@
1
- # Git Sync And Sync Notes Workflow
2
-
3
- ## Why this note exists
4
-
5
- The template now ships a dedicated `/git-sync` command and a `.claude/sync-notes/` contract for downstream release guidance. This separates plain git transport from manual template reconciliation work.
6
-
7
- ## Applies to
8
-
9
- All template-derived projects that pull this train and previously relied on `/sync` for pull-plus-reinstall behavior.
10
-
11
- ## Required actions
12
-
13
- - Use `/git-sync` for future release-train pulls so new sync notes are surfaced automatically
14
- - Keep using `/sync` only for local cache resets or fresh reinstalls when git transport is not part of the task
15
- - Read any newly introduced note file after `/git-sync` and apply the listed manual follow-up before considering the update complete
16
-
17
- ## Verification
18
-
19
- - Run `/git-sync`
20
- - Confirm it reports this note as newly introduced on the first pull that contains it
21
- - Confirm the baseline verification flow passes or follow the reported failure
22
-
23
- ## Not handled by /git-sync
24
-
25
- - registry/template reconciliation
26
- - project-specific migration edits
27
- - conflict resolution in project-owned files
@@ -1,30 +0,0 @@
1
- # Lead Gen Deliverability Page Removal
2
-
3
- ## Why this note exists
4
-
5
- `LeadGenDeliverabilityPage` has been removed from the published `@elevasis/ui` package. The deliverability route and sidebar nav item were removed from the shared lead-gen surface. Template-derived projects that still import or route to this page will fail to compile after pulling this train.
6
-
7
- ## Applies to
8
-
9
- All template-derived projects that use the lead-gen feature and have a `ui/src/routes/lead-gen/deliverability.tsx` route file or a deliverability entry in their lead-gen sidebar.
10
-
11
- Known affected projects: `nirvana-marketing`, `ZentaraHQ`.
12
-
13
- ## Required actions
14
-
15
- 1. Delete `ui/src/routes/lead-gen/deliverability.tsx` — this file is completely removed (no redirect replacement).
16
- 2. Remove the deliverability nav item from any project-local lead-gen sidebar overrides that reference it by ID or label.
17
- 3. Remove any import of `LeadGenDeliverabilityPage` from route trees, lazy-loaded chunks, or custom page wrappers.
18
- 4. Regenerate the TanStack Router route tree (`pnpm -C ui exec tsr generate` or equivalent) after removing the route file so the generated routeTree no longer references the deleted route.
19
- 5. Run `pnpm -C ui build` to confirm the build is clean.
20
-
21
- ## Verification
22
-
23
- - `pnpm -C ui build` passes with no import or route errors.
24
- - Navigating to `/lead-gen` works; navigating to `/lead-gen/deliverability` either 404s or redirects as expected by the project's router config.
25
-
26
- ## Not handled by /git-sync
27
-
28
- - `/git-sync` pulls the template source change (removal of `deliverability.tsx` from `_template/ui/src/routes/lead-gen/`), but it does not automatically delete project-owned route files that still import `LeadGenDeliverabilityPage`.
29
- - Any project-local sidebar override that hard-references the deliverability nav entry must be manually cleaned up.
30
- - The route tree regeneration step must be run manually after route file removal.
@@ -1,73 +0,0 @@
1
- # Test Utils And Template Tests
2
-
3
- ## Why this note exists
4
-
5
- This update adds meaningful package, template, and downstream test coverage while keeping ownership boundaries clear. Package-owned contracts live in package tests/test-utils; `_template` keeps scaffold smoke tests and examples; downstream projects keep custom tests for project-specific workflows and routes.
6
-
7
- The new package-level test-utils subpaths are being prepared in the monorepo packages:
8
-
9
- - `@elevasis/core/test-utils`
10
- - `@elevasis/ui/test-utils`
11
- - `@elevasis/sdk/test-utils`
12
-
13
- Until the bundled release train publishes those expanded package surfaces, `_template` keeps small local compatibility wrappers for tests that need the new helpers. Do not replace those wrappers with local `file:` dependencies.
14
-
15
- ## Applies to
16
-
17
- All template-derived projects that sync from `external/_template`.
18
-
19
- Known affected projects: `nirvana-marketing`, `ZentaraHQ`.
20
-
21
- ## Required actions
22
-
23
- ### Step 1 -- Pull template changes via `/git-sync`
24
-
25
- Accept the new tests under sync-managed scaffold surfaces:
26
-
27
- - `ui/src/routes/__tests__/`
28
- - `core/types/**`
29
- - `core/config/**`
30
- - local core compatibility helpers under `core/test-utils/`
31
-
32
- Operations tests are intentionally narrower. Treat `operations/src/**` as project-owned runtime code. Only keep or add Operations tests in a downstream project when the project owns the workflow/module being tested. The template's email-notification tests are examples, not a requirement for every derived project.
33
-
34
- ### Step 2 -- Run the expanded test chain
35
-
36
- From project root:
37
-
38
- ```bash
39
- pnpm test
40
- ```
41
-
42
- The root test script now runs `operations check` between UI and operations tests so resource-registry drift fails during ordinary test runs.
43
-
44
- ### Step 3 -- Keep compatibility wrappers until the bundled release lands
45
-
46
- Do not delete any local compatibility wrapper that is still used by a project-owned custom test until the project has upgraded to package versions that publish the expanded test-utils subpaths.
47
-
48
- After the release train lands, projects can migrate local compatibility imports to:
49
-
50
- ```ts
51
- import { renderWithProviders } from '@elevasis/ui/test-utils'
52
- import { makeProject } from '@elevasis/core/test-utils'
53
- import { runWorkflow } from '@elevasis/sdk/test-utils'
54
- ```
55
-
56
- ### Step 4 -- Adjust only for intentionally removed features
57
-
58
- If a derived project intentionally removed a feature route or workflow, skip or adjust the specific synced test case. For Operations, prefer project-owned tests that import package helpers over copied template workflow tests.
59
-
60
- ## Verification
61
-
62
- - `pnpm -C ui test` passes.
63
- - `pnpm -C operations check` passes.
64
- - `pnpm -C operations test` passes.
65
- - `pnpm -C core test` passes.
66
- - `pnpm test` passes from project root.
67
-
68
- ## Not handled by /git-sync
69
-
70
- - `/git-sync` does not publish or upgrade `@elevasis/*` package versions.
71
- - `/git-sync` does not remove compatibility wrappers after the release train.
72
- - `/git-sync` does not decide how a project-specific removed feature should be represented in tests.
73
- - `/git-sync` does not force template-only Operations example tests into downstream projects that do not own the matching workflow files.
@@ -1,86 +0,0 @@
1
- # UI Consolidation And SDK CLI Train
2
-
3
- ## Why this note exists
4
-
5
- This release train combines three changes that affect derived projects after `pnpm up`:
6
-
7
- 1. `@elevasis/ui` 2.18.x consolidates previously-duplicated template surface (hooks, components, constants, utilities, test-utils, org-model examples) into the published package. Files that lived in `_template/ui/src/lib/**`, `_template/ui/src/test-utils/**`, and `_template/scripts/use-*-ui.mjs` are deleted from the template and re-exported from `@elevasis/ui`. A `useDeleteRequest` hook and a rollup dts fix also land in this `@elevasis/ui` version.
8
- 2. `@elevasis/sdk` hardens project-root and CWD resolution in the `elevasis-sdk` CLI. Unsupported invocation directories now fail fast with a clear error instead of silently using `process.cwd()`.
9
- 3. `@elevasis/sdk` + `@elevasis/core` + `@elevasis/ui` close three `project:*` / `request:submit` CLI gaps: `--description` on `project:milestone:update`, `agent_learning` note-type enum alignment between `/project` skill docs and the server, and enum values surfaced in `request:submit --help`.
10
-
11
- ## Applies to
12
-
13
- All template-derived projects that:
14
-
15
- - import from `@elevasis/ui` (nearly all of them),
16
- - run the `elevasis-sdk` CLI from any project directory (all of them),
17
- - invoke `project:milestone:update`, `project:note:create --type agent_learning`, or `request:submit`.
18
-
19
- Known affected projects: `nirvana-marketing`, `ZentaraHQ`.
20
-
21
- ## Required actions
22
-
23
- ### Step 1 -- Pull the train via `/git-sync`
24
-
25
- `/git-sync` surfaces this note and applies template-source changes (deletions of `ui/src/lib/**`, `ui/src/test-utils/**`, `scripts/use-*-ui.mjs`).
26
-
27
- ### Step 2 -- Update package dependencies
28
-
29
- Run from project root:
30
-
31
- ```
32
- pnpm up @elevasis/ui @elevasis/core @elevasis/sdk --latest
33
- ```
34
-
35
- Dep bumps are already written into `_template/ui/package.json`, `_template/operations/package.json`, and `_template/core/package.json` by the release train (`@elevasis/core` ^0.9.0, `@elevasis/ui` ^2.19.0, `@elevasis/sdk` ^1.9.0).
36
-
37
- ### Step 3 -- Replace inlined type defs with package imports
38
-
39
- Projects that copied the Phase-1 workaround carry six inlined symbols in `ui/src/lib/platform-utils.ts` that should now come from `@elevasis/ui`:
40
-
41
- - `CredentialSchema`, `CredentialField`, `OAuthProviderConfig`, `OAuthToken`, `OAuthState` -> `@elevasis/ui/types`
42
- - `DOMAIN_MAP` -> `@elevasis/ui/utils`
43
-
44
- Delete the inlined copies and replace with named imports from the appropriate subpaths. After the edit, `ui/src/lib/platform-utils.ts` should only contain Elevasis-specific symbols and the new imports.
45
-
46
- ### Step 4 -- Re-verify `elevasis-sdk` invocations
47
-
48
- From any dir you routinely invoke the SDK CLI, run:
49
-
50
- ```
51
- pnpm exec elevasis-sdk doctor
52
- ```
53
-
54
- If the command fails with a "no `.elevasis` marker reachable" error, re-run from a supported directory (project root, `operations/`, or any nested path under a valid project). Previously-silent misfires now surface as hard errors; this is intentional.
55
-
56
- ### Step 5 -- Audit `project:note:create --type agent_learning` call sites
57
-
58
- If any project scripts or agent prompts call `project:note:create --type agent_learning`, verify they match the server enum decision (the train either adds `agent_learning` to the enum or strips it from `/project` skill docs -- check the landed behavior in `pnpm exec elevasis-sdk project:note:create --help` and in the project's synced `/project` SKILL).
59
-
60
- ### Step 6 -- Rebuild and type-check
61
-
62
- Run from project root:
63
-
64
- ```
65
- pnpm -C ui build
66
- pnpm -C ui exec tsc --noEmit
67
- pnpm -C operations exec tsc --noEmit
68
- ```
69
-
70
- All three must pass before the update is complete.
71
-
72
- ## Verification
73
-
74
- - `pnpm up` completes cleanly.
75
- - `ui/src/lib/platform-utils.ts` contains no inlined `CredentialSchema | CredentialField | OAuthProviderConfig | OAuthToken | OAuthState | DOMAIN_MAP` definitions -- only imports from `@elevasis/ui`.
76
- - `pnpm -C ui exec tsc --noEmit` passes with no missing-module errors for `@elevasis/ui/hooks`, `@elevasis/ui/components`, `@elevasis/ui/constants`, `@elevasis/ui/utils`, `@elevasis/ui/test-utils`.
77
- - `pnpm exec elevasis-sdk doctor` reports project root correctly from the directories you use.
78
- - `pnpm exec elevasis-sdk project:milestone:update --help` lists `--description`.
79
- - `pnpm exec elevasis-sdk request:submit --help` shows enum values for `--type`, `--category`, `--severity`.
80
-
81
- ## Not handled by /git-sync
82
-
83
- - `/git-sync` does not run `pnpm up` -- Step 2 is manual.
84
- - `/git-sync` does not rewrite project-owned `ui/src/lib/platform-utils.ts` -- the inlined-to-imports swap in Step 3 is manual per project.
85
- - `/git-sync` does not validate SDK CLI behavior from project terminals -- Step 4 verification is manual.
86
- - Any project-local override that hard-references the deleted `_template/ui/src/lib/**` paths must be cleaned up manually.
@@ -1,55 +0,0 @@
1
- # Auth Role System And Settings Roles
2
-
3
- ## Why this note exists
4
-
5
- The Org OS default surface now includes `settings.roles` at `/settings/roles`. Template-derived projects that update to the matching `@elevasis/core` release will receive the Settings navigation entry, so the template now ships a self-view route for members to see their current role and effective permission groups.
6
-
7
- This route depends on the published `@elevasis/ui` provider/layout/auth exports that the template already uses, plus the backend role and permission endpoints introduced by the same release train. The release train also publishes reusable role hooks and primitives for custom app code that wants the richer role-management surfaces.
8
-
9
- ## Applies to
10
-
11
- All template-derived projects that sync from `external/_template` and update to the auth role system release train.
12
-
13
- This is especially relevant for projects that expose the default Settings navigation from `@elevasis/core` organization-model surfaces or run a project-local organization model derived from those defaults.
14
-
15
- ## Required actions
16
-
17
- 1. Pull template changes with `/git-sync` so `ui/src/routes/settings/roles.tsx` is available.
18
- 2. Update project packages after the release train is published:
19
-
20
- ```bash
21
- pnpm up @elevasis/core @elevasis/ui --latest
22
- ```
23
-
24
- 3. Confirm the project API target is deployed to a backend version that includes the auth role endpoints used by the published UI hooks:
25
-
26
- - `GET /permissions/catalog`
27
- - `GET /memberships/my-permissions/:orgId`
28
- - role-management endpoints under `/organizations/:orgId/roles`
29
- - membership role and effective-permission endpoints under `/memberships/:membershipId`
30
-
31
- 4. Rebuild any project-local route tree artifacts if your project does not regenerate TanStack Router routes during normal dev/build startup.
32
-
33
- ## Verification
34
-
35
- Run from the project root after package updates and backend deployment:
36
-
37
- ```bash
38
- pnpm -C ui check-types
39
- pnpm -C ui build
40
- ```
41
-
42
- Then sign in to the UI, open `/settings/roles`, and verify:
43
-
44
- - the page is protected for authenticated organization members,
45
- - the current membership role badge is visible,
46
- - grouped effective permissions render,
47
- - permission descriptions load from the catalog endpoint,
48
- - no Settings navigation item points to a missing route.
49
-
50
- ## Not handled by /git-sync
51
-
52
- - `/git-sync` does not publish or upgrade `@elevasis/core` or `@elevasis/ui`.
53
- - `/git-sync` does not deploy the API/backend version that serves the role and permission endpoints.
54
- - `/git-sync` does not reconcile project-owned organization-model overrides that intentionally remove or rename Settings surfaces.
55
- - `/git-sync` does not validate downstream auth state, role assignments, or production API connectivity.
@@ -1,97 +0,0 @@
1
- # CRM HITL Action Layer Cutover
2
-
3
- ## Why this note exists
4
-
5
- The Elevasis platform completed an atomic cutover of `acq_deals` from the legacy `cached_stage` + `proposal_status` model to the canonical `pipeline_key` / `stage_key` / `state_key` runtime fields. The release train that ships this cutover bumps `@elevasis/core`, `@elevasis/ui`, and `@elevasis/sdk` together, and rewires server-side lifecycle to flow through a single `transitionItem()` boundary in the API.
6
-
7
- Concretely, this train introduces:
8
-
9
- - a flat `ActivityEventSchema` discriminated union on `@elevasis/core/business/acquisition` (replaces the older `DealActivityEntry` shape; activity rows now use fields like `stageBefore`, `stageAfter`, `stateBefore`, `stateAfter`, `taskId`, `timestamp`)
10
- - a pure `deriveActions(deal)` helper on `@elevasis/core/business/acquisition` (UI/API action derivation from current deal state)
11
- - new typed CRM hooks on `@elevasis/ui` (`useTransitionItem`, refreshed `useSyncDealStage`, kanban + deal-drawer wiring)
12
- - canonical `transitionItem(dealId, organizationId, pipelineKey, stageKey, stateKey?, reason?, expectedUpdatedAt?)` as the single lifecycle mutation; server-side it appends activity, supersedes open command-queue rows, and closes incompatible tasks atomically
13
- - a `command_queue`-backed HITL transport supersession lifecycle resolved by `resolveDealCommandQueue` (called inside `transitionItem`)
14
-
15
- Derived projects that read or write `acq_deals` directly, render the CRM kanban from `@elevasis/ui`, or import acquisition types from `@elevasis/core` will pick up these contract changes when they upgrade through this train.
16
-
17
- ## Applies to
18
-
19
- All template-derived projects that:
20
-
21
- - consume `@elevasis/core/business/acquisition` types (`Deal`, `ActivityEvent`, action types) or import `deriveActions`
22
- - render the CRM kanban / deal drawer surfaces from `@elevasis/ui`
23
- - have a project-local `acq_deals` table that mirrors the platform schema
24
- - author workflows under `operations/src/sales/crm/**` that call `acqDb.transitionItem(...)` (or formerly called `syncDealStage` / direct stage writes)
25
- - read `activity_log` rows on deals and pattern-match on event shape
26
-
27
- Operations-only projects with no CRM surface and no `acq_deals` table can ignore this train.
28
-
29
- ## Required actions
30
-
31
- 1. Pull template changes with `/git-sync` so the refreshed CRM hook + drawer/kanban consumers are available.
32
-
33
- 2. After the release train is published, update package versions in the project:
34
-
35
- ```bash
36
- pnpm up @elevasis/core @elevasis/ui @elevasis/sdk --latest
37
- ```
38
-
39
- 3. If your project has a project-local `acq_deals` table, run a matching atomic cutover migration. The reference SQL that drove the monorepo cutover (preflight, outlier cleanup, atomic cutover, postflight) is no longer checked into the repo -- recover it from git history under `apps/docs/content/docs/in-progress/active-development/sdk-changes/org-model/_sql/` (deleted 2026-04-27 alongside the completed task doc) if you need a starting point.
40
-
41
- The cutover is single-shot, not dual-write. Backfill `pipeline_key` / `stage_key` from `cached_stage` and drop the legacy columns in the same transaction. There is no mid-flight rollback path; fix-forward only. Confirm prod deal volume is small enough to accept that tradeoff before applying.
42
-
43
- 4. Replace any direct stage writes with `acqDb.transitionItem(...)`:
44
- - workflow code that previously called `syncDealStage`, `updateDeal({ cached_stage: ... })`, or wrote `proposal_status` directly must now route through `transitionItem`
45
- - the API server injects `organizationId` from execution context — never pass `organizationId` from worker payload
46
- - the platform-side method appends `ActivityEventSchema`-shaped events; do NOT also write activity rows from the workflow side
47
-
48
- 5. If you read `activity_log` and pattern-match by `type`, update consumers to the flat schema:
49
-
50
- ```ts
51
- // Stage change
52
- { type: 'stage_change', timestamp, stageBefore, stageAfter, reason? }
53
-
54
- // State change
55
- { type: 'state_change', timestamp, stateBefore, stateAfter, reason? }
56
-
57
- // Task created
58
- { type: 'task_created', timestamp, taskId }
59
-
60
- // Approval resolved (written by resolveDealCommandQueue)
61
- { type: 'approval_resolved', timestamp, ... }
62
- ```
63
-
64
- The legacy `{ type, title, payload, occurredAt }` envelope is gone.
65
-
66
- 6. If your project deploys SDK resources, redeploy `operations` after the package upgrades so workers pick up the new typed adapter surface and ToolMap entries:
67
-
68
- ```bash
69
- pnpm -C operations exec elevasis-sdk deploy --prod
70
- ```
71
-
72
- ## Verification
73
-
74
- Run from the project root after package updates and any DB migration:
75
-
76
- ```bash
77
- pnpm -C ui check-types
78
- pnpm -C ui build
79
- pnpm -C operations check-types
80
- pnpm -C operations exec elevasis-sdk check
81
- ```
82
-
83
- Then exercise the CRM surface:
84
-
85
- - open the deal kanban — drag a deal between stages; confirm the activity log shows a flat `stage_change` event with `stageBefore` / `stageAfter`
86
- - open a deal drawer — confirm available actions render from `deriveActions(deal)` and not from a stored `available_actions` array
87
- - if you have a HITL approval surface, confirm that completing or superseding an approval lands an `approval_resolved` activity event before any subsequent state change
88
-
89
- If a workflow that historically wrote stage updates throws Zod errors against `ActivityEventSchema`, it is still on the legacy envelope — fix-forward by routing it through `acqDb.transitionItem(...)`.
90
-
91
- ## Not handled by /git-sync
92
-
93
- - `/git-sync` does not publish or upgrade `@elevasis/core`, `@elevasis/ui`, or `@elevasis/sdk`.
94
- - `/git-sync` does not run the project-local `acq_deals` cutover migration. The DB cutover is atomic and irreversible — only the project owner can authorize it.
95
- - `/git-sync` does not redeploy the project's `operations` bundle to dev or prod.
96
- - `/git-sync` does not rewrite project-owned workflow code that bypasses `transitionItem` to write stage / state directly.
97
- - `/git-sync` does not reconcile project-owned `activity_log` consumers that still pattern-match on the legacy `DealActivityEntry` envelope.
@@ -1,112 +0,0 @@
1
- # Lead-Gen Substrate Train (Tracks A + B + C)
2
-
3
- > **PARTIAL SUPERSEDE — 2026-04-29.** Track A's `acq_touchpoints` table and all `recordTouchpoint` / `listDealTouchpoints` helpers were removed end-to-end on 2026-04-28/29. Replacement substrate for outreach event audit is `acq_deals.activity_log` (JSONB) appended via `acqDb.recordDealActivity`. Replacement substrate for thread context (Instantly thread UUIDs) is the same `activity_log` — `reply_received` entries now carry thread fields in their payload. Ignore every touchpoint-flavored instruction in this note (table creation, hooks, UI tabs, writers, verification). The `acq_artifacts` table and ICP rubric columns from Track A remain valid. Track B + Track C non-touchpoint content remains valid.
4
-
5
- ## Why this note exists
6
-
7
- This release train ships the Lead-Gen Substrate Generalization across three coordinated tracks:
8
-
9
- - **Track A — Additive Primitives.** New `acq_artifacts` (versioned content: audit PDFs, email drafts, etc.) and `acq_touchpoints` (append-only outreach event log) tables, plus ICP rubric columns (`qualification_score numeric`, `qualification_signals jsonb`, `qualification_rubric_key text`) on `acq_companies` and `acq_contacts`. Purely additive schema — no column drops on these entities.
10
- - **Track B — Stateful Trait Generalization.** The `(pipeline_key, stage_key, state_key, activity_log)` quartet from the CRM HITL deal cutover is now applied to `acq_lists`, `acq_list_members`, and `acq_list_companies`. Legacy `acq_lists.status`, `acq_list_*.stage`, and `acq_list_*.stage_updated_at` columns are dropped. `acq_companies` and `acq_contacts` are explicitly **excluded** (batch-ETL pattern, not state-machine).
11
- - **Track C — Campaign Creator UI.** `@elevasis/ui` ships a hooks layer (`useArtifacts`, `useCreateArtifact`, `useTouchpoints`, `useListMembers`, `useListMember`, `useTransitionList`, `useTransitionListMember`, `useTransitionListCompany`, `useDeriveActions`) plus upgraded `LeadGenListsPage` and `LeadGenListDetailPage` (5-tab layout: Overview / Members / Activity / Artifacts / Touchpoints) and a `ListMemberDrawer` deep-linkable via `?member=<id>&memberKind=<contact|company>`.
12
-
13
- Concretely, this train introduces:
14
-
15
- - a `Stateful` interface + `StatefulSchema` Zod object + generic `TransitionItem<T,TEvent>` / `DeriveActions<T,TAction>` type aliases at `@elevasis/core/business/acquisition/stateful`
16
- - three `StatefulPipelineDefinition` constants on `@elevasis/core/organization-model` — `ACQ_LISTS_LEAD_GEN_PIPELINE` (single stage `lifecycle` with five states: draft / enriching / launched / closing / archived), `ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE`, `ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE` — plus `findPipeline()` helper and `LEAD_GEN_PIPELINE_DEFINITIONS` map
17
- - API routes `GET/POST /acquisition/artifacts`, `GET /acquisition/touchpoints`, `GET /acquisition/lists/:listId/members`, `GET /acquisition/list-members/:memberId`, `PATCH /acquisition/lists/:listId/transition`, `PATCH /acquisition/list-members/:memberId/transition`, `PATCH /acquisition/list-companies/:listCompanyId/transition`
18
- - new flat columns on `acq_artifacts` / `acq_touchpoints` / `acq_lists` / `acq_list_members` / `acq_list_companies` and ICP rubric columns on `acq_companies` / `acq_contacts`
19
-
20
- ## Applies to
21
-
22
- All template-derived projects that:
23
-
24
- - consume `@elevasis/core/business/acquisition` types or import the `Stateful` trait / `LEAD_GEN_PIPELINE_DEFINITIONS`
25
- - render the lead-gen lists / list-detail / Campaign Creator surfaces from `@elevasis/ui/features/lead-gen`
26
- - have a project-local `acq_*` schema that mirrors the platform tables (artifacts, touchpoints, lists, list-members, list-companies)
27
- - author workflows under `operations/src/sales/{outreach,prospecting,qualification}/**` that read or write the `acq_lists` / `acq_list_members` / `acq_list_companies` lifecycle columns, or that produce email drafts / audit content / outreach events
28
- - read `acq_companies.qualification_score` / `qualification_signals` / `qualification_rubric_key`, or the parallel columns on `acq_contacts`
29
-
30
- Operations-only projects with no lead-gen surface and no `acq_*` tables can ignore this train.
31
-
32
- ## Required actions
33
-
34
- 1. Pull template changes with `/git-sync` so the refreshed lead-gen hook surface, `LeadGenListsPage` upgrades, and `ListMemberDrawer` deep-link wiring are available.
35
-
36
- 2. After the release train is published, update package versions in the project:
37
-
38
- ```bash
39
- pnpm up @elevasis/core @elevasis/ui @elevasis/sdk --latest
40
- ```
41
-
42
- 3. If your project has project-local `acq_*` tables, run additive + cutover migrations:
43
- - **Additive (Track A — safe to apply standalone):** `acq_artifacts` and `acq_touchpoints` table creation (canonical 3-policy RLS — `Platform admins have full access to <table>` / `Org members with acquisition.manage can manage <table>` / `Org members can view <table>`). ICP columns added to `acq_companies` and `acq_contacts` (`qualification_score numeric`, `qualification_signals jsonb`, `qualification_rubric_key text`, all nullable).
44
- - **Stateful trait (Track B — atomic cutover, not dual-write):** add `pipeline_key text NOT NULL`, `stage_key text NOT NULL`, `state_key text NOT NULL`, `activity_log jsonb NOT NULL DEFAULT '[]'` to `acq_lists` / `acq_list_members` / `acq_list_companies`; drop `acq_lists.status`, `acq_list_members.{stage,stage_updated_at}`, `acq_list_companies.{stage,stage_updated_at}` in the same transaction.
45
- - **Backfill values used in the platform cutover:** `acq_lists` -> `pipeline_key='lead-gen'`, `stage_key='lifecycle'`, `state_key=coalesce(status,'draft')`. `acq_list_members` and `acq_list_companies` -> `pipeline_key='lead-gen'`, `stage_key='outreach'`, `state_key=coalesce(stage,'pending')` (preserves `personalized` / `verified` / `discovered` / `qualified` / `populated` / `extracted` vocabularies losslessly).
46
- - The cutover is single-shot. Confirm prod row counts on these tables are small enough to accept fix-forward semantics before applying.
47
-
48
- 4. Replace any direct lifecycle writes on lists / list-members / list-companies with the new transition surface:
49
- - workflow code that previously wrote `acq_lists.status`, `acq_list_members.stage`, or `acq_list_companies.stage` directly must now route through `acqDb.transitionList(...)` / `transitionListMember(...)` / `transitionListCompany(...)`
50
- - the API server injects `organizationId` from execution context — never pass `organizationId` from worker payload
51
- - the platform-side methods append `ActivityEventSchema`-shaped events to `activity_log`; do NOT also write activity rows from the workflow side
52
-
53
- 5. Replace `enrichmentData.pipeline.{auditDoc, touchpointCount, lastReply}` writers with `acq_artifacts` / `acq_touchpoints` writes:
54
- - audit PDFs / email drafts / proposals -> `acq_artifacts(kind='audit'|'email_draft'|'proposal', owner_kind='company'|'contact'|'list'|'list_member', version=N, content=<jsonb>, source_execution_id=<execution>)`
55
- - outreach events -> `acq_touchpoints(direction='outbound'|'inbound', channel='email'|'linkedin'|'sms', kind='initial'|'followup'|'reply'|'nudge', occurred_at=<ts>, payload=<jsonb>, artifact_id=<linked draft>, source_execution_id=<execution>)`
56
- - `pipeline_status.pipelineStatus` text enum on `acq_companies` is **untouched** (out of trait scope per Decision B1) — that JSONB key remains canonical for company-level state
57
-
58
- 6. Adopt the qualification rubric columns:
59
- - LLM qualifiers should write `acq_companies.qualification_score` / `qualification_signals` (jsonb shape: `{ status: 'complete' | 'pending' | ..., result?: ..., reason?: ..., completedAt?: ... }`) and stop writing `pipeline_status.qualification`
60
- - readers (e.g. `fetch-companies` filters in email-discovery / company-qualification workflows) should use `qualificationSignals?.status === 'complete'` instead of `pipeline_status.qualification?.status`
61
- - `qualification_rubric_key` is a free-form text key today; an Org OS rubric registry may land in a later train without a schema change
62
-
63
- 7. If you read `activity_log` rows on lists / list-members / list-companies and pattern-match by `type`, mirror the flat schema already used for `acq_deals`:
64
-
65
- ```ts
66
- { type: 'state_change', timestamp, stateBefore, stateAfter, reason? }
67
- { type: 'stage_change', timestamp, stageBefore, stageAfter, reason? }
68
- { type: 'task_created', timestamp, taskId }
69
- ```
70
-
71
- 8. If you ship lead-gen UI from `@elevasis/ui/features/lead-gen`, the `lists.tsx` and `list-detail.tsx` pages now expect:
72
- - `state_key` badge column resolved via `findPipeline('acq.list')` from `LEAD_GEN_PIPELINE_DEFINITIONS`
73
- - ICP rubric column reading `list.config.qualification.qualificationRubricKey` (em-dash when absent)
74
- - `stateKeyFilter` Select chip in the FilterBar (options sourced from `ACQ_LISTS_LEAD_GEN_PIPELINE.stages[0].states`)
75
- - 5-tab detail layout (Overview / Members / Activity / Artifacts / Touchpoints) plus action toolbar fed by `useDeriveActions(list)`
76
- - Row-click navigation on the Members tab via `window.history.pushState`, with `useSearch({ strict: false })` reading `?member=<id>&memberKind=<contact|company>` to drive `ListMemberDrawer`
77
- - For the `?member=` deep-link to be typed, add `validateSearch` to the project's `routes/lead-gen/lists.$listId.tsx` route file (optional; the drawer reads search params untyped via `strict: false`)
78
-
79
- 9. Redeploy `operations` after the package upgrades so workers pick up the new typed adapter surface, the artifact/touchpoint writers, and the qualification column writes:
80
-
81
- ```bash
82
- pnpm -C operations exec elevasis-sdk deploy --prod
83
- ```
84
-
85
- ## Verification
86
-
87
- Run from the project root after package updates and any DB migration:
88
-
89
- ```bash
90
- pnpm -C ui check-types
91
- pnpm -C ui build
92
- pnpm -C operations check-types
93
- pnpm -C operations exec elevasis-sdk check
94
- ```
95
-
96
- Then exercise the lead-gen surface:
97
-
98
- - open the lists page — confirm the new state-key badge column renders, the ICP rubric column shows either the rubric key or an em-dash, and the FilterBar exposes a state-key Select chip
99
- - open a list detail — confirm the 5-tab layout (Overview / Members / Activity / Artifacts / Touchpoints), the state-machine progression badge in the Overview tab, and that the Action toolbar in `PageTitleCaption` renders the actions returned by `useDeriveActions(list)`
100
- - click a member row — confirm the drawer opens, the URL gains `?member=<id>&memberKind=<contact|company>`, the activity / touchpoints / artifacts tabs render, and `onClose` clears both params
101
- - after the operations redeploy, run a campaign through the qualification + email-discovery workflows; confirm new rows in `acq_artifacts`, new rows in `acq_touchpoints`, and non-null `qualification_score` / `qualification_signals` on the affected `acq_companies` rows
102
-
103
- If a workflow that historically wrote `acq_lists.status` / `acq_list_*.stage` throws Zod errors against `StatefulSchema` or fails on missing `state_key`, route it through `acqDb.transitionList(...)` / `transitionListMember(...)` / `transitionListCompany(...)`.
104
-
105
- ## Not handled by /git-sync
106
-
107
- - `/git-sync` does not publish or upgrade `@elevasis/core`, `@elevasis/ui`, or `@elevasis/sdk`.
108
- - `/git-sync` does not run the project-local `acq_artifacts` / `acq_touchpoints` table creation, ICP-column additions, or the Stateful-trait cutover on `acq_lists` / `acq_list_members` / `acq_list_companies`. Each of those is owner-authorized and atomic.
109
- - `/git-sync` does not redeploy the project's `operations` bundle to dev or prod.
110
- - `/git-sync` does not rewrite project-owned workflow code that bypasses `transitionList` / `transitionListMember` / `transitionListCompany` to write list / member / company stage directly.
111
- - `/git-sync` does not retire project-local `enrichmentData.pipeline.{auditDoc, touchpointCount, lastReply}` writers — those must be migrated to `acq_artifacts` + `acq_touchpoints` by the project owner.
112
- - `/git-sync` does not migrate workflow qualifiers off `pipeline_status.qualification` onto `qualification_score` / `qualification_signals` / `qualification_rubric_key`.
@@ -1,93 +0,0 @@
1
- # CRM State-Change UI + Lead-Gen Processing Status Migration
2
-
3
- ## Why this note exists
4
-
5
- This release train ships two coordinated changes that both flow through the `@elevasis/core` + `@elevasis/ui` + `@elevasis/sdk` package family.
6
-
7
- 1. **CRM state-change UI + canonical state source.** CRM `state_key` values are now defined canonically in `@elevasis/core/organization-model` as `CRM_PIPELINE_DEFINITION` (mirrors lead-gen's `ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE` shape). Eight `CRM_*_STATE` constants and a `getValidStatesForStage(definition, stageKey)` helper are exported. The API now exposes `PATCH /api/deals/:dealId/state` with server-side validation against the per-stage allowed-state set, and the deal drawer ships a `StateSelect` plus an Unstaged-deal staging affordance. Manual state changes log `state_changed_manually` (vs. workflow-driven `state_change`).
8
-
9
- 2. **Lead-gen processing-status migration.** `processing_state` JSONB stage values shift from boolean flags to status strings drawn from `ProcessingStageStatusSchema = 'success' | 'no_result' | 'skipped' | 'error'`. Legacy boolean `true` values continue to read as `success` for the foreseeable future via API normalization. `ListStageProgressSchema` expands from `{ done, total }` to attempted-coverage + per-status counts (`total`, `attempted`, `success`, `noResult`, `skipped`, `error`, `other`, `notAttempted`). Lead-gen list-detail UI renders attempted percentage with stacked status segments. Local `listTool` writers (`updateCompanyStage` / `updateContactStage`) now accept an optional `status` argument; omitted writes default to `success`.
10
-
11
- ## Applies to
12
-
13
- All template-derived projects that:
14
-
15
- - consume `@elevasis/core/business/acquisition` types (`ListStageProgressSchema`, `ProcessingStageStatusSchema`, `UpdateCompanyStageParams`, `UpdateContactStageParams`, `TransitionDealStateRequestSchema`)
16
- - import from `@elevasis/core/organization-model` (the new `CRM_PIPELINE_DEFINITION` + `CRM_*_STATE` constants are exposed for the first time in this release)
17
- - render the CRM deal drawer or kanban surfaces from `@elevasis/ui` (the drawer now slots `StateSelect` and an Unstaged staging block; `useTransitionState` is a new exported hook)
18
- - render the lead-gen list-detail progress bars from `@elevasis/ui` (stacked segment rendering replaces single fills)
19
- - author lead-gen workflows that call `acqDb.updateCompanyStage(...)` / `acqDb.updateContactStage(...)`
20
- - author CRM workflows that hardcode `state_key` string literals (`discovery_link_sent`, `discovery_replied`, `reply_sent`, `followup_{1,2,3}_sent`, etc.) — these should now import named constants from `@elevasis/core/organization-model`
21
-
22
- Operations-only projects with no CRM surface, no `acq_deals` table, and no lead-gen list workflows can ignore this train.
23
-
24
- ## Required actions
25
-
26
- 1. Pull template changes with `/git-sync` so the refreshed package baselines (`core/package.json`, `ui/package.json`, `operations/package.json`) and any propagated scaffold doc updates land.
27
-
28
- 2. After the release train is published, update package versions in the project:
29
-
30
- ```bash
31
- pnpm up @elevasis/core @elevasis/ui @elevasis/sdk --latest
32
- ```
33
-
34
- 3. **Lead-gen workflows** — extend any local `listTool` wrapper signatures to accept the new optional `status` parameter and pass an explicit non-success status where the workflow can distinguish outcomes:
35
-
36
- ```ts
37
- updateCompanyStage: (params: {
38
- listId: string
39
- companyId: string
40
- stage: 'extracted'
41
- status?: 'success' | 'no_result' | 'skipped' | 'error'
42
- executionId?: string
43
- }) => platform.call({ tool: 'list', method: 'updateCompanyStage', params }) as Promise<void>
44
- ```
45
-
46
- Recommended status mapping per stage (`populated`, `extracted`, `discovered`, `verified`, `qualified`, `personalized`, `uploaded`) is documented in `apps/docs/content/docs/in-progress/active-development/sdk-changes/ship/lead-gen-processing-status-migration.mdx` (Step 4 table). Omitted `status` defaults to `success` so existing call sites keep working unchanged.
47
-
48
- 4. **CRM workflows** — replace any hardcoded CRM `state_key` string literals with imports from `@elevasis/core/organization-model`:
49
-
50
- ```ts
51
- import {
52
- CRM_DISCOVERY_REPLIED_STATE,
53
- CRM_DISCOVERY_LINK_SENT_STATE,
54
- CRM_REPLY_SENT_STATE,
55
- CRM_FOLLOWUP_1_SENT_STATE,
56
- // ...
57
- } from '@elevasis/core/organization-model'
58
-
59
- // before:
60
- await acqDb.transitionItem({ ..., stateKey: 'reply_sent' })
61
-
62
- // after:
63
- await acqDb.transitionItem({ ..., stateKey: CRM_REPLY_SENT_STATE.stateKey })
64
- ```
65
-
66
- The runtime string values are unchanged; this is a mechanical substitution that aligns workflows with the canonical source. The API now validates `stateKey` for the new `PATCH /deals/:dealId/state` route, but `transitionItem` retains existing acceptance behavior for backward compatibility during rollout.
67
-
68
- 5. **Reading `acq_deal_activity_log`** — pattern-matchers should accept `state_changed_manually` as a new event kind alongside the existing `state_change`. Manual state edits carry a user id and optional reason; workflow-driven state writes continue to use `state_change`.
69
-
70
- 6. **Lead-gen progress consumers** — if your project reads `GET /acquisition/lists/:listId/progress`, the response shape now exposes attempted-coverage fields. The legacy `{ done, total }` shape no longer ships; consumers should switch to `attempted / total` for completion percentages and use the per-status counts (`success`, `noResult`, `skipped`, `error`, `other`, `notAttempted`) for outcome rendering.
71
-
72
- 7. **`processing_state` data shape** — running rows now carry string statuses (`"success" | "no_result" | "skipped" | "error"`). Legacy `true` values continue to be normalized server-side. Direct SQL consumers should treat both shapes as readable; new writes should always emit strings.
73
-
74
- ## Verification
75
-
76
- After upgrading and applying the actions above:
77
-
78
- - `pnpm check-types` clean across project packages
79
- - `pnpm test` for any operations workflows that exercise `listTool.update*Stage` signatures
80
- - Spot-check a CRM deal drawer in your project's command-center: state dropdown should appear under the Summary block when the deal has a stage; an "Unstaged" staging affordance should appear when `stage_key` is null
81
- - Spot-check a lead-gen list-detail page: progress bars should render stacked segments, with the headline percentage reflecting attempted coverage rather than only successful rows
82
- - `GET /acquisition/lists/:listId/progress` response should carry the new attempted-coverage shape
83
- - Manual deal state changes through the new UI should append `state_changed_manually` rows in `acq_deal_activity_log`
84
-
85
- ## Not handled by /git-sync
86
-
87
- `/git-sync` propagates template-authored files (package baselines, scaffold doc copies, sync-managed shells) but does NOT:
88
-
89
- - run `pnpm up @elevasis/core @elevasis/ui @elevasis/sdk --latest` for you — bump deps explicitly after this train publishes
90
- - rewrite hardcoded `state_key` literals in your CRM workflows — Action 4 is a manual substitution
91
- - backfill historical `processing_state: true` JSONB values to `"success"` strings — the platform monorepo ran a one-shot SQL conversion for its prod data on 2026-04-29; your project owns its own backfill if you want clean string-only rows. API normalization makes the backfill optional for correctness.
92
- - regenerate workflow status writes — Action 3 is a code-level change in your operations workflows
93
- - rebuild your `command-center` after the `@elevasis/ui` upgrade — run your project's normal build/dev cycle