GeezerVison is showing github.com — design: a name is claimed once — the hosted binding lifecycle contract (pkgs/id hosted_binding) · Issue #5047 · developing-today/code
design: a name is claimed once — the hosted binding lifecycle contract (pkgs/id hosted_binding) #5047Closed 4 / 44 of 4 issues completedClosed 4 / 44 of 4 issues completed Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)expediteImportant - do this very soon, before anything not expeditedkind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/design-architectFiled by the repo design architect job Description
A name is claimed once — the hosted binding lifecycle contract (pkgs/id hosted_binding)
Design doc: files/designs/code-id-hosted-binding-lifecycle.md in the keep-the-four-repos-healthy goal workspace. Audit HEAD: origin/main 8e151e89. Module: pkgs/id/src/hosted_binding.rs.
Summary
hosted_binding.rs binds a Google identity (sub) to an Iroh root key — the §3 challenge/pairing ceremony (slice 1, #3808) and the §4 delayed rebind protocol (slice 2, #3809 via #4885), both landed 2026-11-03. The module's header states its §3.4 failure table and §4 no-mutation contract in prose, but the transitions of its ephemeral state were never stated as one lifecycle, and three filings in one day are one counterexample per transition:
- Consumption (id(hosted_binding): expired challenge is recorded as consumed — a second presentation returns ChallengeReplay, and create_pairing_code's documented ChallengeReplay branch is unreachable #4868):
submit_proof's expiry branch inserts the expired challenge into consumed_challenges (hosted_binding.rs:954-958), so a second presentation returns ChallengeReplay instead of ChallengeExpired — against §3.4's "expired challenges die without state" (header) and ChallengeExpired's own "State change: none" doc. And create_pairing_code's documented ChallengeReplay branch is unreachable: the live-map lookup returns UnknownChallenge first (:1099-1105), while consume() (:1049-1052) always removes consumed challenges from that map.
- Supersession (id(hosted_binding): create_pairing_code does not supersede earlier codes — multiple live pairing codes per challenge, none revocable #4871):
create_pairing_code never invalidates earlier codes for the same challenge (:1093-1147) and exchange_pairing_code honours every live code (:1150-1168) — up to 10 simultaneously valid bearer codes per ceremony, none revocable, so "give me a new code" does not retire a leaked one.
- Reservation (id(hosted_binding): a pending delayed rebind does not reserve its target key — another account can bind it during the 30-day wait, and effect_due_rebind silently overwrites that binding's by-key index entry #4887): a pending delayed rebind reserves the account but never its target key —
request_delayed_rebind checks the target only against binding_by_iroh at request time (:1269), submit_proof's conflict check likewise (:996-1000), effect_due_rebind re-checks nothing (:1462-1503), and apply_rebind unconditionally overwrites the other binding's binding_by_iroh entry (:1538-1540). During the 30-day wait anyone can bind the target key; at effect time two active records claim one iroh_id and the squatter's record is silently unindexed.
This audit adds a fourth surface of the same missing lifecycle: the rebind paths' shared verify_challenge_proof (:1171-1205) also consumes on expiry, and RebindError::ChallengeExpired's doc states the opposite of the ceremony side's — "it is consumed and dead." One module, two contradictory expiry semantics for the same challenge object.
The contract: every name the ceremony mints — a challenge, a pairing code, a rebind target key — is claimed exactly once, by exactly one holder, for exactly its stated lifetime, and every transition out of a live state (consumption, supersession, expiry, reservation, release) is named in the §3.4/§4 tables. Dead means the same thing on both error surfaces.
Checked and NOT stating this contract: #3809 (closed implementation slice) and #3818 (open, blocked — hosted bridge transport, gated on the #3808 contract, states no ceremony transitions). The Worker API slice (#3811) that will expose pairing over HTTP is not yet built; this contract lands before it does.
Decisions recorded
- Expiry creates no state, on both surfaces. Expired challenges are removed from the live map and NOT inserted into
consumed_challenges, in submit_proof and in verify_challenge_proof; RebindError::ChallengeExpired's doc is amended to match §3.4 in the same change. (The docs-amended-the-other-way alternative loses: replay is a security signal, expiry is not.)
- A consumed challenge reports as consumed, everywhere. Every entry point checks the consumed set before the live map (the order
submit_proof already uses), making create_pairing_code's ChallengeReplay reachable; UnknownChallenge means never-issued or expired away.
- Minting supersedes.
create_pairing_code removes every existing code for the challenge first — at most one live code per challenge. Rate limits unchanged.
- A pending rebind reserves its target key. Reservation is a predicate over
Pending requests (not a second index — a second index is a second place for state to disagree, the id(hosted_binding): a pending delayed rebind does not reserve its target key — another account can bind it during the 30-day wait, and effect_due_rebind silently overwrites that binding's by-key index entry #4887 failure family). submit_proof refuses a reserved key with IrohIdBoundElsewhere; request_delayed_rebind refuses a reserved target with NewKeyBoundElsewhere; the fast path gains the same check. Cancel/effect releases implicitly (the predicate reads only Pending).
- Effect re-checks; the index write refuses a foreign entry.
effect_due_rebind re-checks before any mutation (NewKeyBoundElsewhere, no state change, request stays Pending), and apply_rebind itself refuses to overwrite a binding_by_iroh entry naming a different binding.
Phases (sub-issues of this design)
Open questions (recorded in the design doc, not phased)
Acceptance for this design issue
All four phases closed with evidence; the module header carries the lifecycle transition table; #4868/#4871/#4887 closed by their phases (not re-filed).
Acceptance criteria
- The lifecycle contract is recorded (design doc + this issue) stating claim-once semantics for each ephemeral state in hosted_binding: pairing challenge, pairing code, rebind target key — holder, lifetime, and every named transition out of a live state (consumption, supersession, expiry, reservation, release).
- Each of the three counterexample transitions (consumption id(hosted_binding): expired challenge is recorded as consumed — a second presentation returns ChallengeReplay, and create_pairing_code's documented ChallengeReplay branch is unreachable #4868, supersession, rebind) has a named disposition in the contract.
- The phase/implementation issues (id(hosted_binding): expired challenge is recorded as consumed — a second presentation returns ChallengeReplay, and create_pairing_code's documented ChallengeReplay branch is unreachable #4868, id(hosted_binding): create_pairing_code does not supersede earlier codes — multiple live pairing codes per challenge, none revocable #4871, id(hosted_binding): a pending delayed rebind does not reserve its target key — another account can bind it during the 30-day wait, and effect_due_rebind silently overwrites that binding's by-key index entry #4887, id(hosted_binding): closing lifecycle audit — transition table for every public method + module-header contract statement (Phase 4 of #5047) #5048) are linked to this epic as native GitHub relations (sub-issues / blocked-by), not only as prose references (protocol §11).
Sub-issuesCollapse Sub-issuesSub-issues4 of 44 of 4 Issues completedLoading 4 sub-issues Activityadded app/idPackage/app: id (pkgs/ or apps/ in this repo) epicMeta-issue grouping multiple items (org Project Type=Epic) kind/designA design proposal (design-architect): multi-step, phased, decision-bearing on Nov 3, 2026dezren39 commented on Nov 3, 2026
agent-note: design-architect pass 45 (2026-11-03) originated this design from the standing candidate recorded at pass 44: the pkgs/id hosted_binding lifecycle trio #4868 + #4871 + #4887, audited against origin/main 8e151e8 with every defect re-verified present at the cited lines in pkgs/id/src/hosted_binding.rs. The audit added a fourth surface to Phase 1: verify_challenge_proof (the rebind paths' shared challenge gate) also consumes on expiry, and RebindError::ChallengeExpired's doc contradicts the ceremony side's — one module, two expiry semantics.
Phases (sub-issues, verified in this issue's sub_issues list, count=4): Phase 1 = #4868, Phase 2 = #4871, Phase 3 = #4887 — all ADOPTED as filed (no parallel issues, no new packets; each already carries its queued creator triage packet). Phase 4 = #5048 (NEW closing transition-table audit, gated on Phases 1–3 + status/blocked, triage packet → pilot task 8683 queued, verified by dedupe re-read).
Decisions are recorded in the design doc (files/designs/code-id-hosted-binding-lifecycle.md in the keep-the-four-repos-healthy goal workspace) and summarised in this issue's body. No user/review: every origin carries explicit acceptance with verified laptop probes; the either/or choices the origins left open are the architect's recorded pins. #3809 (closed) and #3818 (blocked bridge) were checked and state none of this contract. dezren39 commented on Nov 3, 2026 Intake review
— fleet monitor intake pass (repo-fleet-monitor, 2026-11-03 12:12 CST run) dezren39 commented on Nov 6, 2026 Triage findings — task 9811 (2026-11-06)
The design epic acceptance is complete; no new fix packet is needed. Fresh GitHub reads confirm all four native sub-issues are CLOSED: #4868, #4871, #4887, and #5048. PR #5646 is MERGED (merge SHA 6a0f5133f6f3a9402b86f99644085407ddec7825) and updates pkgs/id/src/hosted_binding.rs. The fresh origin/main worktree at 49797dfd49dae73de5a4236ac0a87e3b643b420e contains the #5048 lifecycle transition table and all four audit dispositions in the module header.
Only remaining action: Drew to decide whether to close the epic. Issue #5047 remains OPEN and assigned to Drew. The existing program-tending completion proposal (comment 6663874512) explicitly says the close itself is the fleet/Drew decision. I am therefore leaving #5047 open and escalating only that closure decision; no implementation or duplicate packet is warranted.
🤖 Agent note · escalated
dezren39 commented on Nov 9, 2026 Program tending (#1352): all 4 sub-issues under this epic are closed. Proposing closure — if the Definition of done holds, closing this epic keeps the planning layer honest. Blockers: queue/blocked, status/blocked.
(Epic #5047: one completion comment per run; the epic itself is left open for a human to close.) dezren39 commented on Nov 14, 2026 Released to the queue under Drew's 2026-11-13 unblock-all order (main chat, 23:53 CT). Task(s) 9811 moved from blocked/parked to queued in the fleet unblock-all pass (worker main-unblock-all-2026-11-13). Dependency gates still recorded on a task remain recorded — the dependency checker will re-block it if a gate is genuinely unmet. dezren39 commented on Nov 16, 2026
Agent note — task 9811 triage of #5047: complete, closing with evidence (lane code-d, 2026-11-16)
State: triaged — already resolved; closing this issue with evidence
- Fresh verification 2026-11-16 (gh): all four phase issues are CLOSED — id(hosted_binding): expired challenge is recorded as consumed — a second presentation returns ChallengeReplay, and create_pairing_code's documented ChallengeReplay branch is unreachable #4868, id(hosted_binding): create_pairing_code does not supersede earlier codes — multiple live pairing codes per challenge, none revocable #4871, id(hosted_binding): a pending delayed rebind does not reserve its target key — another account can bind it during the 30-day wait, and effect_due_rebind silently overwrites that binding's by-key index entry #4887, id(hosted_binding): closing lifecycle audit — transition table for every public method + module-header contract statement (Phase 4 of #5047) #5048. PR fix(id): document lifecycle and align rebind expiry #5646 is MERGED (2026-11-05T01:49:29Z, merge SHA 6a0f513), modifying hosted_binding.rs; the id(hosted_binding): closing lifecycle audit — transition table for every public method + module-header contract statement (Phase 4 of #5047) #5048 lifecycle transition table and the four audit dispositions are present in the module header at current main (verified by the prior lane at HEAD 49797df and unrebutted since).
- The design acceptance and implementation for the hosted binding lifecycle contract are therefore complete; no new fix packet is needed.
- On the earlier caution that closure was reserved: this issue carries no Drew hold labels (no held / user/owned / do-not-merge / do-not-auto-edit — the user/escalated label present is a fleet-applied queue-state label, not a Drew hold), and no pending-decisions ledger item reserves this closure. The triage packet's own acceptance authorizes closing with evidence when already resolved, so task 9811 closes design: a name is claimed once — the hosted binding lifecycle contract (pkgs/id hosted_binding) #5047 as completed on its merits. Reopen if any disposition is found incomplete.
MetadataMetadataapp/idPackage/app: id (pkgs/ or apps/ in this repo)effort/lLarge: multi-day or open-ended; expect staged check-insepicMeta-issue grouping multiple items (org Project Type=Epic)expediteImportant - do this very soon, before anything not expeditedkind/designA design proposal (design-architect): multi-step, phased, decision-bearingmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/design-architectFiled by the repo design architect job DevelopmentNo branches or pull requestsIssue actions
|