Skip to content

Add live-reservation router add/remove/replace (ADR-0008) - #63

Draft
struanb wants to merge 2 commits into
claude/ded-async-rewritefrom
claude/router-mutation
Draft

Add live-reservation router add/remove/replace (ADR-0008)#63
struanb wants to merge 2 commits into
claude/ded-async-rewritefrom
claude/router-mutation

Conversation

@struanb

@struanb struanb commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Lets a permission-holding developer add/remove/replace routers on a live reservation
(previously frozen at launch), gated by two new role permissions and a profile-level opt-in:

  • New role permissions: addContainerRouter, removeContainerRouter.
  • Reservation standing: can_on(develop) (owner unconditionally, or a named developer).
  • Profile-level opt-in for add only: Profile.userRouters (off by default; bypassed by
    default for role='admin').
  • A router added this way is stamped type=user; removal doesn't depend on that stamp - any
    router (admin-authored or self-added) is removable once permission + standing hold, except the
    auto-injected ide/ssh routers, which can never be removed through this feature.
  • The initial meta.access value defaults to 'owner' if the caller owns the reservation, else
    'developer' (falling back to the allowed-levels list's first entry if that preference isn't
    permitted) - overridable per-call via --access. The allowed-levels list itself defaults to
    every known level unless narrowed via --auth (comma-separated and/or repeatable).
  • gatewayMode (deprecated) makes add fail closed outright.

Full design, rationale, and alternatives considered: docs/adr/0008-router-mutation.md.

Scope: server API + CLI only. The Vue UI surface (devtainer edit-state controls, admin
permission-screen entries) is designed but not yet built - opening as draft for that reason, and
so review can land on the API/CLI shape first.

Testing

  • ./test.sh (full static suite): all green.
  • t/integration/tests/04_access_and_http.py Section F (41 tests): permission/standing/profile-
    gate denial and admin bypass, type=user + default-access-level correctness (owner-adds vs
    developer-adds), duplicate-name collision, ide-type hard-block, removal by a non-creator
    shared developer, replace carrying (or correctly not carrying) access forward, --auth/
    --access interaction including comma-separated and repeated-flag forms, and genuine live-HTTP
    reachability of an admin-added router against the already-running test nginx container. All
    passing live against a running instance.

🤖 Generated with Claude Code

https://claude.ai/code/session_012zoMS7ycYeL4kHsztZ29yy

struanb and others added 2 commits August 21, 2026 19:38
Lets a permission-holding developer add/remove/replace routers on a live
reservation, gated by new addContainerRouter/removeContainerRouter role
permissions, can_on(develop) standing, and a profile-level userRouters
opt-in for add (bypassed by default for admins). Server API + CLI only;
Vue UI is designed but not yet built (see the ADR).

Reservation::Mutate stays a dumb data-mutation layer: it validates that an
already-resolved auth allow-list and initial access level are mutually
consistent, but decides neither. User.pm resolves both - defaulting the
initial access level to 'owner' if the caller owns the reservation, else
'developer' (falling back to the auth list's first entry if that
preference isn't permitted), overridable via an explicit --access; the
auth list defaults to every known level unless narrowed via --auth
(comma-separated and/or repeatable).

See docs/adr/0008-router-mutation.md for the full design and alternatives
considered.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zoMS7ycYeL4kHsztZ29yy
cli/README.md gets a new "Router management" section (list/add/replace/remove,
--auth, --access) alongside the existing user/role/profile sections; usage.md
gets a short cross-reference noting that adding/removing a devtainer's routers
is CLI-only for now, since the UI doesn't have this yet.

ADR-0008's Status line and Consequences section dropped their "Vue UI not yet
built" framing - an ADR records the architecture decision, not a snapshot of
what's shipped, since the UI's build/ship order is a separate call that may
change independently of anything decided here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zoMS7ycYeL4kHsztZ29yy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant