agent-compose Compose task reports changed on every run (no changed_when) #230

Closed
opened 2026-06-05 20:20:08 +00:00 by coilysiren · 1 comment
Owner

Problem

The agent-compose : Compose COMPOSED.md and converge harness symlinks task in roles/agent-compose reports changed on every run, even when the composed output is byte-identical to what's already on disk. It's a command-style task with no changed_when guard, so Ansible always classifies it as changed.

Observed during a freshness sweep on the Kapwing laptop: after a clean action=apply tags=agent-compose,claude-hooks, an immediate idempotent re-check still reported:

TASK [agent-compose : Compose COMPOSED.md and converge harness symlinks]
changed: [localhost]

PLAY RECAP
localhost : ok=9 changed=1 failed=0

Impact

  • ansible-freshen check mode will always show this task as drift, so the default check run never reads as a true no-op. That erodes the signal of the check-mode preview - real drift hides behind permanent noise.
  • Cosmetic only at runtime (the composed output is identical each run), but it defeats idempotency, which is the point of the converge step.

Suggested fix

Add a changed_when to the compose task driven by whether the composer actually rewrote COMPOSED.md / the load points. Options:

  • Have the composer emit a machine-readable "did I change anything" signal (exit code or stdout marker) and gate changed_when on it.
  • Or hash the relevant outputs before/after and set changed_when on the diff.

Goal: a converged host runs ansible-freshen tags=agent-compose as changed=0.

Same class of check-mode-fidelity wart as the ansible_env.HOME -> ansible_facts deprecation warnings across the roles, and #229 (check mode aborting on tap+formula migrations). Could be folded into a single roles-housekeeping pass.

Found on kais-macbook-pro (Kapwing host) on 2026-06-05.

## Problem The `agent-compose : Compose COMPOSED.md and converge harness symlinks` task in `roles/agent-compose` reports `changed` on **every** run, even when the composed output is byte-identical to what's already on disk. It's a command-style task with no `changed_when` guard, so Ansible always classifies it as changed. Observed during a freshness sweep on the Kapwing laptop: after a clean `action=apply tags=agent-compose,claude-hooks`, an immediate idempotent re-check still reported: ``` TASK [agent-compose : Compose COMPOSED.md and converge harness symlinks] changed: [localhost] PLAY RECAP localhost : ok=9 changed=1 failed=0 ``` ## Impact - `ansible-freshen` check mode will **always** show this task as drift, so the default check run never reads as a true no-op. That erodes the signal of the check-mode preview - real drift hides behind permanent noise. - Cosmetic only at runtime (the composed output is identical each run), but it defeats idempotency, which is the point of the converge step. ## Suggested fix Add a `changed_when` to the compose task driven by whether the composer actually rewrote `COMPOSED.md` / the load points. Options: - Have the composer emit a machine-readable "did I change anything" signal (exit code or stdout marker) and gate `changed_when` on it. - Or hash the relevant outputs before/after and set `changed_when` on the diff. Goal: a converged host runs `ansible-freshen tags=agent-compose` as `changed=0`. ## Related Same class of check-mode-fidelity wart as the `ansible_env.HOME` -> `ansible_facts` deprecation warnings across the roles, and #229 (check mode aborting on tap+formula migrations). Could be folded into a single roles-housekeeping pass. Found on kais-macbook-pro (Kapwing host) on 2026-06-05.
Author
Owner

Mis-scoped. The root cause is in agent-compose itself - it rewrites COMPOSED.md and re-links the harness symlinks unconditionally, emitting the wrote /linked markers on every run, not in the ansible role's changed_when. The role's changed_when is correct once those markers only fire on real changes, so no role change is needed.

Re-filed against the right repo as coilyco-flight-deck/agentic-os#177. Closing.

Mis-scoped. The root cause is in agent-compose itself - it rewrites `COMPOSED.md` and re-links the harness symlinks unconditionally, emitting the `wrote `/`linked ` markers on every run, not in the ansible role's `changed_when`. The role's `changed_when` is correct once those markers only fire on real changes, so no role change is needed. Re-filed against the right repo as coilyco-flight-deck/agentic-os#177. Closing.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
coilyco-flight-deck/infrastructure#230
No description provided.