data-collections: a GRANTED operator is not a Grist org owner — no member-orbit port exists for Grist, so #1537's reconciler never reaches it (#1536 seeds the founding operator only) #1551

Closed
opened 2026-09-16 21:22:25 +00:00 by ben · 2 comments
Owner

Why (found by the session babysitting #1547, 2026-09-16, reading the landed tickets against the code)

Spec #1535 — Ben's ruling: adding an operator gives admin on ALL services. #1537's ReconcileRoles (internal/member/roles.go:177) fans a grant out over every DEPLOYED port whose mapping is reconciler-mapped. The proof drive #1547 grants a SECOND person operator through the panel AFTER founding and then signs them into every door expecting the admin surface. Read against main today that leg is red by construction on the doors below, so the gap is filed now rather than burned on a droplet.

The gap — data-collections (Grist)

There is NO member-orbit port for Grist (productionServicePorts, control-plane/cmd/control-plane/main.go — mail, files, static-sites, meetings, docs-editing, code, chat, newsletters, video, surveys; grep -rn ReconcileRole internal/ finds no data-collections implementation). #1536 (1f24e88c) seeds the org's access ONLY in the deploy-time health check (dataCollectionsEnsureOrgAccess: the FOUNDING operator → owners, everyone@getgrist.com → editors). So a person granted operator later is an editor in Grist, exactly like a member — the operator = admin promise is broken on this door.

Build

internal/datacollectionssvc (the internal/newslettersvc shape, #1541): Port.RoleMapping() = reconciler-mapped · header · operator → org owner · member → editor (SignIn stays header, #1536); Port.ReconcileRole(personID, operator) = GET /api/orgs/{org}/access, compare, then PATCH /api/orgs/{org}/access {"delta":{"users":{"<personID>":"owners"|"editors"}}} over the owner's minted admin key the health check already holds (productionDataCollectionsAdmin, the same session) — idempotent, and it works BEFORE the person's first sign-in (Grist creates the user record on the grant, the login is the header's bare id, #1536's convention). Revoke → editors (the everyone default), never removal. Wire it into productionServicePorts so #1537's fan-out (grant/revoke, member add, the P4 deploy hook) reaches it; the health check's founding seed stays as the belt.

Acceptance

  • datacollectionssvc_test.go: grant → owners, revoke → editors, idempotent (no PATCH when at truth), never-deployed → truthful no-op; TestProductionServicePorts_FromDerivedURLs counts the new port.
  • Member detail (P6-S4) for a granted operator reads role_in_app: org owner on data-collections, not_applied clear.
  • Live proof rides #1547 (operator-data-collections: GET /api/orgs/current answers access: owners for the granted operator; member-data-collections: editors).
  • #1167 unregressed (exempt-path strip untouched).
## Why (found by the session babysitting #1547, 2026-09-16, reading the landed tickets against the code) Spec #1535 — Ben's ruling: adding an operator gives admin on ALL services. #1537's `ReconcileRoles` (`internal/member/roles.go:177`) fans a grant out over every DEPLOYED port whose mapping is `reconciler-mapped`. The proof drive #1547 grants a SECOND person operator through the panel AFTER founding and then signs them into every door expecting the admin surface. Read against `main` today that leg is red by construction on the doors below, so the gap is filed now rather than burned on a droplet. ## The gap — data-collections (Grist) There is NO member-orbit port for Grist (`productionServicePorts`, `control-plane/cmd/control-plane/main.go` — mail, files, static-sites, meetings, docs-editing, code, chat, newsletters, video, surveys; `grep -rn ReconcileRole internal/` finds no data-collections implementation). #1536 (1f24e88c) seeds the org's access ONLY in the deploy-time health check (`dataCollectionsEnsureOrgAccess`: the FOUNDING operator → `owners`, `everyone@getgrist.com` → `editors`). So a person granted operator later is an **editor** in Grist, exactly like a member — the operator = admin promise is broken on this door. ## Build `internal/datacollectionssvc` (the `internal/newslettersvc` shape, #1541): `Port.RoleMapping()` = `reconciler-mapped · header · operator → org owner · member → editor` (SignIn stays `header`, #1536); `Port.ReconcileRole(personID, operator)` = `GET /api/orgs/{org}/access`, compare, then `PATCH /api/orgs/{org}/access {"delta":{"users":{"<personID>":"owners"|"editors"}}}` over the owner's minted admin key the health check already holds (`productionDataCollectionsAdmin`, the same session) — idempotent, and it works BEFORE the person's first sign-in (Grist creates the user record on the grant, the login is the header's bare id, #1536's convention). Revoke → `editors` (the everyone default), never removal. Wire it into `productionServicePorts` so #1537's fan-out (grant/revoke, member add, the P4 deploy hook) reaches it; the health check's founding seed stays as the belt. ## Acceptance - `datacollectionssvc_test.go`: grant → owners, revoke → editors, idempotent (no PATCH when at truth), never-deployed → truthful no-op; `TestProductionServicePorts_FromDerivedURLs` counts the new port. - Member detail (P6-S4) for a granted operator reads `role_in_app: org owner` on data-collections, `not_applied` clear. - Live proof rides #1547 (`operator-data-collections`: `GET /api/orgs/current` answers `access: owners` for the granted operator; `member-data-collections`: `editors`). - #1167 unregressed (exempt-path strip untouched).

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

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

close-report for #1551 — status success

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

envelope
{
  "issue": 1551,
  "status": "success",
  "commits": [
    "732e7941"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/offboard_catalogue_test.go",
    "internal/datacollectionssvc/datacollectionssvc.go",
    "internal/datacollectionssvc/datacollectionssvc_test.go"
  ],
  "tests": [
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/datacollectionssvc/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/datacollectionssvc/ ./control-plane/cmd/control-plane/ ./internal/member/ ./internal/memberorbit/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "datacollectionssvc_test.go: grant → owners": "internal/datacollectionssvc/datacollectionssvc_test.go TestDataCollectionsPort_ReconcileRolePromotesOperatorToOwner",
    "datacollectionssvc_test.go: revoke → editors": "TestDataCollectionsPort_ReconcileRoleRevokesToEditor",
    "datacollectionssvc_test.go: idempotent (no PATCH when at truth)": "TestDataCollectionsPort_ReconcileRolePromotesOperatorToOwner (second run asserts patches unchanged) + TestDataCollectionsPort_ArchiveDemotesToEditor",
    "datacollectionssvc_test.go: never-deployed → truthful no-op": "TestDataCollectionsPort_NoKeyIsTruthfulNoOp (empty owner key → 0 HTTP, no-op)",
    "works before first sign-in": "TestDataCollectionsPort_ReconcileRoleWorksBeforeFirstSignIn",
    "TestProductionServicePorts_FromDerivedURLs counts the new port": "control-plane/cmd/control-plane/offboard_catalogue_test.go count 11→12 + byService[datacollectionssvc.Service]; port wired in main.go productionServicePorts",
    "Member detail (P6-S4) for a granted operator reads role_in_app: org owner on data-collections": "RoleMapping().OperatorRole=\"org owner\" (datacollectionssvc.go); detail.go:345 reads OperatorRole for an operator when the port is deployed; not_applied clear (ReconcileRole succeeds over HTTP, no outstanding tail)",
    "Live proof rides #1547 (operator/member data-collections org access)": "deferred clan-lab drive per #1547; the offline contract proves owners/editors convergence over the org-access API",
    "#1167 unregressed (exempt-path strip untouched)": "no front-door/exempt-path code changed; go test ./control-plane/cmd/control-plane/ green"
  },
  "summary": "Shipped the internal/datacollectionssvc member-orbit port so a granted operator reconciles to Grist org owner (member→editor) over the org-access API, wired into productionServicePorts as the 12th port.",
  "blockers": []
}
**close-report** for #1551 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1551, "status": "success", "commits": [ "732e7941" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/offboard_catalogue_test.go", "internal/datacollectionssvc/datacollectionssvc.go", "internal/datacollectionssvc/datacollectionssvc_test.go" ], "tests": [ { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/datacollectionssvc/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go test ./internal/datacollectionssvc/ ./control-plane/cmd/control-plane/ ./internal/member/ ./internal/memberorbit/", "exit_code": 0 } ], "criteria": { "datacollectionssvc_test.go: grant → owners": "internal/datacollectionssvc/datacollectionssvc_test.go TestDataCollectionsPort_ReconcileRolePromotesOperatorToOwner", "datacollectionssvc_test.go: revoke → editors": "TestDataCollectionsPort_ReconcileRoleRevokesToEditor", "datacollectionssvc_test.go: idempotent (no PATCH when at truth)": "TestDataCollectionsPort_ReconcileRolePromotesOperatorToOwner (second run asserts patches unchanged) + TestDataCollectionsPort_ArchiveDemotesToEditor", "datacollectionssvc_test.go: never-deployed → truthful no-op": "TestDataCollectionsPort_NoKeyIsTruthfulNoOp (empty owner key → 0 HTTP, no-op)", "works before first sign-in": "TestDataCollectionsPort_ReconcileRoleWorksBeforeFirstSignIn", "TestProductionServicePorts_FromDerivedURLs counts the new port": "control-plane/cmd/control-plane/offboard_catalogue_test.go count 11→12 + byService[datacollectionssvc.Service]; port wired in main.go productionServicePorts", "Member detail (P6-S4) for a granted operator reads role_in_app: org owner on data-collections": "RoleMapping().OperatorRole=\"org owner\" (datacollectionssvc.go); detail.go:345 reads OperatorRole for an operator when the port is deployed; not_applied clear (ReconcileRole succeeds over HTTP, no outstanding tail)", "Live proof rides #1547 (operator/member data-collections org access)": "deferred clan-lab drive per #1547; the offline contract proves owners/editors convergence over the org-access API", "#1167 unregressed (exempt-path strip untouched)": "no front-door/exempt-path code changed; go test ./control-plane/cmd/control-plane/ green" }, "summary": "Shipped the internal/datacollectionssvc member-orbit port so a granted operator reconciles to Grist org owner (member→editor) over the org-access API, wired into productionServicePorts as the 12th port.", "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.

Reference
Matou/idss#1551
No description provided.