@elevasis/sdk 1.14.1 → 1.15.1

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.
@@ -1,208 +1,208 @@
1
- ---
2
- description: Ambient intent classifier -- routes natural-language input to 7 intent buckets without a slash command; Codify and Toggle delegate to /configure
3
- paths:
4
- - "**/*"
5
- ---
6
-
7
- # Vibe Layer
8
-
9
- Vibe is an **ambient, always-on** intent classifier. It activates automatically whenever the user speaks in plain language -- no slash command, no activation phrase, no special syntax. Every natural-language message passes through vibe classification before the agent acts.
10
-
11
- This rule applies to all sessions inside external projects. It does NOT apply in the monorepo (ambient routing is off there by default).
12
-
13
- ## What Vibe Is
14
-
15
- Vibe is the translation layer between the user's natural language and the correct agent action. The user describes reality -- "we track deals by Shopify platform", "I'm stuck on this task", "what should I work on next" -- and vibe determines which of the seven intent types the message represents. The agent then routes to the right behavior without the user ever knowing the classification happened.
16
-
17
- Vibe coders (non-technical builders) are the primary audience. They build by describing. They never memorize commands, IDs, or schema. The ambient layer closes the gap between what they say and what the system can act on.
18
-
19
- ## The Seven Intent Types
20
-
21
- ### 1. Capture
22
-
23
- The user wants to record something new -- a task, a note, a piece of information that should persist.
24
-
25
- **Recognize by:** action verbs like "add", "create", "remember", "track", "log", "note down", "write down", combined with a thing to record.
26
-
27
- **Fixture examples:**
28
-
29
- | Input | Why it's Capture |
30
- | ------------------------------------------------- | ------------------------------------------- |
31
- | "Add a task to follow up with the Shopify client" | Explicit "add a task" with a described item |
32
- | "Remember to run the campaign report on Friday" | "Remember to" signals something to persist |
33
- | "Track this conversation as a deal note" | Explicit "track" with a described artifact |
34
-
35
- **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands. Never write without confirmation.
36
-
37
- ### 2. Query
38
-
39
- The user wants to know something about current state -- task priorities, what is pending, what is running, what failed.
40
-
41
- **Recognize by:** questions about the current list, status, or queue of things. Includes both static-model queries ("what features are on?") and runtime-entity queries ("what's pending in the queue?"). Route Query to static-model sources (org model, features config) or runtime sources (operations domain) based on the referenced entity.
42
-
43
- **Fixture examples:**
44
-
45
- | Input | Why it's Query |
46
- | --------------------------------------------- | ------------------------------------------- |
47
- | "What should I work on next?" | Asking for prioritized task list |
48
- | "What's pending in the HITL queue?" | Runtime-entity query about operations state |
49
- | "What features are enabled for this project?" | Static-model query about features config |
50
-
51
- **Agent action:** read the relevant source (org model, `prj_tasks`, operations domain as available) and narrate the answer in plain language. No writes.
52
-
53
- ### 3. Describe
54
-
55
- The user wants the agent to explain something -- a scope, an entity, a concept within the project.
56
-
57
- **Recognize by:** "what is", "what does", "tell me about", "explain", "where am I", "what's going on", "describe", "show me" without an action intent attached.
58
-
59
- **Fixture examples:**
60
-
61
- | Input | Why it's Describe |
62
- | ------------------------------------------ | ----------------------------------------------------- |
63
- | "What's going on with the ZentaraHQ deal?" | Asking for a plain-language description of an entity |
64
- | "Tell me about the CRM feature" | Asking the agent to narrate what a model element does |
65
- | "Where am I in this project?" | Asking for current scope narration |
66
-
67
- **Agent action:** read the relevant org-model label, entity, or scope. Narrate in plain language using label fields from the model -- never invent vocabulary not present in the model. Phase-1 scope covers Model, Features, and Foundations layers only.
68
-
69
- ### 4. Transition
70
-
71
- The user wants to change the status of a task or entity.
72
-
73
- **Recognize by:** single-word or short-phrase state signals -- "done", "finished", "complete", "blocked", "stuck", "waiting", "in review", "cancelled" -- applied to a current task or named entity.
74
-
75
- **Fixture examples:**
76
-
77
- | Input | Why it's Transition |
78
- | --------------------------------------------- | ------------------------------------------- |
79
- | "Done with the proposal draft" | "Done" + named artifact = status transition |
80
- | "Stuck -- blocked waiting on client feedback" | "Stuck" + reason = blocked transition |
81
- | "Mark the onboarding task as complete" | Explicit status-change vocabulary |
82
-
83
- **Agent action:** identify the task or entity being transitioned, confirm the new status with the user, then apply the transition via `elevasis-sdk project:task:save` or equivalent. Never auto-transition without confirmation if the target entity is ambiguous.
84
-
85
- ### 5. Navigate
86
-
87
- The user wants to shift focus -- to a different task, project, feature, or layer of the model.
88
-
89
- **Recognize by:** focus-shift vocabulary -- "focus on", "let's look at", "switch to", "back to", "move to", "open", "go to" -- followed by a scope target.
90
-
91
- **Fixture examples:**
92
-
93
- | Input | Why it's Navigate |
94
- | -------------------------------------------- | --------------------------------------------------- |
95
- | "Let's focus on the onboarding flow for now" | "Focus on" + scope target |
96
- | "Switch to the Shopify integration project" | "Switch to" = navigate to a different project scope |
97
- | "Back to the CRM tasks" | "Back to" = return to a prior scope |
98
-
99
- **Agent action:** update the active scope in `prj_tasks.resume_context` (current project + task pointer), then narrate the new scope in plain language so the user knows where they are.
100
-
101
- ### 6. Codify
102
-
103
- The user describes organizational reality that is not yet expressed in the model -- industry type, entity kinds, custom attributes, renamed stages, domain vocabulary.
104
-
105
- **Recognize by:** declarative "we are" / "we use" / "we track" statements, repeated attribute mentions (second time the same attribute appears), or explicit "add a type / add a field / model X as Y" requests.
106
-
107
- **Fixture examples:**
108
-
109
- | Input | Why it's Codify |
110
- | -------------------------------------------------------------------------------- | -------------------------------------------------------- |
111
- | "We're an e-commerce company -- all our deals come from Shopify or Amazon" | Declares industry + platform attributes not yet in model |
112
- | "We track deal stage as discovery, scoping, proposal, closed" | Describes custom CRM stages that should replace defaults |
113
- | "Add a project type called 'retainer' with monthly billing and a contract field" | Explicit request to add a new entity extension |
114
-
115
- **Agent action:** delegate immediately to `/configure`. Do not attempt the ceremony yourself. Invoke with the relevant domain: `/configure crm` for deal/contact changes, `/configure projects` for project types, `/configure features` for feature toggles. Plain-language summary of what was detected is acceptable before delegating, but the actual draft-confirm-write ceremony belongs to `/configure`.
116
-
117
- This routing applies to both codify levels (decision #21 -- Codify ceremony delegated to `/configure`):
118
-
119
- - **Level A** (config-only edits to `organization-model.ts`, feature toggles, label renames): delegate to `/configure <domain>` immediately.
120
- - **Level B** (new Zod extension files in `foundations/config/extensions/`): also delegate to `/configure <domain>`; `/configure` gates Level B to explicit user asks before scaffolding a new TS file.
121
-
122
- Vibe detects the intent and delegates in both cases. It does not run either pipeline itself.
123
-
124
- For "build/extend the CRM" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` before editing. CRM work often spans org-model sales semantics, shared UI routes, hooks, workflow adapters, and deal actions; do not reduce it to only `sales` config or only UI.
125
-
126
- For "build/extend lead gen" / "campaign creator" / "outbound list state" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` before editing. Lead-gen work often spans org-model prospecting semantics, shared UI routes, hooks, list/member state, artifacts, touchpoints, and workflow adapters; do not reduce it to only `prospecting` config or only UI.
127
-
128
- For "add a custom CRM action" / "Send Quote button" asks, classify as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` before editing. Start with the shared `crmActions` provider path for action visibility, labels, ordering, and render-time configuration. In v1, platform-known/default action endpoint behavior is server-constrained; use project-owned UI that calls the workflow directly when a custom key sits outside that server-dispatched set.
129
-
130
- Heuristics for when to propose codification (passed to `/configure` as context):
131
-
132
- - First mention of a new attribute: note to `resume_context`, do not propose yet
133
- - Second mention OR explicit declaration ("we're ecom"): propose extension
134
- - Explicit ask ("track ecom deals separately"): propose immediately with fuller scope
135
- - Attribute appearing across 3+ tasks: propose adding field to existing extension
136
-
137
- ### 7. Toggle
138
-
139
- The user wants to enable or disable a feature.
140
-
141
- **Recognize by:** feature-control vocabulary -- "turn on", "enable", "disable", "turn off", "activate", "deactivate" -- followed by a feature name or description.
142
-
143
- **Fixture examples:**
144
-
145
- | Input | Why it's Toggle |
146
- | ------------------------------- | --------------------------------------------- |
147
- | "Turn on the lead-gen feature" | Explicit "turn on" + feature name |
148
- | "Disable monitoring for now" | "Disable" + feature reference |
149
- | "We don't use SEO, turn it off" | Declarative + "turn it off" = feature disable |
150
-
151
- **Agent action:** delegate to `/configure features`. The ceremony (confirm + edit `foundations/config/organization-model.ts` + typecheck) belongs to `/configure`, not to the ambient rule.
152
-
153
- ## Quick Reference Table
154
-
155
- | Intent | Trigger signal | Routed to |
156
- | ---------- | --------------------------------------------------------------- | ------------------------------------------ |
157
- | Capture | "add", "remember", "track", "log" + a thing | Agent -- draft + confirm + `project:*` CLI |
158
- | Query | "what's next", "what's pending", "what failed", "what features" | Agent -- read + narrate |
159
- | Describe | "what is", "tell me about", "explain", "where am I" | Agent -- narrate from org model labels |
160
- | Transition | "done", "stuck", "blocked", "finished", "complete" | Agent -- confirm + `project:task:save` |
161
- | Navigate | "focus on", "switch to", "back to", "look at" | Agent -- update scope + narrate |
162
- | Codify | "we are X", "we track Y", repeated attribute, "add type/field" | Delegate to `/configure \<domain>` |
163
- | Toggle | "enable", "disable", "turn on/off" + feature | Delegate to `/configure features` |
164
-
165
- ## Source of Truth for Plain Language
166
-
167
- All plain-language labels come from the OrganizationModel itself -- never from hardcoded strings in this rule file. Every status, entity kind, and layer name in the model carries an inline `label` field (e.g., `{ id: 'revision_requested', label: 'changes needed', semanticClass: 'blocked' }`). When narrating state or confirming an action, read the label from the model and use it verbatim. Do not invent synonyms or fallback vocabulary.
168
-
169
- The unified manifest (delivered via `@elevasis/core/organization-model`) is the canonical vocabulary surface. Vibe classifies against it -- capabilities, features, statuses, operations entities, and resource kinds are all discoverable from the manifest without hardcoding.
170
-
171
- ## Ambiguous Intent
172
-
173
- When the user's input does not clearly map to one of the seven types, ask one clarifying question. Do not guess. Do not apply a precedence rule. Do not route to the "closest" intent.
174
-
175
- Format: a single neutral question that presents the two (or three) plausible intents as options and asks which the user means.
176
-
177
- Example: "That could be a note to capture or a status update on the current task -- which did you mean?"
178
-
179
- Never ask more than one question per ambiguous input. If the user's reply is still ambiguous, ask once more, then surface the options explicitly.
180
-
181
- ## Classifier Threshold
182
-
183
- Default threshold: `balanced`.
184
-
185
- The threshold controls how aggressively the classifier proposes codification from ambiguous signals:
186
-
187
- - `strict` -- only explicit declarations or repeat mentions trigger codify proposals
188
- - `balanced` -- second mention OR explicit declaration triggers; default
189
- - `loose` -- first strong signal triggers a proposal
190
-
191
- Override per project in `foundations/config/organization-model.ts` under `vibe.classifierThreshold`. The override is merge-aware (Tier 2 sync) and will not be overwritten by template sync operations.
192
-
193
- ## Phase-1 Scope
194
-
195
- This rule covers Phase 1 of the vibe layer rollout. The layers the ambient classifier can narrate and codify in Phase 1 are:
196
-
197
- - Layer 1 (Model): narrate schema shape, propose codification edits via `/configure`
198
- - Layer 4 (Features): describe which features are on/off, propose enabling one via `/configure`
199
- - Layer 7 (Foundations): explain and edit `organization-model.ts` and `extensions/` via `/configure`
200
-
201
- Layers 2 (Public API), 3 (UI Shell Runtime), 5 (Toolkit), and 6 (Graph) require runtime read APIs that are not yet available. Do not attempt to narrate or classify against those layers in Phase 1. If the user's input clearly references one of those layers, acknowledge the scope and explain that full support arrives in a later phase.
202
-
203
- ## What Vibe Is Not
204
-
205
- - Vibe is not a slash command. There is no `/vibe` invocation (decision #19 -- ambient rule, not a skill or command).
206
- - Vibe is not a skill. It lives in this rule file + CLAUDE.md + the PreToolUse hook -- not in `.claude/skills/`.
207
- - Vibe does not own the codify ceremony. `/configure` owns draft, confirm, write, and typecheck for both Level A and Level B codify pipelines (decision #21 -- Codify ceremony delegated to `/configure`). Vibe detects intent and hands off.
208
- - Vibe is not active in the monorepo. If working inside the monorepo (not an `external/` project), this ambient routing does not apply.
1
+ ---
2
+ description: Ambient intent classifier -- routes natural-language input to 7 intent buckets without a slash command; Codify and Toggle delegate to /configure
3
+ paths:
4
+ - "**/*"
5
+ ---
6
+
7
+ # Vibe Layer
8
+
9
+ Vibe is an **ambient, always-on** intent classifier. It activates automatically whenever the user speaks in plain language -- no slash command, no activation phrase, no special syntax. Every natural-language message passes through vibe classification before the agent acts.
10
+
11
+ This rule applies to all sessions inside external projects. It does NOT apply in the monorepo (ambient routing is off there by default).
12
+
13
+ ## What Vibe Is
14
+
15
+ Vibe is the translation layer between the user's natural language and the correct agent action. The user describes reality -- "we track deals by Shopify platform", "I'm stuck on this task", "what should I work on next" -- and vibe determines which of the seven intent types the message represents. The agent then routes to the right behavior without the user ever knowing the classification happened.
16
+
17
+ Vibe coders (non-technical builders) are the primary audience. They build by describing. They never memorize commands, IDs, or schema. The ambient layer closes the gap between what they say and what the system can act on.
18
+
19
+ ## The Seven Intent Types
20
+
21
+ ### 1. Capture
22
+
23
+ The user wants to record something new -- a task, a note, a piece of information that should persist.
24
+
25
+ **Recognize by:** action verbs like "add", "create", "remember", "track", "log", "note down", "write down", combined with a thing to record.
26
+
27
+ **Fixture examples:**
28
+
29
+ | Input | Why it's Capture |
30
+ | ------------------------------------------------- | ------------------------------------------- |
31
+ | "Add a task to follow up with the Shopify client" | Explicit "add a task" with a described item |
32
+ | "Remember to run the campaign report on Friday" | "Remember to" signals something to persist |
33
+ | "Track this conversation as a deal note" | Explicit "track" with a described artifact |
34
+
35
+ **Agent action:** draft the capture in plain language, confirm with the user, then execute via `elevasis-sdk project:*` commands. Never write without confirmation.
36
+
37
+ ### 2. Query
38
+
39
+ The user wants to know something about current state -- task priorities, what is pending, what is running, what failed.
40
+
41
+ **Recognize by:** questions about the current list, status, or queue of things. Includes both static-model queries ("what features are on?") and runtime-entity queries ("what's pending in the queue?"). Route Query to static-model sources (org model, features config) or runtime sources (operations domain) based on the referenced entity.
42
+
43
+ **Fixture examples:**
44
+
45
+ | Input | Why it's Query |
46
+ | --------------------------------------------- | ------------------------------------------- |
47
+ | "What should I work on next?" | Asking for prioritized task list |
48
+ | "What's pending in the HITL queue?" | Runtime-entity query about operations state |
49
+ | "What features are enabled for this project?" | Static-model query about features config |
50
+
51
+ **Agent action:** read the relevant source (org model, `prj_tasks`, operations domain as available) and narrate the answer in plain language. No writes.
52
+
53
+ ### 3. Describe
54
+
55
+ The user wants the agent to explain something -- a scope, an entity, a concept within the project.
56
+
57
+ **Recognize by:** "what is", "what does", "tell me about", "explain", "where am I", "what's going on", "describe", "show me" without an action intent attached.
58
+
59
+ **Fixture examples:**
60
+
61
+ | Input | Why it's Describe |
62
+ | ------------------------------------------ | ----------------------------------------------------- |
63
+ | "What's going on with the ZentaraHQ deal?" | Asking for a plain-language description of an entity |
64
+ | "Tell me about the CRM feature" | Asking the agent to narrate what a model element does |
65
+ | "Where am I in this project?" | Asking for current scope narration |
66
+
67
+ **Agent action:** read the relevant org-model label, entity, or scope. Narrate in plain language using label fields from the model -- never invent vocabulary not present in the model. Phase-1 scope covers Model, Features, and Foundations layers only.
68
+
69
+ ### 4. Transition
70
+
71
+ The user wants to change the status of a task or entity.
72
+
73
+ **Recognize by:** single-word or short-phrase state signals -- "done", "finished", "complete", "blocked", "stuck", "waiting", "in review", "cancelled" -- applied to a current task or named entity.
74
+
75
+ **Fixture examples:**
76
+
77
+ | Input | Why it's Transition |
78
+ | --------------------------------------------- | ------------------------------------------- |
79
+ | "Done with the proposal draft" | "Done" + named artifact = status transition |
80
+ | "Stuck -- blocked waiting on client feedback" | "Stuck" + reason = blocked transition |
81
+ | "Mark the onboarding task as complete" | Explicit status-change vocabulary |
82
+
83
+ **Agent action:** identify the task or entity being transitioned, confirm the new status with the user, then apply the transition via `elevasis-sdk project:task:save` or equivalent. Never auto-transition without confirmation if the target entity is ambiguous.
84
+
85
+ ### 5. Navigate
86
+
87
+ The user wants to shift focus -- to a different task, project, feature, or layer of the model.
88
+
89
+ **Recognize by:** focus-shift vocabulary -- "focus on", "let's look at", "switch to", "back to", "move to", "open", "go to" -- followed by a scope target.
90
+
91
+ **Fixture examples:**
92
+
93
+ | Input | Why it's Navigate |
94
+ | -------------------------------------------- | --------------------------------------------------- |
95
+ | "Let's focus on the onboarding flow for now" | "Focus on" + scope target |
96
+ | "Switch to the Shopify integration project" | "Switch to" = navigate to a different project scope |
97
+ | "Back to the CRM tasks" | "Back to" = return to a prior scope |
98
+
99
+ **Agent action:** update the active scope in `prj_tasks.resume_context` (current project + task pointer), then narrate the new scope in plain language so the user knows where they are.
100
+
101
+ ### 6. Codify
102
+
103
+ The user describes organizational reality that is not yet expressed in the model -- industry type, entity kinds, custom attributes, renamed stages, domain vocabulary.
104
+
105
+ **Recognize by:** declarative "we are" / "we use" / "we track" statements, repeated attribute mentions (second time the same attribute appears), or explicit "add a type / add a field / model X as Y" requests.
106
+
107
+ **Fixture examples:**
108
+
109
+ | Input | Why it's Codify |
110
+ | -------------------------------------------------------------------------------- | -------------------------------------------------------- |
111
+ | "We're an e-commerce company -- all our deals come from Shopify or Amazon" | Declares industry + platform attributes not yet in model |
112
+ | "We track deal stage as discovery, scoping, proposal, closed" | Describes custom CRM stages that should replace defaults |
113
+ | "Add a project type called 'retainer' with monthly billing and a contract field" | Explicit request to add a new entity extension |
114
+
115
+ **Agent action:** delegate immediately to `/configure`. Do not attempt the ceremony yourself. Invoke with the relevant domain: `/configure crm` for deal/contact changes, `/configure projects` for project types, `/configure features` for feature toggles. Plain-language summary of what was detected is acceptable before delegating, but the actual draft-confirm-write ceremony belongs to `/configure`.
116
+
117
+ This routing applies to both codify levels (decision #21 -- Codify ceremony delegated to `/configure`):
118
+
119
+ - **Level A** (config-only edits to `organization-model.ts`, feature toggles, label renames): delegate to `/configure <domain>` immediately.
120
+ - **Level B** (new Zod extension files in `foundations/config/extensions/`): also delegate to `/configure <domain>`; `/configure` gates Level B to explicit user asks before scaffolding a new TS file.
121
+
122
+ Vibe detects the intent and delegates in both cases. It does not run either pipeline itself.
123
+
124
+ For "build/extend the CRM" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-crm.md` before editing. CRM work often spans org-model sales semantics, shared UI routes, hooks, workflow adapters, and deal actions; do not reduce it to only `sales` config or only UI.
125
+
126
+ For "build/extend lead gen" / "campaign creator" / "outbound list state" asks, classify the structural org-model portion as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-lead-gen.md` before editing. Lead-gen work often spans org-model prospecting semantics, shared UI routes, hooks, list/member state, artifacts, and workflow adapters; do not reduce it to only `prospecting` config or only UI.
127
+
128
+ For "add a custom CRM action" / "Send Quote button" asks, classify as Codify, then read `node_modules/@elevasis/sdk/reference/scaffold/recipes/customize-crm-actions.md` before editing. Start with the shared `crmActions` provider path for action visibility, labels, ordering, and render-time configuration. In v1, platform-known/default action endpoint behavior is server-constrained; use project-owned UI that calls the workflow directly when a custom key sits outside that server-dispatched set.
129
+
130
+ Heuristics for when to propose codification (passed to `/configure` as context):
131
+
132
+ - First mention of a new attribute: note to `resume_context`, do not propose yet
133
+ - Second mention OR explicit declaration ("we're ecom"): propose extension
134
+ - Explicit ask ("track ecom deals separately"): propose immediately with fuller scope
135
+ - Attribute appearing across 3+ tasks: propose adding field to existing extension
136
+
137
+ ### 7. Toggle
138
+
139
+ The user wants to enable or disable a feature.
140
+
141
+ **Recognize by:** feature-control vocabulary -- "turn on", "enable", "disable", "turn off", "activate", "deactivate" -- followed by a feature name or description.
142
+
143
+ **Fixture examples:**
144
+
145
+ | Input | Why it's Toggle |
146
+ | ------------------------------- | --------------------------------------------- |
147
+ | "Turn on the lead-gen feature" | Explicit "turn on" + feature name |
148
+ | "Disable monitoring for now" | "Disable" + feature reference |
149
+ | "We don't use SEO, turn it off" | Declarative + "turn it off" = feature disable |
150
+
151
+ **Agent action:** delegate to `/configure features`. The ceremony (confirm + edit `foundations/config/organization-model.ts` + typecheck) belongs to `/configure`, not to the ambient rule.
152
+
153
+ ## Quick Reference Table
154
+
155
+ | Intent | Trigger signal | Routed to |
156
+ | ---------- | --------------------------------------------------------------- | ------------------------------------------ |
157
+ | Capture | "add", "remember", "track", "log" + a thing | Agent -- draft + confirm + `project:*` CLI |
158
+ | Query | "what's next", "what's pending", "what failed", "what features" | Agent -- read + narrate |
159
+ | Describe | "what is", "tell me about", "explain", "where am I" | Agent -- narrate from org model labels |
160
+ | Transition | "done", "stuck", "blocked", "finished", "complete" | Agent -- confirm + `project:task:save` |
161
+ | Navigate | "focus on", "switch to", "back to", "look at" | Agent -- update scope + narrate |
162
+ | Codify | "we are X", "we track Y", repeated attribute, "add type/field" | Delegate to `/configure \<domain>` |
163
+ | Toggle | "enable", "disable", "turn on/off" + feature | Delegate to `/configure features` |
164
+
165
+ ## Source of Truth for Plain Language
166
+
167
+ All plain-language labels come from the OrganizationModel itself -- never from hardcoded strings in this rule file. Every status, entity kind, and layer name in the model carries an inline `label` field (e.g., `{ id: 'revision_requested', label: 'changes needed', semanticClass: 'blocked' }`). When narrating state or confirming an action, read the label from the model and use it verbatim. Do not invent synonyms or fallback vocabulary.
168
+
169
+ The unified manifest (delivered via `@elevasis/core/organization-model`) is the canonical vocabulary surface. Vibe classifies against it -- capabilities, features, statuses, operations entities, and resource kinds are all discoverable from the manifest without hardcoding.
170
+
171
+ ## Ambiguous Intent
172
+
173
+ When the user's input does not clearly map to one of the seven types, ask one clarifying question. Do not guess. Do not apply a precedence rule. Do not route to the "closest" intent.
174
+
175
+ Format: a single neutral question that presents the two (or three) plausible intents as options and asks which the user means.
176
+
177
+ Example: "That could be a note to capture or a status update on the current task -- which did you mean?"
178
+
179
+ Never ask more than one question per ambiguous input. If the user's reply is still ambiguous, ask once more, then surface the options explicitly.
180
+
181
+ ## Classifier Threshold
182
+
183
+ Default threshold: `balanced`.
184
+
185
+ The threshold controls how aggressively the classifier proposes codification from ambiguous signals:
186
+
187
+ - `strict` -- only explicit declarations or repeat mentions trigger codify proposals
188
+ - `balanced` -- second mention OR explicit declaration triggers; default
189
+ - `loose` -- first strong signal triggers a proposal
190
+
191
+ Override per project in `foundations/config/organization-model.ts` under `vibe.classifierThreshold`. The override is merge-aware (Tier 2 sync) and will not be overwritten by template sync operations.
192
+
193
+ ## Phase-1 Scope
194
+
195
+ This rule covers Phase 1 of the vibe layer rollout. The layers the ambient classifier can narrate and codify in Phase 1 are:
196
+
197
+ - Layer 1 (Model): narrate schema shape, propose codification edits via `/configure`
198
+ - Layer 4 (Features): describe which features are on/off, propose enabling one via `/configure`
199
+ - Layer 7 (Foundations): explain and edit `organization-model.ts` and `extensions/` via `/configure`
200
+
201
+ Layers 2 (Public API), 3 (UI Shell Runtime), 5 (Toolkit), and 6 (Graph) require runtime read APIs that are not yet available. Do not attempt to narrate or classify against those layers in Phase 1. If the user's input clearly references one of those layers, acknowledge the scope and explain that full support arrives in a later phase.
202
+
203
+ ## What Vibe Is Not
204
+
205
+ - Vibe is not a slash command. There is no `/vibe` invocation (decision #19 -- ambient rule, not a skill or command).
206
+ - Vibe is not a skill. It lives in this rule file + CLAUDE.md + the PreToolUse hook -- not in `.claude/skills/`.
207
+ - Vibe does not own the codify ceremony. `/configure` owns draft, confirm, write, and typecheck for both Level A and Level B codify pipelines (decision #21 -- Codify ceremony delegated to `/configure`). Vibe detects intent and hands off.
208
+ - Vibe is not active in the monorepo. If working inside the monorepo (not an `external/` project), this ambient routing does not apply.
@@ -1,5 +1,7 @@
1
1
  # Lead-Gen Substrate Train (Tracks A + B + C)
2
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
+
3
5
  ## Why this note exists
4
6
 
5
7
  This release train ships the Lead-Gen Substrate Generalization across three coordinated tracks:
@@ -0,0 +1,93 @@
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
@@ -0,0 +1,58 @@
1
+ # CRM Ownership and Next-Action Projection
2
+
3
+ ## Why this note exists
4
+
5
+ This release train ships CRM ownership and next-action projection across the shared core, UI, API, and Elevasis operations bundle.
6
+
7
+ Shared CRM deal responses now carry nullable `ownership` and `nextAction` values derived from activity history. The CRM list and detail surfaces render the move owner directly, and detail actions prefer the projected `nextAction` before falling back to ownership-aware derivation. The Elevasis operations bundle also writes canonical follow-up and deferred-next-step activity events so ownership can sort consistently.
8
+
9
+ ## Applies to
10
+
11
+ Template-derived projects that:
12
+
13
+ - consume `@elevasis/core/business/acquisition/api-schemas` deal list or detail response types
14
+ - render CRM list, detail, or action surfaces from `@elevasis/ui`
15
+ - author CRM operations workflows that append or interpret deal activity events
16
+ - read `activity_log` rows and classify who owns the next move
17
+
18
+ Projects with no CRM surface and no `acq_deals` workflow logic can ignore this train.
19
+
20
+ ## Required actions
21
+
22
+ 1. Pull template changes with `/git-sync` after this train publishes so package baselines for `@elevasis/core` and `@elevasis/ui` are refreshed.
23
+
24
+ 2. Upgrade shared packages in the derived project after the publish stages complete:
25
+
26
+ ```bash
27
+ pnpm up @elevasis/core @elevasis/ui --latest
28
+ ```
29
+
30
+ 3. Audit any project-owned CRM workflow code that writes activity events. Outbound follow-up should emit `followup_email_sent`, and "lead will check / get back to us" replies should emit `lead_deferred_next_step` when they defer our next action.
31
+
32
+ 4. Audit any project-owned CRM UI code that computes available actions locally. Prefer the server-projected `nextAction` when present, and suppress send-reply affordances when `ownership` is `them`.
33
+
34
+ 5. If the project deploys an operations bundle with CRM reply or follow-up handlers, redeploy that bundle after package upgrades so runtime activity writes match the new ownership derivation:
35
+
36
+ ```bash
37
+ pnpm -C operations exec elevasis-sdk deploy --prod
38
+ ```
39
+
40
+ ## Verification
41
+
42
+ After upgrading:
43
+
44
+ - `pnpm check-types` passes in project packages that consume CRM types or UI.
45
+ - CRM list rows show the expected move owner for deals with inbound replies, outbound replies, follow-ups, reminders, booking nudges, and deferred-next-step replies.
46
+ - CRM detail actions expose Send Reply only when the server-projected action and ownership allow it.
47
+ - Operations tests or smoke probes confirm follow-up handlers emit `followup_email_sent`.
48
+ - A CRM reply where the lead says they will check internally records `lead_deferred_next_step` and sorts after the inbound reply event.
49
+
50
+ ## Not handled by /git-sync
51
+
52
+ `/git-sync` does not:
53
+
54
+ - publish `@elevasis/core` or `@elevasis/ui`
55
+ - run package upgrades inside derived projects
56
+ - redeploy project-owned operations bundles
57
+ - rewrite project-owned CRM workflow logic that still emits legacy activity event names
58
+ - verify or repair historical `activity_log` rows in project databases