~ knotless Search/
↑↓ move↵ open⇧↵ all results

socialweb.computer/socialweb-computer-kcp

socialweb.computer: a compute market on atproto (kcp)

1 collaborator
0
0
93 lines · 7.7 KB Raw History
# 0041 - After the pipeline: port parity, docs, and what 0040 left open

Status: NOT in flight. It starts when plan 0040 is done (two green CI rolls). Owner, 2026-11-18: "numbers now, rest
after. Once we have solid CI/CD everything else is easy" and "move those other things into the next numbered plan doc
so they stay out of this goal". These steps were steps 16, 18 and 19 of `0040-release-pipeline.md`; nothing here
counts toward 0040's Done when.

## Steps

1. atlibs port parity (was 0040 step 16): the Rust compose host shows nested instances' outputs (`on_event` with the
   instance name, as the JS host); knotless-run shows the root's.
2. atlibs docs and examples (was 0040 step 18): minimal wording, copy-pastable examples run by the docs checker
   (`scripts/check-docs.sh`, `run=gate` blocks; with `ATLIBS_REPO` set it reads atlibs `docs/`), highlighted code;
   using, writing and publishing libs and compositions. Known from the checker's first listing (atlibs f39c7a7): 10
   `run=gate` blocks; `docs/browser/oauth.md:231` is a js block (the checker fails it); `docs/transports.md:56` holds a
   placeholder and cannot pass as written.
3. kcp docs and examples (was 0040 step 19), the same standard, for every mode: prod, rc and dev builds, foreground
   and systemd, bidder, requester, gateway, the release channels and self-update. Today 0 of the 57 code blocks in
   `README.md`, `docs/quickstart*.md`, `docs/deploy.md`, `docs/bidder.md` are tagged `run=gate`.
