# Acceptance 0005: record association, guest requester R2, cascade release (plan 0036) Proves an agent that cannot do OAuth can still be a market requester the owner vouches for: alice's VM starts a second requester R2 (own did:plc + PDS in the VM, DID doc `https://ident.link/agent-of/`), R2 writes `market.associationRequest/` {principal, contract, nonce} in its repo, alice checks it and writes the contract-scoped grant `market.association/` then `link.ident.endorsement/`, bidders allow R2's RFP via the walk R2 -> alice, R2 rents a nested VM, and releasing alice's contract cascades: R2 releases first, every token in the chain is revoked, alice deletes the endorsement then the grant, R2's DID is tombstoned. - Design: [../design/ident-link-associations.md](../design/ident-link-associations.md) - Plan [0036](../plans/0036-record-association.yaml) item V1 (A4-A8) - Last pass: 2026-11-13 01:38-02:17Z, kcp 038bd32e (v0.0.0-rc165-pre1, release 24a8b530, rollout 20), alice by QR (consent: qr.fedfork.com for @aliceoa.bsky.social), no bidders list, parts A and B and step 5. A (`cli-v1-1794533915`, winner hat-8): outer Held 01:39:46Z; `run request r2 --r2-name r2-v1 --agent --hold` 01:39:47Z; R2 reported 01:40:23.0Z, `requester_association_written` 01:40:23.9Z, R2's ref arrived 01:40:25.7Z, its RFP 01:40:29Z, its `--agent` contract Held on the nested VM (hat-8) 01:41:05Z, `agentStart` out; chain alice -> R2 -> nested R3 -> nested agent, walk roots [alice] at depth 1/2/3, rotationKeys shared down the chain; the owner node's `atirc mesh peers` lists the nested agent. Outer-only release 01:46:26Z: exit 0 in 72 s, `requester_guest_requester_released` 46.5 s after the r2Release, `requester_guest_dids_tombstoned by=the guest`, `r2Release: Released`, `atircRevokes: Done`, grant + endorsement RecordNotFound x3, R2, R3 and the agent `plc_tombstone`, 9/9 URIs RecordNotFound x3 (0 `market.event` left), hosts empty. (The renter CLI was stopped by a harness kill while Held at 01:40:42Z; the release ran from the stopped state.) B (`cli-v1-1794535699`, winner hat-8): R2 with `R2_COLOCATED=mesh1` (R2 handle `aliceoa-.aliceoa.bsky.social`): association 02:10:05Z, `colocated-mesh1-{grant,endorsement,peer}` and `peer` written, `svc-pds-pds-iroh` dumbpipe listening, crawl ok (one `participant_request_crawl_unresolved` retry first); R2 and mesh1 peer records `iroh`, no `lease`; R2's grant of mesh1 (same contract + expiresAt as R2's) and endorsement; mesh1 `alsoKnownAs` [at://mesh1., agent-of/R2], rotationKeys as R2's; walk exit 0, roots [alice], ancestors R2 (1), alice (2); release: exit 0 in 28 s, `r2Released` 22 s, both `plc_tombstone`, 8/8 URIs RecordNotFound x3, 0 ERROR. Step 5 (`cli-v1-1794535982`, outer on hat-8): `kb delete` of the outer ComputeVM 02:15:36Z -> mesh1's walk exit 1 within 1 s (errors: R2's repo unreachable, HTTP 500: its PDS ran in the deleted VM); the renter `requester_tombstoned` R2 and mesh1 `by=the renter rotation key` 02:15:38Z (both `plc_tombstone`), `requester_contract_records_deleted` 02:15:38.6Z (7/7 RecordNotFound x3), Released "the bidder ended the contract: deleted_on_request"; R2's nested VM stayed Running with `spec.associationExpiresAt` = the chain's expiresAt (the bidder backstop), removed with [0007](0007-bidder-termination.md). Not run: the `association.maxDepth: 1` policy denial (no prod bidder runs that policy), atirc-dev `revocations.ndjson` (no ssh to irc.fedfork.com; no r2 token is minted any more) - Previous pass: 2026-11-11 16:22-16:46Z, kcp f482083c (release 4656466c, rollout 14), alice by QR, no bidders list (winner hat-8 for every VM), no workaround. A (`cli-v1-1794414131`): outer Held 16:23:52Z; `run request r2 --r2-name r2-v1 --agent --hold` 16:24:09Z; R2 reported 16:24:39Z, `requester_association_written` 16:24:40Z, R2 Ready 16:24:46Z, its `--agent` contract Held on the nested VM 16:25:52Z (no handle refusal); chain alice -> R2 -> nested R3 (identity-only) -> nested agent, roots [alice]; the owner node lists the nested agent. Outer-only release: R2 released first (`requester_guest_requester_released` ok after 5m24s: the nested identity-only R3 never answered its r2Release, see pitfalls), `requester_guest_dids_tombstoned by=the guest`, records 14/14, grant + endorsement RecordNotFound x3, R2, R3 and the agent `plc_tombstone`, hosts empty. B (`cli-v1-1794415120`): R2 with `R2_COLOCATED=mesh1` Held 16:42:08Z; iroh dumbpipe listening, crawl, R2 and mesh1 peer records (`iroh`, no `lease`), R2's grant + endorsement of mesh1, mesh1 `alsoKnownAs` [at://mesh1., agent-of/R2], walk roots [alice]; release: `r2Released` in 24 s, records 12/12, both DIDs `plc_tombstone`. Step 5 (out-of-band loss) not re-run. Before: 2026-11-11 13:32-13:38Z, kcp e496cbff, **FAIL** (ref never mirrored, R2's agent check wanted a resolving handle; fixed in 982ba545, e9f1de4a) - Earlier pass: part A rc128 cascade 2026-10-30 20:34Z (atirc-dev confirmed server-side); part B 2026-11-10 (see its end). Both predate the ident.link cut-over (old-shape association, mirror, peer `lease`): not yet re-run on the records below ```mermaid flowchart LR alice[alice requester
CLI or page] -- RFP / accept --> b1[bidder] b1 --> vm1[alice VM
guest agent] vm1 -- guest.requesterDid --> alice alice -- grant + endorsement, rkey R2 DID
contract-scoped, expiresAt --> repoA[(alice repo)] r2 -- associationRequest/alice DID
principal, contract, nonce --> repoR2[(R2 repo)] vm1 --> r2[R2 requester
own did:plc + PDS] r2 -- RFP allowed via association --> b2[bidder] b2 --> vm2[R2 nested VM] alice -- mint r2-RKEY.alice --> atirc((atirc)) r2 -- mint vm-RKEY.r2-RKEY.alice --> atirc ``` ## Preconditions | Item | Need | | --- | --- | | Accounts | alice (authority) signed in by QR; R2 is created inside the VM, nothing to prepare | | Vouches | bob + john vouch alice; alice vouches bob + john (R2 inherits trust only through the association) | | Versions | **all** bidders on the same main (>= kcp 8601013d): a bidder that ignores `guestTools` can win and the guest has no `socialweb-computer`; the guest runs the winner's binary, so part B needs it on every bidder | | Requester host | `dumbpipe` on PATH: an iroh-only bidder (hat-9: offering `endpoints` [iroh, webrtc]) is reached over iroh first | | Owner | part A as alice (QR); part B ran as bob (pdsAccount, `--atproto-pds-url https://bsky.social`); any requester whose bidders allow it works | | Scopes | requester `guest.secretsUpdated` c/u, `market.association` and `market.associationRequest` c/u/d, optional `repo:link.ident.endorsement?action=create&action=delete` (without it `requester_endorsement_skipped`, R2 stays unassociated); bidder `guest.requesterDid` c (re-sign-in after these were added) | | atirc | child mint below the r2 token (any depth), lease server | | Watchers | host watchers (both VMs may land on different hosts), atirc-dev for revocations | ## Steps ```bash SWC=socialweb-computer; R=~/.tmp/acc36; mkdir -p "$R"; chmod 700 "$R" NAME=cli-v1-$(date +%s) # 1. outer VM: agent + socialweb-computer in the guest + guest association slot $SWC run request --state-dir "$R" --name "$NAME" --hold --guest-tools socialweb-computer \ --associate guest --agent --atproto-oauth-qr > "$R/$NAME-request.log" 2>&1 & # sign alice in (pendingAction url), wait Held + requester_atirc_minted # 2. zero-command R2: guest.r2Start -> socialweb-r2.service in the guest $SWC run request r2 "$NAME" --state-dir "$R" --r2-name r2-v1 --agent --hold # 3. optional: VM agent for the outer VM $SWC run request agent "$NAME" --state-dir "$R" # 4. wait: R2 Held on its nested VM, grandchild nick vm-.r2-.aliceoa joins # 5. release ONLY the outer contract: cascade must release R2 first $SWC run request release "$NAME" --state-dir "$R" ``` Page: Request VM with Associate DID / R2 box (`guestTools`, `fromGuest`, `secretsRef`), then **Start R2**. Manual fallback in the guest (debug only): `socialweb-computer run request --guest-requester ...` as the agent user (never root). ## Expected observations Outer requester (alice) log: | msg | meaning | | --- | --- | | `requester_guest_requester_reported` / `requester_guest_requester` | R2 DID arrived via `guest.requesterDid` | | `requester_association_request_entry` | bundle entry `/etc/socialweb-computer/association-request.json` {principal, contract, nonce, rotationKey} | | `at:///com.publicdomainrelay.temp.market.associationRequest/` verified | principal == alice, contract == the accept, nonce (constant time) | | `requester_association_written subject=` | grant `at:///com.publicdomainrelay.temp.market.association/` {agent, contract, expiresAt, createdAt}, then `link.ident.endorsement/` {agent}; its strongRef in the refFile (R2's `--association-ref`) | | `requester_atirc_minted` subhandle `r2-.aliceoa.bsky.social` | child token into `/etc/socialweb-computer/r2-atirc.env` | | `requester_secrets_updated_sent` | `guest.secretsUpdated` delivered | | `requester_guest_requester_release` ... `r2Released` | cascade on outer release | | `requester_atirc_revoked` x2 (r2 + VM agent), `release_revoke left=0` | grandchild covered by suffix | | `requester_association_deleted rkey=` | endorsement, then grant deleted | Guest / R2: `socialweb-r2.service: active` (started by `guest.r2Start`), `association ref arrived`, identity Ready, R2 RFP, Held, in-guest `socialweb-r2-release ok`, `local_account_retired did= plc=tombstoned`. Check the pair + grant while R2 is Held (read only): ```bash ALICE=did:plc:lpfuqerea3deuoyrn7ojser4; R2= # `subject` of requester_association_written pds() { curl -s "https://plc.directory/$1" | jq -r '.service[] | select(.id=="#atproto_pds") | .serviceEndpoint'; } rec() { curl -s "$(pds "$1")/xrpc/com.atproto.repo.getRecord?repo=$1&collection=$2&rkey=$3" | jq -c '.value // .error'; } rec "$ALICE" com.publicdomainrelay.temp.market.association "$R2" # {agent, contract, expiresAt, createdAt} rec "$ALICE" link.ident.endorsement "$R2" # {agent} rec "$R2" com.publicdomainrelay.temp.market.associationRequest "$ALICE" # {principal, contract, nonce, createdAt} curl -s "https://plc.directory/$R2" | jq -c .alsoKnownAs # at://, https://ident.link/agent-of/$ALICE curl -s "https://plc.directory/$R2/data" | jq -c .rotationKeys # [renter key, VM localPDS key]; an OAuth renter: [VM localPDS key] socialweb-computer internal association "$R2" | jq -c '{roots, expiresAt, errors}' # roots [ALICE] # the renter's core log: $R/requests/$NAME/dev/$NAME/logs/core.log while it runs, $R/requests/$NAME/logs/core.log after ``` Timings (V1 rc125): R2 DID reported 17:15:48 -> Verified 17:15:52 -> hat-7 bid on R2 RFP 17:16:09 -> R2 joined channel 17:16:38. Cascade revoke ~32 s after outer release. ## Part B: co-located accounts, peer records, retire, out-of-band loss 1. Start R2 with a co-located account: as root in the outer guest (`run request ssh "$NAME" --exec -- `) write `/run/socialweb-r2/r2-start.env` (`R2_NAME=r2`, `R2_HOLD=1`, `R2_COLOCATED=mesh1`, root:socialweb-r2 0640), then `systemctl start --no-block socialweb-r2.service`. R2 stays in the foreground while Held. 2. R2's core log: AtprotoRecords `peer`, `colocated-mesh1-grant`, `colocated-mesh1-endorsement`, `colocated-mesh1-peer` written; `ingressproxy_iroh_dumbpipe_listening` exposure `svc-pds-pds-iroh`; `participant_request_crawl` relay `https://relay.mini-cloud-0002.chadig.com` ok true. 3. From any host (helpers above, `M=`): `rec "$R2" computer.socialweb.peer ` (`