@proofoftech/flowsafe 0.22.0 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/CHANGELOG.md +160 -0
  2. package/README.md +77 -12
  3. package/dist/agent-host/catalog.d.ts.map +1 -1
  4. package/dist/agent-host/catalog.js +5 -2
  5. package/dist/agent-host/catalog.js.map +1 -1
  6. package/dist/agent-host/thread-host.d.ts +16 -0
  7. package/dist/agent-host/thread-host.d.ts.map +1 -1
  8. package/dist/agent-host/thread-host.js +81 -27
  9. package/dist/agent-host/thread-host.js.map +1 -1
  10. package/dist/agent-runner/durable-agent-runner.d.ts +121 -80
  11. package/dist/agent-runner/durable-agent-runner.d.ts.map +1 -1
  12. package/dist/agent-runner/durable-agent-runner.js +747 -468
  13. package/dist/agent-runner/durable-agent-runner.js.map +1 -1
  14. package/dist/approval-ui/use-approval-dashboard.js +6 -6
  15. package/dist/approval-ui/use-approval-dashboard.js.map +1 -1
  16. package/dist/background-tasks/d1-storage.d.ts.map +1 -1
  17. package/dist/background-tasks/d1-storage.js +2 -3
  18. package/dist/background-tasks/d1-storage.js.map +1 -1
  19. package/dist/background-tasks/host.d.ts.map +1 -1
  20. package/dist/background-tasks/host.js +27 -38
  21. package/dist/background-tasks/host.js.map +1 -1
  22. package/dist/do-runner/cause-chain.d.ts +5 -0
  23. package/dist/do-runner/cause-chain.d.ts.map +1 -1
  24. package/dist/do-runner/cause-chain.js +12 -0
  25. package/dist/do-runner/cause-chain.js.map +1 -1
  26. package/dist/do-runner/cf-types.d.ts +3 -0
  27. package/dist/do-runner/cf-types.d.ts.map +1 -1
  28. package/dist/do-runner/cf-types.js.map +1 -1
  29. package/dist/do-runner/constants.d.ts +1 -1
  30. package/dist/do-runner/constants.d.ts.map +1 -1
  31. package/dist/do-runner/constants.js +1 -1
  32. package/dist/do-runner/constants.js.map +1 -1
  33. package/dist/do-runner/core-events-nonce.d.ts +2 -0
  34. package/dist/do-runner/core-events-nonce.d.ts.map +1 -0
  35. package/dist/do-runner/core-events-nonce.js +16 -0
  36. package/dist/do-runner/core-events-nonce.js.map +1 -0
  37. package/dist/do-runner/d1-storage.js +1 -9
  38. package/dist/do-runner/d1-storage.js.map +1 -1
  39. package/dist/do-runner/do-error-response.d.ts.map +1 -1
  40. package/dist/do-runner/do-error-response.js +2 -1
  41. package/dist/do-runner/do-error-response.js.map +1 -1
  42. package/dist/do-runner/durable-object.d.ts +17 -2
  43. package/dist/do-runner/durable-object.d.ts.map +1 -1
  44. package/dist/do-runner/durable-object.js +442 -55
  45. package/dist/do-runner/durable-object.js.map +1 -1
  46. package/dist/do-runner/fenced-workflow-capability.d.ts +24 -0
  47. package/dist/do-runner/fenced-workflow-capability.d.ts.map +1 -1
  48. package/dist/do-runner/fenced-workflows-d1.d.ts +5 -1
  49. package/dist/do-runner/fenced-workflows-d1.d.ts.map +1 -1
  50. package/dist/do-runner/fenced-workflows-d1.js +149 -48
  51. package/dist/do-runner/fenced-workflows-d1.js.map +1 -1
  52. package/dist/do-runner/index.d.ts +2 -2
  53. package/dist/do-runner/index.d.ts.map +1 -1
  54. package/dist/do-runner/index.js +2 -2
  55. package/dist/do-runner/index.js.map +1 -1
  56. package/dist/do-runner/init.d.ts +2 -3
  57. package/dist/do-runner/init.d.ts.map +1 -1
  58. package/dist/do-runner/init.js.map +1 -1
  59. package/dist/do-runner/memory-id.js +1 -1
  60. package/dist/do-runner/memory-id.js.map +1 -1
  61. package/dist/do-runner/pubsub.d.ts +6 -2
  62. package/dist/do-runner/pubsub.d.ts.map +1 -1
  63. package/dist/do-runner/pubsub.js +12 -22
  64. package/dist/do-runner/pubsub.js.map +1 -1
  65. package/dist/do-runner/run-lifecycle.d.ts +42 -2
  66. package/dist/do-runner/run-lifecycle.d.ts.map +1 -1
  67. package/dist/do-runner/run-lifecycle.js +57 -1
  68. package/dist/do-runner/run-lifecycle.js.map +1 -1
  69. package/dist/do-runner/run-terminal-state.d.ts +2 -0
  70. package/dist/do-runner/run-terminal-state.d.ts.map +1 -1
  71. package/dist/do-runner/run-terminal-state.js +4 -0
  72. package/dist/do-runner/run-terminal-state.js.map +1 -1
  73. package/dist/do-runner/runtime.d.ts +91 -58
  74. package/dist/do-runner/runtime.d.ts.map +1 -1
  75. package/dist/do-runner/runtime.js +351 -191
  76. package/dist/do-runner/runtime.js.map +1 -1
  77. package/dist/do-runner/suspension-deadline.d.ts +25 -17
  78. package/dist/do-runner/suspension-deadline.d.ts.map +1 -1
  79. package/dist/do-runner/suspension-deadline.js +44 -21
  80. package/dist/do-runner/suspension-deadline.js.map +1 -1
  81. package/dist/do-runner/workflow-snapshot-row.d.ts +7 -0
  82. package/dist/do-runner/workflow-snapshot-row.d.ts.map +1 -1
  83. package/dist/do-runner/workflow-snapshot-row.js +21 -0
  84. package/dist/do-runner/workflow-snapshot-row.js.map +1 -1
  85. package/dist/host-kit/approval-bridge.d.ts +11 -8
  86. package/dist/host-kit/approval-bridge.d.ts.map +1 -1
  87. package/dist/host-kit/approval-bridge.js +15 -9
  88. package/dist/host-kit/approval-bridge.js.map +1 -1
  89. package/dist/host-kit/do-response.d.ts.map +1 -1
  90. package/dist/host-kit/do-response.js +7 -1
  91. package/dist/host-kit/do-response.js.map +1 -1
  92. package/dist/host-kit/flowsafe-worker.d.ts +2 -1
  93. package/dist/host-kit/flowsafe-worker.d.ts.map +1 -1
  94. package/dist/host-kit/flowsafe-worker.js +4 -2
  95. package/dist/host-kit/flowsafe-worker.js.map +1 -1
  96. package/dist/host-kit/run-router.d.ts.map +1 -1
  97. package/dist/host-kit/run-router.js +3 -2
  98. package/dist/host-kit/run-router.js.map +1 -1
  99. package/dist/schedules/schedules-d1.d.ts +1 -0
  100. package/dist/schedules/schedules-d1.d.ts.map +1 -1
  101. package/dist/schedules/schedules-d1.js +35 -22
  102. package/dist/schedules/schedules-d1.js.map +1 -1
  103. package/dist/schedules/tick.d.ts +17 -2
  104. package/dist/schedules/tick.d.ts.map +1 -1
  105. package/dist/schedules/tick.js +63 -44
  106. package/dist/schedules/tick.js.map +1 -1
  107. package/dist/signals/client.d.ts +7 -4
  108. package/dist/signals/client.d.ts.map +1 -1
  109. package/dist/signals/client.js +9 -7
  110. package/dist/signals/client.js.map +1 -1
  111. package/dist/signals/d1-shared.js +1 -1
  112. package/dist/signals/d1-shared.js.map +1 -1
  113. package/dist/signals/index.d.ts +1 -1
  114. package/dist/signals/index.d.ts.map +1 -1
  115. package/dist/signals/index.js.map +1 -1
  116. package/dist/signals/thread-do-routes.d.ts +56 -10
  117. package/dist/signals/thread-do-routes.d.ts.map +1 -1
  118. package/dist/signals/thread-do-routes.js +434 -247
  119. package/dist/signals/thread-do-routes.js.map +1 -1
  120. package/package.json +18 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,165 @@
