remove-steward cannot land from the founder's session alone — a 2-of-2 rotation has only one signer on the drive #1107

Closed
opened 2026-09-01 07:10:17 +00:00 by matou-build-agent · 2 comments

Failure

With add-steward unblocked (commit f6e55f5, sig 759b7b6197f7), the drive now reaches remove-steward for the first time. It cannot go green as written: the leg will sit on its own five-minute ceiling and red with the rotation must resolve once the majority has signed (S9i).

Evidence

Drive 20260901T064205Z ended with two stewards. Its failure screenshot (artifacts/journey.idip-IDIP-journey--133f0-ey-on-the-rehearsal-droplet/test-failed-1.png) shows both Drive Operator and Hine Aroha wearing "Remove from stewards", which dashboard/src/components/members/IdipRosterPanel.vue:107-117 renders only for m.role === 'operator'. That is the state remove-steward starts from.

At a steward count of 2 the majority line is 2:

  • MajorityThreshold(2) = 2/2 + 1 = 2 — internal/keria/rotations.go:166-171.
  • StartRemove records only the starter's co-signature — internal/keria/rotations.go:223-228 → start → Cosigns: []Cosign{{Steward: steward, …, Started: true}} at internal/keria/rotations.go:255. One of two → settle leaves it Pending (internal/keria/rotations.go:267-275).
  • Cosign is idempotent per steward: if rot.hasCosign(steward) { return *rot, false, nil } — internal/keria/rotations.go:296-298. The founder's S9i "Sign — remove" is a no-op.

The drive only ever co-signs from the founder's page: demoteStewardAndCosign(dash, portalAddress, founderPhrase, MEMBER_NAME) → runStewardRotation(dash, …) (app/tests/e2e/fixtures/idip.ts:938-945). PendingRotationScreen.vue:181 seeds youSigned = false on mount, so the Sign button is enabled and clickable — the click simply returns the unchanged rotation, sets youSigned = true, and the [data-status="rotation-pending"] pill (PendingRotationScreen.vue:20) stays on screen. The fixture's final assertion (app/tests/e2e/fixtures/idip.ts:948-952) then burns 5 * 60_000 and reds.

This was anticipated in the helper's own docstring — "a larger set's second signer is a different session's act — the drive reds honestly if a threshold it cannot meet leaves the rotation pending" — but journey.idip.spec.ts:993-996 still drives the leg expecting it to land.

Suspected layer

