rehearsal-5 task 1/13: Design tier — ADRs 0207 (standing rehearsal community), 0208 (device landing goes live), 0209 (files on a member device) #842

Closed
opened 2026-08-25 20:14:26 +00:00 by ben · 1 comment
Owner

Part of the #183 phase-5 rehearsal arc (device-add + Nextcloud-on-device on a standing rented community).

  • Spec: docs/superpowers/specs/2026-08-25-183-phase-5-device-nextcloud-rehearsal-design.md
  • Plan: docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md — this ticket is Task 1, carried verbatim below. The plan's Global Constraints apply to every step.

Task 1: Design tier — ADRs 0207 (standing rehearsal community), 0208 (device landing goes live), 0209 (files on a member device)

Files:

  • Create: docs/adr/0207-standing-rehearsal-community-staleness-gated-refound.md
  • Create: docs/adr/0208-device-add-landing-goes-live-mesh-fact-fleet-admission.md
  • Create: docs/adr/0209-files-on-a-member-device-composition-oidc-split-mesh-route.md
  • Modify: docs/architecture/02-containers.md (agent now lands enrollments; gateway /get serves the pinned agent — ADR 0042 same-commit rule)
  • Modify: STATUS.md

Interfaces:

  • Produces: the ruled vocabulary every later task uses —
    MeshAddressFact (the device's wt0 IP, reported at land, stored in placement);
    ComposeMemberModules (member entry-module composition mirroring ComposeGatewayCohost);
    the OIDC split (kanidm client provisioning = gateway-side oneshot; device-side occ config consumes the public discovery URL + a SHARED clan-var client secret);
    the two-deploy placement order (device first, then gateway);
    the removal verb (POST /api/v1/provision/devices/{id}/remove = empty-services selection + RemoveNode + gateway route rewrite);
    the reaper wall re-rule (wall destroys only lease-less boxes).

  • Step 1: Write ADR 0207 — status accepted # 2026-08-25 — ruled by Ben (phase-5 scoping, spec 2026-08-25-183-phase-5). Decided: the standing fixture (home layout test-results/standing-rented/{state,facts.json}), staleness-gated re-found on the founding SHA (agent/ go.mod go.sum internal/ path list, origin/main base), executor-renewed lease each tick, honest reaper (renewal-not-exemption; executor death → lapse → reap → next drive re-founds), gateway-only baseline enforced by the standing leg, re-found legs recorded (ruling 7). Rejected: per-drive re-found (cost, LE budget), idss-rental-hold on the standing box (zombie on executor death), calendar re-founds.

  • Step 2: Write ADR 0208 — Decided: (1) agent enroll continues past Pending: await the operator's decision over the enrollwire device transport, then land via join.Orchestrator.Enroll; honest terminal copy for approved/declined; (2) real device-side adapters for join.Mesh (netbird up with the admission's setup key on the stock OS), join.Clan (community CA into the system trust store + reachability proof), join.Takeover (stage-only, per the takeover-ready contract ADR 0059) — each still fails loud when its tool is absent; (3) ConfirmEnrolled carries the device's mesh address; the ledger stores it; approve-side admission calls Config().AddNode with node id node-<requestID>, the probe's resources, Install{Mode: ModeFull, TakeoverReady: true, Consent: <ledger consent record>}, and the mesh address — the fleet sees the device the moment it lands; (4) the gateway serves the one-liner: bare GET /get (no arch) returns the POSIX install script (fetch /get?arch=, install unit, idss-agent install "$1"), and the gateway env file exports IDSS_AGENT_CACHE seeded at deploy from the fleet's pinned agent (ADR 0051 lockstep).

  • Step 3: Write ADR 0209 — Decided: (1) member full-install machines gain an entry module: ComposeMemberModules(node, present) renders machines/<node>/configuration.nix importing networking.nix, disko.nix, platform.nix, access.nix + present service modules (the gateway's presentModules pattern); (2) standalone files render binds nginx on the wt0 interface port 80 and opens it in the firewall (code.go/chat.go sibling pattern) — MeshTarget = <device-mesh-ip>:80; (3) OIDC split: the kanidm OAuth2 client oneshot renders on the GATEWAY beside the files placement (it already owns kanidm + its vars); the client secret becomes a SHARED clan var both machines read; the device-side nextcloud-oidc oneshot drops KANIDM_URL=localhost and the kanidm-package dependency, consuming the public discovery URL https://id.<apex>/… (the rented path is public — real DNS + LE certs) and the shared secret; (4) placement deploy = one config commit, two single-node deploys, device first; the front-door LiveSet re-supplies the public kanidm block (the whole-rewrite rule); (5) removal = POST /api/v1/provision/devices/{id}/remove → LOSES-consented empty-selection deploy: detach services, rewrite the front door without the route, deploy gateway, Config().RemoveNode, revoke the device's grant; (6) configRepoInventory derives Datasets from placement (files → one "Files & documents" dataset homed on its node) so LOSES speaks live; (7) rental-reap.sh wall re-rule: the wall destroys only boxes with NO idss-rental-expires-* tag; a live future lease governs alone.

  • Step 4: Verify — grep -c 'status: accepted' docs/adr/020[789]*.md → 3; architecture diagram updated in the same commit.

  • Step 5: Commit — git commit -m "rehearsal-5: ADRs 0207-0209 — standing community, device landing goes live, files on a member device (task 1 of #<ticket>)" with the STATUS lead updated.


Global Constraints (from the plan)

  • Nothing fabricated (ADR 0100): every landed fact is read from the box; a
    failure is a named error, never a masked success. No sandbox-green claim (#377).
  • The wipe consent is given at the machine (ADR 0024) and shown-not-re-asked
    at P4-S3x; the takeover runs at provisioning's first deploy, never at join.
  • One placement deploy = device closure + gateway route in one config-repo
    commit, then two single-node clan.Deploy calls, device first (ruling: a
    route to a dead service is the honest failure, a service with no route is
    invisible).
  • Standing community: home test-results/standing-rented/; staleness gate =
    oc_bootstrap_staleness pattern over agent/ go.mod go.sum internal/; the
    reaper stays honest — renewal, not exemption (idss-rental-hold is for
    humans, the executor never sets it).
  • Do not destabilize live drives: #720 (rented confirm loop, elitebook) and
    #721/#722 (workstation) keep running; the prefix extraction (Task 10) is
    behavior-preserving and #720 must stay green across it. Never touch the
    executors' env files from a ticket.
  • Tracker gotcha: labels via POST/DELETE /issues/<n>/labels, never in an
    issue PATCH. "closes #NNN" in commit messages auto-closes — say "task N of
    #NNN" instead.
  • ADR numbers: 0207/0208/0209 assumed — re-check git ls-tree origin/main docs/adr/
    at mint (IDIP + observability swarm lanes are minting concurrently).
  • STATUS.md updated in the same commit as any project-state change;
    git pull --rebase immediately before a STATUS commit (shared checkout).
  • Go: gofmt, go vet ./..., go test ./... green; TS: pnpm -r typecheck +
    unit suites green, pre-land.
Part of the **#183 phase-5 rehearsal arc** (device-add + Nextcloud-on-device on a standing rented community). - Spec: `docs/superpowers/specs/2026-08-25-183-phase-5-device-nextcloud-rehearsal-design.md` - Plan: `docs/superpowers/plans/2026-08-25-183-phase-5-device-nextcloud-rehearsal.md` — this ticket is **Task 1**, carried verbatim below. The plan's Global Constraints apply to every step. --- ### Task 1: Design tier — ADRs 0207 (standing rehearsal community), 0208 (device landing goes live), 0209 (files on a member device) **Files:** - Create: `docs/adr/0207-standing-rehearsal-community-staleness-gated-refound.md` - Create: `docs/adr/0208-device-add-landing-goes-live-mesh-fact-fleet-admission.md` - Create: `docs/adr/0209-files-on-a-member-device-composition-oidc-split-mesh-route.md` - Modify: `docs/architecture/02-containers.md` (agent now lands enrollments; gateway `/get` serves the pinned agent — ADR 0042 same-commit rule) - Modify: `STATUS.md` **Interfaces:** - Produces: the ruled vocabulary every later task uses — `MeshAddressFact` (the device's wt0 IP, reported at land, stored in placement); `ComposeMemberModules` (member entry-module composition mirroring `ComposeGatewayCohost`); the OIDC split (kanidm client provisioning = gateway-side oneshot; device-side occ config consumes the public discovery URL + a SHARED clan-var client secret); the two-deploy placement order (device first, then gateway); the removal verb (`POST /api/v1/provision/devices/{id}/remove` = empty-services selection + `RemoveNode` + gateway route rewrite); the reaper wall re-rule (wall destroys only lease-less boxes). - [ ] **Step 1: Write ADR 0207** — status `accepted # 2026-08-25 — ruled by Ben (phase-5 scoping, spec 2026-08-25-183-phase-5)`. *Decided:* the standing fixture (home layout `test-results/standing-rented/{state,facts.json}`), staleness-gated re-found on the founding SHA (`agent/ go.mod go.sum internal/` path list, `origin/main` base), executor-renewed lease each tick, honest reaper (renewal-not-exemption; executor death → lapse → reap → next drive re-founds), gateway-only baseline enforced by the `standing` leg, re-found legs recorded (ruling 7). *Rejected:* per-drive re-found (cost, LE budget), `idss-rental-hold` on the standing box (zombie on executor death), calendar re-founds. - [ ] **Step 2: Write ADR 0208** — *Decided:* (1) `agent enroll` continues past Pending: await the operator's decision over the enrollwire device transport, then land via `join.Orchestrator.Enroll`; honest terminal copy for approved/declined; (2) real device-side adapters for `join.Mesh` (netbird up with the admission's setup key on the stock OS), `join.Clan` (community CA into the system trust store + reachability proof), `join.Takeover` (stage-only, per the takeover-ready contract ADR 0059) — each still fails loud when its tool is absent; (3) `ConfirmEnrolled` carries the device's mesh address; the ledger stores it; approve-side admission calls `Config().AddNode` with node id `node-<requestID>`, the probe's resources, `Install{Mode: ModeFull, TakeoverReady: true, Consent: <ledger consent record>}`, and the mesh address — the fleet sees the device the moment it lands; (4) the gateway serves the one-liner: bare `GET /get` (no `arch`) returns the POSIX install script (fetch `/get?arch=`, install unit, `idss-agent install "$1"`), and the gateway env file exports `IDSS_AGENT_CACHE` seeded at deploy from the fleet's pinned agent (ADR 0051 lockstep). - [ ] **Step 3: Write ADR 0209** — *Decided:* (1) member full-install machines gain an entry module: `ComposeMemberModules(node, present)` renders `machines/<node>/configuration.nix` importing `networking.nix, disko.nix, platform.nix, access.nix` + present service modules (the gateway's `presentModules` pattern); (2) standalone files render binds nginx on the wt0 interface port 80 and opens it in the firewall (`code.go`/`chat.go` sibling pattern) — `MeshTarget = <device-mesh-ip>:80`; (3) OIDC split: the kanidm OAuth2 client oneshot renders on the GATEWAY beside the files placement (it already owns kanidm + its vars); the client secret becomes a SHARED clan var both machines read; the device-side `nextcloud-oidc` oneshot drops `KANIDM_URL=localhost` and the kanidm-package dependency, consuming the public discovery URL `https://id.<apex>/…` (the rented path is public — real DNS + LE certs) and the shared secret; (4) placement deploy = one config commit, two single-node deploys, device first; the front-door LiveSet re-supplies the public kanidm block (the whole-rewrite rule); (5) removal = `POST /api/v1/provision/devices/{id}/remove` → LOSES-consented empty-selection deploy: detach services, rewrite the front door without the route, deploy gateway, `Config().RemoveNode`, revoke the device's grant; (6) `configRepoInventory` derives `Datasets` from placement (files → one "Files & documents" dataset homed on its node) so LOSES speaks live; (7) `rental-reap.sh` wall re-rule: the wall destroys only boxes with NO `idss-rental-expires-*` tag; a live future lease governs alone. - [ ] **Step 4: Verify** — `grep -c 'status: accepted' docs/adr/020[789]*.md` → 3; architecture diagram updated in the same commit. - [ ] **Step 5: Commit** — `git commit -m "rehearsal-5: ADRs 0207-0209 — standing community, device landing goes live, files on a member device (task 1 of #<ticket>)"` with the STATUS lead updated. --- ## Global Constraints (from the plan) - **Nothing fabricated (ADR 0100):** every landed fact is read from the box; a failure is a named error, never a masked success. No sandbox-green claim (#377). - **The wipe consent is given at the machine (ADR 0024)** and shown-not-re-asked at P4-S3x; the takeover runs at provisioning's first deploy, never at join. - **One placement deploy = device closure + gateway route** in one config-repo commit, then two single-node `clan.Deploy` calls, device first (ruling: a route to a dead service is the honest failure, a service with no route is invisible). - **Standing community:** home `test-results/standing-rented/`; staleness gate = `oc_bootstrap_staleness` pattern over `agent/ go.mod go.sum internal/`; the reaper stays honest — renewal, not exemption (`idss-rental-hold` is for humans, the executor never sets it). - **Do not destabilize live drives:** #720 (rented confirm loop, elitebook) and #721/#722 (workstation) keep running; the prefix extraction (Task 10) is behavior-preserving and #720 must stay green across it. Never touch the executors' env files from a ticket. - **Tracker gotcha:** labels via `POST/DELETE /issues/<n>/labels`, never in an issue PATCH. "closes #NNN" in commit messages auto-closes — say "task N of #NNN" instead. - **ADR numbers:** 0207/0208/0209 assumed — re-check `git ls-tree origin/main docs/adr/` at mint (IDIP + observability swarm lanes are minting concurrently). - **STATUS.md** updated in the same commit as any project-state change; `git pull --rebase` immediately before a STATUS commit (shared checkout). - Go: `gofmt`, `go vet ./...`, `go test ./...` green; TS: `pnpm -r typecheck` + unit suites green, pre-land.

Close report — phase-5 design tier landed

Commit 70a3bce6 — rehearsal-5: ADRs 0208-0210 — standing community, device landing goes live, files on a member device (task 1 of #842).

Ruling 1 — the ADR numbers shifted by one

Ruled by agent under ADR 0174 — veto anytime. Two-way door: a file name and a
set of cross-references, revertible with a rename commit. What proves it:
git ls-tree origin/main docs/adr/ shows 0207-design-keri-stack-version-pins.md
(#771, the concurrent IDIP lane) had already taken 0207, so minting there would
have collided with an accepted ADR.

assumed ruled ADR
0207 0208 the standing rehearsal community — staleness-gated re-found
0208 0209 device-add's landing goes live — mesh fact, fleet admission, /get
0209 0210 files on a member device — composition, OIDC split, mesh route

The plan's own Global Constraints line asked for exactly this re-check at mint;
it now records the mapping instead of the assumption, and the plan's task
headings, file paths and commit-message templates are renumbered to match.
A mapping comment is posted on #843–#850, #852, #853 so no worker writes the
wrong number into a commit.

What landed

  • docs/adr/0208-standing-rehearsal-community-staleness-gated-refound.md —
    the standing fixture (test-results/standing-rented/{state,facts.json}, the app
    launched on the persistent IDSS_STATE_DIR, OPERATOR_PASSWORD as the
    credential); staleness-gated re-found on the founding SHA against
    origin/main over OC_BOOTSTRAP_AGENT_PATHS (agent/ go.mod go.sum internal/,
    #600's own gate shape); the executor renews the lease each tick and nothing
    else does
    , so executor death → lapse → reap → next drive re-founds (renewal,
    not exemption); the standing leg's gateway-only baseline with strays
    removed and evidence-logged; re-found legs recorded under their own keys
    (spec ruling 7); one standing slug, one LE cert. Rejected: per-drive re-found
    (money + LE issuance — phase-4's rehearsal-b burn), idss-rental-hold on the
    standing box (ADR 0189 amendment 2's zombie), calendar re-founds, any
    standing-community mode inside the product.

  • docs/adr/0209-device-add-landing-goes-live-mesh-fact-fleet-admission.md —
    opens on the plan-time survey's finding that device-add is done at LIBRARY
    level only (no production caller for join.Orchestrator.Enroll, fail-loud port
    stubs, no AddNode, Install.TakeoverReady/Consent written nowhere, no
    mesh address fact anywhere
    , bare /get 400s). Ruled: agent enroll continues
    past Pending to a terminal outcome with honest copy at both ends; real
    device-side adapters that still fail loud when the tool is absent (ADR 0100);
    takeover staged only (ADRs 0024/0059 — the wipe is provisioning's first
    deploy); the device's own wt0 address reported at landing, never inferred;
    approve-side Config().AddNode admission with the probe's resources, the
    machine-given consent and the mesh address; bare /get = the POSIX script,
    ?arch= = the binary, both from an IDSS_AGENT_CACHE seeded at deploy from the
    fleet's pin (ADRs 0054/0051).

  • docs/adr/0210-files-on-a-member-device-composition-oidc-split-mesh-route.md —
    all seven rulings: ComposeMemberModules (the presentModules pattern,
    imports only files that exist — the dead-text failure gateway_attach_test.go
    guards); a wt0:80 listener opened on wt0 alone (code.go/chat.go firewall
    pattern) with MeshTarget = <device-mesh-ip>:80, the co-host
    127.0.0.1:8084 shape untouched; the OIDC split (kanidm client
    provisioning stays gateway-side, the client secret becomes a shared clan var,
    the device consumes the public discovery URL derived through the ADR 0113
    authority); one config commit, two single-node deploys, device first;
    removal as a verb (POST /api/v1/provision/devices/{id}/remove); placement-derived
    Datasets so LOSES can name what is lost; and the rental-reap.sh wall
    re-ruled to destroy only lease-less boxes.

  • docs/architecture/02-containers.md — updated in the same commit
    (ADR 0042): the agent node now says it owns the join end to end (awaits the
    decision, lands, reports its wt0 address); the API node's /get says
    script-bare / binary-by-arch from a deploy-seeded cache; a new
    caddy → services edge for the front-door→mesh→placed-service path that
    LiveService.MeshTarget was built for and had never carried; and the two new
    ADRs added to Decisions encoded.

  • STATUS.md — new lead in the same commit, carrying the number-shift mapping
    and the three ADRs' rulings; the arc lead demoted to Prior lead.

Proof

  • Step 4's gate: grep -c 'status: accepted' → 1 each on all three files, 3
    total
    ; git ls-tree origin/main docs/adr/ confirms 0208/0209/0210 were free
    at mint and re-confirmed free after the pre-push git pull --rebase.
  • Architecture diagram updated in the same commit — ADR 0042 satisfied.
  • Docs-only commit: no Go or TS surface changed, so no build gate applies.

Not done here (deliberate)

The downstream ticket bodies still carry the plan's assumed numbers verbatim.
They are the swarm's verbatim task contract, so they were left intact and given a
mapping comment rather than a body rewrite — the plan file in the repo is the
corrected source, and each body already carried the "numbers assumed, re-check at
mint" constraint that this ruling answers.

Advances #183; unblocks #843–#850.

## Close report — phase-5 design tier landed **Commit `70a3bce6`** — `rehearsal-5: ADRs 0208-0210 — standing community, device landing goes live, files on a member device (task 1 of #842)`. ### Ruling 1 — the ADR numbers shifted by one Ruled by agent under ADR 0174 — veto anytime. **Two-way door:** a file name and a set of cross-references, revertible with a rename commit. **What proves it:** `git ls-tree origin/main docs/adr/` shows `0207-design-keri-stack-version-pins.md` (#771, the concurrent IDIP lane) had already taken 0207, so minting there would have collided with an accepted ADR. | assumed | **ruled** | ADR | |---|---|---| | 0207 | **0208** | the standing rehearsal community — staleness-gated re-found | | 0208 | **0209** | device-add's landing goes live — mesh fact, fleet admission, `/get` | | 0209 | **0210** | files on a member device — composition, OIDC split, mesh route | The plan's own Global Constraints line asked for exactly this re-check at mint; it now **records the mapping** instead of the assumption, and the plan's task headings, file paths and commit-message templates are renumbered to match. A mapping comment is posted on **#843–#850, #852, #853** so no worker writes the wrong number into a commit. ### What landed - **`docs/adr/0208-standing-rehearsal-community-staleness-gated-refound.md`** — the standing fixture (`test-results/standing-rented/{state,facts.json}`, the app launched on the persistent `IDSS_STATE_DIR`, `OPERATOR_PASSWORD` as the credential); staleness-gated re-found on the **founding SHA** against `origin/main` over `OC_BOOTSTRAP_AGENT_PATHS` (`agent/ go.mod go.sum internal/`, #600's own gate shape); the **executor renews the lease each tick and nothing else does**, so executor death → lapse → reap → next drive re-founds (renewal, **not** exemption); the `standing` leg's gateway-only baseline with strays removed and evidence-logged; re-found legs **recorded** under their own keys (spec ruling 7); one standing slug, one LE cert. *Rejected:* per-drive re-found (money + LE issuance — phase-4's rehearsal-b burn), `idss-rental-hold` on the standing box (ADR 0189 amendment 2's zombie), calendar re-founds, any standing-community mode inside the product. - **`docs/adr/0209-device-add-landing-goes-live-mesh-fact-fleet-admission.md`** — opens on the plan-time survey's finding that device-add is `done` at LIBRARY level only (no production caller for `join.Orchestrator.Enroll`, fail-loud port stubs, no `AddNode`, `Install.TakeoverReady`/`Consent` written nowhere, **no mesh address fact anywhere**, bare `/get` 400s). Ruled: `agent enroll` continues past Pending to a terminal outcome with honest copy at both ends; real device-side adapters that **still fail loud when the tool is absent** (ADR 0100); takeover **staged only** (ADRs 0024/0059 — the wipe is provisioning's first deploy); the device's own `wt0` address reported at landing, never inferred; approve-side `Config().AddNode` admission with the probe's resources, the machine-given consent and the mesh address; bare `/get` = the POSIX script, `?arch=` = the binary, both from an `IDSS_AGENT_CACHE` seeded at deploy from the fleet's pin (ADRs 0054/0051). - **`docs/adr/0210-files-on-a-member-device-composition-oidc-split-mesh-route.md`** — all seven rulings: `ComposeMemberModules` (the `presentModules` pattern, imports only files that exist — the dead-text failure `gateway_attach_test.go` guards); a `wt0`:80 listener opened on `wt0` alone (`code.go`/`chat.go` firewall pattern) with `MeshTarget = <device-mesh-ip>:80`, the co-host `127.0.0.1:8084` shape untouched; the **OIDC split** (kanidm client provisioning stays gateway-side, the client secret becomes a shared clan var, the device consumes the public discovery URL derived through the ADR 0113 authority); **one config commit, two single-node deploys, device first**; removal as a verb (`POST /api/v1/provision/devices/{id}/remove`); placement-derived `Datasets` so LOSES can **name** what is lost; and the `rental-reap.sh` wall re-ruled to destroy only **lease-less** boxes. - **`docs/architecture/02-containers.md`** — updated in the **same commit** (ADR 0042): the agent node now says it owns the join **end to end** (awaits the decision, lands, reports its `wt0` address); the API node's `/get` says script-bare / binary-by-`arch` from a **deploy-seeded** cache; a new `caddy → services` edge for the front-door→mesh→placed-service path that `LiveService.MeshTarget` was built for and had never carried; and the two new ADRs added to *Decisions encoded*. - **`STATUS.md`** — new lead in the same commit, carrying the number-shift mapping and the three ADRs' rulings; the arc lead demoted to *Prior lead*. ### Proof - Step 4's gate: `grep -c 'status: accepted'` → **1 each on all three files, 3 total**; `git ls-tree origin/main docs/adr/` confirms 0208/0209/0210 were free at mint and re-confirmed free after the pre-push `git pull --rebase`. - Architecture diagram updated in the same commit — ADR 0042 satisfied. - Docs-only commit: no Go or TS surface changed, so no build gate applies. ### Not done here (deliberate) The downstream ticket **bodies** still carry the plan's assumed numbers verbatim. They are the swarm's verbatim task contract, so they were left intact and given a mapping **comment** rather than a body rewrite — the plan file in the repo is the corrected source, and each body already carried the "numbers assumed, re-check at mint" constraint that this ruling answers. Advances #183; unblocks #843–#850.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#842
No description provided.