The apt cache refreshes stop reporting a change in check mode (THE-136) #71

Merged
pit merged 1 commit from hermes/136-apt-cache-changed-when into main 2026-12-04 07:11:42 +00:00
Owner

paperclip:THE-136

Summary

THE-136 is the drift report's repeating row for infra-secrets' bao service layer: the daily rehearsal reports changed=2, so the row hides the next real difference behind noise. The two changed tasks are the first one in each of two roles, and both are the same apt cache refresh.

TASK [unattended_upgrades : refresh the apt cache before the first install]
changed: [bao]
TASK [openbao : refresh the apt cache before the first install]
changed: [bao]

Under --check the apt module cannot update the cache and says so itself: it skips cache.update() and still sets updated_cache = True when the cache has passed cache_valid_time (ansible/modules/apt.py). A daily run is always past the hour, so the row reads drift every day.

Two files, four lines each:

 - name: refresh the apt cache before the first install
+  # Preparation, not a change: check mode cannot update the cache and still
+  # answers `changed` once it is older than `cache_valid_time`, so without this
+  # line every daily rehearsal of the service layer reads as drift.
   ansible.builtin.apt:
     update_cache: true
     cache_valid_time: 3600
+  changed_when: false

The refresh is preparation for the installs below, and those tasks still report a package that moved. The rehearsal now reads ok on both. This is the fix infra-silo carries on its own two roles (olympus/infra-silo#45) and infra-tracker on its unattended_upgrades and vikunja roles (olympus/infra-tracker#66).

The firewall role's nftables task also refreshes the cache, but it names a package install, so it reports only a change to that package; a changed_when: false there would hide a real install, and it is left as it is.

Evidence

Before — main at a2f8692 (05:35Z) After — this branch at 7b7f30c (05:37Z)
bao : ok=60 changed=2 unreachable=0 failed=0 skipped=41 bao : ok=60 changed=0 unreachable=0 failed=0 skipped=41
both refresh tasks changed: [bao] both refresh tasks ok: [bao]

Both runs are mise exec -- make service-check against PROD (Guest 144) with the same play, from the Hermes host with the runner's fleet key; exit 0.

The Guest's /var/lib/apt/lists read 2026-12-04 00:03:19 +0000 — 5h32m old at the after-run, and still that value 5h35m old when re-read at 05:38Z — and /var/lib/apt/periodic/update-success-stamp is absent, so the cache was past cache_valid_time: the suppression, not a fresh cache, is what made the tasks ok.

mise exec -- make check on this branch: exit 0.

Merge Danger

Door: two-way. Two predicates in two tasks; a revert is an ordinary pull request. It applies nothing — the rehearsal is the deploy's own first step.

Blast Radius: the changed count of the bao service rehearsal and of a deploy's --check run. A deploy still installs what moved: the install tasks below are what report a package. The one thing no longer reported is the cache refresh itself, which changes no configuration on the Guest.

Prose in this body is agent-written (Hermes).

paperclip:THE-136 ## Summary [THE-136](https://paperclip.thepit.space/THE/issues/THE-136) is the drift report's repeating row for `infra-secrets`' bao service layer: the daily rehearsal reports `changed=2`, so the row hides the next real difference behind noise. The two changed tasks are the first one in each of two roles, and both are the same apt cache refresh. ```text TASK [unattended_upgrades : refresh the apt cache before the first install] changed: [bao] TASK [openbao : refresh the apt cache before the first install] changed: [bao] ``` Under `--check` the apt module cannot update the cache and says so itself: it skips `cache.update()` and still sets `updated_cache = True` when the cache has passed `cache_valid_time` (`ansible/modules/apt.py`). A daily run is always past the hour, so the row reads `drift` every day. Two files, four lines each: ```diff - name: refresh the apt cache before the first install + # Preparation, not a change: check mode cannot update the cache and still + # answers `changed` once it is older than `cache_valid_time`, so without this + # line every daily rehearsal of the service layer reads as drift. ansible.builtin.apt: update_cache: true cache_valid_time: 3600 + changed_when: false ``` The refresh is preparation for the installs below, and those tasks still report a package that moved. The rehearsal now reads `ok` on both. This is the fix `infra-silo` carries on its own two roles (olympus/infra-silo#45) and `infra-tracker` on its `unattended_upgrades` and `vikunja` roles (olympus/infra-tracker#66). The firewall role's `nftables` task also refreshes the cache, but it names a package install, so it reports only a change to that package; a `changed_when: false` there would hide a real install, and it is left as it is. ## Evidence | Before — `main` at `a2f8692` (05:35Z) | After — this branch at `7b7f30c` (05:37Z) | | --- | --- | | `bao : ok=60 changed=2 unreachable=0 failed=0 skipped=41` | `bao : ok=60 changed=0 unreachable=0 failed=0 skipped=41` | | both refresh tasks `changed: [bao]` | both refresh tasks `ok: [bao]` | Both runs are `mise exec -- make service-check` against PROD (Guest 144) with the same play, from the Hermes host with the runner's fleet key; exit 0. The Guest's `/var/lib/apt/lists` read `2026-12-04 00:03:19 +0000` — 5h32m old at the after-run, and still that value 5h35m old when re-read at 05:38Z — and `/var/lib/apt/periodic/update-success-stamp` is absent, so the cache was past `cache_valid_time`: the suppression, not a fresh cache, is what made the tasks `ok`. `mise exec -- make check` on this branch: exit 0. ## Merge Danger **Door:** two-way. Two predicates in two tasks; a revert is an ordinary pull request. It applies nothing — the rehearsal is the deploy's own first step. **Blast Radius:** the changed count of the bao service rehearsal and of a deploy's `--check` run. A deploy still installs what moved: the install tasks below are what report a package. The one thing no longer reported is the cache refresh itself, which changes no configuration on the Guest. Prose in this body is agent-written (Hermes).
The apt cache refresh is preparation, so the drift check reads zero (THE-136)
All checks were successful
plan / guest-plan-check (pull_request_target) Successful in 22s
pr-checks / check (pull_request) Successful in 48s
7b7f30cebd
`apt: update_cache: true` with `cache_valid_time: 3600` answers `changed` under
`--check` whenever the cache is older than the hour the module is told to
trust: the module skips the update and still reports it. The play carries two
such refreshes, the shared `unattended_upgrades` role and the `openbao` role's
own, so the daily `drift-infra-secrets` row read `changed=2` and the service
layer looked like it had drifted.

Both are preparation for the install that follows, and the install names the
change that matters, so both now set `changed_when: false`, with the reason
beside them. The firewall's `nftables` task refreshes the cache too, but it
names a package, so it reports only that package's install and keeps its
report.
Member

Review started (round 1/5) on 7b7f30cebd — reading the diff now.

**Review started** (round 1/5) on 7b7f30cebdfe45e2b4887873eda798881fd10cf5 — reading the diff now.
bot-minos approved these changes 2026-12-04 05:41:23 +00:00
bot-minos left a comment

olympus/infra-secrets #71 — head 7b7f30cebdfe45e2b4887873eda798881fd10cf5 — round 1/5 — verdict: merge

Recommendation: merge

Standards — 0 findings

standards: no repo conventions found beyond AGENTS.md (its checks and the workshop ADRs); judged by general good practice and the repo's own file conventions. No ADR conflict: the diff touches no Stack, no ADR, no workflow and no branch protection, and a predicate on two apt tasks reaches neither ADR-0009 (deploy through a merge to main) nor ADR-0011 (a deploy never destroys or replaces). No secret in the diff.

The shape is the one the org already carries: olympus/infra-silo at origin/main, silo/service/roles/unattended_upgrades/tasks/main.yml:10-17 (comment wording identical) and silo/service/roles/silo/tasks/main.yml:52-62; olympus/infra-tracker at origin/main, vikunja/service/roles/unattended_upgrades/tasks/main.yml:10-14 and vikunja/service/roles/vikunja/tasks/main.yml:11-15. Both changed files pass.

Spec — 0 findings

Spec source: paperclip:THE-136, read live over the Paperclip control plane (GET /api/issues/THE-136 → 200; GET /api/issues/cfe21a65-…/comments → 200, 0 entries), "What to do" steps 1–4.

Ticket step At the reviewed head
1. changed_when: false on both refresh tasks, reason in a comment beside them bao/service/roles/openbao/tasks/main.yml:64-71, bao/service/roles/unattended_upgrades/tasks/main.yml:10-17
2. leave the firewall's apt task alone untouched; bao/service/roles/firewall/tasks/main.yml:6-11 is still the repo's only other update_cache site, and it names nftables
3. re-run make service-check, changed=0 failed=0 the author's run; reproduced at task level below — see Could not verify
4. the next 03:15Z audit reads clean a later event; not this round's evidence

No scope creep: +8/−0 across those two files and nothing else; every hunk maps to step 1.

Verified

  • git ls-remote origin refs/pull/71/head = 7b7f30c…, the dispatch's SHA; one commit over a2f8692.
  • Behaviour at task level, on this host, with the shipped probe scripts/apt-check-mode-changed-probe.sh (cache mtime 2026-09-04, age 7,832,846s > cache_valid_time): bare apt: update_cache: true under --check → changed; the same task with changed_when: false → ok; the named-package shape (name: … update_cache: true) → ok. That is the artefact the ticket reports, the predicate that removes it, and the reason the firewall task is rightly left alone.
  • mise exec -- make check at head: rc=0, every suite green (bare make check stops at plan-test only because tofu is off PATH, which the repo's own message names). ansible-playbook --syntax-check on bao/service/site.yml at head: parses.
  • CI at the reviewed head: pr-checks / check (pull_request) success (48s) and plan / guest-plan-check (pull_request_target) success (22s).
  • The body's sibling citations, read at each sibling's live origin/main: infra-silo — two roles carry it; infra-tracker — unattended_upgrades and vikunja. "Two files, four lines each" holds, and the recap arithmetic is consistent (ok=60 changed=2 → ok=60 changed=0): a changed task also counts in ok, which the probe's own recap shows (ok=3 changed=1 over three tasks).

Could not verify

  • The live PROD rehearsal (make service-check against Guest 144): there is no .env in the clone or in the head worktree, and an agent does not fetch its own environment (docs/env-fetch.md; infra-silo AGENTS.md §Environment states the refusal). The whole-play changed=0 therefore rests on three reads that compose: the ticket's independent baseline recap (changed=2), a diff that changes only those two tasks, and the probe's task-level red/green above.

Named, not charged

  • A real (non-check) run no longer reports the cache refresh as changed. The ticket orders exactly this and the body's Merge Danger names it ("the one thing no longer reported is the cache refresh itself"); nothing in the repo consumes the service deploy's changed total — docs/deploy.md:109's changed=0 refers to make service-check, a --check run.
  • Ticket step 4 (the 03:15Z audit reading clean) is a later actor's evidence.
  • The two roles each carry their own copy of the refresh task and its comment. That duplication predates this diff and a shared task file is a larger change than the ticket asks for.

Summary

Standards: 0 findings (worst: none). Spec: 0 findings (worst: none). 0 BLOCKER, 0 ADVISORY — the recommendation is merge; state APPROVED, label review/merge-ready.

<!-- minos review-loop: repo=olympus/infra-secrets pr=71 head=7b7f30cebdfe45e2b4887873eda798881fd10cf5 round=1/5 axes=standards,spec --> **olympus/infra-secrets #71** — head `7b7f30cebdfe45e2b4887873eda798881fd10cf5` — round **1/5** — verdict: **merge** Recommendation: merge ## Standards — 0 findings `standards: no repo conventions found beyond AGENTS.md` (its checks and the workshop ADRs); judged by general good practice and the repo's own file conventions. No ADR conflict: the diff touches no Stack, no ADR, no workflow and no branch protection, and a predicate on two `apt` tasks reaches neither ADR-0009 (deploy through a merge to `main`) nor ADR-0011 (a deploy never destroys or replaces). No secret in the diff. The shape is the one the org already carries: `olympus/infra-silo` at `origin/main`, `silo/service/roles/unattended_upgrades/tasks/main.yml:10-17` (comment wording identical) and `silo/service/roles/silo/tasks/main.yml:52-62`; `olympus/infra-tracker` at `origin/main`, `vikunja/service/roles/unattended_upgrades/tasks/main.yml:10-14` and `vikunja/service/roles/vikunja/tasks/main.yml:11-15`. Both changed files pass. ## Spec — 0 findings Spec source: `paperclip:THE-136`, read live over the Paperclip control plane (`GET /api/issues/THE-136` → 200; `GET /api/issues/cfe21a65-…/comments` → 200, 0 entries), "What to do" steps 1–4. | Ticket step | At the reviewed head | | --- | --- | | 1. `changed_when: false` on both refresh tasks, reason in a comment beside them | `bao/service/roles/openbao/tasks/main.yml:64-71`, `bao/service/roles/unattended_upgrades/tasks/main.yml:10-17` | | 2. leave the firewall's `apt` task alone | untouched; `bao/service/roles/firewall/tasks/main.yml:6-11` is still the repo's only other `update_cache` site, and it names `nftables` | | 3. re-run `make service-check`, `changed=0 failed=0` | the author's run; reproduced at task level below — see *Could not verify* | | 4. the next 03:15Z audit reads `clean` | a later event; not this round's evidence | No scope creep: `+8/−0` across those two files and nothing else; every hunk maps to step 1. ## Verified - `git ls-remote origin refs/pull/71/head` = `7b7f30c…`, the dispatch's SHA; one commit over `a2f8692`. - Behaviour at task level, on this host, with the shipped probe `scripts/apt-check-mode-changed-probe.sh` (cache mtime 2026-09-04, age 7,832,846s > `cache_valid_time`): bare `apt: update_cache: true` under `--check` → **changed**; the same task with `changed_when: false` → **ok**; the named-package shape (`name: … update_cache: true`) → **ok**. That is the artefact the ticket reports, the predicate that removes it, and the reason the firewall task is rightly left alone. - `mise exec -- make check` at head: **rc=0**, every suite green (bare `make check` stops at `plan-test` only because `tofu` is off `PATH`, which the repo's own message names). `ansible-playbook --syntax-check` on `bao/service/site.yml` at head: parses. - CI at the reviewed head: `pr-checks / check (pull_request)` success (48s) and `plan / guest-plan-check (pull_request_target)` success (22s). - The body's sibling citations, read at each sibling's live `origin/main`: infra-silo — two roles carry it; infra-tracker — `unattended_upgrades` and `vikunja`. "Two files, four lines each" holds, and the recap arithmetic is consistent (`ok=60 changed=2` → `ok=60 changed=0`): a changed task also counts in `ok`, which the probe's own recap shows (`ok=3 changed=1` over three tasks). ## Could not verify - The live PROD rehearsal (`make service-check` against Guest 144): there is no `.env` in the clone or in the head worktree, and an agent does not fetch its own environment (`docs/env-fetch.md`; infra-silo `AGENTS.md` §Environment states the refusal). The whole-play `changed=0` therefore rests on three reads that compose: the ticket's independent baseline recap (`changed=2`), a diff that changes only those two tasks, and the probe's task-level red/green above. ## Named, not charged - A **real** (non-check) run no longer reports the cache refresh as `changed`. The ticket orders exactly this and the body's Merge Danger names it ("the one thing no longer reported is the cache refresh itself"); nothing in the repo consumes the service deploy's changed total — `docs/deploy.md:109`'s `changed=0` refers to `make service-check`, a `--check` run. - Ticket step 4 (the 03:15Z audit reading `clean`) is a later actor's evidence. - The two roles each carry their own copy of the refresh task and its comment. That duplication predates this diff and a shared task file is a larger change than the ticket asks for. ## Summary Standards: 0 findings (worst: none). Spec: 0 findings (worst: none). 0 BLOCKER, 0 ADVISORY — the recommendation is **merge**; state APPROVED, label `review/merge-ready`.
pit merged commit 432c320c0c into main 2026-12-04 07:11:42 +00:00
pit deleted branch hermes/136-apt-cache-changed-when 2026-12-04 07:11:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/infra-secrets!71
No description provided.