Skip to content

feat(rollback): RollbackExecutor and CLI execute path#28

Merged
mdheller merged 1 commit into
mainfrom
feat/rollback-execute
Jun 16, 2026
Merged

feat(rollback): RollbackExecutor and CLI execute path#28
mdheller merged 1 commit into
mainfrom
feat/rollback-execute

Conversation

@mdheller

Copy link
Copy Markdown
Contributor

Summary

  • RollbackExecutor (rollback_executor.py): execute boundary for AsahiRollbackPlan. Shells out to nixos-rebuild switch --rollback. Dry-run by default. Emits RollbackExecutionResult with engineId, per-step results, durationMs, and issuedAt.
  • CLI: adds sourceos-boot rollback plan (non-mutating) and sourceos-boot rollback execute (dry-run unless --execute).
  • Purity invariant preserved: asahi_boot_chain.py remains side-effect-free; all execution is in rollback_executor.py.

Test plan

  • python3 -m pytest tests/ -q → 28 passed
  • sourceos-boot rollback plan → prints AsahiRollbackPlan JSON, exits 0
  • sourceos-boot rollback execute → dry-run steps, exits 0
  • sourceos-boot rollback execute --execute on device → applies rollback

- RollbackExecutor: converts AsahiRollbackPlan into real subprocess calls.
  Non-mutating purity boundary is preserved in asahi_boot_chain.py; this
  module owns the execute boundary.
- CLI: adds `sourceos-boot rollback plan` and `sourceos-boot rollback execute`.
  --execute flag required to shell out; dry-run default.
- RollbackExecutionResult.to_dict() emits engineId + specVersion for
  traceability.
- 28 tests passing.
@mdheller mdheller merged commit bc6dd8c into main Jun 16, 2026
1 check passed
@mdheller mdheller deleted the feat/rollback-execute branch June 16, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant