The gateway's /api/config carries the descriptor's community block, not the organization/registry.{id,name} org-config the app reads — every branded app lands on 'Set up … first admin' (ADR 0226 d1/d3) #1825

Closed
opened 2026-09-24 15:26:54 +00:00 by ben · 3 comments
Owner

Symptom

Ben, 2026-09-24, first launch of the whakatohea-demo Android build (matou-app v0.7.3, backend https://whakatohea-demo.idss.nz, any-sync handshake now OK after #1813): the app opens on "Set up WHAKATOHEA DEMO — first admin", i.e. the founding flow. Submitting name + email ends in Setup failed: Failed to fetch. ADR 0226 decision 3: on an IDSS backend the app never founds — a branded app against a gateway can only join. The community is already founded (the descriptor names its AID EEPniUBM…, registry EIb--9e6…, steward ben).

Cause — /api/config is served in the descriptor's shape, not the org-config shape the app reads

The app decides "join, don't set up" from GET <apex>/api/config (ADR 0226 §context, decision 1: "the gateway serves matou-app's document in the shape the app … already expect[s]"). matou-app's reader (frontend/src/api/config.ts; the Android backend's internal/api/org.go mirrors it) expects

{ "organization": { "aid": "...", "name": "...", "oobi": "..." },
  "admins": [ { "aid": "...", "name": "...", "oobi": "..." } ],
  "registry": { "id": "...", "name": "..." }, "generated": "..." }

and gates on isUsableConfig = !!config.organization?.aid && !!config.registry?.id — anything else is not_configured, and boot/keri.ts then redirects every route to /setup.

The gateway's config server serves the SAME document on /api/config and /api/client-config (diffed live: /api/config is the descriptor minus the keri/witnesses/schema_server_url blocks) — internal/orgconfig (doc.go: "served at /api/config and /api/client-config") renders community.{name,slug,aid,oobi,registry} + admins[] and no organization / registry.{id,name} at all:

top-level keys: admins, anysync, api_url, backend_kind, boot, community, schemas, signin, stack, version

So the roster rendering is right, but it was written to the descriptor's vocabulary, not to the org-config vocabulary decision 1 promised. Decision 5's "a 1.0 wallet strips the keys it does not read" only holds for ADDED keys; the keys the wallet reads are missing.

Fix (proposed, two-way door)

Render /api/config (or the whole document — the app strips extras) with the org-config keys ALONGSIDE the community block, derived from the same roster:

  • organization: { aid: community.aid, name: community.name, oobi: community.oobi }
  • registry: { id: community.registry, name: "<community name> registry" } (the top-level registry key is free; community.registry stays a string)
  • admins[] already matches (aid, name, oobi)
  • generated: <RFC3339 of the render>

render_test.go: assert the document parses as matou-app's OrgConfig (a golden copied from frontend/src/api/config.ts) and that organization.aid == community.aid. Then re-render + re-write for standing communities (the descriptor writer already updates in place on every steward change — one steward touch, or a control-plane restart if the writer re-renders at boot, republishes whakatohea-demo's).

Acceptance

  • curl https://whakatohea-demo.idss.nz/api/config | jq '.organization.aid, .registry.id' → the community AID and registry SAID.
  • A fresh install of the whakatohea-demo build boots to the welcome/join flow, never /setup.

Companion on the app side (defence in depth, ADR 0226 d3): matou-app ticket "honour backend_kind: idss — never route to /setup, derive the org identity from community" (linked below once filed).

Related: ADR 0226 (d1, d3, d5), ADR 0235, #1813, #1807, docs/research/2026-09-07-community-backend-contract.md §1.4 + gap 2.

