@sellable/mcp 0.1.688-uat.refill-zero-shot.20260722213823 → 0.1.689-uat.refill-zero-shot.20260722230802

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.
@@ -204,14 +204,71 @@ function normalizeWorkspaceRunState(value) {
204
204
  ];
205
205
  })
206
206
  : [];
207
+ // Run-scoped attempt ledgers (Signal/provider continuation, broadening,
208
+ // rubric relaxation, sender-post refresh…) prove which escalation-ladder
209
+ // rungs are already spent this workspace command. The planner reads them
210
+ // from runState; stripping them here reset the ladder to rung 1 on every
211
+ // coordinator call, so the planner re-emitted the identical
212
+ // continue_signal_discovery_source forever and the identical-action guard
213
+ // failed closed (sellable.dev run 17 terminal).
214
+ const attemptLedgers = {};
215
+ for (const key of WORKSPACE_ATTEMPT_LEDGER_KEYS) {
216
+ const entries = Array.isArray(root[key])
217
+ ? root[key].slice(0, 250).filter((entry) => Boolean(recordValue(entry)))
218
+ : [];
219
+ if (entries.length > 0)
220
+ attemptLedgers[key] = entries;
221
+ }
207
222
  return {
208
223
  version: 1,
209
224
  senderCursors,
210
225
  laneCooldowns: [],
211
226
  passRates: [],
212
227
  coordinatorBlockedExactTargets,
228
+ ...attemptLedgers,
213
229
  };
214
230
  }
231
+ const WORKSPACE_ATTEMPT_LEDGER_KEYS = [
232
+ "signalDiscoveryAttempts",
233
+ "providerSourceAttempts",
234
+ "broadenSignalSearchAttempts",
235
+ "broadenProviderSearchAttempts",
236
+ "rubricRelaxationAttempts",
237
+ "senderPostRefreshAttempts",
238
+ "drySourcePrepAttempts",
239
+ "approvalCohortAttempts",
240
+ ];
241
+ // A fenced exact run records its bounded attempt receipts on ITS OWN
242
+ // runState; the workspace loop replans from workspaceRunState. Without this
243
+ // merge the ladder receipts die with the fence and the planner keeps rung 1
244
+ // "available" forever.
245
+ function mergeAttemptLedgersIntoWorkspaceRunState(workspaceRunState, fenceRunState) {
246
+ if (!fenceRunState)
247
+ return workspaceRunState;
248
+ let merged = workspaceRunState;
249
+ for (const key of WORKSPACE_ATTEMPT_LEDGER_KEYS) {
250
+ const fenceEntries = Array.isArray(fenceRunState[key])
251
+ ? fenceRunState[key].filter((entry) => Boolean(recordValue(entry)))
252
+ : [];
253
+ if (fenceEntries.length === 0)
254
+ continue;
255
+ const base = merged ?? {
256
+ version: 1,
257
+ senderCursors: [],
258
+ laneCooldowns: [],
259
+ passRates: [],
260
+ coordinatorBlockedExactTargets: [],
261
+ };
262
+ const existing = Array.isArray(base[key]) ? base[key] : [];
263
+ const seen = new Set(existing.map((entry) => JSON.stringify(entry)));
264
+ const additions = fenceEntries.filter((entry) => !seen.has(JSON.stringify(entry)));
265
+ merged =
266
+ additions.length === 0
267
+ ? base
268
+ : { ...base, [key]: [...existing, ...additions].slice(-250) };
269
+ }
270
+ return merged;
271
+ }
215
272
  export const refillSendsToolDefinitions = [
216
273
  {
217
274
  name: "refill_sends",
@@ -2650,7 +2707,7 @@ export async function executeRefillSendsCommand(input = {}) {
2650
2707
  actionKey: exactTargetConfig.approvalInputs.expectedActionKey,
2651
2708
  }
2652
2709
  : null;
2653
- const pinnedWorkspaceRunState = coordinatorSelection?.workspaceRunState ?? scopedInput.workspaceRunState;
2710
+ const pinnedWorkspaceRunState = mergeAttemptLedgersIntoWorkspaceRunState(coordinatorSelection?.workspaceRunState ?? scopedInput.workspaceRunState, recordValue(result.runState) ?? undefined);
2654
2711
  const deferredExactBlocker = isWorkspaceCoordinator && selectedCoordinatorTarget
2655
2712
  ? workspaceExactDeferredBlocker(result)
2656
2713
  : null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellable/mcp",
3
- "version": "0.1.688-uat.refill-zero-shot.20260722213823",
3
+ "version": "0.1.689-uat.refill-zero-shot.20260722230802",
4
4
  "type": "module",
5
5
  "description": "Sellable MCP server for Claude Code, Codex, and Hermes campaign workflows",
6
6
  "main": "dist/index.js",