@sellable/mcp 0.1.394 → 0.1.396

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.
package/dist/index-dev.js CHANGED
File without changes
package/dist/index.js CHANGED
File without changes
@@ -373,7 +373,7 @@ export function getPostFindLeadsScoutRegistry() {
373
373
  codex: 'After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not spawn anything before that question. After the answer, launch only Message Drafting. The filter-choice answer is the post-import user gate for this single worker; do not ask another question about starting it in step-wise or YOLO mode. The registry lookup is not a launch: after get_post_find_leads_scout_registry, immediately invoke Task/spawn_agent or the host background-agent mechanism before loading filter-leads.md, before saving rubrics, and before treating skip-filters as ready for message review. Both choices route through this kickoff; do not let filters_skipped jump straight from filter-choice to message-generation. If filters are chosen, the parent stays on Filter Rules and drafts/saves rubrics with MCP tools while Message Drafting runs in the background. If filters are skipped, move to Messages/message review only after Message Drafting has started or is ready; update_campaign(currentStep=messages) is not proof of launch. If the named Message Drafting custom agent is unavailable, spawn a generic gpt-5.5 xhigh Message Drafting background agent with the same lean campaign/table basis. When the background worker starts, persist workerDetails.messageDraftBuilder with statusSource "branch", status "branch-running", runId, startedAt, updatedAt, basisToken when known, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds; workerStatuses.messageDraftBuilder may be "running" as a simple badge only. Never put rich proof under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start the same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource "parent-thread-fallback" and status "fallback-active", and require the same live context, prompt, assets, and validation gate before message review; do not wait until filters are saved and then call the registry.',
374
374
  claude: "After confirm_lead_list copies source rows and the initial campaign-table execution slice exists, ask the filter-choice question immediately. Do not invoke any Task/Agent before that question. After the answer, invoke only Message Drafting. If filters are chosen, parent drafts/saves rubrics with MCP tools while Message Drafting runs, asks filter approval, then joins Message Drafting. If filters are skipped, invoke only Message Drafting and move to Messages/message review.",
375
375
  parentThreadRule: 'Named agents are optional acceleration, but message drafting is not optional. The only normal background worker is Message Drafting. The filter-choice answer is the campaign-scoped go-ahead for this single post-import worker; do not ask another question to start it in step-wise or YOLO mode. If a named agent is unavailable, use a generic gpt-5.5 xhigh Message Drafting background agent. source work and filter work stay in the parent thread with MCP tools. If post-find-leads-message-scout is available, run it as the background Message Draft Builder after the filter-choice answer. The registry lookup is not a launch: get_post_find_leads_scout_registry only identifies the worker, and Message Drafting counts as started only after Task/spawn_agent or the host background-agent tool is invoked, or after the parent begins the same full message branch inline because no background-agent tool is callable. This launch must happen before loading filter-leads.md, save_rubrics, filter approval, or skip-filter message review; currentStep=messages is not proof of launch. If post-find-leads-message-scout is absent, do not customer-surface install status. Do not silently treat message drafting as started; the main thread must either launch the background worker or execute the same message branch from CampaignOffer state, selected source state, workflowTableId, and initial campaign-table execution slice rows. For a spawned worker, record workerDetails.messageDraftBuilder with statusSource branch / status branch-running, runId, startedAt, updatedAt, and basis containing campaignId, selectedLeadListId, workflowTableId, filterChoice, and reviewBatchRowHash or reviewBatchRowIds. workerStatuses.messageDraftBuilder is optional simple badge text only ("running", "ready", "blocked", "idle"); never put runId/statusSource/basis under workerStatuses and never use workerStatuses.messageDrafting. If no background-agent tool is callable, start that same full message branch inline before filter drafting or before skip-filter message review, record workerDetails.messageDraftBuilder with statusSource parent-thread-fallback / status fallback-active then ready, and require the same live context, prompt, assets, and validation gate before message review; do not report that as a background worker failure. If neither branch nor inline fallback can run, return blocked/retry-needed; do not wait until filters are saved and then call the registry. The Message Drafting handoff must be lean. Do not paste copied row counts, brief hashes, review-batch hashes, full reviewBatchRowIds, broad row data, or local debug artifacts into the spawn prompt. Local markdown/json files are not normal-path inputs. The filter-choice question is the first post-import user gate; do not load post-lead registries or filter references before it. Message drafting starts after the filter-choice answer, must load get_subskill_prompt({ subskillName: "generate-messages" }), and must load every required message asset named by generate-messages Mode 0 through get_subskill_asset before drafting. Reference Asset Loading means loading the required pre-draft reference pack before drafting; return blocked/retry-needed if required assets cannot be loaded; load ai-tells.md because it is never optional. The branch or parent-thread fallback loads the full generate-messages prompt and every referenced asset through get_subskill_asset. After generating/revising the candidate and before returning ready, must load get_subskill_prompt({ subskillName: "create-campaign-v2-validation" }) as the final internal validation gate, must read live campaign table state through scoped MCP/product tools, and must reject mismatched selectedLeadListId/workflowTableId/campaign/workspace input. Do not block when filters were chosen but leadScoringRubrics are not yet visible in the branch read; the parent owns save_rubrics and filter approval in parallel, so Message Drafting should return status ready with basisStatus usable_initial when campaign/list/table identity and the non-empty execution slice match. Do not use any alternate, local-artifact, or examples-only message prompt. User copy feedback, message QA, or rewrite requests before approve-message must be routed back to Message Drafting with the current recommendation, lean campaign/table basis, and latest user text; the parent must not rewrite or QA the template from memory and must not call update_campaign_brief before approve-message. The worker validates internally and returns only templateRecommendation, tokenFillRules, renderedGoodSample, status, approveOrReviseRecommendation, validationStatus, outputAt, outputHash, and blocked/retry detail. Do not render renderedFallbackSample, risk notes, or a qaReceipt on the normal happy path. On the filter path, save_rubrics keeps the browser on Filter Rules after save_rubrics so the user can approve the saved criteria; after saved-filter approval, move to Filter Leads with currentStep=apply-icp-rubric whether Message Drafting is ready or still running. Wait there for message approval. Enrichment, filtering, Generate Message cells, sender setup, sequence attach, and launch wait for template approval on the Use Template path. On the skip path, move to Messages/message review after Message Drafting has started or is ready and wait for message approval before enrichment or Settings. Do not render message review from checklist or shortcut instructions; message review requires a messageDraftRecommendation whose basis proves the generate-messages prompt, required message assets, and validation gate ran for the current campaign/table execution slice. Do not automatically rerun Message Drafting after filters/enrichment finish; show the initial draft by default and offer an enriched rewrite only with explicit user opt-in. Handoff and recommendation output are Markdown with labeled fields, not raw JSON.',
376
- prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }) and get_campaign_refill_state before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation: calculate the bounded target from sender capacity when needed, then use the refill workflow to decide same-campaign source replenishment, enrichment/prep, approval/ready state, scheduler reread, and sender-health blockers. Do not create warm-post-engager side campaigns. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; inspect reviewBatch/table selectors or use adaptive/wider bounded prep so appended rows are included. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor. Before source import, prep, or approval, require exact visible approval and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested, but still do not launch. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if scheduler-owned scheduledFor cells are not present, report prepared/approved/ready - awaiting scheduler instead of success. Do not call start_campaign as part of fill/schedule horizon. Do not call start_campaign as part of refill sends. Launch/start is a separate explicit human action after the operator intentionally wants sends to go out, and it must still verify that the bounded cohort is the only approved cohort and must not broad approve-all. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane. start_campaign remains forbidden until explicit launch/start approval outside refill sends.`,
376
+ prepareMessagesRule: `Default create-campaign stays on the existing reviewBatchLimit:15 first campaign-table execution slice. For plain post-mint fill/load/refill requests, load get_subskill_prompt({ subskillName: "refill-sends-workflow" }), then call resolve_campaign_fill_route({ intent:"plain" }), list_senders, and get_campaign_refill_state for enough candidate campaigns to identify the campaign that most recently had scheduler-owned sends for the relevant sender set before any mutation. Route outcomes are route:"evergreen_horizon", route:"active_campaigns", and route:"ask_create"; stay in the same campaignOfferId/campaignId context after minting. Plain fill is not an alias for fill_campaign_horizon or campaign creation. fill_campaign_horizon is evergreen-only and is not the generic regular-campaign fill path. Campaign creation is allowed only after route:"ask_create" and explicit user selection; it is never the default response to plain fill. Treat "fill up/load sends" as capacity-fill preparation: calculate the bounded target from sender capacity when needed, then use the refill workflow to decide whether to enrich/prep more rows in that same recent-send campaign, add/import more rows to that same campaign/source path, use a different existing campaign only when the recent-send lane is blocked/exhausted, or ask what to create. Do not create warm-post-engager side campaigns. User-facing refill decisions must be campaign-name-first and sender-name-first, with ids as proof/execution targets only. For already-running regular campaigns that need Signal Discovery source replenishment, use the guarded currentStep clear with clearCurrentStepIfMatches:"running", campaign-scoped provider prompt/search/select, and import_leads with the existing sourceLeadListId when a newly approved selected-post scrape would otherwise return reusedExistingSourceList. After confirm_lead_list copies rows into an existing table, avoid fixed maxRowsToCheck:100; inspect reviewBatch/table selectors or use adaptive/wider bounded prep so appended rows are included. Do not interpret checkedRows as enriched rows; it is only the table cursor. Prepared, approved, and ready_to_schedule rows are intermediate states; never call them scheduled unless a re-read proves scheduler-owned scheduled cells with non-null scheduledFor. Before source import, prep, or approval, require exact visible approval and a fresh get_campaign_refill_state reread; stop if freshness.stateHash or exact ids changed. For "approve X messages", use approvalMode:approve only when explicitly requested, but still do not launch. For "schedule X sends" or "fill sender sends", approve only when explicitly requested, then re-read campaign/table scheduled counts; if scheduler-owned scheduledFor cells are not present, report prepared/approved/ready - awaiting scheduler instead of success. Do not call start_campaign as part of fill/schedule horizon. Do not call start_campaign as part of refill sends. Launch/start is a separate explicit human action after the operator intentionally wants sends to go out, and it must still verify that the bounded cohort is the only approved cohort and must not broad approve-all. campaignId is CampaignOffer.id. If the user asks to stop preparation, the target is wrong, or status shows the wrong campaign/table, use cancel_campaign_message_preparation only for the exact active job. Low-level selectors are diagnostics and recovery only for this lane. start_campaign remains forbidden until explicit launch/start approval outside refill sends.`,
377
377
  },
378
378
  };
379
379
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.394",
3
+ "version": "0.1.396",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code and Codex campaign workflows",
6
6
  "main": "dist/index.js",
@@ -123,6 +123,7 @@ such as "fill campaigns", "fill up", "refill sends", "max out sends", or
123
123
  ```text
