The apt cache refresh is preparation, not a change (THE-125) #117

Merged
pit merged 1 commit from hermes/THE-125-apt-cache-no-drift into main 2026-12-03 06:38:05 +00:00
Owner

paperclip:THE-125

Summary

THE-125 is the drift report's repeating row for infra-forge's forgejo 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: [forgejo]
TASK [forgejo : refresh the apt cache before the first install]
changed: [forgejo]

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, one line each:

 - name: refresh the apt cache before the first install
   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.

Evidence

Before — main at 59d427c (the scheduled run and THE-125's rehearsal) After — this branch at b1451f9
forgejo : ok=49 changed=2 unreachable=0 failed=0 skipped=13 forgejo : ok=49 changed=0 unreachable=0 failed=0 skipped=13
both refresh tasks changed: [forgejo] both refresh tasks ok: [forgejo]

Both runs are mise exec -- make service-check against PROD with the same play; the branch run is from the Hermes host, with ACTOR=hermes make env and the fleet key, exit 0.

The Guest's /var/lib/apt/lists read 2026-12-02 21:52:10 +0000 — 7h43m old at the after-run — 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 lines 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 forge's 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).

Refs: THE-125

paperclip:THE-125 ## Summary [THE-125](https://paperclip.thepit.space/THE/issues/THE-125) is the drift report's repeating row for `infra-forge`'s forgejo 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: [forgejo] TASK [forgejo : refresh the apt cache before the first install] changed: [forgejo] ``` 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, one line each: ```diff - name: refresh the apt cache before the first install 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. ## Evidence | Before — `main` at `59d427c` (the scheduled run and THE-125's rehearsal) | After — this branch at `b1451f9` | | --- | --- | | `forgejo : ok=49 changed=2 unreachable=0 failed=0 skipped=13` | `forgejo : ok=49 changed=0 unreachable=0 failed=0 skipped=13` | | both refresh tasks `changed: [forgejo]` | both refresh tasks `ok: [forgejo]` | Both runs are `mise exec -- make service-check` against PROD with the same play; the branch run is from the Hermes host, with `ACTOR=hermes make env` and the fleet key, exit 0. The Guest's `/var/lib/apt/lists` read `2026-12-02 21:52:10 +0000` — 7h43m old at the after-run — 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 lines 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 forge's 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). Refs: THE-125
The apt cache refresh is preparation, not a change (THE-125)
All checks were successful
plan / edge-plan-check (pull_request_target) Successful in 19s
pr-checks / env-check (pull_request) Successful in 19s
plan / runner-guest-plan-check (pull_request_target) Successful in 21s
pr-checks / fmt-check (pull_request) Successful in 17s
pr-checks / validate (pull_request) Successful in 22s
pr-checks / docs-check (pull_request) Successful in 15s
plan / guest-plan-check (pull_request_target) Successful in 21s
pr-checks / syntax-check (pull_request) Successful in 16s
b1451f94d6
Under `--check` the apt module skips the cache update and still answers
`changed` whenever the cache is older than `cache_valid_time`, so the daily
rehearsal of the forge's service layer reported drift as soon as the cache
passed an hour old. The refresh is a precondition for the installs below, and
those tasks are what name a package that moved; these two report no change of
their own.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
Author
Owner

Waiting — queued behind olympus/infra-forge#116 (one review run at a time). The review run resumes on its own at Thu 3 Dec, 06:38 (Europe/Madrid); nothing is needed from you. This retry does not count as a review round.

**Waiting** — queued behind olympus/infra-forge#116 (one review run at a time). The review run resumes on its own at Thu 3 Dec, 06:38 (Europe/Madrid); nothing is needed from you. This retry does not count as a review round.
Member

Review started (round 0/5) on b1451f94d6 — reading the diff now.

**Review started** (round 0/5) on b1451f94d6cccb66cfa20d28e01095dcdd8440a9 — reading the diff now.
bot-minos approved these changes 2026-12-03 05:54:25 +00:00
bot-minos left a comment

olympus/infra-forge #117 — head b1451f9 — round 1/5 — verdict: merge

