HydraIssues

Build hydraheadandroid for phones, tablets and iiyama touch signage
open feature Project: hydraheadandroid Parent: #769 Reporter: codex 13 Oct 2026 15:50

Description

Implement hydraheadandroid as a general flat Android Hydra head with phone/tablet and signage profiles. This is the Android implementation workstream of ExperienceNet #769. The owner explicitly requested a new issue and separate tmux session to execute it, and accepted the general Android name because the app should also support their phone and tablet.

Targets and available hardware

  • Samsung Galaxy S24: owner has a phone for testing. Exact variant, firmware, installed Android version and ABI must be recorded when connected.
  • Samsung SM-X210: owner has a Galaxy Tab A9+ Wi-Fi tablet for testing. Capacity, firmware, installed OS and ABI are not yet recorded. Manufacturer identification: https://www.samsung.com/ph/tablets/galaxy-tab-a/galaxy-tab-a9-plus-wifi-graphite-128gb-sm-x210nzaextc/ . This identifies the family, not the owner's capacity variant.
  • iiyama ProLite T4362AS-B1: embedded Android 8 signage target, no unit available yet. It is not established as Android TV. Query actual userspace ABI, MediaCodec support, touch and kiosk permissions on hardware later. A 64-bit CPU does not prove 64-bit Android userspace.

Reuse and repository boundaries

  • Inspect existing repos before implementing. /home/claude-user/hydraheadquest contains the Android Moonlight fork and Kotlin Hydra enrollment/state/catalog/pairing/heartbeat/WireGuard layer, plus the flat Game activity. Its CLAUDE.md and docs/hydra-api-contract.md describe conventions and the contract. It is the starting point, not the APK to deploy unchanged.
  • The existing Quest build has Quest identity/enrollment, VR launch defaults, OpenXR dependencies and aggressive bitrate choices. Create a separately identified non-VR Android product while preserving Quest behavior. Keep reused Hydra/Moonlight history and shared code maintainable; avoid an unrelated rewrite or branding the devices as Quest/iPad.
  • Check whether a hydraheadandroid repo exists remotely before creating a new one. It was not present locally when this issue was created. Use an isolated checkout/worktree for any shared repository changes: a Quest session is already active in hydra:0.
  • Read /home/claude-user/hydra-moonlight-web-stream/docs/runbooks/signage-heads.md and docs/testbooks/signage-heads.md for the prior assessment; they are evidence, not proof of device compatibility.

Required behavior

  1. One Android head identity and application, with phone/tablet and signage profiles. Reuse native Moonlight/GameStream for media and inputs.
  2. Stable per-device identity; scoped enrollment and revocation; correct venue/catalog scope; heartbeat and observable connection state. Extend hydracluster enrollment/type/role handling and flat/XR filtering as necessary, with contract tests. Current fleet enrollment accepts iPad and Quest only.
  3. Body/experience selection for portable use and fixed body/experience assignment for signage. Existing cluster POST /api/v1/nodes/{id}/head-assignment stores body_id/app_id. Honor assignment, stop/reassignment, pairing and session cleanup without orphaning or stealing another session.
  4. Touch with per-experience absolute mouse emulation and native multitouch as appropriate. Handle letterboxing, landscape/portrait, rotation, touch cancellation and release cleanup. Support mouse, keyboard and gamepad when available; test held/simultaneous keys, button release, wheel and relative capture where the experience needs it.
  5. Phone/tablet lifecycle: background/foreground, screen off/on, rotation, network changes and reconnect. Signage lifecycle: assigned experience, offline state, automatic recovery, boot launch and update/rollback via the actual supported firmware route. Do not impose kiosk/device-owner behavior on personal phones/tablets.
  6. Android 8 compatibility for iiyama while remaining compatible with installed S24/SM-X210 OS versions. No required Quest/OpenXR hardware, VR activity or camera-only enrollment path in the flat build. Use conservative H.264/SDR trial settings and explicit bitrate bounds; do not inherit unconditional 150 Mbps LAN/20 Mbps mesh settings or assume 4K from panel resolution.
  7. Preserve credential boundaries. Do not log tokens, keys or passwords, and do not embed fleet admin credentials in the APK. Follow existing approved pairing and device credential mechanisms.

Deliverables and acceptance

  • Maintainable Android source with the required profiles and separate app identity, a reproducible build and CI checks, and versioned installable test APKs when signing prerequisites are available.
  • Software tests for profile/manifest/ABI selection, enrollment/assignment/revocation, lifecycle and input behavior. Build against fake services where useful before hardware is connected.
  • Testbook with separate results for S24, SM-X210 and iiyama. No device has been tested for this app yet. Owner availability is not a connected ADB device or a completed installation. Coordinate actual install/test when a device is available; do not factory-reset, root or enroll personal hardware into device-owner management.
  • Record app/version/hash, firmware/OS/ABI, stream settings, decoder, input modes, orientation, reconnect and remaining failures. Passing on the Samsung Android devices does not validate Android 8, the iiyama firmware or Samsung Tizen signage.
  • Update this issue with implementation evidence and remaining hardware gates. Keep parent #769 open until the requested display acceptance is complete. No production deployment or live body allocation is required merely to prepare the client.

Coordination and constraints
Samsung Tizen rework is separate issue #770, running in tmux hydra:9, window samsung-770. Coordinate shared cluster/relay changes by inspecting current work and using isolated worktrees; do not overwrite another session's edits. The FTI live venue update is independently blocked by account authorization and is outside this task. CC38a/b and DT23 have unknown regular-TV models; this Android app does not establish support for those TVs.
This shared workstation was down to approximately 265 MB free disk. Check current resources, avoid local SDK/NDK installs or large builds, and use existing CI/build infrastructure. Do not interrupt other tmux sessions. Never use /dev/shm as build spillover or expose public test servers.

Comments (13)

codex 13 Oct 2026 16:09

Implementation started in the explicitly requested persistent goal session. Saved tmux identity: hydra:10 (@62, %62). Isolated checkouts: /home/claude-user/worktrees/android-771 and android-771-cluster; Quest and Samsung live checkouts are untouched.

