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
Follow-on design ticket from #5684 — its decomposition sketch names this as a separate design, and the parent's acceptance requires these tickets to be filed and linked. Filed in the 2026-11-04 gap pass (WS-F) so the design work exists and can be prioritised on its own merits; implementation timing is a separate decision, possibly months out.
What this design must settle
Ownership forms, challenge signing, scope/expiry/revocation, and raw-view provenance for do-as delegation.
Context from the parent
The parent design — Drew-ruled keen and simplicity-first — fixes the key-custody variants, security-code recovery, and pseudo-login delegation for ID identity. The parent issue carries the surrounding decisions this ticket must not re-decide; where this ticket's answer would change a parent decision, record that explicitly rather than silently forking it.
Decision record expected
Close this design with a recorded decision (on this issue or in a doc/ record linked from it): the chosen shape, the alternatives rejected and why, and the invariants implementation must hold. If the design splits further, file the splits and link them here rather than growing this issue.
Relations
Parent: #5684. Programme: epic #2056. Filed by WS-F (2026-11-04 ID design gap & expansion pass).
Agent: queue worker (repo-worker-code), lane code-l
Session / ID: queue task 10291
Found via: atomic queue claim (lane code-l); execution-lane assignment returned opencode, so per runbook §1b this task is handed off to the laptop opencode claimant — not worked directly by this lane.
🤖 Agent note · decision record posted (task 13644, lane code-o, direct)
Decision record — pseudo-login identities & scoped do-as delegation (variant d of #5684)
This record settles the design #5889 was filed to settle. It conforms to parent #5684 (Drew-ruled, keen / simplicity-first) and changes no parent decision; the one place it touches a parent-adjacent mechanism (the one-time login token) is recorded explicitly in §7. Implementation is follow-on work, prioritised separately per the parent — this record is the design, not an implementation.
0. Grounding — primitives that already exist (verified on laptop main1f5ac11)
JoinCapability — pkgs/id/src/world/mod.rs:339: an invite/join proof, held and redeemed to enter a world.
delegate_to_friend — pkgs/id/src/world/core.rs:1651: an existing scoped delegation between participants in a world.
CapabilityBounds / invite_bounds — pkgs/id/src/world_session/types.rs (~L496): expiry (expires_at) and use-count bounds on capabilities.
effective_scopes — pkgs/id/src/world/core.rs:1718: resolves what a participant may effectively do, through delegation.
revoke_tree — pkgs/id/src/world/core.rs:1843: revokes a participant and everything delegated downstream of it.
Signed HTTP request authentication with replay protection (per the task packet's verified evidence): per-request signing already exists as a separate mechanism.
Consequence: do-as delegation is a composition of these primitives, not a new subsystem. Anything below that cannot be expressed as a composition of the above plus one new artefact (the delegation grant, §2) is out of scope for the first implementation.
1. The acted-as identity contract (cross-context)
Every action in the system is attributable to a 4-tuple, and verifiers resolve all four parts:
Acted-as / effective identity — the pseudo-login identity that actually signs the action.
Delegation grant — the signed artefact (§2) authorising (2) to act for (1), identified by grant id.
Context — the world(s) and capability scope in which the action is taken.
Contract rules:
An action is valid iff: the signature verifies against the pseudo-login identity's key; a live grant exists from the principal to that pseudo-login identity covering the context; and the action's scope ⊆ the grant's scope ⊆ the principal's own effective scope in that context (checked with effective_scopes semantics — delegation can only ever narrow, never widen).
Contexts do not leak: a grant minted for one world grants nothing in any other world. Cross-context use means one grant per context, all visible in the same management view (§6).
Friendly UI may render the action as the user's; the raw record always carries the full tuple (§5).
2. The delegation grant — the one new artefact
A grant is a signed statement by the principal's real key (the parent's signed-hash construction applied to delegation: the real key signs the grant, acceptance thereafter comes from verifying that signature, never from anyone's custody of the real key). Fields:
grant_id, principal_id, pseudo_login_id
scope — a set of (world, capabilities) pairs, expressed with existing scope types
bounds — a CapabilityBounds: expires_at (required, see §4) and optional max uses
created_at, nonce
signature by the principal
The grant is stored server-side as a public artefact (it contains no secret material — the pseudo-login's private key is never in it) and is presented or referenced by id at verification time.
3. Ownership forms — decided
Three forms were on the table. They are not equals; each gets a different trust ceiling:
Form
Standing do-as scope?
Revoked by
Ceiling
User-owned (the principal's real key created and can revoke the pseudo-login) — the default and the only recommended form for ongoing use
Yes, via a §2 grant
Principal at any time (§4)
Grant scope
Login-derived / nobody-owned (fresh identity materialised from an authentication event; no key controls it)
No
Session record deletion / session expiry only
One session, shortest expiry, no grant renewal without a fresh authentication event
Service-held pseudo-login (the service's custody variant (a) key acts)
Only as variant (a) already allows
Service + principal, per variant (a) rules
Inherits variant (a)'s honesty statement verbatim: the service can act as the user
Decisions:
User-owned is the canonical form. A pseudo-login is its own real ID (its own keypair), created under the principal's control, one per device / login method.
Login-derived pseudo-logins are session identities, not delegation holders. They answer "what signs in this browser session" and nothing more. The honest statement, for UX copy: nobody holds a key for this login; it ends when the session ends, and it cannot be extended — only replaced by logging in again. They may act only within the scope the authentication event itself carried, and never beyond the session.
A login-derived identity can be adopted: the principal, once authenticated by a stronger route, signs a §2 grant to it, converting it into a user-owned pseudo-login. Adoption is an explicit user-visible act, never automatic.
4. Scope, expiry, revocation
Scope: least-privilege by default. Grant creation pre-fills the narrowest scope that covers the stated purpose (per world, per capability set) and renders it in plain language before the user confirms: "this login can do X in worlds Y until Z" (parent requirement).
Expiry: every grant has one. CapabilityBounds.expires_at is mandatory for grants (unlike invites, no unbounded default); the default is short (days, not months) and renewal is a fresh signed grant, not an edit — grants are immutable, supersession only.
Use bounds: optional uses cap via the same CapabilityBounds, for single-purpose delegations.
Revocation:
The principal revokes a grant (or a whole pseudo-login, i.e. all its grants) at any time from the management view; revocation is a signed statement by the principal (or an authenticated management action under variant (a), which inherits (a)'s honesty).
Revoking a pseudo-login uses revoke_tree semantics: everything delegated downstream of it dies with it.
Propagation: verifiers check grant liveness at verification time against the stored grant set; no verifier may cache liveness beyond a short TTL (minutes). Actions already taken under a then-live grant stand — they are history with provenance (§5), not retroactively invalidated. What revocation changes is the future, instantly at next verification.
Login-derived identities: revocation = deleting the server-side session record; there is no key to kill, and the design says so plainly rather than pretending otherwise.
A compromised pseudo-login never compromises the principal: killing it touches nothing about the real identity, its keys, or its other pseudo-logins (parent flow 5).
5. Challenge signing — three different signings, kept separate
Confusing these three is the main design hazard; they are distinct mechanisms with distinct artefacts:
Delegation challenge signing (this design). To activate a session under a grant, the pseudo-login identity signs a challenge issued by the verifier: sign(pseudo_login_key, grant_id ‖ verifier_nonce ‖ context ‖ timestamp). The nonce is verifier-chosen, single-use, and short-lived (minutes). This proves live possession of the pseudo-login key and binds the session to one specific grant and context. It never involves the principal's key.
Request authentication (existing). Per-request signed HTTP authentication with replay protection authenticates individual requests inside an established session. It is not a delegation proof and must not be treated as one: a valid request signature from a key with no live grant authorises nothing.
Invite proofs (existing). Redeeming a JoinCapability proves an invite was extended. It creates membership; it confers no do-as authority and cannot substitute for a grant.
Rule: authority comes only from the grant; challenge signing proves the session holds the granted key; request signing proves request origin. All three may compose in one flow, none may substitute for another.
6. Raw-view and audit provenance
The raw activity record stores the full §1 tuple: acting pseudo-login ID, principal ID, grant id, and the grant's scope snapshot at action time.
The raw view renders exactly that — "pseudo-login P acted, under delegation grant G from user U, scope S" — even where the friendly UI renders the action as the user's (parent: provenance is visible in the raw view, full stop).
Grant lifecycle events (creation, adoption, supersession, revocation, expiry) are themselves recorded with the same provenance, so the delegation chain is auditable end to end.
The management view (parent flow 5) lists every pseudo-login with: form (§3), plain-language scope, expiry, last-used, and a revoke control — one row per pseudo-login, grants grouped under it.
7. Relation to the parent's one-time login token — recorded, no conflict
Parent comment (2026-11-04, Drew's own mechanism): an already-authenticated surface (CLI or web login) mints a one-time token to carry that authentication into a browser session. Composition with this design, decided here: redeeming that token creates (or attaches to) a login-derived pseudo-login session under §3 — the token transports an authentication that already happened; it does not mint a §2 grant and confers no standing do-as scope. If the browser session later needs standing scope, §3 adoption applies. This narrows nothing the parent decided; it names which §3 form the token lands in.
Conflict check against #5684: no parent decision is changed by this record. Key-custody variants (a)/(b), security-code recovery (c), and the signed-hash construction are inputs, reused as-is. The only cross-references are §3's service-held row (inherits (a)'s honesty statement) and §7 above.
8. Alternatives rejected
Real key signs activity directly, pseudo-login is just a label. Rejected: violates the parent's core rule (the real key never performs the activity) and destroys revocation granularity.
Impersonation flag on an account row ("act as user" bit, no separate identity). Rejected: no cryptographic provenance; the raw view could not distinguish actor from principal; revocation and scope would be policy theatre, exactly what the parent's honesty requirement forbids.
Bearer-token delegation with no signed grant (an opaque token is the authority). Rejected: possession = authority with no chain to audit, no scope binding, and theft is silent and total until expiry. The grant must be a signed, inspectable artefact.
Deterministically deriving the pseudo-login key from the login credential (e.g. from the password). Rejected: couples delegation identity to a low-entropy secret (the parent's own password-derived-key brute-force concern), and rotating the credential would silently rotate or orphan every delegation.
One global pseudo-login for all contexts. Rejected: violates least-privilege and per-device independent revocability (parent: one per device / method).
9. Invariants implementation must hold
The principal's real key signs grants, adoptions, and revocations — and nothing else in day-to-day operation.
No action verifies without a live, in-scope, unexpired grant behind the acting pseudo-login identity.
Delegation only narrows: effective scope of any pseudo-login action ⊆ grant scope ⊆ principal's effective scope, per context.
Grants are immutable, always expiring, and revocable with tree semantics; revocation is effective at next verification.
Raw provenance is never collapsed: actor, principal, grant, and scope snapshot are on every record.
Challenge signing, request authentication, and invite proofs are implemented and verified as three separate checks; no one of them implies another.
Login-derived identities hold no standing scope and cannot be renewed without a fresh authentication event.
Every user-facing scope statement is plain-language and complete (who can act, as whom, where, until when) before the user confirms a grant.
Recorded by queue task 13644 (repo-worker-code, lane code-o, direct lane). Issue #5889 stays open per its packet: this record completes the design decision; implementation splits are follow-on work to be filed/prioritised separately, not silently grown here.
🤖 Agent note · triaged (bulk-intake concurrence) — design decision already recorded by task 13644; issue stays open per its packet for implementation splits
Agent: queue worker (repo-worker-code), lane code-e
🤖 Agent note · triaged — decision record already on this issue (task 13644); no dependency, no new packet
Agent: repo-worker-code
Session / ID: queue task 19926 · lane code-e
Found via: repo-health-code-pilot atomic claim (small_fix packet; triage follow-on of task 18400)
Fresh verification (2026-11-17, this run): issue #5889 OPEN, labels task/small-fix + app/id + epic/id-program, no hard-stop labels, no comments since task 18400's triage note today (2026-11-17T03:04Z).
Verdict (concurring with task 18400): the design this issue was filed to settle is settled — task 13644's full decision record is posted on this issue (2026-11-08, lane code-o), grounded in primitives verified on main, conforming to parent #5684 and changing no parent decision. Unlike a dep-gated item, nothing named blocks this issue: it stays OPEN per its packet for implementation splits, which the parent programme prioritises separately; none are filed yet and this triage files none (per task 18400's verdict). The #5684 gate leg naming this child record is satisfied in substance.
Terminal for this task: task 19926 completes as triaged, naming task 18400's triage of record and task 13644's decision record. No follow-on packet enqueued.
Picked up via the parent triage: queue task 16820 (re-packet triage of parent #5684) named this issue as one of its two remaining gate legs. Fresh checks this pass:
The issue's own acceptance is met. The body asks to "close this design with a recorded decision (on this issue or in a doc/ record linked from it): the chosen shape, the alternatives rejected and why, and the invariants implementation must hold." That record is on this issue: the 2026-11-08 decision record (comment 6728532555, task 13644) — chosen shape (user-owned pseudo-login as the canonical form, holding a signed delegation grant — the one new artefact — composed from existing primitives JoinCapability / delegate_to_friend / CapabilityBounds / effective_scopes / revoke_tree; login-derived identities demoted to session-only with no standing scope; service-held form inherits variant (a)'s honesty statement), the acted-as 4-tuple contract and scope/expiry/revocation rules as the invariants implementation must hold, challenge signing kept distinct from request authentication and invite proofs, raw-view provenance, and §8 alternatives rejected with reasons. The record states it changes no parent design(id): identity, login & delegation — simplicity-first key custody, security-code recovery, and pseudo-login identities #5684 decision, with the one parent-adjacent touch (the one-time login token) recorded explicitly in its §7.
Closing #5889 as completed: the variant (d) design it asked for is decided and recorded. This clears the last child gate of parent #5684; it does not close or decide #5684 itself.
Activity
developing-today commentedon Nov 5, 2026
CODE-1572
developing-today commentedon Nov 5, 2026
🤖 Agent note · handed off / parked
repo-worker-code), lane code-lopencode, so per runbook §1b this task is handed off to the laptop opencode claimant — not worked directly by this lane.dezren39 commentedon Nov 5, 2026
🤖 Agent note · state: handed off
52 remaining items
dezren39 commentedon Nov 8, 2026
🤖 Agent note · state: done
developing-today commentedon Nov 8, 2026
🤖 Agent note · picked up
direct— this lane works it directly. Fresh check: issue id: design: pseudo-login identities & scoped do-as delegation (variant d) (from #5684) #5889 is OPEN, no hard-stop labels.developing-today commentedon Nov 8, 2026
🤖 Agent note · decision record posted (task 13644, lane code-o, direct)
Decision record — pseudo-login identities & scoped do-as delegation (variant d of #5684)
This record settles the design #5889 was filed to settle. It conforms to parent #5684 (Drew-ruled, keen / simplicity-first) and changes no parent decision; the one place it touches a parent-adjacent mechanism (the one-time login token) is recorded explicitly in §7. Implementation is follow-on work, prioritised separately per the parent — this record is the design, not an implementation.
0. Grounding — primitives that already exist (verified on laptop
main1f5ac11)JoinCapability—pkgs/id/src/world/mod.rs:339: an invite/join proof, held and redeemed to enter a world.delegate_to_friend—pkgs/id/src/world/core.rs:1651: an existing scoped delegation between participants in a world.CapabilityBounds/invite_bounds—pkgs/id/src/world_session/types.rs(~L496): expiry (expires_at) and use-count bounds on capabilities.effective_scopes—pkgs/id/src/world/core.rs:1718: resolves what a participant may effectively do, through delegation.revoke_tree—pkgs/id/src/world/core.rs:1843: revokes a participant and everything delegated downstream of it.Consequence: do-as delegation is a composition of these primitives, not a new subsystem. Anything below that cannot be expressed as a composition of the above plus one new artefact (the delegation grant, §2) is out of scope for the first implementation.
1. The acted-as identity contract (cross-context)
Every action in the system is attributable to a 4-tuple, and verifiers resolve all four parts:
Contract rules:
effective_scopessemantics — delegation can only ever narrow, never widen).2. The delegation grant — the one new artefact
A grant is a signed statement by the principal's real key (the parent's signed-hash construction applied to delegation: the real key signs the grant, acceptance thereafter comes from verifying that signature, never from anyone's custody of the real key). Fields:
grant_id,principal_id,pseudo_login_idscope— a set of (world, capabilities) pairs, expressed with existing scope typesbounds— aCapabilityBounds:expires_at(required, see §4) and optional maxusescreated_at,nonceThe grant is stored server-side as a public artefact (it contains no secret material — the pseudo-login's private key is never in it) and is presented or referenced by id at verification time.
3. Ownership forms — decided
Three forms were on the table. They are not equals; each gets a different trust ceiling:
Decisions:
4. Scope, expiry, revocation
CapabilityBounds.expires_atis mandatory for grants (unlike invites, no unbounded default); the default is short (days, not months) and renewal is a fresh signed grant, not an edit — grants are immutable, supersession only.usescap via the sameCapabilityBounds, for single-purpose delegations.revoke_treesemantics: everything delegated downstream of it dies with it.5. Challenge signing — three different signings, kept separate
Confusing these three is the main design hazard; they are distinct mechanisms with distinct artefacts:
sign(pseudo_login_key, grant_id ‖ verifier_nonce ‖ context ‖ timestamp). The nonce is verifier-chosen, single-use, and short-lived (minutes). This proves live possession of the pseudo-login key and binds the session to one specific grant and context. It never involves the principal's key.JoinCapabilityproves an invite was extended. It creates membership; it confers no do-as authority and cannot substitute for a grant.Rule: authority comes only from the grant; challenge signing proves the session holds the granted key; request signing proves request origin. All three may compose in one flow, none may substitute for another.
6. Raw-view and audit provenance
7. Relation to the parent's one-time login token — recorded, no conflict
Parent comment (2026-11-04, Drew's own mechanism): an already-authenticated surface (CLI or web login) mints a one-time token to carry that authentication into a browser session. Composition with this design, decided here: redeeming that token creates (or attaches to) a login-derived pseudo-login session under §3 — the token transports an authentication that already happened; it does not mint a §2 grant and confers no standing do-as scope. If the browser session later needs standing scope, §3 adoption applies. This narrows nothing the parent decided; it names which §3 form the token lands in.
Conflict check against #5684: no parent decision is changed by this record. Key-custody variants (a)/(b), security-code recovery (c), and the signed-hash construction are inputs, reused as-is. The only cross-references are §3's service-held row (inherits (a)'s honesty statement) and §7 above.
8. Alternatives rejected
9. Invariants implementation must hold
Recorded by queue task 13644 (repo-worker-code, lane code-o, direct lane). Issue #5889 stays open per its packet: this record completes the design decision; implementation splits are follow-on work to be filed/prioritised separately, not silently grown here.
dezren39 commentedon Nov 17, 2026
🤖 Agent note · triaged (bulk-intake concurrence) — design decision already recorded by task 13644; issue stays open per its packet for implementation splits
JoinCapability,delegate_to_friend,CapabilityBounds,effective_scopes,revoke_tree), conforming to parent design(id): identity, login & delegation — simplicity-first key custody, security-code recovery, and pseudo-login identities #5684 and changing no parent decision. The record's own closing line governs this issue's state: it stays open per its packet; implementation splits are follow-on work to be filed/prioritised separately.dezren39 commentedon Nov 17, 2026
🤖 Agent note · triaged — decision record already on this issue (task 13644); no dependency, no new packet
code-eFresh verification (2026-11-17, this run): issue #5889 OPEN, labels task/small-fix + app/id + epic/id-program, no hard-stop labels, no comments since task 18400's triage note today (2026-11-17T03:04Z).
Verdict (concurring with task 18400): the design this issue was filed to settle is settled — task 13644's full decision record is posted on this issue (2026-11-08, lane code-o), grounded in primitives verified on main, conforming to parent #5684 and changing no parent decision. Unlike a dep-gated item, nothing named blocks this issue: it stays OPEN per its packet for implementation splits, which the parent programme prioritises separately; none are filed yet and this triage files none (per task 18400's verdict). The #5684 gate leg naming this child record is satisfied in substance.
Terminal for this task: task 19926 completes as
triaged, naming task 18400's triage of record and task 13644's decision record. No follow-on packet enqueued.dezren39 commentedon Nov 23, 2026
Done check + close — Lane EC (archer), 2026-11-22
Picked up via the parent triage: queue task 16820 (re-packet triage of parent #5684) named this issue as one of its two remaining gate legs. Fresh checks this pass:
doc/record linked from it): the chosen shape, the alternatives rejected and why, and the invariants implementation must hold." That record is on this issue: the 2026-11-08 decision record (comment 6728532555, task 13644) — chosen shape (user-owned pseudo-login as the canonical form, holding a signed delegation grant — the one new artefact — composed from existing primitivesJoinCapability/delegate_to_friend/CapabilityBounds/effective_scopes/revoke_tree; login-derived identities demoted to session-only with no standing scope; service-held form inherits variant (a)'s honesty statement), the acted-as 4-tuple contract and scope/expiry/revocation rules as the invariants implementation must hold, challenge signing kept distinct from request authentication and invite proofs, raw-view provenance, and §8 alternatives rejected with reasons. The record states it changes no parent design(id): identity, login & delegation — simplicity-first key custody, security-code recovery, and pseudo-login identities #5684 decision, with the one parent-adjacent touch (the one-time login token) recorded explicitly in its §7.Closing #5889 as completed: the variant (d) design it asked for is decided and recorded. This clears the last child gate of parent #5684; it does not close or decide #5684 itself.