@bastani/atomic 0.9.88-alpha.1 → 0.9.88

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 (55) hide show
  1. package/CHANGELOG.md +287 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +57 -0
  3. package/dist/builtin/intercom/index.bundle.mjs +62 -38
  4. package/dist/builtin/intercom/package.json +1 -1
  5. package/dist/builtin/intercom/session-target.ts +15 -3
  6. package/dist/builtin/mcp/package.json +1 -1
  7. package/dist/builtin/subagents/CHANGELOG.md +50 -0
  8. package/dist/builtin/subagents/package.json +1 -1
  9. package/dist/builtin/web-access/CHANGELOG.md +10 -0
  10. package/dist/builtin/web-access/package.json +1 -1
  11. package/dist/builtin/workflows/CHANGELOG.md +117 -0
  12. package/dist/builtin/workflows/README.md +2 -2
  13. package/dist/builtin/workflows/builtin/{chunk-r9xfx5d0.js → chunk-4h4nh4f1.js} +1 -1
  14. package/dist/builtin/workflows/builtin/{chunk-cryf7s3r.js → chunk-jm7redy5.js} +648 -91
  15. package/dist/builtin/workflows/builtin/{chunk-c7bc4ppx.js → chunk-t661k7hd.js} +1 -1
  16. package/dist/builtin/workflows/builtin/goal.js +2 -2
  17. package/dist/builtin/workflows/builtin/index.js +3 -3
  18. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  19. package/dist/builtin/workflows/package.json +1 -1
  20. package/dist/builtin/workflows/src/durable/fork-errors.d.ts +0 -1
  21. package/dist/builtin/workflows/src/durable/journal/internal.d.ts +1 -0
  22. package/dist/builtin/workflows/src/extension/index.bundle.mjs +2515 -1091
  23. package/dist/builtin/workflows/src/extension/local-worker-entry.mjs +1092 -98
  24. package/dist/builtin/workflows/src/index.js +1077 -91
  25. package/dist/builtin/workflows/src/local-worker-entry.mjs +1092 -98
  26. package/dist/core/storage/session/session-resume.d.ts +8 -1
  27. package/dist/core/storage/session/session-resume.d.ts.map +1 -1
  28. package/dist/core/storage/session/session-resume.js +22 -3
  29. package/dist/core/storage/session/session-resume.js.map +1 -1
  30. package/dist/core/worktree-snapshot/restore.d.ts +2 -0
  31. package/dist/core/worktree-snapshot/restore.d.ts.map +1 -1
  32. package/dist/core/worktree-snapshot/restore.js +41 -5
  33. package/dist/core/worktree-snapshot/restore.js.map +1 -1
  34. package/dist/modes/interactive/components/jump-to-latest.d.ts +0 -5
  35. package/dist/modes/interactive/components/jump-to-latest.d.ts.map +1 -1
  36. package/dist/modes/interactive/components/jump-to-latest.js +0 -5
  37. package/dist/modes/interactive/components/jump-to-latest.js.map +1 -1
  38. package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
  39. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  40. package/dist/modes/interactive/interactive-mode-base.js +13 -2
  41. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  42. package/dist/modes/interactive/interactive-render-chat.d.ts +0 -4
  43. package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
  44. package/dist/modes/interactive/interactive-render-chat.js +19 -45
  45. package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
  46. package/dist/modes/interactive/interactive-startup-chat-container.d.ts +9 -1
  47. package/dist/modes/interactive/interactive-startup-chat-container.d.ts.map +1 -1
  48. package/dist/modes/interactive/interactive-startup-chat-container.js +38 -0
  49. package/dist/modes/interactive/interactive-startup-chat-container.js.map +1 -1
  50. package/docs/keybindings.md +1 -1
  51. package/docs/storage.md +1 -1
  52. package/docs/workflows/api-reference.md +3 -2
  53. package/docs/workflows/operations.md +11 -9
  54. package/npm-shrinkwrap.json +49 -49
  55. package/package.json +6 -6
