surveys: a GRANTED operator is not a LimeSurvey superadmin — ReconcileRole is a no-op and the superadmin seed follows the founding seat, not the ledger's operator set #1552

Closed
opened 2026-09-16 21:22:27 +00:00 by ben · 4 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 — surveys (LimeSurvey)

#1540 (e91d709c) seeds the FOUNDING operator superadmin on the node at deploy (renderSurveysAuth, the Permission model) and declares Port.ReconcileRole a hard no-op (internal/surveyssvc/surveyssvc.go:134, RemoteControl 2 has no permission setter) with the mapping kind front-door-only — so #1537's fan-out skips it entirely. A person granted operator later lands via the header as the member template (survey creator), never superadmin.

Build

The superadmin set must follow the LEDGER's operator set, not the founding seat:

  1. The seed becomes a reconcile of the whole operator list: the control plane materialises the current operator ids where the node's oneshot reads them (a control-plane-written file on the node or a clan var the render carries — the anysync descriptor / surveys-operators file shape), and the oneshot grants superadmin to each and demotes anyone no longer listed, idempotent on re-run.
  2. Port.ReconcileRole(personID, operator) triggers that run for real: the control plane can reach the node (the panel's own self-deploy target over loopback, root@127.0.0.1:22, #1504 — a targeted re-run of the limesurvey-auth oneshot, or a small node-side trigger). Pick one and say why; a fabricated HTTP success is out (ADR 0100). If the only honest path is a deploy, ReconcileRole returns the named outstanding error so P6-S4 reads "not yet applied on surveys" until the next deploy lands it — never a silent no-op.
  3. The mapping kind becomes reconciler-mapped so #1537 fans out to it (grant/revoke AND the P4 deploy hook, which re-seeds existing operators on every deploy for free).

Acceptance

  • Render test pins the operator LIST (two operators → two grants; a removed one → demoted); reconcile contract test (grant → run triggered / outstanding named; revoke; idempotent).
  • Member detail for a granted operator reads role_in_app: superadmin on surveys with not_applied honest.
  • Live proof rides #1547 (operator-surveys reaches global settings; member-surveys is refused).
  • #1167's strip (TestRenderFrontDoor_SurveysExemptPathStripsIdentity) unregressed.
## 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 — surveys (LimeSurvey) #1540 (e91d709c) seeds the FOUNDING operator superadmin on the node at deploy (`renderSurveysAuth`, the Permission model) and declares `Port.ReconcileRole` a hard no-op (`internal/surveyssvc/surveyssvc.go:134`, RemoteControl 2 has no permission setter) with the mapping kind `front-door-only` — so #1537's fan-out skips it entirely. A person granted operator later lands via the header as the member template (survey creator), never superadmin. ## Build The superadmin set must follow the LEDGER's operator set, not the founding seat: 1. The seed becomes a **reconcile of the whole operator list**: the control plane materialises the current operator ids where the node's oneshot reads them (a control-plane-written file on the node or a clan var the render carries — the `anysync` descriptor / `surveys-operators` file shape), and the oneshot grants superadmin to each and demotes anyone no longer listed, idempotent on re-run. 2. `Port.ReconcileRole(personID, operator)` triggers that run for real: the control plane can reach the node (the panel's own self-deploy target over loopback, `root@127.0.0.1:22`, #1504 — a targeted re-run of the `limesurvey-auth` oneshot, or a small node-side trigger). Pick one and say why; a fabricated HTTP success is out (ADR 0100). If the only honest path is a deploy, `ReconcileRole` returns the named outstanding error so P6-S4 reads "not yet applied on surveys" until the next deploy lands it — never a silent no-op. 3. The mapping kind becomes `reconciler-mapped` so #1537 fans out to it (grant/revoke AND the P4 deploy hook, which re-seeds existing operators on every deploy for free). ## Acceptance - Render test pins the operator LIST (two operators → two grants; a removed one → demoted); reconcile contract test (grant → run triggered / outstanding named; revoke; idempotent). - Member detail for a granted operator reads `role_in_app: superadmin` on surveys with `not_applied` honest. - Live proof rides #1547 (`operator-surveys` reaches global settings; `member-surveys` is refused). - #1167's strip (`TestRenderFrontDoor_SurveysExemptPathStripsIdentity`) unregressed.

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)

Ruled by agent under ADR 0174 — veto anytime.

