The apt cache refresh is preparation, not a change (THE-116) #66

Merged
pit merged 1 commit from hermes/THE-116-apt-cache-refresh-not-a-change into main 2026-12-02 10:55:03 +00:00
Owner

paperclip:THE-116

Summary

THE-116 is the drift report's one repeating row: infra-tracker's service layer rehearses with changed=1 on every daily run, so the row hides the next real difference behind noise. The changed task is the first one in the play.

TASK [vikunja : refresh the apt cache before the first install]
changed: [vikunja]            <- once the cache is older than cache_valid_time

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, if module.check_mode or updated_cache_time != post_cache_update_time). A daily run is always past the hour, so the row reads drift every day.

vikunja/service/roles/vikunja/tasks/main.yml, one line:

 - 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 install below, and that task still reports a package that moved. The rehearsal now reads ok on it.

Not covered here: the Suite proves an apply is idempotent (Converge 2/3 changed=0) and never runs the rehearsal, so this class of artefact had no test of its own. A --check leg in container/suite.sh is a separate call.

Evidence

Before — main at c55be75 After — this branch at 67dc852
TASK [vikunja : refresh the apt cache before the first install] changed: [vikunja] same task, ok: [vikunja]
vikunja : ok=22 changed=1 unreachable=0 failed=0 vikunja : ok=22 changed=0 unreachable=0 failed=0

Both runs are mise exec -- make service-check on runner 145 as the runner actor (ACTOR=runner make env), each from a fresh shallow clone, exit 0.

The Guest's apt cache read 2026-12-01 20:52:38 +0000 (/var/lib/apt/lists, the file the module stats when no update-success stamp exists) — 13h53m old at the after-run — so the suppression, not a fresh cache, is what made the task ok.