124
124
  get_subskill_prompt({ subskillName: "refill-sends-workflow" })
125
125
  resolve_campaign_fill_route({ intent:"plain" })
126
+ list_senders
126
127
  get_campaign_refill_state
127
128
  ```
128
129
 
@@ -133,15 +134,20 @@ campaign refill. Route outcomes are `route:"evergreen_horizon"`,
133
134
  returns `route:"ask_create"`, ask whether to create a normal campaign or
134
135
  evergreen campaigns. Campaign creation is allowed only after this route and
135
136
  explicit user selection; it is never the default response to plain fill. When
136
- more leads are needed, the refill workflow must recommend same-campaign
137
- source-ladder replenishment; do not create warm-post-engager side campaigns,
138
- on-demand campaigns, or unrelated campaigns. Surface sender-health blockers
139
- separately from prepared/approved/scheduled counts.
137
+ choosing among active targets, use refill-state scheduled-count evidence to
138
+ continue the campaign that most recently had scheduler-owned sends for the
139
+ relevant sender set; do not treat every active campaign as a refill candidate.
140
+ When more leads are needed, the refill workflow must recommend same-campaign
141
+ source-ladder replenishment first; do not create warm-post-engager side
142
+ campaigns, on-demand campaigns, or unrelated campaigns. Surface sender-health
143
+ blockers separately from prepared/approved/scheduled counts.
140
144
 
141
145
  Treat active fills as capacity-fill preparation: calculate the bounded target
142
146
  from sender capacity when needed, then use the refill workflow to decide source
143
- replenishment, enrichment/prep, approval policy, and scheduler proof. Mutation
144
- requires exact visible approval and a fresh `get_campaign_refill_state` reread.
147
+ replenishment, enrichment/prep, approval policy, and scheduler proof. Present
148
+ operator decisions by campaign name and sender name first, with campaign/table
149
+ ids as proof only. Mutation requires exact visible approval and a fresh
150
+ `get_campaign_refill_state` reread.
145
151
  For already-running regular campaigns that need Signal Discovery source
146
152
  replenishment, the refill workflow owns the guarded recovery: clear
147
153
  `currentStep` only with `clearCurrentStepIfMatches:"running"`, load the
@@ -58,22 +58,6 @@ Default evergreen plan per workspace (override only if the prompt specifies diff
58
58
  1. **`<Sender Name> - Post Engagers`** — one per sender (warm lane, highest priority)
59
59
  2. **`<Workspace/Team> - Shared Signal Discovery`** — one shared warm-signal campaign lane across senders
60
60
  3. **`<Workspace/Team> - Shared Cold Fallback`** — one shared cold/fallback campaign lane across senders
61
-
62
- Sender scope resolution is safety-critical. Do not pass
63
- `allConnectedSenders:true` unless the invoking prompt explicitly says "all
64
- connected senders", "every connected sender", "all seats", or names an
65
- equivalent all-sender scope. If the user says "all 4 campaigns", "the four
66
- evergreen campaigns", or names specific senders, resolve those exact senders
67
- and pass explicit `postEngagerSenderIds` plus `sharedSenderIds`; do not broaden
68
- the plan to every connected sender. In non-interactive or `--yolo` mode, when
69
- more than two connected senders exist and the prompt does not explicitly
70
- authorize all connected senders, stop before mutation with
71
- `blocked: ambiguous_post_engager_sender_scope` and report the sender ids/names
72
- needed for approval. Never let "workspace default" silently create Post
73
- Engagers lanes for extra senders.
74
- Short form: Do not pass `allConnectedSenders:true` unless the prompt explicitly says all/every connected sender.
75
- Short form: "all 4 campaigns" means explicit sender scope plus two shared lanes, not all connected senders.
76
- Short form: In `--yolo`, ambiguous multi-sender scope blocks before mutation.
77
61
  </inputs>
78
62
 
79
63
  <command_backed_workflow>
@@ -231,8 +215,7 @@ After bounded delegated approval or safe `--yolo`, fan out lane worker tasks
231
215
  only from the current plan. Each worker receives the complete lane packet:
232
216
  workspace id, sender ids, lane key/type, existing campaign/table binding or
233
217
  create intent, source hints, caps, planRevision, actionId, allowed side effects,
234
- postconditions, the parent `postEngagerSenderIds`, the parent
235
- `sharedSenderIds`, and the packet's `workerDispatch` policy. Treat
218
+ postconditions, and the packet's `workerDispatch` policy. Treat
236
219
  `workerDispatch.requiresVisibleThreadOrDurableReceipt:true` as a hard
237
220
  execution boundary, not guidance. Read and preserve `workerDispatch.acceptedRuntimes`,
238
221
  `workerDispatch.rejectedRuntimes`, and `workerDispatch.receiptArtifactHint`
@@ -251,15 +234,6 @@ parent packet, do not mutate and do not use it as `setupPlanCall` proof; stop
251
234
  with `blocked: worker_plan_scope_drift` and ask the parent to re-plan.
252
235
  Short form: If a worker-local plan omits `postEngagerSenderIds:[]`, do not use it as `setupPlanCall` proof.
253
236
  Short form: stop with `blocked: worker_plan_scope_drift`.
254
- Every worker prompt must include both parent scope arrays as explicit fields:
255
- `Parent postEngagerSenderIds:` and `Parent sharedSenderIds:`. Workers must
256
- preserve parent postEngagerSenderIds even for shared lanes. Never run a
257
- shared-lane worker-local plan with `postEngagerSenderIds:[]` unless the parent
258
- `postEngagerSenderIds` is exactly `[]`. Every durable receipt must copy these
259
- arrays to top-level `parentPostEngagerSenderIds` and `parentSharedSenderIds`
260
- before completion.
261
- Short form: Workers must preserve parent postEngagerSenderIds even for shared lanes.
262
- Short form: Never run a shared-lane worker-local plan with `postEngagerSenderIds:[]` unless the parent `postEngagerSenderIds` is exactly `[]`.
263
237
 
264
238
  Worker fan-out must use visible or durable execution. Preferred in local Codex
265
239
  is a visible Codex thread created with the actual Codex app thread tools:
@@ -290,36 +264,10 @@ CLI builds that expose `-a`/`-s` only at top level. Do not use
290
264
  forms fail on current customer CLI installs. Pipe the lane packet prompt on
291
265
  stdin, require the worker to write `workerDispatch.receiptArtifactHint`, and
292
266
  pass exactly one lane packet per worker.
293
- When wrapping multiple local Codex CLI workers in a shell launcher, run the
294
- wrapper with `/bin/bash -lc` or another explicitly chosen portable shell. Do not
295
- rely on zsh-specific behavior. Do not use `status` as a shell variable because
296
- zsh treats it as read-only; use `exit_code` or `rc` instead. Receipt polling
297
- must use `find <receipt-dir> -maxdepth 1 -name 'evg_*.json' -print` or an
298
- explicit nullglob-safe equivalent. Do not use naked `*.json` globs under zsh,
299
- and keep zero-receipt polls quiet with no `no matches found` diagnostics.
300
- Do not embed `<<'WORKER_PROMPT'` heredocs inside a single quoted or double
301
- quoted `/bin/bash -lc '...'` command string; nested quoting is brittle and can
302
- truncate the first worker before mutation. For multi-worker launchers, write one
303
- plain prompt file per lane under the current run directory, then start each
304
- worker with `codex -a never -s danger-full-access exec -C "$REPO" -o
305
- "$worker_final_file" - < "$worker_prompt_file"`. Keep launcher shell variables
306
- double-quoted and keep the prompt heredoc only in a standalone script/prompt-file
307
- write step, not inside an already quoted shell argument. If the first launcher
308
- attempt exits with a shell parse error or before starting the first worker,
309
- stop with `blocked: worker_launcher_quoting_failed` and do not retry by
310
- loosening sender scope or mutating in the parent.
311
- Short form: run the wrapper with `/bin/bash -lc`.
312
- Short form: Do not rely on zsh-specific behavior.
313
- Short form: Do not use `status` as a shell variable; use `exit_code` or `rc`.
314
- Short form: Receipt polling uses `find <receipt-dir> -maxdepth 1 -name 'evg_*.json' -print`.
315
- Short form: Do not use naked `*.json` globs under zsh; no `no matches found` diagnostics.
316
- Short form: Do not embed `<<'WORKER_PROMPT'` heredocs inside a quoted `/bin/bash -lc` command string.
317
- Short form: Multi-worker launchers write prompt files and run `codex ... - < "$worker_prompt_file"`.
318
267
  After creating receipt directories, dispatch workers immediately; do not perform extended parent reasoning, extra inventory, or prompt rewriting loops.
319
268
  Use a compact worker prompt: include lane packet JSON, original selectedActionIds,
320
- original planRevision, parent postEngagerSenderIds, parent sharedSenderIds,
321
- receiptArtifactPath, workspace id, sender ids, side-effect caps, and the
322
- instruction to load packaged prompts through MCP.
269
+ original planRevision, receiptArtifactPath, workspace id, sender ids,
270
+ side-effect caps, and the instruction to load packaged prompts through MCP.
323
271
  Do not paste the entire wrapper skill into worker prompts. If the parent cannot
324
272
  launch at least one visible/durable worker immediately after directory setup,
325
273
  stop with `blocked: worker_dispatch_stalled` before any mutation.
@@ -328,11 +276,8 @@ current lane packet for receipt paths.
328
276
  Do not hardcode machine-specific paths, workspace ids, campaign ids, sender ids, or UAT/phase artifact paths in this MCP prompt or any worker prompt.
329
277
  After the receipt-directory `mkdir`, the next shell/tool call must launch the first lane worker.
330
278
  Do not run `find`, `ls`, extra inventory, or another preflight between directory setup and the first worker launch.
331
- For the local Codex CLI fallback, use this literal durable CLI worker launch
332
- template and fill only the lane-specific placeholders. For one-off direct worker
333
- launches you may pipe a heredoc directly to `codex`; for multi-worker shell
334
- launchers, write the same prompt body to `<worker-prompt-file>` and launch the
335
- worker with stdin redirected from that file:
279
+ For the local Codex CLI fallback, use this literal durable CLI worker launch template
280
+ and fill only the lane-specific placeholders:
336
281
 
337
282
  ```
