add-member: the by-hand create sends kanidm a person with no displayname — a MUST attribute of its person class — so P6-S2 can never land a member on a real box #1560

Closed
opened 2026-09-17 03:17:54 +00:00 by matou-build-agent · 1 comment

The failure

Drive 20260917T025557Z (target rented-services) went red at leg add-member, 868 ms in, after 27 green legs (artifacts/legs.json, artifacts/verdict.json — firstRedLeg: add-member, commit 1c52085a). The fault the harness recorded:

the by-hand create of proof-member was refused by the seam: "kanidm: create person \"proof-member\": unexpected status 400"

The evidence

The seam's refusal rendered in the dialog and the fixture quoted it verbatim — app/tests/e2e/fixtures/panelMembers.ts:80-84 (frame: artifacts/roles/add-member-proof-member-refused.png). kanidm says why, in its own words — logs/droplet-journal.txt:1994-1995:

WARN  Validation error, the following required (proof-member@id.roles-proof.idss.nz)
      (must) attributes are missing - [DisplayName]
ERROR Schema Violation in create validate MissingMustAttribute([DisplayName])

The preceding GET /v1/person/proof-member answered 200-with-null (the idempotency probe, correctly reading absence — logs/droplet-journal.txt:1985), then POST /v1/person → 400 (:1990).

The chain, in the checkout:

  • docs/ux/wireframes/p6-members/p6-s2-invite.html:29 — the by-hand path is "a username + temporary password" and nothing else. The UI is per contract: dashboard/src/components/members/InviteScreen.vue:128-146 offers exactly those two inputs.
  • internal/member/byhand.go:15-24 — ByHandSpec's own doc calls the display name optional; :75-80 passes it straight through.
  • internal/kanidm/kanidm.go:635-639 (createEntity) — omits displayname from the POST body entirely when it is empty. Real kanidm's person class makes it a MUST attribute, so the entity is unconstructable.

add-member is a new leg (#1547) and this was its first reach past the dialog — the previous red on this signature died earlier, at the locator. The defect has been latent since the by-hand path was written.

The suspected layer — and why it shipped

The adapter (internal/kanidm), plus the fixture that hid it: the in-process double at internal/kanidm/fakekanidm_test.go:263 accepted a person with no display name, so every adapter contract test passed against a server the real one does not resemble. The double is documented as "a faithful kanidm REST DOUBLE" — here it was not faithful.

The fix

  1. internal/kanidm/fakekanidm_test.go — the double now refuses a person create with no displayname with a 400, exactly as kanidm does, citing this drive.
  2. internal/kanidm/kanidm.go — new displayNameOr helper; both person-create verbs (CreatePerson, CreatePendingPerson) fall back to the account name.
  3. internal/kanidm/kanidm_test.go — two new tests, one per verb.

Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)

Two-way door. The whole product-code change is one 5-line pure helper (displayNameOr) and two call sites that now pass displayNameOr(spec.DisplayName, spec.Username) instead of spec.DisplayName — git revert ff35660 restores the previous bytes exactly. No schema, no dependency, no secrets, no route, no infra state; nothing outside this checkout.

Proven by a test written here, red first. TestCreatePerson_NoDisplayName_FallsBackToTheAccountName and TestCreatePendingPerson_NoDisplayName_FallsBackToTheAccountName (internal/kanidm/kanidm_test.go) fail before the fix with the drive's error string verbatim — kanidm: create person "proof-member": unexpected status 400 — once the double is made faithful to kanidm's MUST attribute, and pass after.

Mechanical repair, not a design decision. It changes nothing a community sees. The member list already falls back to the person id when the idp carries no name — Name: m.PersonID, // fall back to the id if the idp has no name (never a dead end) (internal/member/member.go:188), and the same fallback repeats in detail.go:223, komiti.go:240, removal.go:600, signup.go:297, reset.go:291. Writing displayname = <account name> at create time therefore renders the identical string; the only difference is that kanidm's schema is satisfied and the create lands instead of being refused. No message at a trust moment changes, no default posture changes, no new field is asked of an operator — the wireframe contract (username + temporary password, nothing else) is preserved, which is precisely why the adapter must own kanidm's schema rather than push a name-collection field back onto P6-S2. The alternative reading — ask the operator for a display name — would be the design decision; this is not it. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.

drive 20260917T025557Z red at add-member (sig e5567d778c73) — self-fixed on the fast lane, commit 7da8ab07bfbe11d8a9322470e255cf6724cae676; checks: Targeted (red-first): GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/kanidm -run 'TestCreatePerson_NoDisplayName_FallsBackToTheAccountName|TestCreatePendingPerson_NoDisplayName_FallsBackToTheAccountName' — RED before the fix, reproducing the drive's exact error (CreatePerson(no display name) = (…, created false, kanidm: create person "proof-member": unexpected status 400), want created; same for person-7), then ok git.matou.nz/Matou/idss/internal/kanidm 0.011s after. Package tests: GOWORK=… go test ./internal/kanidm ./internal/member ./internal/controlapi — ok internal/kanidm 0.158s, ok internal/member 0.248s, ok internal/controlapi 0.732s, all green. gofmt -l internal/kanidm/ clean; go vet ./internal/kanidm clean. Diff: 3 files, 73 insertions / 2 deletions — the only 2 removed lines are the two createEntity call sites; no assertion or test touched. The live leg needs a rented droplet and re-proves on the next drive.. evidence: /home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260917T025557Z on matou-workstation.

## The failure Drive `20260917T025557Z` (target `rented-services`) went red at leg **`add-member`**, 868 ms in, after 27 green legs (`artifacts/legs.json`, `artifacts/verdict.json` — `firstRedLeg: add-member`, commit `1c52085a`). The fault the harness recorded: > the by-hand create of proof-member was refused by the seam: `"kanidm: create person \"proof-member\": unexpected status 400"` ## The evidence The seam's refusal rendered in the dialog and the fixture quoted it verbatim — `app/tests/e2e/fixtures/panelMembers.ts:80-84` (frame: `artifacts/roles/add-member-proof-member-refused.png`). kanidm says why, in its own words — `logs/droplet-journal.txt:1994-1995`: ``` WARN Validation error, the following required (proof-member@id.roles-proof.idss.nz) (must) attributes are missing - [DisplayName] ERROR Schema Violation in create validate MissingMustAttribute([DisplayName]) ``` The preceding `GET /v1/person/proof-member` answered 200-with-null (the idempotency probe, correctly reading absence — `logs/droplet-journal.txt:1985`), then `POST /v1/person` → **400** (`:1990`). The chain, in the checkout: - `docs/ux/wireframes/p6-members/p6-s2-invite.html:29` — the by-hand path is "a username + temporary password" and nothing else. The UI is per contract: `dashboard/src/components/members/InviteScreen.vue:128-146` offers exactly those two inputs. - `internal/member/byhand.go:15-24` — `ByHandSpec`'s own doc calls the display name **optional**; `:75-80` passes it straight through. - `internal/kanidm/kanidm.go:635-639` (`createEntity`) — omits `displayname` from the POST body entirely when it is empty. Real kanidm's person class makes it a MUST attribute, so the entity is unconstructable. `add-member` is a new leg (#1547) and this was its first reach past the dialog — the previous red on this signature died earlier, at the locator. The defect has been latent since the by-hand path was written. ## The suspected layer — and why it shipped The adapter (`internal/kanidm`), plus the **fixture that hid it**: the in-process double at `internal/kanidm/fakekanidm_test.go:263` accepted a person with no display name, so every adapter contract test passed against a server the real one does not resemble. The double is documented as "a faithful kanidm REST DOUBLE" — here it was not faithful. ## The fix 1. `internal/kanidm/fakekanidm_test.go` — the double now refuses a person create with no `displayname` with a 400, exactly as kanidm does, citing this drive. 2. `internal/kanidm/kanidm.go` — new `displayNameOr` helper; both person-create verbs (`CreatePerson`, `CreatePendingPerson`) fall back to the account name. 3. `internal/kanidm/kanidm_test.go` — two new tests, one per verb. ## Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime) **Two-way door.** The whole product-code change is one 5-line pure helper (`displayNameOr`) and two call sites that now pass `displayNameOr(spec.DisplayName, spec.Username)` instead of `spec.DisplayName` — `git revert ff35660` restores the previous bytes exactly. No schema, no dependency, no secrets, no route, no infra state; nothing outside this checkout. **Proven by a test written here, red first.** `TestCreatePerson_NoDisplayName_FallsBackToTheAccountName` and `TestCreatePendingPerson_NoDisplayName_FallsBackToTheAccountName` (`internal/kanidm/kanidm_test.go`) fail before the fix with the drive's error string *verbatim* — `kanidm: create person "proof-member": unexpected status 400` — once the double is made faithful to kanidm's MUST attribute, and pass after. **Mechanical repair, not a design decision.** It changes nothing a community sees. The member list already falls back to the person id when the idp carries no name — `Name: m.PersonID, // fall back to the id if the idp has no name (never a dead end)` (`internal/member/member.go:188`), and the same fallback repeats in `detail.go:223`, `komiti.go:240`, `removal.go:600`, `signup.go:297`, `reset.go:291`. Writing `displayname = <account name>` at create time therefore renders the identical string; the only difference is that kanidm's schema is satisfied and the create lands instead of being refused. No message at a trust moment changes, no default posture changes, no new field is asked of an operator — the wireframe contract (username + temporary password, nothing else) is *preserved*, which is precisely why the adapter must own kanidm's schema rather than push a name-collection field back onto P6-S2. The alternative reading — ask the operator for a display name — would be the design decision; this is not it. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes. drive `20260917T025557Z` red at `add-member` (sig e5567d778c73) — self-fixed on the fast lane, commit `7da8ab07bfbe11d8a9322470e255cf6724cae676`; checks: Targeted (red-first): `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/kanidm -run 'TestCreatePerson_NoDisplayName_FallsBackToTheAccountName|TestCreatePendingPerson_NoDisplayName_FallsBackToTheAccountName'` — RED before the fix, reproducing the drive's exact error (`CreatePerson(no display name) = (…, created false, kanidm: create person "proof-member": unexpected status 400), want created`; same for `person-7`), then `ok git.matou.nz/Matou/idss/internal/kanidm 0.011s` after. Package tests: `GOWORK=… go test ./internal/kanidm ./internal/member ./internal/controlapi` — `ok internal/kanidm 0.158s`, `ok internal/member 0.248s`, `ok internal/controlapi 0.732s`, all green. `gofmt -l internal/kanidm/` clean; `go vet ./internal/kanidm` clean. Diff: 3 files, 73 insertions / 2 deletions — the only 2 removed lines are the two `createEntity` call sites; no assertion or test touched. The live leg needs a rented droplet and re-proves on the next drive.. evidence: `/home/dev/swarm/Matou/idss/test-results/drive-rented-services/20260917T025557Z` on matou-workstation. <!-- rehearsal-sig: e5567d778c73 -->
Author
Member

close-report for #1560 — status success

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

envelope
{
  "issue": 1560,
  "status": "success",
  "commits": [
    "7da8ab07bfbe11d8a9322470e255cf6724cae676"
  ],
  "changed_files": [
    "internal/kanidm/fakekanidm_test.go",
    "internal/kanidm/kanidm.go",
    "internal/kanidm/kanidm_test.go"
  ],
  "tests": [
    {
      "command": "Targeted (red-first): `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/kanidm -run 'TestCreatePerson_NoDisplayName_FallsBackToTheAccountName|TestCreatePendingPerson_NoDisplayName_FallsBackToTheAccountName'` — RED before the fix, reproducing the drive's exact error (`CreatePerson(no display name) = (…, created false, kanidm: create person \"proof-member\": unexpected status 400), want created`; same for `person-7`), then `ok git.matou.nz/Matou/idss/internal/kanidm 0.011s` after. Package tests: `GOWORK=… go test ./internal/kanidm ./internal/member ./internal/controlapi` — `ok internal/kanidm 0.158s`, `ok internal/member 0.248s`, `ok internal/controlapi 0.732s`, all green. `gofmt -l internal/kanidm/` clean; `go vet ./internal/kanidm` clean. Diff: 3 files, 73 insertions / 2 deletions — the only 2 removed lines are the two `createEntity` call sites; no assertion or test touched. The live leg needs a rented droplet and re-proves on the next drive.",
      "exit_code": 0
    }
  ],
  "criteria": {
    "the red leg is now green": "healed on the fast lane, commit 7da8ab07bfbe11d8a9322470e255cf6724cae676"
  },
  "summary": "The by-hand member create omitted `displayname`, a MUST attribute of kanidm's person class, so real kanidm refused `POST /v1/person` with 400 MissingMustAttribute — both kanidm person-create verbs now fall back to the account name (the id every read already falls back to), and the in-process double now refuses the empty-display-name create exactly as kanidm does, so the gap cannot reopen.",
  "blockers": []
}
**close-report** for #1560 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1560, "status": "success", "commits": [ "7da8ab07bfbe11d8a9322470e255cf6724cae676" ], "changed_files": [ "internal/kanidm/fakekanidm_test.go", "internal/kanidm/kanidm.go", "internal/kanidm/kanidm_test.go" ], "tests": [ { "command": "Targeted (red-first): `GOWORK=/home/dev/rehearsal-heal/idss/go.work go test ./internal/kanidm -run 'TestCreatePerson_NoDisplayName_FallsBackToTheAccountName|TestCreatePendingPerson_NoDisplayName_FallsBackToTheAccountName'` — RED before the fix, reproducing the drive's exact error (`CreatePerson(no display name) = (…, created false, kanidm: create person \"proof-member\": unexpected status 400), want created`; same for `person-7`), then `ok git.matou.nz/Matou/idss/internal/kanidm 0.011s` after. Package tests: `GOWORK=… go test ./internal/kanidm ./internal/member ./internal/controlapi` — `ok internal/kanidm 0.158s`, `ok internal/member 0.248s`, `ok internal/controlapi 0.732s`, all green. `gofmt -l internal/kanidm/` clean; `go vet ./internal/kanidm` clean. Diff: 3 files, 73 insertions / 2 deletions — the only 2 removed lines are the two `createEntity` call sites; no assertion or test touched. The live leg needs a rented droplet and re-proves on the next drive.", "exit_code": 0 } ], "criteria": { "the red leg is now green": "healed on the fast lane, commit 7da8ab07bfbe11d8a9322470e255cf6724cae676" }, "summary": "The by-hand member create omitted `displayname`, a MUST attribute of kanidm's person class, so real kanidm refused `POST /v1/person` with 400 MissingMustAttribute — both kanidm person-create verbs now fall back to the account name (the id every read already falls back to), and the in-process double now refuses the empty-display-name create exactly as kanidm does, so the gap cannot reopen.", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1560
No description provided.