Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Services provision their own AppRoles via `tasks/manage-approle.yml` — no need
| `secret/services/github-runner` | GitHub App private key (`app_private_key`) for the org runner-automation App. The App's OAuth client secret is NOT used and is not stored; the client id is the JWT issuer and is not secret. Read only by the orchestrator — a runner host is denied OpenBao by its own firewall declaration and never holds this |
| `secret/services/weft/door`, `secret/services/weft-staging/door` | Front door `signing_key` (hex, generated once by the front door's deploy, reused forever) and its `public_key` (derived on the controller by every front door deploy, read by each workspace's deploy); staging shares nothing with the rack |
| `secret/services/weft/workspaces/<id>` (and `weft-staging/…`) | `seal`, 64 hex digits (32 bytes), generated once by the workspace's deploy and rendered as its `seal.key`; its only origin, never in a backup set. A workspace's model keys and forge token are NOT in OpenBao: its admin enters them in weft and they stay sealed in its catalog (weft D539) |
| `secret/services/smtp` | Outbound mail: `authentik_smtp_token`, `plane_smtp_token` and `grafana_smtp_token`. One shared mail token today, with a field per service so it can be split later (plan 29). The Authentik, Plane and Grafana deploys are to read them through `_shared_reads` (plan 29, units S4, S6 and S7); no deploy reads them yet. Local-dev seeds each field with a `LOCAL_FAKE_<field>_placeholder` value; the production value is placed by the operator, never generated |
| `secret/services/smtp` | Outbound mail: `authentik_smtp_token`, `plane_smtp_token` and `grafana_smtp_token`. One shared mail token today, with a field per service so it can be split later (plan 29). Deploy Plane reads `plane_smtp_token` through `_shared_reads` while mail is on. The Authentik and Grafana deploys are to read theirs the same way (plan 29, units S4 and S7); they do not yet. Local-dev seeds each field with a `LOCAL_FAKE_<field>_placeholder` value; the production value is placed by the operator, never generated |

## Composable Task Library

Expand Down Expand Up @@ -338,7 +338,7 @@ Each deployment concern is its own playbook — independently runnable and retry
| Deploy Postiz | `deploy-postiz.yml` | Social publishing (rootless podman, 5 containers + the inventory-gated search node `compose.search.yml`, required as of v2.23.0 — the backend registers >3 Text search attributes and SQL visibility caps at 3): secrets (+OIDC shared-read) → render BOTH env files → deploy.sh → verify app AND workflow engine |
| Store Postiz API Key | `store-postiz-api-key.yml` | Capture the app-minted `/api/public/v1` key (the DB column IS the bearer value; minted on first sign-in) into `secret/services/postiz:postiz_api_key` — read from the service's own Postgres, never printed, all key-bearing steps `no_log`. |
| Clean Deploy Postiz | `clean-deploy-postiz.yml` | Destructive: wipe containers + all four volumes + fresh deploy (social accounts need re-authorizing by hand afterwards) |
| Deploy Plane | `deploy-plane.yml` | Work tracker (rootless podman, Commercial edition): fetch Plane's Compose and variables files for the pinned release and verify each sha256 (never committed) → secrets + `.env` (refuses Plane's shipped default credentials) → deploy.sh with `compose.agentcloud.yml`, the proxy held until the instance is set up → first-run configuration (setup, invitation-only sign-up, workspace) → verify through the proxy. With `plane_github_app_id` declared it also renders the GitHub App settings (all six or none), sets the App's webhook URL and secret from the controller, and verifies an unsigned delivery is refused 401 |
| Deploy Plane | `deploy-plane.yml` | Work tracker (rootless podman, Commercial edition): fetch Plane's Compose and variables files for the pinned release and verify each sha256 (never committed) → secrets + `.env` (refuses Plane's shipped default credentials) → deploy.sh with `compose.agentcloud.yml`, the proxy held until the instance is set up → first-run configuration (setup, invitation-only sign-up, workspace) → verify through the proxy. With `plane_github_app_id` declared it also renders the GitHub App settings (all six or none), sets the App's webhook URL and secret from the controller, and verifies an unsigned delivery is refused 401. With `smtp_host` set it also writes Plane's outbound mail settings from the inventory and the mail token from `secret/services/smtp`; on local-dev it sends a test mail from the Plane worker and checks the local mail catcher |
| Clean Deploy Plane | `clean-deploy-plane.yml` | Destructive: remove every container and named volume and deploy fresh; secrets return from OpenBao, all workspaces and work items are gone |
| Back Up Plane DB | `backup-plane-db.yml` | Timestamped pg_dump of `plane-db` into an owner-only (0700) dir on the VM; read-only against the database, each run a NEW file. The database only; uploads are covered by a VM snapshot |
| Restore Plane DB | `restore-plane-db.yml` | DESTRUCTIVE: restore a named dump (`-e plane_dump_file=` REQUIRED) into a staging database, swap it in only after it fully loads (prior kept as `plane_prev`), and bring the stack back through deploy.sh in an `always:` block, which reruns the migrator |
Expand Down
6 changes: 6 additions & 0 deletions docs/LESSONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,9 @@ Superseded by L-033
- **ACCEPTED:** the pull request titled with AC-1149 (batch v0.18.0, unit U16c).
- **DERIVED:** Proxmox runs a connection test inside every create and update of a metric server, and the write is refused when that test fails: `POST` and `PUT` `/cluster/metrics/server/{id}` both call `test_connection` before saving (pve-manager `PVE/API2/Cluster/MetricServer.pm`, `master`, :178 and :252), and the OpenTelemetry plugin's test posts an empty metrics payload to the declared URL with the certificate checked by host name (`PVE/Status/OpenTelemetry.pm`, :665-670). So a declared metric server can be written only after its receiver answers from the cluster: the receiver's listener is deployed, the node trusts the receiver's CA and resolves its name, and the receiver's firewall admits the node. A plan that converges a metric server orders its real run after those steps, and a dry run cannot show that the write will succeed.
- **APPLIES TO:** `platform/playbooks/converge-proxmox-metric-server.yml` and any later converge of a Proxmox metric server, and the order of production runs that bring up the o11y Proxmox listener.

### L-038 · 2026-12-02 · playbooks

- **ACCEPTED:** the pull request titled with AC-1127 (unit 06 of batch proton-smtp, #1249).
- **DERIVED:** Plane's `manage.py test_email` exits 0 when delivery fails: it catches the send exception and prints an `Error: Email could not be delivered` line instead (`apps/api/plane/db/management/commands/test_email.py`, makeplane/plane default branch, :64-67). A task that sends a test mail through it judges the exact line `Email successfully sent` in its output and then the delivery itself (the local catcher, or the relay), never the exit code alone.
- **APPLIES TO:** any playbook or test under `platform/playbooks/` and `platform/tests/` that proves Plane's outbound mail by running its test-mail command (the local verify of `deploy-plane.yml` and the production test send, plan 29 unit S9).
4 changes: 3 additions & 1 deletion docs/MISTAKES.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ and why.
| 4.11 | A workstation home path reached a committed ledger entry; the audit grep for it ran by hand only | Data handling | 1 | Pre-commit hook (`no-machine-paths`) |
| 4.12 | A brief carried an instance detail (a person) into the public template (widens 4.9) | Data handling | 1 | Convention |
| 5.1 | Security check duplicated per caller; a fix reached three copies and missed two | Duplication | 1 | Test |
| 5.2 | Committed while a test was failing, because the check did not gate the commit (repeat 2026-09-25: a merge after a mergeability read, joined by `;`; 2026-10-30: a push under `SKIP_TESTS=1`; 2026-11-02: another, past two repo-wide guards; 2026-11-03: past the TLS guard again; 2026-11-04: a ledger edit past the citation guard; 2026-11-05: a playbook change past the check-mode contract test; 2026-11-08: a template comment past the check-mode injection guard; 2026-11-09: a template-order test the fast subset skips; 2026-11-11: a new test file past the spawn guard; 2026-11-11: a test-only push under `SKIP_TESTS=1`, past the line-window ratchet; 2026-11-17: a merge go sent in the same step as a CONFLICTING read; 2026-11-20: a registry row reported to a peer in the same step as a write that failed; 2026-11-27: a new tempfile user past the tempfile allowlist; 2026-11-28: a fixture certificate under `SKIP_TESTS=1` past the strict-chain guard; 2026-11-29: a new tempfile user under `SKIP_TESTS=1` past the tempfile allowlist again; 2026-11-29: a lesson-only push under `SKIP_TESTS=1` before its own hook run, over a red lint; 2026-11-30: a `dev` merge head pushed under `SKIP_TESTS=1` with no batch decision and no hook run of its own; 2026-12-01: a playbook refactor past the check-mode contract test the fast lane did not run) | Process | 22 | Pre-push hook (bypassed whole by `SKIP_TESTS=1`; narrower skip proposed); ledger citation test at pre-commit when `docs/MISTAKES.md` is staged |
| 5.2 | Committed while a test was failing, because the check did not gate the commit (repeat 2026-09-25: a merge after a mergeability read, joined by `;`; 2026-10-30: a push under `SKIP_TESTS=1`; 2026-11-02: another, past two repo-wide guards; 2026-11-03: past the TLS guard again; 2026-11-04: a ledger edit past the citation guard; 2026-11-05: a playbook change past the check-mode contract test; 2026-11-08: a template comment past the check-mode injection guard; 2026-11-09: a template-order test the fast subset skips; 2026-11-11: a new test file past the spawn guard; 2026-11-11: a test-only push under `SKIP_TESTS=1`, past the line-window ratchet; 2026-11-17: a merge go sent in the same step as a CONFLICTING read; 2026-11-20: a registry row reported to a peer in the same step as a write that failed; 2026-11-27: a new tempfile user past the tempfile allowlist; 2026-11-28: a fixture certificate under `SKIP_TESTS=1` past the strict-chain guard; 2026-11-28: a play var removed past the play-vars scope guard; 2026-11-29: a new tempfile user under `SKIP_TESTS=1` past the tempfile allowlist again; 2026-11-29: a lesson-only push under `SKIP_TESTS=1` before its own hook run, over a red lint; 2026-11-30: a `dev` merge head pushed under `SKIP_TESTS=1` with no batch decision and no hook run of its own; 2026-12-01: a playbook refactor past the check-mode contract test the fast lane did not run) | Process | 23 | Pre-push hook (bypassed whole by `SKIP_TESTS=1`; narrower skip proposed); ledger citation test at pre-commit when `docs/MISTAKES.md` is staged |
| 5.3 | Merged a PR while its review was rate-limited | Process | 1 | Convention (user-stated) |
| 5.4 | A command's own planning boundary honoured over an explicit instruction to implement (widened by 5.47) | Process | 1 | Convention + stop hook |
| 5.5 | Repeated 5.2 — committed with a failing test; hooks do not gate the suite | Process | 1 | Pre-push hook |
Expand Down Expand Up @@ -5185,6 +5185,8 @@ fast subset of scans that launch nothing includes it and would have stopped the

**Occurrence 2026-11-28 (a fixture certificate past the strict-chain guard).** PR #1245 (AC-1147) head `fc91e167c` added a bats test that signs two fixture certificates with `openssl x509 -req -extfile`. It was pushed with `SKIP_TESTS=1` under batch v0.18.0 decision 35's extension, after the three changed test files ran alone and passed. CI's Python (8/8) failed on `test_fixture_certs_strict_chain.py::test_every_extfile_signing_site_is_followed_by_a_strict_chain_check`, which counts the `-extfile` signing sites in every test file and requires an `assert_strict_chain(` call for each (1 failed, 1211 passed). Fixed in `5832b2c6d` by adding key identifiers and a strict check after each signing. Why the rule did not fire: the extension asks for the test files the head changes or that cover the code it changes, and I read that as the changed files only; this guard scans every test file without naming any. This is the shape of the 2026-11-11 test-only push above, which already says a pushed change to a `*.bats` file is the subject of repo-wide guards that only the full suite runs.

**Occurrence 2026-11-28 (a play var removed past the play-vars scope guard).** PR #1249 (AC-1127) head `c8c6cdb5` carried a `/simplify` fix (`210720ad`) that dropped `_deploy_dir` from the Phase 4 vars of `deploy-plane.yml`, on the reading that `tasks/list-service-containers.yml` sets it as a fact earlier in that play. It was pushed through the pre-push hook, which passed. CI's Python (2/8) failed on `test_play_vars_scope.py::test_no_play_reads_another_plays_vars` (1 failed, 1185 passed): that guard does not scan included task files, so the read looked like another play's var. Fixed before merge by defining it in Phase 4 again (`c7e0a310`). Why the rule did not fire: the fast lane keeps an unchanged file only when every one of its tests ran under 0.25 s in CI, and `test_durations.json` records this file at a 1.09 s maximum, so the push ran without it. This is the shape of the 2026-11-09 occurrence above.

**Occurrence 2026-11-29 (a new tempfile user past the tempfile allowlist again).** PR #1256 (AC-1002) head `a23a9a804` added an `ansible.builtin.tempfile` task to `cleanup-proxmox-backup-archives.yml` for the reviewed helpers' scratch directory. It was pushed with `SKIP_TESTS=1` under the batch's rule for weft-only pre-push failures, after the cleanup Rust tests and five playbook scanners passed locally; the hook's own run had failed only on weft tests. CI's Python (5/8) failed on `test_materialise_ssh_key.py::test_exactly_one_file_materialises_an_ssh_probe_key` (1 failed). Fixed in the PR's correction by adding the playbook to `TEMPFILE_USERS`. Why the rule did not fire: the 2026-11-27 occurrence above names this exact test and why the fast lane skips it, and I chose the local test set from the files the change touched without searching the tests for `tempfile`. A change that adds a `tempfile` task runs every test file that names `tempfile` before it is pushed.

**Occurrence 2026-11-29 (a lesson-only head pushed under `SKIP_TESTS=1` before its own hook run, over a red lint).** PR #1259 (AC-1136): the simplify fix `cde00b8f5` left `platform/tests/ssh_harness.py:95` at 158 characters. Neither the pre-commit hook nor the pre-push hook runs ruff, so it reached the remote with the `dev` merge `31ac1dde3`, whose Static Analysis failed on ruff E501. Before reading that result I pushed `8e5e13186`, which only adds a `docs/LESSONS.md` entry, with `SKIP_TESTS=1`. Batch v0.18.0 allows that only after the full hook on that head fails solely on the known weft failures, and the hook had run on `31ac1dde3`, not on that head. Run after the push, it failed only on those (16 tests in `test_weft_deploy_runs.py`, BATS 845; the Rust lane passed 1042). Static Analysis failed again on `8e5e13186`; fixed in `cb746b1ef`. Why the rule did not fire: the head changed one Markdown file, so the parent's run felt like its own, and the parent's CI was not read before the next push. A push under `SKIP_TESTS=1` waits for the hook's run on that exact head, and for the previous head's CI to be read; `ruff check` runs on every changed Python file before a push.
Expand Down
Loading
Loading