338
283
  codex -a never -s danger-full-access exec -C <repo> -o <worker-final-file> - <<'WORKER_PROMPT'
@@ -341,8 +286,6 @@ Use $sellable:create-evergreen-campaigns as the governing skill for this one lan
341
286
  Workspace id: <workspaceId>
342
287
  Parent planRevision: <planRevision>
343
288
  Parent selectedActionIds: <selectedActionIds JSON>
344
- Parent postEngagerSenderIds: <postEngagerSenderIds JSON>
345
- Parent sharedSenderIds: <sharedSenderIds JSON>
346
289
  Action id: <actionId>
347
290
  Lane key: <laneKey>
348
291
  Allowed side effects: <allowedSideEffects JSON>
@@ -356,9 +299,6 @@ Use mcp__sellable only. Do not use admin tools, direct DB, Prisma, SQL, web sear
356
299
  Do not launch, start, schedule, send, or use paid InMail.
357
300
  Complete only this lane, write the required durable receipt JSON, and stop.
358
301
  WORKER_PROMPT
359
-
360
- # Multi-worker launcher equivalent:
361
- codex -a never -s danger-full-access exec -C <repo> -o <worker-final-file> - < <worker-prompt-file>
362
302
  ```
363
303
 
364
304
  If any placeholder cannot be filled from the current lane packet, do not inspect
@@ -428,14 +368,7 @@ not a parent-thread summary. The receipt must include:
428
368
  `senderIds`, `campaignId`, `tableId`, and `createIntent`. Do not use
429
369
  `laneActionId`, `lanePacketActionId`, `delegatedPlanRevision`,
430
370
  `delegatedActionId`, or freeform `requestedCall` text as a substitute for
431
- these fields. For create lanes, `setupPlanCall.campaignId` and
432
- `setupPlanCall.tableId` must be the actual created campaign/table ids after
433
- creation and readback. If the parent lane packet carried null ids before
434
- creation, preserve that original packet only in a separate `parentLanePacket`
435
- object; do not leave `setupPlanCall.campaignId:null` or
436
- `setupPlanCall.tableId:null`.
437
- Short form: For create lanes, `setupPlanCall.campaignId` and `setupPlanCall.tableId` must be the actual created campaign/table ids.
438
- Short form: Do not leave `setupPlanCall.campaignId:null` or `setupPlanCall.tableId:null`.
371
+ these fields.
439
372
  - `createCampaignWorkflowReceipt`: proof the worker loaded the actual installed
440
373
  `$sellable:create-campaign` wrapper instead of doing ad hoc MCP calls. It must
441
374
  include `skillCommand:"$sellable:create-campaign"`,
@@ -490,19 +423,8 @@ not a parent-thread summary. The receipt must include:
490
423
  evidence field such as `rowCount`, `rowIdsHash`, or `rowEvidence`; do not
491
424
  leave those only in `searchSignalsProof`, `importProof`, `coldFallbackProof`,
492
425
  or narrative text for the parent/verifier to infer.
493
- - `filterDecisionReceipt`: saved/applied ICP filter proof for the current
494
- campaign/table basis. Customer-visible evergreen lanes must enable ICP
495
- filtering with `enableICPFilters:true`, call `save_rubrics`, and save at
496
- least three rubric/filter criteria before Message Drafting. Do not skip
497
- filtering for evergreen setup. Missing or skipped filter proof is
498
- `blocked: missing_filter_setup`.
499
- Before the worker exits, the durable JSON must contain
500
- `filterDecisionReceipt.status:"applied"`,
501
- `filterDecisionReceipt.enableICPFilters:true`, the current
502
- `workflowTableId`, and concrete saved-filter proof such as
503
- `filterDecisionReceipt.filterIds`, `filterDecisionReceipt.rubricIds`,
504
- `filterDecisionReceipt.savedRubricCount`, or
505
- `filterDecisionReceipt.headlineICPCriteria`.
426
+ - `filterDecisionReceipt`: saved/applied filter ids or explicit skip-filter
427
+ decision with current campaign/table basis.
506
428
  - `messageDraftingReceipt`: the Message Drafting proof described below,
507
429
  including packaged `generate-messages` prompt/assets and validation. Raw
508
430
  fields like `generateMessagesPromptLoadedToHasMoreFalse`,
@@ -638,12 +560,7 @@ verification unless the same object also appears inside
638
560
  "sourceLadderReason": "<why the current source is valid before colder sources>"
639
561
  },
640
562
  "filterDecisionReceipt": {
641
- "status": "applied",
642
- "enableICPFilters": true,
643
- "filterIds": ["<saved filter/rubric id>"],
644
- "rubricIds": ["<saved rubric id>"],
645
- "headlineICPCriteria": ["<saved ICP criterion>", "<saved ICP criterion>", "<saved ICP criterion>"],
646
- "savedRubricCount": 3,
563
+ "status": "skipped",
647
564
  "workflowTableId": "<workflow table id>"
648
565
  },
649
566
  "messageDraftingReceipt": {
@@ -724,19 +641,6 @@ path itself in the worker thread:
724
641
  exactly one semantic Approved cell through `select_campaign_cells` and
725
642
  `update_cell`.
726
643
  Approval shorthand: approve exactly one semantic Approved cell.
727
- In this message-drafting path, `update_cell` is allowed only for the semantic
728
- Approved checkbox. Do not use `update_cell` or any row/cell write to edit
729
- generated message text, sample copy, or final message bodies in automation.
730
- If generated copy fails review, update the campaign brief/message template
731
- with `update_campaign_brief` or `revise_message_template_and_rerun`, then
732
- rerun Generate Message and review current-revision generated output. Receipt
733
- `sampleMessages` must come from generated current-revision cells after the
734
- brief/template rerun, not from hand-edited message cell overrides. If a lane
735
- used a generated-message body override, report
736
- `blocked: generated_message_cell_override` instead of success.
737
- Short form: `update_cell` is allowed only for the semantic Approved checkbox.
738
- Short form: Do not use `update_cell` to edit generated message text.
739
- Short form: Bad copy requires brief/template revision plus Generate Message rerun.
740
644
  4. Poll `get_campaign_message_preparation_status` until no queued/active cells
741
645
  remain or a bounded stop reason is returned.
742
646
  5. Use `get_campaign_messages_preview` or `select_campaign_cells` to inspect
@@ -763,26 +667,6 @@ The only accepted statusSource values are exactly `branch` and
763
667
  `packaged-generate-messages-worker`; descriptive aliases such as
764
668
  `package-readback-local-thread` are rejected.
765
669
 
766
- Before any provider-specific source mutation for a newly created campaign,
767
- reread `get_campaign_navigation_state({ campaignId })` and use that product
768
- navigation state as the source-step authority. Do not jump from a shell directly
769
- into `contact-search`, and do not jump from a shell directly into
770
- `signal-discovery`. Advance through the product-visible source-selection step
771
- first, then load the provider prompt and write only the provider/source fields
772
- accepted for that current step. Never include sender reassignment fields in
773
- source-step updates, never include custom narration fields in source-step
774
- updates, and do not use guessed `currentStep` or watched narration payloads to
775
- force the flow forward. If `update_campaign` rejects the source transition
776
- twice, reread navigation/campaign state once; if the campaign is not already on
777
- the intended source step, stop the lane with
778
- `blocked: watched_source_transition_blocked` and include the rejected tool
779
- result plus the readback. Do not loop on rejected `update_campaign` transitions.
780
- Short form: do not jump from a shell directly into `contact-search`.
781
- Short form: do not jump from a shell directly into `signal-discovery`.
782
- Short form: never include sender reassignment fields in source-step updates.
783
- Short form: never include custom narration fields in source-step updates.
784
- Short form: do not loop on rejected `update_campaign` transitions.
785
-
786
670
  One lane may produce exactly one CampaignOffer/campaign id and one current
787
671
  workflow table id. For `intent:"create"`, the first successful
788
672
  `create_campaign` result establishes the lane's only allowed campaign/table
@@ -821,14 +705,9 @@ the prospect's engagement unless the selected source evidence proves that exact
821
705
  sender authored the post.
822
706
  Shared lanes must reject generic product-summary samples that explain the
823
707
  product in the same broad words for every row. Shared lanes must reject three
824
- nearly identical samples after stripping the leading name. Shared lanes must
825
- fail quality review when any reviewed sample has non-empty `issues`; do not
826
- approve or final-report samples with `verdict:"passed"` and non-empty `issues`.
827
- If any of these failures appears, revise or rerun the packaged
828
- create-campaign/generate-messages path from the lane worker before writing a
829
- success receipt.
830
- Short form: Shared lanes must fail quality review when any reviewed sample has non-empty `issues`.
831
- Short form: Do not approve or final-report samples with `verdict:"passed"` and non-empty `issues`.
708
+ nearly identical samples after stripping the leading name. If either failure
709
+ appears, revise or rerun the packaged create-campaign/generate-messages path
710
+ from the lane worker before writing a success receipt.
832
711
  The generated-message cells are not prompt proof: `currentRevisionGeneratedMessages`,
833
712
  Generate Message column counts, `messagesCount`, or rendered row previews prove
834
713
  only that table cells exist from the current brief/template, not that the
@@ -912,9 +791,6 @@ Parent-thread handwritten copy or setting `currentStep` is not proof.
912
791
  say it. Prefer sender-agnostic company/team language such as "we're
913
792
  helping CX teams..." or "at cxconnect.ai, we help..." and one clear
914
793
  problem question.
915
- Short form: Shared Signal Discovery uses no self-intro such as "I'm building Sellable".
916
- Short form: Shared Signal Discovery uses no self-intro such as "We're building Sellable".
917
- Short form: Shared Signal Discovery uses no "I've put together".
918
794
  - **Shared Cold Fallback** first-message style: cold, direct, and cohesive.
919
795
  It must not pretend there was engagement, must not say "saw you pop up",
920
796
  and must not use a standalone name line followed by "Hey there" or other
@@ -931,38 +807,12 @@ Parent-thread handwritten copy or setting `currentStep` is not proof.
931
807
  create-campaign message workflow proves a better delivery format.
932
808
  Short form: Shared Cold Fallback must not pass just because the receipt says `generate-messages` loaded.
933
809
  Short form: Shared Cold Fallback uses no self-intro such as "We're building".
934
- Short form: Shared Cold Fallback uses no self-intro such as "I'm building Sellable".
935
- Short form: Shared Cold Fallback uses no "I've put together".
936
810
  Short form: Shared Cold Fallback uses no opt-out shrug such as "If this isn't relevant, ignore me".
937
811
  Short form: Shared Cold Fallback uses no product-stack dump.
938
- - Customer-visible evergreen lanes must enable ICP filtering before Message
939
- Drafting. This applies to Post Engagers, Shared Signal Discovery, and
940
- Shared Cold Fallback. Do not skip filtering for evergreen setup, even when
941
- the source is warm. Use the normal `$sellable:create-campaign` filter
942
- workflow: set or save 3-5 headline ICP criteria, call `save_rubrics`, and
943
- persist `enableICPFilters:true` on the campaign before generating
944
- messages. Good evergreen filters should be light but real: role/budget
945
- relevance, company/market fit, and obvious non-buyer exclusion. For
946
- Post Engagers, keep filters permissive enough that warm source rows are not
947
- over-pruned, but still save the filter rules. For shared lanes, filter for
948
- buyers/operators relevant to the workspace offer and exclude students,
949
- job seekers, vendors, and off-topic commenters. The receipt must show
950
- `filterDecisionReceipt.status:"applied"`,
951
- `filterDecisionReceipt.enableICPFilters:true`, current `workflowTableId`,
952
- and saved filter/rubric proof with at least three saved rubric/filter
953
- criteria (`filterIds`, `rubricIds`, `headlineICPCriteria`, or
954
- `savedRubricCount`). Missing or skipped filter proof is
955
- `blocked: missing_filter_setup`.
956
- Short form: Customer-visible evergreen lanes must enable ICP filtering.
957
- Short form: `enableICPFilters:true`.
958
- Short form: Do not skip filtering for evergreen setup.
959
- Short form: at least three saved rubric/filter criteria.
960
- Short form: missing or skipped filter proof is `blocked: missing_filter_setup`.
961
- Short form: run Message Drafting only after saved filters are applied.
962
- - Every customer-visible lane must run Message Drafting from the current
963
- campaign/table basis after source rows exist. The worker must load the full
964
- packaged `generate-messages` prompt, every required asset, and
965
- `create-campaign-v2-validation`; if the internal branch handoff is not
812
+ - Every customer-visible lane must run Message Drafting from the current
813
+ campaign/table basis after source rows exist. The worker must load the full
814
+ packaged `generate-messages` prompt, every required asset, and
815
+ `create-campaign-v2-validation`; if the internal branch handoff is not
966
816
  callable in the packaged runtime, the worker must call
967
817
  `start_campaign_message_preparation` and poll
968
818
  `get_campaign_message_preparation_status` from the lane worker. The
@@ -992,13 +842,10 @@ Parent-thread handwritten copy or setting `currentStep` is not proof.
992
842
  - A source/list decision has been resolved and campaign rows are loaded. If
993
843
  there is no approved source or no rows can be copied, report `blocked` with
994
844
  the missing source detail; do not call the campaign complete.
995
- - The filter step is resolved with saved/applied filters. Customer-visible
996
- evergreen lanes must have `enableICPFilters:true`, at least three saved
997
- ICP filter/rubric criteria, and a receipt with
998
- `filterDecisionReceipt.status:"applied"`. Do not skip filters for
999
- evergreen setup. Do not leave customer-visible campaigns at
1000
- `filter-choice`, `filter-rules`, or `apply-icp-rubric` and report success.
1001
- Do not proceed to Message Drafting until saved filters are applied.
845
+ - The filter step is resolved: either saved/applied filters are present, or
846
+ the campaign explicitly skipped filters. Do not leave customer-visible
847
+ campaigns at `filter-choice`, `filter-rules`, or `apply-icp-rubric` and
848
+ report success.
1002
849
  - Message Drafting has run from the current campaign/table basis, using the
1003
850
  create-campaign message prompt/assets and validation gate. Updating
1004
851
  `currentStep:"messages"` is not proof. Parent-thread handwritten copy is
@@ -1017,16 +864,13 @@ Parent-thread handwritten copy or setting `currentStep` is not proof.
1017
864
  reviewed sample messages. For Shared Cold Fallback, reject samples that
1018
865
  open with a standalone name followed by "Hey there" or a similarly generic
1019
866
  greeting. For Shared Cold Fallback, also reject samples with a self-intro
1020
- such as "We're building", "I'm building Sellable", or "I've put
1021
- together", an opt-out shrug such as "If this isn't relevant, ignore me",
1022
- or a product-stack dump that repeats the same
867
+ such as "We're building", an opt-out shrug such as "If this isn't
868
+ relevant, ignore me", or a product-stack dump that repeats the same
1023
869
  Sellable/Codex/Claude-Code feature summary across prospects. For all
1024
870
  shared lanes, reject generic product-summary samples, repeated
1025
- near-identical samples, any sample with non-empty `issues`, and any
1026
- preserved Post Engagers opener; revise or rerun the packaged
1027
- create-campaign/generate-messages path before reporting completion. Do not
1028
- approve or final-report samples with `verdict:"passed"` and non-empty
1029
- `issues`.
871
+ near-identical samples, and any preserved Post Engagers opener; revise or
872
+ rerun the packaged create-campaign/generate-messages path before reporting
873
+ completion.
1030
874
  - The first review batch exists and at least 3 review rows have generated
1031
875
  messages from the approved brief. If fewer than 3 usable rows exist, report
1032
876
  the actual count and why.
@@ -1100,9 +944,7 @@ Parent-thread handwritten copy or setting `currentStep` is not proof.
1100
944
  **Also confirm the delivery format and keep config in sync.** Ask the user whether DM lanes should send multiline (paragraph-per-message) or as a single message. Record the answer as the brief's `Delivery format:` line, and when multiline is chosen, set `actionConfig.sendEachParagraphAsMessage: true` on that campaign's `send_dm` column via `update_column` (config edits run no cells and nothing sends from unlaunched campaigns). Never set the paragraph-split flag on InMail columns — the option does not apply to InMail.
1101
945
  6. **Interactive polish mode only: prove the template on one real row.** For ONE campaign that has at least one lead row (add one via `add_on_demand_leads` if every lane is empty and the user provides/approves a test lead), generate a message for exactly one row (`queue_campaign_cells` with `columnRole: "generateMessage"`, `rowSelector: { type: "reviewBatch", limit: 1 }` or the single row's ID), wait for it, then show the user the generated message next to the template — AND show how it would split if paragraph-per-message sending is enabled (list each paragraph as `msg 1:`, `msg 2:`, …) so the user confirms each one reads like a real typed message. Check alignment: tone, structure, no internal vocabulary, correct token substitution, no letter punctuation. Do NOT approve the row or generate for more rows — one sample only.
1102
946
  7. **Automation mode template/config audit**: inspect existing send-lane briefs for a `Delivery format:` line and chat-native warm template. If a send lane is missing the line and the prompt allows cleanup, update only the campaign brief metadata with the safest default for that lane (`Delivery format: single message (LinkedIn DM; line breaks remain inside one generated message; no follow-up until reply)`). If cleanup is not allowed, flag it. Do not generate a sample row in automation mode unless the invocation explicitly asks for sample proof. In structure-only automation, do not generate a sample row unless the invocation explicitly asks for sample proof. In customer-visible completion, follow the Customer-Visible Completion Contract instead.
1103
- 8. **Final customer-facing completion must include sample messaging**: after customer-visible verify and the idempotency rerun pass, add a `Sample Messaging Review` section to the final answer. For every completed lane, show at least one full generated first message for every completed lane with campaign name, campaign id, row id, and verdict. Extract samples from nested `createCampaignStepReceipt.messageDraftingReceipt.sampleMessages`, not from top-level summaries; extract samples from nested `createCampaignStepReceipt.messageDraftingReceipt.sampleMessages` when building the final answer. Prefer the approved route-proof row when it is quality-valid; otherwise use the best reviewed generated row from the verified receipt. A final `passed` sample must have `issues:[]`; if every reviewed sample has issues, report the lane as needing message revision instead of presenting a passed sample. Do not summarize the sample into a copy theme. Show the actual message text so the user can inspect tone and specificity. If any sample is not quite right, tell the user they can ask the AI to update the campaign brief/message template and rerun Generate Message before launch. Never suggest launching, scheduling, or sending as the next step from this command.
1104
- If the `Sample Messaging Review` section is omitted, the command is incomplete even when the structural campaign setup succeeded.
1105
- 9. **Report the reconcile plan and result** — every slot tagged `reused`, `created`, `repaired`, `flagged`, or `blocked`, plus template/sample details only when that mode ran:
947
+ 8. **Report the reconcile plan and result** every slot tagged `reused`, `created`, `repaired`, `flagged`, or `blocked`, plus template/sample details only when that mode ran:
1106
948
 
1107
949
  ```
