Skip to content

docs: Document RevertActor and drop "terminal" from CRASHED - #1711

Open
shrutiyam-glitch wants to merge 3 commits into
agent-substrate:mainfrom
shrutiyam-glitch:update-comments-doc
Open

shrutiyam-glitch wants to merge 3 commits into
agent-substrate:mainfrom
shrutiyam-glitch:update-comments-doc

Conversation

@shrutiyam-glitch

@shrutiyam-glitch shrutiyam-glitch commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

RevertActor returns a RUNNING, PAUSED, or CRASHED actor to SUSPENDED at its last external snapshot, so CRASHED is no longer a dead end that only DeleteActor can clear. Docs and code comments still described it as terminal and told operators to delete and recreate the actor, losing its state.

Update the api-guide, architecture, upgrade guide, and kubectl-ate README to cover the new verb, and correct the comments that justified keeping a partial external snapshot by naming actor deletion as the only remaining collector -- revert collects it too.

Follow up for the PR - #1675
Issue - #1556

  • Tests pass
  • Appropriate changes to documentation are included in the PR

RevertActor returns a RUNNING, PAUSED, or CRASHED actor to SUSPENDED at
its last external snapshot, so CRASHED is no longer a dead end that only
DeleteActor can clear. Docs and code comments still described it as
terminal and told operators to delete and recreate the actor, losing its
state.

Update the api-guide, architecture, upgrade guide, and kubectl-ate README
to cover the new verb, and correct the comments that justified keeping a
partial external snapshot by naming actor deletion as the only remaining
collector -- revert collects it too.
@shrutiyam-glitch
shrutiyam-glitch marked this pull request as ready for review September 17, 2026 17:14
@bowei Bowei Du (bowei) added kind/docs Improvements or additions to documentation area/api User-facing API changes labels Sep 17, 2026
}

// The actor is CRASHED and can only be deleted from here.
// The actor is CRASHED; delete reclaims its partial snapshot.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete reclaims its partial snapshot.

what does this mean?

// every object that suspend wrote. CRASHED is terminal, so the actor delete is
// the only collector left: whatever it cannot name is leaked for good.
// every object that suspend wrote. When an actor crashes mid-suspend, only
// delete or revert can collect the partial snapshot: whatever they cannot name

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only delete or revert can collect the partial snapshot
we are not collecting partial snapshot anywhere right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by collecting, I meant only those two actions can get rid of the in progress snapshots.
will reword it.

Julian Gutierrez Oschmann (juli4n) pushed a commit to juli4n/substrate that referenced this pull request Sep 18, 2026
#### Summary
This PR introduces the `RevertActor` RPC for actor lifecycle management.
It includes the API definition, the corresponding workflow execution
logic, observability metrics, and updates to the authorization model to
support reverting actors.

Fixes agent-substrate#1556
Docs updated in agent-substrate#1711 

#### Commit-wise Changes

**1. Add RevertActor RPC (`1145d99`)**
* Introduces the new `RevertActor` RPC to the API definitions.
* Updates the corresponding protobuf bindings (affecting files like
`ateapi.pb.go` and `ateapi_pb2.py`).

**2. Add the revertActor workflow and observability metrics
(`dcb1fae`)**
* Implements the core `revertActor` workflow logic, designed to be
idempotent and re-enterable. It progresses through the following steps:
* **Mark Reverting:** Validates that the actor is in a revertable state
(`RUNNING`, `PAUSED`, or `CRASHED`) and transitions its state to
`REVERTING`.
* **Discard Worker:** Safely tears down the execution environment by
terminating the workload, detaching volumes, and releasing the assigned
worker.
* **Collect In-Progress Snapshot:** Cleans up external object storage by
deleting any objects a previous suspend operation was partway through
writing.
* **Finalize:** Commits the actor to `SUSPENDED` and strips all
node-local and in-progress state pointers (clearing `WorkerAssignment`,
`LocalSnapshotInfo`, etc.), returning the actor to its untouched
external snapshot.
* Instruments the workflow with lifecycle operation metrics (e.g.,
updating `ate.actor.lifecycle.operation.duration` to track `revert`
operations).
* *Note/TODO:* Currently, when reverting a paused actor, the workflow
drops the pointer to the node-local state but does *not* actually prune
the local checkpoint bytes from the node (this is tracked in agent-substrate#641).

**3. Add `can_revert` to the authorization model (`2fc53ae`)**
* Adds the `can_revert` permission to the auth model, mirroring the
shape of `can_suspend` (editor tier of the parent atespace, plus a
direct grant so a machine identity can revert the actor it drives
without holding an atespace role).

**4. Serve RevertActor and add the CLI verb (`f04fab4`)**
* Wires the `Control.RevertActor` service method to the workflow
(replacing the generated stub that previously answered `Unimplemented`).
* Adds the `"ate revert actor"` CLI command, making the feature usable
end-to-end.
* Implements `Terminate` for the fake atelet. This was necessary because
reverting an actor from the `RUNNING` state is the first path to reach
this call in functional tests (previously, delete tests skipped this
step as they ran against actors with no worker assignment).

**5. Add a manual verify script for RevertActor (`8022db3`)**
* Adds a script to manually exercise `RevertActor` against a real
control plane, since unit and functional tests only run against a fake
atelet.
* Tests reverting from `CRASHED`, `RUNNING`, and `PAUSED` states, and
verifies that attempting to revert a `SUSPENDED` actor is properly
rejected.
* Simulates a crash by deleting the worker pod the actor runs on to
verify the workflow can handle the absence of a worker to terminate.


- [ ] Tests pass
- [ ] Appropriate changes to documentation are included in the PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api User-facing API changes kind/docs Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants