Plan the runner's Guest Stack on every pull request (CP-42) #23

Merged
pit merged 1 commit from hermes/cp42-runner-plan-job into main 2026-11-06 21:11:21 +00:00
Owner

Until now the plan check planned only semaphore/guest (143). A change to runner/guest (145) reached main, and so the deploy, without a plan anyone had judged. This adds the second job.

Summary

 # .forgejo/workflows/plan.yml   (pull_request_target; workflow, Makefile and judge from main)
 jobs:
   guest-plan-check:
     make guest-plan-check PLAN_GUEST_DIR=head/semaphore/guest
       AWS_*  ← secrets.COCKPIT_GUEST_PLAN_STATE_*
+  runner-guest-plan-check:
+    make guest-plan-check PLAN_GUEST_DIR=head/runner/guest
+      AWS_*  ← secrets.COCKPIT_RUNNER_PLAN_STATE_*      # plan-only, prod/semaphore-runner.tfstate
       PROXMOX_VE_API_TOKEN ← secrets.PROXMOX_VE_PLAN_API_TOKEN   # both jobs: PVEAuditor on pool prod
  • There's no new Makefile code. guest-plan-check already takes its Stack from PLAN_GUEST_DIR and its keys from the job's environment. The job and a workstation run the same line.
  • The two jobs are separate and unchained. A red plan names its own Stack, and a red server plan can't publish the runner's as a skipped success.
  • It uses the same token, not a second one. infra-ci@pve!cockpit-plan reads pool prod, and 145 has been a member since its first apply.
  • Docs: docs/deploy.md now lists both contexts and the runner's secrets, and says the token reaches 143 and 145. The Makefile comment on PLAN_GUEST_DIR is updated to match.

Evidence

  • The job's exact Target, run once against PROD, read-only.
    • Command: make guest-plan-check PLAN_GUEST_DIR=<fresh copy of runner/guest>.
    • Keys: the runner's plan-only pair from secret/tofu-state/semaphore-runner/plan, and infra-ci@pve!plan standing in for !cockpit-plan. It has the same ACL; !cockpit-plan's value exists only as the repository secret.
    • Refresh on, -lock=false:
No changes. Your infrastructure matches the configuration.
  ok    the plan changes nothing
plan-check: the plan destroys and replaces nothing.
  • The refusal this check exists for is named on the runner's longer address. A --plan-failure log in tofu's wrapped wording for proxmox_virtual_environment_container.semaphore_runner gives:
  FAIL  proxmox_virtual_environment_container.semaphore_runner would be destroyed or replaced; prevent_destroy refused the plan
  • make check → exit 0: env tests: every case passed., plan tests: every case passed. The package fixture still reports skip, because the machine has no dpkg.
  • Not proven by this PR's own checks. The plan workflow runs from main on pull_request_target, so this PR's run still has the one old job. plan / runner-guest-plan-check (pull_request_target) first reports on the next PR after the merge.

Merge Danger

Door: two-way.

The merge deploys, but nothing in it changes PROD. The deploy is make prod (snapshot guest service verify): it plans and applies the server's Stack only, then runs the service layer, both no-ops on an unchanged tree. runner/guest isn't in make prod yet; that's separate CP-42 work. Reverting removes the job.

Blast Radius: CI only.

The new context isn't required yet. main's protection lists pr-checks / check (pull_request) and plan / guest-plan-check (pull_request_target), and the new context can only be added after a run has published it.

Until now the plan check planned only `semaphore/guest` (143). A change to `runner/guest` (145) reached `main`, and so the deploy, without a plan anyone had judged. This adds the second job. ## Summary ```diff # .forgejo/workflows/plan.yml (pull_request_target; workflow, Makefile and judge from main) jobs: guest-plan-check: make guest-plan-check PLAN_GUEST_DIR=head/semaphore/guest AWS_* ← secrets.COCKPIT_GUEST_PLAN_STATE_* + runner-guest-plan-check: + make guest-plan-check PLAN_GUEST_DIR=head/runner/guest + AWS_* ← secrets.COCKPIT_RUNNER_PLAN_STATE_* # plan-only, prod/semaphore-runner.tfstate PROXMOX_VE_API_TOKEN ← secrets.PROXMOX_VE_PLAN_API_TOKEN # both jobs: PVEAuditor on pool prod ``` - **There's no new Makefile code.** `guest-plan-check` already takes its Stack from `PLAN_GUEST_DIR` and its keys from the job's environment. The job and a workstation run the same line. - **The two jobs are separate and unchained.** A red plan names its own Stack, and a red server plan can't publish the runner's as a skipped success. - **It uses the same token, not a second one.** `infra-ci@pve!cockpit-plan` reads pool `prod`, and 145 has been a member since its first apply. - **Docs:** `docs/deploy.md` now lists both contexts and the runner's secrets, and says the token reaches 143 and 145. The Makefile comment on `PLAN_GUEST_DIR` is updated to match. ## Evidence - **The job's exact Target, run once against PROD, read-only.** - Command: `make guest-plan-check PLAN_GUEST_DIR=<fresh copy of runner/guest>`. - Keys: the runner's plan-only pair from `secret/tofu-state/semaphore-runner/plan`, and `infra-ci@pve!plan` standing in for `!cockpit-plan`. It has the same ACL; `!cockpit-plan`'s value exists only as the repository secret. - Refresh on, `-lock=false`: ``` No changes. Your infrastructure matches the configuration. ok the plan changes nothing plan-check: the plan destroys and replaces nothing. ``` - **The refusal this check exists for is named on the runner's longer address.** A `--plan-failure` log in tofu's wrapped wording for `proxmox_virtual_environment_container.semaphore_runner` gives: ``` FAIL proxmox_virtual_environment_container.semaphore_runner would be destroyed or replaced; prevent_destroy refused the plan ``` - `make check` → exit 0: `env tests: every case passed.`, `plan tests: every case passed.` The package fixture still reports `skip`, because the machine has no `dpkg`. - **Not proven by this PR's own checks.** The plan workflow runs from `main` on `pull_request_target`, so this PR's run still has the one old job. `plan / runner-guest-plan-check (pull_request_target)` first reports on the next PR after the merge. ## Merge Danger **Door:** two-way. The merge deploys, but nothing in it changes PROD. The deploy is `make prod` (`snapshot guest service verify`): it plans and applies the server's Stack only, then runs the service layer, both no-ops on an unchanged tree. `runner/guest` isn't in `make prod` yet; that's separate CP-42 work. Reverting removes the job. **Blast Radius:** CI only. The new context isn't required yet. `main`'s protection lists `pr-checks / check (pull_request)` and `plan / guest-plan-check (pull_request_target)`, and the new context can only be added after a run has published it.
Plan the runner's Guest Stack on every pull request (CP-42)
All checks were successful
plan / guest-plan-check (pull_request_target) Successful in 19s
pr-checks / check (pull_request) Successful in 38s
940daebaa1
plan.yml gains runner-guest-plan-check: the same guest-plan-check
Target and judge the server's Stack is held to, pointed at
head/runner/guest, with the runner's own plan-only state key
(COCKPIT_RUNNER_PLAN_STATE_*, on prod/semaphore-runner.tfstate) and the
one auditor token, which reads 145 through pool prod. Its own job,
unchained, so a red plan of one Stack names that Stack and cannot
publish the other as a skipped success.

docs/deploy.md: both contexts, the runner's secrets, and the token's
reach as 143 and 145.
Member

Review started (round 1/5) on 940daebaa1 — reading the diff now.

**Review started** (round 1/5) on 940daebaa1698841c5f4b6ffe75f266761106eb4 — reading the diff now.
bot-minos approved these changes 2026-11-06 21:05:42 +00:00
bot-minos left a comment

repo: olympus/infra-cockpit · PR #23 · head 940daebaa1 · round 1/5 · verdict: merge (0 BLOCKER, 2 ADVISORY)

Recommendation: merge

Round: the thread had no earlier review, so this is 1 of 5 (the dispatch also said 1/5). Fixed point: origin/main 1f07290, the PR's merge base; the delta is the single commit 940daeb (3 files, +47/−12).

Spec source: the PR body, read against ticket CP-42 (Vikunja project 11, task 270). The ticket's acceptance criteria are about the runner's registration and the deploy; this PR does not claim them. The part of CP-42 it answers is the ticket comment listing "a plan key … and a PVEAuditor token on 145, for the PR's plan check". Nothing here claims to close CP-42, and I checked it against the claims it does make.
Standards source: AGENTS.md §Toolchain, §Docs, §Pull requests; docs/deploy.md; workshop ADR-0006, ADR-0011, ADR-0012 (read from origin/main). The repo has no docs/adr/ of its own.

Spec

The PR's claims, each checked:

Claim Result
No new Makefile code; the job and a workstation run the same line Confirmed. The Makefile hunk is a comment only. guest-plan-check (Makefile:336-348) takes its Stack from PLAN_GUEST_DIR and its keys from the environment.
Two jobs, separate and unchained Confirmed. .forgejo/workflows/plan.yml:58 runner-guest-plan-check has no needs:.
The runner's own plan key The policy exists: infra-silo silo/store/semaphore-runner-plan-state-policy.json is on main, reads prod/semaphore-runner.tfstate, and writes only the .tflock. The key is declared in silo/store/variables.tf:84. The PR's secret names match the docs. Whether the repo secrets exist is unverified; see A1.
make check exits 0 Reproduced at the head. env tests, install-reinstall, plan tests: every case passed., tofu fmt -check clean, rc=0.
The refusal is named on the runner's longer address Reproduced. A --plan-failure log in tofu's wrapped wording, with semaphore_runner's address, gives FAIL proxmox_virtual_environment_container.semaphore_runner would be destroyed or replaced; prevent_destroy refused the plan, rc=1.
Merge changes nothing in PROD Consistent with the diff. It touches a workflow, a comment and a doc. runner/guest is not in PROD_STEPS (Makefile:56).
plan / runner-guest-plan-check first reports on the next PR after the merge Consistent. The head's status list shows only the old context. It is pull_request_target, so the workflow comes from main. The PR says so itself.

No spec-axis BLOCKER.

A1 · ADVISORY · docs/deploy.md:47-48, .forgejo/workflows/plan.yml:73-76. The job's two live inputs are unproven before merge.

  • COCKPIT_RUNNER_PLAN_STATE_* must exist as repository secrets. The PR body never says they were created.
  • PROXMOX_VE_PLAN_API_TOKEN (!cockpit-plan) reading 145 rests on a stand-in token infra-ci@pve!plan that "has the same ACL". The body discloses this itself.
  • If a secret is missing, require_plan_credentials (Makefile:101-110) turns the job red on every PR after the merge. That context is not yet required, so nothing is blocked, but it would be red noise until fixed.
  • Clearing: one line in the PR body saying the two secrets are set, or a first post-merge run showing the context green before it is added to branch protection. The body already plans the latter.

Standards

A2 · ADVISORY · docs/environment.md:51-52. The PR updates docs/deploy.md and misses the sentence that says the same thing about plan.yml. It reads "One job holds credentials and no .env at all: the pull request's plan check, .forgejo/workflows/plan.yml. Its plan-only state key and its auditor token …". That workflow now has two jobs and two state keys. The page is not wrong about the kind of credential, only about the count. Standard: AGENTS.md §Docs lists docs/environment.md as where every environment name comes from.

  • Clearing: "Two jobs hold credentials … each its own plan-only state key, and the one auditor token".

No standards-axis BLOCKER.

  • Workshop ADR-0006: the runner's key is its own and a plan shape (read the record, write only the lock). Consistent with the policy file above.
  • ADR-0011: the same judge, unchanged.
  • ADR-0012: not engaged, because no deploy key is touched.
  • AGENTS.md §Pull requests: the title and body name CP-42.
  • Smell baseline: the new job repeats the server job's six steps. That is Duplicated Code in the YAML. It is a judgement call and deliberately not charged: the PR body states why the two jobs are separate and unchained, and a matrix or reusable workflow would couple the two contexts.