4. Left open by 0040, each to its own root cause and a composition. Two of them can still cost plan 0040 a run and are
   watched there (0040 Finding "Open items that can cost a run"): the QR token limit and the second kcp first-start
   stuck mode; if either shows in a CI run it is fixed in 0040, not here:
   - the relay keeps listing an account whose bidder records were deleted (`internal/atproto/relay/relay.go`,
     `listReposByCollection`): 0040 Finding on 0014:impossible;
   - a staging bidder watches prod's release account and is kept off it only because the staging network cannot
     resolve it: name the network's own `release-repo` at stand-up (0040 Finding on 0020);
   - the unanswered `ingress.offer` leak (atlibs-webrtc `js/record-signals.js`, the page's `webrtc-cubit.js`);
   - the QR backend's 8192-byte accessJwt limit (token ~8004 bytes today);
   - the PDS sends an absolute `did:plc:...#atproto_pds` service id;
   - an ssh session gives up after ~7.5 min while its requester waits for capacity;
   - `gateway.sh up` keeps a live serve on the old spec;
   - the requester repo's `modules/vm-mcp/test.mjs` hang;
   - a second kcp first-start stuck mode (cache-server CRDs never Established);
   - the ops read routes' proposed, unbuilt controls (`docs/security/proposed-controls.md`).
   - the two-grants question of the orphan-VM fix (0040 decision 37: the product ends a VM whose requester's association
     no longer verifies, and the test host deletes VMs a guest requester of its own run rented): owner, 2026-11-18,
     "Decide later" (0040 decision 39).
   - the ops read routes' proposed, unbuilt controls (`docs/security/proposed-controls.md`);
   - the owner's "two grants" question (Decide later): a requester reached by both a standing and a contract-scoped
     grant; until the owner decides, the bidder records no `spec.associationContracts` for it, so it is never auto-ended
     (`internal/market/bidder/association.go` `associationContracts`; 0040 Finding on 0014 at 7a0406d9).
5. Timing work the owner stopped on 2026-11-18 (0040 decision 32), to take up only if asked: the guest image baked into
   the staging image; a faster release build.

## Done when

Each step's own proof: step 1 by a composition on both hosts; steps 2 and 3 by `scripts/check-docs.sh` running every
example in CI; step 4 item by item.

## Lexicons with no test or no writer (history traced 2026-11-20; owner: "bids.x402 and accepts.* and receipts.* we want for sure")

- LIVE on the gateway, code complete, no test since 48b88154 and no canary since 6e76e7f4: `k8s.kubectlApplyServerSide`,
  `k8s.getJob` (`internal/gateway/tenantapi.go:101,111`), `cluster.subscribeClusters` (`internal/xrpcserver/subscribe.go:125`),
  `cluster.revokeIdentity` (`internal/gateway/gateway.go:402`: an account DID revokes its own access to its tenant
  clusters). To do: a composition test for each; an acceptance 0001 step.
- Removed (owner 2026-11-20, on `lexicons-fix`): `compute.events.vm.registerIdentity`, `compute.events.vm.started`,
  `mesh.roster`.
- Wanted, not wired: `bids.x402`, `accepts.{free,x402}`, `receipts.{free,x402}`. Only `cost` of a `bids.x402` is read
  (`internal/market/requester/accept.go:276`). Old code: `~/src/publicdomainrelay/atproto-market`
  `lib/market-settlement-x402/` and the PoC's `bids_x402.ts`. To build: bidder price config, the bidder writes
  `bids.x402`, a payment route on the bidder's transport (verify and settle through a facilitator, mint the receipt),
  requester wallet and paying fetch, accept carries the payment, bidder verifies before provisioning,
  `receipt.payload` set, lexicon fixes (no settlement evidence in `receipts.x402`; no network, asset, payTo in
  `bids.x402`; `accepts.*` missing from the OAuth scopes), a composition test on a test network. Needs its own plan.

## Staging stand-up from an image (owner 2026-11-20: "land fast-standup under a plan after the two rolls")

- Branch `fast-standup` on `swc` (4 commits, 2026-11-17): `scripts/build-staging-image.sh`,
  `deploy/vm-images/staging.json`, parallel stand-up. Needs its own plan; rebase on main, hand staging cycle, then land.

## DigitalOcean bidder (owner 2026-11-20: "move DO bidder to after roll two, pause work and document")

- Branch `do-bidder` on `swc`, plan 0042 on that branch (state and resume steps at its top). Built locally, never run
  against DigitalOcean, not deployed. Before it goes live the owner creates a new DigitalOcean OAuth client secret.

## Bidder heartbeat names its release (owner 2026-11-20: "It would be cool if a bidders health check record strongRef'd to the software.release.version and software.release.channel it was running, make that in one of the next plans")

- Today the heartbeat (`market.heartbeat`, rkey `self`) carries `version` (`#runningVersion`: version, commit and
  binary sha256 as plain values) and `promote.sh` `heartbeats` compares `version.sha256` for every
  `rc-operators.json` DID (a 20 s read loop: also on the no-polling list).
- Wanted: the heartbeat holds two `com.atproto.repo.strongRef`s (uri and cid): the `software.release.version` record
  of the binary it runs and the `software.release.channel` record it follows (rc or stable; absent when the bidder
  follows none). A reader then resolves version, channel and artifact hashes from the release records instead of
  matching a bare sha256, and a stale channel record shows as a cid mismatch.
- To settle in its plan: where the bidder learns its version record (the release follower already reads the channel
  record: keep its uri and cid; a hand-installed binary has no version record: the refs stay absent and the sha256
  stays); `promote.sh heartbeats` and the gate read the refs; the heartbeat lexicon changes with plan 0053's rename
  (do both in one lexicon revision).
- Owner, same day: "It can stil have a string but it should also have a strongref - or it could derive the string
  from the rkey of the strongRef": the version string may stay next to the strongRef, or be dropped and read from the
  version record's rkey (the release records key a version by its name). Decide in the plan: keep the string only if
  a reader without the release records needs it; never let the two disagree (the bidder writes both from one source).
- Order: after plan 0040's two rolls, with or right after plan 0053.