The Guest and the service run without a word, judged (SC-26) #41
No reviewers
Labels
No labels
ready-for-agent
review
merge-ready
review
needs-fix
review
needs-human
review
needs-review
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-secrets!41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/SC-26-infra-secrets-guest-and-service-run-with"
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?
Implements SC-26
Summary
make guestandmake servicegain the deployer's mode. With nobody at aterminal the typed word is replaced by a judge over the plan artifact; without
the variable, both Targets ask for the word exactly as before.
make checkgainsplan-test, so the judge is exercised on every pull request.The judge reads
tofu show -jsonand exits 0 (nothing destroyed or replaced),1 (something would be) or 2 (the plan could not be read at all);
--plan-failureturns tofu's own log into the same verdict, naming a
prevent_destroyrefusalas the conflict it is. That second caller is SC-27's pull request check.
The service Target's gate is the rehearsal, not the judge, because a playbook
has no plan: it cannot destroy or replace a Guest, which is the one thing the
judge exists to refuse.
Evidence
Before: the suite on the branch's base —
plan tests: 20 case(s) FAILED,including
FAIL it asks for no word (found [Type "bao"])and the judge'soutput entirely absent.
After:
mise exec -- make check→ rc 0:The cases that answer the ticket's criteria, all against a real
tofu planofa throwaway
terraform_dataStack:FAIL terraform_data.guest would be replaced: destroyed, then created again (forced by triggers_replace), rc≠0, state unmovedprevent_destroyrefusesReference to undeclared resourceOPENBAO_STATE_SECRET_ACCESS_KEY is empty in .env, no artifact madeType "bao" …and abortenvironment word not typed; nothing applied--check --diffruns, then the playbook for real; the Guest's artifact is judged before it is appliedOther checks at this head:
tofu fmt -check -recursive -diffrc 0;make validate→Success! The configuration is valid.;ansible-playbook … --syntax-check site.ymlrc 0 (the pre-existingFound both group and host with same name: baowarning stands).make -nof both Targets in both modes, fedto
bash -n, parses clean.Not run: a plan against PROD's live state — this host has no
.env, so thejudge has never seen the real Guest's plan. The live Stack carries
prevent_destroyon 144, so a replacement there is refused by tofu before thejudge is reached; the suite drives that refusal on the throwaway Stack instead.
Review round 1
Four advisories, no blocker. Cleared in
1c874aa: the floor's description indocs/env-fetch.mdand in the workflow's comment; the judge's docstring, whichpromised a plan read from
argv[1]that the code never had;REFUSED's wrapbefore the address, which now names the resource instead of reporting that
nothing was judged; and
NONINTERACTIVE's origin, which now has to be thecommand line. The last two carry a case each in
scripts/tests/plan-check.sh.The pattern is the one line the two copies of the judge no longer share, and
the docstring says so:
infra-cockpit's copy wants the same line, in thatrepository.
Merge Danger
Door: two-way. The mode is opt-in, and with
NONINTERACTIVEunset bothTargets compose exactly the script they composed before — every Target's
make -nat this head is byte-identical to the branch's base.The mode opens only where it is named on the command line: an exported
NONINTERACTIVE— a devcontainer, a copied deploy recipe — no longer removeseither gate, and the run says so before it asks for the word. A shell that
relied on exporting it will now be asked.
Blast Radius: the two mutating Targets, plus ~3 s on the
checkfloor.Nothing is applied, planned against PROD, or written to the store by the new
tests.
workshop'sdocs/agents/make-targets.mdlists this repository's flooras
env-check env-test; that row now understates it and is a follow-up inanother repository.
Review started (round 1/5) on
4a0185b5e2— reading the diff now.repo=olympus/infra-secrets · pr=41 · head=4a0185b5e295d94cdc0991ece7bf561e99411626 · round=1/5 · verdict=approve · blockers=0 · advisories=4Recommendation: fix
No BLOCKER. Nothing in this change is wrong enough to refuse: every acceptance criterion on SC-26 is met, and I reproduced each of them by running the suite myself. The recommendation moves on the volume rule alone — four advisories is one batched polishing round's worth, and the rule says recommend that round rather than argue four taste calls one at a time across future rounds. The review state is APPROVE because the state follows blockers, and there are none. Take the four in one commit, or merge and let them ride; nothing here is load-bearing.
Standards
standards: AGENTS.md §Checks, workshop ADR-0001 (toolchain declared and locked), ADR-0011 (a deploy never destroys or replaces).NoCONTRIBUTING.mdorcoding-standards.mdexists in this repo.[ADVISORY]
docs/env-fetch.md:248and.forgejo/workflows/pr-checks.yml:8— the floor's own description did not move withcheck.Makefile:268now readscheck: env-check env-test plan-test, andAGENTS.md:11-13was updated to say so, but two other places that enumerate the same floor still describe the old three-command version:docs/env-fetch.md:248: "make checkis the single credential-free command:env-checkand the fetch's own tests (scripts/tests/, a stub store on127.0.0.1, no network).".forgejo/workflows/pr-checks.yml:8-9: "#make checkis the floor a pull request runs: the env pin and map, and the fetch's own tests against a stub store."Smallest clearing change: one clause each — "…, and the plan judge's tests against a throwaway local Stack".
[ADVISORY]
scripts/plan-check.py:3— the docstring promises a mode the code does not have."Reads
tofu show -json's plan from stdin, or from the path inargv[1]."main()(:115) recognises exactly one argument shape,--plan-failure <log>, andread_plan()readssys.stdinand nothing else. Verified:python3 scripts/plan-check.py <a-plan-that-destroys>with empty stdin exits2, "the plan could not be read"; the file is never opened. The next caller — SC-27 — will read that line and pass a path. Smallest clearing change: drop "or from the path inargv[1]" (the port stays byte-identical in code), or implement the branch.[ADVISORY, latent]
scripts/plan-check.py:29—REFUSEDmisses tofu's other wrap of the same refusal.The regex is
Resource instance (\S+) has\s+prevent_destroy set, which covers the wrap this Stack's Guest produces (addressproxmox_virtual_environment_container.openbao, 46 chars — the suite's fixture is faithful; I confirmed it against a real refusal at 47 chars). tofu also wraps before the address once it no longer fits, and then nothing matches. Real log, address of 79 chars:--plan-failureon that log exits 1 (still red, good) but reports "the plan could not be made, so nothing was judged" and names no resource — the one thing the flag exists to avoid. Latent here: every address inbao/guest/is 35 or 46 chars, and--plan-failurehas no caller in this tree until SC-27. Smallest clearing change:Resource instance\s+(\S+)\s+has\s+prevent_destroy set.[ADVISORY]
Makefile:73—NONINTERACTIVE ?=is not "only the deployer's".The comment above it (
:68-72) says "The deployer's mode, and only the deployer's:make guest NONINTERACTIVE=1", but?=yields to an inherited environment variable. Verified:NONINTERACTIVE=1 make -n servicecomposes the no-word branch, so a shell that exports it — a CI snippet, a devcontainer, a copied deploy recipe — removes the typed word frommake servicewithout anything saying so. Forguestthe judge still gates the plan, so the fail-open is bounded; forservicethe rehearsal's exit status is then the only thing in front of the real playbook run.ACTOR ?=takes the environment on purpose and says so (:29-33); this one says the opposite. Smallest clearing change: gate on$(origin NONINTERACTIVE)beingcommand linein the two macros, or amend the comment to say the environment activates it.Spec
Spec: SC-26 (
https://vikunja.thepit.space/tasks/326), "infra-secrets' guest and service run without a prompt, judged", fetched with its handoff comment. It asks for a plan judge (port the cockpit's),NONINTERACTIVE=1onguestandservice, and the--check --diffrehearsal kept ahead of the service apply.Findings: none. All three acceptance criteria hold against my own runs:
FAIL terraform_data.guest would be replaced: destroyed, then created again (forced by triggers_replace), rc≠0,state_of inputstilla,plan.outremoved.prevent_destroycase (144's real shape): red,terraform_data.guestnamed,prevent_destroy setquoted, nothing applied.OPENBAO_STATE_SECRET_ACCESS_KEY is empty in .env, no artifact. Unmakeable plan: rc≠0, tofu'sReference to undeclared resource, judge's pass line absent.Type "bao" to apply the plan above:/Type "bao" to run the playbook above for real:, both abortenvironment word not typed, nothing applied, real playbook never starts (1 line in the stub's log, not 2).One line of "What to build" is not met literally — "
NONINTERACTIVE=1onguestandservice: plan to an artefact, judge it, apply that artefact". Forservicethere is no judge: the rehearsal is the gate (Makefile:123-134,:283-287). The PR body and the ticket handoff both state why, the acceptance criteria do not ask for a playbook judge, andinfra-cockpittook the same branch — so I am not asking for one. Recorded here so the deviation is not read as an oversight.What I verified, and how
mise exec -- make check→ rc 0;plan tests: every case passed.;make plan-testalone 2.7 s.judge()→return 0): 13 assertions fail;if ! $(call judge_plan,…)→if false): 13 assertions fail, with rc 0 on a replacement and state moved fromatob— the suite sees an unjudged apply.diff -uofinfra-cockpit'sorigin/main:scripts/plan-check.pyagainst this one is one hunk, the docstring; the code is identical.["delete","create"]and["create","delete"]both replacement;["delete"]destroy; no-op,["read"],["forget"], absent/nullresource_changesgreen; module-nested and count-keyed replacements caught; unreadable stdin → exit2;--plan-failureon a real tofu refusal at 47 chars names the resource and exits 1.make -nof both Targets in both modes: the composed scripts are what the review describes, and the interactiveelsebranch is the old lines unchanged.mise exec -- tofu fmt -check -recursive -diff→ rc 0.test-access-key-id/test-secret; nothing real is written.What I could not verify
.envon this host, so the judge has never seen the real Guest's plan — the PR says the same, and the guard case reproduces the shape 144 actually meets. Accepted.pr-checksjob itself. I ranmise exec -- make checklocally, not.forgejo/workflows/pr-checks.yml. The floor now needstofuandpython3on the runner; both are inmise.toml/mise.lock(ADR-0001), andmake deps+mise execsupply them, but I did not watch the runner do it.plan tests: 20 case(s) FAILEDon8153b12; I reproduce 19 with the same suite (rc 1, andFAIL it asks for no word (found [Type "bao"])among them). One-assertion difference in a before-picture only; nothing hangs on it.Summary. Standards: 4 advisories, 0 blockers — worst is the
REFUSEDregex gap, latent and unwired today. Spec: 0 findings, 0 blockers — every acceptance criterion reproduced; one "What to build" line met in substance, not literally, and documented. Recommendation: fix (volume rule, four advisories), review state APPROVE, labelreview/merge-ready.4a0185b5e2ea818e33f14 advisories. Fix
Acknowledged (round 0/5) — fixing now; what changed and how I verified it follows.
New commits pushed, approval review dismissed automatically according to repository settings
Four advisories cleared in
1c874aa— new commits only,ea818e3..1c874aa, fast-forward on the PR's own branch.The report carried no BLOCKER on either axis and
Recommendation: fix. That recommendation moves on the volume rule alone — "four advisories is one batched polishing round's worth" — andpit's comment on the thread said the same ("4 advisories. Fix"). So the round is worked in full: all four, one commit.docs/env-fetch.md:248and.forgejo/workflows/pr-checks.yml:8— the floor's description did not move withcheckAGENTS.mdand thecheckTarget's own comment already diddocs/env-fetch.mdat1c874aacarries the clause and the old sentence is gone (POST /api/v1/markdown, unescaped, tags stripped, whitespace collapsed); the workflow file still parses (yaml.safe_load) with its job key and context unchangedscripts/plan-check.py:3— the docstring promises a mode the code does not haveargv[1]"; the port's code is untouchedpython3 scripts/plan-check.py <a-valid-plan> </dev/null→ rc 2,the plan could not be read, so nothing was judged: Expecting value: line 1 column 1; the same file on stdin → rc 0,the plan destroys and replaces nothing.scripts/plan-check.py:29—REFUSEDmisses tofu's other wrap(\S+) has\s+→\s+(\S+)\s+has\s+, so the address may open the line andhas prevent_destroy setthe nexta refusal wrapped before the address is still named: namesterraform_data.guest_with_a_name_long_enough_that_tofu_wraps_the_address_it_nameswhole and exits 1, instead of reporting that nothing was judgedMakefile:73—NONINTERACTIVE ?=is not "only the deployer's"$(origin NONINTERACTIVE)=command lineonly, viaNONINTERACTIVE_MODE, and both gates read thatmake guestandmake servicewithNONINTERACTIVE=1exported both ask for the word and abortenvironment word not typed, nothing applied, the real playbook never started (1 line in the stub's log)Red first. The three new cases, run at
ea818e3before any code changed:plan tests: 9 case(s) FAILED(rc 2) — the exported-mode cases appliedb(statea→b) and let the real playbook run twice; the wrapped-before-address log reported that nothing was judged and named no resource.Verification at
1c874aa, run before the push:make -nfor every Target at both heads,$(CURDIR)normalised and compared byte for byte: all sixteen identical. That turns the body's "both Targets compose exactly the script they composed before" from a claim into a measurement — withNONINTERACTIVEunset, nothing a Target composes has changed.The forge's own job ran it as well:
pr-checks / check (pull_request)→ success on1c874aa(run 60), and its log carriesenv fetch: every case passed.andplan tests: every case passed.with the three new cases named in it (an exported mode does not stand in for the guest word,… the service word,a refusal wrapped before the address is still named).Added beyond the clearing text, and why
NONINTERACTIVE, saying the word is still asked for. The finding's "without anything saying so" is as much about a silently ignored variable as about a silently removed gate. It is composed only when the variable is inherited — which is whymake -nstays byte-identical otherwise.Named, not changed here
infra-cockpit's by one line, where it used to differ only in the docstring.infra-cockpit'sscripts/plan-check.pycarries the same gap and wants the same line — a follow-up in that repository, not a file this PR may touch.workshop'sdocs/agents/make-targets.mdfloor row still listsenv-check env-test; the PR body already records that as another repository's follow-up.Not verified: a plan against PROD's live state — this host has no
.env, unchanged from the PR's own "Not run" list, and nothing in this round touches the live Stack. Nothing on the report was left alone: all four advisories are in1c874aa.Review started (round 1/5) on
1c874aa7bd— reading the diff now.repo=olympus/infra-secrets · pr=41 · head=1c874aa7bdcafaa8141f2fc216ba5ca953d8e91a · round=2/5 · verdict=approve · blockers=0 · advisories=1Round 2 of the thread, not the
1/5in this round's sign-on comment: that comment is posted before the review list is read, and the list already carries round 1 (4a0185b, APPROVED, 4 advisories). The dispatch's counter restarted; the thread's did not.Recommendation: merge
No BLOCKER on either axis. All four of round 1's advisories are cleared, and I re-drove each one. One new advisory, found while verifying advisory 3 against the real toolchain — it does not block and it does not move the state.
Prior round's findings, re-driven
The branch was rebased onto current
main(b732c83):git merge-base --is-ancestor 4a0185b HEADis false, butgit range-diff 8153b12..4a0185b b732c83..ea818e3prints=for the single commit, and every blob the change owns is identical at both revisions (Makefile,scripts/plan-check.py,scripts/tests/plan-check.sh,AGENTS.md,.forgejo/workflows/pr-checks.yml). Onlydocs/env-fetch.md's blob differs, because the base edited that page too (SC-29) — the base's file, the base's to answer for. The round's own delta isgit diff ea818e3 1c874aa: 5 files, +94/−21.docs/env-fetch.md:248and.forgejo/workflows/pr-checks.yml:8did not move withcheck1c874aadocs/env-fetch.md:256-259andpr-checks.yml:8-11now name the plan judge's tests. Census of every site that enumerates the floor —AGENTS.md:11-13,docs/env-fetch.md:256,pr-checks.yml:9,Makefile:276and its##help text — all four nameplan-test;README.md:5names the floor without enumerating, so it needs nothing.scripts/plan-check.py:3promised anargv[1]mode the code never had1c874aatofu show -json's plan from stdin." and theargv[1]clause is gone.main()still recognises only--plan-failure <log>.REFUSEDmissed tofu's wrap before the address1c874aascripts/plan-check.py:30is nowResource instance\s+(\S+)\s+has\s+prevent_destroy set. Driven on a real OpenTofu 1.12.6 refusal, address 80 chars, which wraps exactlyResource instance/<address>/has prevent_destroy set: it names the address whole and exits 1. Atea818e3the same log reports "nothing was judged" and names nothing.NONINTERACTIVE ?=let an exported variable remove the word1c874aaMakefile:79-81gates on$(origin NONINTERACTIVE)=command line. Measured six origins: command line →if [ '1' = 1 ]; environment →''plus the note; both →'1', no note;NONINTERACTIVE=0→'';make -e+ both →'1'; a parent make forwarding it on the command line →'1'.Standards
standards: AGENTS.md §Checks; workshop ADR-0001 (toolchain declared and locked), ADR-0011 (a deploy never destroys or replaces), ADR-0002 (protected main).NoCONTRIBUTING.md,coding-standards.mdordocs/adr/in this repo;docs/agents/domain.mdsays to proceed silently on their absence, so I do. The delta carries no baseline smell I would charge.[ADVISORY]
scripts/tests/plan-check.sh:337-362and:365-388—--plan-failure's only regression tests are hand-written logs, so the suite cannot see the pattern drift from the toolchain.Both fixtures are literal heredocs, not text captured from
tofu. The one case that does produce a real refusal (scripts/tests/plan-check.sh:186-209) assertsprevent_destroy setin the deploy's output — a substring tofu itself prints, because the recipe aborts attofu planbeforejudge_planever runs. It passes atea818e3too; it cannot see the regex.The sentence
REFUSEDmatches is version-specific, and I measured the difference on this host:--plan-failureResource <addr> has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed.mise.toml:3)Resource instance <addr> has prevent_destroy set, ...Today this is correct and latent: the pin is locked (ADR-0001), and
--plan-failurehas no caller in this tree until SC-27. A toolchain bump that rewords that sentence would leave the suite green while the flag silently degraded, and SC-27 would inherit it. Smallest clearing change: one line in the guarded case — capture the logtofu planalready fails with and assert--plan-failurenames the resource from that file — or widen the pattern toResource (?:instance )?(\S+) has (?:lifecycle\.)?prevent_destroy set.Spec
Spec: SC-26 (Vikunja task 326, project 8), fetched live with its handoff comment. "A plan judge for this repository …
NONINTERACTIVE=1onguestandservice… Theservicestep keeps its--check --diffrehearsal before the apply."Findings: none. The fix is a standards round; it does not move the spec, and I re-verified every acceptance criterion at this head.
1c874aaFAIL terraform_data.guest would be replaced: destroyed, then created again (forced by triggers_replace), rc≠0, state stilla,plan.outgone. Theprevent_destroyshape 144 meets: red, resource named, nothing applied.OPENBAO_STATE_SECRET_ACCESS_KEY is empty in .env, no artifact. Unmakeable plan → tofu's ownReference to undeclared resource, judge's pass line absent.environment word not typed, nothing applied, the real playbook never starts. Stronger:make -nof all sixteen Targets atea818e3and at head,$(CURDIR)normalised, is byte-identical with the variable unset.The one "What to build" line met in substance rather than literally —
servicehas no judge, the rehearsal is its gate — is unchanged by this round and stays recorded as round 1 recorded it.What I verified, and how
mise exec -- make check→ rc 0, 206oklines, 0FAIL, 7.1 s.scripts/tests/plan-check.shrun against theea818e3tree → 9 failures, rc 1, exactly the three cases this round added (the fail-open is visible: rc 0, statea→b, the playbook ran twice). Same script at head: green.terraform_dataStack withlifecycle { prevent_destroy = true }and atriggers_replacebump, planned with the pinned 1.12.6 at 19 and 80 address characters; both logs fed to--plan-failure.olympus/infra-cockpit'sscripts/plan-check.pyatmainstill carriesResource instance (\S+) has\s+prevent_destroy set, i.e. it lacks the wrap line this copy now has — as the docstring says.pr-checks / check (pull_request)→successon1c874aa(run 60, 18 s).Named, not charged
Makefile:270-275points at workshop'sdocs/agents/make-targets.mdas "lands with olympus/workshop#18 and is not on itsmainyet" — a pre-existing line this delta does not touch; the PR body already records that row as another repository's follow-up.ok scripts/env.sh matches infra-secrets@b314c4207885…; at this head the same run printsdc5a0e58…, because the rebase brought SC-29'senv.shchange. Cosmetic: the rc and the counts reproduce exactly.What I could not verify
.envon this host, so the judge has never seen the real Guest's plan. The guarded case reproduces the shape 144 actually meets — the same limit the PR states./actions/runs/60/jobs), so I read the commit status rather than the log. That job runs the same suite I ran green here.Summary. Standards: 1 advisory, 0 blockers — worst is the hand-written
--plan-failurefixtures, latent behind an unused flag. Spec: 0 findings, 0 blockers — all three acceptance criteria reproduced, and every Target's interactive composition is byte-identical to the base. Recommendation: merge, review state APPROVE, labelreview/merge-ready.1c874aa7bd9c4d726cce