Source: https://github.com/cederikdotcom/hydraheadandroid (retains Quest/Moonlight history). Flat build uses -PhydraProduct=android, separate com.experiencenet.hydraheadandroid identity, API 26 floor, ARM32/ARM64/x86_64 selection, no OpenXR/depth dependency, manual enrollment, portable/signage profile choice, H.264 SDR 720p30/5 Mbps with 1-15 Mbps bounds, and per-experience input mode. Assignment matching, authorization failure handling, and per-device Moonlight identity are being implemented and verified.

Cluster branch: https://github.com/cederikdotcom/hydracluster/tree/issue-771-android . Initial Android enrollment/catalog/scope contracts and existing API/store tests passed: https://github.com/cederikdotcom/hydracluster/actions/runs/38427041444 . Further credential/owned-stop hardening is now in CI.

Android/Quest CI found a flat manifest label conflict and a fake HTTP server dependency problem; both were corrected. APK compilation and compiled manifest/ABI audit remain pending the rerun. No installable artifact is claimed yet.

Remaining software work includes native session reservation and integration with the Samsung cluster branch, portable body selection, lifecycle/input regression coverage, signage boot/recovery and durable signing/update flow. Device tests are NOT RUN for Galaxy S24, SM-X210, and iiyama T4362AS-B1. Record actual firmware/OS/ABI when connected. No production deployment, live body allocation, hardware reset or device-owner enrollment was performed. Parent #769 remains open.

codex 13 Oct 2026 16:21

First verified software milestone is ready; persistent goal remains ACTIVE.

Android source c0ffabc35aa1f48ec81684f8e281b91ed5f6e1a8: Android and Quest compilation/JVM tests PASS. Compiled flat APK audit PASS: separate Android identity, API 26 floor, ARM32/ARM64/x86_64, no OpenXR/depth runtime or model assets. Each ABI was also checked for Moonlight and WireGuard libraries. CI: https://github.com/cederikdotcom/hydraheadandroid/actions/runs/38428930166

Test APK: hydraheadandroid-0.1.0-c0ffabc3-debug.apk, package com.experiencenet.hydraheadandroid.debug, version code 1, 19921437 bytes.
SHA256: 1184f7c98c783476412e17ccef3cf04f3ac2f6067a0bc99ff136f1e4c1592094
CI artifact: https://github.com/cederikdotcom/hydraheadandroid/actions/runs/38428930166/artifacts/11829354072
Local artifact: /home/claude-user/task-artifacts/android-head-handoff/hydraheadandroid-0.1.0-c0ffabc3-debug.apk
Signing is the CI debug signer. This is installable trial software; a durable update/rollback signer is not yet provisioned.

Cluster source 2d6d261: API/store tests PASS, including Android enrollment, flat catalog scope, credential restrictions/revocation and ownership-checked stop. CI: https://github.com/cederikdotcom/hydracluster/actions/runs/38429103031 . Cluster branch remains isolated, unmerged and undeployed.

Implemented initial assignment matching, foreground launch gating, no cached assignment launch after lost authorization/contact, per-device Moonlight ID, refusal to resume/quit occupied bodies, and key/mouse/touch/gamepad cleanup on focus loss/rotation/stop. Remaining software includes atomic native start reservations and shared-cluster integration, portable body choice, cancellation/connection lifecycle integration tests, input geometry/contact tests, signage boot and supported update/rollback. These gaps are not device-only blockers.

S24, SM-X210 and iiyama tests remain NOT RUN. No live body or production deployment was used. Testbook and runbook are versioned in the Android repo; parent #769 stays open.

codex 13 Oct 2026 16:54

Android #771 checkpoint: implementation continues in its separate persistent goal; no production deployment or live body allocation.

Client source ebe1fe83 (hydraheadandroid private repository) produces 0.1.1/code 2, package com.experiencenet.hydraheadandroid.debug. Android and Quest builds pass; Android reports 47 test executions, zero failures/skips. CI: https://github.com/cederikdotcom/hydraheadandroid/actions/runs/38433405876 . APK audit checks API26 minimum, ARM32/ARM64/x86_64 and no XR/depth runtime. Local artifact: /home/claude-user/task-artifacts/android-head-handoff/hydraheadandroid-0.1.1-ebe1fe83-debug.apk . SHA256: 3354ed85f6c2dcedc50e352b9816c3a9762881335be5e137482956ad33383285 . CI debug signer remains unsuitable for a durable update lane.

Implemented portable body choice with fresh availability checks; exact fixed assignment; immediate cancellation/background/reset invalidation of pairing; fresh catalog/scope/assignment checks after pairing; native connection-driven streaming status; own-client quit; letterbox rejection and native contact cancellation. Robolectric tests exercise lifecycle on API26/34 and profile/boot behavior on API26/28/34. Android8/9 signage boot launch is explicit opt-in, disabled by portable mode and absent enrollment. Newer Android startup still requires a supported firmware route. None of these tests establishes real decoder/input/boot behavior.

Merged Samsung #770 cluster work into the isolated Android cluster branch, preserving both workstreams. Shared saved/live head reservations now protect flat discovery, explicit XR admission and Samsung admission. Android APK heads no longer queue node-agent provisioning or display host/XR provisioning controls. Cluster 8fbd36a API/store suites pass: https://github.com/cederikdotcom/hydracluster/actions/runs/38434013847 . Neither production nor another session's checkout was changed.

Software gaps remain: atomic native start reservation, durable/fenced cleanup across restart and failed own-client quit (the existing body-wide watchdog stop is not a safe completion guarantee), full Game/native/network/input integration, end-to-end input-mode configuration, and durable signing/update/rollback. Existing body-allocation design must guide the next reservation work.

S24, SM-X210 and iiyama acceptance all remain NOT RUN. Exact firmware/OS/ABI, decoder and supported startup/update routes must be recorded independently on hardware. Parent #769 remains open. Runbook/testbook and progress.json record the evidence and remaining scope.

codex 13 Oct 2026 17:26

#771 checkpoint: active goal continues; no production deployment, live body allocation or device test.

