#719: assign a new owner - orphan folders and departed-owner spaces #723

Merged
Cordy merged 12 commits from feat-719 into main 2026-09-24 15:53:11 +00:00
Owner

Closes #719

The keep-path beside #717's Take over and deactivate, per the approved mockup and both amendments (dedicated audit verb; departed-owner scope from the #654 §2 finding).

Backend

  • POST /api/v1/spaces gains an optional owner field, honoured only for admins (403 otherwise — never silently self-assigned; naming yourself is not an override). Used by the orphan claim path.
  • New POST /api/v1/spaces/{name}/owner reassigns an existing app-owned space, admin-only, and only when the current owner verifiably no longer resolves: living owner → 409, liveness unverifiable → 409 (fail closed), IdP outage → 503 (never reassign on a blip) — the same oracle and rules the departed-owners surface uses, wired in main.go.
  • spacestore.SetOwner hands the record over and absorbs the new owner's member row into the owner role; tombstoned spaces refuse.
  • Everything audited as space-assign-owner (registered in the #433 verb registry); the orphan-claim path additionally keeps its space-create.

Inventory & UI

  • spaceEntry.ownerDeparted marks app-owned rows whose owner departed (verified + no-outage only); the row sublabel reads Owned by X · owner departed · app-managed.
  • "Assign a new owner…" appears on orphan rows (above Take over) and on departed-owner rows; the dialog follows the mockup — lead text per case, New-owner field with the admin candidates datalist (house idiom; deliberate deviation from the mockup's custom picklist, same UX family), the two fact rows, client-side unknown-name error when candidates are enumerable, server refusals inline verbatim. i18n ×10 keys ×4.

Tests: spacestore/setowner_test.go, api/spaces_assign_test.go (owner override + 403, reassign + guards incl. outage/unverifiable/living-owner, inventory departed marks), web/test/qa719.test.js.

Closes #719 The keep-path beside #717's Take over and deactivate, per the approved mockup and both amendments (dedicated audit verb; departed-owner scope from the #654 §2 finding). **Backend** - `POST /api/v1/spaces` gains an optional `owner` field, honoured **only for admins** (403 otherwise — never silently self-assigned; naming yourself is not an override). Used by the orphan claim path. - New `POST /api/v1/spaces/{name}/owner` reassigns an **existing** app-owned space, admin-only, and only when the current owner **verifiably no longer resolves**: living owner → 409, liveness unverifiable → 409 (fail closed), IdP outage → 503 (never reassign on a blip) — the same oracle and rules the departed-owners surface uses, wired in main.go. - `spacestore.SetOwner` hands the record over and absorbs the new owner's member row into the owner role; tombstoned spaces refuse. - Everything audited as **`space-assign-owner`** (registered in the #433 verb registry); the orphan-claim path additionally keeps its `space-create`. **Inventory & UI** - `spaceEntry.ownerDeparted` marks app-owned rows whose owner departed (verified + no-outage only); the row sublabel reads `Owned by X · owner departed · app-managed`. - "Assign a new owner…" appears on orphan rows (above Take over) and on departed-owner rows; the dialog follows the mockup — lead text per case, New-owner field with the admin candidates **datalist** (house idiom; deliberate deviation from the mockup's custom picklist, same UX family), the two fact rows, client-side unknown-name error when candidates are enumerable, server refusals inline verbatim. i18n ×10 keys ×4. **Tests:** `spacestore/setowner_test.go`, `api/spaces_assign_test.go` (owner override + 403, reassign + guards incl. outage/unverifiable/living-owner, inventory departed marks), `web/test/qa719.test.js`.
scout(#719): audit verb registry, liveness wiring, spaces test idiom, dialog anchors
All checks were successful
scout-719 / scout (push) Successful in 1s
93395e2eac
test(#719): RED - spacestore SetOwner
All checks were successful
scout-719 / scout (push) Successful in 1s
91f8c3c7cd
test(#719): RED - admin owner override on create, reassignment guards
All checks were successful
scout-719 / scout (push) Successful in 1s
bb0bbcebc4
test(#719): drop the unused-import kludge
All checks were successful
scout-719 / scout (push) Successful in 1s
5e07b6f489
test(#719): RED - assign-owner dialog, menu wiring, departed sublabel, i18n
All checks were successful
scout-719 / scout (push) Successful in 1s
365fb201ba
one-shot(#719): RED gate, splice, gofmt+vet+build+test+web, self-cleaning commit
Some checks failed
fix-719 / fix (push) Failing after 1m9s
scout-719 / scout (push) Successful in 1s
9ebcd59582
test(#719): deactivate before tombstoning in the SetOwner test (store precondition)
All checks were successful
scout-719 / scout (push) Successful in 1s
fix-719 / fix (push) Successful in 1m9s
a1543b7e9d
Admin-only owner field on POST /api/v1/spaces (orphan claim); POST /api/v1/spaces/{name}/owner reassigns an existing space only when the current owner verifiably no longer resolves (outage 503, unverifiable 409, living owner 409); spacestore.SetOwner absorbs the new owner's member row; inventory marks departed owners under the same oracle; assign dialog with candidates datalist; audited as space-assign-owner (registered); i18n x10x4.
one-shot: apply v0.6.266 changelog entry, self-remove
All checks were successful
chg-266 / chg (push) Successful in 7s
95371a01bb
docs: changelog for v0.6.266 (#719 assign a new owner)
All checks were successful
ci / test-and-build (pull_request) Successful in 1m11s
50a1ce2c7d
Cordy merged commit 0bd7b70de3 into main 2026-09-24 15:53:11 +00:00
Cordy deleted branch feat-719 2026-09-24 15:53:14 +00:00
Sign in to join this conversation.
No reviewers
No labels
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: Cordy/Cairn#723
No description provided.