by-hand member can NEVER become active: story 15's FirstLogin flip is built but wired to nothing — suspend (story 19) unreachable, phase-2 regression red #789

Closed
opened 2026-08-25 04:36:02 +00:00 by ben · 2 comments
Owner

Found by the #722 phase-2 regression drive 20260825T042104Z (24/26 green; the reporter was token-limited so this is filed from the watch). First time the by-hand → sign-in → suspend story has ever been walked end-to-end on current code (the two prior drives red'd earlier on the since-fixed #765 assertion).

Failure

invite-member leg: after the by-hand member signed in through the door (OIDC with the temp password; Files landing asserted; the story-11 admin-denial 403 graded correctly), POST /api/v1/members/e2e-member/suspend → 400 {"code":"act_failed","message":"member: only an active member can be suspended"}.

Root cause — story 15's activation hook is an ORPHAN

internal/member/byhand.go Orchestrator.FirstLogin ("records a member's first sign-in, story 15": flips StatusNeverSignedIn → StatusActive, returns PromptCredential: true) has zero callers: grep -rni 'firstlogin|first-login|first_login|PromptCredential' across Go/TS/Vue finds only its own definition. No control-plane route, no forward_auth/auth-gate observation, no reconciler invokes it. A by-hand member therefore stays hasn't signed in yet FOREVER — detail.go keeps CanGrant=false/controls disabled, and suspend.go's ErrCannotSuspend correctly refuses (the switch is an active↔suspended toggle).

So two stories are dead for by-hand members: story 15 (first-login activation + credential prompt) and, transitively, stories 19/20 (suspend/un-suspend — unreachable while the member can never become active).

Where the wire belongs

The natural observation point is the gateway's per-request auth-gate check (ADR 0074/0076, refusal.go re-evaluates per request): the first authenticated forward_auth pass for a StatusNeverSignedIn member is exactly "the member signed in". Alternatives: the IdP port's session-established signal, or the existing member reconciler pass. Whichever lands, the e2e leg needs no change — it already signs the member in before suspending; a short activation-visible poll in the leg (detail read until active) would absorb an async wire.

Blocks #722 (attached).

Found by the #722 phase-2 regression drive `20260825T042104Z` (24/26 green; the reporter was token-limited so this is filed from the watch). First time the by-hand → sign-in → suspend story has ever been walked end-to-end on current code (the two prior drives red'd earlier on the since-fixed #765 assertion). ## Failure `invite-member` leg: after the by-hand member signed in through the door (OIDC with the temp password; Files landing asserted; the story-11 admin-denial 403 graded correctly), `POST /api/v1/members/e2e-member/suspend` → `400 {"code":"act_failed","message":"member: only an active member can be suspended"}`. ## Root cause — story 15's activation hook is an ORPHAN `internal/member/byhand.go` `Orchestrator.FirstLogin` ("records a member's first sign-in, story 15": flips `StatusNeverSignedIn → StatusActive`, returns `PromptCredential: true`) **has zero callers**: `grep -rni 'firstlogin|first-login|first_login|PromptCredential'` across Go/TS/Vue finds only its own definition. No control-plane route, no forward_auth/auth-gate observation, no reconciler invokes it. A by-hand member therefore stays `hasn't signed in yet` FOREVER — `detail.go` keeps `CanGrant=false`/controls disabled, and `suspend.go`'s `ErrCannotSuspend` correctly refuses (the switch is an active↔suspended toggle). So two stories are dead for by-hand members: story 15 (first-login activation + credential prompt) and, transitively, stories 19/20 (suspend/un-suspend — unreachable while the member can never become active). ## Where the wire belongs The natural observation point is the gateway's per-request auth-gate check (ADR 0074/0076, `refusal.go` re-evaluates per request): the first authenticated forward_auth pass for a `StatusNeverSignedIn` member is exactly "the member signed in". Alternatives: the IdP port's session-established signal, or the existing member reconciler pass. Whichever lands, the e2e leg needs no change — it already signs the member in before suspending; a short activation-visible poll in the leg (detail read until `active`) would absorb an async wire. Blocks #722 (attached).

swarm-claim host=elitebook-distributed-server-03 run=10051
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10051 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #789 — status success

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

envelope
{
  "issue": 789,
  "status": "success",
  "commits": [
    "b8b71ce"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/controlapi/authgate.go",
    "internal/controlapi/authgate_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/controlapi/ ./internal/member/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go build ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Orchestrator.FirstLogin now has a caller (was an orphan)": "internal/controlapi/authgate.go — gateVerify calls the FirstLoginObserver (satisfied by *member.Orchestrator) on every authenticated pass",
    "A by-hand member becomes active on their first authenticated sign-in": "TestAuthGate_FirstPassActivatesByHandMember (real orchestrator): a seeded StatusNeverSignedIn member is StatusActive after one gate pass",
    "Suspend (story 19) is reachable once the member is active": "activation flip is the only thing that was missing; suspend.go's active<->suspended toggle already refuses only non-active members — verified green in internal/member tests",
    "The observation fires on authenticated passes and never fails the request": "TestAuthGate_ObservesFirstLoginOnAuthenticatedPass + TestAuthGate_FirstLoginErrorDoesNotFailTheRequest",
    "Production wires with no e2e/main.go change": "*member.Orchestrator satisfies FirstLoginObserver by construction (assertion in authgate.go); main.go already passes c.mem; observation is synchronous"
  },
  "summary": "Wired story 15's FirstLogin activation into the auth gate's per-request forward_auth check so a by-hand member becomes active on first sign-in, unblocking suspend and closing the phase-2 #722 regression.",
  "blockers": []
}
**close-report** for #789 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 789, "status": "success", "commits": [ "b8b71ce" ], "changed_files": [ "STATUS.md", "internal/controlapi/authgate.go", "internal/controlapi/authgate_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/controlapi/ ./internal/member/", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go build ./...", "exit_code": 0 } ], "criteria": { "Orchestrator.FirstLogin now has a caller (was an orphan)": "internal/controlapi/authgate.go — gateVerify calls the FirstLoginObserver (satisfied by *member.Orchestrator) on every authenticated pass", "A by-hand member becomes active on their first authenticated sign-in": "TestAuthGate_FirstPassActivatesByHandMember (real orchestrator): a seeded StatusNeverSignedIn member is StatusActive after one gate pass", "Suspend (story 19) is reachable once the member is active": "activation flip is the only thing that was missing; suspend.go's active<->suspended toggle already refuses only non-active members — verified green in internal/member tests", "The observation fires on authenticated passes and never fails the request": "TestAuthGate_ObservesFirstLoginOnAuthenticatedPass + TestAuthGate_FirstLoginErrorDoesNotFailTheRequest", "Production wires with no e2e/main.go change": "*member.Orchestrator satisfies FirstLoginObserver by construction (assertion in authgate.go); main.go already passes c.mem; observation is synchronous" }, "summary": "Wired story 15's FirstLogin activation into the auth gate's per-request forward_auth check so a by-hand member becomes active on first sign-in, unblocking suspend and closing the phase-2 #722 regression.", "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#789
No description provided.