make pre / make pre-down: the PRE rehearsal (#35) #45
No reviewers
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
wontfix
needs-info
needs-triage
ready-for-agent
ready-for-human
review/merge-ready
review/needs-fix
review/needs-human
review/needs-review
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
olympus/infra-forge!45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/35-make-pre"
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?
Summary
One command replaces the PRE rehearsal's remembered incantations; prod and PRE
never share a
-target.Both compositions are built from the same macros as prod, so the gate is the
same gate:
Prod and PRE are told apart by Target selection alone —
-targetnames theGuest, the inventory names the service — so neither Target can reach the
other's Guest. The runbook's PRE section is rewritten around the two Targets.
Evidence
Dry-run assertions over the Target surface, plus an execution test of the gate
against stub binaries (no Proxmox, no Node, no Guest):
make fmtclean;make validate-> "Success! The configuration is valid."Merge Danger
Door: two-way
The Targets are additive;
make guestandmake servicecompose the samelines as before the refactor. Nothing is applied by merging this — the
Makefile and the runbook change, the estate does not.
Blast Radius: low
make preacts only on the throwaway PRE Guest andmake pre-downdestroysonly that container, both pinned by
-target. A wrong word at the gate appliesnothing.
Refs #35
Code review —
main...hermes/35-make-preTwo-axis review against issue #35. Verified live:
make -n pre/make -n pre-downcomposed commands,bash tests/make-targets.sh→ 71 passed / 0 failed,make fmtclean,make validate→ "Success! The configuration is valid."Standards
(a) Documented-standard violations
1. GLOSSARY.md — "Target … Avoid: recipe, rule, task" (letter is hard; scope arguable).
The new test header uses the banned synonym:
The glossary binds "every document — and every issue, commit and test name." A comment is prose, not a name, so coverage is debatable — but the word is on the avoid-list.
2. GLOSSARY.md — exposure classes ("LAN-reachable / WAN-published") (judgement).
The Makefile PRE comment coins a non-term for the defined class:
"LAN-only" is neither the glossary term nor an avoided synonym. The runbook's "no WAN entry" is compliant; the comment should read "LAN-reachable".
No breaches of AGENTS.md (Secrets/Privacy) or docs/index.md conventions: no secret or our-address is added (
10.12.0.142follows the existing10.12.0.141), all added links are same-page anchors that resolve (#the-pre-rehearsal), and the section file-shape is unchanged.(b) Baseline smells (all judgement calls)
Duplicated Code — the runbook states the PRE lifecycle twice. The new section near the top:
repeats the edited section at the bottom:
Both say "PRE is the disposable rehearsal Guest (LXC 142)" and both describe the same teardown/host-key clear. State the lifecycle once; have the other link to it.
Duplicated Code — service-layer preamble.
service_applyre-states the pair already inservice-check:The diff already extracted the Guest half (
guest_stack_init); do the same here. Also,service_applyanchors withcd $(CURDIR)whileservice-checkdoesn't — theguest_stack_initcomment argues the anchor matters.Mysterious Name (weak). The test header's "the deliverable's public interface" names no concrete thing; use "the Target surface".
No Speculative Generality, Feature Envy, Data Clumps, or Middle Man spotted: the new
$(1)/$(2)macro parameters are used by both Prod and PRE sites, not speculative.Spec
(a) MISSING or PARTIAL — none
All four ACs are implemented.
make -n precomposes-target=…debian_13_base -target=…container.forgejo_pre, thentofu plan -out=plan.out→show→ word gate'pre'→apply plan.out, thenansible-playbook -i inventories/pre/hosts …. No Edge, snapshot or state-backup line appears.make -n pre-downcomposestofu destroy -target=...container.forgejo_prethenssh-keygen -R "10.12.0.142"— no playbook, no Edge. The Prod path never selectsforgejo_pre; the PRE path never selectsforgejo(theprod_guest_targetregex correctly excludes the_preprefix). The rewritten## PRE rehearsalsection leads with the two Targets.(b) NOT ASKED FOR (scope creep)
ssh-preTarget —+ssh-pre: ## Open a shell on the PRE Guest. Spec's "What to build" names onlymake preandmake pre-down.tests/make-targets.sh(new, 199 lines) plus its runbook paragraph. No acceptance criterion asks for a target-surface test suite.guest,service,service-checkare rewritten onto newguest_apply/service_applymacros. Behaviour is equivalent (make -n guest/servicematchmainapart from an absolutecd), but it changes Prod surface AC4 didn't request. Neutral, not harmful.(c) Looks implemented but WRONG
No spec-level AC is wrongly implemented; the concrete defect is in the added test's help assertion:
\bmatches at the-inservice-check,pre-down,guest-plan,edge-plan,ssh-pre, sohelp lists pre(andservice,guest,edge,ssh) pass even if the shorter Target were absent frommake help. The deliverable's ownpre/pre-downpair is therefore never actually verified by the suite. Reproduced live: a help listing containing onlypre-downpasses thehelp lists precheck.Summary — Standards: 2 documented-standard findings (both judgement-weighted; neither hard-severe) + 3 baseline smells (2 Duplicated Code, 1 weak Mysterious Name); worst: the runbook's duplicated PRE lifecycle. Spec: 0 missing/partial, 3 scope-creep items, 1 wrong implementation; worst: the
\bfalse-positive that leavespre/pre-downunverified by the suite that exists to verify them.All four acceptance criteria verified by executing the branch.
All six findings addressed in
3a52d8c. Test count 71 -> 73.Standards (a)(1) — "Recipe internals" / GLOSSARY avoid-list. Fixed: the test header now says "Makefile internals". Also removed the second avoid-list slip you flagged in (b): "the deliverable's public interface" -> "the Target surface".
Standards (a)(2) — "LAN-only" -> "LAN-reachable". Fixed in the Makefile PRE comment.
Standards (b) Duplicated Code — runbook PRE lifecycle stated twice. Fixed.
### The PRE rehearsalkeeps the Target table and links down to## PRE rehearsal; the bottom section no longer restates "PRE is the disposable rehearsal Guest (LXC 142)" / "It is destroyed between rehearsals" a second time, and themake pre-downprose ("destroys only the PRE container … host key changes with every clone") is stated once, in the teardown that follows.Standards (b) Duplicated Code — service-layer preamble. Fixed: extracted
service_stack_init(the shape ofguest_stack_init), used by bothservice_applyandservice-check— soservice-checkalso gains thecd $(CURDIR)anchor it lacked.make -n service-checkandmake -n servicestill compose the same commands, now with the anchor first.Spec (c) — the
\bfalse positive. This was the real defect.help_hasnow matches^ make <name>( |$), so the name must be followed by the listing's separator or end-of-line. A regression assertion runs the matcher against a syntheticpre-down-only listing and confirms it does not read as carryingpre, and that it does readpre-down. Both pass;help lists pre/help lists pre-downnow verify the pair for real.Spec (b) — scope creep:
ssh-pre,tests/make-targets.sh+ its runbook paragraph, Prod-target refactor. Kept, deliberately. All three come from parent epic #27, not this ticket:ssh-preis in the epic's Utility Target set (User Story 20), and the test suite is the epic's Testing Decisions verbatim ("invoke a Target read-only and inspect it", "there is no test framework" — so the file had to land somewhere). The Prod refactor is the mechanism that letsprereuse the gate rather than copy it. Happy to split any of these out if you'd rather #35 stay minimal.The manual "by hand" block is labelled as the manual path rather than "the same run" now, since it does not itself drive the word gate — the earlier wording overstated the equivalence.
Verification on
3a52d8c:bash tests/make-targets.sh-> 73 passed / 0 failed;make fmtclean;make -n pre/pre-down/service/service-checkcompose unchanged command lines.Dropped
tests/make-targets.sh(and the runbook paragraph that pointed at it) in5a508eb, per review. The branch now touches onlyMakefileanddocs/runbooks/0001-deploy-and-rollback.md— thepre/pre-downTargets and their docs. The suite itself is good; it belongs to the epic testing ticket rather than #35, so it can land there.