Skip to content

cloudfall CLI phase 3: health, backup, propose/approve, operator approve, migrate on treaty - #8

Merged
romamo merged 1 commit into
mainfrom
treaty-cli-phase3
Oct 2, 2026
Merged

romamo merged 1 commit into
mainfrom
treaty-cli-phase3

Conversation

@romamo

@romamo romamo commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Phase 3 of moving the cloudfall CLI to treaty: seven commands that run Ansible. Stacked on #7 (base treaty-cli-phase2), which is stacked on #6.

Changes

  • health, backup run, backup verify, operations propose, operations approve, operator approve and migrate run in cloudfall.app; their argparse handlers are gone
  • EngineContext and AgentConfig carry a step runner (lifecycle.subprocess_step by default), so MCP and the argparse commands are unchanged while the treaty commands run every engine step through ctx.run in the project directory. operations propose/approve pass a ctx.run check runner to decision.propose/approve
  • operations approve and migrate keep --yes; without it they change nothing and answer effect: noop (treaty reads would_* only from its own dry run: #197). operator approve and backup run stay ungated, as decided
  • New exit codes, each with the result in data: 87 ENGINE_STEP_FAILED, 88 UNHEALTHY, 89 CHECK_FAILED, 90 NOT_VERIFIED; a paused migrate is 3 PARTIAL_FAILURE, and a failed step's code and message are in error.context
  • Each command declares subprocess= and required_tools=, so doctor checks ansible-playbook

Not moved yet

deploy, rollback, restart and data migrate write wouldRun in their plan answer, which needs an output adapter on a mutating command: treaty #183.

Checks

  • uv run pytest: 456 passed, 1 xfailed (FORCE_COLOR unset)
  • ruff, mypy: clean; treaty audit cloudfall.app:app: #180 false positives and advice only
  • health crm-backend against the example project (TEST-NET hosts): inventory rendered in the project, Ansible ran through ctx.run, exit 88 with the result in data
  • operations propose on a fixture repository ran real check mode through ctx.run and wrote the diff; operations approve without --yes previewed and changed nothing
  • Nothing was run against real servers

🤖 Generated with Claude Code

Phase 3 of moving the cloudfall CLI off argparse, for the commands that
change servers and whose answer fits a dataclass. EngineContext and
AgentConfig carry a step runner, subprocess by default for MCP and the
argparse commands, so the treaty commands run every engine step and
check-mode run through ctx.run in the project directory.

operations approve and migrate keep --yes: without it they preview and
answer effect noop, since treaty reads would_* only from its own dry run
(treaty #197). deploy, rollback, restart and data migrate wait for
treaty #183 (wouldRun). New exit codes 87 to 90 carry the result in data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@romamo
romamo changed the base branch from treaty-cli-phase2 to main October 2, 2026 07:56
@romamo
romamo merged commit 0a573f5 into main Oct 2, 2026
1 check passed
@romamo
romamo deleted the treaty-cli-phase3 branch October 2, 2026 07:58
@shipmill-romamo shipmill-romamo Bot added this to the 0.6.0 milestone Oct 8, 2026
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