1
1
  # @proofoftech/flowsafe
2
2
 
3
+ ## 0.24.0
4
+
5
+ ### Minor Changes
6
+
7
+ - b96f8dd: Breaking: Guarded durable calls refuse more call-level options. `stream()`, `streamUntilPersisted()`, `generate()`, and `prepare()` on a wrapped Breakwater guarded agent refuse, with a `TypeError`, the call-level options that would change what the guarded agent fixes at construction: tools, hooks, processors, scorers, instructions and system or context messages, step preparation, delegation and sub-agent versions, chunk callbacks and stream transforms, per-step saving, and an own `__proto__` property. See the [durable call-option restrictions](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/durable-agents.md#durable-call-options) for the list. `maxSteps`, `toolChoice`, and `disableBackgroundTasks` are accepted only with the guarded agent's own values. `memory` accepts only the thread and resource on these entries and on `resumeViaRuntime()`, and the wrapper forwards a frozen copy. The wrapper's constructor throws when the guarded agent's default options carry a refused option, lack `maxSteps`, `toolChoice`, or `disableBackgroundTasks`, or set `disableBackgroundTasks` to anything but `true`.
8
+
9
+ Security: Before this change, host code that passed such an option to a guarded durable call could bypass the guarded agent's input or output policies, tool set, or memory configuration: for example, a per-call client tool whose mapped result the input policies never read, a call-level output processor list that replaced the output policies, or a working-memory template added to the system prompt. The check closes these per-call routes; the documented limits of durable results for guarded agents are unchanged. The check reads option values as data; the restrictions page names what it leaves to host code.
10
+
11
+ Migration: Configure tools, instructions, memory, processors, hooks, and scorers on the guarded agent, not per call. Pass `maxSteps`, `toolChoice`, and `disableBackgroundTasks` only with the agent's own values, or omit them. Flowsafe's thread host, signal routes, and schedules pass none of the refused options.
12
+
13
+ - 21df7fb: A `DurableObjectRunner` run whose execution leg stops mid-step no longer stays `running`. A start, resume or suspension-deadline leg can stop this way when the platform ends the Durable Object invocation, for example about 15 minutes after the client disconnected. While a leg runs, it sets its run row's `updatedAt` in D1 every 30 seconds without writing the snapshot. Once the row has gone six minutes without a write, the run's own object settles the run on its next wake, with a compare-and-set against the row it read silent. The run becomes `failed` with `errorEnvelope: { code: 'INTERRUPTED', message }`, and its idempotent-start reservation is settled. A retry of the same key returns that result instead of `503 persisted start is not readable`. Flowsafe never re-executes the interrupted step, because it may already have had external effects. A run with a recorded cancellation or timeout completes that transition, with its cleanup, instead.
14
+
15
+ A deploy does not interrupt a leg: the outgoing instance keeps running it, and its touches keep the run from being settled. A Workers runtime update gives in-flight requests at most 30 seconds, so it interrupts a longer leg. A wake no longer queues behind a leg that is still executing in the object. A leg frame older than two hours is reset with `ctx.abort()`, which releases the locks of a promise the platform stopped without settling. A leg that a client keeps connected for longer than two hours is reset the same way.
16
+
17
+ Settlement needs the `FencedWorkflowsStorageD1` workflow domain that `createD1Storage()` composes. A live leg whose touches fail to reach D1 for six minutes is settled while it runs, and its next workflow write is refused. A run on other storage, including Mastra's own D1 workflow storage, or one whose leg ran on a flowsafe version before this one, is not settled automatically; `POST /runs/:workflowId/:runId/terminate` ends it.
18
+
19
+ `RunTerminalErrorEnvelope.code` and `RunSummary.errorEnvelope.code` gain `'INTERRUPTED'`. Code that switches exhaustively on the code needs a branch for it. `FencedWorkflowAdmissionCapability` gains optional `touchRun` and `replaceSnapshot`; a custom capability without both never settles a run automatically.
20
+
21
+ Each step must finish within one invocation. Split long work into steps, and wait in a suspension with a deadline rather than in an in-memory polling loop.
22
+
23
+ - 9feb010: Require `@mastra/core` `1.73.0` exactly and `@proofoftech/breakwater` `>=0.17.0 <1.0.0` when used. Pin the D1 storage dependency to `@mastra/cloudflare-d1` `1.4.0`.
24
+
25
+ Breaking: Guarded durable calls refuse call-level `errorProcessors`, accepted in 0.23, alongside the existing structured-output restriction. See the [durable call-option restrictions](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/durable-agents.md#durable-call-options).
26
+
27
+ Breaking: When a state read falls back to Mastra's in-memory run, `status()` and the run status, dispatch-status and stream routes report that run's lifecycle status, `suspended` with no suspended paths or `running`, instead of `pending`. The fallback state remains marked `isFromInMemory`; authoritative reads used by resume, deadline and terminate paths still refuse it.
28
+
29
+ Core 1.73.0's `@mastra/core/events` entry calls `crypto.randomUUID()` while it loads, which Cloudflare Workers refuse during startup. Flowsafe's do-runner supplies that value before the entry loads, so Workers that build their pub/sub from `createHostPubSub()` start. A Worker whose bundle evaluates `@mastra/core/events` before Flowsafe's do-runner fails at startup with `Disallowed operation called within global scope`, for example a Worker importing `CachingPubSub` or `withCaching` from that entry, since import sorters order `@mastra/*` before `@proofoftech/*`. On core 1.73.0, such a Worker should not import `@mastra/core/events` itself.
30
+
31
+ Storage initialization (`init()`) automatically adds `ownerId` and `leaseExpiresAt` to `mastra_background_tasks` with additive `ALTER TABLE … ADD COLUMN` statements. No manual migration is needed. Mastra's background-task manager claims and renews task leases, skips live leases during recovery, reclaims running tasks with expired or absent leases, and clears leases on suspension. Flowsafe continues applying the `resourceId` filter omitted by the D1 adapter's `listTasks`.
32
+
33
+ Guarded agents inherit Breakwater's [input policy coverage](https://github.com/ProofOfTechOrg/anchorage/blob/main/packages/breakwater/README.md#input-policy-coverage), [input policies and memory](https://github.com/ProofOfTechOrg/anchorage/blob/main/packages/breakwater/README.md#input-policies-and-memory), [application processor rules](https://github.com/ProofOfTechOrg/anchorage/blob/main/packages/breakwater/README.md#application-processors), and [streaming rules](https://github.com/ProofOfTechOrg/anchorage/blob/main/packages/breakwater/README.md#understand-streaming-hold-back).
34
+
35
+ Migration: Upgrade `@mastra/core` to `1.73.0`, `@mastra/cloudflare-d1` to `1.4.0`, and `@proofoftech/breakwater` to `>=0.17.0 <1.0.0` when used. Remove call-level `errorProcessors` from guarded durable calls. Build the bus with `createHostPubSub()` and do not import `@mastra/core/events` in Worker code on core 1.73.0.
36
+
37
+ - 3d5bd5b: A threaded schedule fire that the thread refuses permanently is recorded as `failed` with the refusal's message, and the schedule keeps firing. The trigger and audit carry the reason `dispatch-refused`. This covers an invalid dispatch or host input, an agent that does not allow the scheduled automation, and no matching thread binding or claimed dispatch. A 403 from a host automation policy fails that fire, not the schedule. Conflicts, server errors and other failures keep being retried. Fires already waiting in `deferred` close the same way on their next retry.
38
+
39
+ A permission-requiring agent whose `resolvePrincipalPermissions` throws, rejects or returns malformed output refuses the entry with 503 `permission resolution unavailable` instead of 403 `forbidden`. Automated callers, including the schedule tick, retry it. Human callers of agent starts receive this status too. A missing resolver or unsatisfied permissions still answer 403.
40
+
41
+ A fire refused because its thread binding does not exist yet is lost and is visible in trigger history.
42
+
43
+ Signal routes answer a request the thread refuses as malformed, including host input refusals, with 400 `{ "error": "bad request" }` instead of 502 `{ "error": "internal error" }`. Public signal callers receive this response too.
44
+
45
+ In `D1SchedulesStorage`, permanently refused fires no longer hold schedule deletion open while they wait for retries. A custom store decides its own deletion handling.
46
+
47
+ Migration: The required `failDeferredTrigger` member on `ScheduleTickStore` is a breaking interface change. If you supply a custom store, implement this signature:
48
+
49
+ ```typescript
50
+ failDeferredTrigger(
51
+ id: string,
52
+ scheduleId: string,
53
+ error: string,
54
+ metadata: Record<string, unknown>,
55
+ ): Promise<boolean>;
56
+ ```
57
+
58
+ Merge `metadata` into the stored metadata, as `touchDeferredTrigger` does. Record the failure only while the trigger is still `deferred`, and resolve `true` when a row changes or `false` otherwise. Leave a trigger whose target already settled a receipt, or that another tick resolved, unchanged.
59
+
60
+ A custom `signalAgent` seam must throw an error with the thread route's status in a numeric `status` property, as `ScheduleTickSignalAgent` documents. An adapter that reaches the route through another hop must not report that hop's own status as a refusal. A seam that throws without a status keeps every refusal retrying.
61
+
62
+ - 4d0fe16: `FencedWorkflowsStorageD1` refuses to overwrite a settled run row. A row is settled once its run lifecycle records a terminal transition (terminate or timeout), an interruption, or a start-recovery repair. A workflow snapshot write over such a row lands only when it advances the lifecycle revision and keeps those records; any other write throws the new `RunSettledConflictError`, which the run routes answer with 409. This fixes a defect in earlier releases. When a deploy left a run's leg executing on the outgoing Durable Object instance, a terminate or timeout on the new instance did not stop that leg: it went on running the run's remaining steps, with their external effects, and its writes replaced the terminal record. The cancelled or timed-out run could end `success`, `failed`, `running` or `suspended`, and a run left `suspended` could be resumed after its cancellation. Now the leg's next write is refused and the leg stops there.
63
+
64
+ The guard applies on a D1 binding with `batch()`, where unscoped persistence is now one conditional upsert that writes the same columns as `@mastra/cloudflare-d1`. Standalone client and REST configurations keep the adapter's write and have no guard. Code that rewrites a settled row through `persistWorkflowSnapshot` without advancing its lifecycle revision is refused. Legs running a flowsafe version without the guard still overwrite: during this upgrade, after a rollback, and in a mixed-version deploy. A refused leg stops at its next write; a workflow whose `shouldPersistSnapshot` skips `running` writes nothing between steps, so its steps run until that write. A durable agent persists nothing between tool calls by default, so a terminated agent's leg on an outgoing instance keeps calling tools until it suspends or finishes, and that write is refused. The agent thread host's start recovery does not stamp its repair, so a durable-agent leg that outlives it still overwrites it.
65
+
66
+ A `DurableObjectRunner` start whose leg stopped before its first write is now repaired as `StartOutcomeUnknown` only once its row has gone six minutes without a write, about six to seven minutes after it stopped instead of about one minute, unless the start route sees its own leg fail in the object. The repair stamps the run lifecycle so the guard refuses that leg's later writes; the run's summary is unchanged. `InitialTerminalizationRequest` gains an optional `markOutcomeUnknown`.
67
+
68
+ - 65f7715: A `DurableObjectRunner` workflow step can wait without an approval. It suspends with `SUSPENSION_TIMER_PAYLOAD_KEY` (`'flowsafe.timer'`, exported from `@proofoftech/flowsafe/do-runner/constants` and `@proofoftech/flowsafe/do-runner`) set to `true` beside its `flowsafe.deadlineMs`, and the run's Durable Object resumes it with the timeout envelope when the deadline expires. A run that must outlast one Durable Object invocation waits this way between steps.
69
+
70
+ The run object lists such steps in the new `RunSummary.suspensionTimers` on its start, resume, status, dispatch-status and protected-replay responses. It lists a step only when the current suspension derives an armable deadline for it, the marker is exactly `true`, the entry has not been abandoned, and an alarm is scheduled. `queueApprovalForSuspension` files nothing for a listed step, and `reconcileApprovalsForSummary` supersedes its stale open records without filing a new one. Every other case files an ordinary approval, so a timer step accepts an approval decision's `{ approved, comment?, decidedBy? }` as well as the timeout envelope and re-checks its wait condition on every resume. During a rollout, a timer step gets an ordinary approval wherever a Worker or run object without this change handles the run. Reconciliation supersedes that record once the step has suspended again.
71
+
72
+ The run object files the approvals of a run it leaves suspended with no host request behind it, from its alarm: after a timeout resume (a timer that waits again, the gate after it, or a deadline gate that suspends again, whose expired approval is superseded and filed afresh, notifying reviewers), after it abandons a timer, after its alarm recovers a start, and after it finds a stopped leg's run suspended. `DurableObjectRunLifecycleHooks` gains an optional `reconcileApprovals(workflowId, summary)`, which `createFlowsafeRunnerLifecycle()` fills with `reconcileApprovalsForSummary`. It is best effort; a failure is logged as `reconcile-error`, and a host status read with approval reconciliation, as `createFlowsafeWorker` does, files what it missed. Hooks without the member, and a timer abandoned after 24 hours of unreadable run state, leave those approvals to that host read. An approval open for a suspension that a timeout resume ended stays open.
73
+
74
+ A suspension-deadline resume now keeps the run's recorded `requestedBy` and `requestedByKind` instead of recording `SUSPENSION_DEADLINE_PRINCIPAL_ID` with kind `system`, so separation of duties applies to the gate after a timeout as it would without the timeout. A legacy requester without a kind is kept with kind `human`. The reserved principal is recorded only for a run without a requester, and a run whose recorded requester is already the reserved principal keeps it. A step that recognized a timeout resume by that principal id should test its resume data with `isSuspensionTimeoutResumeData` instead; a `RunSummary` no longer shows that a timeout advanced the run.
75
+
76
+ A step declaring a Zod `suspendSchema` must declare `flowsafe.timer` as well as `flowsafe.deadlineMs`, or use a loose object; a schema that strips the marker files an approval on every wait.
77
+
78
+ `DurableKeyValueStorage` gains an optional `getAlarm`. A storage without it lists no timer steps, so their approvals are filed.
79
+
80
+ ### Patch Changes
81
+
82
+ - 5b467f2: A registered agent start whose caller Breakwater's RBAC gate refuses during preparation is refused with status 403 before the runtime starts and creates no run. An automated fire the agent's RBAC gate refuses now records `failed` instead of a run that did nothing. A created signal the gate refuses for a missing actor is preserved even when Mastra's isolate-wide run registry evicts the start's entry.
83
+
84
+ Security: Before this change, if Mastra's isolate-wide run registry evicted the start's entry between preparation and the first step, the loop called the model for the refused caller on the thread's history and returned its output.
85
+
86
+ No migration is needed.
87
+
88
+ - 3b5b0ad: A guarded `resumeViaRuntime()` whose memory does not resolve is refused before registry installation, observation, or the resumed step. The run stays suspended and can be redriven once memory resolves. A failure while Breakwater resolves the memory processors, including a memory processor lookup error or function-valued memory that resolves a title-enabled `Memory` there, stops the audited `breakwater-memory` step with `input processor failed` and one `agent.input.processor` error event; the resume rejects with `Durable agent registry rehydration denied: input processor failed`. If durable preparation's first memory lookup throws or resolves a title-enabled `Memory`, the resume rejects with that error, including the title `TypeError`, and writes no audit event.
89
+
90
+ Security: Before this change, such a resume ran the approved tool and failed only at the next model step. A leg with no further model step finished and saved through the memory.
91
+
92
+ No migration is needed.
93
+
94
+ - 5b467f2: A run resumed through `resumeViaRuntime()` that suspends at another approval keeps blocking its thread until that approval is decided, even while an output processor has not processed or drops the approval. Under the default cache, the resumed observer starts from the current stream position without replaying earlier legs' events. Earlier resumed legs' thread registrations complete when the run ends or a resume fails after rehydration; the wrapper then publishes a terminal error.
95
+
96
+ Availability: Before this change, the thread was released while the run awaited approval. Signals to the thread were refused as blocked, or a host without a durable blocking check could start a second run.
97
+
98
+ No migration is needed.
99
+
100
+ - aa48c2c: When you set `canPersistSchedule`, its answer governs persistence for every threaded schedule fire in place of `canPersist`'s answer. This includes a wake that falls back to persistence during a deployment drain, under a run cap, or without a start seam. Delivered signals whose schedule persistence is denied carry the persistence-forbidden marker, preventing the runner from persisting them after the run ends. For those fires, `canPersist` is not called, so a throwing `canPersist` no longer fails them and hosts see fewer `canPersist` calls.
101
+
102
+ An authorized schedule wake with memory available persists, instead of being discarded, when a drain keeps it from starting a run. A fire that `canPersistSchedule` refuses is never persisted through a wake fallback, even when `canPersist` allows the system principal.
103
+
104
+ A throwing `canPersistSchedule` fails every fire on which it is consulted, including wake and deliver targets, and the schedule tick retries the fire.
105
+
106
+ - 049971f: Message, signal, notification-dispatch, and schedule routes now re-read the thread's blocking run when they wake. If that run ends while the route checks authorization or content, the idle thread wakes instead of answering `blocked`. A schedule fire no longer settles a permanent `blocked`/`skipped` receipt in that case.
107
+
108
+ This matters for hosts whose `resolveBlockingRun` answer can change while the route holds `serializeDispatch`, such as a host whose start returns while the run keeps executing. Hosts that execute a run's steps under the dispatch lock see no change. Each wake that found a blocking run makes one more `resolveBlockingRun` call, per send in a notification dispatch batch. No migration is required.
109
+
110
+ ## 0.23.0
111
+
112
+ ### Minor Changes
113
+
114
+ - 23eee3f: `createFlowsafeDurableAgent()` fixes the wrapper's agent-level pub/sub at construction to `pubsub ?? runtime.pubsub`, or its own stream bus when both are absent. HTTP-started threaded runs register on the thread Durable Object's pub/sub from their first start. Co-located thread Durable Objects keep separate active-run state, signals sent into those runs are drained by them, and each run publishes one stream to the thread's pub/sub topic from its first start. A `threadRuntime` object passed to the wrapper receives `registerRun` only for runs resumed through `resumeViaRuntime()`; core registers started runs. The constructor throws a `TypeError` when the wrapped agent has a different pub/sub of its own.
115
+
116
+ `FlowsafeDurableAgent` refuses `__setMemory()`, `__setPubSub()`, `abortRunStream()`, `abortThreadStream()` and `discoverThreadPeers()`.
117
+
118
+ Security: a controller's service installation reached the wrapped agent before the Mastra refusal. Direct aborts bypassed the terminate route's ownership and disputed-settlement checks and could reach another thread's run in the isolate. Peer discovery returned every advertised thread identity on the pub/sub.
119
+
120
+ Migration: the signal routes set pub/sub only on agents that are not runtime-driven and answer `503` when a runtime-driven agent's pub/sub is missing or differs from the thread's. Construct the wrapper with the thread Durable Object's pub/sub, as the thread host does, and use a fresh wrapped agent for each thread Durable Object. Configure memory and pub/sub at construction. Cancel runs through the terminate route; the stream result's `abort()` still works.
121
+
122
+ - 850f95b: The thread host refuses durable starts containing caller system messages or call-level provider options rejected by Breakwater's `assertAcceptedCallProviderOptions()` with `400`, before authorization or any write. A threadless fire whose stored options are refused records `failed`. The optional `scheduleProviderOptionsPolicy` runs on every threaded schedule fire before signal creation; a denial settles a discard, while an error leaves the lease for a later tick. The optional Breakwater peer minimum rises to `0.16.0`, which supplies these checks.
123
+
124
+ Security: before this release, a caller `role: 'system'` message passed to the thread host's durable start, and a stored schedule's call-level provider options reached the model outside the guarded agent's input policies.
125
+
126
+ Migration: raise `@proofoftech/breakwater` to `0.16.0`. Move per-agent provider options from schedules and topology starts to the agent's model entry. Wire `scheduleProviderOptionsPolicy` with both `providerOptionsCarryContent()` and `assertAcceptedCallProviderOptions()` so threaded fires are refused when either check rejects their stored options.
127
+
128
+ - ad61e7a: `createThreadSignalRoutes()` accepts an optional `notificationDispatchAllowed` callback for non-owner notification ingestion. `ThreadAgentHost` gains a required `notificationDispatchAllowed()` member that checks the target agent's catalog declaration for `system` on `notification.dispatch`; hosts can wire it to the router callback. A refused non-owner notification receives `409` with `notification-dispatch-forbidden` before an inbox row is created. This is BREAKING for hand-built `ThreadAgentHost` implementations; hosts from `createThreadAgentHost()` get the member automatically, hence the minor bump.
129
+ - ccffeca: `FlowsafeDurableAgent` now refuses `setChannels()`, `__setDeclaredSchedules()`, `__setMastra()` and `__registerMastra()`, so the wrapper cannot be registered on a Mastra: `Mastra.addAgent()` and constructing a `Mastra` or an `MCPServer` with the wrapper in `agents` throw; an `AgentController` throws during service installation when configured with memory or pub/sub that the wrapped agent does not own, and otherwise throws when `init()` registers the wrapper on its Mastra through `__setMastra()`. Its constructor throws a `TypeError`, and the guarded agent catalog refuses the module, when the wrapped agent has channels configured, declares schedules, sets the `durable` option, or is already a durable agent. `RunnerRuntime` refuses a workflow object that another Mastra has registered, including one registered while a start, resume or start recovery is in progress, up to the point the runtime creates the run.
130
+
131
+ Security: channels on the wrapped agent, or bound through the wrapper, dispatched inbound messages and tool approvals to the wrapped agent outside `RunnerRuntime`, and a Mastra schedule worker fired its declared schedules the same way. A wrapped agent with the `durable` option, or a Mastra `DurableAgent` passed as the wrapped agent, was registered on the runtime's Mastra as a durable agent whose recovery and run listing the runner does not guard. Registering the wrapper on a Mastra bound every later leg to that Mastra, and once the runtime had built its own Mastra it also repointed the runtime's loop workflow to the other Mastra's storage, where `status()` read a stored run as absent. A runtime workflow added to another Mastra did the same.
132
+
133
+ Migration: pass `createFlowsafeDurableAgent()` and the agent catalog a plain `Agent` without `channels`, declared schedules or the `durable` option. Do not register the wrapper on a Mastra, pass it to an `AgentController` or an `MCPServer`, or configure it as a sub-agent: every run of a parent agent registered on a Mastra fails when the parent converts its tools. Register each workflow object on one runtime, and do not add a runtime's workflows, or the wrapper's `getWorkflow()`, to another Mastra.
134
+
135
+ ### Patch Changes
136
+
137
+ - 68c4c61: Signal routes, agent-host start and resume routes, and the runner's start route read the request body before waiting for the thread's lock, so a request whose sender disconnects while it waits is still processed.
138
+ - 84bb66a: An owner `/signal/notification` to a runtime-driven agent is recorded in the notifications inbox and delivered at ingestion under the owner's principal: into the owner's running run, or persisted to agent memory when the thread is idle or the owner's run is not running. It never wakes a run, and no dispatch tick selects its row. The response is `{ record, delivery }`: the settled `NotificationRecord`, and Mastra's delivery decision with the delivered `signalId`. A `FlowsafeDurableAgent` registered on no Mastra uses this route-owned delivery path because Mastra's `sendNotificationSignal()` requires a notifications store on the agent's own Mastra.
139
+
140
+ Before writing anything, the route answers `409` with a `reason` when another principal's run holds the thread (`principal-mismatch`, with `retry: true`), when the delivery would need agent memory the agent lacks (`memory-unavailable`), or when a `dedupeKey` or `coalesceKey` matches a pending row the dispatch tick will deliver (`notification-pending`). After the write, the row is discarded when Mastra reports the thread blocked (`409`, `thread-blocked`), when the content policy denies the stored row's signal (`422`) or fails (`503`), and when storage or the send fails before acceptance (`502`). A failed delivered receipt write after an accepted send is retried; if the retry fails, the route answers `502` and the row stays pending with no due time. A row whose isolate dies or whose settle write the execution fence refuses also stays pending with no due time; clear it with a direct write that sets it `discarded`, or delete it. A matching keyed non-owner notification receives `notification-pending` instead of merging into this residue.
141
+
142
+ When a host passes no `canPersist`, every principal takes this owner path, signal providers included, and a provider treats a `409` as a permanent drop.
143
+
144
+ A non-owner notification is still recorded for `createNotificationDispatchTick()`, which delivers each row individually as `system` on `notification.dispatch`; no Mastra delivery policy applies, neither the default nor a configured one. On an idle thread the tick wakes a run whose principal and approval requester is `system`: the self-approval bar does not cover the notification's author, the row stores no author, and the run's permission projection and audit are `system`'s. Idle starts are limited only by `consultRunCap` where the host wires it. The tick counts a failed attempt when the run cap refuses the wake, when another principal's run holds the thread, and when the agent does not declare `system` on `notification.dispatch` in `allowedAutomation`, and it discards the row after `maxDeliveryAttempts` failed attempts.
145
+
146
+ An agent without the runtime-driven brand keeps Mastra's delivery path for owner notifications and its `degraded: 'not-runtime-driven'` marker. When its own Mastra has no notifications store, the route answers `409` before calling Mastra's sender.
147
+
148
+ `BlockingAgentRun` and the `resolveBlockingRun` result of `createThreadSignalRoutes()` take an optional `status`, which the thread host fills from the run's stored status.
149
+
150
+ Migration: a host that accepts owner notifications for a runtime-driven agent must pass `resolveNotificationsStorage` to `createThreadSignalRoutes()`, or the route returns `409`. A host with its own `resolveBlockingRun` reports each run's `status`, so that an owner notification is not queued into a run that is not executing; a run with no status is treated as running. A caller that read an owner response's `record.record` or `record.decision` reads the settled record from `record` and the delivery from `delivery`.
151
+
152
+ - 52cc784: A run resumed through `resumeViaRuntime()`, as an approval decision resumes one, registers with Mastra's thread runtime in a form whose `status` Mastra can read. Before this release, reading it threw `Cannot read private member #status`: Mastra's completion check failed after every threaded resume and never released the finished run's registration, and on a thread host built with `cache: false`, or with a `CachingPubSub` as its pub/sub, later signals, messages and schedule fires to that thread answered `502`.
153
+ - cf7ad72: `/signal` answers 409 when a thread has no wired resource, matching the sibling routes. Signals and messages sent into suspended runs persist to thread memory instead of remaining in the isolate, including wakes, notification dispatch, and agent-schedule fires.
154
+ - 20cabc3: `FlowsafeDurableAgent` preserves the input of a run that the host start seam did not register by the guarded input chain's verdict, before it refuses the run. Such a run starts when Mastra drains a signal still queued after the run it was delivered to completes, or when a caller streams into the agent directly.
155
+
156
+ - When no input processor refused the run, its prepared input is saved.
157
+ - When the run's input is a created signal, the call carries neither a host ticket nor a request context, and Breakwater's RBAC gate refuses it, the signal is saved as received. That is the drain after a run resumed through `resumeViaRuntime()`, whose options carry no request context: the gate refuses it for its missing actor without reading content, and on a guarded agent before any application input processor runs. Breakwater removes a refused call's input from Mastra's prepared message list, so the signal would otherwise be lost. Host code that calls `stream()` the same way, with a created signal or an object carrying the signal brand as input, has that input saved when the gate refuses it.
158
+ - After any other refusal nothing is saved.
159
+ - A transient signal is never saved.
160
+
161
+ Security: the input of an unregistered run that an input policy or processor refused was saved to the thread, where later calls load it as history without the input policies reading it.
162
+
3
163
  ## 0.22.0
4
164
 
5
165
  ### Minor Changes
package/README.md CHANGED
@@ -9,7 +9,7 @@ Flowsafe runs Mastra workflows and agents through Cloudflare Durable Objects, st
9
9
  ## Install
10
10
 
11
11
  ```bash
12
- npm install @mastra/core@1.67.0 @proofoftech/flowsafe
12
+ npm install @mastra/core@1.73.0 @proofoftech/flowsafe
13
13
  ```
14
14
 
15
15
  Install `@proofoftech/breakwater` when resumed steps call approval-protected connectors:
@@ -18,6 +18,8 @@ Install `@proofoftech/breakwater` when resumed steps call approval-protected con
18
18
  npm install @proofoftech/breakwater
19
19
  ```
20
20
 
21
+ Guarded durable calls follow the [durable call-option restrictions](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/durable-agents.md#durable-call-options).
22
+
21
23
  Install React and React DOM only when you import `@proofoftech/flowsafe/approval-ui`.
22
24
 
23
25
  Compatibility:
@@ -25,9 +27,9 @@ Compatibility:
25
27
  - Node.js 22.13.0 or later (engine range `>=22.13.0`)
26
28
  - ESM only
27
29
  - TypeScript `moduleResolution: "NodeNext"`, `"Node16"`, or `"Bundler"`
28
- - `@mastra/core` `1.67.0`
30
+ - `@mastra/core` `1.73.0`
29
31
  - `react` and `react-dom` `>=18 <20` (React 18 or 19) for the optional approval UI
30
- - `@proofoftech/breakwater` `>=0.15.0 <1.0.0` when used
32
+ - `@proofoftech/breakwater` `>=0.17.0 <1.0.0` when used
31
33
  - host-provided Wrangler `>=4.118 <5` for the optional `flowsafe-provision` CLI
32
34
 
33
35
  ## Choose an export
@@ -103,7 +105,9 @@ export class AppRunner extends DurableObjectRunner<Env> {
103
105
  }
104
106
  ```
105
107
 
106
- `init()` creates D1-backed Mastra storage from the conventional `DB` binding unless you inject storage. Workflow definitions use the same `createWorkflow()` and `createStep()` shape as Mastra. Flowsafe pins `@mastra/cloudflare-d1` 1.3.2 because the shipped D1 storage is written against that release's domain surface: it subclasses the adapter's background-tasks domain to apply the `TaskFilter.resourceId` predicate the adapter accepts but omits from its SQL builder, and hand-writes the schedules, notifications, and thread-state domains the adapter does not ship at all. `D1StorageOptions.domains` accepts host-supplied `workflowDefinitions` and `knowledge` domains, which have no D1-backed defaults. The pin also holds the adapter on its `@cloudflare/workers-types` v4 peer, which is the major Flowsafe still builds against.
108
+ `init()` creates D1-backed Mastra storage from the conventional `DB` binding unless you inject storage. Workflow definitions use the same `createWorkflow()` and `createStep()` shape as Mastra. Flowsafe pins `@mastra/cloudflare-d1` `1.4.0` because the shipped D1 storage is written against that release's domain surface: it subclasses the adapter's background-tasks domain to apply the `TaskFilter.resourceId` predicate the adapter accepts but omits from its SQL builder, and hand-writes the schedules, notifications, and thread-state domains the adapter does not ship at all. `D1StorageOptions.domains` accepts host-supplied `workflowDefinitions` and `knowledge` domains, which have no D1-backed defaults. The pin also holds the adapter on its `@cloudflare/workers-types` v4 peer, which is the major Flowsafe still builds against.
109
+
110
+ Storage initialization (`init()`) adds `ownerId` and `leaseExpiresAt` to `mastra_background_tasks` with additive `ALTER TABLE … ADD COLUMN` statements. No manual migration is needed. Mastra's background-task manager claims tasks with a lease, renews it while running, skips live leases during recovery, and clears the lease on suspension. Recovery reclaims running tasks with expired or absent leases. Flowsafe continues applying the `resourceId` filter that the D1 adapter's `listTasks` omits.
107
111
 
108
112
  If the deployment uses a table prefix, pass one shared constant to storage and host maintenance:
109
113
 
@@ -117,7 +121,7 @@ const worker = createFlowsafeWorker({
117
121
  });
118
122
  ```
119
123
 
120
- The prefix may be empty or must start with an ASCII letter or underscore and continue with ASCII letters, numbers, or underscores. It can contain at most 39 characters because Mastra limits final table identifiers to 63 characters and `mastra_workflow_snapshot` uses the remaining 24. All six exported low-level purge functions validate the same contract before preparing D1 statements. `storageTablePrefix` is not auto-discovered and must match the `tablePrefix` used by `init()` or `createD1Storage()`.
124
+ The prefix may be empty or must start with an ASCII letter or underscore and continue with ASCII letters, numbers, or underscores. It can contain at most 39 characters because Mastra limits final table identifiers to 63 characters and `mastra_workflow_snapshot` uses the remaining 24. The exported low-level purge functions validate the same contract before preparing D1 statements. `storageTablePrefix` is not auto-discovered and must match the `tablePrefix` used by `init()` or `createD1Storage()`.
121
125
 
122
126
  ## Approval lifecycle
123
127
 
@@ -152,9 +156,24 @@ The composed host mounts `POST /runs/:workflowId/:runId/terminate`. It transitio
152
156
 
153
157
  Termination is idempotent. A retry by the same trusted principal returns the persisted terminal summary after ownership cleanup. An unrelated principal receives the same opaque `404` as any inaccessible run. A disputed economic settlement returns `409` with `reason.code` set to `DISPUTED_SETTLEMENT` before the runtime cancels active work.
154
158
 
159
+ A run whose execution leg stops mid-step, because the platform ended the Durable Object invocation, does not stay `running`. A running leg marks its run row in D1 every 30 seconds. Once the row has gone six minutes without a write, the run's own object settles it on its next wake, and it never re-executes the interrupted step:
160
+
161
+ ```json
162
+ {
163
+ "status": "failed",
164
+ "error": "Run execution stopped mid-step before a durable outcome was recorded; external effects may have occurred. This run will not be automatically re-executed.",
165
+ "errorEnvelope": {
166
+ "code": "INTERRUPTED",
167
+ "message": "Run execution stopped mid-step before a durable outcome was recorded; external effects may have occurred. This run will not be automatically re-executed."
168
+ }
169
+ }
170
+ ```
171
+
172
+ A run with a recorded cancellation or timeout completes that transition instead. A deploy does not interrupt a leg: the outgoing instance keeps running it, and its touches keep the run from being settled. A Workers runtime update gives in-flight requests at most 30 seconds, so it interrupts a longer leg. Without a connected client, a Durable Object invocation lasts about 15 minutes, so each step must finish within one. Split long work into steps, and [wait without an approval](#wait-without-an-approval) rather than in an in-memory polling loop. Settlement needs the `FencedWorkflowsStorageD1` workflow domain that `createD1Storage()` composes; terminate a stranded run on other storage. See [interrupted legs](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/do-runner-design.md#interrupted-legs).
173
+
155
174
  Economic settlement projections are trusted internal `StartRunOptions.economicOperations` and `ResumeRunOptions.economicOperations` inputs. The host fixes the projection at an execution-leg boundary before that leg becomes cancellable. Public start and resume bodies cannot set it, and Flowsafe does not expose a dynamic mid-leg update API.
156
175
 
157
- The terminal snapshot commits before lifecycle cleanup. Cleanup abandons open approvals, discards an executing agent-schedule receipt, releases run ownership, and then records completion. A crash between those steps reuses the terminal snapshot as its retry anchor. Hosts that compose the run route must override `DurableObjectRunner.runLifecycle()`; use `createFlowsafeRunnerLifecycle()` so approval cleanup uses the same approval service and separation-of-duties configuration as the Worker.
176
+ The terminal snapshot commits before lifecycle cleanup. Cleanup abandons open approvals, discards an executing agent-schedule receipt, releases run ownership, and then records completion. A crash between those steps reuses the terminal snapshot as its retry anchor. Hosts that compose the run route must override `DurableObjectRunner.runLifecycle()`; use `createFlowsafeRunnerLifecycle()` so approval cleanup, and the approvals the run object files from its alarm, use the same approval service and separation-of-duties configuration as the Worker.
158
177
 
159
178
  `POST /runs` and the resume body accept an optional nonnegative `deadlineMs`. Resume replaces the prior deadline relative to the accepted resume leg. `RunSummary.deadlineAt` exposes the persisted epoch-millisecond deadline. The independent deadline maintenance duty sends a compare-and-swap request to the owner Durable Object and transitions each expired run once:
160
179
 
@@ -202,9 +221,9 @@ const gate = createStep({
202
221
  });
203
222
  ```
204
223
 
205
- Use `isArmableSuspensionDeadlineMs(value)` to validate relative milliseconds against the runner's safe-integer and inclusive duration bounds. Import it, those duration bounds and the reserved payload keys from `@proofoftech/flowsafe/do-runner/constants` to avoid loading the runner graph; the per-run cap `MAX_SUSPENSION_DEADLINES_PER_RUN` comes from `@proofoftech/flowsafe/do-runner`. A step declaring a Zod `suspendSchema` must declare the reserved field or use a loose object, because Mastra replaces the suspend payload with parsed output. Its `resumeSchema` must accept the timeout envelope as well as the signal shape.
224
+ Use `isArmableSuspensionDeadlineMs(value)` to validate relative milliseconds against the runner's safe-integer and inclusive duration bounds. Import it, those duration bounds and the reserved payload keys from `@proofoftech/flowsafe/do-runner/constants` to avoid loading the runner graph; the per-run cap `MAX_SUSPENSION_DEADLINES_PER_RUN` comes from `@proofoftech/flowsafe/do-runner`. A step declaring a Zod `suspendSchema` must declare the reserved fields it sets, the timer marker included, or use a loose object, because Mastra replaces the suspend payload with parsed output. Its `resumeSchema` must accept the timeout envelope as well as the signal shape.
206
225
 
207
- For workflow tests, import `suspensionTimeoutResumeData` from `@proofoftech/flowsafe/do-runner/testing` and call it with `{ step, deadlineAt }` and an expiry time. It returns the alarm's envelope shape; `isSuspensionTimeoutResumeData` checks that shape without authenticating its origin. Public resume requests containing the reserved key are rejected. Alarm resumes record system provenance and do not grant approval.
226
+ For workflow tests, import `suspensionTimeoutResumeData` from `@proofoftech/flowsafe/do-runner/testing` and call it with `{ step, deadlineAt }` and an expiry time. It returns the alarm's envelope shape; `isSuspensionTimeoutResumeData` checks that shape without authenticating its origin. Public resume requests containing the reserved key are rejected. An alarm resume keeps the run's recorded requester, so separation of duties applies to the next gate as it would without the timeout, and it grants no approval.
208
227
 
209
228
  Import `suspensionDeadlinesOf` from `@proofoftech/flowsafe/do-runner` to inspect a `RunSummary`. It returns derived entries and rejected requests without scheduling a wake or mutating the summary. See the [acceptance rules](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/do-runner-design.md#inspect-and-test-suspension-deadlines).
210
229
 
@@ -212,6 +231,37 @@ Only a top-level suspended step can arm a deadline. A step suspended inside a ne
212
231
 
213
232
  Wake precision is the Durable Object alarm's, and there is no maintenance-sweep backstop for it, so treat a suspension deadline as best-effort near its due time. Run-level `deadlineMs` remains the swept mechanism. `MAX_SUSPENSION_DEADLINES_PER_RUN` caps how many deadlines one run arms; the stored record, its parser, and the wake arithmetic stay inside the run's Durable Object, because nothing outside it can act on that state safely. Suspension deadlines apply to `DurableObjectRunner`-hosted workflow runs; durable agents keep their own resume path.
214
233
 
234
+ #### Wait without an approval
235
+
236
+ A step that only waits, such as a poll between attempts, suspends as a timer: it sets `SUSPENSION_TIMER_PAYLOAD_KEY` to `true` beside its deadline. The run's Durable Object resumes the step when the deadline expires, lists the step in `RunSummary.suspensionTimers`, and the approval bridges file no approval for it. A run that must outlast one Durable Object invocation, about 15 minutes without a connected client, waits this way between steps.
237
+
238
+ ```ts
239
+ import {
240
+ SUSPENSION_DEADLINE_PAYLOAD_KEY,
241
+ SUSPENSION_TIMER_PAYLOAD_KEY,
242
+ } from '@proofoftech/flowsafe/do-runner/constants';
243
+
244
+ const poll = createStep({
245
+ id: 'poll',
246
+ inputSchema: z.object({ jobId: z.string() }),
247
+ outputSchema: z.object({ jobId: z.string() }),
248
+ execute: async ({ inputData, suspend }) => {
249
+ // Checked on every resume, whatever resumed the step.
250
+ if (!(await jobFinished(inputData.jobId))) {
251
+ return suspend({
252
+ [SUSPENSION_TIMER_PAYLOAD_KEY]: true,
253
+ [SUSPENSION_DEADLINE_PAYLOAD_KEY]: 60_000,
254
+ });
255
+ }
256
+ return { jobId: inputData.jobId };
257
+ },
258
+ });
259
+ ```
260
+
261
+ A timer can still receive an approval: the run object lists a step only while it can vouch for the wake, and every other case files an ordinary approval (see [timer suspensions](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/do-runner-design.md#timer-suspensions)). So a timer step accepts an approval decision's `{ approved, comment?, decidedBy? }` as well as the timeout envelope, in its `resumeSchema` and its branch, and re-checks its wait condition on every resume rather than treating any resume as permission to proceed. The run object files the approvals a timer leaves to a person through the `reconcileApprovals` hook that `createFlowsafeRunnerLifecycle()` fills; see [approvals the run object files](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/do-runner-design.md#approvals-the-run-object-files) for when it files and what it leaves to a host status read.
262
+
263
+ The marker lives in the step's suspend payload, so a step that spreads untrusted data into that payload can make a gate wait without an approval for up to the deadline. A `foreach` with `concurrency` above 1 reports one payload for its suspended iterations, so one iteration's marker applies to the batch.
264
+
215
265
  Read the [Durable Object runner design](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/do-runner-design.md) for the suspension fence, the stored record, and the failure modes.
216
266
 
217
267
  ### REST surface
@@ -453,7 +503,7 @@ Configure the same positive safe-integer `maxDeliveryAttempts` on `createNotific
453
503
 
454
504
  Dispatch requires `NotificationDeliveryStorage`; `D1NotificationsStorage` implements it. A custom store's `updateNotificationDeliveryIfUnchanged()` must compare the captured observation and apply the failure patch atomically against its other writers. Ordinary Core storage still serves notification ingestion. See the [delivery and receipt guide](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/durable-agents.md#bound-notification-delivery) for custom-store migration, lost responses and receipt retention.
455
505
 
456
- Summary source counts and a configured source delivery policy read own properties: the declared `@mastra/core` peer guards both lookups, so a source named after an `Object.prototype` member is counted under its own key and resolves the configured priority or default action. A core outside the declared peer range that predates [mastra-ai/mastra#23693](https://github.com/mastra-ai/mastra/issues/23693) and [mastra-ai/mastra#23694](https://github.com/mastra-ai/mastra/issues/23694) miscounts such a source and selects the inherited policy entry instead.
506
+ Summary items arise only from rows written by Mastra's delivery policy, which means an unbranded agent's owner notifications. Summary source counts and a configured source delivery policy read own properties: the declared `@mastra/core` peer guards both lookups, so a source named after an `Object.prototype` member is counted under its own key and resolves the configured priority or default action. A core outside the declared peer range that predates [mastra-ai/mastra#23693](https://github.com/mastra-ai/mastra/issues/23693) and [mastra-ai/mastra#23694](https://github.com/mastra-ai/mastra/issues/23694) miscounts such a source and selects the inherited policy entry instead.
457
507
 
458
508
  Adapt Breakwater without adding a FlowSafe runtime dependency on it:
459
509
 
@@ -462,7 +512,9 @@ import { RequestContext } from '@mastra/core/request-context';
462
512
  import {
463
513
  ACTOR_CONTEXT_KEY,
464
514
  AGENT_AUDIT_CONTEXT_KEY,
515
+ assertAcceptedCallProviderOptions,
465
516
  createContentPolicyGate,
517
+ providerOptionsCarryContent,
466
518
  } from '@proofoftech/breakwater';
467
519
  import {
468
520
  breakwaterActorFor,
@@ -496,6 +548,19 @@ function signalPolicyContext(input: SignalContentPolicyInput): RequestContext {
496
548
 
497
549
  const signalRoutes = createThreadSignalRoutes({
498
550
  // Existing server-owned resolvers and dispatch seams.
551
+ notificationDispatchAllowed: (scope, agentId) =>
552
+ host.notificationDispatchAllowed(scope, agentId),
553
+ scheduleProviderOptionsPolicy: ({ providerOptions }) => {
554
+ try {
555
+ if (providerOptionsCarryContent(providerOptions)) {
556
+ return { allowed: false, outcome: 'denied' };
557
+ }
558
+ assertAcceptedCallProviderOptions(providerOptions);
559
+ return { allowed: true };
560
+ } catch {
561
+ return { allowed: false, outcome: 'denied' };
562
+ }
563
+ },
499
564
  contentPolicy: (input) =>
500
565
  inspectContent({
501
566
  text: input.text,
@@ -506,7 +571,7 @@ const signalRoutes = createThreadSignalRoutes({
506
571
 
507
572
  Build the request context only from the callback input. FlowSafe derives those fields from the asserted Thread Durable Object scope and server-owned metadata; never merge HTTP body context or caller-supplied identity into it.
508
573
 
509
- Notification ingestion is checked before persistence, and that check is authoritative rather than advisory: Mastra's default delivery decision sends an urgent notification — and an idle-thread high or medium one — straight out of `sendNotificationSignal`, so those records never reach the dispatcher. Storage owns the id, the timestamps and any coalescing, so ingestion inspects a canonical prospective notification carrying every untrusted model-visible field, in both renderings Mastra can choose between: the individual signal and the single-record summary. Dispatch then checks the exact persisted individual or summary signal for every record that was deferred or batched to the tick.
574
+ A non-owner's notification, and an unbranded agent's owner notification, are checked before the inbox write, so a denied one is never recorded. Storage owns the id, the timestamps and any coalescing, so ingestion inspects a canonical prospective notification carrying every untrusted model-visible field, as the individual signal and as the single-record summary. An owner notification to a runtime-driven agent is delivered at ingestion instead: the route records it, checks the exact individual signal built from the stored row, and sends only that signal; a denial discards the row. Dispatch checks the exact persisted individual or summary signal for each record it delivers.
510
575
 
511
576
  `D1NotificationsStorage` and `D1ThreadStateStorage` mirror Mastra's in-memory domains on D1. `SignalClient` is available from the browser-safe `signals/client` export.
512
577
 
@@ -538,7 +603,7 @@ The composed `createFlowsafeWorker()` owns the shared route and maintenance-duty
538
603
 
539
604
  Configure `mutationEpoch` with a nonnegative safe integer or a synchronous environment callback. The Worker captures it before deployment verification or authentication, then forwards it through trusted contexts and protected internal headers. Start paths preserve the original actor, principal, epoch and selectors across waits, including class-backed context method receivers. Do not accept the epoch from public headers or start JSON.
540
605
 
541
- The internal durable-agent host start requires an eighth `AgentStartAuthority` argument, with an explicit `onPreparedStartIdentity` property. Built-in hosts supply `undefined` while Runtime and owner journals remain v1. This transport does not activate final-write epoch checks or managed recovery; the [deployment reference](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/deployment-reference.md#configure-the-trusted-caller-epoch) and [durable-agents guide](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/durable-agents.md) describe the boundary.
606
+ The internal durable-agent host start requires an eighth `AgentStartAuthority` argument, with an explicit `onPreparedStartIdentity` property. This transport does not activate final-write epoch checks or managed recovery; the [deployment reference](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/deployment-reference.md#configure-the-trusted-caller-epoch) and [durable-agents guide](https://github.com/ProofOfTechOrg/anchorage/blob/main/docs/durable-agents.md) describe the boundary.
542
607
 
543
608
  Protect `GET` and `POST /admin/execution-fence` plus `GET /admin/inventory` with a distinct `MAINTENANCE_ADMIN_SECRET`. Fence transitions use CAS and return `409` with `FENCE_CAS_CONFLICT` when the expected state is stale. Fenced execution returns `503` with an `EXECUTION_FENCED` reason. The agent-host and stream routers preserve structured `503` and `409` refusals instead of collapsing them to a generic `500`.
544
609
 
@@ -574,7 +639,7 @@ Critical host obligations:
574
639
 
575
640
  ## Verification
576
641
 
577
- The repository's deterministic workerd spike proves suspend, process restart, resume, forged-resume denial, repeated gates, deployment-sentinel mismatch refusal, live streaming, durable-agent recovery, signals, goals, schedules, providers, notifications, and background-task restart. Durable Object conformance suites separately cover wrong and missing internal caller credentials.
642
+ The repository runs a deterministic workerd spike against the package. Durable Object conformance suites separately cover wrong and missing internal caller credentials.
578
643
 
579
644
  ```bash
580
645
  pnpm --filter @proofoftech/flowsafe spike:verify
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/agent-host/catalog.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,kBAAkB,EAIxB,MAAM,YAAY,CAAC;AAiJpB,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAqB5D;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,SAAS,EAAE,GAC7B,YAAY,CAwBd;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAuDpE;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,SAAS,WAAW,EAAE,GAC9B,kBAAkB,CAoBpB"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/agent-host/catalog.ts"],"names":[],"mappings":"AAgBA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,kBAAkB,EAIxB,MAAM,YAAY,CAAC;AAiJpB,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,CAqB5D;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,SAAS,EAAE,GAC7B,YAAY,CAwBd;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAyDpE;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,SAAS,WAAW,EAAE,GAC9B,kBAAkB,CAoBpB"}
@@ -1,6 +1,6 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  import { isGuardedAgentHandle } from '@proofoftech/breakwater/agent';
3
- import { breakwaterGuardedAgentHostProtocol } from '../agent-runner/durable-agent-runner.js';
3
+ import { breakwaterGuardedAgentHostProtocol, unwrappableAgentReason, } from '../agent-runner/durable-agent-runner.js';
4
4
  import { AGENT_ENTRY_PATHS } from '../agent-runner/index.js';
5
5
  import { AUTOMATED_PRINCIPAL_KINDS, RUN_START_ROLES, } from '../approval-api/index.js';
6
6
  import { isPathSafeId } from '../do-runner/index.js';
@@ -171,6 +171,9 @@ export function validateAgentModule(module) {
171
171
  if (breakwaterGuardedAgentHostProtocol(module.agent) === undefined) {
172
172
  fail(`agent '${meta.id}' was built by a @proofoftech/breakwater release without the durable-host protocol (added in 0.12.0); install a release inside the declared peer range`);
173
173
  }
174
+ const refusal = unwrappableAgentReason(module.agent);
175
+ if (refusal !== undefined)
176
+ fail(`agent '${meta.id}' ${refusal}`);
174
177
  if (module.agent.id !== meta.id) {
175
178
  fail(`metadata id '${meta.id}' does not match guarded agent id '${module.agent.id}'`);
176
179
  }
@@ -188,7 +191,7 @@ export function validateAgentModule(module) {
188
191
  // A handle from a breakwater older than the principal-kinds release has no
189
192
  // such field. Say so, rather than throwing on `.filter` of undefined.
190
193
  if (!Array.isArray(module.agent.allowedPrincipalKinds)) {
191
- fail(`agent '${meta.id}' was built by a @proofoftech/breakwater without principal kinds; >=0.7.0 is required`);
194
+ fail(`agent '${meta.id}' was built by a @proofoftech/breakwater without principal kinds`);
192
195
  }
193
196
  const metaKinds = new Set((meta.allowedAutomation ?? []).map((rule) => rule.kind));
194
197
  const handleKinds = new Set(module.agent.allowedPrincipalKinds.filter((kind) => kind !== 'human'));
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/agent-host/catalog.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAEL,yBAAyB,EAEzB,eAAe,GAChB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAQL,sBAAsB,GAEvB,MAAM,YAAY,CAAC;AAEpB,SAAS,IAAI,CAAC,OAAe;IAC3B,MAAM,IAAI,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,eAAe,CACtB,KAA0C,EAC1C,OAAe;IAEf,MAAM,SAAS,GAAG,KAAK,IAAI,eAAe,CAAC;IAC3C,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,UAAU,OAAO,kCAAkC,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,GAAG,EAAgB,CAAC;IACvC,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,UAAU,OAAO,WAAW,MAAM,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAC;QAC5E,CAAC;QACD,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,UAAU,OAAO,sCAAsC,IAAI,GAAG,CAAC,CAAC;QACvE,CAAC;QACD,MAAM,CAAC,GAAG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uB,CAAC;IAC5C,KAAK,MAAM,SAAS,IAAI,OAAO,EAAE,CAAC;QAChC,MAAM,MAAM,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAC9C,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,uBAAuB,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACjD,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,kBAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;QAC3C,YAAY,EAAE,OAAO,CAAC,YAAY;QAClC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;KAC7C,CAAC,CAAC;AACL,CAAC"}
@@ -3,6 +3,7 @@ import { type AgentEntryPath, type FlowsafeDurableAgent, type FlowsafeDurableAge
3
3
  import { type ApprovalAuditSink, type ApprovalService, type ExecutionPrincipal, type RecoverableResourceOwnershipStore } from '../approval-api/index.js';
4
4
  import { type AutomatedExecutionPrincipal } from '../approval-api/principal.js';
5
5
  import { type RequestContextProvider, type RunSummary, type ScheduleSourceStore, type ThreadScope } from '../do-runner/index.js';
6
+ import { type RunStatus } from '../do-runner/run-terminal-state.js';
6
7
  import { type StartReservationReading } from '../do-runner/start-reservation-contract.js';
7
8
  import type { AgentModule, AgentRunEnvelope, PrincipalPermissionResolver } from './types.js';
8
9
  export interface AgentThreadStateStorage {
@@ -70,6 +71,11 @@ export interface ThreadAgentStartInput {
70
71
  resourceId: string;
71
72
  runId: string;
72
73
  prompt?: string;
74
+ /**
75
+ * Created signals, alone or as list items, pass through unchanged. Every
76
+ * other input must be structured-cloneable (use string file and image URLs),
77
+ * or start answers 400.
78
+ */
73
79
  messages?: Parameters<FlowsafeDurableAgent['stream']>[0];
74
80
  entryPath: AgentEntryPath;
75
81
  threaded?: boolean;
@@ -109,11 +115,21 @@ export interface BoundThreadAgent {
109
115
  export interface BlockingAgentRun {
110
116
  runId: string;
111
117
  principal: ExecutionPrincipal;
118
+ /**
119
+ * The run's stored status. Absent for a run with an operation executing in
120
+ * this isolate, and for one with no readable started state.
121
+ */
122
+ status?: RunStatus;
112
123
  }
113
124
  export interface ThreadAgentHost {
114
125
  requestContextForRun(base?: RequestContextProvider): RequestContextProvider;
115
126
  /** Serialize one target-thread dispatch decision with public start/resume routes. */
116
127
  serializeDispatch<T>(operation: () => Promise<T>): Promise<T>;
128
+ /**
129
+ * Check the catalog's system notification-dispatch declaration. Automated-entry
130
+ * authorization and required permissions still apply at dispatch.
131
+ */
132
+ notificationDispatchAllowed(scope: ThreadScope, agentId: string): Promise<boolean>;
117
133
  start(scope: ThreadScope, input: ThreadAgentStartInput): Promise<AgentRunEnvelope>;
118
134
  resolveBoundAgent(scope: ThreadScope, input: {
119
135
  agentId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"thread-host.d.ts","sourceRoot":"","sources":["../../src/agent-host/thread-host.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAOjE,OAAO,EAGL,KAAK,cAAc,EAQnB,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAIjC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,iBA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