Important correction: Sunshine /cancel is NOT scoped by the supplied Moonlight client ID. Its handler unconditionally terminates sessions: https://github.com/LizardByte/Sunshine/blob/7c124b43926f22b272376e564f0b5f10d3371080/src/nvhttp.cpp#L1555 . The earlier 0.1.0/0.1.1 own-client cleanup claims are superseded. Those APKs must not qualify session safety. Android now refuses unscoped cancel at the HTTP boundary. Cluster owned/watchdog stop intent is retained rather than converted into an unsafe legacy body-wide command. This is intentionally incomplete until the body can execute a fenced stop.

Client 8f734872 builds 0.1.2/code3. CI passed Android and Quest builds, 76 Android test executions (zero failures/skips), manifest/API26/ABI/no-XR audit: https://github.com/cederikdotcom/hydraheadandroid/actions/runs/38437720716 . APK: /home/claude-user/task-artifacts/android-head-handoff/hydraheadandroid-0.1.2-8f734872-debug.apk . SHA256 6356718536db28c6604b3df97e1fef0e0831d7f3b5a987fe2d5dd6524812d708 . CI debug signer remains temporary.

Added durable cleanup intent before native launch, recovery after process recreation/network failure, pinned HTTPS idle confirmation without plaintext fallback, successor blocking until cleanup, native launch cancellation/settling, and client response to heartbeat ownership conflicts/revocation. Tests include real local HTTPS fixtures and state-machine fake services. They do not prove native decoder/Game behavior or eliminate a server executing a request after the client times out.

Cluster 1190706 passes API/store tests with Go race detection: https://github.com/cederikdotcom/hydracluster/actions/runs/38437384204 . Head reports cannot rewrite a mismatching session identity or refresh its watchdog. Body client changes reconcile without requiring an idle edge. Watchdog snapshots recheck current ownership/timestamps. Unconfirmed cleanup remains occupied across flat/XR/Samsung admission; an unhealthy provider reporting idle cannot release it.

Experience library b7272f7 in isolated issue-771-android branch now validates, persists and publishes input_mode (absolute-mouse/native-touch/relative-mouse/empty). Actual handler/write/reload/live-catalog and invalid-update tests pass: https://github.com/cederikdotcom/hydraexperiencelibrary/actions/runs/38438012416 . This closes the configuration gap behind the existing cluster/client field.

Still required: durable native slot claims and execution-time fenced body teardown, post-timeout/identical-client/restart reconciliation, full Game/native/network/peripheral testing, durable signing and update/rollback qualification. A pending cleanup can currently prevent further streaming. All S24, SM-X210 and iiyama device gates remain NOT RUN. Parent #769 stays open. Updated source runbook/testbook and local progress.json carry the full remaining scope.

api 13 Oct 2026 18:49

#771 checkpoint. No production deployment, live body allocation or device test. The codex session in tmux hydra:10 stopped on a usage limit at 17:26Z; this continues it from a multi-agent analysis of the three repositories.

Owned stop is now delivered, and here is exactly what the claim is worth.

Previously the cluster retained an Android/watchdog stop as intent and never delivered it, because TerminateStream invokes a body-wide Sunshine close and matching client identity at report time cannot show that no successor was granted. A durable record can. hydracluster now persists a slot lease in a new allocation.yaml sidecar beside nodes.yaml. A head claims the body's slot before launching (POST /api/v1/heads/{id}/slot-claims) and hands it back afterwards (DELETE .../slot-claims/{lease_id}); release moves the lease to draining, which still occupies the slot. drainTerminate delivers the stop only when exactly one lease holds that body, it is draining, its client equals both the client the body is reporting and the client the stop was issued against, and the body's report is current.

What this is NOT: a fenced per-session stop. The executed operation is still Sunshine's body-wide close, it is not fenced against a client paired directly to the body outside the cluster, and capacity greater than one is refused rather than handled. The lease epoch is a cluster-internal ordering number, not a fencing token: no body is ever told its epoch, because BodyStatusResponse has no field for one.

Why the sidecar is a separate file: yaml.v3 does not preserve unknown keys, so leases under a new key in nodes.yaml would be silently erased by a rollback to a binary that predates them, and a roll-forward would then grant a body that is already streaming. A separate file degrades to "ignored" instead of "deleted".

Three unbounded states that are now bounded. An owned stop that cannot be fenced is dropped after two minutes with an event rather than staying pending forever. That mattered more than it looks: the occupancy it produced was counted by flat discovery, XR session creation and signage start, so one Android disconnect removed a body from every head type's pool with no timer and no escape but the body-wide admin route. The legacy body-wide flag now carries the session and client it was issued against and expires after 90 s, so the admin and iPad stop paths can no longer fire at an unrelated later session. A body silent for ten minutes stops occupying its slot, which is the direct fix for the recorded 2h46m orphan and needs no body release.

Also fixed in the cluster. A head heartbeat the session store refused no longer persists LiveBodyID; a stale LiveBodyID reserves a body only while its head is online, where before a head that died mid-stream reserved its body forever. DELETE /heads/{id}/stream for an Android head with no body resolved returns 400 instead of answering {"status":"stopping"} having marked nothing. BodyNodeStatus.ReportedAt is stamped from the cluster clock with a 150 s window, not 90 s: hydrabody ticks at 30 s and suppresses an unchanged report for 45 s, so a healthy idle body can be 60 s between posts and 90 s would have intermittently blanked the fleet. It gates the new claim and stop paths only.

Cluster 54b14ea9: PASS. The CI gate was widened from ./pkg/api ./pkg/store to go vet ./... plus go test -race ./..., which is what the repo's own CLAUDE.md always stated; the whole module is vet-clean. https://github.com/cederikdotcom/hydracluster/actions/runs/38447323866

Client, 0.1.3 / code 4, source 6033ffc5. The cleanup journal now records the lease, and releasing it is the authoritative completion; the pinned idle probe remains as corroboration for a cluster without slot claims. This removes a dead end: quitApp throws for flat by design and the body-wide *_SERVER_FREE probe was the only proof, so any abnormal end left the journal pending forever and refused every new launch. An unreadable journal record is retired once into lost instead of throwing on every call, which previously left the head unable to stream with no remedy the runbook permits. The flat /launch request no longer carries a 7 s read timeout, which Sunshine routinely exceeds because it answers only after its prep-cmd hook and the experience have started; that bounded client made the late-launch race the normal case. The pending-cleanup guard in tick() sat above every heartbeat call site, so a foregrounded head went silent to the cluster and stopped noticing a 401/403 revocation; it now heartbeats before returning. onAndroidStreamEnded no longer swallows HttpStatusException, so a 409 no longer looks like success. The client degrades to the previous behaviour on 404/501 from the claim routes, so an Android build cannot be bricked by a cluster that has not been upgraded.

CI: https://github.com/cederikdotcom/hydraheadandroid/actions/runs/38448889291 . Android and Quest builds PASS. 80 unit test executions, zero failures, zero ignored, across the Robolectric API 26/34 matrix. That is executions, not 80 distinct tests. APK: hydraheadandroid-0.1.3-6033ffc5-debug.apk, SHA256 11ff103b56f474995fa2f1771b920be8f7d33d14434661deab64766d60b90326, 19937933 bytes, package com.experiencenet.hydraheadandroid.debug. The CI debug signer remains temporary and rotates per job.

Correction to the 16:21Z comment. It claimed each ARM32/ARM64/x86_64 ABI contains Moonlight and WireGuard libraries. That was true of the inspected artifact but it was never what CI asserted: scripts/check-android-apk.py compared only the SET of lib/<abi>/ directory names, so a regression dropping a library from one ABI would have passed. The script now asserts per-ABI content, an assets allowlist rather than a keyword denylist, allowBackup=false, the applicationId, and the versionName/versionCode. Only builds audited by the corrected script may carry the per-ABI claim.

Blocked, not deferred. Truly fenced per-session termination cannot be built here: go-sunshine v0.1.2, the version hydrabody pins, exposes one teardown call (CloseRunningApp to POST /api/apps/close) and its session registry is keyed by application name with no client, slot or launch field, so there is no object to address a scoped stop to. Delivering it needs coordinated go-sunshine, hydrabody and hydraclusterapi releases, and this issue forbids deploying body changes. hydraclusterapi is at v0.23.0; the design's v0.24.0 with the body-facing desired slot table does not exist.

Open question that should be gated. Whether Sunshine /cancel honours uniqueid is not verifiable on this host: there is no Sunshine server source here and Sunshine arrives as a prebuilt zip from an unpinned latest mirror path. The repository contradicts itself on it. The fail-closed reading stays the operating assumption. Worth adding to the design's gate list is the question it omits entirely: can Sunshine close one of N sessions while the others continue, and over which endpoint. Four admission inferences are gated there; the teardown inference they all rest on is not. This workstream has already had to retract one assumption about per-client scope on a body-wide Sunshine operation.

Merge trap, needs an owner decision. cederikdotcom/hydraheadquest:issue-771-android still exists at c7165f62, 18 commits behind, and still carries the superseded own-client /cancel cleanup. Merging it would reintroduce retracted behaviour into the Quest product. It should be deleted or fast-forwarded. The Quest regression evidence for this workstream is the build (quest) job of the hydraheadandroid run above, not that branch. Not touched here because a Quest session is active in tmux hydra:0.

Remaining hardware gates, unchanged. S24, SM-X210 and iiyama: all NOT RUN. Real /launch latency per experience. BOOT_COMPLETED delivery on each firmware. Whether SUNSHINE_CLIENT_UUID is byte-identical to the Android Moonlight uniqueId: if it is not, every Android heartbeat 409s about five seconds after a successful start and the owned stop never matches. The 409 was deliberately not relaxed, because softening it before a device test would turn a loud failure into a silent ownership hole.

Still open and worth separate issues. A body whose hydrabody is dead while hydranode keeps heartbeating still appears eligible to every head type; ReportedAt exists but retrofitting it onto the four admission sites is a fleet-wide change that does not belong inside the Android workstream. The durable Android signing lane is unprovisioned, so no two CI APKs are upgrade-compatible and the identity-across-upgrade gate is unexecutable rather than merely unqualified. Input coverage for requirement 4 has nothing for wheel, gamepad, relative capture or physical peripherals.

hydraexperiencelibrary is unchanged at b7272f7 and green; nothing in this work touches it.

api 13 Oct 2026 20:32

Merge trap resolved, and a correction to my 18:49Z comment.

cederikdotcom/hydraheadquest:issue-771-android is deleted.

What it actually was: c7165f62, the second of 24 commits on this line of work, and a strict ancestor of hydraheadandroid master (6033ffc5) - 22 behind, 0 ahead, confirmed server-side. Every commit on it stays reachable from the hydraheadandroid default branch, so the delete loses no history. It carried no tag, no pull request and no branch protection, nothing on Quest master referenced it, and the Quest session in tmux hydra:0 is parked on master and has never touched it.

Correction. I wrote at 18:49Z that the branch "still carries the superseded own-client /cancel cleanup". That is wrong, and so was the same line in progress.json. c7165f62 predates that cleanup: the own-client quit arrived around ebe1fe83 (0.1.1) and was retracted at 51e4a2e1 and 8f734872. The branch sat two commits in, before either.

The real hazard was the inverse of what I described: the branch held none of the 22 corrections, and merging it into Quest master would have duplicated an obsolete flat-Android scaffold inside the Quest repo - the hydraProduct source sets, the variantFilter, a conditional dependency block, an android.yml workflow, and HYDRA_FLAT guards across 7 shared files. Quest runtime behaviour would have survived that merge (every guard defaults to the Quest product, and app/src/quest/.../DepthSourceFactory keeps MidasDepthSource), so this was a repo-hygiene and stale-code hazard, not a Quest regression. Calling it a regression overstated it.

Restore, if it is ever wanted:

git push origin c7165f6207501c16cc62bc3a65c37989d8f09604:refs/heads/issue-771-android

Separately, on the Sunshine /cancel question: the 17:26Z comment already settled it from upstream source (the handler terminates unconditionally, it is not scoped by the supplied client id). My 18:49Z framing of it as unresolved was about the absence of Sunshine source on this host and should not be read as reopening it. The fail-closed behaviour shipped in 0.1.2/0.1.3 matches the upstream reading.

