Files
hyprland-headless-stream-pl…/docs/TODO/reconcile-while-containers-are-off.md
T
HermenixandClaude Opus 5 6b395305e0 scroll: one verb, two axes, and the sign carries the direction
A session could move a cursor and press it, but not scroll. The protocol
already had the request -- zwlr_virtual_pointer_v1.axis(time, axis, value) --
it had simply never been implemented, in the driver or the broker.

  hhstream session pointer scroll <id> --axis vertical --amount 3

Positive is down (vertical) or right (horizontal): the protocol's direction,
not a choice of ours, which is why direction travels in the sign and there is
deliberately no up/down vocabulary layered over it. The output is whatever the
last warp aimed at, exactly like a button, so scrolling somewhere else is a
warp first -- and the lease is what keeps the whole gesture atomic. Bounded at
100 wheel clicks per request on both sides, because a decimal-point slip should
be a refusal rather than a session scrolled somewhere unrecoverable.

The resume point is re-stamped, not moved: the cursor did not go anywhere, so
the coordinates are re-affirmed and only the stamp advances. Recorded in the
contract as an amendment to the frozen op set, because adding an op to a frozen
interface should be visible rather than implied.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-10-03 19:05:39 +00:00

49 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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.