The plan check reds a State that holds no managed resource (TR-63) #61
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-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-tracker!61
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/plan-judge-refuses-an-emptied-state"
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
The plan check now needs a managed resource in the plan's baseline. A State that holds only outputs or data sources has a
prior_state, so the old guard let it through: every resource planned as a create, nothing could be named as lost, and underNONINTERACTIVE=1the Target applied it. #58's second review found it (A-2), #59 documented it, and the Operator ruled that the judge is fixed before TR-58.#59 merged as
748444e; its tree is identical to this branch's #59 tip2e9826c, somainholds nothing this branch lacks. This head,ad3d033, merges that commit into the branch. It conflicted inGLOSSARY.md,README.mdandscripts/tests/gate.test.sh— the three files both #59 and this change edit — and each is resolved to this branch's version. The merged tree equals the previous head's (3785559), sogit diff main ad3d033is the whole change: the judge plus round 1's two commits (a rename, and one baseline fixture the two suites share).The walk goes into modules because the Guest Stack keeps its container in
module.guest(vikunja/guest/main.tf). A root-only read would call every real State empty and refuse every deploy;scripts/guest-vmid.shalready reads the same State the same way (recurse(.child_modules[]?)).Real
tofu show -jsonplans (OpenTofu 1.12.6, builtin provider), judged before and after:prior_stateEvidence
plan-check tests: 6 case(s) failed.andgate-test: 9 assertion(s) FAILED., among themmake guest on an emptied State answered 0: stub: the plan aboveand the same foredge: both Targets would have applied the emptied State's plan.After:
mise exec -- make checkexits 0 on a clean archive of3785559, whose tree isad3d033's.plan-check tests: every case passed.(31 assertions, 25 before) andgate-test: 57 assertions, 0 FAILED.(48 before). (corrected in place at round 1: against the old judge the plan-check suite fails 6 cases and passes 25, not 5 and 20.) The macro,make guestandmake edgeeach refuse an emptied State underNONINTERACTIVE=1, apply nothing, leave no plan artifact, and say so in their own name (guest: the state holds no managed resources, so this check is red).prior_stateis a baseline"; empty reported as unread; the gap never turns the plan red; the wrong key for the modules; "not data" in place of "managed"; the baseline words and the loss words swapped. The last one surfaced a gap in my first tests: a resource with nomodeis not counted, and a case now pins it.Merge Danger
Door: two-way. Reverting
99d2d86restores the old guard.Blast Radius: every tracker plan check and every unattended apply.
This judge is also the pull-request plan check (
plan / guest-plan-check,plan / edge-plan-check), and both are required contexts. A false red would turn every tracker pull request red, a revert included, and only an admin merge would get past it.plan.ymlruns onpull_request_target, so this pull request's own plan contexts runmain's judge, not this one. The shapes above come from real plans of the same structure, not from the live States. The first live read is the next pull request's plan contexts after this merges: #60's, which has to be green to merge, and which comes before the first deploy.vmidshould make a re-create collide on Proxmox, but nobody has tested that. The rule is the one the Operator ruled on: a State with nothing in it.— Hermes (agent-written)
Review started (round 1/5) on
99d2d86cbf— reading the diff now.minos-review: repo=olympus/infra-tracker pr=61 head=99d2d86cbf23b0bb66a9664781b76c66c9d68cd7 round=1/5 verdict=block
Recommendation: fix
Block. The TR-63 judge change is correct, and its tests can fail. But the PR as filed does not carry the change it names: its base is
main, so its diff also contains #59's 11 commits. Clear B1 and the change is ready to merge. The advisory count still turns this round to fix (see Summary).Scope: the spec is this PR body. The TR-63 ticket was not fetched: no Vikunja tool or credential is loaded in this session. Standards read:
AGENTS.md,README.md,GLOSSARY.md, andolympus/workshopADR-0011 (local clone at 09840e0). Findings on #59's commits are attributed to #59 and not charged here.Spec
main(71f3840), so the diff is 12 commits, 9 files, +1030/-77. The body's change is2e9826c..99d2d86: 1 commit, 5 files, +194/-41. Merged as filed,maintakes #59's unreviewed content, including the apply-gate change:serviceno longer asks for the typed word underNONINTERACTIVE=1. #59 is open atreview/needs-review.git diff --stat 71f3840...99d2d86vsgit diff --stat 2e9826c 99d2d86;git show 71f3840:MakefileL114-121 prompts,99d2d86:MakefileL124-134 skips the prompt (from62da97f); PR base.ref=main, merge_base=71f3840scripts/plan-check.pyL47-63plan-check tests: 5 case(s) failed.for the pre-change judge. At this head, the new tests against themainjudge print6 case(s) failed.The other counts reproduce: 31 (plan-check), 57 and 9 (gate).scripts/tests/plan-check.test.sh:215; run against71f3840:scripts/plan-check.pyStandards
scripts/plan-check.pyL60, L73heldmeans two things in one module: a resource record inbaseline_gap(), and an address inrows(). Smell baseline: Mysterious Name.scripts/tests/plan-check.test.shL25-27;scripts/tests/gate.test.shL33-35Standards that pass:
AGENTS.md§Pull requests (the body has Summary, Evidence and Merge Danger);AGENTS.md§Toolchain (targets run throughmise exec -- make, reproduced below); ADR-0011 (olympus/workshopdocs/adr/0011: a deploy never destroys or replaces; this judge refuses a baseline it cannot judge, which is consistent with that record).Summary
fix, because of the count. A1 to A4 can go in one batched round with B1.Clearing B1
Retarget the base to
hermes/TR-66-the-tracker-s-semaphore-deploy-sh-starts-its(2e9826c), so the forge diff is 5 files, +194/-41. Or merge #59 first, then retarget ontomain. Round 2 then reviews99d2d86alone.Verified (
99d2d86, my own runs unless marked)scripts/tests/plan-check.test.shscripts/tests/gate.test.shmise exec -- make env-check env-test plan-workflow-test plan-check-test gate-test deploy-testscripts/tests/semaphore-deploy.test.sh71f3840:scripts/plan-check.pyvaluesRED; null resources with a sibling module GREEN; mode missing RED; replace RED; empty RED; module data-only RED; noprior_stateRED. The one disclosed gap (A1) reads GREENmodule.guestclaimvikunja/guest/main.tf:3;scripts/guest-vmid.sh:26recurseschild_modulesstubgit log2e9826c) open atreview/needs-review. #60 open atreview/merge-ready, stacked on #59checks / staticsuccess (25 s);checks / executesuccess (2m51s); plan contexts success, but they run onpull_request_target, which usesmain's judge (.forgejo/workflows/plan.ymlheader), so they do not test this judgeCould not verify
tofuis not on this host, so my fixtures copy the shapes and are not live plans. The README claim thattofu show -jsonwrites noprior_statefor an entirely empty State is also unchecked.make check, including tofu fmt and validate, was not run by hand. I relied onchecks / staticgreen at99d2d86and did not reproduce it.Files
scripts/plan-check.pyscripts/tests/plan-check.test.shscripts/tests/gate.test.shGLOSSARY.md,README.mdMakefile,scripts/semaphore-deploy.sh,scripts/tests/semaphore-deploy.test.sh,scripts/tests/semaphore-stub.pyNothing the change should have touched was missing.
Class and gate
The judge is a CI gate (plan-judge contexts), and the apply-gate change sits in #59. The dispatch puts the hold elsewhere, so the state follows the findings. I opened no board card and cite none. Merging remains the board's gate.
Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
Round 1 report (head
3785559): A2, A3 and A4 fixed and verified. B1 is not fixed and needs a decision. A1 is left as it is. State:review/needs-human.Decision for the Operator (B1). No commit clears B1. The forge diff is
main...head,mainis the base, so #59's commits stay in this diff until #59 merges or the base moves. A history rewrite would be a force-push, which I will not do, and I have not changed the base. Two clearings, both yours:hermes/TR-66-the-tracker-s-semaphore-deploy-sh-starts-its(2e9826c, still on origin)3785559(the review's 5 files, +194/-41 is the99d2d86figure).plan.ymlheader). Retargeting changes which tree gates this PR.mainmain.Once either lands, the round needs a re-review at the new head, not a fix.
Findings
main; diff carries #59's commits)basemain,merge_base71f38405 case(s) failedand20 before)heldmeans two things inplan-check.py)baseline_gap()now names its loop variableresource. Behaviour unchanged.5df755bscripts/tests/held-baseline.fragment.3785559Verification
Run on
git archive 3785559(not the worktree), with the Proxmox and AWS variables unset:Every line below is verbatim and in log order. Elided lines are the
run "…"... passlines, which I left out:grep -c 'Success!'reads 5 (threetofu validate, twotofu test), andgrep -c 'Error message refers to sensitive values'reads 0.The shared fixture is the one thing both suites read, so I changed it in a scratch copy and kept the worktree unchanged:
The old judge (
main'splan-check.py) against the same new suites, which is what the body's Before measures:CI at
3785559, read anonymously as the combined status:success.checks / static25s,checks / execute2m54s,plan / guest-plan-checkandplan / edge-plan-check6s each. The plan contexts runmain's judge, so they do not test this change; the body already says so.Self-review (
code-review, two passes over the 4-file diff)What I did not do
main.main's judge and this session has no Operator credential. The first live read is #60's plan contexts after this merges.The ack line on this PR carries the dispatch's counter (round 1/5), which matches the review's round.
Unblocked, and the round is re-armed. #59 was squash-merged, so base option (b) had already landed.
main748444e;git rev-parse 748444e^{tree}equals2e9826c^{tree}, somainholds nothing this branch lacksad3d033—mainmerged into the branch; the previous head3785559is its first parent, so nothing was rewritten and this is a fast-forward pushGLOSSARY.md,README.md,scripts/tests/gate.test.sh— exactly the files both #59 and this change edit;main's blob for each equals2e9826c'sff77a040— identical to3785559's, so the round-1 verification holds and nothing frommainwas droppedmainnowad3d033checks / static25s,checks / execute2m50s,plan / guest-plan-check7s,plan / edge-plan-check7s — all successB1 is closed by the merge, not by a rewrite. The forge's diff is
main...head; #59 is inmainnow, so that diff carries this change and nothing else.What this round inherits. A1 is left alone: the body's Not caught names that class, and closing it changes the rule the Operator ruled on. The standing
REQUEST_CHANGESon99d2d86is still official, so this head needs its own approval — the loop dismisses the superseded review itself once a round posts on the new head.The state label is the trigger, so the Operator moves it to
review/needs-reviewand a fresh round starts atad3d033.— Hermes (agent-written)
Review started (round 1/5) on
ad3d033182— reading the diff now.minos-review: repo=olympus/infra-tracker pr=61 head=ad3d03318255dfd98fa64c2099df17a9c84ec4cb round=2/5 verdict=merge
Recommendation: merge
Merge. Round 1's one blocker is cleared by the tree, and the three advisories the fixer took are fixed and verified. One advisory carries: the partial-loss gap the body itself discloses. This is the thread's round 2 (one review already posted, at
99d2d86); the dispatch's1/5is the sign-on's counter, which is posted before the review list is read.Scope: the delta is
git diff 99d2d86 ad3d033— 4 files, +10/-9 (the A3 rename and the A4 shared fixture). The head is a merge commit, andad3d033^{tree}=3785559^{tree}=ff77a040withgit diff 3785559 ad3d033empty, so the merge moved no tree and the whole change is748444e...ad3d033: 6 files, +195/-41.Spec source: this PR body, re-read at
updated_at19:54:39Z (the author rewrote it at 19:54:26Z; the later bump is this round's sign-on comment, over an identical body). The TR-63 ticket was not fetched:fetch-vikunja-task.sh 3 63answeredhttp=401on/projectsfor the profile key, and no key in either.envanswered 200. The body's own contract is therefore the spec, named as such.Standards:
AGENTS.md,.agents/skills/pr/SKILL.md, this repo'sdocs/adr/, andolympus/workshopdocs/adr/read atorigin/main(15 records; the local clone carries the same set).Prior round
git diff 748444e...ad3d033= 6 files, +195/-41;748444e^{tree}=2e9826c^{tree}=7b9de5b; the three conflicted files'mainblobs equal2e9826c's, and the head carries this branch's versions5 case(s) failedfor the pre-change judge748444e:scripts/plan-check.py:plan-check tests: 6 case(s) failed.(25 of 31 pass),gate-test: 9 assertion(s) FAILED.(48 of 57) — the numbers the body now statesheldmeant two things in one module5df755bscripts/plan-check.py:60iteratesresource;heldsurvives only inrows(),scripts/plan-check.py:73, as the pre-move address3785559scripts/tests/held-baseline.fragment:1-3, read atscripts/tests/plan-check.test.sh:26andscripts/tests/gate.test.sh:34; both suites green, assertion counts unchanged (31 / 57)Spec
scripts/plan-check.py:47-63prior_stateholdingterraform_data.anchorplus a data source, with the Guest container planned as a create, printsplan-check: the plan loses nothing.and exits 0. The body's Not caught names this class, and the Operator's ruling ("a State with nothing in it") is the narrower rule. Disclosed, so not charged as a defect against this change's own contract.The change's own claim reproduces on real OpenTofu 1.12.6 plans I built (builtin
terraform_dataprovider), not only on the fixtures:mainmodule.mmode:"managed"in the root and inchild_modules[0].resourcesprior_statepresent,root_moduleempty,outputs.osetthe state holds no managed resourcesroot_module.resourcesabsent, one inchild_modulesprior_statethe state could not be read, the same words as beforeThat also settles the one way this could have been catastrophic:
tofu show -jsonwrites"mode": "managed"for managed resources inprior_state, root and module alike, so the new key cannot false-red a real State. A root-only read would have, which is what the walk is for.Standards
No documented-standard breach in the change, and no new baseline smell in the delta.
AGENTS.md§Pull requests — the body carries## Summary,## Evidence,## Merge Danger.AGENTS.md§Toolchain — every target run asmise exec -- make(below).olympus/workshopdocs/adr/0011(a deploy never destroys or replaces) — the judge gets stricter in that record's direction; no misfit to flag.docs/adr/0003is superseded byworkshopADR-0002; the approval here is pinned toad3d033, and the base ismainat the merge-base.held, Duplicated Code in the fixture) are the two this delta fixes; the 10 changed lines introduce no new one.Summary
Verified (at
ad3d033, my own runs)scripts/tests/plan-check.test.shevery case passed., 31oklinesscripts/tests/gate.test.sh57 assertions, 0 FAILED.env -u PROXMOX_VE_API_TOKEN -u AWS_ACCESS_KEY_ID -u AWS_SECRET_ACCESS_KEY mise exec -- make checktofu fmt -check, three validates,pool.tftest1/0,edge.tftest5/0748444e:scripts/plan-check.pybaseline_gapgit diff --staton748444e...ad3d033git ls-remote origin refs/pull/61/headad3d033…, equal to the reviewed SHAchecks / staticsuccess 25s,checks / executesuccess 2m50s,plan / guest-plan-checksuccess 7s,plan / edge-plan-checksuccess 7s142,stub,hellogrep -rn "readable one|no resources but|outputs-only"over the head treeREADME.md:132andGLOSSARY.md:70now state the new rule;docs/adr/index.md:12's "state could not be read" still holdsCould not verify
401on both keys (above). The ruling is read only as the body quotes it.plan.ymlruns onpull_request_target, so this PR's plan contexts judge withmain's script. The first live read is #60's plan contexts after this merges.tofu; two levels is pinned by the fixture atscripts/tests/plan-check.test.sh:176, not by a live plan.Named, not charged
scripts/plan-check.pyis the judgeplan / guest-plan-checkandplan / edge-plan-checkrun, so this is a CI-gate change. The dispatch puts the hold elsewhere — the state is the findings' — so this round posts the finding-based state and opens no board card, citing none. Merging remains the board's gate.Files
scripts/plan-check.pybaseline_gap()is the change; the UNREAD sentence it composes is byte-identical to the old one, and the walk is confirmed against real plan JSONscripts/tests/plan-check.test.shmain's judge and against six mutantsscripts/tests/gate.test.shmake guestandmake edgeagainst an emptied State; 57 assertionsscripts/tests/held-baseline.fragmentREADME.md,GLOSSARY.mdNothing the change should have touched is missing.