Skip to content

Commit facb4fe

Browse files
committed
📝 Finish saying what the executor lock and the workflow host already do
The previous commit moved the inventories and left three passages behind, each still describing the state before the merge it was reconciling. `start.md` called single-executor ownership, atomic lifecycle transitions, cancellation and deletion unbuilt. They are #466's, owned by the executor lock; only durable suspension and releasing the executor at a checkpoint remain #367. `runtime.md` said `xmd workflow cancel` asks an active executor to stop, which is the one thing cancellation never does. It refuses without mutation against a live executor and directs the caller to interrupt the foreground process; without one, an eligible retained state transitions to `cancelled` under the exact lock; a completed or failed outcome stays authoritative. The specification called `<Repository>` and `<Worktree>` unimplemented alongside `<Agent.AddDir>`, which conflated a shipped composition with an unbuilt Agent boundary, and opened its lifecycle paragraph with "the rest of the lifecycle is not built" before listing what #466 shipped. Both now lead with what is built and end with what is not. The sweeps carry each of those exact forms as a forbidden pattern, self-tested against the text that produced them, so a regression fails there rather than in review.
1 parent ecb957f commit facb4fe

3 files changed

Lines changed: 29 additions & 19 deletions

File tree

‎specs/adversarial-implementation-workflow.md‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -599,15 +599,17 @@ History reads already-filtered retained protocol events, so it exposes no value
599599
the security policy has not already seen, and the authored source position it
600600
reports is descriptive evidence about an event rather than identity.
601601

602-
The rest of the lifecycle is not built. Durable suspension and releasing the
603-
executor at a checkpoint, the single-executor ownership and atomic lifecycle
604-
transitions around them, and cancellation and deletion are shipped as #367's
605-
second slice (#466): the executor lock owns every transition, and a cancellation
606-
that meets a live executor refuses without mutation and directs the caller to
607-
interrupt the foreground process rather than signalling it. Durable suspension
608-
and releasing the executor at a checkpoint remain #367; versioned
609-
history checkpoints, compatible forks, `history --forkable`, and forkability
610-
reasons remain #368.
602+
The authority underneath is shipped as #367's second slice (#466). The executor
603+
lock owns every lifecycle transition, so single-executor ownership, atomic begin
604+
and settle, cancellation and deletion are built. Cancellation never reaches into
605+
a live document execution: meeting a live executor it refuses without mutation
606+
and directs the caller to interrupt the foreground process, while an eligible
607+
retained state transitions to `cancelled` under the exact lock, and a
608+
`completed` or `failed` outcome stays authoritative.
609+
610+
What is not built is the wait. Durable suspension and releasing the executor at
611+
a checkpoint remain #367; versioned history checkpoints, compatible forks,
612+
`history --forkable`, and forkability reasons remain #368.
611613

612614
**Still missing: who answered.** The journal records the validated decision, the
613615
question fingerprint, and the document execution it belongs to. It does not
@@ -695,8 +697,9 @@ is composition and isolation, not a security boundary — the security boundary
695697
the host's Agent ceiling and the Workspace the document's file operations resolve
696698
inside.
697699

698-
`<Repository>` and `<Worktree>` (#293) and `<Agent.AddDir>` (#302) are not
699-
implemented. `API.Files` and its host provider are: every document file operation
700+
`<Repository>` and `<Worktree>` are built and registered by the workflow host
701+
(#293, shipped); `<Agent.AddDir>` (#302) and the durable Git and forge effects
702+
below them are not. `API.Files` and its host provider are: every document file operation
700703
routes through that provider, which confines document paths to `Env.cwd` while the
701704
host namespace is stable. That claim is about traversal rather than about the
702705
filesystem being stable — a directory that is real when it is read could be

‎workflows/adversarial-implementation/runtime.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,15 @@ Three outcomes are distinct, and none of them is a failure of the document:
119119
is available.
120120
- **Interruption.** Losing the executor outside an authored wait, including
121121
Ctrl-C, leaves the run `interrupted` and resumable at the journal frontier.
122-
- **Cancellation.** `xmd workflow cancel <run-id>` asks an active executor to
123-
stop and makes the run terminal. It retains the journal and Workspace for
124-
inspection and does not undo completed local or external effects.
122+
- **Cancellation.** `xmd workflow cancel <run-id>` never reaches into a live
123+
document execution. When the lock reports a live workflow executor it refuses
124+
without mutation and directs the caller to interrupt that foreground process
125+
instead. Without one, an eligible retained state — a stale `running` with no
126+
root Close, or a `suspended` or `interrupted` run — transitions to `cancelled`
127+
under the exact executor lock, validated inside the transaction that publishes
128+
it. A `completed` or `failed` outcome is authoritative and cancellation
129+
refuses. It retains the journal and Workspace for inspection and does not undo
130+
completed local or external effects.
125131

126132
An uncaught failure escaping the root is terminal too. Reusing that run's ID
127133
replays the retained failure rather than silently retrying it; a corrected

‎workflows/adversarial-implementation/start.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,12 @@ shipped (#366), and a resume restores completed durable effects from the journal
335335
rebuilds ephemeral attachments, and continues the partial remainder at the
336336
retained frontier. Reading a run back is shipped too: `xmd workflow status`,
337337
`list`, and `history` report immutable lifecycle snapshots without advancing
338-
anything (#460). What is still missing is the wait itself — releasing the
339-
executor at a checkpoint, and the single-executor ownership and atomic lifecycle
340-
transitions around it, remain #367 and unbuilt, as do cancellation and deletion.
341-
So a question asked today is answered inside the document execution that asked
342-
it. Gating is expressed by nesting, which
338+
anything (#460). So is the authority underneath: the executor lock owns
339+
lifecycle transitions, so single-executor ownership, atomic begin and settle,
340+
cancellation and deletion are shipped (#466). What is still missing is the wait
341+
itself — durable suspension, and releasing the executor at a checkpoint, remain
342+
#367. So a question asked today is answered inside the document execution that
343+
asked it. Gating is expressed by nesting, which
343344
prevents the remaining stages from running but does not stop the document
344345
execution: it still reaches the final-gate report inside the root's `<Output>`
345346
and completes.

0 commit comments

Comments
 (0)