The marker is now written up as the *open* item rather than a research note: it
is not implemented, the video went out without it, and everything else about the
pointer is exact and readable.
proof-video.py is rewritten for desks, one command, no arguments. It films the
session's own output with `record --output` instead of the published socket --
with desks, the socket carries every output stitched together, so a viewer would
watch two thirds wallpaper. The scrolling beats are real pointer axis events,
down twice and back up once, so the movement cannot be mistaken for a page that
merely loaded a different part of itself.
Driving the session's browser over CDP, then a terminal with cowsay, was a
scratch script twice and got pruned from scratch once -- which produced an
80-second video of an idle browser and no error. It is asked for repeatedly, so it
belongs with the rest of the agent-eyes tooling, takes a session id, and says in
its docstring that the URLs are real (the search uses key= singular, the bug that
once silently cost every Gunpost search its filtering).
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Everything below the CLI was merged and green against fakes; none of it was
reachable and none of it had ever met a compositor. This wires it up and then
puts the compositor in a position to disagree.
CLI (src/hhstream/cli.py, src/hhstream_session/**)
session container [ID], session reconcile [ID], and the seven pointer verbs
from PLAN §9. `start` still prints the bare session id and nothing else.
`list` gains WS / OUTPUT / POINTER, with the gap marker where a value is
genuinely unknown rather than a blank that reads as zero -- the POINTER
column needs a second, read-only `pointer.state` call because the `list`
reply carries no lease state.
The lease id is cached in `hhstream_session.lease` (under
$XDG_RUNTIME_DIR), because PLAN §9's gesture verbs take no --lease and the
wire requires a lease_id on every one of them; --lease and $HHSTREAM_LEASE
override it, and a `no_lease` refusal drops the stale entry.
Exit codes are the contract's: a gesture with no lease is 9 and never
reaches the broker, and a compositor failure is 10 with a message that says
the session is still running. `kill` now warns about
`session.container_survivors` -- windows the compositor still shows -- and
distinguishes `null` ("could not ask") from `[]`.
`shot`/`record --output NAME` capture one container through `grim -o`; the
frame socket publishes the main output only, so it cannot do it.
Module (nix/module.nix)
sessions.containers.{enable,max,mode,workspaceBase},
sessions.pointer.{enable,leaseTtl,leaseMax}, rendered into the generated
TOML with §10's key names. hhstream-pointer.service: the operator's account,
supplementary group hhstream, After=/BindsTo= the compositor,
Restart=on-failure, KillMode=process, and the command line §3.4 freezes.
tmpfiles for /run/hhstream plus RuntimeDirectoryPreserve on the broker,
without which restarting the broker deletes the driver's socket out from
under it. The runtime-directory length assertion is untouched.
And ExecStartPost on the compositor, opening its IPC directory to its own
group: Hyprland creates <runtime>/hypr with S_IRWXU, so the broker -- a
different account by design -- could not reach the request or event socket
at all, and degraded silently exactly as it is built to.
Checks (checks/**)
vm-ipc: both sockets at their frozen names, measured against sun_path's 108
bytes, and a socket2 subscriber that receives an openwindow for a window the
test creates. The subscriber is the shipped HyprlandIPC, not a second
implementation: this check exists to prove that this client hears this
compositor.
vm-containers: one hh-* output per session at the container mode, the window
on it, a second window of the same application beside it, an unmatched
window quarantined, grim -o isolating one container, teardown removing the
output and freeing the slot. PLAN experiment 3 is answered: `hyprctl output
create headless` works.
vm-pointer: a version-2 virtual pointer, a warp and a click whose
coordinates the *application* reports, BUSY naming the holder, an expired
lease swept with its held button lifted, and a broker restart that leaves
the lock free, the bookmark intact and the driver reachable.
checks/lib gains the guest the three share, their test-script helpers (no
assertions live there), an event-socket subscriber and a Wayland client that
says where it was clicked -- nothing in nixpkgs both honours
$HHSTREAM_APP_ID and reports pointer events.
Reported, not worked around: the broker reads none of the container or
pointer config (policy.py takes [defaults] and [apps] only), `start` has no
no_container field so --no-container is refused rather than silently ignored,
and nix/hyprland-conf.nix sets input:follow_mouse = 0, which sends pointer
events to the focused window only -- measured, with the cursor at the aimed
pixel and no client told. README.dev.md has the evidence for each.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WQy29x9AfHWyzNd1f7XPGK
Slice A renamed the runtime directory in the module, but the old path was still
live in the code and checks it does not own, so the VM gates pointed at a
directory the module no longer creates. This moves the 21 remaining live
occurrences (client/server defaults, the unit tests that pin them, all three VM
checks, the diagnostics script, both READMEs) and deliberately leaves the three
mentions that are history rather than configuration: the plan's problem
statement, module.nix's note about the previous name, and cli.py's explanation
for spelling its default out.
Also here: docs/CONTRACT-sessions.md is now v2 with every gap the four slices
reported resolved as a decision (Monitor.id, stable_id, pid -1, Event.data,
mark(), the quarantine argv type, the corrected wlr XML path, and the state
dir/frame socket rows), and docs/CONTRACT.md is v2 because its documented socket
default moved -- wire format unchanged.
Two comments that stated the old, wrong diagnosis (a 'misnamed' IPC socket) now
state the measured one: the event socket did not fit in sun_path.
`/run/hyprland-headless-stream` is 29 characters, and the compositor's IPC
sockets live under it at `hypr/<instance signature>/.socket2.sock`. With a
~30-character signature the *event* socket does not fit in `sun_path` and the
compositor refuses to bind it:
ERR ]: Socket2 path is too long. (2) IPC will not work.
The *request* socket kept answering `hyprctl` (both ends agree on a residual
truncated path), which is why this looked healthy while every observation
feature that needs events had nothing to read.
`/run/hypr-stream` is 16 characters. The rename reaches both units'
`RuntimeDirectory`, `WorkingDirectory`, `XDG_RUNTIME_DIR` and `HOME`, the
broker's `--compositor-runtime-dir`, the `socketPath` option default, the
`hhstream` CLI's frame-socket default and the `agent-eyes` helper.
An assertion now holds the name at <= 25 characters, the ceiling frozen in
docs/CONTRACT-sessions.md §5, so this cannot regress silently -- the failure
mode is a working request socket and a dead event stream, which looks like
nothing is wrong. Its message says what breaks and why the limit exists.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018YqpJb5aZvZQKb49QDnV7P
M0 of the sessions design, wired into the flake and gated by a real check.
What is here now:
- `src/hhstreamd/` — the broker: session registry, lifecycle verbs, process-group
teardown, app allowlist, audit log, idle reaper on CLOCK_BOOTTIME.
- `src/hhstream_session/` — the CLI handlers, registered into the one front door.
- `src/hhstream/cli.py` — `hhstream status|shot|run|record|session …`, so the
frame verbs and the session namespace are one binary.
- `nix/module.nix` — `sessions.*` options and the `hhstream-sessions.service`
unit: the operator's own account (never a service account, because launched
applications should see that account's home), the compositor's group as a
supplementary group (without it a launched GUI client cannot open the Wayland
socket), the generated app allowlist, and `--compositor-runtime-dir` so
applications are handed the compositor's session rather than the broker's.
- `checks/vm-sessions.nix` — 18 subtests on a real compositor in a VM.
Two bugs found by driving it, both fixed:
- BUG-01: launched applications could not reach the compositor at all — the
broker spawned them with its own inherited environment, which names the login
session. `hhstreamd/compositor.py` discovers the socket and builds the child
environment; a directory with no usable socket is a startup refusal, not a
warning.
- BUG-02: `kill` refused to signal a live application and said nothing was
wrong. The identity gate hashed `/proc/<pid>/cmdline`, which every `execve`
replaces — and on NixOS applications are reached through wrapper scripts that
do exactly that. The gate now rests on `starttime` (+ boot id, + session id
where it is immutable) and records command-line drift as evidence of nothing.
KillMode=process is set on the unit on purpose: the default control-group kill
would take the applications down with the broker, which would make adoption and
a broker restart pointless.
There are two `sg` on this box: the setuid wrapper in /run/wrappers/bin and a
plain symlink to shadow's sg in the system profile. A login shell has the
wrapper first and works; a cron job's PATH reaches the plain one, which cannot
switch groups and dies with "setgroups: Operation not permitted" — which reads
as "chromium exited immediately" once a consumer discards its stderr. The
helper now looks for a setuid `sg` explicitly and says so if there is none.
One front door to the headless session, for reuse by any consumer: it
discovers whichever wayland-N socket exists, re-execs itself under
sg hhstream when the login predates the group membership, and encodes
recordings at the measured frame rate so clips play at true speed.