The decision (build point 2): the ticket asked me to pick, for Port.ReconcileRole, EITHER (a) trigger the run for real over the loopback self-deploy target (#1504) OR (b) return the named outstanding error because a deploy is the only honest path — "pick one and say why".

Ruling: (b) — the named outstanding error. surveyssvc.Port.ReconcileRole now returns ErrReconcileNeedsDeploy (never a fabricated HTTP success, ADR 0100). Why:

  1. LimeSurvey RC2 exposes no per-person permission setter — established since #1540, so there is no honest per-person HTTP path.
  2. A real loopback oneshot-trigger (a) would need the operator list materialised on the NODE out of the render (a control-plane-written surveys-operators file the oneshot reads at runtime) — a larger cross-cutting deploy-infra mechanism, and one hard to prove offline.
  3. The render already carries the WHOLE operator set and re-seeds it on every deploy (build point 1 + 3: the limesurvey-auth oneshot grants each listed operator superadmin and demotes any no longer listed; the P4 deploy hook drives it "for free"). So the DEPLOY is the honest application path, and the per-person reconcile is honestly OUTSTANDING until then — member detail (P6-S4) reads role_in_app: superadmin on surveys with not_applied honest, exactly as the acceptance asks.

Why it is a two-way door: revertible (a later ticket can add the loopback trigger + node-side operator file without touching this contract) and provable by tests I ran — the render test (two operators → two grants; a removed one → demoted; admin identity never demoted), the reconcile contract test (ReconcileRole → ErrReconcileNeedsDeploy, grant + revoke, idempotent), and the member-detail test (superadmin + not_applied). It is not on the one-way-door list (no credential/security-widening/data-destruction/spend). The live end-to-end proof rides #1547.

Secondary call (also two-way): the operator LIST is sourced at deploy via a new provision.RoleReconciler.Operators(ctx) seam (member lists active operators), UNIONed founder-first with clan.OperatorAccount, so an unwired roles seam is unchanged (founding seat alone) — never a deploy left with an empty set it did not have before.

Ruled by agent under ADR 0174 — veto anytime. **The decision (build point 2):** the ticket asked me to pick, for `Port.ReconcileRole`, EITHER (a) trigger the run for real over the loopback self-deploy target (#1504) OR (b) return the named outstanding error because a deploy is the only honest path — "pick one and say why". **Ruling: (b) — the named outstanding error.** `surveyssvc.Port.ReconcileRole` now returns `ErrReconcileNeedsDeploy` (never a fabricated HTTP success, ADR 0100). Why: 1. LimeSurvey RC2 exposes no per-person permission setter — established since #1540, so there is no honest per-person HTTP path. 2. A real loopback oneshot-trigger (a) would need the operator list materialised on the NODE out of the render (a control-plane-written `surveys-operators` file the oneshot reads at runtime) — a larger cross-cutting deploy-infra mechanism, and one hard to prove offline. 3. The render already carries the WHOLE operator set and re-seeds it on every deploy (build point 1 + 3: the `limesurvey-auth` oneshot grants each listed operator superadmin and demotes any no longer listed; the P4 deploy hook drives it "for free"). So the DEPLOY is the honest application path, and the per-person reconcile is honestly OUTSTANDING until then — member detail (P6-S4) reads `role_in_app: superadmin` on surveys with `not_applied` honest, exactly as the acceptance asks. **Why it is a two-way door:** revertible (a later ticket can add the loopback trigger + node-side operator file without touching this contract) and provable by tests I ran — the render test (two operators → two grants; a removed one → demoted; admin identity never demoted), the reconcile contract test (`ReconcileRole` → `ErrReconcileNeedsDeploy`, grant + revoke, idempotent), and the member-detail test (superadmin + not_applied). It is not on the one-way-door list (no credential/security-widening/data-destruction/spend). The live end-to-end proof rides #1547. **Secondary call (also two-way):** the operator LIST is sourced at deploy via a new `provision.RoleReconciler.Operators(ctx)` seam (member lists active operators), UNIONed founder-first with `clan.OperatorAccount`, so an unwired roles seam is unchanged (founding seat alone) — never a deploy left with an empty set it did not have before.

close-report for #1552 — status success

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

envelope
{
  "issue": 1552,
  "status": "success",
  "commits": [
    "c3a272e7"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/portroute.go",
    "internal/clan/surveys.go",
    "internal/clan/surveys_attach.go",
    "internal/clan/surveys_attach_test.go",
    "internal/clan/surveys_test.go",
    "internal/member/komiti.go",
    "internal/member/roles.go",
    "internal/member/roles_test.go",
    "internal/provision/deploy.go",
    "internal/provision/deploy_ports_test.go",
    "internal/provision/health_test.go",
    "internal/provision/provision.go",
    "internal/surveyssvc/surveyssvc.go",
    "internal/surveyssvc/surveyssvc_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Render test pins the operator LIST (two operators -> two grants; a removed one -> demoted); reconcile contract test (grant -> run triggered / outstanding named; revoke; idempotent)": "internal/clan/surveys_test.go TestRenderSurveys_ReconcilesTheWholeOperatorList (operators=( \"opihi\" \"rata\" ), grant-each loop, deleteAllByAttributes demote pass, admin identity never demoted) + TestRenderSurveys_OperatorIsSeededSuperadmin; internal/surveyssvc/surveyssvc_test.go TestPort_ReconcileRoleIsOutstandingNamed (grant+revoke -> ErrReconcileNeedsDeploy, idempotent) — outstanding-named path, ruled two-way under ADR 0174 (comment on issue)",
    "Member detail for a granted operator reads role_in_app: superadmin on surveys with not_applied honest": "internal/member/roles_test.go TestMemberDetail_SurveysOperatorIsSuperadminNotAppliedHonest (surveys reconciler-mapped superadmin, ReconcileRole outstanding -> RoleInApp=superadmin, NotApplied=true); surveyssvc.Port.RoleMapping OperatorRole=superadmin + ReconcileRole=ErrReconcileNeedsDeploy",
    "Live proof rides #1547 (operator-surveys reaches global settings; member-surveys is refused)": "deferred to the #1547 clan-lab drive per the ticket; the render + posture + plumbing are the contract it rides (STATUS.md milestone entry)",
    "#1167's strip (TestRenderFrontDoor_SurveysExemptPathStripsIdentity) unregressed": "SurveysExemptPaths untouched; go test ./internal/clan/... green including TestRenderFrontDoor_SurveysExemptPathStripsIdentity"
  },
  "summary": "surveys reconciles its superadmin set to the ledger's whole operator list (grant each, demote unlisted) at deploy, becomes reconciler-mapped, and ReconcileRole returns a named outstanding error so a granted operator reads superadmin/not_applied honestly.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1552 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1552, "status": "success", "commits": [ "c3a272e7" ], "changed_files": [ "STATUS.md", "internal/clan/portroute.go", "internal/clan/surveys.go", "internal/clan/surveys_attach.go", "internal/clan/surveys_attach_test.go", "internal/clan/surveys_test.go", "internal/member/komiti.go", "internal/member/roles.go", "internal/member/roles_test.go", "internal/provision/deploy.go", "internal/provision/deploy_ports_test.go", "internal/provision/health_test.go", "internal/provision/provision.go", "internal/surveyssvc/surveyssvc.go", "internal/surveyssvc/surveyssvc_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./...", "exit_code": 0 } ], "criteria": { "Render test pins the operator LIST (two operators -> two grants; a removed one -> demoted); reconcile contract test (grant -> run triggered / outstanding named; revoke; idempotent)": "internal/clan/surveys_test.go TestRenderSurveys_ReconcilesTheWholeOperatorList (operators=( \"opihi\" \"rata\" ), grant-each loop, deleteAllByAttributes demote pass, admin identity never demoted) + TestRenderSurveys_OperatorIsSeededSuperadmin; internal/surveyssvc/surveyssvc_test.go TestPort_ReconcileRoleIsOutstandingNamed (grant+revoke -> ErrReconcileNeedsDeploy, idempotent) — outstanding-named path, ruled two-way under ADR 0174 (comment on issue)", "Member detail for a granted operator reads role_in_app: superadmin on surveys with not_applied honest": "internal/member/roles_test.go TestMemberDetail_SurveysOperatorIsSuperadminNotAppliedHonest (surveys reconciler-mapped superadmin, ReconcileRole outstanding -> RoleInApp=superadmin, NotApplied=true); surveyssvc.Port.RoleMapping OperatorRole=superadmin + ReconcileRole=ErrReconcileNeedsDeploy", "Live proof rides #1547 (operator-surveys reaches global settings; member-surveys is refused)": "deferred to the #1547 clan-lab drive per the ticket; the render + posture + plumbing are the contract it rides (STATUS.md milestone entry)", "#1167's strip (TestRenderFrontDoor_SurveysExemptPathStripsIdentity) unregressed": "SurveysExemptPaths untouched; go test ./internal/clan/... green including TestRenderFrontDoor_SurveysExemptPathStripsIdentity" }, "summary": "surveys reconciles its superadmin set to the ledger's whole operator list (grant each, demote unlisted) at deploy, becomes reconciler-mapped, and ReconcileRole returns a named outstanding error so a granted operator reads superadmin/not_applied honestly.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Author
Owner

Landed, but not yet true on main for a LATER grant: a P4 deploy attaches only the ADDED services (deploy.go diffSelection), so surveys' operator list is rendered once at its own attach and never again — and the ErrReconcileNeedsDeploy tail never clears. Follow-up #1554 (bug, priority, ready-for-agent) blocks #1547.

Landed, but not yet true on `main` for a LATER grant: a P4 deploy attaches only the ADDED services (`deploy.go` diffSelection), so surveys' operator list is rendered once at its own attach and never again — and the `ErrReconcileNeedsDeploy` tail never clears. Follow-up **#1554** (bug, priority, ready-for-agent) blocks #1547.
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#1552
No description provided.