HydraIssues

Onboarding a venue needs a config edit and a restart; scope should be data the service reads while running
open improvement Priority: medium Project: hydravenues Reporter: 11 Nov 2026 13:14

Description

Giving a new venue its floor plan takes four steps today, and two of them are
not data work. PUT /api/v1/venues/{id}/plan (v0.61.0) closed the part that
was missing, but the account doing it still has to be let in first, and
letting it in means editing the scale's config.yaml by hand and restarting
the container. A new row of access data should not need a service restart.

What is actually in the way

The scope list is read once, at boot. cli/serve.go:83 copies
cfg.IAMNim.VenueScopes into Server.VenueScopes when the process starts,
and nothing re-reads it. Grants are the same kind of data and behave the
opposite way: access/grant.go:126 does an os.ReadFile of the venue's
grants file on every request, so a grant written now is in force now. Two
lists that both answer "who may act here", one live and one frozen until the
next restart.

The restart is a real outage. It is an incus restart of the scale.
Measured twice yesterday, once after an image rebuild and once after a plain
restart: the edge answers no available server for well under a minute and
then recovers. Short, but it is still taking the venue service away from the
floor in order to add one line of configuration.

The refusal explains nothing. A scoped account asking about an unscoped
venue gets a bare 403. access/resolve.go:114 sets Platform = false and
returns with no role at all, before organization membership is considered
and before a single grant is read. So the one place an operator would look,
that venue's grants.yaml, cannot contain the answer, and the actual cause
is a file on the node that most people cannot see.

Nothing reconciles the list against the venues that exist. A venue can be
created and never scoped. A scoped id can outlive the venue it names. Both
are silent.

Scoping an account also removes its platform authority everywhere, its
own organization's venues included, because Platform = false runs before
the list is even searched. That is the part that has already cost real time:
platform authority had been quietly covering for venues that had no grants
file at all, and the day an account was scoped that cover disappeared.

What is not wrong

The capability model. EditLayout on the install route is right: the owner
and buildout may say where a wall is and the floor may not. None of this is
an argument for a weaker gate. It is an argument for the gate being made of
data the service can read while it is running, and for it saying why it
refused.

Opinion, in the order I would do it

1. Scope by organization, not by venue id. The thing the list is trying
to say is "this account works on these customers". The resolver already
treats organization membership as the primary route to a role
(resolve.go:157: organization first, grant second, inheritance third). A
scope expressed as organization slugs needs no edit at all when venue sixteen
is created inside an organization that is already named, which removes the
onboarding step rather than making it faster. Today nine of the fifteen
venues are organization_id: hydra and resolve owner by membership alone, so
most of the fleet is already working this way.

2. If it must stay per-venue, move it next to the grants and read it per
request.
Same directory, same fail-closed parse, same "a broken file hands
out nothing" rule. Then adding a venue to a scope is a data write like every
other access change, and no restart is involved. One caveat that has to be
designed in, not bolted on: a scope that the scoped account can widen is not
a limit, so this file must not be writable through the venue API. Platform
admin or the node, nothing else.

3. Either way, make the refusal say why. The service knows. The plan page
already does this well for the neighbouring case: somebody holding a hall
code is told their code is for the whole hall rather than being shown a page
with the controls quietly missing. The API should be as plain: this account
is limited to named venues and this venue is not one of them.

I would not do 2 and 1 both. 2 is the fallback if organization scoping is
rejected for a reason I cannot see from here.

Evidence

  • internal/cli/serve.go:83 — scopes read once into the server
  • internal/access/resolve.go:114 — scope short-circuit, Platform = false,
    returns before org membership and before grants
  • internal/access/resolve.go:157 — organization first, grant second
  • internal/access/grant.go:126 — grants read from disk per request
  • docs/runbooks/runbook.md, "A new venue may need its id in venue_scopes
    first" — the onboarding order as it stands

Live state on 11 November 2026: fifteen venues, fifteen scoped, exact match
both ways, nine of them organization_id: hydra. So nothing is blocked
today. The cost lands on the next venue created.

This issue is about the service and not about one venue, so it carries no
session.venue on purpose rather than by omission.

Session Context