- one line each, grouped by namespace; the lexicon file is `lexicons/<nsid with / for .>.json` unless the line says "no file"
- namespaces: market and relay `com.publicdomainrelay.temp.*`; runtime and host contracts `com.fedfork.exec.*`; deployments, ingress and peers `computer.socialweb.*`; releases `software.release.*`; associations `link.ident.*`; signatures `network.attested.*`
- every NSID that has a lexicon file is listed from the lexicons themselves: its type and the first sentence of its
description, grouped by namespace, with the docs pages that name it. On the site the list is generated in place:
https://socialweb.computer/docs/protocol/glossary.html (each NSID's own page: https://socialweb.computer/docs/lexicons/)
- below that list, by hand: the NSIDs we use that have no lexicon file here, and the ones other projects own
- namespaces: market and relay `com.publicdomainrelay.temp.*`; runtime and host contracts `com.fedfork.exec.*`;
deployments, ingress and peers `computer.socialweb.*`; releases `software.release.*`; associations `link.ident.*`;
signatures `network.attested.*`
- names in other docs drop `com.publicdomainrelay.temp.` (`market.rfp`)
## com.publicdomainrelay.temp.market
## From the lexicons
| NSID | type | one line | doc |
|---|---|---|---|
| `market.rfp` | record | signed request for proposals: `payload` -> `compute.vm`, `policies[]`, `submitBid`, `ingress[]` | [flow.md](flow.md#s3-policy-vm-rfp) |
| `market.bid` | record | signed bid on an RFP: `rfp`, `payload` -> `bids.*`, `config` -> `compute.config.wif.simple`; rkey `BidRKey` | [flow.md](flow.md#s4-bid) |
| `market.bids.free` | record | bid terms at no cost `{reason, cost: 0}` | [market.md](market.md) |
| `market.bids.x402` | record | bid terms paid over x402 `{cost, currency, frequency, prepay, url}`; defined, not written | [lexicons-market.md](lexicons-market.md#marketbidsx402) |
| `market.accept` | record | signed accept of one bid: `rfp`, `bid`, `submitEvent`, `ingress[]` | [flow.md](flow.md#s5-accept) |
| `market.accepts.free`, `market.accepts.x402` | record | accept terms; defined, not written | [lexicons-market.md](lexicons-market.md) |
| `market.receipt` | record | the bidder's signed receipt; `cid` binds it to the accept; `payload` -> the `compute.vm` | [flow.md](flow.md#s6-receipt) |
| `market.receipts.free`, `market.receipts.x402` | record | receipt terms; defined, not written | [lexicons-market.md](lexicons-market.md) |
| `market.event` | record | signed event envelope under a receipt: `receipt`, `payload` -> a `compute.events.*` record | [guest-events.md](guest-events.md) |
| `market.offering` | record (`self`) | what a bidder bids on and where it takes calls: `appliesTo`, `endpoints[]`, `maxCpus`, `maxMem`, `nestedVirt`, `images` | [market.md](market.md#discovery) |
| `market.heartbeat` | record (`self`) | a bidder's liveness beat, fresh for 300 s; `version` of the running binary | [market.md](market.md#discovery) |
| `market.relays` | record (`self`) | relays a participant crawls; read in discovery, no Go writer | [market.md](market.md#discovery) |
| `market.association` | record | the grant: the repo trusts `agent` (rkey = the agent DID); `contract` and `expiresAt` scope it | [identity.md](identity.md#associations-identlink) |
| `market.associationRequest` | record | a guest requester asks the principal to grant it for one contract (rkey = the principal DID, `nonce`) | [identity.md](identity.md#guest-requester-r2) |
| `market.submitEvent` | procedure | either party -> the other: a `market.event` it wrote | [market.md](market.md#xrpc-procedures) |
| `market.policies.denoWorker` | record (no file) | a policy record type the engine denies | [policy.md](policy.md) |
## com.publicdomainrelay.temp.compute
[glossary: generated from lexicons/](https://socialweb.computer/docs/protocol/glossary.html)
| NSID | type | one line | doc |
|---|---|---|---|
| `compute.vm` | record | the VM asked for: `role`, `kind`, `cpus`, `mem`, `disk`, `nestedVirt`, `image`, `user_data`, `net`, `expiresAt` | [flow.md](flow.md#s3-policy-vm-rfp) |
| `compute.config.wif.simple` | record (no file) | a bid's workload identity config: OIDC issuer and `sub` format of the VM | [guest-events.md](guest-events.md#secrets-getsecrets-or-sealed-fallback) |
| `compute.secrets.getSecrets` | query (no file; route `/xrpc/<nsid>/<contract>`) | the guest fetches its secrets bundle from the requester with a workload identity token | [guest-events.md](guest-events.md#secrets-getsecrets-or-sealed-fallback) |
| `compute.guest.subscribeEvents` | subscription | the guest's WebSocket at its bidder for requester-authored `compute.events.guest.*` | [guest-events.md](guest-events.md#computeguestsubscribeevents) |
| `compute.events.vm.onNetwork` | record | an address of the VM: iroh ticket, https tunnel URL, webrtc DTLS fingerprint | [guest-events.md](guest-events.md#each-kind) |
| `compute.events.vm.hostKeys` | record | the VM's ssh host keys | [guest-events.md](guest-events.md#each-kind) |
| `compute.events.vm.delete` | record | the requester asks the bidder to delete the VM (`reason: released`) | [market.md](market.md#release-and-termination) |
| `compute.events.vm.terminated` | record | the bidder reports the VM stopped, with a reason | [market.md](market.md#release-and-termination) |
| `compute.events.vm.sandbox` | record | a deno sandbox ended, with its output | [guest-events.md](guest-events.md#each-kind) |
| `compute.events.vm.memoryPressure`, `vm.oomKilled` | record | the VM's host cgroup crossed a memory threshold / OOM-killed | [guest-events.md](guest-events.md#each-kind) |
| `compute.events.vm.started`, `vm.registerIdentity` | record | defined, no writer | [lexicons-market.md](lexicons-market.md) |
| `compute.events.guest.publicKey` | record | an age-x25519 key per tag, either side | [guest-events.md](guest-events.md#sealed-signaling-webrtc-tunnels) |
| `compute.events.guest.signalWebRTC` | record | a sealed WebRTC offer or answer for one tag | [guest-events.md](guest-events.md#sealed-signaling-webrtc-tunnels) |
| `compute.events.guest.secrets` | record | the requester's bundle sealed to the guest's key (only when asked) | [guest-events.md](guest-events.md#secrets-getsecrets-or-sealed-fallback) |
| `compute.events.guest.secretsRequested` | record | the guest asks for the sealed bundle | same |
| `compute.events.guest.secretsApplied` | record | the guest wrote its bundle (`via`) | same |
| `compute.events.guest.secretsUpdated` | record | the bundle changed; fetch again | same |
| `compute.events.guest.agentStart` | record | start the guest's atirc agent unit | [guest-events.md](guest-events.md#agent-start-and-atirc-mint) |
| `compute.events.guest.requesterDid` | record | the guest reports its guest requester's DID | [identity.md](identity.md#guest-requester-r2) |
| `compute.events.guest.r2Start` | record | start the guest requester unit | same |
| `compute.events.guest.r2Release` | record | release the guest requester's contracts | same |
| `compute.events.guest.r2Released` | record | the guest requester released them | same |
| `compute.events.guest.memoryPressure`, `guest.oomKill` | record | the guest's PSI or swap threshold / an OOM kill | [guest-events.md](guest-events.md#each-kind) |
| `compute.events.guest.image` | record | the marker of the image the guest booted | [guest-events.md](guest-events.md#each-kind) |
## Lexicons without a description
## com.publicdomainrelay.temp (other)
Kept here until the lexicon file has one.
| NSID | type | one line | doc |
|---|---|---|---|
| `ingress.webRTC` | record | the requester's WebRTC ingress listen record (rkey `webrtc`) named in `ingress[]` | [lexicons-market.md](lexicons-market.md#ingresswebrtc) |
| `badgeBlueKeys` | record | binds a signing key (or an ssh key) to the repo DID | [identity.md](identity.md#badgebluekeys) |
| `ops.getRequesterLog` | query | the ssh gateway's requester log lines of one DID | same |
| `binding`, `pins` | record (no file here; knotless) | CI executor bindings and the tested atlibs pin set, in the release account's repo | [../ci-debug.md](../ci-debug.md) |
## computer.socialweb
| NSID | type | one line | doc |
|---|---|---|---|
| `computer.socialweb.infra` | record | a long-lived deployment: contracts with their wanted state; index at `self` | [infra.md](infra.md) |
| `computer.socialweb.ephemeralInfra` | record | a short-lived deployment that ends at `createdAt + ttlSeconds` | [infra.md](infra.md) |
| `computer.socialweb.ingress.listen` | record | a WebRTC answerer's keys (rkey: the listen name, `market` for a bidder) | [market.md](market.md#xrpc-procedures) |
| `computer.socialweb.ingress.offer` | record | a sealed WebRTC offer, rkey `<answerer DID>.<tid>` | same |
| `computer.socialweb.ingress.answer` | record | the sealed answer, rkey `<offerer DID>.<tid>` | same |
| `computer.socialweb.peer` | record | how to reach one subhandle directly (iroh ticket) | [lexicons-market.md](lexicons-market.md#computersocialwebpeer) |
| `computer.socialweb.mesh.roster` | record | one socialweb-meshd overlay's roster | `lexicons/computer/socialweb/mesh/roster.json` |
| `computer.socialweb.k8s.kubectlApplyServerSide`, `k8s.getJob` | XRPC | the gateway's k8s API | [infra.md](infra.md#computersocialwebk8s) |
| `com.publicdomainrelay.temp.market.policies.denoWorker` | record (no file) | a policy record type the engine denies | [policy.md](policy.md) |
| `com.publicdomainrelay.temp.compute.config.wif.simple` | record (no file) | a bid's workload identity config: OIDC issuer and `sub` format of the VM | [guest-events.md](guest-events.md#secrets-getsecrets-or-sealed-fallback) |
| `com.publicdomainrelay.temp.compute.secrets.getSecrets` | query (no file; route `/xrpc/<nsid>/<contract>`) | the guest fetches its secrets bundle from the requester with a workload identity token | [guest-events.md](guest-events.md#secrets-getsecrets-or-sealed-fallback) |
| `com.publicdomainrelay.temp.auth.allowlist.rbacDid` | scope only (no file) | an OAuth scope; nothing writes it | [outside.md](outside.md#scope-only-collections) |
| `com.fedfork.exec.binding`, `com.fedfork.exec.pins` | record (no file here; knotless) | CI executor bindings and the tested atlibs pin set, in the release account's repo | [../ci-debug.md](../ci-debug.md) |
| `computer.socialweb.temp.policy.ghalite` | record (no file) | the requester's published policy workflow, strongRef'd by the RFP | [policy.md](policy.md) |
| `computer.socialweb.temp.policy.typescript` | record (no file) | a policy type the engine denies | [policy.md](policy.md) |
## software.release
| NSID | type | one line | doc |
|---|---|---|---|
| `software.release.project` | record | a released piece of software | [release.md](release.md) |
| `software.release.manifest` | record | the artifacts of one build, each with its CID | [release.md](release.md) |
| `software.release.version` | record | a named version: its manifest and `previous` | [release.md](release.md) |
| `software.release.channel` | record | `rc` or `stable`: the version followers track | [release.md](release.md) |
| `link.ident.endorsement` | record | the principal confirms an agent (rkey = the agent DID); vendored from ident.link | [identity.md](identity.md#associations-identlink) |
| `network.attested.signature` | object | the inline signature on market records | [identity.md](identity.md#networkattested) |
| `network.attested.proof`, `network.attested.verify` | record, query | defined, not written or served | [identity.md](identity.md#networkattested) |
| `vm.terminated` | `reason`, `exitCode`, `observedAt`, `request?` | reasons: [market.md](market.md#release-and-termination); `request` is optional: a `deleted_on_request` without one is a delete on the bidder |
| `vm.memoryPressure` | `kind`, `threshold`, `observed`, `observedAt` | the VM unit's cgroup `memory.events` high or max rose |
| `vm.oomKilled` | `kills`, `total`, `limit`, `observedAt` | its `oom_kill` rose |
| `guest.publicKey` | `kind: age-x25519`, `tag`, `key` (age1...) | one per tag per side; anything sealed for a tag goes to the other side's latest key |
| `guest.signalWebRTC` | `kind` offer / answer, `tag`, `ciphertext` | plaintext `{sdp, replyTo}`; non-trickle ICE, one offer, one answer |
| `guest.secrets` | `ciphertext` | age armored, at most 65536 bytes (`MaxGuestSecretsCiphertext`); plaintext = the getSecrets JSON array |
| `guest.secretsRequested` | none | only with `secretsFallback: Sealed` |
| `guest.memoryPressure` | `kind` psi / swap, `threshold`, `psiSomeAvg10`, `psiFullAvg10`, `swapUsed`, `swapTotal`, `observedAt` | every VM whose bidder serves the guest agent (`memory.json`); edge-triggered: PSI some avg10 >= 10.00% or swap >= 10% in use, re-armed after 5 min under half; one per kind per 10 min, ten memory events per contract (agent and bidder) |
| `guest.oomKill` | `kills` (since the last one), `total` (oom_kill since boot), `observedAt` | one per /proc/vmstat oom_kill rise, same caps |
| `guest.image` | `marker` (first line of `/etc/swc-image`; any length within the event's 24 KiB) | once at agent start, when the file exists; the bidder publishes one per contract |
What the code does with each kind; the fields of each are its lexicon's, included below.
| NSID tail | notes |
|---|---|
| `vm.onNetwork` | kind absent: iroh without tag, https with tag (`market.OnNetworkKind`). webrtc address = the guest agent DTLS fingerprint `sha-256 AB:CD:...` |
| `vm.hostKeys` | at most 8 keys, an ed25519 key required (`internal/guestidentity/guestrecord.go`) |
| `vm.sandbox` | `compute.vm.kind: deno` only (`internal/market/bidder/sandbox.go`) |
| `vm.delete` | requester writes `released` |
| `vm.terminated` | reasons: [market.md](market.md#release-and-termination); `request` is optional: a `deleted_on_request` without one is a delete on the bidder |
| `vm.memoryPressure` | the VM unit's cgroup `memory.events` high or max rose |
| `vm.oomKilled` | its `oom_kill` rose |
| `guest.publicKey` | one per tag per side; anything sealed for a tag goes to the other side's latest key |
| `guest.signalWebRTC` | plaintext `{sdp, replyTo}`; non-trickle ICE, one offer, one answer |
| `guest.secrets` | age armored, at most 65536 bytes (`MaxGuestSecretsCiphertext`); plaintext = the getSecrets JSON array |
| `guest.secretsRequested` | only with `secretsFallback: Sealed` |
| `guest.secretsApplied` | |
| `guest.secretsUpdated` | the bundle changed (atirc mint, association ref) |
| `guest.memoryPressure` | every VM whose bidder serves the guest agent (`memory.json`); edge-triggered: PSI some avg10 >= 10.00% or swap >= 10% in use, re-armed after 5 min under half; one per kind per 10 min, ten memory events per contract (agent and bidder) |
| `guest.oomKill` | one per /proc/vmstat oom_kill rise, same caps |
| `guest.image` | once at agent start, when the file exists; the bidder publishes one per contract |
| `link.ident.endorsement` | record, key `any` (ident.link `74d22dc`, vendored) | the agent DID | principal confirms an agent, [below](#associations-identlink) |
| `com.publicdomainrelay.temp.market.association` | record | the agent DID | the grant, [below](#associations-identlink) |
| `com.publicdomainrelay.temp.market.associationRequest` | record | [lexicons-market.md](lexicons-market.md#marketassociationrequest) | flow [below](#contract-scoped-association) |
| NSID | rkey | used |
|---|---|---|
| `network.attested.signature` | - | inline on every market and compute event record |
| `network.attested.proof` | - | defined, not written |
| `network.attested.verify` | - | defined, not served or called |
- reference rows for every lexicon under `lexicons/com/publicdomainrelay/temp/` except `cluster.*` ([infra.md](infra.md#compublicdomainrelaytempcluster)) and `badgeBlueKeys` ([identity.md](identity.md#badgebluekeys)), plus the two NSIDs here that have no lexicon file
- the fields of every lexicon come from the lexicon files: each section below includes its generated field table
(the `lexicon:` link; on https://socialweb.computer/docs/protocol/lexicons-market.html the table is rendered in place)
and adds what the code does with it: the rkey it writes, who writes and reads it, and the step
- every lexicon, generated: https://socialweb.computer/docs/lexicons/ (XRPC methods: https://socialweb.computer/docs/xrpc/)
- covers every lexicon under `lexicons/com/publicdomainrelay/temp/` except `cluster.*` ([infra.md](infra.md#compublicdomainrelaytempcluster)) and `badgeBlueKeys` ([identity.md](identity.md#badgebluekeys)), plus the two NSIDs here that have no lexicon file
- the flows: [market.md](market.md) (rfp to release), [guest-events.md](guest-events.md) (events under a receipt); steps S3 to S9: [README.md](README.md#end-to-end-sequence)
- headings drop the prefix `com.publicdomainrelay.temp.`; file paths are under `lexicons/com/publicdomainrelay/temp/`
- the Go types are generated from these files into `internal/atproto/market/zz_generated.lexicons.go` (`go generate` in `internal/atproto/market/nsid.go`)
- "defined, not written": the lexicon and its NSID constant exist, but no Go code in this repo writes the record
## Columns
## Rows
| column | meaning |
| row | meaning |
|---|---|
| type | lexicon `defs.main.type`: record, procedure, query, subscription |
| key fields | required fields first (`*`), then the fields the code reads |
| rkey | what the code writes, not only the lexicon `key` |
| written by / read by | role and the Go function |
| code notes | what the code does with a field, where it differs from what the lexicon allows |
| step | the README step it belongs to |
## Coverage
| file | section | done |
|---|---|---|
| `market/rfp.json` | [market.rfp](#marketrfp) | x |
| `market/bid.json` | [market.bid](#marketbid) | x |
| `market/bids/free.json` | [market.bids.free](#marketbidsfree) | x |
| `market/bids/x402.json` | [market.bids.x402](#marketbidsx402) | x |
| `market/accept.json` | [market.accept](#marketaccept) | x |
| `market/accepts/free.json` | [market.accepts.free](#marketacceptsfree) | x |
| `market/accepts/x402.json` | [market.accepts.x402](#marketacceptsx402) | x |
| `market/receipt.json` | [market.receipt](#marketreceipt) | x |
| `market/receipts/free.json` | [market.receipts.free](#marketreceiptsfree) | x |
| `market/receipts/x402.json` | [market.receipts.x402](#marketreceiptsx402) | x |
| `market/event.json` | [market.event](#marketevent) | x |
| `market/offering.json` | [market.offering](#marketoffering) | x |
| `market/heartbeat.json` | [market.heartbeat](#marketheartbeat) | x |
| `market/relays.json` | [market.relays](#marketrelays) | x |
| `market/association.json` | [market.association](#marketassociation) | x |
| `market/associationRequest.json` | [market.associationRequest](#marketassociationrequest) | x |
| `computer/socialweb/peer.json` | [computer.socialweb.peer](#computersocialwebpeer) | x |
| `market.relays` | record | `self` | no Go writer here | S3 (discovery) |
| `market.association` | record | the agent DID | principal | S5, S8 |
| `market.associationRequest` | record | the principal DID | guest requester | S8 |
| `computer.socialweb.peer` | record | the subhandle | guest requester (its own and each co-located account's); requester (each spec.agent contract's atirc agent) | S8 |
| `market.submitRfp` | procedure | - | served by bidder | S3 |
| `market.submitBid` | procedure | - | served by requester | S4 |
| `market.submitAccept` | procedure | - | served by bidder | S5 |
| `market.submitEvent` | procedure | - | served by both | S7-S9 |
| `compute.vm` | record | TID | requester | S3 |
| `compute.events.vm.*` | record | per kind | bidder (vm.delete: requester) | S7, S9 |
| `compute.events.guest.*` | record | per kind | requester or bidder for the guest | S8 |
| `compute.guest.subscribeEvents` | subscription | - | served by bidder GuestControlPlane | S8 |
| `ingress.webRTC` | record | `webrtc` (listen), TID (offer, answer) | requester, bidder | S3-S6 |
| `compute.secrets.getSecrets` | query (route, no file) | - | served by requester | S8 |
| `compute.config.wif.simple` | record (no file) | `<bid rkey>-config` | bidder | S4 |
| rkey | TID (`putRFP` puts the signed record at a TID it makes) |
| written by | requester: `contractRunner` in `internal/market/requester/runner.go` `putRFP` (`market.BuildRFP`, `market.SignRecord`, putRecord) |
| read by | bidder: stream or `submitRfp`, then `getRecord` (`internal/market/bidder/submit.go` `SubmitRFP`, `acceptContract` in `internal/market/bidder/adapters.go`); bid window from `createdAt` (`internal/atproto/market/rfpwindow.go`) |
| rkey | `market.BidRKey(bidderDID, rfpURI, rfpCID)` = `bid-<20 hex>`; also the Bid object name |
| written by | bidder: `writeBidRecord` in `internal/market/bidder/bids.go` (`market.BuildBid`, `market.SignRecord`) |
| read by | requester: `submitBid` (`Requester.SubmitBid` in `internal/market/requester/callbacks.go`), stream, catch-up `getRecord` at `BidRKey` (`internal/market/requester/bidcatchup.go`); bidder at accept time |
| written by | requester: `putAccept` in `runner.go` (`market.SignRecord`, putRecord) |
| read by | bidder: `submitAccept` or stream -> provisioning StateSync (`SubmitAccept` in `internal/market/bidder/submit.go`, `acceptContract`); the receipt `cid` binds it |
| key fields | `rfp`*, `bid`*, `accept`*, `cid`*, `signatures`*, `payload` (-> the RFP's `compute.vm`; `null` when none), `submitEvent` (copied from the accept when the bidder serves inbound XRPC), `ingress[]` |
| code notes | `submitEvent` is copied from the accept when the bidder serves inbound XRPC; `payload` is the RFP's `compute.vm` (`null` when none) |
| key fields | `receipt`*, `payload`* (-> a `compute.events.*` record in the same repo), `signatures`*, `createdAt` |
| rkey | bidder: `market.EventRKeys(key)` second value `<prefix>-event-<32 hex>`; requester: `SessionRKey("event", receiptURI)` for vm.delete, `SessionRKey("contract-event-envelope", uid)` for ContractEvents |
| written by | bidder event adapter (`writeMarketEvent` in `internal/market/bidder/adapters.go`); requester `destroyEnvelope` (`runner.go`), `publishContractEvent` (`internal/market/requester/contractevents.go`); both via `market.PutEvent` |
| read by | the other party: `submitEvent` or stream; requester `FindTermination` |
| written by | bidder: `putOffering`, `withdraw` in `internal/market/bidder/offering.go` |
| read by | requester: `market.ReadOffering` (`self`, else the rkey the heartbeat names), `market.OfferingApplies`; relays list its repos by `listReposByCollection` |
| meaning | the grant beside the `link.ident.endorsement` at the same rkey: [identity.md](identity.md#associations-identlink) |
| written by | the operator (standing, no `contract`: `compose.ApplyOperatorPair`, `scripts/associate-bidder.ts`); the renter for its guest requester (`contract` = the accept `{uri, cid}`, `expiresAt` = accept + 24 h: `internal/market/requester/association.go`); the guest requester for its co-located accounts (R2's contract and expiresAt: `internal/app/compose/peer.go`) |
| key fields | `principal`*, `contract`* (the principal's accept uri), `nonce`*, `createdAt`*, `accounts` (the co-located DIDs) |
| rkey | the principal DID (`compose.ApplyAssociationRequestRecord`) |
| written by | the guest requester: an AtprotoRecord object from `internal/app/compose/records.go` |
| read by | the authority requester: one `getRecord` in the DID the guest reported (`internal/market/requester/association.go`); `cmd/socialweb-computer/requestassociation.go` |
| key fields | `createdAt`*, `iroh` (short ticket); the lexicon also has `webrtc` (the DID answering ingress offers) and `channels`, which no writer sets |
| code notes | only `createdAt` and `iroh` are written; no writer sets `webrtc` or `channels` |
| rkey | the subhandle: the guest requester's atirc subhandle (`r2-<accept rkey>.<owner handle>`, its handle without one); `<name>.<that>` for a co-located account; `<label>-<rfp rkey>.<handle>` for a contract's atirc agent (label: the handle's first label, at most 14 characters) |
| iroh | the short ticket of the node that is that identity: for an account a PDS hosts, the PDS's XRPC endpoint (ingress-iroh); for an atirc agent identity, its `atirc mesh run` daemon (ALPN `atirc/mesh/1`). One identity, one node; the dialer picks the protocol by ALPN |
| written by | the guest requester (`run request --guest-requester [--colocated a,b]`): AtprotoRecord objects of `internal/app/compose/peer.go` in its own repo and each co-located account's, present only while its association ref verifies. The requester of a spec.agent contract writes no peer record: after the verified receipt it puts the agent's iroh key (a 32-byte ed25519 seed, `/etc/atirc/iroh_key.hex`, 0600) and, for a guest requester, `R2_COLOCATED=<nick>=<ticket>` (`/etc/socialweb-computer/r2-agent.env`) into the bundle (`internal/market/requester/agentpeer.go` `publishAgentPeer`), and R2 writes the agent's peer record |
| output | `{ok, name, phase, ingress?, declined?: {kind, reason}}` (`declined`: the bidder will not bid; kind `capacity` = full now, `unservable` = nothing but another bidder will do); errors `InvalidRequest`, `Unauthorized`, `Forbidden`, `Unavailable`; the code also answers 409 `RFPClosed` |
| served by | bidder: `handleSubmitRFP` in `internal/services/bidder/routes.go` -> `Bidder.SubmitRFP` |
| key fields | `role`* (VM name in the contract), `kind` (`vm` default, `deno`), `cpus` (2), `mem` (`4G`), `disk` (`50G`), `nestedVirt`, `image` (`{url, sha256}`: an https base holding `image.json`, sha256 of that file), `network`, `location`, `user_data`, `createdAt` |
| rkey | TID (`putSetupRecord`: putRecord at a TID; unsigned) |
| written by | requester: `runner.go` with `DefaultComputeCPUs`, `DefaultComputeMem`, `DefaultComputeDisk` (`internal/market/requester/requester.go`); `user_data` from `cloudinit.BuildUserData` (`internal/atproto/cloudinit`) |
| read by | bidder through `rfp.payload`: kind check (`rfpKind` in `submit.go`), boot (`acceptContract`, `internal/guestseed` adds the binaries unit) |
| written by | bidder: `report` in `internal/market/bidder/report.go` from the host key bound at login (`RecordBoundHostKey` in `internal/guestidentity/service.go`) |
| read by | requester: `waitGuest` -> `status.contract.hostKeys` |
| rkey | `EventRKeys("onNetwork:<receipt>")` or `EventRKeys("onNetwork:<tag>:<receipt>")` |
| written by | bidder: `report` (`internal/market/bidder/report.go`) from the guest POST (`Guest.onNetwork` in `internal/guestidentity/service.go`); sandbox: `internal/market/bidder/sandbox.go` |
| read by | requester: `waitGuest` -> `status.contract.vmAddress`, `status.contract.networks` |
| rkey | from the report StateSync key `<nsid>:<kind>-<n>:<receipt>` |
| written by | bidder: `internal/market/bidder/memory.go` (edge-triggered from the VM cgroup's memory.events: one per crossing, re-armed after 5 min below 90% of the threshold, at most 1 per kind per 10 min and 10 memory events per contract) |
| read by | none in Go (renters and the watch page) |
| written by | bidder: termination StateSync (`internal/computevm/termination.go`, `internal/controllers/computevm/controller.go`), adapter `atproto.market.event` |
| read by | requester `FindTermination` (`market.go`); atirc via the token lease (`contractLease` in `internal/market/requester/atirc.go`); policy trust |
| written by | requester (outbound ContractEvent, `contractevents.go`); bidder for the guest (`PublishGuestEvent` in `internal/market/bidder/guestevents.go`) |
| served by | bidder GuestControlPlane: `handleSubscribeEvents` in `internal/services/guestcontrolplane/subscribe.go`, queue `internal/guestcp/queue` |
| called by | guest agent: `internal/guestagent/subscribe.go` (bearer = workload identity token) |
| carries | requester-authored `compute.events.guest.*` payloads, in order; keepalive every 25 s |
| key fields | `kind`* (`webrtc`), `mode`* (`listen`, `offer`, `answer`), `id`* (hex sha256 of the requester repo DID), `createdAt`*, `peer`, `session`, `descriptor` (-> the listen record), `sdp`, `stunUrls` |
| rkey | requester listen: `webrtc` (`ingressDescriptor` in `internal/market/requester/requester.go`); offer: TID (`createIngressOffer` in `internal/market/requester/market.go`); bidder answer: TID (`AnswerIngressRecords` in `internal/market/bidder/submit.go`) |
| written by | requester (listen, offer), bidder (answer) |
| read by | the other side through `ingress[]` on rfp, bid, accept, receipt, offering and the submit calls; only refs to this NSID are allowed (`validateIngressList` in `internal/atproto/market/records.go`) |
| [policy.md](policy.md) | policy records (gha-lite workflows), the strongRefs an RFP attaches, tangled-vouch |
| [outside.md](outside.md) | lexicons we use but do not own: `sh.tangled.graph.vouch`, `chat.atirc.*`, `com.atproto.*`, `app.bsky.*`, `com.fedproxy.*`, OAuth scopes per role |
## How To Read A Lexicon Row
## The Lexicon Reference
Every lexicon section in this tree carries the same fields.
The lexicon files under `lexicons/` are the one source of every record's and method's fields. The reference is generated
from them: https://socialweb.computer/docs/lexicons/ (one page per NSID: type, key, fields, refs, errors, the raw schema
and the docs pages that name it) and https://socialweb.computer/docs/xrpc/ (the XRPC methods). A docs page that shows a
lexicon's fields includes the generated table (a `[lexicon: <nsid>](https://socialweb.computer/docs/lexicons/<nsid>.html)`
line, rendered as the table on the site) and adds only what the code does with it:
| field | meaning |
| row | meaning |
|---|---|
| NSID | the full id, as in the `id` of the lexicon file |
| type | `record`, `query`, `procedure`, `subscription` or `object` |
| key fields | the fields a reader acts on; the lexicon file has the rest |
| rkey | `self`, a deterministic key (named), `tid`, or `any` with the scheme the writer uses |
| written by / read by | the application role and the Go package |
| step | the step of the [end-to-end sequence](#end-to-end-sequence) where it appears |
@@ -24,6 +24,8 @@ Start at the [README](../README.md). Agents: [../AGENTS.md](../AGENTS.md) first.
| [protocol/compute-contract-flow-map.md](protocol/compute-contract-flow-map.md) | the compute contract flow map: every layer from the lexicons to the guest transport |
| [protocol/README.md](protocol/README.md) | the atproto lexicons and the end-to-end sequence; [protocol/glossary.md](protocol/glossary.md): every NSID |
| [lexicon reference](https://socialweb.computer/docs/lexicons/) | every record, object and method, generated from [../lexicons/](../lexicons/) (on the site) |
| [XRPC reference](https://socialweb.computer/docs/xrpc/) | the XRPC methods, generated from the same files (on the site) |
| [KCP.md](KCP.md) | how every app uses kcp |
| [ARCHITECTURE.md](ARCHITECTURE.md) | decisions, measurements, invariants (open a section by heading) |
| [../deploy/market-network/README.md](../deploy/market-network/README.md) | the one-kcp market network |