api 14 Oct 2026 12:51

The library half of this landed, to clear the way for the Experience struct split (#774). Nothing else from this issue is merged.

hydraexperiencelibrary v0.18.0, deployed and verified: input_mode on the Experience, validated against "" | absolute-mouse | native-touch | relative-mouse, plus the android-contract workflow. Rebased onto main, one commit, 141 insertions and no deletions. All 22 experiences read back intact after the container rebuild.

The split then went out as v0.19.0 on top of it. input_mode now sits inside the embedded Streaming block, still exp.InputMode from anywhere and still the same key on the wire.

Still open and NOT merged: the worktree at worktrees/android-771-cluster is 20 commits ahead of main (owned stop behind a durable slot lease, and the runbook work). That is the rest of this issue and it was deliberately left alone.

api 15 Oct 2026 14:39

#771 checkpoint. Two blockers cleared, both from coordinating with the #549 session in tmux hydra:1. No device test yet.

The signing lane exists now, and the identity gate is executable. android.yml had no signing step, so AGP minted a throwaway debug keystore per job. That was worse than "unsigned": no two CI APKs were upgrade compatible, adb install -r fails, the tester must uninstall, and uninstall changes ANDROID_ID, which changes the head identity. The testbook gate "identity across upgrade and reboot" was therefore unexecutable, not merely unrun, and a test device would have had to re-enrol on every build.

This ports the lane hydraheadquest's release.yml already proves: the same four secrets, the same presence gate exposed as a step output because the secrets context is not allowed in a step-level if, the same zipalign plus apksigner sequence. It signs in place before the APK audit, so the audited artifact and SHA256SUMS describe exactly what gets installed. Without the secret the build still passes and the log states what the artifact cannot qualify, so an unprovisioned checkout is not broken by it.

The key is a new one, not the Quest key: PKCS12, RSA 4096, alias hydraheadandroid, valid to 2056. Certificate SHA-256 237f9d680bdbcdbc96b6dd457aad12568c7a35aabfccd777eb2ab8b355c4fc81, and CI printed exactly that digest. Reusing the Quest key is forbidden by this issue, it signs an already distributed product so sharing it widens the blast radius, and the application IDs differ so it would buy no upgrade compatibility anyway. It was generated with openssl rather than keytool because this workstation has no JDK.

Not done, and it is the weak point: the key is mirrored nowhere. The Quest key is backed up to Hetzner Storage Box u645590 under hydramdm-backups/hydraheadquest-signing/. This one needs the same at hydramdm-backups/hydraheadandroid-signing/ and until then exists on one disk that sat at 100 percent today. That needs SSH on port 23, so it is an owner action.

The client could not pair with half the fleet, and now can. The fleet runs two Sunshine generations that want different PIN posts. 2025.924 accepts {"pin":"NNNN"}, which is all this client sent. 2026.914 requires a server minted 32 hex pairing_id plus a name and rejects the bare form with HTTP 400 pairing_id must contain exactly 32 hexadecimal characters; getservercert then never unblocks and the client times out looking like a network fault. Credit for that diagnosis belongs to the #549 session, which had the failure verbatim from a flatscreen head.

The client now asks the body which form it wants: once getservercert is pending, GET /api/pin returns the pending list, we identify our own entry, and the PIN goes back with the id and the name the server recorded. A body that 404s the route, reports no pairings, or answers in an unrecognised shape gets the legacy bare body, so an older body is never sent fields whose handling is unverified and a newer one is never sent a form it rejects.

Two deliberate rules in that matching. Match on source address, never on name, because every Moonlight derived head sends the hardcoded devicename roth. And ambiguity fails closed: more than one matching entry errors instead of choosing, because posting our PIN against another client's pairing id pairs the wrong device and the symptom is a phase 4 clientpairingsecret rejection indistinguishable from an unrelated bug. The {"pairings":[...]} envelope is wire verified; the per-entry names (id, name, address) are source derived from pending_pairing_t and not yet wire captured, which is why the parse tolerates their absence. Tighten it on the first real pair against a 2026.914 body. Sunshine's status_message is now carried into the client error, so a refused PIN says why instead of only HTTP 400.

Client 69ecddfc: CI success on both products, 104 unit test executions, 0 failures, 0 ignored, up from 80. That is executions, not distinct tests: the 12 new pairing tests run across the API 26/34 Robolectric matrix. The parsing, selection and payload shaping are pure functions, so all of it is covered without a network. https://github.com/cederikdotcom/hydraheadandroid/actions/runs/38751909927

Correction to stale comments, which cost a peer real time. HydraStreamHooks and HydraApp both asserted that the pairing layer hardcodes 0123456789ABCDEF. That stopped being true for this product when NvHTTP.java:214 gained its flat branch: the flat build sends a per device IdentityManager uid, the same value passed to Game as EXTRA_UNIQUEID. Since Sunshine keys its single pending-pair session by uniqueid, the shared identity heads collide with each other on concurrent pairing and this product does not. The #549 session read those comments while reasoning about exactly that. Fixed. Also, a null identity now refuses to pair rather than sending a literal "null", which would have been a shared identity again, and the worst kind.

New prerequisite for Android fleet rollout, agreed with the #549 session and recorded from both sides. Because each Android device pairs under its own uniqueid, each is its own client certificate on the body, where the shared identity heads collapse into roughly one. hydrabody calls TrimPairedClients(200) (pkg/provider/provider.go:217) and above that threshold sunshine_provider.go:325-335 calls UnpairAll(). So Android is the workload that walks a body toward that cliff, and when it trips it unpairs every head on that body, not only the Android ones. A cert keyed trim is therefore a prerequisite for Android fleet rollout, not a later refinement. #549's own sketch proposes a selective UnpairClient(uuid), which that session has flagged as wrong since all heads share one uuid: it must key on the certificate. That session is promoting the work accordingly.

Validation body changed. Not cloud-l4-euw1: it runs Sunshine 2026.914.233613, so no current head can pair with it, and it is a GCP spot instance preempted twice in one day. Use chunky-turnip-23 (node-b961f1c8, district bxl1-test-2, venue mobile-kit), now on hydrabody rc.16 with the #798 provider-404 loop and the #804 apps.json churn both confirmed dead, Sunshine 2025.924.154138, pairing verified three times with a rendered frame. Head enrolment must use that district and venue, since eligibility is same district AND (same venue OR same owner).

One earlier statement corrected. The 18:49Z comment treated hydrabody rc.16 as possibly changing the teardown picture. It does not. rc.16 is #798 provider version adoption and backoff, #804 sanitising via the API instead of editing apps.json behind Sunshine, and #805 refusing to register an app whose exe is absent. go-sunshine is still v0.1.2 and SessionRegistry is unchanged, so CloseRunningApp to POST /api/apps/close remains the only stop primitive and there is still no per-session object to scope to. #771's blocked split stands as published. rc.16 fixes what was tearing sessions down unbidden, not the teardown API.

Device gates unchanged: S24, SM-X210 and iiyama all NOT RUN. The tablet still needs its one time USB arming, after which it is reachable through the always-on hydraadb scale on pi-node-004-nvme, which I verified end to end today over cluster exec. Note for whoever runs it: that adb is 29.0.6 and has no pair subcommand, so the Android 11+ wireless debugging route cannot be driven from it and adb tcpip 5555 from a USB host is the only arming path, which does not survive a reboot.

api 18 Oct 2026 11:57

The iiyama signage target is physically present. Two ProLite T4362AS-B1 panels are on the mobile-kit venue LAN at 10.110.15.148 and 10.110.15.149 (MACs 18:65:71:FE:6A:63 and :65). This issue has carried "no unit available yet" for that model since it was written, and requirement 6, Android 8 compatibility, has been theory until now.

Nothing is claimed beyond presence. Android 8.0 is the vendor specification, not something read off the unit. The userspace ABI is still unknown, which is the fact that matters most here: getprop needs ADB, and ADB is not yet enabled on either panel. This issue's own warning stands, that a 64-bit CPU does not prove a 64-bit Android userspace. It is also the gap the tablet cannot close: the SM-X210 reports abilist64 of arm64-v8a alone, so every device result so far exercises only the ARM64 slice, and the iiyama is the most likely consumer of the armeabi-v7a one.

Current state of both panels, measured from the venue LAN: both answer ICMP in about 2.6 ms, both refuse TCP 5555, and both expose nothing on 80, 8008, 8060, 8080 or 7000. Connection refused rather than a timeout, so network ADB is switched off rather than unreachable.

Reachability is solved. Neither neoremote nor the hydraadb scale can route to 10.110.15.0/24, and the venues are deliberately not bridged: peppy-dumpling-32 on 10.110.0.x times out and chunky-turnip-23 on 11.0.5.x gets Destination net unreachable from its upstream. The route in is cranky-toaster-86 (macbookair2013), which moved onto the venue LAN at 10.110.15.180, is online, and carries adb 37.0.0. It reaches both panels. So the only thing between here and a device report is the ADB toggle on the panels themselves.

Enabling it is not straightforward on this model. Android 8 has no Wireless debugging at all, that arrived in Android 11, so only the USB debugging toggle can exist. iiyama's Android settings are a flat list (Network, Signage Display, Apps, Display, Security, Date & time, Developer options, About) rather than the Android TV layout, so Developer options is a top-level sibling of Signage Display. Availability varies across their range: the LH32/43/49/5546HS manual states "Developer options: Not available on this model" while the LE6540UHS manual lists it. I could not confirm which applies to the T4362AS-B1, because iiyama's CDN returns 403 to automated downloads of the T43/55/6562AS manual and the mirrors omit that section.

Fallback if the toggle does not exist: install the APK from a USB stick with the panel's file manager. That forfeits logcat and remote control, but it still answers whether the app runs on Android 8 at all, and a failed install would itself be informative. The APK is minSdk 26, exactly Android 8.0, and carries an armeabi-v7a slice.

Also on that venue LAN, worth recording: Cederik-s-S24 at 10.110.15.174, the other device named in this issue, and five iPads. The three Samsung Tizen panels enrolled for venue mobile-kit belong to #770 and are not Android.

Client status unchanged: 0.1.7/code 8 is installed on the SM-X210. The QR preview fix is still unconfirmed by eye; a camera preview is not captured by screencap, so the region reads as black from off-device and the fix cannot be verified remotely. The instrumented build reports the fit it computes, and on that device it is view 1038x576, buffer 640x480, sensor 90, display 90, giving zero rotation and a uniform 1.6219 cover scale, which is arithmetically correct. Whether it looks right still needs a human.

api 18 Oct 2026 16:17

First end-to-end stream on the signage target, and the cluster change that unblocked it. No gate list survives this one unchanged.

hydracluster v2.0.130 is released and deployed to production, owner approved. Before it, handleFleetEnrollHead accepted iPad, Quest and the Samsung signage role and sent everything else to default:, so hydraheadandroid got 400 unknown head type and no Android head could enrol at all, on any device. Reproduced against production before and after. The tablet's failure to enrol, which had looked like unfinished setup, was the same 400.

Merging main into the branch produced three conflicts, two of them semantic, and one would have done real damage silently. Main changed head diagnostics to map[string]json.RawMessage for #801, and the merge left the Moonlight identity being read from the raw map, which does not compile and would have compared against JSON quoting if it had. Worse, the merge restored main's calls to touchHeadHeartbeat and setSessionUUIDFromHead without their definitions, because this branch deliberately replaced both with reportHeadHeartbeat, which does the same work only after checking the reporting head owns the session. The old setSessionUUIDFromHead overwrote the session uuid even when it disagreed with the body's and merely logged it. Restoring that call would have reopened the ownership hole with every test still passing, because the test drives the store directly rather than the handler. The #770 session verified beforehand that its signage client never calls handleUpdateHead and never sends a session uuid, so removing the path costs signage nothing.

The iiyama ProLite T4362AS-B1 is no longer "no unit available". Two units are on the mobile-kit LAN. One is enrolled as node-bc40639a and has streamed from chunky-turnip-23. From the unit itself, not the datasheet: Android 8.0.0 / API 26, fingerprint IIYAMA/sugarcane/sugarcane:8.0.0/.../TVOS-04.24.010.05.03, arm64-v8a with abis_64 of arm64-v8a alone, page size 4096, 1920x1080 at 160dpi. Our minSdk is exactly 26, so requirement 6 is demonstrated with no margin to spare. Note the ABI: neither device type exercises armeabi-v7a, so that slice remains completely untested and these panels will not change that.

An open question from 13 October is closed. This issue warned that if SUNSHINE_CLIENT_UUID were not byte-identical to the Android Moonlight uniqueId, every heartbeat would 409 about five seconds after a successful start and the owned stop would never match. They match: the head reported moonlight_client_id 64e1f15da6a579ad and the session carried streaming_client_uuid 64e1f15da6a579ad. The proof is not the string equality but that the session had head_id bound at all, which only happens after the identity check passes. The 409 was never relaxed and did not need to be.

The oversized picture is hydraissue #828, in hydrabody, not in this client. hydrabody writes -ResX=1920 -ResY=1080 -windowed -ForceRes into every landscape experience in apps.json, derived from orientation alone and never from the requested stream resolution. The app window is therefore a constant while the desktop is a variable the client controls, so a 1280x720 request gives a 1920x1080 app on a 1280x720 desktop, capture takes the top-left corner and the panel upscales it. Found by the session working on body slots.

Getting there cost three wrong fixes, each shipped on inference, and the correction is worth recording. A GL render path change did nothing: the symptom was identical on both render paths. A claim that the body's desktop was 1024x768 was false and I published it before checking; cluster exec runs in Windows session 0, which has its own 1024x768 pseudo-display, and it was never the display Sunshine captures. Sunshine's own log showed it honouring the request exactly: mode 1280x720x30, desktop 1280x720, capture 1280x720.

What ended it was instrumentation rather than reasoning. The head heartbeat now carries requested[WxH@Nfps Nkbps], the view, surface and window sizes, and decoder[WxH crop=... shown=... stride=...]. One reading eliminated the entire Android layout path: decoder output 1280x720 with crop 0,0-1279,719, every surface exactly 1920x1080. That diagnostic exists because the panel has no ADB and a decoder surface is invisible to screencap, so the head screenshot command returns a valid but entirely black JPEG during a stream. Screenshots cannot verify anything the decoder draws.

Client 0.1.14 now asks for the head panel's own resolution, capped at 1920x1080 preserving aspect, at 60 fps, with the default bitrate scaled by pixel count from the 720p 5 Mbps trial figure. On the iiyama that is exactly 1920x1080, so the symptom disappears. That is two numbers agreeing, not a repair. The testbook records the geometry gate as PASS for a 1920x1080 panel only and NOT RUN for any other geometry. Predicted and not yet observed: the SM-X210 at 1200x1920 fits to a 1080x1728 request and should still show the crop.

Defects found that are ours, not #828.

DELETE /heads/{id}/stream answers 200 {"status":"stopping"} and does nothing when no slot lease fences the request. Reproduced twice on a live stream; the stream had to be closed from the body side through Sunshine. The fencing may be right, but a stop that cannot act must not answer 200. Related and unverified: POST /heads/{id}/slot-claims requires prefer_body_id for a head with no assignment, which the client does send, so the claim should succeed at launch; whether the 90 second lease then renews through the heartbeat is unknown. And allocation state is exposed nowhere in the API, so a durable lease was built with no way to inspect it.

There is also no way to exit a stream on a wall panel. Moonlight exits on KEYCODE_BACK, the activity runs immersive with the navigation bar hidden, and signage has no remote. The three finger gesture is toggleKeyboard, not an exit, so my first diagnosis of this was wrong too. It needs an explicit on-screen affordance in the flat build.

Delivered since the last checkpoint, all green: a durable signing identity, so builds upgrade in place and the identity-across-upgrade gate became executable and was then executed on the tablet, 0.1.5 to 0.1.6 with firstInstallTime preserved. Enrolment from a file for heads that cannot scan, which after the panel answered ActivityNotFoundException had to become a storage search rather than a picker, because stripped signage firmware ships no DocumentsUI. And a phone-home path that reuses the public tracker endpoint, needing no credentials and no enrolment, which is how the panel reported its full inventory as issue #819 without anyone reading anything off a screen.

api 18 Oct 2026 16:18

Addendum on #828: the per-experience resolution override is not a workaround for this fleet, and should not be offered as one.

The exact line, from hydrabody pkg/provider/experiences.go, streamResolution():

if info.Resolution != "" { ... return info.Resolution, "-ResX=W -ResY=H -windowed -ForceRes" }
if info.Orientation == "portrait" { return "1080x1920", "-ResX=1080 -ResY=1920 ..." }
return "1920x1080", "-ResX=1920 -ResY=1080 ..."

So the window geometry comes from the experience record: an explicit resolution field when the library carries one, otherwise an orientation default. The client's requested stream resolution is not an input at any point. The function's own doc comment calls it "the single source of truth for all three layers", which is the flaw stated plainly: layers 2 and 3 agree with each other by construction, and both can disagree with the client.

There is an escape hatch today, and the comment cites "1668x2224 for an iPad kiosk", so someone has hit this before. But resolution is per experience, not per head. One experience shown on both a 1920x1080 iiyama panel and a 1200x1920 tablet can only carry one number, and this fleet is deliberately mixed: iPad, Quest, Samsung signage, a Galaxy tablet and now two iiyama panels. Setting it per experience fixes one head by breaking the others. Recording that here so it is not mistaken for a fix when #828 is picked up.

The preferred fix shape, argued by the #549 session and agreed here: derive the app args from the requested stream resolution, not from the desktop mode Sunshine ends up adopting. The adopted mode is downstream of dd_resolution_option and of whatever the virtual display could honour, so deriving from it makes the window track a number that has already been rounded or refused. The request is the intent. Orientation can still pick which axis is long; it must not pick the numbers.

This has been handed to the session currently holding hydrabody, which is at v2.0.77 and is building per-slot Sunshine instances with their own virtual displays. That work makes #828 worse rather than incidental: with app args a global constant and each slot's desktop set per client, the defect multiplies by the number of slots, and two heads of different geometry on one body cannot work at all.

Not reassigning #828's authorship: the #549 session established that layer 3 is hydrabody's and declined to claim an issue it has not read.

api 18 Oct 2026 16:21

Correction to my framing of #828: it is drift, not an original design flaw. The session holding hydrabody checked and the distinction matters.

streamResolution's doc comment still claims layers 2 and 3 both call it, but there is exactly one caller left, sunshine.go:352. handleStreamStarted stopped calling it and now writes no resolution at all, delegating the desktop mode to dd_resolution_option = auto. So layer 2 was moved onto the client's request and layer 3 was left behind on the experience record. They agreed only while they shared an input. Nothing failed loudly because each layer stayed self-consistent on its own, which is why this survived to be found on a panel rather than in a test. The vddRes return value is now dead for its original purpose.

I had called it a design flaw where two layers agree by construction. That was wrong: they used to share a source and one of them moved. The drift reading also explains the silence, which mine did not.

A trap for whoever implements the fix. Do not write -ResX=%SUNSHINE_CLIENT_WIDTH% into apps.json. Sunshine launches these through CreateProcess, not a shell, so there is no variable expansion and the literal string reaches the application. This repository already learned it for the client UUID and documented it at pkg/provider/slot_files.go:274-279, which is why internal/cli/stream_hook.go:48 calls os.Getenv("SUNSHINE_CLIENT_UUID") instead of templating.

The values do exist, pulled from the shipped sunshine.exe on chunky (2025.924.154138): SUNSHINE_CLIENT_WIDTH, SUNSHINE_CLIENT_HEIGHT, SUNSHINE_CLIENT_FPS, SUNSHINE_CLIENT_HDR, SUNSHINE_CLIENT_ENABLE_SOPS. So the requested geometry reaches a child process's environment, never its command line. That is also independent confirmation that the request is available at launch time, which is the input the fix should derive from.

The recorded fix shape is a launcher shim reusing the UUID pattern: apps.json holds hydrabody.exe launch-experience --app <name>, the shim inherits the environment and starts the real executable with matching -ResX/-ResY, and apps.json stays static so there is no per-session rewrite and no race with Sunshine parsing it. Two constraints on it: the shim cannot exit, because Sunshine tracks the app process for session lifetime and would read the stream as ended immediately; and it must survive hydrabody's reaper, which kills anything it reads as "orphan: no active session" within about 60 seconds, so a process tree one level deeper still has to register as Sunshine-launched.

Not implemented, and not approved. It changes layer 3 of the orientation contract for every body in the fleet, so it is an owner decision and has been put to them as one.

A mixed-geometry test bed now exists without waiting for the fix: boom-pickle-38 is being brought up on 2 slots (47989, 48089) and cosmic-pretzel-98 reports 3 free slots. Noting one measurement against that: GET /api/v1/bodies/eligible?district=bxl1 currently returns free_slots=1 for boom-pickle and free_slots=3 for cosmic, so the cluster has not yet seen boom-pickle's second slot. Whether that is propagation delay or the body not reporting SlotPorts is for that session to confirm.

api 18 Oct 2026 16:28

A defect I introduced in v2.0.130: hydracluster now has two independent slot allocators that do not reference each other.

pkg/api/slotclaims.go     in-memory, keyed by head id, assigns a port during eligibility
pkg/api/slot_lease.go     durable leases in allocation.yaml beside nodes.yaml
pkg/store/slot_lease.go

A grep -c of each for the other's symbols returns 0 in both directions. They were built in parallel, the lease on this branch for fencing owned stop and slotClaims on main for deciding which slot a head gets, and I merged them into main today without noticing they are the same concept twice. I resolved three conflicts carefully, two of them semantic, and still missed the overlap. Recording it here rather than leaving it to be rediscovered.

A body's occupancy now has two truths in one process. slotClaims decides the port a head is told to use, lives only in memory and dies with the process. The lease decides whether a body counts as occupied for admission and whether an owned stop may fire, survives restart, and has a lifecycle of granted, streaming, draining, terminal. A head can hold a lease on one body while its slotClaim has been overwritten onto another.

That bears directly on hydraissue #831, raised by the session doing the multi-slot work: slotClaims.claims is keyed by head id alone while Claim is called once per body inside the eligibility loop, so each call overwrites the last and a head ends up holding its claim on whichever body the loop visited last. Measured there: cosmic-pretzel-98 reporting every slot free while serving a stream. Fixing the keying alone would make the two mechanisms disagree more precisely rather than less, so the choice of allocator semantics should be made once, across both, as an owner decision.

It did not affect this issue's device testing. chunky-turnip-23 is single-slot, visible as free_slots reading a constant 1 whether stream_count is 0 or 1, and FreeSlots hard-codes 1 while Claim returns early without writing when a body has one port or none. So the panel under test is on the one path #831 cannot reach. free_slots on a multi-slot body is not currently a trustworthy readiness signal in either direction, and is not used as one here.

Separately, and worth its own issue: all four online bxl1 heads and both bodies share owner=visit.flanders, and the eligibility filter is if !sameVenue && !sameOwner { continue }. So every head currently sees every body regardless of venue. Venue has been treated as a hard isolation boundary in planning, including in this issue's own body-selection notes, and it is not one while owner matches.

Also found today, in this issue's own session-handling. Installing a client update over a running stream orphans the session: the app dies without its cleanup path, Sunshine keeps streaming to nobody, the body keeps reporting streaming, and the session stays open holding the body. The head then correctly refuses to start a new stream because the body reads as busy, which presents as "no body available". The watchdog does not recover it, because bodyGoneThreshold only fires when the BODY falls silent and this body is not silent. The head heartbeat stops the moment the client dies and nothing acts on that. A head that has stopped heartbeating while its session is open should bound that session rather than waiting on the body. Same family as the owned stop that answers 200 and does nothing: both trust the body's self-report with no corroboration from the head.