Named, not charged

  • The trust boundary is unchanged, not widened. pull_request_target plans the PR's own HCL with PROD read credentials, and the runner job now holds a second state key under the same model. That is the existing design (plan.yml header, ADR-0011). Each key still reads one record.
  • Not reproducible from this host: the author's read-only PROD run ("No changes. Your infrastructure matches the configuration."). It needs PROD credentials and the plan key; an agent does not fetch them (AGENTS.md §Secrets). I take the output as the author's, not as a check the repo runs.
  • The ticket's earlier comment said the plan key and the auditor token on 145 were "not minted". The PR's evidence implies both exist now. I cannot confirm either from here.
  • infra-secrets docs/store-layout.md lists the runner's …/deploy path and has no row for secret/tofu-state/semaphore-runner/plan, which docs/deploy.md:47 now cites. It is another repository's file and not in this diff.
  • A hypothetical --plan-failure log where tofu wraps so the address sits alone on its own line is judged red-but-unnamed. I tried it; it is fail-closed. At 76 columns the real runner line does not wrap there, so I dropped it.

Summary

Axis Findings BLOCKER Worst
Spec 1 0 A1 (ADVISORY): the runner secrets and !cockpit-plan's reach on 145 are not proven before merge
Standards 1 0 A2 (ADVISORY): docs/environment.md:51-52 still describes one credentialled job

Two advisories, zero blockers: the recommendation is merge. The volume rule (three or more advisories) is not reached.

Verified by hand: head resolved to 940daeb via refs/pull/23/head (twice, start and before posting); full diff read; make check at the head, rc=0; the judge driven on the runner's address. Not verified: the live PROD plan, the repository secrets, !cockpit-plan's ACL.

