HydraPipeline

HydraExperienceLibrary

Experience lifecycle manager handling the full journey from draft through live deployment to retirement.

Infrastructure

Server hydraexperiencelibrary.experiencenet.com (Incus scale on pi-node-004-nvme, behind the edge router)
hcloud hydraexperiencenet context, cx23 nbg1
Config /root/.hydraexperiencelibrary/config.yaml
Data /root/.hydraexperiencelibrary/
Service systemctl status hydraexperiencelibrary
Logs journalctl -u hydraexperiencelibrary -f
Health GET /api/v1/health

Operations

Check status

# via hydracluster exec on node-50ab5309
incus exec hydraexperiencelibrary -- systemctl status hydraexperiencelibrary

Or via the health endpoint:

curl -s https://hydraexperiencelibrary.experiencenet.com/api/v1/health

View logs

# via hydracluster exec on node-50ab5309
incus exec hydraexperiencelibrary -- journalctl -u hydraexperiencelibrary -n 100 --no-pager

Show last 100 lines:

# via hydracluster exec on node-50ab5309
incus exec hydraexperiencelibrary -- journalctl -u hydraexperiencelibrary -n 100 --no-pager

Restart

The service runs as the Incus scale hydraexperiencelibrary on pi-node-004-nvme (node-50ab5309), behind the edge router. The old host 46.225.120.6 is gone; its IP was recycled and belongs to a foreign machine now. Never ssh there.

# via hydracluster exec on node-50ab5309
incus restart hydraexperiencelibrary

Update

A scale has no self-update path: the image is the unit of update. Tag + push triggers CI, which publishes the OCI image. Then rebuild the scale (via hydracluster exec on node-50ab5309):

hydraskin update hydraexperiencelibrary          # dry run
hydraskin update hydraexperiencelibrary --apply  # rebuild onto the new image

The rebuild preserves state disks, the expose proxy and labels, and verifies /api/v1/health afterward (verified 2026-08-26, v0.10.6 to v0.10.7 in 12 s).

Release credentials

