Prerequisites
- JJ installed and in
PATH(brew install jjorcargo install jj-cli) - Workspace is a JJ repository (
jj git initorjj init) - Target attempt has a recorded JJ pointer (captured only when JJ was available at attempt completion)
How It Works
- On successful attempt completion, Smithers captures the JJ change ID via
jj log -r @ --no-graph --template change_id. - The change ID is stored in
_smithers_attempts.jj_pointer. smithers revertrunsjj restore --from <change_id>to restore the workspace.- Database frames recorded after the attempt started are deleted so the DB state matches the reverted filesystem.
CLI Usage
Flags
| Flag | Default | Description |
|---|---|---|
--run-id ID | required | Run containing the target attempt. |
--node-id ID | required | Task node to revert to. |
--attempt N | 1 | Attempt number (1-indexed). |
--iteration N | 0 | Loop iteration number. |
Examples
Exit Codes
| Code | Meaning |
|---|---|
0 | Revert succeeded. |
1 | Revert failed. |
Output
RevertStarted and RevertFinished events are printed as JSON lines to stdout during execution.
Programmatic Usage
RevertOptions
RevertResult
Events
RevertStarted— Beforejj restoreruns. IncludesjjPointer.RevertFinished— After restore completes. Includessuccessanderror(if failed).
Troubleshooting
| Error | Cause |
|---|---|
| ”Attempt has no jjPointer recorded” | JJ was not available when the attempt finished. Pointers are captured opportunistically. |
| ”jj exited with code 1” | Change ID pruned/GC’d, workspace conflicted, or JJ misconfigured. |
Related
- Events — RevertStarted and RevertFinished types.
- VCS Integration — Version control integration.
- CLI — Full CLI reference.