## Symptom Ben, 2026-09-24, first launch of the whakatohea-demo Android build (matou-app v0.7.3, backend `https://whakatohea-demo.idss.nz`, any-sync handshake now OK after #1813): the app opens on **"Set up WHAKATOHEA DEMO — first admin"**, i.e. the founding flow. Submitting name + email ends in `Setup failed: Failed to fetch`. ADR 0226 decision 3: *on an IDSS backend the app never founds — a branded app against a gateway can only join.* The community is already founded (the descriptor names its AID `EEPniUBM…`, registry `EIb--9e6…`, steward `ben`). ## Cause — `/api/config` is served in the descriptor's shape, not the org-config shape the app reads The app decides "join, don't set up" from `GET <apex>/api/config` (ADR 0226 §context, decision 1: *"the gateway serves matou-app's document in the shape the app … already expect[s]"*). matou-app's reader (`frontend/src/api/config.ts`; the Android backend's `internal/api/org.go` mirrors it) expects ```json { "organization": { "aid": "...", "name": "...", "oobi": "..." }, "admins": [ { "aid": "...", "name": "...", "oobi": "..." } ], "registry": { "id": "...", "name": "..." }, "generated": "..." } ``` and gates on `isUsableConfig = !!config.organization?.aid && !!config.registry?.id` — anything else is `not_configured`, and `boot/keri.ts` then redirects every route to `/setup`. The gateway's config server serves the SAME document on `/api/config` and `/api/client-config` (diffed live: `/api/config` is the descriptor minus the `keri`/`witnesses`/`schema_server_url` blocks) — `internal/orgconfig` (`doc.go`: "served at /api/config and /api/client-config") renders `community.{name,slug,aid,oobi,registry}` + `admins[]` and no `organization` / `registry.{id,name}` at all: ``` top-level keys: admins, anysync, api_url, backend_kind, boot, community, schemas, signin, stack, version ``` So the roster rendering is right, but it was written to the descriptor's vocabulary, not to the org-config vocabulary decision 1 promised. Decision 5's "a 1.0 wallet strips the keys it does not read" only holds for ADDED keys; the keys the wallet reads are missing. ## Fix (proposed, two-way door) Render `/api/config` (or the whole document — the app strips extras) with the org-config keys ALONGSIDE the community block, derived from the same roster: - `organization: { aid: community.aid, name: community.name, oobi: community.oobi }` - `registry: { id: community.registry, name: "<community name> registry" }` (the top-level `registry` key is free; `community.registry` stays a string) - `admins[]` already matches (`aid`, `name`, `oobi`) - `generated: <RFC3339 of the render>` `render_test.go`: assert the document parses as matou-app's `OrgConfig` (a golden copied from `frontend/src/api/config.ts`) and that `organization.aid == community.aid`. Then re-render + re-write for standing communities (the descriptor writer already updates in place on every steward change — one steward touch, or a control-plane restart if the writer re-renders at boot, republishes whakatohea-demo's). ## Acceptance - `curl https://whakatohea-demo.idss.nz/api/config | jq '.organization.aid, .registry.id'` → the community AID and registry SAID. - A fresh install of the whakatohea-demo build boots to the welcome/join flow, never `/setup`. Companion on the app side (defence in depth, ADR 0226 d3): matou-app ticket "honour `backend_kind: idss` — never route to /setup, derive the org identity from `community`" (linked below once filed). Related: ADR 0226 (d1, d3, d5), ADR 0235, #1813, #1807, `docs/research/2026-09-07-community-backend-contract.md` §1.4 + gap 2.
Author
Owner

Companion app-side ticket: Matou/matou-app#610 (Matou/matou-app#610) — the app must never route to /setup on an IDSS-kind backend regardless of this fix.

Companion app-side ticket: Matou/matou-app#610 (https://git.matou.nz/Matou/matou-app/issues/610) — the app must never route to /setup on an IDSS-kind backend regardless of this fix.