1108
950
  Evergreen Reconcile — {date}
@@ -1111,17 +953,6 @@ Evergreen Reconcile — {date}
1111
953
  • Sellable.dev - Shared Signal Discovery: repaired (send review ready; 50 rows, 3 generated, 1 approved gate row, sequence attached, paused)
1112
954
  • Sellable.dev - Shared Cold Fallback: created (send review ready; 50 rows, 3 generated, 1 approved gate row, sequence attached, paused)
1113
955
  All campaigns remain unlaunched. Next: enrich/approve more rows when you want more items ready to schedule.
1114
-
1115
- Sample Messaging Review
1116
- • Christian Reyes - Post Engagers (`cmp_...`, row `row_...`, verdict: passed)
1117
- ```
1118
- {{full generated first message}}
1119
- ```
1120
- • Sellable.dev - Shared Cold Fallback (`cmp_...`, row `row_...`, verdict: passed)
1121
- ```
1122
- {{full generated first message}}
1123
- ```
1124
- If any sample is not quite right, ask the AI to update the campaign brief/message template and rerun Generate Message before launch.
1125
956
  ```
1126
957
  </objective>
1127
958
 
@@ -5,6 +5,9 @@ visibility: public
5
5
  allowed-tools:
6
6
  - mcp__sellable__get_subskill_prompt
7
7
  - mcp__sellable__search_subskill_prompts
8
+ - mcp__sellable__list_senders
9
+ - mcp__sellable__get_sender_routing
10
+ - mcp__sellable__get_campaign_waterfall
8
11
  - mcp__sellable__resolve_campaign_fill_route
9
12
  - mcp__sellable__get_campaign_refill_state
10
13
  - mcp__sellable__fill_campaign_horizon
@@ -51,10 +54,11 @@ get_subskill_prompt({ subskillName: "refill-sends-workflow" })
51
54
  ```
