diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 8b469a81..64032387 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -104,12 +104,37 @@ and run logs are raw Ansible output, so they stay under size (D-24). `cloudfall init` lays out a new project and `cloudfall add` declares its first fleet resources. -Proposed, not built: for a team that already runs Ansible, the project is -their existing repository. The fleet is read from their inventory instead of -`Server` resources, Cloudfall's declarations live under one `cloudfall` key -in their `group_vars` and `host_vars`, and their playbooks are registered as -operations. One config, theirs; no import and no second copy. See the -[brownfield design](docs/brownfield-design.md). +For a team that already runs Ansible, Cloudfall works on their existing +repository instead of a project. One config, theirs; no import and no second +copy. See the [brownfield design](docs/brownfield-design.md). + +Built on a team's repository since 0.4.0: + +- **The fleet reader.** `cloudfall inventory show`, `cloudfall audit` and + `cloudfall observe` read the fleet from their inventory (`--inventory`, + or the one their `ansible.cfg` names) instead of `Server` resources. + Hosts, groups and connection settings come from Ansible; each host's + `cloudfall` block in their `host_vars`, `cloudfall_defaults` per group and + the `cloudfall_baselines` catalog carry what Ansible does not model, and + are validated against the same schemas a project's resources are +- **The operations catalog and the gate.** Their playbooks are declared as + operations in `operations/`, each with a risk level, typed inputs, + preconditions and a verify playbook (`cloudfall operations list|show`); + `cloudfall operations propose` runs one in check mode and records it, + and `cloudfall decisions approve` is the person's step that runs it and + its verify playbook +- **The record and the agent surface.** `cloudfall why` (0.6.0) answers + from the decision records, and `cloudfall mcp serve --repository` serves + the declared operations as tools beside those reads + +Not built yet on a team's repository, so these still need a Cloudfall +project: deploy, rollback, restart and health +([#618](https://github.com/cloudfall-dev/cloudfall/issues/618)); backups +and the restore drill +([#619](https://github.com/cloudfall-dev/cloudfall/issues/619)); and +`cloudfall get host` returning a host's merged variables with the file that +sets each winning value +([#620](https://github.com/cloudfall-dev/cloudfall/issues/620)). ## Module boundaries @@ -152,8 +177,8 @@ The typed resources are today's config, not the point. The point is that there is one description of the fleet, the team owns it, it is plain files in a repository, and nothing rewrites it silently. The brownfield design keeps every one of those properties while moving the description into the -team's own Ansible inventory; the schemas then validate the `cloudfall` -block instead of standalone documents. +team's own Ansible inventory; on a team's repository the schemas already +validate the `cloudfall` block instead of standalone documents. ## Application and component model diff --git a/changelog.d/617-brownfield-built-status.md b/changelog.d/617-brownfield-built-status.md new file mode 100644 index 00000000..24791523 --- /dev/null +++ b/changelog.d/617-brownfield-built-status.md @@ -0,0 +1,3 @@ +### Fixed + +- Docs said reading a team's own Ansible inventory was not built: `ARCHITECTURE.md`, `docs/fleet-goals.md` (requirement 14, now Partial) and `docs/brownfield-design.md` (a status per part instead of "nothing is implemented") now say that `inventory show`, `audit`, `observe`, the operations catalog, `why` and `mcp serve --repository` work on a team's repository, and that deploy, rollback, restart and health (#618), backups and the restore drill (#619) and `get host` with each value's source (#620) do not yet (#617) diff --git a/docs/brownfield-design.md b/docs/brownfield-design.md index 4c95173f..cf0537eb 100644 --- a/docs/brownfield-design.md +++ b/docs/brownfield-design.md @@ -1,8 +1,11 @@ # Brownfield design: Ansible is the hand, the agent is the brain, Cloudfall is the conscience -Status: proposed concept. Nothing in this document is implemented. It -re-roots Cloudfall on an existing Ansible inventory instead of Cloudfall's -own resource documents. It builds on the decision in +Status: partly built. The read side, the catalog, the gate and the record +work on a team's own repository since 0.4.0 (`cloudfall why` since 0.6.0); +safe edits, starter operations and the run-side commands do not. Each of +[the seven parts](#the-seven-parts) opens with its own status. This +document re-roots Cloudfall on an existing Ansible inventory instead of +Cloudfall's own resource documents. It builds on the decision in [no Ansible replacement](decisions/2026-09-14-no-ansible-replacement.md) and changes the [project vocabulary](../ARCHITECTURE.md): the fleet is no longer declared by Cloudfall, it is read from Ansible. @@ -220,6 +223,11 @@ hosts and a library of verify steps is the product. ### 1. Operations catalog +Status: built (0.4.0). Operations are declared in `operations/` and read by +`cloudfall operations list|show`; each risk level is exported as MCP tool +annotations, and the verify playbook runs after an approved run. Cloudfall's +own roles are not packaged as starter operations yet (part 7). + Every playbook or role the team already runs becomes an operation: ```yaml @@ -252,6 +260,13 @@ that have no baseline yet. They are optional (part 7). ### 2. Approval and audit +Status: built (0.4.0; `cloudfall why` since 0.6.0). `cloudfall operations +propose` runs check mode and records the decision, `cloudfall decisions +approve` is the person's step that runs it and its verify playbook, and +`cloudfall why` answers from the records. A mutating operation always waits +for that person: approval by policy for a declared operation is not built +(see the open questions). + | Risk | Behaviour | | --- | --- | | `read` | Runs freely | @@ -282,6 +297,13 @@ process that refuses to run a `destructive` operation without a human. ### 3. Agent surface +Status: built for the catalog and the reads (0.4.0). `cloudfall mcp serve +--repository` serves each declared operation as a tool beside `inventory +show`, `observe`, `audit`, `operations list|show`, `decisions list|show` +and `why`; no tool approves anything. The safe-edit verbs of part 6 are +not built, and neither are deploy, rollback, restart and health on a +repository ([#618](https://github.com/cloudfall-dev/cloudfall/issues/618)). + One CLI and one MCP server, same commands for humans and agents, JSON output everywhere. The loop is fixed: @@ -298,6 +320,15 @@ call, and raw shell calls are what the harness exists to make unnecessary. ### 4. Fleet reader +Status: built (0.4.0). `cloudfall inventory show`, `cloudfall audit` and +`cloudfall observe` read the team's inventory (`--inventory`, or the one +their `ansible.cfg` names) through `cloudfall.ansible_api`, in process with +the `ansible-inventory` fallback. The `cloudfall` block is per host, with +`cloudfall_defaults` per group and the `cloudfall_baselines` catalog (the +answer to the merge question below). Not built: `cloudfall get host` +returning the merged variables with the file that sets each winning value +([#620](https://github.com/cloudfall-dev/cloudfall/issues/620)). + Cloudfall declares no servers. It reads the team's inventory (static INI or YAML, or a dynamic plugin) through ansible-core's own loader and gets hosts, groups and merged variables with Ansible's precedence applied. The @@ -333,6 +364,11 @@ document. They do not change what the reader is for. ### 5. Observation +Status: built (0.4.0). `cloudfall observe` writes one read-only snapshot per +host through the team's inventory, and `cloudfall audit` judges the fleet +from those snapshots. Backups and the restore drill do not run on a +repository yet ([#619](https://github.com/cloudfall-dev/cloudfall/issues/619)). + Facts, service state, disk, recent logs and the last run result are gathered into one structured snapshot per host. The agent reads the snapshot, never raw SSH output. Snapshots are cached with a timestamp so @@ -344,6 +380,10 @@ concept rather than as Ansible fact caching. ### 6. Safe edits +Status: not built. No `get`, `set`, `unset`, `add host` or `remove host` +verb exists; `cloudfall get host` is the first +([#620](https://github.com/cloudfall-dev/cloudfall/issues/620)). + Ansible ships nothing that edits its own files: `ansible-inventory` exports, `ansible-config init` generates, ansible-lint validates. An agent editing Ansible today rewrites raw YAML with no schema and no gate, and loses @@ -419,6 +459,10 @@ and for the round-trip write that no reviewer can add after the fact. ### 7. Starter roles +Status: not built. The engine roles run for a Cloudfall project, not as +operations on a team's repository, and `cloudfall init` still lays out a +project rather than a plain Ansible inventory. + The existing engine roles stay, packaged as optional operations. A greenfield team gets a plain Ansible inventory generated by `cloudfall init` so that greenfield and brownfield share one code path. @@ -456,7 +500,10 @@ so that greenfield and brownfield share one code path. (`cloudfall_environment`, `cloudfall_owns`, ...) so each merges by precedence on its own; or a `cloudfall` block at host level only with group-level defaults read by Cloudfall itself, not by Ansible. The - reader (part 4) and the `set` verb (part 6) both depend on the answer + reader (part 4) and the `set` verb (part 6) both depend on the answer. + The reader took the second option: `cloudfall` is per host and + `cloudfall_defaults` per group, merged by Cloudfall with the host + winning; the `set` verb is not built - **Dynamic inventories.** Where do `host_vars` go when hosts come from a cloud plugin? Likely `group_vars` keyed by tag, plus a Cloudfall-side overlay file only for hosts that need one diff --git a/docs/fleet-goals.md b/docs/fleet-goals.md index d954dd06..a0da338a 100644 --- a/docs/fleet-goals.md +++ b/docs/fleet-goals.md @@ -117,7 +117,7 @@ acceptable if the following hold: | 11 | Drain / decommission | Evacuation procedure over 9 + 10 | Missing | | 12 | Declared operations with verify | `Operation` catalog, MCP annotations, verify playbook | Partial: MCP tools are annotated, server changes preview until confirmed, and approval stays a person's command; deploys, backups and migrations verify; no catalog over arbitrary playbooks, no declared verify step | | 13 | Audit entry per decision | Receipts as the record, `cloudfall why` | Partial: operator proposals and every deploy, backup and drill write receipts; no single entry joining snapshot, diff, approver and verify; no query | -| 14 | One config, the team's | Fleet reader over their inventory, `cloudfall` key | Missing: the config is Cloudfall's own resources today (design written) | +| 14 | One config, the team's | Fleet reader over their inventory, `cloudfall` key | Partial: on a team's repository `inventory show`, `audit` and `observe` read their inventory with a `cloudfall` block per host, their playbooks are declared operations, and `why` and `mcp serve --repository` work there; deploy, rollback, restart and health (#618), backups and the restore drill (#619) and `get host` with the file that sets each value (#620) still need a Cloudfall project | ## Sequencing implications