# Cleanup depends on the feature it is cleaning up after ## The issue Start-up reconciliation for stray `hh-*` outputs lives inside the container host, so it runs **only when containers are enabled**. Turning containers off therefore also turned off the broker's ability to see what it had already left on the compositor. That is not theoretical: an output created while the feature was on survived the rollback switch. With containers off, nothing reconciled it, and the frame capture stayed **2560×720 instead of 1280×720** — the extra width being the orphan sitting beside the real one. The symptom is a *capture* problem, which is where it would be looked for, and it was fixed by restarting the compositor, which drops every session. ## Ideas 1. **Reconcile always, not conditionally.** *(recommended)* On start-up, list the compositor's outputs, find `hh-*` ones that no live session owns, and remove them — regardless of whether containers are enabled. "Disabled" should mean *create none*, not *leave the machine as it was found*. 2. **Never start a session onto an unowned output.** If a leftover is found that cannot be removed, refuse to place a session on it rather than silently sharing it — the ambiguity is what makes the capture width unexplainable. 3. **Record removals in the audit trail.** The `hyprctl output remove` calls are already logged individually; a reconcile pass that removes three outputs should say so once, with the names, so a later "why is my screen narrower" has an answer. 4. **Make it a check.** A VM case that creates a container, disables the feature, and asserts the output is gone — the rollback path deserves the same gate as the forward path, because it is the one that runs when something is already wrong. ## Why it matters A feature that cannot be turned off safely is worse than one that was never turned on, and this one fails asymmetrically: the *forward* path is tested (containers are created and torn down in `vm-sessions` and `vm-containers`), while the *rollback* path was never exercised before it was needed. That is precisely when it is used. It also cost a compositor restart — the bluntest tool available, and one that kills every session — to clean up a state the broker itself had created and could no longer see. The general rule worth keeping: **teardown code belongs outside the thing being torn down**, or there will be exactly one configuration where it does not run, and it will be the configuration you are in when you need it.