52
55
 
53
56
  Then follow that workflow exactly. The default path is read-only research:
54
- resolve the route, read target refill state, report the next safe step, and stop
55
- before mutation unless the user has explicitly approved the exact workspace,
56
- campaign/table/source ids, caps/dates, approval mode, expected side effects,
57
- and stop/rollback condition.
57
+ resolve the route, identify the sender-relevant campaign that most recently had
58
+ scheduler-owned sends, read refill state for that target, report the next safe
59
+ step using campaign names first, and stop before mutation unless the user has
60
+ explicitly approved the exact workspace, campaign/table/source ids, caps/dates,
61
+ approval mode, expected side effects, and stop/rollback condition.
58
62
 
59
63
  Public concepts are regular campaign and evergreen campaign. Internal direct
60
64
  campaign types are unsupported refill targets. `fill_campaign_horizon` is only a
@@ -3,6 +3,9 @@ name: refill-sends-workflow
3
3
  description: Internal skill-led refill sends workflow for regular campaigns and evergreen campaigns.
4
4
  visibility: internal
5
5
  allowed-tools:
6
+ - mcp__sellable__list_senders
7
+ - mcp__sellable__get_sender_routing
8
+ - mcp__sellable__get_campaign_waterfall
6
9
  - mcp__sellable__resolve_campaign_fill_route