Two candidates, and they fork:

  1. The drive (fixture layer). The second signature genuinely is a different session's act. The drive already holds Hine's phrase and already signs her in at the door (member-sign-in), and she is now an operator, so her session can reach the steward routes (#1098). demoteStewardAndCosign would open a second browser context, run establishOperatorSession with member1Phrase, click the S1i open-pending-rotation strip there and co-sign as her.

  2. The rotation contract (ADR 0197). currentCount does not exclude the steward being removed, so at N=2 the target must sign their own removal. That inverts ADR 0197's stated reason for the solo-steward nudge — "add a second steward and, if one is lost, the survivors rotate them out and the community lives" (dashboard/src/lib/stewardRotation.ts:98-100). At N=2 the survivors are 1, which is not a majority of 2, so a lost or hostile second steward can never be rotated out. If that is wrong, the majority for a remove should be taken over the set minus the target, and the drive's walk changes with it.

What plugging it needs

A ruling on (2) first — does the steward being removed count toward the majority that removes them? — because it decides whether the drive's fix is "co-sign as Hine" or "the founder's start already is the majority of the surviving set". Then the matching change to demoteStewardAndCosign (app/tests/e2e/fixtures/idip.ts:938-945) plus a fixture pin, in the house style of the pins added in f6e55f5, so the next split reds offline rather than on a paid droplet.

drive 20260901T064205Z red at add-steward: locator.click: Timeout 300000ms exceeded. Call log: - waiting for locator('[data-action="open-pending-rotation"]')
evidence: /home/dev/swarm/Matou/idss/test-results/drive-idip/20260901T064205Z on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured

## Failure With `add-steward` unblocked (commit f6e55f5, sig 759b7b6197f7), the drive now reaches `remove-steward` for the first time. It cannot go green as written: the leg will sit on its own five-minute ceiling and red with `the rotation must resolve once the majority has signed (S9i)`. ## Evidence Drive `20260901T064205Z` ended with **two stewards**. Its failure screenshot (`artifacts/journey.idip-IDIP-journey--133f0-ey-on-the-rehearsal-droplet/test-failed-1.png`) shows both `Drive Operator` and `Hine Aroha` wearing **"Remove from stewards"**, which `dashboard/src/components/members/IdipRosterPanel.vue:107-117` renders only for `m.role === 'operator'`. That is the state `remove-steward` starts from. At a steward count of 2 the majority line is 2: - `MajorityThreshold(2) = 2/2 + 1 = 2` — `internal/keria/rotations.go:166-171`. - `StartRemove` records **only the starter's** co-signature — `internal/keria/rotations.go:223-228` → `start` → `Cosigns: []Cosign{{Steward: steward, …, Started: true}}` at `internal/keria/rotations.go:255`. One of two → `settle` leaves it `Pending` (`internal/keria/rotations.go:267-275`). - `Cosign` is **idempotent per steward**: `if rot.hasCosign(steward) { return *rot, false, nil }` — `internal/keria/rotations.go:296-298`. The founder's S9i "Sign — remove" is a no-op. The drive only ever co-signs from the founder's page: `demoteStewardAndCosign(dash, portalAddress, founderPhrase, MEMBER_NAME)` → `runStewardRotation(dash, …)` (`app/tests/e2e/fixtures/idip.ts:938-945`). `PendingRotationScreen.vue:181` seeds `youSigned = false` on mount, so the Sign button is enabled and clickable — the click simply returns the unchanged rotation, sets `youSigned = true`, and the `[data-status="rotation-pending"]` pill (`PendingRotationScreen.vue:20`) stays on screen. The fixture's final assertion (`app/tests/e2e/fixtures/idip.ts:948-952`) then burns `5 * 60_000` and reds. This was anticipated in the helper's own docstring — "a larger set's second signer is a different session's act — the drive reds honestly if a threshold it cannot meet leaves the rotation pending" — but `journey.idip.spec.ts:993-996` still drives the leg expecting it to land. ## Suspected layer Two candidates, and they fork: 1. **The drive (fixture layer).** The second signature genuinely is a different session's act. The drive already holds Hine's phrase and already signs her in at the door (`member-sign-in`), and she is now an operator, so her session can reach the steward routes (#1098). `demoteStewardAndCosign` would open a second browser context, run `establishOperatorSession` with `member1Phrase`, click the S1i `open-pending-rotation` strip there and co-sign as her. 2. **The rotation contract (ADR 0197).** `currentCount` does not exclude the steward being removed, so at N=2 the **target must sign their own removal**. That inverts ADR 0197's stated reason for the solo-steward nudge — "add a second steward and, if one is lost, the survivors rotate them out and the community lives" (`dashboard/src/lib/stewardRotation.ts:98-100`). At N=2 the survivors are 1, which is not a majority of 2, so a lost or hostile second steward can never be rotated out. If that is wrong, the majority for a `remove` should be taken over the set **minus the target**, and the drive's walk changes with it. ## What plugging it needs A ruling on (2) first — does the steward being removed count toward the majority that removes them? — because it decides whether the drive's fix is "co-sign as Hine" or "the founder's start already is the majority of the surviving set". Then the matching change to `demoteStewardAndCosign` (`app/tests/e2e/fixtures/idip.ts:938-945`) plus a fixture pin, in the house style of the pins added in f6e55f5, so the next split reds offline rather than on a paid droplet. drive `20260901T064205Z` red at `add-steward`: `locator.click: Timeout 300000ms exceeded. Call log: - waiting for locator('[data-action="open-pending-rotation"]')` evidence: `/home/dev/swarm/Matou/idss/test-results/drive-idip/20260901T064205Z` on matou-workstation (legs.json and whatever else the drive harvested there) — a representative screenshot is attached here if one was captured <!-- rehearsal-sig: 759b7b6197f7 -->
Author
Member

Ruled by agent under ADR 0174 — routing to ready-for-human (veto anytime). This ticket's blocking question is a one-way door, so I am not landing code; I am handing Ben a worked ruling packet per ADR 0174 rule 4. No contract or fixture change was made this session.

Why human

The residue is a one-way-door ruling (ADR 0174 rule 3: security-posture widenings — loosening an auth requirement): does the steward being removed count toward the majority that removes them? Answering it changes who can eject a key-holding steward from the community group AID — the most trust-critical act on the IDIP path — and ADR 0197 is itself flagged one-way on "the community's key-management shape". A session cannot adopt this under rule 1 even though it is revertible+provable, because rule 1(c) excludes the one-way list.

The contradiction, pinned in code

At a steward count of 2 the current contract deadlocks a remove:

  • MajorityThreshold(2) = 2/2 + 1 = 2 — internal/keria/rotations.go:166-171.
  • count passed to StartRemove is the full current set incl. the target — a.reg.Operators() at internal/keria/adapter.go:833-837.
  • start records only the starter's co-sign — internal/keria/rotations.go:255 — so at 2-of-2 settle leaves it Pending (:267-275).
  • Cosign is idempotent per steward (:296-298), so the only path to the 2nd signature is the target signing their own removal.

Existing seam coverage masks this: TestRotation_RemoveRunsTheSameCosignMachinery (internal/keria/rotations_test.go:159) runs N=3, where a non-target third steward ("Eben") supplies the majority signature. At N=2 the only non-target survivor is the starter, already signed — there is no one left to be the 2nd signer.

This directly contradicts ADR 0197's own rescue rationale (ADR 0195 rung 3), quoted in dashboard/src/lib/stewardRotation.ts:97-100: "add a second steward and, if one is lost, the survivors rotate them out and the community lives." At N=2 the survivors are 1, which is not a majority of 2 — so a lost or hostile second steward can never be rotated out. The ADR's "majority of N (… 2-of-2 …)" threshold line and its rescue consequence disagree for the remove case only.

Proposed default ruling (advisory — for the digest, does not auto-adopt)

Rule B: the majority for a remove is taken over the set MINUS the target — the survivors decide. This is the only reading consistent with ADR 0197's rescue rationale. Consequences to weigh:

  • N=2 → survivors 1 → founder's StartRemove reaches majority at the start and lands immediately (the rescue case works).
  • N=3 → survivors 2 → both survivors must co-sign; the target's signature must not count.
  • Non-obvious trust consequence: at N=2 this makes removal a mutual single-signer kill-switch — either steward can unilaterally eject the other. The ADR's rationale assumed a lost steward; it did not explicitly bless a hostile-founder eject. This is exactly why the call is Ben's.

Scope note for whoever implements B: it is not just lowering currentCount to count-1. Cosign currently counts any steward, including the target — so B also requires the target's co-sign to be excluded from the count (and the S9i sign button not offered to the target on their own removal). Both halves are needed or N≥3 can still land on starter+target instead of two survivors.

Alternative (Rule A — keep 2-of-2 incl. target): then removal at N=2 requires the target's consent, the rescue scenario stays genuinely impossible, and that gap must be recorded as an ADR 0197 amendment (not left implicit). The drive fix would then be option (1) below.

Per-fork execution plan (so the next session moves fast once Ben rules)

  • If B (default): change MajorityThreshold usage / cosign counting for DirRemove to exclude the target (both halves above); add a N=2 remove seam test to internal/keria/rotations_test.go (red before green) asserting the founder's start lands the remove; add a rotation-adapter test. No drive change is needed — under B the remove lands at the start, so runStewardRotation's existing flipped branch (app/tests/e2e/fixtures/idip.ts:941) returns green without an S9i, exactly as the 1-of-1 add does. Update ADR 0197 (remove-majority = survivors) and STATUS.md.
  • If A: the contract stands; fix the drive per suspected-layer (1) — demoteStewardAndCosign opens a second browser context, runs establishOperatorSession(member1Phrase) (Hine is now an operator, #1098), and co-signs the pending remove as her (the S1i open-pending-rotation strip → cosign-rotation), in the house style of the f6e55f5 pins so the split reds offline. Record the rescue-impossibility gap as an ADR 0197 amendment.

Either fork also wants an offline pin so a future N=2 split reds fast in Vitest/Go rather than burning 5 * 60_000 on a paid droplet (app/tests/e2e/fixtures/idip.ts:949-952) — this session confirmed that ceiling is the paid-droplet burn journey.idip.spec.ts:993-996 hit.

What I did / didn't touch

  • Read-only investigation only; working tree clean, nothing committed.
  • Did not change the rotation contract (one-way door) and did not apply the drive fix (its shape depends on the ruling — see above).
Ruled by agent under ADR 0174 — **routing to `ready-for-human`** (veto anytime). This ticket's blocking question is a **one-way door**, so I am not landing code; I am handing Ben a worked ruling packet per ADR 0174 rule 4. No contract or fixture change was made this session. ## Why human **The residue is a one-way-door ruling** (ADR 0174 rule 3: *security-posture widenings — loosening an auth requirement*): **does the steward being removed count toward the majority that removes them?** Answering it changes who can eject a key-holding steward from the community group AID — the most trust-critical act on the IDIP path — and ADR 0197 is itself flagged one-way on "the community's key-management shape". A session cannot adopt this under rule 1 even though it is revertible+provable, because rule 1(c) excludes the one-way list. ### The contradiction, pinned in code At a steward count of 2 the current contract deadlocks a remove: - `MajorityThreshold(2) = 2/2 + 1 = 2` — `internal/keria/rotations.go:166-171`. - `count` passed to `StartRemove` is the **full** current set incl. the target — `a.reg.Operators()` at `internal/keria/adapter.go:833-837`. - `start` records only the starter's co-sign — `internal/keria/rotations.go:255` — so at 2-of-2 `settle` leaves it `Pending` (`:267-275`). - `Cosign` is idempotent per steward (`:296-298`), so the only path to the 2nd signature is **the target signing their own removal**. Existing seam coverage masks this: `TestRotation_RemoveRunsTheSameCosignMachinery` (`internal/keria/rotations_test.go:159`) runs **N=3**, where a non-target third steward ("Eben") supplies the majority signature. At N=2 the only non-target survivor is the starter, already signed — there is no one left to be the 2nd signer. This directly contradicts ADR 0197's own rescue rationale (ADR 0195 rung 3), quoted in `dashboard/src/lib/stewardRotation.ts:97-100`: *"add a second steward and, if one is lost, the survivors rotate them out and the community lives."* At N=2 the survivors are 1, which is not a majority of 2 — so a **lost or hostile** second steward can never be rotated out. The ADR's "majority of N (… 2-of-2 …)" threshold line and its rescue consequence disagree for the remove case only. ### Proposed default ruling (advisory — for the digest, does not auto-adopt) **Rule B: the majority for a `remove` is taken over the set MINUS the target** — the survivors decide. This is the only reading consistent with ADR 0197's rescue rationale. Consequences to weigh: - N=2 → survivors 1 → founder's `StartRemove` reaches majority **at the start** and lands immediately (the rescue case works). - N=3 → survivors 2 → both survivors must co-sign; the target's signature must **not** count. - **Non-obvious trust consequence:** at N=2 this makes removal a mutual single-signer kill-switch — *either* steward can unilaterally eject the other. The ADR's rationale assumed a *lost* steward; it did not explicitly bless a hostile-founder eject. This is exactly why the call is Ben's. **Scope note for whoever implements B:** it is not just lowering `currentCount` to `count-1`. `Cosign` currently counts *any* steward, including the target — so B also requires the target's co-sign to be excluded from the count (and the S9i sign button not offered to the target on their own removal). Both halves are needed or N≥3 can still land on starter+target instead of two survivors. **Alternative (Rule A — keep 2-of-2 incl. target):** then removal at N=2 requires the target's consent, the rescue scenario stays genuinely impossible, and that gap must be recorded as an ADR 0197 amendment (not left implicit). The drive fix would then be option (1) below. ### Per-fork execution plan (so the next session moves fast once Ben rules) - **If B (default):** change `MajorityThreshold` usage / cosign counting for `DirRemove` to exclude the target (both halves above); add a **N=2 remove** seam test to `internal/keria/rotations_test.go` (red before green) asserting the founder's start lands the remove; add a rotation-adapter test. **No drive change is needed** — under B the remove lands at the start, so `runStewardRotation`'s existing `flipped` branch (`app/tests/e2e/fixtures/idip.ts:941`) returns green without an S9i, exactly as the 1-of-1 add does. Update ADR 0197 (remove-majority = survivors) and `STATUS.md`. - **If A:** the contract stands; fix the drive per suspected-layer (1) — `demoteStewardAndCosign` opens a second browser context, runs `establishOperatorSession(member1Phrase)` (Hine is now an operator, #1098), and co-signs the pending remove as her (the S1i `open-pending-rotation` strip → `cosign-rotation`), in the house style of the f6e55f5 pins so the split reds offline. Record the rescue-impossibility gap as an ADR 0197 amendment. Either fork also wants an **offline pin** so a future N=2 split reds fast in Vitest/Go rather than burning `5 * 60_000` on a paid droplet (`app/tests/e2e/fixtures/idip.ts:949-952`) — this session confirmed that ceiling is the paid-droplet burn `journey.idip.spec.ts:993-996` hit. ### What I did / didn't touch - Read-only investigation only; working tree clean, nothing committed. - Did **not** change the rotation contract (one-way door) and did **not** apply the drive fix (its shape depends on the ruling — see above).
ben closed this issue 2026-09-01 20:22:54 +00:00
Owner

Ruled and fixed — 1374829f (ADR 0197 amendment 3).

Ben's ruling: "the org multisig should be 1 of n, so any 1 operator can sign org transactions."

You laid the fork out exactly right, and the answer is your option 2 — the rotation contract, not the drive. Issuance was already kt=1; rotation now matches it. Every steward-set rotation lands on the acting steward's own signature, at every N.

Your analysis of why is what carried the decision: at N=2 the threshold was 2 and currentCount included the steward being removed, so the target had to sign their own removal. That inverts ADR 0197's own stated reason for the solo-steward nudge — "add a second steward and, if one is lost, the survivors rotate them out and the community lives". At N=2 the survivors are 1, which is not a majority of 2. Majority-of-N is only coherent from N=3 up, and two stewards is the ordinary shape for a small community.

Worth adding to the record: 1-of-N is the consistent choice, not just the convenient one. At N=2 either steward could already issue credentials, revoke them, suspend a member and remove one — each single-handed under kt=1. Rotation being the sole act requiring unanimity was the anomaly, not the protection.

What landed:

  • RotationThreshold (Go) and rotationThreshold (renderer) return 1 at every N, setting both cosignThreshold and nextThreshold to 1.
  • A pending rotation is now unreachable in production, so S9i, the co-sign strip and cancel are dormant. They are neither deleted nor left untested: Rotations takes a threshold policy, so the co-sign / cancel / one-at-a-time / never-expires machinery stays proven above 1 rather than becoming untested shipping code the moment policy made its state unreachable.
  • Already-founded communities keep the thresholds baked into their KEL until a rotation under the new policy resets nt. The drive re-founds each run, so it gets 1-of-N from inception.
  • ErrLastSteward unchanged — a community still keeps at least one steward.
  • DDR 0217 ruling 7 amended: one-at-a-time, the last-steward refusal and the solo-steward nudge survive, and the nudge is now truthful.

Your option 1 turned out unnecessary: 952965f9's flipped detection already greens a rotation that lands at the click, which is now every rotation. No drive change was needed.

Checks: go build ./...; go test ./internal/... ./control-plane/...; app vitest 1303; dashboard vitest 1350; vue-tsc both; gofmt clean.

**Ruled and fixed — `1374829f` (ADR 0197 amendment 3).** Ben's ruling: *"the org multisig should be 1 of n, so any 1 operator can sign org transactions."* You laid the fork out exactly right, and the answer is your option 2 — the rotation contract, not the drive. Issuance was already `kt=1`; rotation now matches it. Every steward-set rotation lands on the acting steward's own signature, at every N. Your analysis of why is what carried the decision: at N=2 the threshold was 2 **and** `currentCount` included the steward being removed, so the target had to sign their own removal. That inverts ADR 0197's own stated reason for the solo-steward nudge — "add a second steward and, if one is lost, the survivors rotate them out and the community lives". At N=2 the survivors are 1, which is not a majority of 2. Majority-of-N is only coherent from N=3 up, and two stewards is the ordinary shape for a small community. Worth adding to the record: 1-of-N is the *consistent* choice, not just the convenient one. At N=2 either steward could already issue credentials, revoke them, suspend a member and remove one — each single-handed under `kt=1`. Rotation being the sole act requiring unanimity was the anomaly, not the protection. What landed: - `RotationThreshold` (Go) and `rotationThreshold` (renderer) return 1 at every N, setting both `cosignThreshold` and `nextThreshold` to 1. - **A pending rotation is now unreachable in production**, so S9i, the co-sign strip and cancel are dormant. They are neither deleted nor left untested: `Rotations` takes a threshold policy, so the co-sign / cancel / one-at-a-time / never-expires machinery stays proven above 1 rather than becoming untested shipping code the moment policy made its state unreachable. - Already-founded communities keep the thresholds baked into their KEL until a rotation under the new policy resets `nt`. The drive re-founds each run, so it gets 1-of-N from inception. - `ErrLastSteward` unchanged — a community still keeps at least one steward. - DDR 0217 ruling 7 amended: one-at-a-time, the last-steward refusal and the solo-steward nudge survive, and the nudge is now **truthful**. Your option 1 turned out unnecessary: `952965f9`'s `flipped` detection already greens a rotation that lands at the click, which is now every rotation. No drive change was needed. Checks: `go build ./...`; `go test ./internal/... ./control-plane/...`; app vitest 1303; dashboard vitest 1350; `vue-tsc` both; gofmt clean.
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#1107
No description provided.