@@ -6,6 +6,123 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.9.88] - 2026-11-16
10
+
11
+ ### Breaking Changes
12
+
13
+ - Removed `/workflow connect` and `/workflow attach`. `/workflows` opens the session's only run in its graph, or lists the runs, and `/workflows <run-id>` opens that run; Enter on a stage in the graph opens its chat. On a failed stage, Enter opens its failure detail; press `t` there for its chat. Launch, status and notice text now point to `/workflows`. Autocomplete offers `/workflows`, completes the session's run IDs as `/workflow connect` did, and omits both removed subcommands, including before workflow discovery finishes or when live completion is unavailable. The fallback also offers `/workflow fork` and `--from`. Typing either removed command shows a one-line pointer and runs nothing. **Migration:** use `/workflows <run-id>` (or ↓ to the run in the agent panel) where you used `/workflow connect <run-id>`, and select the stage in that graph where you used `/workflow attach <run-id> <stage>` ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
14
+
15
+ ### Added
16
+
17
+ - Added `idleExitMs`, `onEvent` and an optional `journal` (default: the journal this machine selects) to `startWorkflowWorkerHost`, with `host.closed` and `host.stats().degraded`, and `readWorkflowWorkerFleet()`, which lists a shared journal's worker hosts and root queues. A host whose polls of the journal fail keeps its running children and polls again after 1 s, doubling up to 30 s. `workflows.workers` in settings gives roots the workflow tool starts shared placement ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
18
+ - Added fleet autoscaling for shared placement: the `WorkerHostProvisioner` interface (`list`, `scaleTo`, `drain`), `startWorkflowFleetController()`, and `workers.provisioner` for SDK roots. The controller adds hosts when the shared roots' queues stay deep, drains and removes only hosts that held no child for `idleDrainMs`, keeps the fleet between `minHosts` and `maxHosts` and within each root's session limit and budget, and replaces a host that does not register within `bootTimeoutMs`, backing off after repeated failures. One controller per journal is active at a time through a fenced lease, and another takes over when it stops. Provisioner failures are recorded and retried and never fail or block a run. Worker hosts report `ATOMIC_PROVIDER_ID` (or `providerId`) and drain when a controller asks ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
19
+ - Added the command worker host provisioner, `createWorkerHostProvisioner({ kind: "command", up, down, list })`: your own commands, or a preset for `az`, `aws`, `gcloud`, `kubectl` or `gh`, run without a shell with each tool's own credentials. Placeholders (`{target}`, `{add}`, `{id}`, `{remaining}`) and `listFormat` (a path to the hosts, their id, state and time, and a map of the platform's states) let one configuration drive any scaling group. Adding runs only for hosts `list` lacks, removing only for a host `list` reports, and changes run one at a time. Each command is bounded by `timeoutMs` and stopped with everything it started on a timeout or abort, and fails with a `WorkerProvisionerError` (`missing-cli`, `auth`, `exit`, `timeout` or `malformed`) that carries the exit code and redacted error output, never the arguments or secrets ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
20
+ - Added the fleet's scaling signal: `readWorkflowWorkerFleet({ policy })` returns `scaling` (the hosts the autoscaling policy wants, the demand and queue behind them, and live hosts with busy and idle slots), and `probeWrites: false` reads without the write probe ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
21
+ - Added fleet status to `/workflow status`, its JSON and `host.stats()`: each registered worker host's state (`busy`, `idle`, `draining`, `degraded`, `stale`, or `live` for a host of an older version), slots, busy workers, last heartbeat and poll failures, the queue across every running or paused shared root, and the shared store's state. A status read writes nothing to the store and never waits more than 5 seconds on it. It shows the store unknown, with a hint, when the read fails, and degraded when the read times out, a write of the process has waited over 10 seconds, writes keep failing while hosts are registered, or the libSQL adapter reports unanswered writes, naming the sqld bug [tursodatabase/libsql#2286](https://github.com/tursodatabase/libsql/issues/2286) and its `--checkpoint-interval-s` workaround. `readWorkflowWorkerFleet()` returns the same, and `workflowWorkerFleetLines()` formats it ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
22
+ - Added GitHub App auth to the command provisioner: `auth.githubApp` (`appId`, `installationId`, `privateKeyFile`, `repository`, and `host` or `apiUrl` for GitHub Enterprise Server, each also read from an `ATOMIC_GITHUB_*` variable) mints installation tokens with `@octokit/auth-app`, narrowed to `actions: write` on one repository, reuses each until 5 minutes before it expires, and passes it to each command as `GH_TOKEN` (`GH_ENTERPRISE_TOKEN` with `GH_HOST` for GitHub Enterprise Server) in that command's environment only. The private key must be readable by its owner only and never reaches an error, a log or the journal. A refused app rejects with `auth`; an unreachable API, a rate limit or a server error with the new `unavailable` code ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
23
+ - Worker pools run on PostgreSQL: a root with shared placement on a `@bastani/atomic-storage-postgres` journal keeps its work queue, leases, resource admission, pooled-stage transcripts and usage there, and worker hosts and the fleet controller serve it as they serve a libSQL one. Fleet safety (live-lease checks, boot holds and drains) works there too. The pool's writes take turns across machines, as on libSQL ([#4793](https://github.com/bastani-inc/atomic/issues/4793))
24
+ - On PostgreSQL, a shared pool's worker hosts and root wake as soon as work is queued, released or completed: an idle worker claims a queued child at once instead of after its half-second pause, a host attaches to a new root at once instead of at its next poll, and the root sees a child another host finished at once. The polls stay as the fallback ([#5103](https://github.com/bastani-inc/atomic/issues/5103))
25
+ - Added `workers.checkpointShipping` for shared placement: `"sync"` (the default) or `{ intervalMs, maxBatch, maxLagMs }`. With an object, each worker host records its children's plain checkpoints in a local journal under the child's work lease and ships them to the shared journal in background batches. Each batch is recorded once and refused for an attempt that lost its work. A delayed release from an earlier worker leaves a replacement worker's shipping state intact. Everything is shipped before a child completes, before a pause or quit takes effect, and before the host stops. Each batch, including a full 1,000-checkpoint batch, is one request with one insert for its events. Each attempt times its deliveries, reuses the host's catch-up timings until it has its own, and counts high-percentile catch-up latency when scheduling shipments to target `maxLagMs`. Sudden slowdowns and store outages can exceed that target. While catching up, the child's next step waits and the host claims no new children. On a store whose single delivery takes half of `maxLagMs` or more, each step waits for the one before it instead. A host that restarts ships what it left behind while its children still own their work, and drops the rest. Restart recovery keeps unshipped checkpoints accounted for when a lease is renewed, replaced, or the host stops during recovery. A delayed renewal cannot discard a newer attempt's checkpoints. Sessions, snapshot-carrying checkpoints and checkpoints that bill model usage still commit directly. A host whose local journal fails, such as on a full disk, falls back to committing that attempt's checkpoints directly and reports it once. Later attempts try the local journal again. If the local journal cannot open at startup, the pool still starts and its children on that host commit directly, with one health warning. Concurrent processes sharing an agent directory use synchronous commits when another process owns the root's local checkpoint journal, so they cannot discard one another's acknowledged checkpoints. Each host removes a root's local journal file once the root's run ends and nothing is left to ship, with its root lock file; unshipped checkpoints stay on disk for recovery. A resume may change the setting ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
26
+ - Added fleet-wide model rate limits for shared placement: `workers.rateLimits` meters model calls of a provider or `provider/model` across every worker host through one token bucket in the shared journal, and `workers.shareCooldowns` holds every host back after a 429 any of them gets. A host whose journal does not answer within a second meters locally at its share of the rate and reports `rateLimit: "local-fallback"` ([#4768](https://github.com/bastani-inc/atomic/issues/4768)).
27
+
28
+ ### Changed
29
+
30
+ - Resuming a workflow stage whose session was compacted, and opening a forked stage session, read the session from its latest compaction instead of its whole history ([#5249](https://github.com/bastani-inc/atomic/issues/5249))
31
+ - The orchestrator stages of the builtin `ralph` and `goal` workflows and the worker stage of `loop-until-done` no longer end early because their conversation grew long. Atomic compacts long conversations automatically, so the stage keeps working instead of deferring the rest to a fresh run.
32
+ - The `keepContext` helper documentation and the workflow tool's guidance now explain that protection has a budget: restating a constraint adds no protection, and old duplicate or over-budget spans can be released and compacted. Tag constraints, not material ([#4794](https://github.com/bastani-inc/atomic/issues/4794))
33
+ - Worker pools on PostgreSQL no longer take turns across machines for their busiest writes. Claiming a child, heartbeats, checkpoints and completing a child lock only the rows they change, and a claim skips work another host is taking, so hosts claim and record in parallel. Every guarantee holds as before: a child is held by one worker at a time, a replaced worker's writes are refused, and each checkpoint is recorded once in order. With 32 hosts of 4 workers on one PostgreSQL 16 server, claims ran 8 to 13 times faster and checkpoint commits about 1.5 times faster, and the slowest claims and commits take a third to half as long. SQLite and libSQL pools are unchanged ([#5102](https://github.com/bastani-inc/atomic/issues/5102))
34
+ - The workflow graph's hint line lists exactly the keys that work on the focused node and reflects remapped keys, and `?` opens a key overlay. `f` cycles a status filter that dims non-matching nodes without moving them, and the configured stop key, `x` by default, pressed twice within 3 seconds stops a running stage so it can be resumed. Esc at the graph's top returns to where it was opened from, such as the `/workflows` list ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
35
+ - Enter on a failed stage opens its failure detail: a short reason instead of the raw error, with `r` to retry the stage, `f` to confirm a new run from that stage, `t` for the transcript and `l` for bounded error-log output. Actions wait for workflow resource reloads. Late results cannot replace a newer view, and recovery clears stale confirmations. Forks keep the selected stage when same-named sibling completion changes its path; failed child-workflow boundaries remain valid targets. Confirmation counts exclude internal records and duplicate tool replays. Action errors become notices, and details, notices, run cards and tool labels show terminal controls as printable text without changing stored values ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
36
+ - Stopped stages and runs show a muted `◼` instead of `⊘`, so they no longer look like failures or skips ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
37
+ - `/workflows` with no runs shows a dismissible "No workflows in this session." sheet. Returning from a graph preserves the selected run-list row. `/workflows <run-id> <stage>` opens that stage's chat ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
38
+ - Ctrl+X no longer navigates workflow views, and Esc no longer closes an idle stage chat. In a stage chat, ← on an empty prompt returns to the graph (Esc on a choice or yes/no question); in the graph, which has no prompt, Esc pops one level: it closes the stage switcher or a detail, then returns to where the graph was opened from. Arrows only move between graph nodes; ← at the leftmost node or inside a detail does nothing. In a stage chat Esc only interrupts, and on a choice or yes/no question it closes the question back to the chat's prompt (Enter reopens it; it stays pending). `/workflows` opens the session's only run in its graph, or the run picker when there are several, instead of the resume picker. **Migration:** use ← in a stage chat and Esc in the graph where you used Ctrl+X ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
39
+ - The workflow graph reuses its layout between status updates and combines status bursts into one frame. Status polling reuses unchanged run details. Optional status-file writes reuse unchanged runs and combine frequent updates without dropping output fields ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
40
+ - Idle pooled workers no longer poll the shared store. An idle worker no longer reads pool control or catches up on the root's journal before each claim; it waits for a wake-up (PostgreSQL `LISTEN`/`NOTIFY`, or its own host queuing or releasing work) and otherwise asks for work at intervals that grow from 25–50 ms to 2 s while nothing is ready. Without wake-ups (SQLite, libSQL / sqld, PostgreSQL through a transaction pooler or while its listen connection reconnects), each host checks for ready work about every 250 ms while a worker is idle, so children are still claimed promptly. Pause, stop and drain reach idle workers as before. Resuming a pool wakes them through notifications or the next ready probe, even when the queued work is unchanged. Delayed handoffs wake an idle worker on the next recovery pass rather than relying solely on its 2 s fallback; once a pass sees one pending, recovery uses each 500 ms tick. A worker that exits or whose claim fails passes its wake-up to another idle worker, including between claims. Successful claims pass wake-ups on before workspace restoration finishes, and a host that loses a placement race checks the next ready child. Failed workspace restores retry when their restore backoff expires or another restore clears it. Idle claims also resume promptly when fleet drains or checkpoint-shipping lag clear. Journal-delivery refusals retain short retries while the journal is reachable; an unavailable journal uses the existing one-second outage retry instead. Without notifications, the next ready probe also discovers released work whose ready time is unchanged, including claims returned after workspace placement fails ([#5230](https://github.com/bastani-inc/atomic/issues/5230))
41
+
42
+ ### Fixed
43
+
44
+ - Fixed four worker pool statements on PostgreSQL that read the database's clock twice, though it moves on between two readings. A fleet-wide rate limit could let one request take more tokens than its bucket's burst, and a poll could report a shared 429 cooldown as running with no time left of it. The fleet controller could count a shared root as running while it left out a child that the root's lease still kept live, and `/workflow status` could show a leased child's renewal and expiry 1 ms short of a whole lease apart. Each statement now reads the clock once ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
45
+ - Fixed writes to a libSQL server that many worker hosts share waiting 15 s or more under load. An interactive write transaction holds the server's one write lock from its first statement until its commit arrives, across every round trip in between, while every other host waits. Every pooled child's worker opened the pool's queue, session store and admission that way, and checked their schemas with dozens of such transactions. Queueing a child, a root's lease renewals and event appends, and admission's open and release did the same. A pool whose tables exist now opens with reads alone, and those writes now go as one request each, fenced in SQL on everything they decided from their reads. Running the 8-host and then the 16-host case (4 workers each) took about 3,240 interactive write transactions before and 80–135 now, all of them first-time schema setup or rare per-root writes. On the farm, the 16-host case's fresh-client write went from p95 1.0–1.6 s and max 1.5–2.3 s to p95 0.17–0.47 s and max 0.20–0.71 s ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
46
+ - Fixed worker pool checkpoints failing on a libSQL server (sqld) with `StoragePayloadTooLargeError` once a host had recorded 64 large ones for a root in a row, such as 64 of 256 KiB, while SQLite and PostgreSQL recorded them all. After 64 checkpoints of its own a host reads the root's back with its next commit, and the database built one value of that read from all 64, past the 5,000,000 bytes sqld holds in one value, even though the read then left it unused and read them in pages. The read now builds that value only when it returns it, for at most 64 checkpoints of at most 256 KiB in all, whatever their size and number, and reads the rest in pages as before ([#5260](https://github.com/bastani-inc/atomic/pull/5260))
47
+ - Worker pool stores (queue, usage, shared placement, fleet, rate limits, resource admission) run no DDL when their schema is current on PostgreSQL, so worker hosts, roots and their child workers run with a runtime role that has only DML privileges, and a starting host no longer blocks running hosts' pool writes. `migrateWorkflowStorage` sets them up, as `atomic storage migrate` does ([#5218](https://github.com/bastani-inc/atomic/issues/5218))
48
+ - The shared-journal setup hint, as `atomic worker status` prints it, names `atomic storage join <postgres-url> --password-file <path>` for PostgreSQL beside the libSQL command, instead of only `atomic team join`, which refuses PostgreSQL ([#5218](https://github.com/bastani-inc/atomic/issues/5218))
49
+ - Fixed a worker pool write on PostgreSQL committing against a journal a later build had just upgraded: the write checked the schema version without locking it, so the upgrade could commit between that check and the write. The check now holds the version until the write commits, so the upgrade waits for it. SQLite and libSQL pools already wrote under the lock the upgrade takes ([#5219](https://github.com/bastani-inc/atomic/issues/5219))
50
+ - Fixed two agent directories under one parent, such as `ATOMIC_CODING_AGENT_DIR=/x/a1` and `/x/a2`, reporting the same worker host id: each agent directory now keeps its own id, in `<agent dir>/pool-host-id`. The id an earlier build kept in `<parent>/workflows/pool/host-id` is kept by the first agent directory that starts after the upgrade, and only by that one ([#5219](https://github.com/bastani-inc/atomic/issues/5219))
51
+ - Credential redaction now covers more field names, encodings and multi-line values. Fixed a worker provisioner's error redacting a word on the line after a secret's name, as in Python's `-> Token:` followed by code: a `name: value` pair now stays on its line ([#5142](https://github.com/bastani-inc/atomic/issues/5142))
52
+ - Fixed a workflow run on a libSQL server (sqld) failing with `StoragePayloadTooLargeError` when one journal event, such as a `ctx.step` result or stage output, passed 5,000,000 bytes, and a pooled child failing the same way when its inputs or result did. The SQL run journal and the worker pool now store such JSON as rows of at most 1 MiB in one transaction on every backend, keeping in the event's row the fields that SQL reads. Opening a journal upgrades it to journal schema version 2, and a pool to version 3, which older builds refuse. Stop older Atomic processes and pool workers on a shared store before the first run: while one detectably holds a run's lease or reports as a worker host, large values are written whole. Lease grants and worker host reports now record the journal schema they read, and every journal read and write checks the schema version, so later upgrades are safe against live processes of this release ([#4965](https://github.com/bastani-inc/atomic/issues/4965))
53
+ - Fixed callers of a released stage waiting forever when its reopened session refused one of the messages held while it waited. Every other held message still reaches the session, callers waiting for it go on, and the turn fails with the refusal ([#5156](https://github.com/bastani-inc/atomic/issues/5156))
54
+ - Fixed a workflow run whose `completed` status write was refused by storage twice reading as still running, in `status` and inspection and after a restart, until someone resumed it. A run now records that its definition completed, in a run-timing record every release already reads, before it writes its status, and a run still marked running that recorded this in its latest attempt reads as completed. ([#5133](https://github.com/bastani-inc/atomic/issues/5133))
55
+ - Fixed a sticky Intercom message that a pooled stage received being recorded as undeliverable, and its sender told it could not be delivered, after the store briefly refused the root's handoff into that stage twice. A refused handoff no longer ends the stage's attempt, the stage keeps its own receipt of the messages its session took, and the root records that receipt as the delivery, also when the run ends. A message no stage received is still reported undeliverable ([#5023](https://github.com/bastani-inc/atomic/issues/5023))
56
+ - Fixed one transient storage refusal of a single durable record leaving a workflow run with no durable view, or unable to resume. A resumed run whose tool replay record was refused showed nothing in inspection or forks; a run whose tool failure, stage, stage replay or child workflow boundary record was refused failed with `insufficient_state` on every later resume, in the same session or after a restart. A failed attempt now names the stage, tool or child workflow it failed at, even when the failure is a storage error; a tool's replay record is written like the tool's own record, and a refused one fails the attempt at its next step rather than naming the finished tool; a failed tool's refused failure record is written again as the run ends; and a run that failed with no failed node, such as one that failed in plain workflow code after its tools, resumes in the same session from the run's records, as it does after a restart, when every node it reached completed with its record. The run then resumes and completes ([#5027](https://github.com/bastani-inc/atomic/issues/5027))
57
+ - Fixed a fleet controller removing an instance a worker host still needed, and acting after it lost its lease. An instance is no longer removed while a host on it that the controller cannot match holds an unexpired lease, however long ago that host last reported, nor while a drained host is still in the registry: it is removed once the host leaves, or 5 minutes after the drain with no lease held, never just because the host stopped reporting. A worker host asked to drain claims no more children even before it reads the drain. Leased work whose root died and whose own lease expired no longer keeps an idle host or the fleet's target up. A controller checks its lease's age right before each provider call, by the longer of the monotonic and wall clocks, so one stalled or asleep past its lease makes none. A host that registers just as its boot timeout is reached is not removed, and an instance removed for its boot timeout is drained first, so a host that registers on it meanwhile takes no child ([#5072](https://github.com/bastani-inc/atomic/issues/5072))
58
+ - `open-claude-design` artifacts written to the temp directory now use a directory only the current user owns
59
+ - A workflow stage now charges every model call it makes to the stage and run budgets exactly once, read from the session's provider usage events instead of the stage's message list: a compaction inside a stage prompt no longer drops that prompt's usage, the compaction's own planner, classifier and summary requests are charged, and a session retry keeps the failed request's usage. A resumed stage never re-charges its history ([#5053](https://github.com/bastani-inc/atomic/issues/5053))
60
+ - A worker pool claim whose answer was lost and that commits late, after a later attempt was fenced off, is now handed to its worker instead of the worker claiming a second row, which left the first child waiting a full lease expiry before it was retried ([#5126](https://github.com/bastani-inc/atomic/issues/5126))
61
+ - A run budget now charges the budget wrap-up turn's spend when the turn finishes, so a stopped run's accounting includes it and a resumed run starts with that much less headroom. Before, it was never charged ([#5053](https://github.com/bastani-inc/atomic/issues/5053))
62
+ - A child workflow's own budget now keeps what it already charged when its root run resumes after a crash at any point, including in a new process. The child records its accounting, and its root's, on the root run after each of its stages, in one write. Before, the child's budget restarted at zero and the child could spend past its own cap, and the stages a resume replayed were never charged to the root ([#5053](https://github.com/bastani-inc/atomic/issues/5053))
63
+ - A run whose child workflow stopped on its own budget can now be resumed after a crash: the stopped child counts as ended, its replayed stages are not charged again, and a child's own exhaustion found before its next stage stops only the child. Before, such a resume failed with "durable nested topology is non-resumable", or the root stopped with a "duration budget exceeded (35ms / 0ms)" error although no duration budget was set ([#5053](https://github.com/bastani-inc/atomic/issues/5053))
64
+ - A workflow stage now charges the model calls of the subagents it launches to its budget, including their compaction and their own subagents, and the stage session's cache-warming requests. Before, a stage's subagents spent outside every workflow budget ([#5053](https://github.com/bastani-inc/atomic/issues/5053))
65
+ - A token or cost budget now stops a stage within its turn: after every model call, the stage checks the budget including the call not yet recorded, and once a call reaches the cap it starts no further model call, answers the tool calls that call asked for as cancelled, and runs its single wrap-up. Before, the budget was checked only before and after each prompt, so a tool loop could spend far past the cap (11 calls, 55 tokens under a 10-token cap) ([#5053](https://github.com/bastani-inc/atomic/issues/5053))
66
+ - Run cost now adds up and compares exactly against `maxCost`: ten $0.10 stages reach a $1.00 cap and the 11th stage no longer starts. Floating-point sums such as 0.9999999999999999 used to fall just under the cap ([#5053](https://github.com/bastani-inc/atomic/issues/5053))
67
+ - Fixed a fork (a continuation under a new run id) of a run, also a pooled one, failing with `insufficient_state: replay topology mismatch for stage <name>` when a stage was created before the `ctx.tool` its first call follows. The stage replays when it is created, before that tool replays, so its recorded tool parent had no counterpart in the fork yet. The fork now takes that tool as the stage's parent by its stable id, and fails loudly only if the tool then starts with another identity or never starts. The fork records the stage with the parents the source recorded. A resume or fork whose definition changed or removed a tool that a replayed stage or tool follows, also inside a child workflow, now fails with a replay topology mismatch instead of completing with records that name a node the run no longer has. Such a run used to show no graph at all once rebuilt from its records; its records now rebuild it with the node its replayed stage recorded as parent. A live stage that takes the parents its record names is held to the same rule, so a child workflow resumed with a changed tool fails as its root does. A fork that only replaces its source's inputs still replays every recorded stage in its first execution: a stage after a tool or child workflow the new inputs ran again keeps the copied one as its recorded parent, and the fork's records show both. A fork whose definition changed or removed such a call fails like a resume ([#4945](https://github.com/bastani-inc/atomic/issues/4945))
68
+ - Fixed a fork from a stage that ran in parallel with another stage giving the forked stage that other stage as its parent, and the stage that joins them only the forked one. A fork from `b` of `start → [a ‖ b] → finish` now keeps `b ← start` and `finish ← a, b`: the fork records the stage id, parents and source order its fork point has in the source, and the stage resumes with them. This also fixes a fork from a stage that a later attempt completed, for example after a resume, which completed but whose durable view was empty, so inspecting, resuming or restarting the fork failed ([#5042](https://github.com/bastani-inc/atomic/issues/5042)).
69
+ - Fixed a message sent to a stage on a local worker being dropped without telling its sender when the stage's worker attempt ended and the replacement finished the stage before the message was sent again. The parent session now gets a notice naming the message and the stage, and the stage chat shows the same notice, so you can send it to another stage ([#4884](https://github.com/bastani-inc/atomic/issues/4884))
70
+ - Fixed a pooled child using up one of its attempts when a worker's claim of it was recorded but the answer never reached the worker, and that worker then died before running it. A worker now confirms its claim with a heartbeat before it runs the child, and only a confirmed claim counts as an attempt. A claim whose lease expires unconfirmed goes back to the queue as a handoff, which counts as none of the child's attempts, and a late confirmation from that claim is refused. A child that fails at its attempt limit after such a handoff reports the attempts it spent, not one per claim ([#5034](https://github.com/bastani-inc/atomic/issues/5034))
71
+ - Fixed a workflow run that holds more than 10 MB of checkpoints not reading back from a libSQL server (sqld), which refuses a response over 10 MB. Resuming or inspecting the run failed. The journal now reads events in pages of about 1 MiB of payload ([#4954](https://github.com/bastani-inc/atomic/issues/4954))
72
+ - Fixed a `ctx.task({ worktree: true })` change larger than 1 MiB being saved as an empty `diff` artifact and then deleted with the task's worktree. Git now writes the patch straight to the artifact file, with binary changes included, so a change of any size is saved in full. When a diff cannot be captured, the worktree is kept: the `diff` artifact records `captureError` and `worktreePath`, and the task's result warns where the work is. A `.worktreeinclude` file such as `.env` is also copied into a new worktree again in a repository with an installed `node_modules`, where it was silently skipped; when git cannot list those files, the task still runs and its `warnings` and `diff` artifact (`setupWarnings`) name the worktree and git's reason ([#4876](https://github.com/bastani-inc/atomic/issues/4876))
73
+ - Fixed a pooled child failing with `insufficient_state: missing durable UI answer for completed prompt`, or asking a `ctx.ui` prompt again and using the second answer, when its worker died right after you answered. A prompt's answer is now recorded in the same record as its completion, and the root keeps an answer its worker took until a later attempt shows the prompt settled, so the replacement uses your first answer once without asking again. A run whose journal already holds a completed prompt without its answer asks that prompt again once, when nothing was recorded after it, instead of failing ([#4941](https://github.com/bastani-inc/atomic/issues/4941))
74
+ - Forking or resuming a run whose workflow is defined in another project folder now loads that workflow only when that folder is a trusted project. Otherwise the fork is refused with a `definition-mismatch` error, reason `project-not-trusted`, that names the folder and says to start Atomic there and use `/trust`. `/workflow fork` and `/workflow resume` show the project trust prompt for that folder instead, when they can
75
+ - Fixed killing a workflow run, or aborting its `run()` signal, leaving the stages it had in flight, and those of its nested child runs, `running` forever. They now end `failed` with `workflow killed` (or `skipped` when a parent's exit cancels the run), its running `ctx.tool` calls end `cancelled`, the session journal and the durable journal record those ends, and status shows no active stage for the run ([#4875](https://github.com/bastani-inc/atomic/issues/4875))
76
+ - Fixed run-level `/workflow pause` doing nothing when the only work in flight was a `ctx.tool` call. It now stops the call and pauses the run resumably, as `quit` does, and resume runs the call again. A call that pause or quit stopped is now also recorded `cancelled` in the durable journal, so it shows after a restart ([#4878](https://github.com/bastani-inc/atomic/issues/4878))
77
+ - Project workflows and agents are now loaded only for trusted projects, and their presence prompts for trust. Workflow modules in `.atomic/workflows`, workflows named by the project's `.atomic/extensions/workflow/config.json` and that config itself are read only when the project is trusted, and trust granted later in the session is picked up by the next discovery
78
+ - Fixed a run's nested history becoming unreadable when a child workflow that failed was resumed and then ended by `ctx.exit`. The child's boundary records a skipped attempt after the failed one, and the history check rejected that pair, so completed-run inspection and fork lost every nested run of the root. The check now accepts any terminal after a resumed failed attempt, the same rule resume uses, and still reads every history earlier releases wrote. Runs already recorded this way become readable again with no migration ([#4863](https://github.com/bastani-inc/atomic/issues/4863))
79
+ - Fixed a resumed workflow spending past its `maxTokens` or `maxCost` budget after it re-entered a child workflow that the budget had stopped mid-run. The child's earlier stages replay without charge, and every new prompt after the resume is now charged in full ([#4859](https://github.com/bastani-inc/atomic/issues/4859))
80
+ - Fixed a pooled child failing for good, with "took different steps when it ran again on a replacement worker", when its worker was lost after a stage completed whose call followed a `ctx.tool` that ran after the stage was created. The stage replays when it is created, before that tool replays, and its replay record lost the tool as its parent, so the pool rejected the record as "immutable stage identity drift". The replayed stage now keeps the parents it recorded, and the rest of the run's graph matches the original. A same-id resume in one process recorded the same wrong parents, which later left the run unreadable from its records; a replay that would record a stage differently from its own record now fails instead of writing it ([#4888](https://github.com/bastani-inc/atomic/issues/4888))
81
+ - Fixed pattern sends such as `workflow:<root>/**` and `workflow:<root>/*/reviewer` silently missing live stages when a parent runs the same child workflow more than once, or names a child's boundary stage with `/` or `*`. Live forwards now use the target the run's roster announces, so every matching live stage gets the message once ([#4844](https://github.com/bastani-inc/atomic/issues/4844))
82
+ - Fixed a resumed workflow run still showing a stage, tool or child workflow that failed in an earlier attempt when the resumed attempt ended, for example with `ctx.exit`, before reaching it. Completed-run inspection, targeted inspection, resume, fork and Intercom routing for runs that are no longer live now show what the latest attempt reached, as the live run does, and a tool that ends badly in two attempts shows the latest attempt's status. A failure the run caught and completed past stays failed. Each resumed attempt now records itself in the run's journal; journals written before this change read as before, and earlier releases can still read journals written by this one ([#4874](https://github.com/bastani-inc/atomic/issues/4874))
83
+ - Fixed workflow stage patterns with many `**` segments taking exponential time to match against stage paths; matching now takes time proportional to pattern length times stage depth, and `workflow:` targets longer than 1024 characters or with more than 64 segments are no longer accepted ([#4843](https://github.com/bastani-inc/atomic/issues/4843))
84
+ - A workflow heartbeat that arrives while main chat is idle after an interrupt now starts a turn at once instead of waiting for your next message; `tasks.heartbeatWakesIdleSession` turns this off ([#4795](https://github.com/bastani-inc/atomic/issues/4795))
85
+ - Fixed a pooled child being taken off its worker and replayed elsewhere when a single heartbeat failed because the journal's database was briefly unreachable. The worker now keeps the child while its lease lasts and renews it with the next heartbeat that gets through, and an idle worker waits out the outage instead of exiting ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
86
+ - Fixed `/workflow resume` on a libSQL server (sqld) or another storage adapter still listing a deleted run, and missing the run that replaced it, until Atomic restarted. Over these adapters `SqlRunJournal.changeToken()` now returns `undefined` and each catalog read compares every run's latest event, about 77 ms at 10,000 runs on sqld. Atomic's own SQLite storage still serves an unchanged catalog from its cache. `RunJournal.changeToken` may now return `undefined` ([#4814](https://github.com/bastani-inc/atomic/issues/4814))
87
+ - Fixed a message sent to a pooled stage being delivered twice when the stage's worker stopped right after saving it. The stage now saves the message and its delivery receipt in one write, and the stage chat treats the message as delivered only after that write lands. If the worker stops before then, the message is sent again and reaches the replacement once ([#4839](https://github.com/bastani-inc/atomic/issues/4839))
88
+ - Fixed a failed workflow run that you resumed being missed by crash recovery when Atomic crashed or quit during the resumed attempt. The next session now reports it as interrupted, or resumes it under `resumeInFlight: "auto"`, instead of showing its earlier failure ([#4858](https://github.com/bastani-inc/atomic/issues/4858))
89
+ - Fixed a slow stage-session heartbeat checkpoint overlapping the next one when a stage paused and resumed its heartbeat, which could also drop that checkpoint's late failure. Checkpoints now run one at a time, and a late failure fails the stage ([#4853](https://github.com/bastani-inc/atomic/issues/4853))
90
+ - A fleet controller's drain now applies to the host's provider instance (`providerId`), not only its host id: a worker host that registers again on a drained instance under a new host id drains at once until the instance is removed, and a drain is forgotten once the provider no longer lists its instance. `providerId` now defaults to `ATOMIC_PROVIDER_ID`, or to `HOSTNAME` on Kubernetes, and fleet status shows it ([#4803](https://github.com/bastani-inc/atomic/issues/4803))
91
+ - Fixed a fork taken after an answered `ctx.ui` prompt (`confirm`, `select` or `input`, in the workflow or in a child workflow) showing nothing in inspection, the resume picker and Intercom routing until it was resumed. The fork now keeps the prompt's stage records along with its answer, so it shows its earlier stages, the answered prompt and its tools right after forking ([#4879](https://github.com/bastani-inc/atomic/issues/4879))
92
+ - Fixed workflow runs on PostgreSQL ([#4793](https://github.com/bastani-inc/atomic/issues/4793)): opening the run journal created the snapshot blob tables with SQLite-only SQL and its runs table without the column the snapshot reference index orders by, so every run failed to start after `atomic storage join postgres://…`. A checkpoint or status payload that holds a NUL character or a lone surrogate is now saved too.
93
+ - Fixed a stage that runs again when a failed run is resumed with the same id getting the wrong parents in the run graph. It took the stages that had replayed before it as parents, and the stages after it lost an edge: with `Promise.all([A, B])`, then S and T together, then Z, a resume after S failed gave S the parent T instead of A and B, and Z only S instead of S and T. The stage now keeps the parents and the position its first attempt recorded, so the resumed graph matches an uninterrupted run, the run opens from the completed-runs catalog, and the same body inside a child workflow can be resumed and re-run. Runs already resumed this way keep the conflicting records and still don't open ([#4871](https://github.com/bastani-inc/atomic/issues/4871))
94
+ - Fixed string workflow inputs bypassing their schema: a `Type.Literal(...)`, `minLength`, `maxLength`, `pattern` or `format` constraint is now enforced when you start a run, call a child workflow, fork or resume, and the error names the input and the constraint it breaks. Input names inherited from `Object.prototype` (`constructor`, `toString`, …) and a JSON `__proto__` key are now rejected as undeclared, so a `__proto__` key can no longer supply an input that a resumed or forked run would not see. An output declared with a `default` that the run omits now gets that default, so a parent's `ctx.workflow(...)` call no longer receives it as `undefined` ([#4849](https://github.com/bastani-inc/atomic/issues/4849))
95
+ - Fixed the workflow budget warning not firing when a token, cost or duration reading is exactly at `warnAtPercent`, for example 29 of 100 tokens at `warnAtPercent: 29` ([#4850](https://github.com/bastani-inc/atomic/issues/4850))
96
+ - Fixed a worktree workflow started from a repository subdirectory whose name starts with two dots (for example `..sub`) running at the worktree root instead of that subdirectory ([#4836](https://github.com/bastani-inc/atomic/issues/4836))
97
+ - Fixed the fleet autoscaler's boot-failure backoff depending on the order the provisioner lists its hosts. When one host registers in the same tick another fails to boot, the registration clears the earlier failures and the new failure still counts, so the replacement starts at once and a further failure backs off. Hosts idle for the same time are now drained in id order ([#4832](https://github.com/bastani-inc/atomic/issues/4832))
98
+ - `ctx.chain`, `ctx.parallel` and `ctx.task` now insert task text and previous-step output verbatim into `{task}` and `{previous}`; text containing `$$`, `$&`, `` $` `` or `$'` (shell, Perl or regex code) was previously altered before reaching the next stage ([#4887](https://github.com/bastani-inc/atomic/issues/4887))
99
+ - Fixed pending and sticky workflow stage messages that could fill the run owner's memory and journal without bound: besides the 50-message limit per target, one run now holds at most 1,000 queued messages or 64 MiB across all targets, including future stages and patterns. A send past the limit is refused with an error that states it, and messages already queued are kept ([#4896](https://github.com/bastani-inc/atomic/issues/4896))
100
+ - Fixed shared placement on a database server such as sqld or Turso slowing down and stalling as hosts were added. Every pool write (a checkpoint, a heartbeat, a claim, a completion, a stage input, a host's report) now goes as one request, instead of an interactive transaction of 6–17 requests that held the server's write lock across each round trip. A write that finds the lock busy waits a short random time before trying again. Each process sends at most four writes at once, with lease renewals and host reports first. A request the server leaves unanswered is abandoned after 30 seconds and the write planned again, never applied twice. At 8 hosts × 4 workers on sqld started with `--checkpoint-interval-s 60`, checkpoints commit 5% faster, with p99 latency down from 1.3 s to 1.1 s ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
101
+ - Fixed pooled children failing, or using up their retries, while a shared store's write lock stayed busy under many hosts. A checkpoint, a heartbeat or a completion the store refuses only for a while is sent again within the attempt's lease, and applied once. A worker starting meanwhile waits for the store, and a root's enqueue is sent again. An attempt the store keeps refusing for two minutes hands its child to another host without counting as an attempt, up to 20 times per child. A write the store can never take, such as one past its size limit, counts as a failed attempt, so the child fails after its attempt limit with an error that names the refusal. A write of an attempt that already ended never reaches the attempt that replaced it A child whose claim the store took while its answer was lost goes back to the queue once its lease expires, instead of staying leased to a worker that never knew it held it, and that lost claim counts as none of its attempts. A worker whose child's handoff the store refuses to record waits the outage out instead of exiting, so a long outage no longer fails the pool for crashing workers. ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
102
+ - A fleet controller now keeps a drain when a worker host without a provider id restarts on its instance under a new host id: it drains the new host when the provider lists that id for the instance, and never removes a drained instance whose host is gone while a host it cannot match holds a child. A drain is forgotten only after three listings in a row omit its instance, so a listing that briefly misses a running instance no longer lets a drained worker serve again ([#4828](https://github.com/bastani-inc/atomic/issues/4828))
103
+ - Fixed a fleet controller whose host clock stepped back acting on the fleet after another controller took its lease, and a forward step of the wall clock removing booting hosts as boot failures: lease checks and the autoscaler's boot-timeout, idle-drain and scale-up delays now use the monotonic clock. A `releaseWhenWaiting` idle release and journal lock waits are no longer delayed by a step back of the wall clock ([#5058](https://github.com/bastani-inc/atomic/issues/5058))
104
+ - Fixed workflow notices, status messages, run summaries, tool-result summaries, readiness state, stage output cut to a byte budget and other bounded previews cutting an emoji in half at the limit, which showed up as `�` or a raw `\ud83d` escape ([#5097](https://github.com/bastani-inc/atomic/issues/5097))
105
+ - With a `postgres://` journal whose adapter is not installed, worker setup now says to install `@bastani/atomic-storage-postgres` instead of `@bastani/atomic-storage-libsql`. Worker and workflow status show the cause of a storage failure, and no longer add the sqld hint for a PostgreSQL store ([#5113](https://github.com/bastani-inc/atomic/issues/5113))
106
+ - Fixed a `ctx.chain` or `ctx.parallel` `modelConstraints.allowedProviders` or `excludedProviders` overriding your `modelRouting` provider settings for tasks that set no `modelConstraints` of their own. Shared provider lists now only narrow your settings, for every task. Only a task's or stage's own provider lists replace them ([#5046](https://github.com/bastani-inc/atomic/issues/5046))
107
+ - Fixed a workflow checkpoint recording a worktree snapshot whose content a snapshot collection had deleted after the capture stored it, which left the run's snapshot unrestorable. The checkpoint stores the content again and retries, then captures once more; if that fails too, it is committed without the snapshot and the run reports `blobs-collected` ([#5077](https://github.com/bastani-inc/atomic/issues/5077))
108
+ - Fixed pooled work and a root's binding carrying a dispatch snapshot whose content a snapshot collection had deleted before the work was queued, which left its child with a snapshot it could not restore. Work is now queued without such a snapshot, the root reports `blobs-collected`, and the child runs as it does when the dispatch capture is unavailable. A pooled child's checkpoint whose snapshot content was collected before the pool wrote it is now stored again and retried, or committed without the snapshot, instead of recording one that cannot be restored. A local pool over a journal in another database no longer stops handing out work for good when a checkpoint it accepted lost its snapshot content while waiting to be delivered: the checkpoint is recorded without the snapshot and the pool goes on ([#5077](https://github.com/bastani-inc/atomic/issues/5077))
109
+ - Fixed a readiness decision that finished just as a stage was paused or aborted still advancing or keeping the stage open and dropping your message. The late verdict is now discarded unrecorded, and your message is judged again when the stage resumes ([#5159](https://github.com/bastani-inc/atomic/issues/5159))
110
+ - Fixed startup recovery resuming a run that was paused, or taken up by another host, while the "Resume interrupted workflows?" dialog was open: each run is checked again just before it resumes, and a failed check is reported as a startup resume warning. Such runs are now named in a notice. Fixed an aborted SDK adoption of a run losing the run: an abort while the adoption claimed the run left it `running` under the adopting session with nothing executing it, and an abort while its executor started cancelled the run for good. The executor is now stopped and the run returns, still resumable, to its previous status and owner; a released run stays adoptable by any session, and a change another session made meanwhile is kept. An abort that arrives once the resumed run has started no longer reports the resume as aborted while the run keeps running. A pause, an answered prompt or `resumable: false` written while a resumed run was starting is no longer overwritten when it starts: a paused run stays paused and is not started, and the resume reports that the run changed ([#5149](https://github.com/bastani-inc/atomic/issues/5149))
111
+ - Fixed a paused workflow run that no session could resume. Pausing a run whose owning session's process had died left it paused under that dead session, and any status change on a run its session had released (an answered prompt, another pause) cleared the release, so the run was neither crash- nor release-adoptable. A running or failed run that nothing is executing is now released by its owner when it is paused, and a released run keeps its release while it stays paused, so another session can adopt it. A session whose process took over a crashed run's lease, for example to answer one of its prompts, can now adopt that run instead of being refused. A run its live session pauses or quits is still not released ([#5167](https://github.com/bastani-inc/atomic/issues/5167))
112
+ - Fixed a pooled stage on a host that doesn't run its root keeping its Intercom inbox after its session failed to start: later messages to it were taken into the failed session instead of staying queued ([#5168](https://github.com/bastani-inc/atomic/issues/5168))
113
+ - Fixed the workflow session picker showing no selected row when the selected run left the list and the list got shorter. The selection now moves to the nearest remaining run, so Enter acts on it without first moving the cursor.
114
+ - Fixed `/workflow` commands whose arguments start after a tab or on a new line not being run ([#5192](https://github.com/bastani-inc/atomic/issues/5192))
115
+ - Fixed reading a workflow run's journal of large events, as resuming or inspecting a run does, and a worker pool host reading a root's large checkpoints, as one that takes over a child does, taking time that grew with the square of their number. To cut each page at its size limit, a read measured the payloads of up to 256 events (the pool host's read, of every checkpoint left) to return a few large ones, so reading 1000 events of 256 KiB took about a minute on SQLite, PostgreSQL and libSQL servers alike. Each page now measures about twice the events it returns, and a journal read's pages of small events are unchanged ([#5263](https://github.com/bastani-inc/atomic/pull/5263))
116
+ - Fixed a fleet controller keeping an instance whose worker died after registering for 5 minutes instead of removing it for its boot timeout, when the removal was cut off after it asked the instance to drain: a busy or paused controller's lease could lapse, or the controller could stop, just before its provider call. The drain now names the boot-timeout removal, so the next tick, or the controller that takes over, removes the instance once no host on it reports or is draining. A controller whose lease may have lapsed still makes no provider call ([#5072](https://github.com/bastani-inc/atomic/issues/5072))
117
+ - `/workflow resume`, `/workflow pause` and `/workflow fork` completion no longer offers run IDs where a stage or message goes, and `fork` no longer offers `--from` twice ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
118
+ - Fixed checkpoint shipping acknowledging more steps locally after a direct shared-journal commit lost its work or root lease, including a root lease released without changing its epoch. Ownership-loss refusals fence that attempt without fencing a replacement generation. Delayed releases and renewals from an older attempt no longer remove the replacement's acknowledged checkpoints. An expired but unreplaced work lease, or a late renewal of the same root lease, keeps acknowledged checkpoints and allows direct commits and shipping to retry after renewal ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
119
+ - Fixed a worker host hanging during shutdown when a deadline-triggered checkpoint flush still had another batch pending ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
120
+ - Fixed checkpoint shipping reporting checkpoints as pending after they had shipped or their attempt was fenced or replaced. A late local acknowledgement no longer keeps the host from claiming new children ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
121
+ - Fixed checkpoint shipping starting catch-up too late when larger batches take longer to deliver. Catch-up scheduling now learns their delivery times separately from normal batches ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
122
+ - Restarting a worker host with a large checkpoint backlog no longer loads every saved output before new work can start ([#4768](https://github.com/bastani-inc/atomic/issues/4768))
123
+ - Switching workflow runs while a stage chat has unsent text preserves that stage's draft when you return ([#5224](https://github.com/bastani-inc/atomic/issues/5224))
124
+ - Reloading workflow resources no longer leaves old runs in the optional status file or corrupts it when a previous write is still finishing. Status writes retry temporary Windows file locks. Status summaries distinguish blocked and stopped runs from pending stages and failures. Long failure logs preserve indentation, root error codes, hints and rollback causes, and combining marks no longer crash failure details or workflow notices ([#5234](https://github.com/bastani-inc/atomic/pull/5234))
125
+
9
126
  ## [0.9.88-alpha.1] - 2026-11-16
10
127
 
11
128
  ### Breaking Changes
@@ -673,7 +673,7 @@ Tradeoff: `Type.Unsafe<T>()` does not deeply validate at runtime — it trusts t
673
673
  | `/workflow <name> --help` | Print the workflow's input schema |
674
674
  | `/workflow list` | List all registered workflows with descriptions |
675
675
  | `/workflow status [run-id]` | Show active plus retained terminal/current-session runs, or details for one run |
676
- | `/workflows [run-id]` | Open the session's only run graph, or a list of runs |
676
+ | `/workflows [run-id] [stage]` | Open the session's only run graph, a stage chat, or a list of runs |
677
677
  | `/workflow pause [run-id\|--all]` | Pause active/named/all active runs so they can resume |
678
678
  | `/workflow quit [run-id\|--all]` | Gracefully pause live workflow runs so they can resume later |
679
679
  | `/workflow resume <run-id>` | Resume paused work or re-open a run snapshot |
@@ -682,7 +682,7 @@ Tradeoff: `Type.Unsafe<T>()` does not deeply validate at runtime — it trusts t
682
682
 
683
683
  Input overrides are bare `key=value` tokens (no leading `--`). Values are JSON-parsed when possible, so numbers, booleans, and quoted strings work as expected (e.g. `count=3`, `flag=true`, `prompt="multi word value"`). A whole-object override can be passed as a single JSON token (e.g. `{"prompt":"...","count":3}`). Runtime validation is strict: unknown input keys, missing required values, type mismatches, and invalid `select` choices fail before a named workflow run starts.
684
684
 
685
- Named workflow launches always run as **background tasks** in interactive sessions. Run `/workflows <run>` to see agents working and chat with and steer each stage. Foreground launches are reserved for explicit user requests or technical requirements, with notice before launch. Press **F2** to open the same live graph viewer; HIL prompts (`ctx.ui.input/confirm/select/editor/custom`) appear as awaiting-input graph nodes. Press Enter on a focused node, click a visible graph node, or choose one from the switcher to open a `ctx.tool` node's one read-only agent-chat-style tool message block, never a modal dialog or editable transcript. Tool nodes remain non-attachable: their graph card body is always the constant `durable tool`, and the message block is collapsed by default with the tool name/call and a compact bounded result or error preview. The configured `app.tools.expand` action (`ctrl+o` by default) toggles full bounded args, result or error, callback source, timing, and cached/replayed markers. `↑`/`↓`, `PageUp`/`PageDown`, `Home`/`End`, the wheel, and the scrollbar scroll the block; Escape or ← returns to the graph. It is read-only and offers no attach, steer, pause, or resume action. ← on an empty stage prompt returns to the graph. Escape closes a graph detail or key overlay, then returns to the graph's opener. Ctrl+X does not navigate workflow views. Composer and prompt drafts survive leaving a stage, and pending custom questions remain pending for reattachment. `ctrl+d` and `q` are not workflow navigation controls; ordinary editor/prompt Ctrl+D behavior and printable prompt `q` remain available. In a stage chat, `esc` only interrupts the stage or closes a question, never leaves the chat. `ctrl+c` and graph `h` retain their close/hide behavior. While the graph pane is active, vertical wheel/trackpad gestures pan vertically and horizontal gestures pan wide graphs left and right when the terminal reports them, without falling through to the main chat or terminal scrollback. Focused graph and stage-chat overlays receive those gestures through the fullscreen application route. Fullscreen pi-tui owns application selection, so drag and multi-click selection also work over workflow overlays; copied text uses OSC 52, and terminals that refuse OSC 52 writes rely on the modifier-drag bypass (Shift/Option, as provided by the terminal). `ctrl+t` is not a workflow control: focused workflow overlays leave it to the host `app.thinking.toggle` action, while inline tree selectors keep `app.tree.filter.noTools`. Human input is detected when those runtime `ctx.ui.*` calls execute; workflows no longer have a declaration-time HIL flag.
685
+ Named workflow launches always run as **background tasks** in interactive sessions. Run `/workflows <run>` (or `/workflows <run> <stage>` for a stage chat) to see agents working and chat with and steer each stage. Foreground launches are reserved for explicit user requests or technical requirements, with notice before launch. Press **F2** to open the same live graph viewer; HIL prompts (`ctx.ui.input/confirm/select/editor/custom`) appear as awaiting-input graph nodes. Press Enter on a focused node, click a visible graph node, or choose one from the switcher to open a `ctx.tool` node's one read-only agent-chat-style tool message block, never a modal dialog or editable transcript. Tool nodes remain non-attachable: their graph card body is always the constant `durable tool`, and the message block is collapsed by default with the tool name/call and a compact bounded result or error preview. The configured `app.tools.expand` action (`ctrl+o` by default) toggles full bounded args, result or error, callback source, timing, and cached/replayed markers. `↑`/`↓`, `PageUp`/`PageDown`, `Home`/`End`, the wheel, and the scrollbar scroll the block; Escape returns to the graph; Left does nothing in the tool detail. It is read-only and offers no attach, steer, pause, or resume action. In an attached stage chat, **← on an empty prompt** (or at the start of a typed prompt, preserving the draft) returns to the graph. In the graph, arrows only move between nodes; ← at the leftmost node does nothing. **Esc** is the only back key in the graph and its tool/failure details: it closes a detail or key overlay first, then returns to the graph's opener. Ctrl+X does not navigate workflow views. Composer and prompt drafts survive leaving a stage, and pending custom questions remain pending for reattachment. `ctrl+d` and `q` are not workflow navigation controls; ordinary editor/prompt Ctrl+D behavior and printable prompt `q` remain available. In a stage chat, `esc` only interrupts the stage or closes a choice/yes-no question back to the chat's prompt (never leaving the chat). `ctrl+c` and graph `h` retain their close/hide behavior. While the graph pane is active, vertical wheel/trackpad gestures pan vertically and horizontal gestures pan wide graphs left and right when the terminal reports them, without falling through to the main chat or terminal scrollback. Focused graph and stage-chat overlays receive those gestures through the fullscreen application route. Fullscreen pi-tui owns application selection, so drag and multi-click selection also work over workflow overlays; copied text uses OSC 52, and terminals that refuse OSC 52 writes rely on the modifier-drag bypass (Shift/Option, as provided by the terminal). `ctrl+t` is not a workflow control: focused workflow overlays leave it to the host `app.thinking.toggle` action, while inline tree selectors keep `app.tree.filter.noTools`. Human input is detected when those runtime `ctx.ui.*` calls execute; workflows no longer have a declaration-time HIL flag.
686
686
 
687
687
  Typing into an attached stage chat and pressing Enter steers: the message is consumed after the current assistant response finishes its tool batch and before the next model request, matching normal session steering. Ctrl+F queues a follow-up, consumed only when the agent would otherwise stop. Queued entries belong to the stage session rather than the pane, so leaving the stage and reattaching restores the pending `Steering:` / `Follow-up:` rows, and a detached stage node carries a `✉ N queued` badge in the graph.
688
688
 
@@ -38,7 +38,7 @@ import {
38
38
  parseFailureDiagnostics,
39
39
  summarizeReviewConvergence,
40
40
  reverify_consolidated_batch
41
- } from "./chunk-cryf7s3r.js";
41
+ } from "./chunk-jm7redy5.js";
42
42
  import {
43
43
  VERIFICATION_SCALE
44
44
  } from "./chunk-n1910xc4.js";