7
10
  - mcp__sellable__get_campaign_refill_state
8
11
  - mcp__sellable__fill_campaign_horizon
@@ -52,11 +55,23 @@ Plain phrases that enter here include "fill", "refill sends", "max out sends",
52
55
  fill/load language, `intent:"active"` only when the user explicitly narrowed
53
56
  to active regular campaigns, and `intent:"evergreen"` only when the user
54
57
  explicitly asked for evergreen or horizon work.
55
- 2. Pick exact ids from the resolver result. Do not use campaign names or table
56
- names as target identifiers.
57
- 3. Call `get_campaign_refill_state` for the selected `campaignId` or `tableId`.
58
- This must be the next target-specific research primitive.
59
- 4. Classify the target from refill state:
58
+ 2. Resolve sender context before choosing a target. Call `list_senders`; when a
59
+ managed program is involved, also call `get_campaign_waterfall`, and call
60
+ `get_sender_routing` when territory rules may constrain sender eligibility.
61
+ If the user named senders, map those names to exact sender ids. If the user
62
+ did not name senders, infer the relevant senders from the most recent
63
+ scheduler-owned sends in refill-state readbacks and report that inference.
64
+ Short form: infer from the most recent scheduler-owned sends when the sender set is not explicit.
65
+ 3. Read `get_campaign_refill_state` for candidate campaigns from the resolver
66
+ result. For a broad `active_campaigns` route, inspect enough candidates to
67
+ identify the campaign or small campaign set that most recently had
68
+ scheduler-owned sends for the relevant sender set. Do not stop after the
69
+ first resolver target unless it is also the most recent sender-relevant send
70
+ lane.
71
+ Short form: Do not stop after the first resolver target unless recent-send evidence supports it.
72
+ 4. Pick exact ids from the selected refill-state response. Do not use campaign
73
+ names or table names as target identifiers for tool calls.
74
+ 5. Classify the target from refill state:
60
75
  - regular campaign: campaign-backed workflow table with normal source,