Every github.com/cederikdotcom/* dependency is a private repository, so go fetches them directly over git instead of through the module proxy. Both release jobs therefore need GO_PRIVATE_TOKEN, a repository secret with read access to those module repos. Credentials here are repository-local; no organization secret is inherited.

The binary job writes it to a ~/.netrc and sets GOPRIVATE=github.com/cederikdotcom/*. The image build receives it as a BuildKit secret file mounted only for go mod download, so it never lands in an image layer, and the build stage installs git for the same reason. Both copies are removed with if: always().

If a release fails with could not read Username for 'https://github.com' or git: executable file not found, the secret is missing or expired. That is what broke v0.10.12: nothing in the build changed since v0.10.11 on 2026-09-05, but the dependencies went private afterwards and the library was not released again until #721, so the breakage stayed latent. SCALE_REGISTRY_TOKEN publishes the OCI image and HYDRARELEASE_PUBLISH_TOKEN publishes binaries; SCALE_REGISTRY and SCALE_REGISTRY_USER are repository variables.

Create experience (API)

Creates a new experience in draft state:

curl -X POST https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Experience Name",
    "organization_id": "<organization-id>",
    "description": "Description of the experience"
  }'

List experiences (API)

curl -s https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences \
  -H "Authorization: Bearer <token>" | jq .

Promote experience (API)

Move an experience to the next lifecycle state (e.g., draft to staging, staging to live):

curl -X POST https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/<id>/promote \
  -H "Authorization: Bearer <token>"

Pause experience (API)

Pause a live experience (can be resumed later):

curl -X POST https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/<id>/pause \
  -H "Authorization: Bearer <token>"

Rollback experience (API)

Roll back an experience to a previous build version:

curl -X POST https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/<id>/rollback \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "target_version": "<version>"
  }'

Retire experience (API)

Permanently retire an experience (terminal state):

curl -X POST https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/<id>/retire \
  -H "Authorization: Bearer <token>"

What a hydramancer writes, and who reads it

An experience carries the text its author owes everyone else:

Field For Read when
label the title always
description anyone: what this is, in a sentence or two always
space_requirements what the ROOM must be: size, light, floor, walls choosing a room, weeks ahead
peripherals what a visitor touches, and who brings it procurement
compute what runs it, and who brings that procurement
software how the build is obtained and deployed procurement
staffing how many people, and what they do writing the rota
setup what to do ONCE, before the first visitor install day
instructions what to say and do to run ONE visitor every visitor, all day
troubleshooting named failure modes and their fixes in a hurry, visitor waiting
expert_contact who knows best how to USE it, which is not who built it a volunteer is stuck
developer_contact who to reach about the BUILD: crashes, bugs, missing features the build is wrong
owner_contact the person at the organization that commissioned it may this change at all
briefing_url fuller material when a paragraph is not enough always

These live on the experience rather than on a venue, because the experience is what its author owns and already has access to, and because the same experience runs at more than one venue and should not have its description retyped at each.

setup is venue independent, and that is deliberate. How one installation switches on, and where its mouse is kept, belongs to the room in hydravenues, not here. The Castle Viewer manual opens by taking the mouse from a wooden cabinet to the left of a wall TV, which is true at Rupelmonde and nowhere else; the same experience runs at FTI on two different touch screens. Put what the software needs here, and what this installation needs on the room.

Why setup, instructions and troubleshooting are three fields. They were one, and the Laser Dance event guide separated them for us: a three step room scan done once, a six step demo done two hundred times a day, and six failure modes read under pressure. Different readers, different moments, and they fail independently.

space_requirements is the one that cannot be fixed on the day. Laser Dance needs at least 3m between its buttons, good light but no direct sunlight, a floor that is not shiny and walls that are not blank. You cannot lay a carpet at 09:00 on opening morning. Write the mitigation next to the constraint: "avoid shiny floors, or lay down a carpet" is actionable, "avoid shiny floors" starts an argument.

They are carried in the live projection, so a body and the people at that venue receive them. Hosting text that stops at the library helps nobody on the floor.

enable_microphone is also settable through create and update now. It was served to bodies but could only be set by hand-editing YAML.

The two blocks, and the tag that holds them together

An Experience is split into two embedded blocks plus a short spine:

Block Holds Read by
spine name, label, status, owner, developer, expert_contact, watch_name, open_question, share_token, editors, districts, timestamps everything
Streaming stream, the four build numbers, release_path, exe_path, stream_mode, input_mode, steam_app_id, auto_promote, enable_microphone, orientation hydrabody, hydracluster, the heads
Hosting description, instructions, briefing_url, peripherals, compute, software, space_requirements, staffing, setup, troubleshooting, developer_contact, owner_contact people, standing up, often in a hurry

Both blocks carry yaml:",inline", and both sit where their fields used to sit, so the file on disk and the JSON on the wire are byte for byte what they were before the split. Nothing downstream had to change.

The inline tag is load bearing, and both ways of breaking it are silent.

Both are caught by internal/store/split_test.go. Before changing either block, run the whole package against a copy of the real file:

hydracluster exec node-50ab5309 \
  "incus exec hydraexperiencelibrary -- cat /root/.hydraexperiencelibrary/experiences.yaml" > /tmp/live.yaml
HYDRALIB_LIVE_YAML=/tmp/live.yaml go test ./internal/store/

That test skips when the variable is unset, so a green suite without it proves less than it looks. The fixtures are written by the same struct they verify; only the real file catches a field the struct never had.

Label, developer and expert_contact are on the spine on purpose. They belong in Hosting by meaning. They were left out because the admin templates bind them by dotted path, html/template resolves those at request time, and build, vet and test all stay green while /admin returns 500 in production. Revisit after FTI, together with internal/web/templates/*.html and the iPad head's decoder, which treats label as non-optional.

List live experiences (API)

Returns the experiences a body at a given location should have. Used by hydrabody to discover which builds to download. Supports optional district and venue query parameters.

An experience is returned when it is live with a production build, AND it has something to run: either a registered build with a URL, or an externally managed build, meaning a steam_app_id or an exe_path already on the body's disk. Those externally managed titles come back with an EMPTY build_url, which is correct and not a fault. Before #721 any experience with an exe_path was served with an empty build_url even when it had a perfectly good build, so no fresh body could auto-install it.

Venue matching is exact, and an empty venues list is not a wildcard. An experience is scoped as districts: [{name, venues: [...]}]. When a request supplies a venue, the experience must list that venue explicitly; a district entry with an empty venues list matches only a request that supplies no venue at all. hydrabody ALWAYS sends a venue (?district=<d>&venue=<v>, see pkg/provider/experiences.go), so an experience that does not name the venue is invisible to every body there. This is the usual reason a freshly scoped experience does not appear at a new venue.

# All live experiences
curl -s https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/live \
  -H "Authorization: Bearer <token>" | jq .

# Live experiences for a specific venue
curl -s "https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/live?district=brussels&venue=mercator-hall" \
  -H "Authorization: Bearer <token>" | jq .

Response fields:

Field Notes
name Experience identifier (slug)
label Human-readable display name (omitted if empty)
build_number Production build number
build_url Download URL for the build ZIP
exe_path Path to the executable on body machines
orientation portrait or landscape (omitted if landscape)
input_mode absolute-mouse, native-touch, or relative-mouse; omitted means the client's default
enable_microphone true if the experience uses voice input via hydravoice (omitted if false)
[
  {"name": "rupelmonde-castle-viewer", "build_number": 1, "build_url": "https://releases.experiencenet.com/builds/...", "exe_path": "C:\\experiences\\rupelmonde-castle-viewer\\Rupelmonde.exe"}
]

Start stream (API)

Returns a URL to hydraheadwebstream for browser streaming of the given experience:

curl -X POST https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/<name>/stream \
  -H "Authorization: Bearer <token>"

Response:

{
  "stream_url": "https://hydraheadwebstream.experiencenet.com/?experience=<name>"
}

Requires hydraheadwebstream_url to be configured.

Pipeline health check (API)

End-to-end health check of the entire deployment pipeline: hydraperforce, hydrarelease, hydradistrict, hydracluster, hydramirror, and local experience status. Supports filtering by district and experience name.

# Full pipeline health for a district and experience
curl -s https://hydraexperiencelibrary.experiencenet.com/api/v1/pipeline/health?district=bxl1-test\&experience=mercator-talks \
  -H "Authorization: Bearer <token>" | jq .

# District-only check
curl -s https://hydraexperiencelibrary.experiencenet.com/api/v1/pipeline/health?district=bxl1-test \
  -H "Authorization: Bearer <token>" | jq .

# Full pipeline check (all experiences, no district filtering)
curl -s https://hydraexperiencelibrary.experiencenet.com/api/v1/pipeline/health \
  -H "Authorization: Bearer <token>" | jq .

Requires the pipeline config section:

pipeline:
  hydraperforce_url: "https://hydraperforce.experiencenet.com"
  hydrarelease_url: "https://releases.experiencenet.com"
  hydradistrict_url: "https://hydradistrict.experiencenet.com"
  hydramirror_url_pattern: "https://{district}.hydramirror.experiencenet.com"

Key Concepts

A local experience has no build (stream_mode: local)

Some experiences are installed on the head and launched there rather than streamed from a body. MendelCraft on cheeky-cactus is the first: Minecraft 1.18.2 Forge through Prism Launcher, rendering on the Mac Mini itself.

Mark it with stream_mode: local. The field already existed and already carried xr; this is one more value on it.

curl -sk -X POST https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H 'Content-Type: application/json' \
  -d '{"name":"mendelcraft","label":"MendelCraft","stream_mode":"local",
       "districts":[{"name":"bxl1-test-2","venues":["mobile-kit"]}]}'
curl -sk -X PUT .../api/v1/experiences/mendelcraft -d '{"status":"live"}'

It goes live with production_build: 0 and that is correct. The live catalog normally drops an experience with no build, because a body would have nothing to download and nothing to run. A local experience is delivered by the machine it sits on, so no build will ever arrive and the usual rule would keep it out of every catalog forever. handleLiveExperiences exempts it, and only it: a STREAMED experience with no build is still dropped, which is the check that catches a half-finished upload.

Consequences worth knowing:

Issue #833.

A title that is not Unreal (launch_args)

hydrabody appends Unreal window arguments to every Sunshine command it registers: -ResX=1920 -ResY=1080 -windowed -ForceRes, plus -nosound on a muted body and -WinX/-WinY on a multi-slot one. A title that does not know those switches can refuse to start on them. World of Warcraft shows its "Command Line Help" dialog, which streams a dialog to the head while the body, Sunshine and the head all report success.

launch_args turns them off. It has three states, and the difference between the first two is the whole point:

Value Meaning
absent keep the Unreal arguments. Every experience that existed before this field
"" register the executable with no arguments at all
"-windowed -console" register exactly these, and none of Unreal's
# A title that takes no arguments.
curl -sk -X PUT https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/wow \
  -H "Authorization: Bearer $ADMIN_TOKEN" -H 'Content-Type: application/json' \
  -d '{"launch_args":""}'

# Put it back on the Unreal arguments. null, not "" — they are different states.
curl -sk -X PUT .../api/v1/experiences/wow -d '{"launch_args":null}'

Traps:

Issue #1116.

Reader tokens

Every consumer used to hold the same credential. hydravenues needs the copy for a venue guide, and its token could also read all 14 share tokens and follow one to become an editor of that experience (hydraissue #775).

Give a consumer that only reads a reader token:

server:
  admin_token: "..."          # hydramancer: the policy point, needs the secrets
  reader_tokens:
    hydravenues: "..."        # one per consumer, named, retired on its own

Make one with openssl rand -hex 32. Restart the service, then move the consumer onto it. The two steps are in that order: a token the library does not know about yet answers 401.

To check which class a token is in:

# A reader gets the copy and not the secrets.
curl -s -H "Authorization: Bearer $TOK" \
  https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences \
  | grep -c share_token          # 0 for a reader, more than 0 for an admin
# And a reader cannot write.
curl -s -o /dev/null -w '%{http_code}\n' -X PUT \
  -H "Authorization: Bearer $TOK" -d '{}' \
  https://hydraexperiencelibrary.experiencenet.com/api/v1/experiences/laser-dance
# 401 for a reader

What a reader may see is readerExperience in internal/api/wire.go. It is an allowlist, so a field added to the store does not reach readers until somebody puts it there. TestReaderFieldsAreDeclared fails on a store field that is in neither the allowlist nor withheldFromReaders, with its reason. Do not answer that failure by adding the field to both.

Sharing an experience: public, share_token, editors

Three separate answers that used to be two tangled ones.

public used to be derived from share_token being non-empty, so retiring a link also took the page private, and taking a page private also destroyed the link and every editor it had earned.

Troubleshooting

YAML corruption

If the YAML store becomes corrupted (partial writes, disk issues):

  1. Stop the service: systemctl stop hydraexperiencelibrary
  2. Check the data directory: ls -la /root/.hydraexperiencelibrary/
  3. Look for malformed YAML files -- inspect the index and individual entity files
  4. Restore from backup if needed, or manually fix the YAML syntax
  5. Start the service: systemctl start hydraexperiencelibrary

Service won't start

  1. Check logs for the error: journalctl -u hydraexperiencelibrary -n 50 --no-pager
  2. Verify config exists and is valid: cat /root/.hydraexperiencelibrary/config.yaml
  3. Check if the port is already in use: ss -tlnp | grep <port>
  4. Verify the binary exists and is executable: ls -la $(which hydraexperiencelibrary)
  5. Try running manually to see output: hydraexperiencelibrary serve

Auth token issues

  1. Verify the token by calling hydraauth directly: curl -s https://hydraauth.experiencenet.com/api/v1/verify -H "Authorization: Bearer <token>"
  2. Check that hydraauth is reachable from the experience library server: incus exec hydraexperiencelibrary -- curl -s https://hydraauth.experiencenet.com/api/v1/health (via exec on node-50ab5309)
  3. If tokens are consistently rejected, check clock sync: incus exec hydraexperiencelibrary -- date -- token validation may fail if the clock is skewed

Experience stuck in wrong state

  1. Check the experience YAML file in /root/.hydraexperiencelibrary/ for the current state
  2. Review logs for failed state transitions: journalctl -u hydraexperiencelibrary --since "1 hour ago" | grep <experience-id>
  3. If the state is inconsistent, stop the service, manually correct the YAML file, and restart

Not picking up new builds from HydraRelease

  1. Check that the SSE connection to HydraRelease is active in the logs
  2. Verify HydraRelease is healthy: curl -s https://hydrarelease.experiencenet.com/api/v1/health
  3. Check for network issues between the servers: incus exec hydraexperiencelibrary -- curl -s https://hydrarelease.experiencenet.com/api/v1/health
  4. Restart the service to re-establish the SSE connection if needed

Backup & Recovery

What is backed up

OBSOLETE: the Hetzner snapshot arrangement covered the retired dedicated server. The scale's state lives as a host disk device on pi-node-004-nvme and survives image rebuilds; a scale-level backup policy is an open item.

The snapshot covers the entire server disk, including all experience and build records.

Restore procedure

  1. In the Hetzner Cloud Console (hydraexperiencenet project), open Servers → hydraexperiencelibrary → Backups.
  2. Power off the server, restore the snapshot, then power on.
  3. Verify:
    curl https://hydraexperiencelibrary.experiencenet.com/api/v1/health
    

Three contacts, named by the side they are on

Renamed 2026-10-15, owner ruling. There is no field called contact any more.

field the question it answers the side
expert_contact how do I USE this neither: whoever has run it most
developer_contact the BUILD is wrong, who fixes it the developer
owner_contact may this change at all the organization that commissioned it

Why it was worth a rename six days before a zone opened. contact said who to reach and not which side they were on. The Mercator booth was filed under Sam Versele, who represents Visit Flanders, the OWNER. Visit Flanders cannot fix a build. soulmade can, and Kris is the person there. One ambiguous name put the wrong person on the escalation path, and it was written down twice before anybody noticed. A name that forces the question cannot be filled in wrongly by accident.

owner is an organization slug. It names a party, not a person, so before owner_contact an owner's representative had nowhere to live and landed in the field meant for the maker.

Old files still load. expert and contact are read into LegacyExpert and LegacyContact, copied by migrateContactNames on every store.Load, and cleared, so the next save writes only the new keys. A value already on a new name wins and the old key is dropped as stale. Tests: internal/store/contacts_test.go.

The legacy fields are json:"-", so they never reach the API and the reader allowlist walk in internal/api/reader_token_test.go skips them. A reader token gets all three contacts: assembling a guide is what the fields are for.

Delete migrateContactNames only when no file anywhere carries the old keys, hydrabackup copies included. Until then it costs one pass over 22 experiences.

Experience launch totals

Each experience detail page shows Recorded launches. The read-authorized endpoint GET /api/v1/experiences/{name}/usage returns launch_count, reporting_heads, tracking_since, and last_sync. Existing reader tokens may read this endpoint; they cannot write usage or alter the experience.

Every 30 seconds the service reads authenticated head telemetry from HydraCluster. Supporting HydraHeads persist cumulative per-experience totals in launch-counts.json and report them as diagnostics.experience_launches. The library retains a per-head/per-installation high-water mark in experience-usage.yaml, beside experiences.yaml. Repeated or older snapshots never add duplicate starts. Offline or removed heads retain their previously recorded counts. An installation ID allows a deliberate head reset without losing earlier totals. Back up both YAML files; never replace the usage file with zeros after a read/parse error.

Local experiences count when the matched game process appears; subprocess streams count when launched, and in-process streams count on their first streaming report. Failed launches and repeated state messages do not count. These are launches, not unique visitors or completed sessions. Earlier history is not inferred, and clients without launch telemetry are not included. The UI distinguishes no reporting heads from a measured total and shows sync time. If cluster access fails, old counts remain readable and the collector logs the failure; check last_sync for stale data.