You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
impl(pm-stack): SSO relying-party H2 — identity_link table + link/unlink API (child of #9086) #14260
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)priority/normalOrdinary priority (the default)
Child slice of #9086 (design: PR #14089, doc/2026-11-24T04-50-00Z_design_sso-relying-party-9086/ §4.3 + §5 slice H2). Depends on H1 (#14259). Parent of H3/H5.
What
New identity_link table in the CENTRAL tenancy DB (beside E's account/binding tables): one row per linked login door (door = github | google | microsoft | devtoday; provider_sub key; UNIQUE (door, provider_sub); email is contact-only, never a key). Link ceremony (authenticated session + new-door proof), last-door guard (single active link cannot be unlinked without a same-operation replacement), audit events on every link/unlink, history rows retained.
Acceptance
Migration + link/unlink round-trip tests including guard refusal and history retention.
DB-continuity proof: tenant rows untouched across relink (access keys off account_id/binding_id, never off a door).
Triage verdict (task 23357, lane code-h, 2026-11-24): still open — remainder already routed and live.
Fresh state: #14260 OPEN, no hold labels, no merged or open PR. Design PR #14089 merged; parent #9086 OPEN. Dependency H1 (#14259) still OPEN (its triage 22916 is blocked).
No new packet filed: the implementation remainder is already owned by live feature_slice task 23353 (H2 of #14260, claimed by oc-code-05, lane any-occodejlldbejkoaghibjibcppglfbdajkgfoj). Enqueueing again would collide on the same work identity. This triage closes with that task as the recorded follow-up.
Landed as PR #14418 (open, unmerged — the merge is Archer's; this lane does not merge):
Migration pkgs/id/hosted-worker/tenancy/migrations/0002_identity_link.sql: identity_link per design §4.3 (door CHECK for the closed vocabulary; UNIQUE (door, provider_sub) spanning history — one account per door-identity, ever; history rows retained via unlinked_at) + append-only identity_link_event audit table (the sketch DDL has no unlink-actor column; §§4.3/4.8 require every link/unlink audited with actor + timestamp — the deviation is stated in the migration header, per the baseline's precedent). schema_version 1 → 2.
pkgs/id/hosted-worker/src/identity-link.ts: link ceremony (authenticated session on the account + new-door proof; actor must be the account's active binding; links target only the session's own account), last-door guard with same-operation replacement (replacement links first; a refused replacement aborts untouched), door-identity-ever refusal across accounts, re-link reactivates the retained row, resolveAccountIdByDoor for the H1 front door. Refusals are returned reason codes, never thrown, never partially applied.
✅ DB-continuity proof: the test snapshots account/binding/tenant_db/role_grant/credential across a relink and asserts identical rows; the module writes no tenant rows.
Verification: targeted suites 17/17; full hosted-worker suite 186/186; tsc --noEmit clean. Tests ran on the laptop in the worktree (named fallback: the Actions exec runner cannot check out this repo/branch; repo CI runs on main only).
Dependency note: H1 (PR #14323) is still open; this PR has no code dependency on it (the table shape is the design's) and lands behind no traffic per §6 rollout. Task 23353 is parked pr-bound on PR #14418: when it merges, the wake runs verify-disposition and completes 23353 as merged_verified; this issue closes from this record.
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workepic/pm-stackReprioritization program epic (2026-11-12)priority/normalOrdinary priority (the default)
Activity
developing-today commentedon Nov 24, 2026
CODE-5258
dezren39 commentedon Nov 24, 2026
Triage verdict (task 23357, lane code-h, 2026-11-24): still open — remainder already routed and live.
Fresh state: #14260 OPEN, no hold labels, no merged or open PR. Design PR #14089 merged; parent #9086 OPEN. Dependency H1 (#14259) still OPEN (its triage 22916 is blocked).
No new packet filed: the implementation remainder is already owned by live feature_slice task 23353 (
H2 of #14260, claimed by oc-code-05, lane any-occodejlldbejkoaghibjibcppglfbdajkgfoj). Enqueueing again would collide on the same work identity. This triage closes with that task as the recorded follow-up.developing-today-fleet commentedon Nov 24, 2026
H2 implemented — PR #14418 (queue task 23353)
Landed as PR #14418 (open, unmerged — the merge is Archer's; this lane does not merge):
pkgs/id/hosted-worker/tenancy/migrations/0002_identity_link.sql:identity_linkper design §4.3 (door CHECK for the closed vocabulary;UNIQUE (door, provider_sub)spanning history — one account per door-identity, ever; history rows retained viaunlinked_at) + append-onlyidentity_link_eventaudit table (the sketch DDL has no unlink-actor column; §§4.3/4.8 require every link/unlink audited with actor + timestamp — the deviation is stated in the migration header, per the baseline's precedent).schema_version1 → 2.pkgs/id/hosted-worker/src/identity-link.ts: link ceremony (authenticated session on the account + new-door proof; actor must be the account's active binding; links target only the session's own account), last-door guard with same-operation replacement (replacement links first; a refused replacement aborts untouched), door-identity-ever refusal across accounts, re-link reactivates the retained row,resolveAccountIdByDoorfor the H1 front door. Refusals are returned reason codes, never thrown, never partially applied.Acceptance:
test/identity-link.test.ts(9 tests).account/binding/tenant_db/role_grant/credentialacross a relink and asserts identical rows; the module writes no tenant rows.Verification: targeted suites 17/17; full hosted-worker suite 186/186;
tsc --noEmitclean. Tests ran on the laptop in the worktree (named fallback: the Actions exec runner cannot check out this repo/branch; repo CI runs on main only).Dependency note: H1 (PR #14323) is still open; this PR has no code dependency on it (the table shape is the design's) and lands behind no traffic per §6 rollout. Task 23353 is parked pr-bound on PR #14418: when it merges, the wake runs
verify-dispositionand completes 23353 asmerged_verified; this issue closes from this record.