61
76
  sequence, senders, and send/refill stages.
62
77
  - evergreen campaign: managed always-on lane with current source evidence.
@@ -77,7 +92,10 @@ Use the refill-state response as the current facts receipt:
77
92
  approved, ready to schedule, scheduled;
78
93
  - active message prep job;
79
94
  - scheduler-owned scheduled counts by date/action from cells with non-null
80
- `scheduledFor`;
95
+ `scheduledFor`; treat these as the last sends/continuation signal;
96
+ - latest scheduled send date, latest scheduled-cell update when present,
97
+ sender overlap with the requested or inferred sender set, and whether future
98
+ scheduled sends already exist;
81
99
  - `freshness.stateHash` and exact campaign/table/workspace ids.
82
100
 
83
101
  Empty or unsafe states stop with the blocker: no fillable target, missing or deleted campaign,
@@ -89,9 +107,51 @@ scheduler, or unsupported direct campaign type.
89
107
 
90
108
  For regular campaign workspaces, rank regular campaigns from route and
91
109
  `get_campaign_refill_state` evidence. Choose the best existing refill target.
110
+ The default refill interpretation is "continue the campaign that was actually
111
+ sending most recently for the relevant available senders", not "touch every
112
+ active campaign".
113
+
114
+ Rank candidates in this order:
115
+
116
+ 1. **Sender match**: campaigns whose healthy sender ids match the user-named
117
+ senders, or the inferred sender set when the user said only "fill sends" or
118
+ "load senders". Do not include campaigns merely because they are active when
119
+ their sender set is unrelated.
120
+ 2. **Recent sends**: campaigns with the newest scheduler-owned scheduled counts
121
+ and non-null `scheduledFor` cells for those senders. Future scheduled sends
122
+ are stronger continuation evidence than old historical sends; otherwise use
123
+ the latest scheduled send date / newest scheduled-cell update from refill
124
+ state.
125
+ 3. **Continuation capacity**: campaigns with healthy senders, remaining daily
126
+ capacity, and a gap between current ready-to-schedule rows and the desired
127
+ sender capacity.
128
+ 4. **Same-campaign source health**: prefer campaigns whose current source has
129
+ enough `sourceAvailable` inventory to prepare the gap. If source inventory
130
+ is low or exhausted, choose same-campaign row replenishment before switching
131
+ campaigns.
132
+ 5. **Campaign scope**: keep the selected set small. Normally choose one
133
+ campaign; choose multiple only when the recent-send evidence shows multiple
134
+ distinct sender lanes are actively being filled.
135
+
92
136
  Do not create side campaigns, warm-post-engager side campaigns, on-demand campaigns,