mise exec -- make check on a fresh clone at 67dc852: exit 0 (env check and its tests, the plan/gate/deploy tests, tofu fmt -check, both Stacks, the Test Stack and the Edge's tests).

Merge Danger

Door: two-way. One line in one task; 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 service rehearsal and of a deploy's --check run. A deploy still installs what moved: install the service's dependencies is the task that reports 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-116

paperclip:THE-116 ## Summary [THE-116](https://paperclip.thepit.space/THE/issues/THE-116) is the drift report's one repeating row: `infra-tracker`'s service layer rehearses with `changed=1` on every daily run, so the row hides the next real difference behind noise. The changed task is the first one in the play. ```text TASK [vikunja : refresh the apt cache before the first install] changed: [vikunja] <- once the cache is older than cache_valid_time ``` 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`, `if module.check_mode or updated_cache_time != post_cache_update_time`). A daily run is always past the hour, so the row reads `drift` every day. `vikunja/service/roles/vikunja/tasks/main.yml`, one line: ```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 install below, and that task still reports a package that moved. The rehearsal now reads `ok` on it. Not covered here: the Suite proves an apply is idempotent (`Converge 2/3 changed=0`) and never runs the rehearsal, so this class of artefact had no test of its own. A `--check` leg in `container/suite.sh` is a separate call. ## Evidence | Before — `main` at `c55be75` | After — this branch at `67dc852` | | --- | --- | | `TASK [vikunja : refresh the apt cache before the first install]` `changed: [vikunja]` | same task, `ok: [vikunja]` | | `vikunja : ok=22 changed=1 unreachable=0 failed=0` | `vikunja : ok=22 changed=0 unreachable=0 failed=0` | Both runs are `mise exec -- make service-check` on runner 145 as the `runner` actor (`ACTOR=runner make env`), each from a fresh shallow clone, exit 0. The Guest's apt cache read `2026-12-01 20:52:38 +0000` (`/var/lib/apt/lists`, the file the module stats when no update-success stamp exists) — 13h53m old at the after-run — so the suppression, not a fresh cache, is what made the task `ok`. `mise exec -- make check` on a fresh clone at `67dc852`: exit 0 (env check and its tests, the plan/gate/deploy tests, `tofu fmt -check`, both Stacks, the Test Stack and the Edge's tests). ## Merge Danger **Door:** two-way. One line in one task; 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 service rehearsal and of a deploy's `--check` run. A deploy still installs what moved: `install the service's dependencies` is the task that reports 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-116
The apt cache refresh is preparation, not a change (THE-116)
All checks were successful
plan / guest-plan-check (pull_request_target) Successful in 7s
plan / edge-plan-check (pull_request_target) Successful in 8s
checks / static (pull_request) Successful in 29s
checks / execute (pull_request) Successful in 2m52s
67dc852292
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 service layer reported drift as soon as the cache passed an
hour old. The refresh is a precondition for the install below, and that task is
what names a package that moved; this one reports no change of its own.

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

Review started (round 1/5) on 67dc852292 — reading the diff now.

**Review started** (round 1/5) on 67dc8522928933beab2b84936bcc5b38de58db4a — reading the diff now.
bot-minos approved these changes 2026-12-02 10:50:29 +00:00
bot-minos left a comment

olympus/infra-tracker#66 · head 67dc852 · round 1/5 · axes: standards, spec · base c55be75

Recommendation: merge

The dispatch numbered this round 1/5 and the thread agrees: list_pull_reviews answered [], so this is the first review on this head.

Standards

Conventions read at the reviewed head (67dc852): AGENTS.md, .agents/skills/pr/SKILL.md, docs/adr/0001…0005, docs/agents/issue-tracker.md, plus the org records in olympus/workshop — git ls-tree origin/main docs/adr/ lists sixteen (0001–0015 + index), all read at origin/main, not from the clone's older checkout.

No findings.

  • PR-body contract — .agents/skills/pr/SKILL.md §template asks for ## Summary, ## Evidence, ## Merge Danger (Door / Blast Radius). The body carries all three, with the evidence as a before/after table.
  • Citation convention — olympus/workshop AGENTS.md §Agent skills / Issue tracker: a task is cited as <tracker>:<ref>, never as a bare number. The body opens with paperclip:THE-116 and closes with Refs: THE-116. Compliant.
  • Change in file convention — vikunja/service/roles/vikunja/tasks/main.yml already carries changed_when: false with a rationale comment on its non-mutating tasks, at lines 82, 92, 161, 171, 296. The new line (main.yml:11-15) is the same shape: a preparation task that states why it reports nothing. The six-line comment at main.yml:5-10 explains behaviour no reader can infer from the task (check mode lies about changed), which is what the file's other comments do.
  • ADRs not engaged — no state object, store credential, secret, destroy/replace or deploy-path change (olympus/workshop 0004, 0009, 0011 untouched). No olympus/workshop escalation class applies: one Ansible task's reporting on a non-tier-1 service; no ADR, branch-protection or CI-gate file in the diff.

Spec

Spec source: paperclip:THE-116 — "Drift: infra-tracker — vikunja service layer reports changed=1 on every drift run (apt cache)", read live 2026-12-02 10:46Z through the Paperclip control plane (scripts/fetch-paperclip-issue.sh, 200; comments via fetch-paperclip-comments.py, 200, 1 entry). The PR body names the same ticket and adds the mechanism.

No findings. The ticket's three steps:

  1. "Reproduce on the runner as the runner actor: make service-check in vikunja/service; the recap names the changed task." — the author's evidence table does this (runner 145, ACTOR=runner make env, fresh shallow clone): ok=22 changed=1 before, ok=22 changed=0 after. Not reproducible from this host; see Could not verify.
  2. "make the rehearsal idempotent — a task that refreshes the cache without reporting a change (changed_when: false), or let the dependency-install task own the refresh." — implemented at main.yml:15 (changed_when: false), the first of the two remedies the ticket names. The install task at main.yml:17-25 still reports a package that moved, which is the property the ticket's second remedy exists to preserve.
  3. "Re-run and confirm the row reads clean (changed=0 failed=0)." — the drift reader sums changed= over the recap and answers clean at 0, drift above it (infra-cockpit scripts/drift-lib.sh:115-136 at origin/main d64dfb1). At changed=0 the row is clean; nothing else in the audit's ansible branch reads this task (scripts/drift.sh runs play vikunja "$dir" service-check).

The mechanism the body asserts is the module's own, at the version the repo pins (mise.toml → pypi:ansible-core = "2.21.5"): in check mode cache.update() is skipped (apt.py:1460) and updated_cache is set anyway (apt.py:1485-1486, if module.check_mode or updated_cache_time != post_cache_update_time). The body's parenthetical about /var/lib/apt/lists is also right: get_cache_mtime() stats APT_UPDATE_SUCCESS_STAMP_PATH first and falls back to APT_LISTS_PATH.

Verified

Probe Result
git ls-remote origin refs/pull/66/head vs the dispatch's SHA both 67dc8522928933beab2b84936bcc5b38de58db4a
git diff c55be75...67dc852 --stat one file, +7/−0 — vikunja/service/roles/vikunja/tasks/main.yml
base task (c55be75), --check, reviewer host whose apt lists are 89 days old changed: [localhost], ok=1 changed=1
head task (67dc852), same fixture, same host ok: [localhost], ok=1 changed=0
mise exec -- make check at head rc 0 (env pin, its tests, plan/gate/deploy tests, tofu fmt -check, three Stacks, Test Stack + Edge tests)
CI run 150 checks / static @ 67dc852 success, 29s
CI run 150 checks / execute (the Suite on a real Test Guest) success, 2m52s — three converges, TASK [vikunja : refresh the apt cache before the first install] → ok: [vikunja] each time; recaps changed=18, changed=0, changed=0
CI run 149 plan / guest-plan-check, plan / edge-plan-check both success
branch protection, live four required contexts, all green at this head

The red/green pair in rows 3–4 is the claim driven end to end: same task text, same host, same stale cache — the base reports a change in check mode, the head does not. Rows 6–8 are the four required contexts the merge gate reads, all green at the reviewed head.

Could not verify

  • The PR's runner-145 run itself (ok=22 changed=1 → ok=22 changed=0). This host has no SSH path to the runner (.145) or the Guest (.142) — root@10.12.0.143 answers Permission denied (publickey) — and make env ACTOR=runner is refused to a regular agent (AGENTS.md §Environment). THE-116's own comment records the same refusal for the drift agent. Covered instead by the module source, the local check-mode pair above, and CI's Suite log.

Named, not charged

  • No --check leg exists in the Suite (container/suite.sh never passes --check) — the PR body discloses this under Not covered here and calls it a separate change. Not this change's to make, and the ticket does not ask for it.
  • The same task recurs in four sibling repositories the same drift audit reads — infra-forge (3 sites: forgejo, runner, and two unattended_upgrades), infra-cockpit (2), infra-secrets (1), infra-silo (1) — none of them carrying the line at origin/main today. Each is another repository's ticket; charged to nobody here, named so the next drift ticket starts from a census rather than a fresh hunt.

Counts — Standards: 0 findings (worst: none). Spec: 0 findings (worst: none). Zero blockers, zero advisories, so nothing trips the volume rule; the recommendation is merge.

<!-- minos review-loop: repo=olympus/infra-tracker pr=66 head=67dc8522928933beab2b84936bcc5b38de58db4a round=1/5 axes=standards,spec --> **olympus/infra-tracker#66** · head `67dc852` · round **1/5** · axes: standards, spec · base `c55be75` Recommendation: merge The dispatch numbered this round 1/5 and the thread agrees: `list_pull_reviews` answered `[]`, so this is the first review on this head. ## Standards Conventions read at the reviewed head (`67dc852`): `AGENTS.md`, `.agents/skills/pr/SKILL.md`, `docs/adr/0001…0005`, `docs/agents/issue-tracker.md`, plus the org records in `olympus/workshop` — `git ls-tree origin/main docs/adr/` lists sixteen (`0001`–`0015` + `index`), all read at `origin/main`, not from the clone's older checkout. No findings. - **PR-body contract** — `.agents/skills/pr/SKILL.md` §template asks for `## Summary`, `## Evidence`, `## Merge Danger` (Door / Blast Radius). The body carries all three, with the evidence as a before/after table. - **Citation convention** — `olympus/workshop` `AGENTS.md` §Agent skills / Issue tracker: a task is cited as `<tracker>:<ref>`, never as a bare number. The body opens with `paperclip:THE-116` and closes with `Refs: THE-116`. Compliant. - **Change in file convention** — `vikunja/service/roles/vikunja/tasks/main.yml` already carries `changed_when: false` with a rationale comment on its non-mutating tasks, at lines 82, 92, 161, 171, 296. The new line (`main.yml:11-15`) is the same shape: a preparation task that states why it reports nothing. The six-line comment at `main.yml:5-10` explains behaviour no reader can infer from the task (check mode lies about `changed`), which is what the file's other comments do. - **ADRs not engaged** — no state object, store credential, secret, destroy/replace or deploy-path change (`olympus/workshop` `0004`, `0009`, `0011` untouched). No `olympus/workshop` escalation class applies: one Ansible task's reporting on a non-tier-1 service; no ADR, branch-protection or CI-gate file in the diff. ## Spec Spec source: `paperclip:THE-116` — *"Drift: infra-tracker — vikunja service layer reports changed=1 on every drift run (apt cache)"*, read live 2026-12-02 10:46Z through the Paperclip control plane (`scripts/fetch-paperclip-issue.sh`, 200; comments via `fetch-paperclip-comments.py`, 200, 1 entry). The PR body names the same ticket and adds the mechanism. No findings. The ticket's three steps: 1. *"Reproduce on the runner as the `runner` actor: `make service-check` in `vikunja/service`; the recap names the changed task."* — the author's evidence table does this (runner 145, `ACTOR=runner make env`, fresh shallow clone): `ok=22 changed=1` before, `ok=22 changed=0` after. Not reproducible from this host; see *Could not verify*. 2. *"make the rehearsal idempotent — a task that refreshes the cache without reporting a change (`changed_when: false`), or let the dependency-install task own the refresh."* — implemented at `main.yml:15` (`changed_when: false`), the first of the two remedies the ticket names. The install task at `main.yml:17-25` still reports a package that moved, which is the property the ticket's second remedy exists to preserve. 3. *"Re-run and confirm the row reads `clean` (`changed=0 failed=0`)."* — the drift reader sums `changed=` over the recap and answers `clean` at 0, `drift` above it (`infra-cockpit` `scripts/drift-lib.sh:115-136` at `origin/main` `d64dfb1`). At `changed=0` the row is clean; nothing else in the audit's ansible branch reads this task (`scripts/drift.sh` runs `play vikunja "$dir" service-check`). The mechanism the body asserts is the module's own, at the version the repo pins (`mise.toml` → `pypi:ansible-core = "2.21.5"`): in check mode `cache.update()` is skipped (`apt.py:1460`) and `updated_cache` is set anyway (`apt.py:1485-1486`, `if module.check_mode or updated_cache_time != post_cache_update_time`). The body's parenthetical about `/var/lib/apt/lists` is also right: `get_cache_mtime()` stats `APT_UPDATE_SUCCESS_STAMP_PATH` first and falls back to `APT_LISTS_PATH`. ## Verified | Probe | Result | | --- | --- | | `git ls-remote origin refs/pull/66/head` vs the dispatch's SHA | both `67dc8522928933beab2b84936bcc5b38de58db4a` | | `git diff c55be75...67dc852 --stat` | one file, +7/−0 — `vikunja/service/roles/vikunja/tasks/main.yml` | | base task (`c55be75`), `--check`, reviewer host whose apt lists are 89 days old | `changed: [localhost]`, `ok=1 changed=1` | | head task (`67dc852`), same fixture, same host | `ok: [localhost]`, `ok=1 changed=0` | | `mise exec -- make check` at head | rc 0 (env pin, its tests, plan/gate/deploy tests, `tofu fmt -check`, three Stacks, Test Stack + Edge tests) | | CI run 150 `checks / static` @ `67dc852` | success, 29s | | CI run 150 `checks / execute` (the Suite on a real Test Guest) | success, 2m52s — three converges, `TASK [vikunja : refresh the apt cache before the first install]` → `ok: [vikunja]` each time; recaps `changed=18`, `changed=0`, `changed=0` | | CI run 149 `plan / guest-plan-check`, `plan / edge-plan-check` | both success | | branch protection, live | four required contexts, all green at this head | The red/green pair in rows 3–4 is the claim driven end to end: same task text, same host, same stale cache — the base reports a change in check mode, the head does not. Rows 6–8 are the four required contexts the merge gate reads, all green at the reviewed head. ## Could not verify - **The PR's runner-145 run itself** (`ok=22 changed=1` → `ok=22 changed=0`). This host has no SSH path to the runner (`.145`) or the Guest (`.142`) — `root@10.12.0.143` answers `Permission denied (publickey)` — and `make env ACTOR=runner` is refused to a regular agent (`AGENTS.md` §Environment). THE-116's own comment records the same refusal for the drift agent. Covered instead by the module source, the local check-mode pair above, and CI's Suite log. ## Named, not charged - **No `--check` leg exists in the Suite** (`container/suite.sh` never passes `--check`) — the PR body discloses this under *Not covered here* and calls it a separate change. Not this change's to make, and the ticket does not ask for it. - **The same task recurs in four sibling repositories the same drift audit reads** — `infra-forge` (3 sites: `forgejo`, `runner`, and two `unattended_upgrades`), `infra-cockpit` (2), `infra-secrets` (1), `infra-silo` (1) — none of them carrying the line at `origin/main` today. Each is another repository's ticket; charged to nobody here, named so the next drift ticket starts from a census rather than a fresh hunt. --- **Counts** — Standards: 0 findings (worst: none). Spec: 0 findings (worst: none). Zero blockers, zero advisories, so nothing trips the volume rule; the recommendation is **merge**.
pit merged commit 0b82bf8a80 into main 2026-12-02 10:55:03 +00:00
pit deleted branch hermes/THE-116-apt-cache-refresh-not-a-change 2026-12-02 10:55:04 +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-tracker!66
No description provided.