@sellable/mcp 0.1.368 → 0.1.369

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.
@@ -51,11 +51,434 @@ Default evergreen plan per workspace (override only if the prompt specifies diff
51
51
  3. **`<Workspace/Team> - Shared Cold Fallback`** — one shared cold/fallback campaign lane across senders
52
52
  </inputs>
53
53
 
54
+ <command_backed_workflow>
55
+ For full/customer-visible setup, the first operational command is always
56
+ `setup_evergreen_campaigns({ mode:"plan", yolo })`. Inventory can happen first
57
+ for operator understanding, but do not create/reuse/repair campaign shells,
58
+ source rows, messages, sequence, approvals, or cleanup before the command-backed
59
+ plan returns lane packets.
60
+ If `setup_evergreen_campaigns` is unavailable, returns 404, throws an API
61
+ error, or does not return a current `planRevision` with lane packets, stop
62
+ immediately with `blocked: setup_evergreen_campaigns_unavailable`. Do not fall
63
+ back to ad hoc create-campaign calls, inventory-only guesses, or direct shell
64
+ creation when the command-backed plan is missing.
65
+
66
+ Plan shape:
67
+
68
+ - one Post Engagers lane per sender in the **Post Engagers sender scope**;
69
+ - one shared Signal Discovery lane for the **shared lane sender scope**;
70
+ - one shared Cold Fallback lane for the **shared lane sender scope**;
71
+ - explicit existing campaign/table bindings when the user points at a canonical
72
+ lane. Pass those exact ids to the plan and reuse/verify them instead of
73
+ creating duplicates.
74
+ - If a user supplies canonical ids, reuse/verify them instead of creating duplicates.
75
+
76
+ The command-backed unbound plan is authoritative. If
77
+ `setup_evergreen_campaigns({ mode:"plan", ... })` returns a lane packet with
78
+ `intent:"create"`, execute that create packet exactly. Do not convert it into an
79
+ explicit binding because `list_tables`, `get_campaigns`, a waterfall, or old
80
+ inventory shows an `ARCHIVED` campaign/table with a matching name. Archived
81
+ campaigns are not reusable evergreen targets. Only pass an archived
82
+ campaign/table as an explicit binding when the user supplied those exact ids and
83
+ explicitly allowed dashboard visibility repair; otherwise ignore archived
84
+ matches for execution and let the create packet proceed.
85
+
86
+ Use `selectedSenderIds` only as a legacy shorthand when the same senders should
87
+ get sender-owned Post Engagers lanes and attach to shared lanes. When the scopes
88
+ differ, pass both explicit arrays:
89
+
90
+ - `postEngagerSenderIds`: only senders that should have sender-owned Post
91
+ Engagers campaigns.
92
+ - `sharedSenderIds`: senders attached to the shared Signal Discovery and Shared
93
+ Cold Fallback campaigns.
94
+
95
+ If the operator says a sender is shared-only, do not create a Post Engagers lane
96
+ for that shared-only sender. Example: if Justin already has a Post Engagers
97
+ campaign and Jell/Hulan should only participate in the two shared campaigns,
98
+ call `setup_evergreen_campaigns` with `postEngagerSenderIds:["<justin id>"]`
99
+ and `sharedSenderIds:["<justin id>","<jell or hulan id>"]`.
100
+
101
+ When senders are ambiguous, ask which sender ids belong in the Post Engagers
102
+ sender scope and which belong in the shared lane sender scope before planning.
103
+ If the operator says all connected senders for both scopes, pass
104
+ `allConnectedSenders` and let the command return exact selected sender ids or
105
+ blockers.
106
+
107
+ `--yolo` is supported, but it is a safety-scoped execution mode, not a cleanup
108
+ or launch permission. With `--yolo`, pass `yolo:true` to
109
+ `setup_evergreen_campaigns({ mode:"plan", yolo })` and proceed without
110
+ intermediate approval only when every selected lane packet returns
111
+ `autoExecutable:true`. `--yolo` does not authorize archive/delete cleanup,
112
+ launch/start, schedule/send, broad approve-all, wrong workspace work, stale
113
+ plan execution, paid InMail spend, or ambiguous target choice. Stop on wrong
114
+ workspace, cleanup/archive/delete need, stale plan, disconnected sender,
115
+ duplicate candidate, unsafe side effect, missing source proof, or missing
116
+ message proof.
117
+
118
+ When safe-yolo is blocked only because the plan needs normal setup work, ask
119
+ for a **bounded delegated approval** over the rendered current plan instead of
120
+ asking for each substep. The approval packet must name the workspace id, sender
121
+ ids, lane keys, campaign/table ids or create intents, source/import caps,
122
+ generate-message caps, route-proof approval policy, selectedActionIds,
123
+ planRevision, allowed side-effect classes, and stop conditions. After that one
124
+ approval covers the current planRevision, the parent may act on behalf of the
125
+ operator and execute the selectedActionIds end to end. Do not ask again for
126
+ substep approvals for source import, create-campaign choices, Message Drafting,
127
+ sequence attach/precheck, or exactly one route-proof approval when those actions
128
+ are within the lane packet, approved caps, approved side-effect classes, and
129
+ route-proof approval policy. Stop and re-plan if any fresh reread changes the
130
+ workspace id, sender ids, source/list id, campaign/table id, new campaign/table
131
+ id, planRevision, actionId, selectedActionIds, allowed side effects, caps,
132
+ status, or blocker set outside the approved packet.
133
+ The short rule: one approval covers the current planRevision and selectedActionIds.
134
+ The execution rule: act on behalf of the operator; do not ask again for substep approvals while work stays within the lane packet, approved caps, approved side-effect classes, and route-proof approval policy.
135
+ The drift rule: stop and re-plan when ids, caps, blockers, side-effect classes, or any new campaign/table id leave the approved packet.
136
+
137
+ After bounded delegated approval or safe `--yolo`, fan out lane worker tasks
138
+ only from the current plan. Each worker receives the complete lane packet:
139
+ workspace id, sender ids, lane key/type, existing campaign/table binding or
140
+ create intent, source hints, caps, planRevision, actionId, allowed side effects,
141
+ postconditions, and the packet's `workerDispatch` policy. Treat
142
+ `workerDispatch.requiresVisibleThreadOrDurableReceipt:true` as a hard
143
+ execution boundary, not guidance. Read and preserve `workerDispatch.acceptedRuntimes`,
144
+ `workerDispatch.rejectedRuntimes`, and `workerDispatch.receiptArtifactHint`
145
+ before dispatch.
146
+
147
+ Worker fan-out must use visible or durable execution. Preferred in local Codex
148
+ is a visible Codex thread created with `codex_app.create_thread`; the parent
149
+ must record the returned thread id, pass exactly one lane packet into that
150
+ thread, and require the worker to write the lane receipt at the artifact path
151
+ named by `workerDispatch.receiptArtifactHint`. A streaming worker or branch
152
+ worker is acceptable only when it writes a durable per-lane receipt artifact as
153
+ it works. `multi_agent_v1.spawn_agent`, raw `spawn_agent`, or any opaque
154
+ Task/subagent runtime that cannot expose a visible thread id or durable receipt
155
+ artifact is not accepted as command-level UAT proof and must not be used for
156
+ mutating evergreen setup.
157
+
158
+ Run this preflight before the first irreversible product mutation in any lane:
159
+ the parent must have recorded either a visible Codex thread id or a durable
160
+ `receiptArtifactPath` for that lane. If the runtime cannot provide this, stop
161
+ with `blocked: missing_visible_or_durable_lane_worker_runtime` before calling
162
+ `create_campaign`, `update_campaign`, `import_leads`, `confirm_lead_list`, or
163
+ any source/message/sequence mutation. Do not downgrade this to
164
+ `missing_parallel_lane_worker_runtime` when an opaque runtime exists: an
165
+ opaque runtime is still missing visible/durable proof. If a worker creates
166
+ partial product state without receipts, the run is blocked; created objects exist
167
+ is not equivalent to command completion.
168
+
169
+ Workers must explicitly load and use the installed visible
170
+ `$sellable:create-campaign` wrapper as the nested workflow entrypoint, then
171
+ load `create-campaign-v2` and `create-campaign-v2/core/flow.v2.json` through
172
+ the packaged MCP prompt/asset loaders before campaign creation or repair. The
173
+ worker then uses that create-campaign workflow/subskills for campaign
174
+ creation/setup, source/import, filter choice, Message Drafting, packaged
175
+ `generate-messages`, sequence attachment, and send-review readiness. Do not
176
+ rebuild those steps ad hoc in the parent thread or from a copied receipt
177
+ checklist. The parent thread is only the planner, dispatcher, verifier, and
178
+ receipt collector: it must not call `create_campaign`, `import_leads`,
179
+ `start_campaign_message_preparation`, `update_cell`, or sequence-attach tools
180
+ for a lane that was assigned to a worker. When the host supports visible Codex
181
+ threads, branch execution with durable receipts, or a streaming durable worker,
182
+ assign one lane packet per worker and run the lane workers in parallel. If the
183
+ host cannot run parallel workers with visible/durable receipts, report
184
+ `blocked: missing_visible_or_durable_lane_worker_runtime` instead of silently
185
+ doing all lane creation sequentially in the parent thread.
186
+ Short form: the parent thread is the planner, dispatcher, verifier, and receipt collector.
187
+ Before the first mutating lane action, complete an execution-runtime preflight:
188
+ name the callable worker surface/tool that will run lane packets and the proof
189
+ it gives (`thread id`, `receiptArtifactPath`, or both). If you cannot name a
190
+ real callable visible/durable worker runtime, stop with
191
+ `blocked: missing_visible_or_durable_lane_worker_runtime` before calling
192
+ `create_campaign`, `update_campaign`, `import_leads`, `confirm_lead_list`, or
193
+ any source/message/sequence mutation. Creating campaign shells first and then
194
+ discovering the worker runtime is missing is a failed run.
195
+ Legacy reports may mention `blocked: missing_parallel_lane_worker_runtime`;
196
+ for new command runs, use the visible/durable blocker above.
197
+
198
+ For any lane with `intent:"create"`, the worker must satisfy the normal
199
+ net-new create-campaign preflight before shell creation: load
200
+ `get_subskill_prompt({ subskillName:"research-sender" })`, run the sender/team
201
+ identity research needed for the brief, call `complete_sender_research(...)`,
202
+ then call `create_campaign`. Do not bypass this with a parent-thread brief or
203
+ by directly setting campaign state.
204
+
205
+ Workers return worker receipts. Each customer-visible lane receipt must include
206
+ one durable `createCampaignStepReceipt` built from actual tool calls or worker receipts,
207
+ not a parent-thread summary. The receipt must include:
208
+
209
+ - `setupPlanCall`: the exact `setup_evergreen_campaigns({ mode:"plan", ... })`
210
+ planRevision, selected actionId, lane key, workspace id, sender ids, and
211
+ campaign/table binding or create intent used before work started. For a
212
+ create lane, this receipt must explicitly include `createIntent:true`; for a
213
+ reuse lane, do not report `createIntent:true`.
214
+ - `createCampaignWorkflowReceipt`: proof the worker loaded the actual installed
215
+ `$sellable:create-campaign` wrapper instead of doing ad hoc MCP calls. It must
216
+ include `skillCommand:"$sellable:create-campaign"`,
217
+ `skillName:"create-campaign"`, `wrapperSkillLoaded:true`,
218
+ `workflowPromptName:"create-campaign-v2"`,
219
+ `workflowPromptLoadedToHasMoreFalse:true`,
220
+ `workflowAssetPath:"create-campaign-v2/core/flow.v2.json"`,
221
+ `workflowAssetLoaded:true`, the real `workerRuntime`, a visible
222
+ `workerThreadId` or durable `receiptArtifactPath`, `durableReceiptWritten:true`
223
+ when using a receipt file, and `notAdHoc:true`.
224
+ - `researchSenderReceipt`: `research-sender` prompt load proof,
225
+ `complete_sender_research` result, sender LinkedIn identity basis, and the
226
+ notes/proof counts used before the net-new `create_campaign` call.
227
+ - `campaignBriefReceipt`: the CampaignOffer/campaign id, current
228
+ workflowTableId, brief hash or updated-at marker, delivery format, token
229
+ rules, hard avoids, source-use rules, and first-message template state.
230
+ - `sourceDecisionReceipt`: selected source/list id, provider, cursor/inventory
231
+ state, import/copy caps, explicit `dedupeDncProviderExclusions:true` or an
232
+ equivalent exclusions object, row ids or row-count evidence (`rowCount`,
233
+ `readyRowCount`, or `rowEvidence`), and the reason no colder source was used
234
+ before the current source was proven exhausted or insufficient.
235
+ - `filterDecisionReceipt`: saved/applied filter ids or explicit skip-filter
236
+ decision with current campaign/table basis.
237
+ - `messageDraftingReceipt`: the Message Drafting proof described below,
238
+ including packaged `generate-messages` prompt/assets and validation.
239
+ - `reviewBatchReceipt`: review-batch row ids/hash, generated row count,
240
+ quality-valid route-proof row id when approved, and proof that no broad
241
+ approve-all occurred.
242
+ - `sequenceReceipt`: exact current workflowTableId, recommended non-paid
243
+ sequence attach/precheck result, and readback showing `hasSequence:true` when
244
+ completion is claimed.
245
+ - final paused-send proof: if the current campaign table is `DRAFT` after the
246
+ sequence is attached, call the product `pause_campaign({ campaignId })`
247
+ endpoint/tool to put the unlaunched campaign into `PAUSED` review state, then
248
+ reread the campaign/table. Do not raw-write `campaignStatus`, do not start or
249
+ launch, and do not schedule/send. Completion requires reread proof of
250
+ `currentStep:"send"` and `campaignStatus:"PAUSED"`.
251
+ - `verifyCall`: the exact `setup_evergreen_campaigns({ mode:"verify",
252
+ planRevision, selectedActionIds, receipts })` call/result used before the
253
+ parent reports completion.
254
+
255
+ Use these canonical receipt leaf names exactly. Do not substitute looser aliases
256
+ like `generateMessagesPromptLoad`, `requiredAssetLoads`,
257
+ `validationPromptLoad`, `reviewBatchBasisHash`, `reviewRowIds`,
258
+ `sequenceActionTypes`, or `pass:true` unless you also include the canonical
259
+ fields below:
260
+
261
+ The receipt status must be `status:"succeeded"` or `status:"completed"` when
262
+ the lane is complete. Do not use `status:"passed"` or
263
+ `status:"passed_with_warnings"` as the primary success status. Warnings may go
264
+ in a separate `warnings` array, but the completion status stays canonical.
265
+
266
+ All step proof objects must live under `createCampaignStepReceipt`. Do not put
267
+ `createCampaignWorkflowReceipt`, `campaignBriefReceipt`,
268
+ `sourceDecisionReceipt`, `filterDecisionReceipt`, `messageDraftingReceipt`,
269
+ `reviewBatchReceipt`, or `sequenceReceipt` only as top-level siblings;
270
+ top-level copies are useful for humans but are not enough for command
271
+ verification unless the same object also appears inside
272
+ `createCampaignStepReceipt`.
273
+
274
+ ```json
275
+ {
276
+ "status": "succeeded",
277
+ "planRevision": "<original planRevision>",
278
+ "laneKey": "<lane key>",
279
+ "laneType": "<lane type>",
280
+ "workspaceId": "<workspace id>",
281
+ "senderIds": ["<sender id>"],
282
+ "campaignId": "<campaign id>",
283
+ "tableId": "<workflow table id>",
284
+ "createCampaignStepReceipt": {
285
+ "createCampaignWorkflowReceipt": {
286
+ "skillCommand": "$sellable:create-campaign",
287
+ "skillName": "create-campaign",
288
+ "wrapperSkillLoaded": true,
289
+ "workflowPromptName": "create-campaign-v2",
290
+ "workflowPromptLoadedToHasMoreFalse": true,
291
+ "workflowAssetPath": "create-campaign-v2/core/flow.v2.json",
292
+ "workflowAssetLoaded": true,
293
+ "workerRuntime": "separate-codex-thread",
294
+ "workerThreadId": "<visible local Codex thread id>",
295
+ "receiptArtifactPath": ".planning/artifacts/uat/69/lane-receipts/<planRevision>/<actionId>-<laneKey>.json",
296
+ "durableReceiptWritten": true,
297
+ "notAdHoc": true
298
+ },
299
+ "campaignBriefReceipt": {
300
+ "campaignId": "<campaign id>",
301
+ "workflowTableId": "<workflow table id>",
302
+ "briefHash": "<brief/currentApprovedBriefHash>",
303
+ "deliveryFormat": "single message",
304
+ "tokenRules": true,
305
+ "hardAvoids": true,
306
+ "sourceUseRules": true,
307
+ "firstMessageTemplate": "<template or template state>"
308
+ },
309
+ "sourceDecisionReceipt": {
310
+ "sourceId": "<source id>",
311
+ "sourceListId": "<source/list id>",
312
+ "cursorOrInventoryState": "<cursor/inventory/import state>",
313
+ "dedupeDncProviderExclusions": true,
314
+ "sourceLadderReason": "<why the current source is valid before colder sources>"
315
+ },
316
+ "filterDecisionReceipt": {
317
+ "status": "skipped",
318
+ "workflowTableId": "<workflow table id>"
319
+ },
320
+ "messageDraftingReceipt": {
321
+ "statusSource": "branch",
322
+ "promptLoadedToHasMoreFalse": true,
323
+ "requiredAssetsLoaded": true,
324
+ "validationLoaded": true,
325
+ "validationResult": "passed",
326
+ "qualityReview": {"passed": true, "checkedSampleCount": 3, "issues": []},
327
+ "campaignId": "<campaign id>",
328
+ "workflowTableId": "<workflow table id>",
329
+ "selectedLeadListId": "<source/list id>",
330
+ "reviewBatchRowHash": "<review row ids hash>",
331
+ "messageDraftRecommendation": {"basis": "generate-messages"},
332
+ "sampleMessages[].verdict": "pass",
333
+ "sampleMessages": [
334
+ {"rowId": "<row id>", "generatedMessageText": "<message>", "verdict": "pass"}
335
+ ]
336
+ },
337
+ "reviewBatchReceipt": {
338
+ "rowIdsHash": "<review row ids hash>",
339
+ "generatedCount": 3
340
+ },
341
+ "sequenceReceipt": {
342
+ "workflowTableId": "<workflow table id>",
343
+ "hasSequence": true,
344
+ "sequenceReceipt.actionTypes": ["send_invite"],
345
+ "sequenceReceipt.nonPaid": true,
346
+ "actionTypes": ["send_invite"],
347
+ "nonPaid": true
348
+ },
349
+ "finalPausedSendProof": {
350
+ "currentStep": "send",
351
+ "campaignStatus": "PAUSED"
352
+ },
353
+ "verifyCall": {
354
+ "mode": "verify",
355
+ "planRevision": "<original planRevision>",
356
+ "selectedActionIds": ["<all original selected action ids>"]
357
+ }
358
+ }
359
+ }
360
+ ```
361
+
362
+ Verification always uses the original execution planRevision and original
363
+ selectedActionIds from the plan packets that were dispatched before mutation.
364
+ The parent must preserve the original selectedActionIds exactly.
365
+ Do not replace them with a later reuse planRevision/actionIds after the
366
+ campaigns exist. After workers complete, attach or patch `verifyCall` on each
367
+ lane receipt with that original execution planRevision, original
368
+ selectedActionIds, same sender scopes, and the verify result. Only after verify
369
+ succeeds should the parent perform the idempotency rerun.
370
+
371
+ If any required field is missing, report
372
+ `blocked: missing_create_campaign_step_receipt` for that lane and do not call it
373
+ complete.
374
+ If `createCampaignWorkflowReceipt.workerRuntime` is
375
+ `multi_agent_v1.spawn_agent`, `spawn_agent`, or another opaque worker runtime,
376
+ or if it lacks both `workerThreadId` and a durable receipt artifact proof, treat
377
+ the lane as `blocked: missing_create_campaign_step_receipt` with detail
378
+ `createCampaignWorkflowReceipt.workerRuntime.visible_or_durable`; do not call
379
+ verify and do not repair by summarizing product readback in the parent.
380
+
381
+ Message Drafting runtime rule: the preferred proof source is the normal
382
+ create-campaign branch handoff (`watchNarration.workerDetails.messageDraftBuilder`
383
+ or equivalent) with `statusSource:"branch"`. If that internal branch handoff is
384
+ not callable or not exposed in the packaged MCP runtime, do **not** stop after
385
+ creating/importing rows. The lane worker must run the packaged message-drafting
386
+ path itself in the worker thread:
387
+
388
+ 1. Load `get_subskill_prompt({ subskillName:"generate-messages" })` until
389
+ `hasMore:false`.
390
+ 2. Load the required message assets and `create-campaign-v2-validation`.
391
+ 3. Call `start_campaign_message_preparation({ campaignId, tableId,
392
+ targetPreparedMessages, maxRowsToCheck, approvalMode:"mark_ready",
393
+ autoContinue:true })` inside the same lane worker, with bounded caps from the
394
+ lane packet.
395
+ 4. Poll `get_campaign_message_preparation_status` until no queued/active cells
396
+ remain or a bounded stop reason is returned.
397
+ 5. Use `get_campaign_messages_preview` or `select_campaign_cells` to inspect
398
+ generated rows, quality-review at least 3 samples, approve exactly one
399
+ quality-valid route-proof row when none is already approved, and prove no
400
+ broad approve-all happened.
401
+ 6. Continue to `attach_recommended_sequence({ campaignId, currentStep:"send" })`
402
+ and, if the campaign is still `DRAFT`, `pause_campaign({ campaignId })`.
403
+ Reread the campaign/table before claiming completion.
404
+
405
+ That packaged worker path must return `messageDraftingReceipt.statusSource:
406
+ "packaged-generate-messages-worker"`. It is accepted only when the receipt
407
+ includes the same prompt/assets/validation proof, current campaign/table/source
408
+ basis, generated review rows, sample messages, quality review, route-proof
409
+ approval evidence, sequence proof, and final paused-send proof required of the
410
+ branch handoff. `statusSource:"parent-thread-fallback"` is still invalid.
411
+
412
+ One lane may produce exactly one CampaignOffer/campaign id and one current
413
+ workflow table id. For `intent:"create"`, the first successful
414
+ `create_campaign` result establishes the lane's only allowed campaign/table
415
+ target. Every later source/import/confirm/message/filter/sequence/readback call
416
+ must use that same campaign id and current workflow table id. If any tool
417
+ returns or creates a different CampaignOffer, workflow table, "Campaign from
418
+ Source" campaign, or shell for the same lane, stop immediately with
419
+ `blocked: duplicate_campaign_offer_created`, include both ids in the receipt,
420
+ and do not report completion. Do not hide the earlier shell by reporting only
421
+ the later imported campaign.
422
+
423
+ Each customer-visible lane receipt must also include message proof from
424
+ `watchNarration.workerDetails.messageDraftBuilder`, the worker's equivalent
425
+ branch handoff record, or the packaged message-prep worker path above. Valid
426
+ evergreen message proof names the current campaign id, workflowTableId,
427
+ selected lead-list or source id, filter choice, and review-batch row ids/hash,
428
+ and it must use `statusSource:"branch"` or
429
+ `statusSource:"packaged-generate-messages-worker"`.
430
+ `statusSource:"parent-thread-fallback"` is not accepted for evergreen
431
+ customer-visible completion because it can be a parent summary rather than proof
432
+ that the create-campaign Message Drafting branch actually ran. The proof must
433
+ show the worker loaded the full packaged prompt with
434
+ `get_subskill_prompt({ subskillName:"generate-messages"` until `hasMore:false`,
435
+ loaded the required message assets, and loaded `create-campaign-v2-validation`
436
+ before returning a `messageDraftRecommendation`.
437
+ The receipt must also include `validationResult:"passed"`, a passed
438
+ quality-review object, and at least 3 concrete reviewed sample messages with
439
+ row ids, generated message text, pass verdicts, and no issues. Shared Cold
440
+ Fallback samples must not open with a standalone name line followed by
441
+ "Hey there" or another generic greeting; that pattern means the lane did not
442
+ finish the create-campaign message workflow to customer quality.
443
+ Shared Signal Discovery samples must not use sender-owned post-engager language
444
+ such as "my post", "thanks for showing support", "saw you pop up", or any copy
445
+ that implies the sending sender authored the source post or personally received
446
+ the prospect's engagement unless the selected source evidence proves that exact
447
+ sender authored the post.
448
+ The generated-message cells are not prompt proof: `currentRevisionGeneratedMessages`,
449
+ Generate Message column counts, `messagesCount`, or rendered row previews prove
450
+ only that table cells exist from the current brief/template, not that the
451
+ create-campaign Message Drafting branch ran. If this receipt is missing, report
452
+ `blocked: missing_message_drafting_receipt` and do not call the lane complete.
453
+
454
+ The parent then calls
455
+ `setup_evergreen_campaigns({ mode:"verify", postEngagerSenderIds,
456
+ sharedSenderIds, planRevision, selectedActionIds, receipts })` using the same
457
+ sender scopes as the plan call and the original execution planRevision/actionIds,
458
+ and reports only verified completion. A verify call without the same sender scopes can recompute an empty or different plan and is invalid proof. A verify call that uses a later reuse planRevision instead of the original execution planRevision is also invalid proof. Only after verify succeeds, rerun
459
+ `setup_evergreen_campaigns({ mode:"plan", postEngagerSenderIds,
460
+ sharedSenderIds, yolo:true })` without explicit campaign/table bindings. That
461
+ idempotency rerun must return `intent:"reuse"` for every completed lane and no
462
+ duplicate-lane blockers before you call the command finished. If verify blocks,
463
+ report the blocker and repair only the missing postconditions from the same
464
+ current plan.
465
+
466
+ Message proof for every customer-visible lane must come from the current
467
+ campaign/table basis and include at least 3 generated review rows from the
468
+ packaged `generate-messages` path before completion is reported.
469
+ Parent-thread handwritten copy or setting `currentStep` is not proof.
470
+ </command_backed_workflow>
471
+
54
472
  <objective>
55
473
  1. **Inventory first**: `get_campaigns` + `list_tables` + `get_campaign_waterfall` in the active workspace. Treat `list_tables` and the managed waterfall as authoritative for older managed slots; `get_campaigns` is a recent campaign page and may miss canonical evergreen lanes. Match existing campaigns/tables/waterfall slots to the plan by name (case-insensitive, ignore suffixes like "(Copy)") and stored slot identity. `list_tables.campaignStatus` and `list_tables.dashboardBucket` are part of the identity check: a matching `ARCHIVED` table/campaign is not a plain `REUSE`. If it is the canonical prod slot and the invocation explicitly allows dashboard visibility repair, repair it to `PAUSED`; otherwise mark it `flagged`/`blocked` and do not create a duplicate. A matching non-archived campaign/table/waterfall slot = REUSE; record it and move on. Never create a second campaign for a slot that already has one in any of those inventories.
56
- 2. **Create only the missing slots** with `create_on_demand_campaign({ name, senderIds, campaignBrief })`:
474
+ 2. **Create only the missing slots** through the full `$sellable:create-campaign`
475
+ workflow path for each lane, using the lane packet as the setup basis:
57
476
  - Post Engagers lanes: that sender's ID only. Shared lanes: all the senders' IDs.
58
- - The brief must include the warm post-engager first-message template style — short, casual, references the post they engaged with, closed question, **no internal vocabulary, no pitch, no meeting ask** in message one:
477
+ - The brief and message direction are lane-specific. Never reuse the Post
478
+ Engagers opening for Shared Cold Fallback.
479
+ - **Post Engagers** first-message style: short, casual, references the
480
+ sender-authored post they engaged with, closed question, **no internal
481
+ vocabulary, no pitch, no meeting ask** in message one:
59
482
 
60
483
  ```
61
484
  {{first_name}}
@@ -65,6 +488,33 @@ Default evergreen plan per workspace (override only if the prompt specifies diff
65
488
  Saw you pop up on my post about {{post_topic_line}}
66
489
  ```
67
490
 
491
+ - **Shared Signal Discovery** first-message style: short, casual, references
492
+ the real observed signal/theme or public conversation. It may mention the
493
+ engagement source only when the source evidence supports it. Do not say
494
+ "my post" unless the selected source post was actually authored by the
495
+ sending sender. Do not thank the prospect for showing support, reacting,
496
+ commenting, or popping up unless this is a sender-owned Post Engagers lane
497
+ with sender-authored source evidence.
498
+ - **Shared Cold Fallback** first-message style: cold, direct, and cohesive.
499
+ It must not pretend there was engagement, must not say "saw you pop up",
500
+ and must not use a standalone name line followed by "Hey there" or other
501
+ generic greeting. It should open with a light role/company/problem
502
+ observation, avoid awkward phrases like "looks like a team where", and ask
503
+ one clear problem question. This is a single-message
504
+ cold path unless the approved create-campaign message workflow proves a
505
+ better delivery format.
506
+ - Every customer-visible lane must run Message Drafting from the current
507
+ campaign/table basis after source rows exist. The worker must load the full
508
+ packaged `generate-messages` prompt, every required asset, and
509
+ `create-campaign-v2-validation`; if the internal branch handoff is not
510
+ callable in the packaged runtime, the worker must call
511
+ `start_campaign_message_preparation` and poll
512
+ `get_campaign_message_preparation_status` from the lane worker. The
513
+ returned receipt must include `statusSource:"branch"` or
514
+ `statusSource:"packaged-generate-messages-worker"`, at least 3 concrete
515
+ reviewed sample messages, a passed validation result, and a passed quality
516
+ review. Row/message counts alone are not enough.
517
+
68
518
  - **The brief must declare the delivery format** so Generate Message writes copy suited to how it actually sends:
69
519
  - DM lanes: add a `Delivery format:` line — either `multiline (each paragraph sends as its own DM message)` or `single message`. When multiline, the template's blank-line paragraphs ARE the message boundaries — write each one as a standalone typed message.
70
520
  - **InMail lanes can never be multiline**: an InMail is one message and the recipient must reply before anything else can be sent. InMail-bound templates must read as one cohesive message — declare `Delivery format: single message (InMail — no follow-up until reply)` and never structure the copy to depend on multi-message pacing.
@@ -90,26 +540,73 @@ Default evergreen plan per workspace (override only if the prompt specifies diff
90
540
  - Message Drafting has run from the current campaign/table basis, using the
91
541
  create-campaign message prompt/assets and validation gate. Updating
92
542
  `currentStep:"messages"` is not proof. Parent-thread handwritten copy is
93
- not a substitute.
543
+ not a substitute. The proof receipt must show
544
+ `get_subskill_prompt({ subskillName:"generate-messages"` was loaded until
545
+ `hasMore:false`, required message assets were loaded, and
546
+ `create-campaign-v2-validation` ran through
547
+ `workerDetails.messageDraftBuilder` with `statusSource:"branch"` or
548
+ through the lane worker's packaged message-prep path with
549
+ `statusSource:"packaged-generate-messages-worker"`,
550
+ `start_campaign_message_preparation`, and
551
+ `get_campaign_message_preparation_status`. The generated-message cells are
552
+ not prompt proof; `currentRevisionGeneratedMessages` and row previews are
553
+ only downstream cell evidence. The proof must include
554
+ `validationResult:"passed"`, a passed quality review, and at least 3
555
+ reviewed sample messages. For Shared Cold Fallback, reject samples that
556
+ open with a standalone name followed by "Hey there" or a similarly generic
557
+ greeting.
94
558
  - The first review batch exists and at least 3 review rows have generated
95
559
  messages from the approved brief. If fewer than 3 usable rows exist, report
96
560
  the actual count and why.
561
+ If a bounded preparation job requested more than the minimum but already
562
+ met the minimum generated-message floor, do not stall on a single bad review row once a fresh status/readiness check shows no queued, processing, or active cells; record the shortfall, name the failed/empty-row reason when
563
+ available, and continue with route-proof review rather than expanding source
564
+ or waiting forever.
97
565
  - At least one generated row is approved as a route-proof gate. If zero rows
98
566
  are approved and the prompt explicitly asked for full/customer-ready
99
567
  completion, approve exactly one quality-valid generated row. If one or more
100
568
  rows are already approved, do not add more approvals during evergreen
101
569
  completion. Never broad approve all rows.
102
- - The recommended non-paid sequence is attached, and the watched campaign is
103
- on Send. Use `attach_recommended_sequence({ campaignId, currentStep:"send" })`
104
- when a safe attach is needed. Existing sequence proof may come from
105
- `SEQUENCE_EXISTS`; do not replace it without explicit user confirmation.
106
- - No scheduled, queued outbound, sent outbound, campaign launch, or paid
107
- InMail spend is created by this skill.
570
+ - The recommended non-paid sequence is attached to the current campaign
571
+ table, and the watched campaign is on Send. Use
572
+ `attach_recommended_sequence({ campaignId, currentStep:"send" })` when a
573
+ safe attach is needed. After `confirm_lead_list` or any source-list copy,
574
+ immediately reread `get_campaign({ campaignId })`; the returned
575
+ `workflowTableId` is the current campaign table. Cross-check that exact
576
+ current workflowTableId with `list_tables` and require `hasSequence:true`
577
+ before reporting completion. If a stale shell table has sequence columns but
578
+ the current campaign table does not, `SEQUENCE_EXISTS` is not enough:
579
+ record the stale shell table id, then repair the current workflowTableId
580
+ with `attach_sequence` using the same non-paid product template
581
+ `attach_recommended_sequence` would have selected. Never use a paid-InMail
582
+ template and never attach/replace sequence outside the current table unless
583
+ the current lane packet explicitly allowed sequence repair.
584
+ - If the current campaign table is still `DRAFT` after sequence/readiness
585
+ proof, call `pause_campaign({ campaignId })` and reread. `pause_campaign`
586
+ is the product-native review-state transition; it is not a launch and does
587
+ not schedule or send. Never raw-write campaign status.
588
+ - No scheduled, queued outbound, sent outbound, campaign launch, or paid
589
+ InMail spend is created by this skill.
108
590
  4. **Verify each slot** after create/reuse/repair:
109
591
  - `get_campaign` shows the campaign exists, remains unlaunched, and has the expected workflow table.
110
592
  - Builder truth must match dashboard truth. `currentStep:"running"` is valid only when the linked table has `campaignStatus:"ACTIVE"`. For a `PAUSED` or `ARCHIVED` campaign/table, repair or flag stale `currentStep:"running"` back to launch review (`send` / review-ready) before reporting the slot done. Never call `start_campaign` just to make a stale `running` step true.
111
- - Send/action lanes such as Post Engagers have a sequence attached. Use `list_tables({ hasSequence: true })` as a quick cross-check, but do not treat that filter as the only proof. If the canonical campaign/table is missing from the sequence-filtered table list but a safe `attach_recommended_sequence({ campaignId })` repair/precheck returns `SEQUENCE_EXISTS`, record `sequence attached (verified by SEQUENCE_EXISTS precheck; list_tables.hasSequence mismatch)` and do not retry.
112
- - Only use `attach_recommended_sequence({ campaignId })` for a send-lane sequence repair/precheck when the target is a canonical prod slot and the invoking prompt allows sequence repair. Call it at most once without `confirmed`; a successful response is `repaired`, and `SEQUENCE_EXISTS` is non-mutating proof that a sequence already exists. Never call `attach_recommended_sequence` or `attach_sequence` with `confirmed:true` in evergreen automation unless the user explicitly asks to replace an existing sequence.
593
+ - Send/action lanes such as Post Engagers have a sequence attached on the
594
+ exact current campaign table. Use `list_tables({ hasSequence: true })` as a
595
+ quick cross-check, but do not treat that filter as the only proof. If the
596
+ canonical current campaign table is missing from the sequence-filtered
597
+ table list and `attach_recommended_sequence({ campaignId })` returns
598
+ `SEQUENCE_EXISTS`, inspect whether a stale shell table owns the sequence.
599
+ For a customer-visible completion run, stale shell proof is not completion:
600
+ rerun the current-table repair above or report `blocked: stale_shell_sequence`.
601
+ - Only use `attach_recommended_sequence({ campaignId })` for a send-lane
602
+ sequence repair/precheck when the target is a canonical prod slot and the
603
+ invoking prompt allows sequence repair. Call it at most once without
604
+ `confirmed`; a successful response is `repaired`. Treat `SEQUENCE_EXISTS` as
605
+ non-mutating proof only when the current table also has `hasSequence:true`.
606
+ Never call `attach_recommended_sequence` or `attach_sequence` with
607
+ `confirmed:true` in evergreen automation unless the user explicitly asks to
608
+ replace an existing sequence or the approved lane packet allows current
609
+ table stale-shell repair.
113
610
  - Do not report `source-only/no sequence expected` for any named evergreen
114
611
  campaign that appears in Campaigns, has a CampaignOffer ID, or is backed by
115
612
  a campaign dashboard table. Shared Signal Discovery and Shared Cold
@@ -9,6 +9,9 @@ allowed-tools:
9
9
  - mcp__sellable__get_campaign_refill_state
10
10
  - mcp__sellable__fill_campaign_horizon
11
11
  - mcp__sellable__get_campaign
12
+ - mcp__sellable__get_campaign_context
13
+ - mcp__sellable__update_campaign
14
+ - mcp__sellable__get_provider_prompt
12
15
  - mcp__sellable__get_campaign_message_preparation_status
13
16
  - mcp__sellable__start_campaign_message_preparation
14
17
  - mcp__sellable__cancel_campaign_message_preparation
@@ -16,6 +19,7 @@ allowed-tools:
16
19
  - mcp__sellable__wait_for_lead_list_ready
17
20
  - mcp__sellable__confirm_lead_list
18
21
  - mcp__sellable__search_signals
22
+ - mcp__sellable__select_promising_posts
19
23
  - mcp__sellable__fetch_post_engagers
20
24
  - mcp__sellable__search_sales_nav
21
25
  - mcp__sellable__lookup_sales_nav_filter
@@ -29,6 +33,10 @@ allowed-tools:
29
33
  - mcp__sellable__get_rows
30
34
  - mcp__sellable__get_rows_minimal
31
35
  - mcp__sellable__get_table_rows
36
+ - mcp__sellable__get_campaign_table_schema
37
+ - mcp__sellable__select_campaign_cells
38
+ - mcp__sellable__wait_for_campaign_processing
39
+ - mcp__sellable__get_sender
32
40
  ---
33
41
 
34
42
  # Refill Sends