93
137
  or unrelated campaigns as the default answer to a fill request.
94
138
 
139
+ For each selected campaign, decide the next action by the smallest sufficient
140
+ step:
141
+
142
+ - **Enrich/prep more rows in the same campaign** when sender health is good,
143
+ recent sends point to this campaign, and `sourceAvailable` can cover the
144
+ ready-to-schedule gap.
145
+ - **Add/import more rows to the same campaign/source path** when the campaign is
146
+ the right recent-send lane but source inventory or viable rows cannot cover
147
+ the gap.
148
+ - **Use a different existing campaign** only when the recent-send campaign is
149
+ blocked, archived, missing sequence/source/senders, disconnected, exhausted
150
+ with no viable same-campaign replenishment path, or the user explicitly asks
151
+ to move to another campaign.
152
+ - **Ask what to create** only after resolver/state evidence shows there is no
153
+ suitable existing campaign for the requested sender set.
154
+
95
155
  When the best regular campaign is source-exhausted, recommend same-campaign source-ladder replenishment.
96
156
  Keep `selectedLeadListId` source identity distinct
97
157
  from the campaign `workflowTableId`.
@@ -146,10 +206,10 @@ returns to Running after same-campaign source rows are copied. Do not call
146
206
  post-copy state transition.
147
207
 
148
208
  Before any source mutation, show exact approval evidence: workspace id,
149
- campaign id, workflow table id, source/provider id, source-list id when known,
150
- import caps, target dates/caps, dedupe/DNC/provider exclusion expectations, and
151
- expected row side effects. Then reread `get_campaign_refill_state`; if
152
- `freshness.stateHash` or exact ids changed, stop and ask for a fresh approval.
209
+ campaign name, campaign id, workflow table id, source/provider id, source-list
210
+ id when known, import caps, target dates/caps, dedupe/DNC/provider exclusion expectations, and expected row side effects. Present the campaign name and plain-English reason first; include ids only as proof and execution targets.
211
+ Then reread `get_campaign_refill_state`; if `freshness.stateHash` or exact ids
212
+ changed, stop and ask for a fresh approval.
153
213
 
154
214
  After source import, call `wait_for_lead_list_ready` and `confirm_lead_list`
155
215
  with the source-list id and campaign id. Imports append to the existing
@@ -191,6 +251,13 @@ bounded table scan, or set a bounded cap high enough to include appended rows
191
251
  when row count evidence requires it. Do not run a fixed `maxRowsToCheck:100` prep pass after appending rows to a larger existing campaign table; it can spend
192
252
  the whole budget on older rows and miss the refill batch.
193
253
 
254
+ Bound `targetPreparedMessages` to the actual ready-to-schedule gap for the
255
+ selected campaign and sender set. If `readyToSchedule` already covers the gap,
256
+ do not start prep; report that the campaign is already loaded and awaiting the
257
+ scheduler. If source inventory is available and the gap is small, prepare only
258
+ the gap instead of filling every active campaign.
259
+ Short form: prepare only the gap instead of filling every active campaign.
260
+
194
261
  Scheduled success requires a post-action reread proving scheduler-owned cells
195
262
  with non-null `scheduledFor`. Prepared, approved, and ready-to-schedule rows are
196
263
  intermediate states; report them as awaiting scheduler unless scheduled cells
@@ -228,6 +295,16 @@ the current source or ask for more research instead of walking the ladder.
228
295
 
229
296
  ## Report
230
297
 
231
- Report the selected target, target type, source state, blockers, exact next
232
- primitive, approval required, and the freshness hash used. Say explicitly that
233
- nothing was launched and nothing was sent.
298
+ Report in campaign-name-first language:
299
+
300
+ - selected campaign name(s), target type, and sender names;
301
+ - why they were selected, including last scheduled send date/future scheduled
302
+ send evidence and sender overlap;
303
+ - whether the smallest next step is enrich/prep more in that campaign, add rows
304
+ to that campaign/source, use a different existing campaign, or ask what to
305
+ create;
306
+ - source state, blockers, exact next primitive, approval required, and the
307
+ freshness hash used.
308
+
309
+ Keep ids visible but secondary: show them under "Exact target" or "Proof", not
310
+ as the main decision text. Say explicitly: nothing was launched and nothing was sent.