Recommendation: merge

Round count: the review list was empty when this round opened, so this is the thread's first review (1/5). The sign-on line's "round 0/5" is the dispatch's own counter, which restarts when a label is moved by hand.

Fixed point. refs/pull/117/head resolved to b1451f94d6cccb66cfa20d28e01095dcdd8440a9 (equals the dispatch's SHA). Delta reviewed: git diff 59d427c...b1451f9 — one commit, two files, 12 added lines, 0 removed.

Spec. paperclip:THE-125, fetched live from the Paperclip control plane (GET /api/issues/THE-125 → 200, 14,254 bytes; documents endpoint → 200, 2 bytes, empty), status in_review. Its "What to do" is the contract:

  1. "Add changed_when: false to both refresh tasks, with the reason in a comment beside them."
  2. "Re-run make service-check and confirm changed=0 failed=0."
  3. "The next scheduled run at 03:15Z should read clean."

Standards. AGENTS.md (head) — §Code comments, §Secrets, §State, §Privacy, §Toolchain; docs/agents/issue-tracker.md; docs/adr/index.md (10 records) plus olympus/workshop's org ADRs; GLOSSARY.md.

Standards

No findings.

  • The paperclip:THE-125 reference is not the FO-<n> / SL-<n> form AGENTS.md §Pull requests names, but the org record every olympus repo defers to (olympus/workshop AGENTS.md §Issue tracker) names paperclip:<KEY>-<n> as the citation for company work, and this ticket is a drift incident born on the company board. The local doc is silent on that route rather than forbidding it.
  • AGENTS.md §Code comments asks for comments kept to a minimum. The 5-line rationale block is required by the ticket ("with the reason in a comment beside them") and matches the repo's own practice above non-obvious tasks (forgejo/service/roles/forgejo_mcp/tasks/main.yml:34-38; the same refresh task in the forgejo role already carried a four-line comment). Considered, cleared.
  • No secret, no state path, no identity literal, and no ADR-governed surface is touched.

Spec

No findings.

  • Requirement 1 — met at forgejo/service/roles/forgejo/tasks/main.yml:34 and forgejo/service/roles/unattended_upgrades/tasks/main.yml:19, each with the reason directly above the task (:23-30 and :11-15).
  • Requirement 2 — the body's evidence table (changed=2 → changed=0, ok=49 unchanged on both sides) is arithmetically sound: Ansible's recap counts a changed task in ok as well, which I reproduced locally (ok=3 changed=1 over three tasks). The live run itself I could not repeat from this session; see Could not verify.
  • Requirement 3 — a prediction about a future scheduled run; not observable at review time.
  • Scope is right-sized: the census of update_cache: true in the forgejo service play finds five sites, and the other three all name a package (forgejo_mcp/tasks/main.yml:37, firewall/tasks/main.yml:9, and the install tasks), so the module's no-package early exit never fires for them and they never report the refresh. "Both refresh tasks" is exactly the two that did.

Verified

Check Result
git ls-remote origin refs/pull/117/head b1451f9… — equals the reviewed SHA
apt-check-mode-changed-probe.sh (shipped probe, live run) PASS ×3 — base shape changed, changed_when: false shape ok, sibling named-package shape ok; cache age 7.7 M s, well past cache_valid_time
Pinned module source, ansible-core 2.21.5 modules/apt.py:1457-1495 check mode skips cache.update() and still sets updated_cache = True when the cache is stale; with no package/upgrade/deb it exits changed=updated_cache
Own probe: does changed_when: false stop the task running? No — the task wrote its file while reporting ok (recap ok=3 changed=0, target file present). The refresh still happens; only the status is suppressed
mise exec -- make check at head rc=0
ansible-playbook --syntax-check for both plays at head rc=0 each, with the collection path supplied (the first attempt failed on community.postgresql not installed in this checkout — an environment gap at line 98, not the diff)
CI statuses at b1451f9 (get_commit_statuses) pr-checks /{env-check,fmt-check,validate,syntax-check,docs-check} all success; plan /{guest,edge,runner-guest}-plan-check all success
notify / register on the two changed tasks none — suppressing changed cannot drop a handler or change a downstream decision

Charter scope: no OpenTofu changes, so no plan/judge movement; no destroy or replace; no ADR, branch-protection, CI-gate, or tier-1 change. The change edits the forgejo service layer's reporting only and applies nothing, so no escalation class moved.

Could not verify

  • The live make service-check before/after counts on PROD. It needs the fetched environment and a Guest key, and this profile holds neither: no .env in the checkout (ls → No such file or directory), ssh-add -l → The agent has no identities, and the profile .env carries no store credential. I substituted the offline mechanism probe, the module source, and make check — all above — rather than the live run. The ticket's own 03:15Z audit row is the live confirmation.

Named, not charged

  • runner/service/roles/unattended_upgrades/tasks/main.yml:10-13 and runner/service/roles/runner/tasks/main.yml:24-31 carry the identical refresh-only task without the line. make runner-service-check rehearses that layer, so it will report the same changed=2 artefact the day it is audited. Pre-existing, untouched by this diff, and outside THE-125's scope (the ticket names the forgejo layer's two tasks) — a follow-up ticket, not this PR's work.
  • The 12 comment lines are duplicated near-verbatim across the two roles. That is the ticket's instruction and the repo's per-role idiom; Ansible roles do not share prose.