<!-- minos review-loop: repo=olympus/infra-cockpit pr=23 head=940daebaa1698841c5f4b6ffe75f266761106eb4 round=1/5 axes=standards,spec --> repo: olympus/infra-cockpit · PR #23 · head 940daebaa1698841c5f4b6ffe75f266761106eb4 · round 1/5 · verdict: merge (0 BLOCKER, 2 ADVISORY) Recommendation: merge Round: the thread had no earlier review, so this is 1 of 5 (the dispatch also said 1/5). Fixed point: `origin/main` 1f07290, the PR's merge base; the delta is the single commit 940daeb (3 files, +47/−12). **Spec source:** the PR body, read against ticket CP-42 (Vikunja project 11, task 270). The ticket's acceptance criteria are about the runner's registration and the deploy; this PR does not claim them. The part of CP-42 it answers is the ticket comment listing "a plan key … and a PVEAuditor token on 145, for the PR's plan check". Nothing here claims to close CP-42, and I checked it against the claims it does make. **Standards source:** `AGENTS.md` §Toolchain, §Docs, §Pull requests; `docs/deploy.md`; workshop ADR-0006, ADR-0011, ADR-0012 (read from `origin/main`). The repo has no `docs/adr/` of its own. ## Spec The PR's claims, each checked: | Claim | Result | | --- | --- | | No new Makefile code; the job and a workstation run the same line | Confirmed. The Makefile hunk is a comment only. `guest-plan-check` (Makefile:336-348) takes its Stack from `PLAN_GUEST_DIR` and its keys from the environment. | | Two jobs, separate and unchained | Confirmed. `.forgejo/workflows/plan.yml:58` `runner-guest-plan-check` has no `needs:`. | | The runner's own plan key | The policy exists: `infra-silo` `silo/store/semaphore-runner-plan-state-policy.json` is on `main`, reads `prod/semaphore-runner.tfstate`, and writes only the `.tflock`. The key is declared in `silo/store/variables.tf:84`. The PR's secret names match the docs. Whether the repo secrets exist is unverified; see A1. | | `make check` exits 0 | Reproduced at the head. `env tests`, `install-reinstall`, `plan tests: every case passed.`, `tofu fmt -check` clean, rc=0. | | The refusal is named on the runner's longer address | Reproduced. A `--plan-failure` log in tofu's wrapped wording, with `semaphore_runner`'s address, gives `FAIL proxmox_virtual_environment_container.semaphore_runner would be destroyed or replaced; prevent_destroy refused the plan`, rc=1. | | Merge changes nothing in PROD | Consistent with the diff. It touches a workflow, a comment and a doc. `runner/guest` is not in `PROD_STEPS` (Makefile:56). | | `plan / runner-guest-plan-check` first reports on the next PR after the merge | Consistent. The head's status list shows only the old context. It is `pull_request_target`, so the workflow comes from `main`. The PR says so itself. | No spec-axis BLOCKER. **A1 · ADVISORY · `docs/deploy.md:47-48`, `.forgejo/workflows/plan.yml:73-76`.** The job's two live inputs are unproven before merge. - `COCKPIT_RUNNER_PLAN_STATE_*` must exist as repository secrets. The PR body never says they were created. - `PROXMOX_VE_PLAN_API_TOKEN` (`!cockpit-plan`) reading 145 rests on a stand-in token `infra-ci@pve!plan` that "has the same ACL". The body discloses this itself. - If a secret is missing, `require_plan_credentials` (Makefile:101-110) turns the job red on every PR after the merge. That context is not yet required, so nothing is blocked, but it would be red noise until fixed. - Clearing: one line in the PR body saying the two secrets are set, or a first post-merge run showing the context green before it is added to branch protection. The body already plans the latter. ## Standards **A2 · ADVISORY · `docs/environment.md:51-52`.** The PR updates `docs/deploy.md` and misses the sentence that says the same thing about `plan.yml`. It reads "One job holds credentials and no `.env` at all: the pull request's plan check, `.forgejo/workflows/plan.yml`. Its plan-only state key and its auditor token …". That workflow now has two jobs and two state keys. The page is not wrong about the kind of credential, only about the count. Standard: `AGENTS.md` §Docs lists `docs/environment.md` as where every environment name comes from. - Clearing: "Two jobs hold credentials … each its own plan-only state key, and the one auditor token". No standards-axis BLOCKER. - Workshop ADR-0006: the runner's key is its own and a plan shape (read the record, write only the lock). Consistent with the policy file above. - ADR-0011: the same judge, unchanged. - ADR-0012: not engaged, because no deploy key is touched. - `AGENTS.md` §Pull requests: the title and body name CP-42. - Smell baseline: the new job repeats the server job's six steps. That is Duplicated Code in the YAML. It is a judgement call and deliberately not charged: the PR body states why the two jobs are separate and unchained, and a matrix or reusable workflow would couple the two contexts. ## Named, not charged - **The trust boundary is unchanged, not widened.** `pull_request_target` plans the PR's own HCL with PROD read credentials, and the runner job now holds a second state key under the same model. That is the existing design (`plan.yml` header, ADR-0011). Each key still reads one record. - **Not reproducible from this host:** the author's read-only PROD run ("No changes. Your infrastructure matches the configuration."). It needs PROD credentials and the plan key; an agent does not fetch them (`AGENTS.md` §Secrets). I take the output as the author's, not as a check the repo runs. - **The ticket's earlier comment said the plan key and the auditor token on 145 were "not minted".** The PR's evidence implies both exist now. I cannot confirm either from here. - **`infra-secrets` `docs/store-layout.md`** lists the runner's `…/deploy` path and has no row for `secret/tofu-state/semaphore-runner/plan`, which `docs/deploy.md:47` now cites. It is another repository's file and not in this diff. - A hypothetical `--plan-failure` log where tofu wraps so the address sits alone on its own line is judged red-but-unnamed. I tried it; it is fail-closed. At 76 columns the real runner line does not wrap there, so I dropped it. ## Summary | Axis | Findings | BLOCKER | Worst | | --- | --- | --- | --- | | Spec | 1 | 0 | A1 (ADVISORY): the runner secrets and `!cockpit-plan`'s reach on 145 are not proven before merge | | Standards | 1 | 0 | A2 (ADVISORY): `docs/environment.md:51-52` still describes one credentialled job | Two advisories, zero blockers: the recommendation is merge. The volume rule (three or more advisories) is not reached. Verified by hand: head resolved to 940daeb via `refs/pull/23/head` (twice, start and before posting); full diff read; `make check` at the head, rc=0; the judge driven on the runner's address. Not verified: the live PROD plan, the repository secrets, `!cockpit-plan`'s ACL.
pit merged commit 770c0f8824 into main 2026-11-06 21:11:21 +00:00
pit deleted branch hermes/cp42-runner-plan-job 2026-11-06 21:11:21 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/infra-cockpit!23
No description provided.