swarm-claim host=bens-mac-04 run=31863
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=31863 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1825 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1825,
  "status": "success",
  "commits": [
    "44e3eec911a1b2b289b1c2667ac501707df07455"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/controlapi/descriptor_1_1_served_test.go",
    "internal/orgconfig/doc.go",
    "internal/orgconfig/render.go",
    "internal/orgconfig/render_test.go",
    "internal/orgconfig/testdata/golden-anysync-spaces.json",
    "internal/orgconfig/testdata/golden-anysync.json",
    "internal/orgconfig/testdata/golden-app-ready.json",
    "internal/orgconfig/testdata/golden-no-anysync.json",
    "internal/orgconfig/writer.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/orgconfig/... ./internal/controlapi/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "curl https://whakatohea-demo.idss.nz/api/config | jq '.organization.aid, .registry.id' -> the community AID and registry SAID": "orgconfig.Render now derives organization{aid,name,oobi} and top-level registry{id,name} byte-for-byte from the community block (internal/orgconfig/render.go, doc.go); the regenerated golden internal/orgconfig/testdata/golden-no-anysync.json shows organization.aid = the community AID and registry.id = the registry SAID, and TestServed11_EqualsGoldenDocument (internal/controlapi) proves the doc fetched from outside the gateway reduces to that golden byte-for-byte. Standing whakatohea-demo republishes on one steward touch / control-plane restart (the writer re-renders whole every reconcile tick).",
    "A fresh install of the whakatohea-demo build boots to the welcome/join flow, never /setup": "matou-app gates isUsableConfig = !!organization.aid && !!registry.id; TestRender_ParsesAsMatouAppOrgConfig (internal/orgconfig/render_test.go) decodes the served descriptor as matou-app's OrgConfig and asserts both gates are now satisfied (organization.aid == community AID, registry.id == community registry SAID), so the app takes the join path instead of routing every screen to /setup. Companion app-side defence-in-depth: matou-app#610."
  },
  "summary": "The gateway's /api/config now carries matou-app's org-config vocabulary (organization/registry/generated) derived byte-for-byte from the community block, so a branded app against a founded gateway joins instead of landing on 'Set up ... first admin'.",
  "blockers": []
}
**close-report** for #1825 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1825, "status": "success", "commits": [ "44e3eec911a1b2b289b1c2667ac501707df07455" ], "changed_files": [ "STATUS.md", "internal/controlapi/descriptor_1_1_served_test.go", "internal/orgconfig/doc.go", "internal/orgconfig/render.go", "internal/orgconfig/render_test.go", "internal/orgconfig/testdata/golden-anysync-spaces.json", "internal/orgconfig/testdata/golden-anysync.json", "internal/orgconfig/testdata/golden-app-ready.json", "internal/orgconfig/testdata/golden-no-anysync.json", "internal/orgconfig/writer.go" ], "tests": [ { "command": "go test ./internal/orgconfig/... ./internal/controlapi/...", "exit_code": 0 } ], "criteria": { "curl https://whakatohea-demo.idss.nz/api/config | jq '.organization.aid, .registry.id' -> the community AID and registry SAID": "orgconfig.Render now derives organization{aid,name,oobi} and top-level registry{id,name} byte-for-byte from the community block (internal/orgconfig/render.go, doc.go); the regenerated golden internal/orgconfig/testdata/golden-no-anysync.json shows organization.aid = the community AID and registry.id = the registry SAID, and TestServed11_EqualsGoldenDocument (internal/controlapi) proves the doc fetched from outside the gateway reduces to that golden byte-for-byte. Standing whakatohea-demo republishes on one steward touch / control-plane restart (the writer re-renders whole every reconcile tick).", "A fresh install of the whakatohea-demo build boots to the welcome/join flow, never /setup": "matou-app gates isUsableConfig = !!organization.aid && !!registry.id; TestRender_ParsesAsMatouAppOrgConfig (internal/orgconfig/render_test.go) decodes the served descriptor as matou-app's OrgConfig and asserts both gates are now satisfied (organization.aid == community AID, registry.id == community registry SAID), so the app takes the join path instead of routing every screen to /setup. Companion app-side defence-in-depth: matou-app#610." }, "summary": "The gateway's /api/config now carries matou-app's org-config vocabulary (organization/registry/generated) derived byte-for-byte from the community block, so a branded app against a founded gateway joins instead of landing on 'Set up ... first admin'.", "blockers": [] } ``` </details>
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.

Dependencies

No dependencies set.

Reference
Matou/idss#1825
No description provided.