Summary

  • Standards: 0 findings (0 blockers, 0 advisories).
  • Spec: 0 findings (0 blockers, 0 advisories).
  • Worst finding per axis: none on either axis. Both requirements that are observable at this revision are met at the cited lines, and the mechanism is reproduced.
<!-- minos review-loop: repo=olympus/infra-forge pr=117 head=b1451f94d6cccb66cfa20d28e01095dcdd8440a9 round=1/5 axes=standards,spec --> **olympus/infra-forge #117** — head `b1451f9` — **round 1/5** — verdict: **merge** Recommendation: merge Round count: the review list was empty when this round opened, so this is the thread's first review (`1/5`). The sign-on line's "round 0/5" is the dispatch's own counter, which restarts when a label is moved by hand. **Fixed point.** `refs/pull/117/head` resolved to `b1451f94d6cccb66cfa20d28e01095dcdd8440a9` (equals the dispatch's SHA). Delta reviewed: `git diff 59d427c...b1451f9` — one commit, two files, 12 added lines, 0 removed. **Spec.** `paperclip:THE-125`, fetched live from the Paperclip control plane (`GET /api/issues/THE-125` → `200`, 14,254 bytes; documents endpoint → `200`, 2 bytes, empty), status `in_review`. Its "What to do" is the contract: 1. *"Add `changed_when: false` to both refresh tasks, with the reason in a comment beside them."* 2. *"Re-run `make service-check` and confirm `changed=0 failed=0`."* 3. *"The next scheduled run at 03:15Z should read `clean`."* **Standards.** `AGENTS.md` (head) — §Code comments, §Secrets, §State, §Privacy, §Toolchain; `docs/agents/issue-tracker.md`; `docs/adr/index.md` (10 records) plus `olympus/workshop`'s org ADRs; `GLOSSARY.md`. ## Standards No findings. - The `paperclip:THE-125` reference is not the `FO-<n>` / `SL-<n>` form `AGENTS.md` §Pull requests names, but the org record every olympus repo defers to (`olympus/workshop` `AGENTS.md` §Issue tracker) names `paperclip:<KEY>-<n>` as the citation for company work, and this ticket is a drift incident born on the company board. The local doc is silent on that route rather than forbidding it. - `AGENTS.md` §Code comments asks for comments kept to a minimum. The 5-line rationale block is required by the ticket ("with the reason in a comment beside them") and matches the repo's own practice above non-obvious tasks (`forgejo/service/roles/forgejo_mcp/tasks/main.yml:34-38`; the same refresh task in the `forgejo` role already carried a four-line comment). Considered, cleared. - No secret, no state path, no identity literal, and no ADR-governed surface is touched. ## Spec No findings. - Requirement 1 — met at `forgejo/service/roles/forgejo/tasks/main.yml:34` and `forgejo/service/roles/unattended_upgrades/tasks/main.yml:19`, each with the reason directly above the task (`:23-30` and `:11-15`). - Requirement 2 — the body's evidence table (`changed=2` → `changed=0`, `ok=49` unchanged on both sides) is arithmetically sound: Ansible's recap counts a changed task in `ok` as well, which I reproduced locally (`ok=3 changed=1` over three tasks). The live run itself I could not repeat from this session; see *Could not verify*. - Requirement 3 — a prediction about a future scheduled run; not observable at review time. - Scope is right-sized: the census of `update_cache: true` in the forgejo service play finds five sites, and the other three all name a package (`forgejo_mcp/tasks/main.yml:37`, `firewall/tasks/main.yml:9`, and the install tasks), so the module's no-package early exit never fires for them and they never report the refresh. "Both refresh tasks" is exactly the two that did. ## Verified | Check | Result | | --- | --- | | `git ls-remote origin refs/pull/117/head` | `b1451f9…` — equals the reviewed SHA | | `apt-check-mode-changed-probe.sh` (shipped probe, live run) | PASS ×3 — base shape `changed`, `changed_when: false` shape `ok`, sibling named-package shape `ok`; cache age 7.7 M s, well past `cache_valid_time` | | Pinned module source, `ansible-core 2.21.5` `modules/apt.py:1457-1495` | check mode skips `cache.update()` and still sets `updated_cache = True` when the cache is stale; with no package/upgrade/deb it exits `changed=updated_cache` | | Own probe: does `changed_when: false` stop the task running? | No — the task wrote its file while reporting `ok` (`recap ok=3 changed=0`, target file present). The refresh still happens; only the status is suppressed | | `mise exec -- make check` at head | `rc=0` | | `ansible-playbook --syntax-check` for both plays at head | `rc=0` each, with the collection path supplied (the first attempt failed on `community.postgresql` not installed in this checkout — an environment gap at line 98, not the diff) | | CI statuses at `b1451f9` (`get_commit_statuses`) | `pr-checks /`{`env-check`,`fmt-check`,`validate`,`syntax-check`,`docs-check`} all `success`; `plan /`{`guest`,`edge`,`runner-guest`}`-plan-check` all `success` | | `notify` / `register` on the two changed tasks | none — suppressing `changed` cannot drop a handler or change a downstream decision | Charter scope: no OpenTofu changes, so no plan/judge movement; no destroy or replace; no ADR, branch-protection, CI-gate, or tier-1 change. The change edits the forgejo service layer's *reporting* only and applies nothing, so no escalation class moved. ## Could not verify - **The live `make service-check` before/after counts on PROD.** It needs the fetched environment and a Guest key, and this profile holds neither: no `.env` in the checkout (`ls` → *No such file or directory*), `ssh-add -l` → *The agent has no identities*, and the profile `.env` carries no store credential. I substituted the offline mechanism probe, the module source, and `make check` — all above — rather than the live run. The ticket's own 03:15Z audit row is the live confirmation. ## Named, not charged - `runner/service/roles/unattended_upgrades/tasks/main.yml:10-13` and `runner/service/roles/runner/tasks/main.yml:24-31` carry the identical refresh-only task without the line. `make runner-service-check` rehearses that layer, so it will report the same `changed=2` artefact the day it is audited. Pre-existing, untouched by this diff, and outside THE-125's scope (the ticket names the forgejo layer's two tasks) — a follow-up ticket, not this PR's work. - The 12 comment lines are duplicated near-verbatim across the two roles. That is the ticket's instruction and the repo's per-role idiom; Ansible roles do not share prose. ## Summary - **Standards:** 0 findings (0 blockers, 0 advisories). - **Spec:** 0 findings (0 blockers, 0 advisories). - Worst finding per axis: none on either axis. Both requirements that are observable at this revision are met at the cited lines, and the mechanism is reproduced.
pit merged commit 624e2cb9f9 into main 2026-12-03 06:38:05 +00:00
pit deleted branch hermes/THE-125-apt-cache-no-drift 2026-12-03 06:38:05 +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-forge!117
No description provided.