service-restrict: SERVICE ACCESS renders zero rows on a fresh community (empty matrix) #1229

Closed
opened 2026-09-04 23:34:27 +00:00 by matou-build-agent · 2 comments

Not the known frontier

This red is not the own-VPS carrier/pairing frontier. pair is green ({"leg": "pair", "status": "green", "ms": 98}) and verdict.json records zero skips, so legs.json carries no skip reasons at all — nothing in this drive's own records names this leg as out of scope:

"legs": { "total": 31, "green": 30, "red": 1, "skip": 0 },
"firstRedLeg": "service-restrict"

The first 30 legs — through deploy-files, files-healthy, door, oidc-admin, credential-claim — are all green. This is a new, specific product defect.

The failure

legs.json / journey.json (identical fault):

the SERVICE ACCESS table must carry a files row (#1156)
expect(locator).toBeVisible() failed
Locator: locator('[data-field="access-files"]')
Expected: visible
Timeout: 30000ms
Error: element(s) not found

Critically, the leg went red, not skipped. Its precheck is shippedOrLedger(dash, '[data-field="service-access"]', 'service-restrict') (app/tests/e2e/journey.idip.spec.ts:959), which returns a named-skip when the section is absent. It did not skip — so the SERVICE ACCESS section rendered, and CredentialsSurface.vue's guard v-if="!detail.builtIn && access" passed. The GET .../access read landed 200. The table rendered its <thead>; the <tbody> was empty.

Root cause — the empty-matrix bootstrap gap

internal/controlapi/idip_service_access.go:113 builds rows only from committed matrix policies, and says so:

// credentialAccessView composes the SERVICE ACCESS section from THIS credential's
// viewpoint (ADR 0222 edit 3): one row per catalogue service that carries a matrix
// policy... A service with no policy row does not appear — the default is open to
// all, mirroring the built komiti control (KomitiDetail lists only the matrix's rows).
	policies, err := matrix.Services()
	...
	for _, p := range policies {
		row := keriawire.CredentialServiceAccessRow{Service: p.Service, OpenToAll: p.OpenToAll}

and internal/member/matrixstore.go:40:

// Services implements [AccessMatrix]: every committed service policy. A community
// that has committed no matrix yet returns an empty slice, not an error...

CredentialsSurface.vue:221 then keys each row off that list — v-for="row in access.rows" → :data-field="access-${row.service}". Empty policies ⇒ empty rows ⇒ no access-files element, ever.

This is a chicken-and-egg deadlock. A service gets a row only after a policy is written; the only UI that writes a policy is the per-row change-access-<svc> edit link inside that row. A service sitting in its default open-to-all state can therefore never be restricted through S7i — the exact act #1156 exists to provide.

Confirmed on the live box (134.199.168.27, still up)

ssh was accepted; read-only commands only. The box is healthy — systemctl --failed is empty, and control-plane (:8080), phpfpm-nextcloud, nginx (:8084), caddy (:80/:443), keria, idss-idp are all running. Not an infra red.

The matrix document simply does not exist:

# cat /srv/idss/config/idss/access-matrix.json
cat: /srv/idss/config/idss/access-matrix.json: No such file or directory

# ls /srv/idss/config/idss/
brand/  brand-kit.json

(MatrixDocPath = "idss/access-matrix.json", internal/member/matrixstore.go:12.)

And it was never written — git -C /srv/idss/config log --all -- idss/access-matrix.json returns nothing, while the service itself is deployed and live: 0e91159 idss: attach files (Nextcloud) module on gateway.

Not a naming mismatch

The harness asks for the right slug. internal/nextcloud/nextcloud.go:60 — const Service = "files", with catalogue.go:298 Slug: "files" and the adapter's own note that the service KEY is files, "never the dead 'nextcloud' service key". The row is absent because the matrix is empty, not because it is named differently.

Why no test caught it

Both existing suites pre-populate the matrix, so neither exercises a fresh community:

  • dashboard/tests/unit/credentialsSurface.test.ts:536 mounts with a populated ACCESS_MATRIX fake, then asserts access-files exists.
  • control-plane/cmd/smoke-stores/main.go:357 seeds it directly: matrix.SetPolicy(member.ServicePolicy{Service: "files", OpenToAll: false, Komiti: []string{"kaitiaki"}}).

Nothing seeds the matrix at founding — the only non-test SetPolicy callers are the komiti control (internal/member/komiti.go, kanidm path, not run on the IDIP path) and the two IDIP access handlers, which are reachable only from a row that does not yet exist.

Suspected layer

Product — control-plane view composition, credentialAccessView. Secondarily a design/spec conflict: the function's "mirror KomitiDetail, policy-only rows" choice contradicts ADR 0222 edit 3 / #1156's S7i contract of one row per catalogue service with an honest front-door state. The harness's expectation matches the wireframe contract; the implementation does not.

What plugging it needs

Compose the rows from the deployed catalogue left-joined onto the matrix policies, rather than iterating policies alone, in credentialAccessView (internal/controlapi/idip_service_access.go:117):

  • Every live catalogue service gets a row. A service with no policy renders OpenToAll: true, FrontDoorLabel: "open to all members" — the honest default the comment already claims.
  • A service with a policy keeps the existing restricted/open composition unchanged.

The write path already anticipates this and needs no change — restrictAdditive's own contract is "A currently-open (or absent) service starts from an empty set." Only the GET view is wrong.

Add a regression test at the empty-matrix boundary (a FakeAccessMatrix with no policies must still yield a files row marked open-to-all), since that is precisely the case both current suites seed past.

An alternative — seeding a default open-to-all matrix at founding — would also turn the leg green, but it writes redundant state for every catalogue service and leaves the view lying whenever a service is added after founding. The join is the narrower fix; either way this is a one-line-of-intent change a swarm agent can take without a human ruling.

drive 20260904T231211Z red at service-restrict: the SERVICE ACCESS table must carry a files row (#1156) expect(locator).toBeVisible() failed Locator: locator('[data-field="access-files"]') Expected: visible Timeout: 30000ms Error: element(s) not fo
evidence: /home/dev/swarm/Matou/idss/test-results/drive-idip/20260904T231211Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Not the known frontier This red is **not** the own-VPS carrier/pairing frontier. `pair` is green (`{"leg": "pair", "status": "green", "ms": 98}`) and `verdict.json` records **zero skips**, so `legs.json` carries no skip reasons at all — nothing in this drive's own records names this leg as out of scope: ```json "legs": { "total": 31, "green": 30, "red": 1, "skip": 0 }, "firstRedLeg": "service-restrict" ``` The first 30 legs — through `deploy-files`, `files-healthy`, `door`, `oidc-admin`, `credential-claim` — are all green. This is a new, specific product defect. ## The failure `legs.json` / `journey.json` (identical `fault`): ``` the SERVICE ACCESS table must carry a files row (#1156) expect(locator).toBeVisible() failed Locator: locator('[data-field="access-files"]') Expected: visible Timeout: 30000ms Error: element(s) not found ``` Critically, the leg went **red, not skipped**. Its precheck is `shippedOrLedger(dash, '[data-field="service-access"]', 'service-restrict')` (`app/tests/e2e/journey.idip.spec.ts:959`), which returns a named-skip when the section is absent. It did not skip — so the SERVICE ACCESS **section rendered**, and `CredentialsSurface.vue`'s guard `v-if="!detail.builtIn && access"` passed. The `GET .../access` read landed 200. The table rendered its `<thead>`; the `<tbody>` was empty. ## Root cause — the empty-matrix bootstrap gap `internal/controlapi/idip_service_access.go:113` builds rows **only** from committed matrix policies, and says so: ```go // credentialAccessView composes the SERVICE ACCESS section from THIS credential's // viewpoint (ADR 0222 edit 3): one row per catalogue service that carries a matrix // policy... A service with no policy row does not appear — the default is open to // all, mirroring the built komiti control (KomitiDetail lists only the matrix's rows). policies, err := matrix.Services() ... for _, p := range policies { row := keriawire.CredentialServiceAccessRow{Service: p.Service, OpenToAll: p.OpenToAll} ``` and `internal/member/matrixstore.go:40`: ```go // Services implements [AccessMatrix]: every committed service policy. A community // that has committed no matrix yet returns an empty slice, not an error... ``` `CredentialsSurface.vue:221` then keys each row off that list — `v-for="row in access.rows"` → `:data-field="`access-${row.service}`"`. Empty policies ⇒ empty `rows` ⇒ no `access-files` element, ever. **This is a chicken-and-egg deadlock.** A service gets a row only after a policy is written; the only UI that writes a policy is the per-row `change-access-<svc>` edit link *inside that row*. A service sitting in its default open-to-all state can therefore never be restricted through S7i — the exact act `#1156` exists to provide. ### Confirmed on the live box (134.199.168.27, still up) ssh was accepted; read-only commands only. The box is **healthy** — `systemctl --failed` is empty, and `control-plane` (:8080), `phpfpm-nextcloud`, `nginx` (:8084), `caddy` (:80/:443), `keria`, `idss-idp` are all running. Not an infra red. The matrix document simply does not exist: ``` # cat /srv/idss/config/idss/access-matrix.json cat: /srv/idss/config/idss/access-matrix.json: No such file or directory # ls /srv/idss/config/idss/ brand/ brand-kit.json ``` (`MatrixDocPath = "idss/access-matrix.json"`, `internal/member/matrixstore.go:12`.) And it was never written — `git -C /srv/idss/config log --all -- idss/access-matrix.json` returns **nothing**, while the service itself is deployed and live: `0e91159 idss: attach files (Nextcloud) module on gateway`. ### Not a naming mismatch The harness asks for the right slug. `internal/nextcloud/nextcloud.go:60` — `const Service = "files"`, with `catalogue.go:298` `Slug: "files"` and the adapter's own note that the service KEY is `files`, *"never the dead 'nextcloud' service key"*. The row is absent because the matrix is empty, not because it is named differently. ### Why no test caught it Both existing suites pre-populate the matrix, so neither exercises a fresh community: - `dashboard/tests/unit/credentialsSurface.test.ts:536` mounts with a populated `ACCESS_MATRIX` fake, then asserts `access-files` exists. - `control-plane/cmd/smoke-stores/main.go:357` seeds it directly: `matrix.SetPolicy(member.ServicePolicy{Service: "files", OpenToAll: false, Komiti: []string{"kaitiaki"}})`. Nothing seeds the matrix at founding — the only non-test `SetPolicy` callers are the komiti control (`internal/member/komiti.go`, kanidm path, not run on the IDIP path) and the two IDIP access handlers, which are reachable only from a row that does not yet exist. ## Suspected layer **Product** — control-plane view composition, `credentialAccessView`. Secondarily a **design/spec conflict**: the function's "mirror KomitiDetail, policy-only rows" choice contradicts ADR 0222 edit 3 / `#1156`'s S7i contract of *one row per catalogue service* with an honest front-door state. The harness's expectation matches the wireframe contract; the implementation does not. ## What plugging it needs Compose the rows from the **deployed catalogue left-joined onto the matrix policies**, rather than iterating policies alone, in `credentialAccessView` (`internal/controlapi/idip_service_access.go:117`): - Every live catalogue service gets a row. A service with no policy renders `OpenToAll: true`, `FrontDoorLabel: "open to all members"` — the honest default the comment already claims. - A service with a policy keeps the existing restricted/open composition unchanged. The write path already anticipates this and needs no change — `restrictAdditive`'s own contract is *"A currently-open (or absent) service starts from an empty set."* Only the GET view is wrong. Add a regression test at the empty-matrix boundary (a `FakeAccessMatrix` with **no** policies must still yield a `files` row marked open-to-all), since that is precisely the case both current suites seed past. An alternative — seeding a default open-to-all matrix at founding — would also turn the leg green, but it writes redundant state for every catalogue service and leaves the view lying whenever a service is added after founding. The join is the narrower fix; either way this is a one-line-of-intent change a swarm agent can take without a human ruling. drive `20260904T231211Z` red at `service-restrict`: `the SERVICE ACCESS table must carry a files row (#1156) expect(locator).toBeVisible() failed Locator: locator('[data-field="access-files"]') Expected: visible Timeout: 30000ms Error: element(s) not fo` evidence: `/home/dev/swarm/Matou/idss/test-results/drive-idip/20260904T231211Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 92f4de71ce2c -->
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=18050
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=18050 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1229 — status success

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

envelope
{
  "issue": 1229,
  "status": "success",
  "commits": [
    "31545803"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "internal/controlapi/idip_service_access.go",
    "internal/controlapi/idip_service_access_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi/ -run TestIdipServiceAccess -v",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/controlapi/ ./internal/clan/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci (pre-push gate: gofmt/build/vet/test/golangci-lint, main + broker)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "SERVICE ACCESS renders a files row on a fresh community (empty matrix)": "credentialAccessView now composes rows from the DEPLOYED catalogue left-joined onto the matrix policies (internal/controlapi/idip_service_access.go); a deployed service with no policy renders open_to_all/'open to all members' — so [data-field=access-files] exists even before any policy is written. Proven by TestIdipServiceAccess_EmptyMatrixShowsDeployedServices (empty FakeAccessMatrix + deployed files yields an open-to-all files row).",
    "a service with a policy keeps its restricted/open composition": "accessRow() retains the existing per-row composition; TestIdipServiceAccess_ReadComposesState still green (files restricted/opens-this, chat restricted-other, code open-to-all).",
    "the deployed-services truth is read from the live fleet, not the fixed catalogue": "production placementServices reads clan.ReadPlacement off the SAME config repo the matrix reads, wired in productionIdip (control-plane/cmd/control-plane/main.go); a nil repo/absent inventory reads as none, a corrupt one surfaces fail-closed.",
    "write path unchanged and still additive/gated": "no change to restrictAdditive/SetPolicy/operator gating; TestIdipServiceAccess_RestrictIsAdditive, _Open, _MemberForbidden all green."
  },
  "summary": "The credential SERVICE ACCESS view now left-joins the deployed catalogue onto the access matrix, so a fresh community renders a files row (open-to-all) instead of zero rows, unblocking the S7i service-restrict leg.",
  "reason": "",
  "blockers": []
}
**close-report** for #1229 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1229, "status": "success", "commits": [ "31545803" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "internal/controlapi/idip_service_access.go", "internal/controlapi/idip_service_access_test.go" ], "tests": [ { "command": "go test ./internal/controlapi/ -run TestIdipServiceAccess -v", "exit_code": 0 }, { "command": "go test ./internal/controlapi/ ./internal/clan/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "nix develop .#go-ci (pre-push gate: gofmt/build/vet/test/golangci-lint, main + broker)", "exit_code": 0 } ], "criteria": { "SERVICE ACCESS renders a files row on a fresh community (empty matrix)": "credentialAccessView now composes rows from the DEPLOYED catalogue left-joined onto the matrix policies (internal/controlapi/idip_service_access.go); a deployed service with no policy renders open_to_all/'open to all members' — so [data-field=access-files] exists even before any policy is written. Proven by TestIdipServiceAccess_EmptyMatrixShowsDeployedServices (empty FakeAccessMatrix + deployed files yields an open-to-all files row).", "a service with a policy keeps its restricted/open composition": "accessRow() retains the existing per-row composition; TestIdipServiceAccess_ReadComposesState still green (files restricted/opens-this, chat restricted-other, code open-to-all).", "the deployed-services truth is read from the live fleet, not the fixed catalogue": "production placementServices reads clan.ReadPlacement off the SAME config repo the matrix reads, wired in productionIdip (control-plane/cmd/control-plane/main.go); a nil repo/absent inventory reads as none, a corrupt one surfaces fail-closed.", "write path unchanged and still additive/gated": "no change to restrictAdditive/SetPolicy/operator gating; TestIdipServiceAccess_RestrictIsAdditive, _Open, _MemberForbidden all green." }, "summary": "The credential SERVICE ACCESS view now left-joins the deployed catalogue onto the access matrix, so a fresh community renders a files row (open-to-all) instead of zero rows, unblocking the S7i service-restrict leg.", "reason": "", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#1229
No description provided.