The Semaphore runner's Guest Stack, and the Targets that apply it (CP-42) #20
No reviewers
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
review
merge-ready
review
needs-fix
review
needs-human
review
needs-operator
review
needs-review
review
waiting
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
olympus/infra-cockpit!20
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/cp42-runner-guest"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is the first slice of CP-42: Guest 145's Stack, plus the
makeTargets the Operator's first apply runs. The runner's role, the server's switch touse_remote_runner,make prod, the snapshot and the plan job for 145 come in later changes.Summary
Two records, one
.env. The server's pair keeps the names the S3 backend reads, soguest,snapshot,verifyand the plan check don't change. The runner's pair goes in under its Stack's prefix, and only the runner's Targets put it onAWS_*, for their own run. This is the patterninfra-trackeruses for its Guest and Edge Stacks.Why no download resource.
semaphore/guestowns the Debian template's download. If a second Stack declared it as well, one file would have two owners, so this Stack names the volume instead.infra-forge'srunner/guestdoes the same.Why both actors use the deploy key. The record was minted with two shapes, deploy and plan (olympus/infra-silo!21, !22). It has no apply key, and creating one Guest doesn't need
DeleteObjecton the record.Evidence
mise exec -- make check→ exit 0: env testsevery case passed, plan testsevery case passed,tofu fmt -recursive -checkclean.Before this change's test edit:
FAIL every name in the map is declared (missing [env.map: 12 names]), while env-check reportedenv.map: 14 names, all declared.mise exec -- make env ACTOR=pit→secret/tofu-state/semaphore-runner/deploy → RUNNER_STATE_AWS_ACCESS_KEY_ID RUNNER_STATE_AWS_SECRET_ACCESS_KEY (rev 2),13 names · 6 paths · 2 from the age class.mise exec -- make runner-guest-plan, against the empty record:make -n runner-guestcomposesuse_state_creds, thentofu init,plan -out=plan.out,show, the word or the judge, andapply plan.out.make runner-guest, with the age class's PROD token), and it comes next.Merge Danger
Door: two-way. The merge creates nothing.
make prodstill runs the server's steps only, and 145 comes from the hand apply.Blast Radius: the deploy's fetch.
The merge's deploy fetches
.envascockpit, and the fetch is all-or-nothing. The new row needsci-cockpitto readsecret/tofu-state/semaphore-runner/deploy.infra-secrets'bao/policies/ci-cockpit.hclgrants that read, but nobody has checked that the live policy matches the file. If it doesn't, the merge's deploy goes red on that path before it changes anything.The plan check for this PR plans
semaphore/guestonly, so it doesn't coverrunner/guestyet.Review started (round 1/5) on
c1ef4b3956— reading the diff now.repo=olympus/infra-cockpit pr=20 head=c1ef4b3956a3fa3ca1401b62b19f2e9b7080cfc8 round=1/5 verdict=no-blocker (4 advisories)
Reviewed: olympus/infra-cockpit#20 at
c1ef4b3, round 1 of 5. This is the first review on the PR (the review list was empty). The dispatch's counter and the thread's agree.Recommendation: fix
Why
fixand notmerge: there is no blocker. The recommendation turns on the count, not the weight: four advisories, and three or more earns one batched polish round. Review state is APPROVED because state follows blockers only. Every finding below keeps the severity its evidence earned; none is a defect in what the change does.What the change claims, and what I reproduced
make checkexits 0tofu fmt -recursive -check. CI agrees:pr-checks / checkandplan / guest-plan-checkbothsuccesson this SHA.env.map: 14 namesandscripts/tests/run.sh:89agree. The pit actor's13 names · 6 paths · 2 from the age classrecounts correctly from the map.runner/guestis the server Stack with its own key, copied.terraform.lock.hcl,keys.tf,providers.tf,versions.tfare byte-identical tosemaphore/guest; the two key files shared with it are byte-identical;backend.tfdiffers only in the state key and comments.tofu init -backend=false && tofu validateon a copy ofrunner/guest: valid.variables.tf:26-38: vmid 145,semaphore-runner, 10.12.0.145/24, vmbr1, pool prod, fast-storage, 2 cores / 2048 MB / 20 GB;container.tf:54prevent_destroy = true.tofuon PATH, scratch copy, fake keys). Both pairs present:init,planandapplyeach ran inrunner/guestcarrying the runner pair, not the server's. Runner access key unset:error: RUNNER_STATE_AWS_ACCESS_KEY_ID is not set; …, rc 2, zerotofucalls. Secret half empty: namesRUNNER_STATE_AWS_SECRET_ACCESS_KEY, zero calls.runner-guestgate = the server's gateNONINTERACTIVE=1with acreateplan: judged, applied. With adelete,createplan:plan-checkred,aborted: the plan would destroy or replace…, noapplycall,plan.outremoved. Without the mode and no word typed: aborts, noapply.make prodruns the server's steps onlyPROD_STEPS := snapshot guest service verify(Makefile:57) all readGUEST_DIR; the deploy never touchesrunner/.AGENTS.md§Secrets holds.ci-cockpitcan read the new pathbao/policies/ci-cockpit.hclatinfra-secrets@maingrantsreadonsecret/data/tofu-state/semaphore-runner/deploy. Whether the live policy matches the file is the one thing the PR itself says nobody has checked; I could not check it either.Spec
Source: CP-42 "Add the Semaphore runner on Guest 145" (Vikunja project 11, index 42), plus its two
bot-telesphoroscomments (the SC-14 handover and the runner record's mint). The PR body cites CP-42 as the task, asdocs/agents/issue-tracker.mdasks, and describes itself as the first slice. Its four acceptance criteria (runner active in Semaphore, a scratch task runs on 145, token file 0600, next merge snapshots 143 and 145) belong to the later slices the body names, and the body does not claim them.No findings on this axis. The
env.maprow differs from the ticket comment's wording (actors=cockpit … AWS_ACCESS_KEY_ID): the PR addspitand usesRUNNER_STATE_*names so the runner's pair never shares names with the server's. The body states this and the Targets rest on it; I do not charge it.Standards
Sources read at the head:
AGENTS.md,docs/environment.md,docs/guest.md,docs/agents/issue-tracker.md,env.mapheader,.forgejo/workflows/*; workshop ADR-0010, 0011, 0012 and infra-silo'ssemaphore-runner-deploy-state-policy.jsonatmain. The change sits within them: the deploy key is the apply shape minus record deletion (ADR-0012, and the policy allowsDeleteObjecton the lock only); the runner Guest is not deployed by the deployer that runs on it (ADR-0010).S1 — ADVISORY —
docs/environment.mddoes not carry the two new names.AGENTS.md§Docs: "docs/environment.md— where every environment name comes from". The table atdocs/environment.md:63-72has a row for every other name the map fills;grep RUNNER_STATE docs/returns nothing. The AWS row (:67) still reads as the whole story of the state pair ("one record, two shapes"). Precedent: the commit that added the mail and watchdog names (4dd55ef) added their rows in the same change. Clearing change: one row forRUNNER_STATE_AWS_ACCESS_KEY_ID/RUNNER_STATE_AWS_SECRET_ACCESS_KEY— source path, who, and that the runner Targets put them on the backend'sAWS_*names.S2 — ADVISORY —
Makefile:23RUNNER_GUEST_IDENTITY := runner_identityhas no reader. One hit in the tree, its definition. Theguest_identitymacro (Makefile:162) reads$(GUEST_DIR)only, so nothing can use it yet. Baseline smell, a judgement call: Speculative Generality. Clearing change: drop the line; the slice that adds the reader adds it.S3 — ADVISORY — two comments assert what is not yet true.
runner/guest/backend.tf:4says the remote state is "the propertyverifyandsshrest on"; both Targets readGUEST_DIRonly (Makefileverify:,ssh:).runner/guest/container.tf:2-3says "Forgejo Actions deploys it, as it deploys the server on 143";make proddoes not touch 145 (Makefile:57), and the PR's own Door line says so. The body marks these as later changes; the code comments state them in the present tense. Clearing change: say "will" or point at CP-42, or cut the sentences until the slice that makes them true.S4 — ADVISORY — the credential swap has no test.
use_state_creds(Makefile:203-213) chooses which key the runner Targets run under and refuses by name when it is missing. The only test edit is the count bump (scripts/tests/run.sh:89); the PR's evidence for the Targets ismake -n, which composes the lines and executes none of them. The behaviour is correct (table above, my own drive), so this is a regression risk and not a defect. The repo has the pattern for it:scripts/tests/plan-check.shalready drives the server's apply gate against a throwaway local Stack. Clearing change: one case inscripts/tests/run.shorplan-check.shdrivingrunner-guest-planwith the pair missing (refuses, names the variable, runs notofu) and present (tofusees the runner's pair).Named, not charged
runner/guest/variables.tf:48andsemaphore/guest/variables.tf:48carry the same Debian file name, with no check that they agree. Deliberate (one owner of the download, per the body); a drift hazard, not a defect today.runner/guest(.forgejo/workflows/plan.yml:47planssemaphore/guest). Disclosed in the body; the plan key is not minted yet (CP-42 comment).infra-secretsdocs/store-layout.mdstill says the runner's deploy path is "not minted", and does not name theRUNNER_STATE_*field names. Another repository; the CP-42 comment lists it as open.Not verified, and why
make runner-guest-planagainst the empty record andmake env ACTOR=pit(the body's output blocks). Need the store, the age class and the PROD token; an agent'smake envis refused by design. I read the pasted output, I did not reproduce it.secret/tofu-state/semaphore-runner/deploy.scripts/env.shreads each field by variable name (.data.data[$k]) and refuses the whole run on a missing one. The CP-42 mint comment records v1 with fieldsAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY; the map namesRUNNER_STATE_AWS_*. The PR'smake envoutput reportsrev 2, which reads as the Operator re-writing the path under the new names. I could not read the store. If the live path still holds the v1 names, the merge's all-or-nothing fetch ascockpitgoes red on this row. The PR's Merge Danger names only the policy; it is worth naming this one, and confirming the rev, before merging.ci-cockpitpolicy against the file (above).sc14-cockpit-deploy.pubis the line 143 carries. 143 is not reachable from here.Summary
docs/environment.mdlacks the two new namesVerdict: no blocker, so APPROVED. Recommendation: fix, on the advisory count alone (4, threshold 3); a single round of S1-S4 clears it.
Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
New commits pushed, approval review dismissed automatically according to repository settings
Round 1 fixed —
53074deonhermes/cp42-runner-guest. Pushed as a new commit on the branch (no force, no rebase, no rewrite);c1ef4b3is still the review's pin.The review raised 0 blockers and 4 advisories, and recommended
fixon the count. All four are addressed; none of them changes what the change does.docs/environment.mddoes not carry the two new namesRUNNER_STATE_AWS_ACCESS_KEY_ID/RUNNER_STATE_AWS_SECRET_ACCESS_KEY: the record they read, that both actors read it, and that the runner Targets put the pair on the backend'sAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYfor their own run. The paragraph under the table names the policy that mints the runner's record, and the floor's own account now says whatplan-testdrives53074deRUNNER_GUEST_IDENTITYhas no reader53074debackend.tfno longer saysverifyandsshrest on the runner'srunner_identity— it says the readers come with the rest of CP-42.container.tfsays Forgejo Actions will deploy 145, with the deploy's step arriving in the rest of CP-4253074descripts/tests/plan-check.sh, so it ridesmake plan-testand the floor53074deS4, in detail
case_the_runner_pair_is_required_and_reaches_tofusandboxes the repo'sMakefileagainst a throwawayrunner/guestStack, with a stand-intofuonPATHthat logs its argv and the twoAWS_*names it was handed, then execs the real binary. Three.envshapes:tofuis handedrunner-record-key-id, and never theserver-record-key-idsitting beside it in the same.env;RUNNER_STATE_AWS_ACCESS_KEY_ID is not set, and the log is empty: notofuwas composed;RUNNER_STATE_AWS_SECRET_ACCESS_KEY.The case unsets the four names from the caller's environment first, so a shell that has already sourced a real
.envcannot stand in for the file under test.It bites, measured. With
use_state_creds' two exports reverted to a no-op:FAIL tofu is handed the runner record's key (missing [AWS_ACCESS_KEY_ID=runner-record-key-id])andFAIL the server record's key is not what the backend reads (found [server-record-key-id]). With the guard's test replaced byfalse:FAIL the refusal names the variable to seed (missing [RUNNER_STATE_AWS_ACCESS_KEY_ID is not set]), and the same for the secret half. Both mutations reverted before the commit.Verification
On an export of the pushed commit (
git archive 53074deinto a fresh directory,mise trust), with no store and no Proxmox credential in the environment:CI on the same SHA:
pr-checks / check (pull_request)success (31s) andplan / guest-plan-check (pull_request_target)success (16s).docs/environment.mdrenders as 1 table, 10 rows, header 3 cells, 0 ragged rows (POST /api/v1/markdown), and its widest prose line is still 82 characters — the file's own cap, measured before and after.Left alone, deliberately
RUNNER_STATE_*field names against the live record (the review's "Not verified", third bullet).scripts/env.shreads each field by variable name and refuses the whole run on a missing one, so a live path still holding the v1 names would redden the merge's fetch. An agent'smake envis refused by design and I hold no store credential, so I could not read the record; that check stays the Operator's before merge.ci-cockpitpolicy againstbao/policies/ci-cockpit.hcl— same reason, no store read from here.runner/guestand the typed-twice template id: the review named them and did not charge them, and both belong to the slices the PR body lists. No change made.c1ef4b3,env.map,.env.exampleand the runner Stack's configuration are untouched.Review started (round 2/5) on
53074defd5— reading the diff now.repo=olympus/infra-cockpit pr=20 head=53074defd5509b82cc8baaa96ab2f4c7ee59a3ab round=2/5 verdict=merge (0 blockers, 0 advisories)
Reviewed: olympus/infra-cockpit#20 at
53074de, round 2 of 5 by the thread (one review already posted, so two) — the dispatch said 2/5 as well, the counts agree. One reviewer held both axes; the sections below are kept apart anyway.Recommendation: merge
Why
merge: no blocker, and no advisory at all, so neither the state rule (blockers only) nor the volume rule (three or more counted advisories) has anything to act on. State is APPROVED, labelreview/merge-ready.Round 1 closed
Fixed point:
c1ef4b3, the head round 1 reviewed (its review is marked stale and dismissed by the forge because the head moved; that is the forge's doing, the findings stand as written).git merge-base --is-ancestor c1ef4b3 53074de→ true: the fixer stacked one commit,53074de(Efesto), no rewrite. The round's delta isgit diff c1ef4b3 53074de: 5 files, +107 −7. Round 1 had 0 blockers and 4 advisories; the round is owed those four and nothing more.53074degrep -n)docs/environment.mdlacks the two new namesrunner-guest-plan/runner-guestput the pair on the backend'sAWS_*names. The paragraph under the table names the policy that mints the record.docs/environment.md:68,:79. Table: 11 lines, all 4 pipes (3 cells), header + separator + 9 rows — no ragged row. Widest non-table line 82 characters before (c1ef4b3) and after, the file's own cap.RUNNER_GUEST_IDENTITYhas no readergrep -c RUNNER_GUEST_IDENTITY Makefile→ 0 (was 1, its definition).RUNNER_GUEST_DIR(Makefile:22) has a reader at:219.Makefiledelta is1 deletion.backend.tfnow says "the readers that take it come with the rest of CP-42";container.tfsays Forgejo Actions will deploy 145, the step coming with the rest of CP-42. Both match the code:PROD_STEPS := snapshot guest service verify(Makefile:56) readsGUEST_DIRonly, andverify:/ssh:do not touchrunner/.runner/guest/backend.tf:4,runner/guest/container.tf:2scripts/tests/plan-check.sh:336(case),:431(registered in the case list),:34(REAL_TOFU)S4, re-driven by me
make checkat the head worktree: rc=0, 130oklines, 0FAILlines (the author's 130 recounts; the new case adds 12).make plan-testalone: rc=0. Then mutations ongit archivecopies of the head tree, each with the diff printed before the suite ran:make plan-testuse_state_creds' twoexportlines (Makefile:209-210) →truetofu is handed the runner record's key,and its secret,the server record's key is not what the backend reads(foundserver-record-key-id),nor its secretMakefile:204) →if false; thenthe refusal names the variable to seed× 2 (access half, secret half)the refusal names the variable to seed(secret half) — the one assertion that aims at itmain's Makefile with the head's test[0], got[2], plus everymissing [...]The case goes red on exactly the assertions that name each defect and stays green on the rest, so it tests the swap and the guard, not "something runs". The stand-in
tofulogs only the fakerunner-record-*/server-record-*strings; no real key is in the diff or in the test.CI by SHA
53074de:pr-checks / check (pull_request)success (31s),plan / guest-plan-check (pull_request_target)success (16s).git status --porcelainafter the suite: empty.Spec
Source: the PR body (first slice of CP-42: Guest 145's Stack and the Targets the Operator's first apply runs), which is unchanged this round, plus the CP-42 ticket as round 1 read it (not re-read this round: the delta touches none of its criteria). The delta touches docs, two comments, one deleted line and a test, and moves none of the body's claims: the merge still creates nothing, and
make prodstill runs the server's steps only (Makefile:56).No findings on this axis. The fix report's claims recount: 130
ok(12 new), the 82-character cap, the table shape, and the two mutations the author quoted (I reproduced both, m1 and m3, with the same failing assertion names).Standards
Sources read at the head:
AGENTS.md(§Docs: "docs/environment.md— where every environment name comes from"; §Secrets; §Toolchain:make checkis the one credential-free floor),docs/environment.md,docs/agents/issue-tracker.md. The delta sits within them: the names are documented whereAGENTS.md§Docs says they live, nothing plaintext is added, and the new test ridesmake plan-test, which is onmake check's floor. Baseline smells checked on the delta: none worth a clearing change.No findings on this axis.
Named, not charged
scripts/tests/run.shas the only test edit and does not namedocs/environment.mdorscripts/tests/plan-check.sh. Nothing the body asserts became false, no repo rule asks the Summary to enumerate files, and the fix report in the thread says what moved. Not a finding.runner/guest/variables.tfandsemaphore/guest/variables.tf), the plan check not coveringrunner/guest(.forgejo/workflows/plan.yml), andinfra-secrets'docs/store-layout.md— all named in round 1, all belong to later slices or another repository, all disclosed. Unchanged by this delta.base.sha263c725equalsgit ls-remote origin refs/heads/main(263c725), so the branch is current; the merge button is the Operator's.Not verified, and why
secret/tofu-state/semaphore-runner/deployholds fields namedRUNNER_STATE_AWS_ACCESS_KEY_ID/RUNNER_STATE_AWS_SECRET_ACCESS_KEY(the all-or-nothing fetch refuses the whole run on a missing field), and that the liveci-cockpitpolicy matchesbao/policies/ci-cockpit.hcl. An agent'smake envis refused by design and I hold no store credential. The author left both to the Operator before merge, and the PR's Merge Danger names the policy; I repeat that the field names are the same check. Unchanged from round 1, not charged.make runner-guest-planagainst the empty record and the first apply — need the store, the age class and the PROD token. The body's pasted output was read, not reproduced.Summary
Verdict: no blocker, so APPROVED; no advisory, so
Recommendation: mergeandreview/merge-ready. All four round 1 advisories are cleared at53074de, and the S4 test is proved by mutation, not by its own green.