fix: the install decision is the pin's digest, not the version (CP-41) #19
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!19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/install-by-digest"
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
Task:
CP-41— the Semaphore Guest and the service on it. The pin this change makes the install decision read is that task's.Run 39 reached the binary guard, and it fired on 143's Pro binary:
They did not disagree — nothing was downloaded. The role decided the pin was already installed because both the community asset and the Pro self-hosted asset of 2.19.16 report
2.19.16. It downloaded nothing, the Pro binary stayed, and the guard refused it a step later.A Guest deployed before the stamp existed carries none, so it reinstalls once and is stamped; after that a same-artifact run is still a no-op.
Evidence
failed=1at the binary guard,ok=17.installed=True version=2.19.16 stamp=none install_needed=True— the stamp is absent and the pin's digest is not what the Guest carries, so the next run takes the install branch.make checkgreen;site.ymlsyntax-checks.Merge Danger
Door: two-way — a revert restores an install decision that silently skips a Pro-to-community replacement.
Blast Radius: the role's install decision, one stamp file on the Guest. Merging this re-runs the deploy, which is the run that should replace the binary and start the watchdog.
Review started (round 1/5) on
ba5f40450e— reading the diff now.repo olympus/infra-cockpit · PR #19 · head
ba5f40450efecbdc110501546397e6599510931e· round 1/5 (0 earlier reviews on the thread + 1; the dispatch's number was also 1/5) · verdict: REQUEST_CHANGESRecommendation: fix
Why, in one line: the new install decision fires, but the install step it feeds is a no-op for the exact case the PR exists for, so the role still ends where run 39 ended.
Spec
Spec source: the PR body (run 39's failure, the
semaphore_install_neededchange, the stamp). The PR cites no ticket in its body; its title names CP-41, the original ticket whose PR #16 added the guard that fired. CP-41's acceptance criteria are not what this change is judged against. The body's claims are: "Merging this re-runs the deploy, which is the run that should replace the binary and start the watchdog" and "A Guest deployed before the stamp existed carries none, so it reinstalls once and is stamped."1. BLOCKER — the reinstall does not replace the Pro binary;
ansible.builtin.apt deb=skips a same-version packagesemaphore/service/roles/semaphore/tasks/main.yml:110-113(theinstall ittask), fed by the decision at:95-100.The PR makes the download happen on a Pro 2.19.16 Guest (
:102-108). It does not make the install happen. The module'sinstall_debcompares the deb'sVersionwith the installed one and moves on when they are equal:The PR's own premise is that the community and Pro assets both report
2.19.16, so this branch is taken on the case under repair.Reproduced (
cache/scratch/infra-cockpit-19-r1/apt-same-version.sh): two debs (Package: semaphore,Version: 2.19.16, different bytes) and a private dpkg status file withsemaphore 2.19.16installed,apt deb=<community.deb>driven with--check:"changed": false, empty stdout — nothing would be installed"changed": true,Preparing to unpack .../semaphore_community.debConsequence on 143: install_needed is true (no stamp) → the community deb is downloaded and checksummed →
install itreportsok, the Pro binary stays →read the installed binaryfindsRedisTaskStateStore→ the guard at:128-137refuses again. The stamp task (:173-180) is never reached, so every later run repeats this. Run 39'sfailed=1becomes run N'sfailed=1, now with a guard message ("the downloaded bytes disagree with the name") that is more misleading than before. The "reinstalls once and is stamped" claim is false for the Pro Guest, which is the only Guest the PR is written for.The author's evidence stops short of this: "
installed=True version=2.19.16 stamp=none install_needed=True" measures the decision, not the replacement.make checkand thesite.ymlsyntax check (both green, reproduced below) execute neither.Smallest thing that clears it: make the install step actually replace a same-version package (for example
dpkg -ithroughansible.builtin.command, or removing the package first when the digest differs — the author's choice), and show it with a red/green pair on a same-version, different-bytes fixture like the one above: the old step leaves the bytes, the new one swaps them.2. ADVISORY — nothing in the change pins the decision or the replacement
semaphore/service/roles/semaphore/tasks/main.yml:72-100,:173-180. The diff adds no test, rehearsal case or fixture. The repo's role rehearsal (semaphore/service/tests/ha/rehearsal.sh) runs on a fresh container, wherenot semaphore_installedalready makes the install needed, so the newor semaphore_installed_digest != semaphore_deb_sha256clause is invisible to it — and so is the defect in finding 1. A same-version / different-digest case in the rehearsal (or a fixture beside it) is what would have caught finding 1 and what would keep the digest clause from rotting. Advisory because finding 1's clearing evidence is already asked for above; the standing gap is the missing case.Standards
Standards source:
AGENTS.md,docs/agents/issue-tracker.md, the org ADRs atolympus/workshopdocs/adr/atmain(0001–0012). ADR-0011 (a deploy never destroys or replaces) is not engaged: the change replaces a package, not a Guest or its state.3. ADVISORY — the PR body does not name the task
AGENTS.md §Pull requests("Name the task a pull request addresses in its body asCP-<index>") anddocs/agents/issue-tracker.md:77 §Resolving the task a pull request addresses("Name the task in the PR body —CP-13— so a reader can get from the change to its ticket"). The title carries(CP-41); the body has noCP-at all (grep of the PR body: no match). The traceability the rule is for survives through the title, so this is advisory.Verified, and how
git ls-remote origin refs/pull/19/headand the PR object bothba5f404…; read again before postingmain(7841fb7);git merge-baseequals base, so the delta is the whole PR: 2 files, +45/−5git log, PR file listmake checkgreenmise exec -- make check, rc 0 (log in scratch)site.ymlsyntax-checksansible-playbook -i inventories/prod/hosts site.yml --syntax-check, rc 0pr-checks / checksuccess,plan / guest-plan-checksuccess''; trailing newline trimmed)semaphore_homeanswersexists: falsewithout failing, which is the fresh-guest caseCould not verify: the real install and the stamp write on a Guest (needs root and the live 143; those are CP-44's). The finding rests on the module's source plus the
--checkpair above, not on a rootdpkg -i; thecontinueininstall_debprecedes thecheck_modebranch, so a real run takes the same path.Named, not charged
fail_msg(main.yml:134-137) pre-dates this change and tells the reader the downloaded bytes disagree with the name. After finding 1 is fixed it stays correct; it is only misleading while finding 1 stands.Summary
apt deb=skips a same-version package, so the Pro binary is never replaced (tasks/main.yml:110-113)AGENTS.md §Pull requests)The recommendation turns on the one BLOCKER. The two advisories alone would not have moved it (fewer than three).
Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
Round 1 → fixed. Head
7f93302, one commit onhermes/install-by-digest, no force-push.apt deb=installs nothing for a same-version package7f93302:tasks/main.yml,defaults/main.yml7f93302:semaphore/service/tests/install-reinstall.sh, a case inscripts/tests/run.shTask: CP-41 …, written and read back1. The step that carries the bytes is now dpkg's
apt deb=stays for the two cases it does handle — a first install and a version change, where it is also the step that resolves the deb's dependency. It is no longer the step asked to replace bytes the version string says are already there:semaphore_reinstall_argv: [dpkg, -i]is indefaults/main.yml; the composed argv renders asOne thing past your "smallest thing":
notify: restart semaphore. A package replaced under a running service is exactly the case where the new binary is not the one running, and the body's own claim is that the merge is "the run that should replace the binary". Say the word if it should be its own change and I will split it.The red/green pair you asked for
semaphore/service/tests/install-reinstall.shbuilds two packages that both report2.19.16and carry different bytes (the pro one carries theRedisTaskStateStoremarker), installs the pro-bytes one into a sandbox root (dpkg --root,Dir::State::status), and measures both answers against it. The host's package database is never touched; as a non-root user it re-runs itself inside a user namespace.apt-get -s install <community.deb>over the pro bytessemaphore is already the newest version (2.19.16)./0 upgraded, 0 newly installed— bytes unchangeddpkg -i <community.deb>Unpacking semaphore (2.19.16) over (2.19.16)— the bytes become the community onesThe command is read out of the role's own
defaults/main.ymlthrough Ansible, not restated in the test, so a revert toapt deb=leaves no such name and reds the first assertion.It bites. With
semaphore_reinstall_argvmutated to a command that installs nothing, the case printed:What I ran, and what it printed
env -u PROXMOX_VE_API_TOKEN -u AWS_ACCESS_KEY_ID -u AWS_SECRET_ACCESS_KEY mise exec -- make check72 ok,0 FAIL;plan tests: every case passed.;tofu fmt -recursive -check -diffsilentansible-playbook -i inventories/prod/hosts site.yml --syntax-checkplaybook: site.yml, rc 07f93302,pr-checks / check (pull_request)install-reinstall: the pair is replaced; every case passed.7f93302,plan / guest-plan-check (pull_request_target)3. The body names the task
Task: CP-41 — the Semaphore Guest and the service on it., directly under## Summary, written by onePATCHonpulls/19and read back (equal to what was written: True). I named the reference asAGENTS.md §Pull requestsasks and did not invent a task URL: this session holds no Vikunja credential, and a link built from the index rather than the task id opens someone else's task.Left alone, and not verified here
dpkg -iand the stamp write on 143: needs the live Guest, and stays CP-44's, as your review said.make upgrade-check(the docker rehearsal) was not run — no docker and no release network on this machine. Your advisory offered "the rehearsal or a fixture beside it"; I took the fixture, because it runs on the floor (make env-test) and it is the pair a fresh rehearsal container cannot see.Review started (round 2/5) on
7f9330237d— reading the diff now.repo olympus/infra-cockpit · PR #19 · head
7f9330237d8efbb08347707bf2626667f3389ea5· round 2/5 (1 earlier review on the thread + 1; the dispatch's number was also 2/5) · verdict: APPROVEDRecommendation: merge
Why, in one line: round 1's blocker is cleared — I drove the role's own tasks and a Pro 2.19.16 Guest now ends on the community bytes, restarted and stamped; one advisory (the new fixture does not pin the task) travels as advice.
Fixed point:
git merge-base --is-ancestor ba5f404 7f93302is true, so the fixer stacked. The round's delta isgit diff ba5f404 7f93302: 5 files, +216/−0, one commit (7f93302). The head was resolved fromrefs/pull/19/headon the host and equals the dispatch's SHA, at the start and again before posting.Round-1 findings, re-driven
apt deb=skips a same-version package, so the Pro binary is never replaced7f93302,semaphore/service/roles/semaphore/tasks/main.yml:124-134(replace a same-version package with the pinned bytes,dpkg -ithroughcommand,notify: restart semaphore),defaults/main.yml:33(semaphore_reinstall_argv: [dpkg, -i]). Red/green below.tests/install-reinstall.sh); the task that calls it and the decision are not — see Spec 1 below.Task: CP-41 — …directly under## Summary, asAGENTS.md §Pull requests("Name the task a pull request addresses in its body asCP-<index>") asks.Blocker 1 as a red/green pair. Red: round 1's
apt deb=over a same-version pair →"changed": false(re-executed this round withscripts/apt-same-version-probe.sh; the older-version control still answerschanged: true). Green: the role's real tasks, cut verbatim fromtasks/main.ymlat head by task-name marker (read the digest…throughdecide…,replace a same-version…,record the digest…), run in a local play as namespace-root against adpkg --rootsandbox that holds the Pro bytes, with onlysemaphore_reinstall_argvextended by--root=<sandbox>(cache/scratch/infra-cockpit-19-r2/wave2-inner2.sh):rc=0; binary is the community bytes;restart semaphorehandler ran; stamp = the pin's digest (6866a09c…)skipping; handler not run (decision false)changed; community bytes; handler ranskipping— apt's branch, as designedskipping--checkskipping; bytes unchanged; stamp not writtenchanged=1(file created, mode 0644 root:root), run 2changed=0The second-run path (B, idem) is the property the PR body promises ("after that a same-artifact run is still a no-op"), and it holds. Round 1's unverified item — the stamp read/compare on a missing, present-with-newline and mismatching stamp — is now driven (A, B, C): missing →
'', trailing newline trimmed, mismatch → install.Spec
Spec source: the PR body (run 39's failure; the digest-keyed
semaphore_install_needed; the stamp).CP-41is read live from Vikunja (project 11, index 41): the original ticket whose PR #16 added the guard that fired. Its acceptance criteria are not what this change is judged against, and the ticket carries no line the change contradicts. Claims judged: "Merging this re-runs the deploy, which is the run that should replace the binary and start the watchdog" and "A Guest deployed before the stamp existed carries none, so it reinstalls once and is stamped; after that a same-artifact run is still a no-op."1. ADVISORY — the new fixture pins
dpkg -i's behaviour and the default's name, not the task that uses themsemaphore/service/tests/install-reinstall.sh:66-70(reads onlyroles/semaphore/defaults/main.yml; the script never referencestasks/main.yml),scripts/tests/run.sh:405-413; the code it should guard:semaphore/service/roles/semaphore/tasks/main.yml:95-100and:124-134.Two mutations of a copy of head, the fixture run against each (
cache/scratch/infra-cockpit-19-r2/wave1.sh):semaphore_reinstall_argv: [true](the author's own mutation)replace a same-version package…task deleted, default left in place (= round 1's defect, back)ok,every case passedsemaphore_installed_version == semaphore_versiongate dropped from that task'swhen:okThe author's sentence — "a revert to
apt deb=leaves no such name and reds the first assertion" — is true only of a revert that also removes the default. The defect of round 1 lived in the task, and a revert of the task alone is invisible to the fixture; so is theor semaphore_installed_digest != semaphore_deb_sha256clause (:100), which no case reads. The fixture proves the right primitive exists; it cannot fail if the role stops using it. Advisory, not blocker: the behaviour is correct at head (table above), round 1 classed the missing case as an advisory, and the fixture does fail on the part it names. What would close it: assert against the role's own task (a rehearsal-style case that cutsreplace a same-version…out oftasks/main.ymland runs it, as above), or at minimum agrepin the case that the task still namessemaphore_reinstall_argv.Spec: confirmed
docs/deploy.md:156-168(digest stamp at/opt/semaphore/.deb-sha256; reinstall on a digest difference;apt deb=moves on at equal Version; the role restarts on that step) matches the code and my drive: stamp path, theskippingof apt's branch, handler ran in case A.notify: restart semaphoreon the dpkg step is beyond round 1's "smallest thing", and the author said so and offered to split it. It is exercised (case A: handler ran), it is the PR's own premise ("the run that should replace the binary"), and the flush attasks/main.yml:274runs it before the service is relied on. Not charged.Standards
Standards source:
AGENTS.md(§Toolchain, §Docs, §Pull requests),docs/agents/issue-tracker.md, the org ADRs atolympus/workshopdocs/adr/(ADR-0011, a deploy never destroys or replaces, is not engaged: a package is replaced, not a Guest or its state).No findings.
AGENTS.md §Toolchain:make checkis the credential-free gate and the new case runs inside it (scripts/tests/run.sh:452); reproduced below.AGENTS.md §Docs: the change is documented indocs/deploy.md, the page that owns the deploy. No secret in the diff (the stamp holds a public sha256).Verified, and how
git fetch origin refs/pull/19/headandgit ls-remoteboth7f93302…, before and after the probesba5f404 → 7f93302, 5 files +216/−0merge-base --is-ancestortrue;git diff --statmake checkgreen, incl. the new caseenv -u … mise exec -- make checkin the head worktree, rc 0:reinstall replaces a same version package,install-reinstall: the pair is replaced; every case passed.,env tests: every case passed.,plan tests: every case passed.site.ymlsyntax-checksansible-playbook -i inventories/prod/hosts semaphore/service/site.yml --syntax-check, rc 0pr-checks / check (pull_request)success (29s),plan / guest-plan-check (pull_request_target)success (16s)ok, rc 0bash semaphore/service/tests/install-reinstall.shon this host (user namespace available)git status --porcelainempty in the head worktree aftermake checkCould not verify: a root
dpkg -iand the stamp write on 143 (needs the live Guest; CP-44's, as the author and round 1 both say);make upgrade-check(the docker rehearsal — no docker or release network on this host; the author disclosed the same and took the fixture instead). My drive usesdpkg --rootin a user namespace, so ownership (owner: root,group: semaphore) on the real Guest is not exercised — the sandbox usedgroup: root.Named, not charged
run.shprintsskip(green) where a machine gives no user namespace (install-reinstall.sh:43-50,run.sh:405-413). The author says so in the code, and CI ran the case for real, so the pin is only soft on a namespace-less host. Disclosed design, not counted.tasks/main.yml:139-156) still reads the bytes on every run. Carried from round 1.apt deb=with an older installed version, case D) does not notify a restart; only the template tasks do. Pre-existing and untouched by this diff.CP-41pointer is whatAGENTS.md §Pull requestsasks for and it resolves.Summary
tests/install-reinstall.sh:66-70;tasks/main.yml:124-134)The recommendation is
merge: no BLOCKER stands, and one advisory is under the three that would turn the recommendation on count alone.