Repository navigation
feat(shared): the account service fake takes a PC's post with the plain invite's line proof, and a PC's completion on its pull - #4646
Conversation
…in invite's line proof, and a PC's completion on its pull
As the account service built them (its main at 7ad93f1):
- POST /v2/pc/list/keys takes `invite` and `invite_proof`, both or neither: an invite the list holds
open, and the line's proof for the posted card, checked only with verifyLineProof of
shared/account-list-invite.ts (ovis-list-line/1; a redeem signature is never one, a redeem
signature over another card's line challenge included). invalid_request, invite_not_in_list
and invite_proof_invalid refuse it, and nothing is posted then. GET /v2/lists/{list}/posts shows
both only on a post that carried them; a later post without them clears them.
- POST /v1/pc/complete takes a current, confirmed listing with evidence of its own: completed
already, a mailbox pull of that PC since the listing was made (pulled_since_listed), a digit
admission, or a one-press admission it took. So a PC of an account that has a list, which takes
no admission (409 list_add), completes on its own pull.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the fake as they are, and see a list PC's completion taken #4630's list-join and plugin-join tests read invite and invite_proof off the PC's post and passed it on without them, since the fake took no such members. It takes them now and checks the proof as the account service does, so the post goes on as the PC sent it. The test of a list PC's receipt now sees the fake take it: the PC's pull is the listing's evidence. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Merged through Test-only fake of the account service: it now takes a PC's post with the plain invite's line proof (checked with |
… the one-press Add of a PC that joined with one (#4648) ## What Invites for a PC, in the Mac app, on an account with a signed list: **Add PC → Ovis relay → Invite a PC**. An invite adds one PC to the account with no sign-in on that PC. By default the PC asks and a device of the account presses **Add** for it; with **Let the PC join by itself** on, the PC joins with nobody asked (for a PC an agent sets up), and the line under the switch says so. - **Make an invite** (`src/lib/account/listInvite.ts`). The device makes a key pair and writes the join line from it; the line is the only copy of the private key, shown once, on the device that made it, and never stored. The account service is given the public key alone (`POST /v1/pc-invites`), and the list gets an `invite` entry for that key: one use, over fourteen minutes after the time the device judges by (its own clock), under the fifteen the service keeps its own. The current epoch's key is wrapped to the invite's key, so the PC that joins reads the list's names. A sign-in older than ten minutes proves its registered key for that very invite, to the service's invite and to the entry alike. - **The line is shown only when this device's own copy of the list shows the entry.** Where the service or the list refuses, nothing is shown, the service's invite is ended again, and the key pair is gone. Where the placement is not known, nothing is ended: the line stays in the page's memory, the screen says it is not known yet, and the next Make an invite settles the kept request first (the line is kept in the page's memory for its life, never stored). The answer's account must be the device's own. `exp` is the device's own clock as it reads now + 840 s; a device whose clock reads behind the list's own time by more than that makes nothing and says its clock is behind. Whichever page ends an invite in the list ends the account service's invite too (by the id this device kept, or the service's list where it names the key). - **What the screen shows** (`src/components/InvitePc.tsx`): the line with **Copy**, a warning that whoever holds it can add a PC, and **For an agent**: the one line an agent runs on the PC (the one-line installer, then `ovis join --invite-file ~/ovis-invite.txt --account <the account's id>`), with **Copy**. Under it, the list's invites: **Expires in N min** while open with **Revoke**, then **Expired**, **Used** or **Revoked** or **Ended**, for an hour after their end. An invite past its time by the device's clock, held against the latest time it saved, is never shown as open. - **The PC that joined with an invite that waits for Add** shows on the card of a PC that asks as **Add this PC to your account? (joined with your invite)**, and its Add needs no number (`listInvited.ts`). The device does not take the account service's word for which PC used the invite: it offers this only where the invite's own key signed for that PC's card, and its own copy of the list holds the invite as open and waiting for Add (`verifyLineProof`, #4610: a redeem signature of the line is never taken for it). Add has the account admit the PC, signs its entry and ends the invite in the same request; the press is bound to the card shown, the invite is judged again on the state of every signature, and the Add is done only once the copy holds the PC and the invite's end. The card is drawn again on list, post and expiry changes, and the `invited` record is written before it goes. Where the account admitted the PC and the list did not take its entry, the card stays with Try again, as the number's card does. A PC added by the number whose post carries the line's proof for that very card has its invite ended beside its entry. - **Revoke** signs a `remove` of the invite's key and ends the service's invite; the same request opens the next epoch, since whoever held the line held the epoch's key. **Used** reads only where the removal sits in one request with the PC's entry; a Revoke this device placed reads **Revoked**; any other end reads **Ended**. It is drawn only in the Mac app, and only for a device that may write the list. Strings in en, ko, ja and zh. ## Not in this PR - The PC posts `invite` and `invite_proof` with its keys (#4630), and the repository's account service fake carries them (#4646). Until the account service itself carries them, a PC that joined with an invite that waits for Add is added with the number, like any PC that asks. - A Revoke on another device ends the account service's invite only where the service names an invite's key in `GET /v1/pc-invites` (documented without it today); the list's `remove` decides for the list in every case. - Invites on a phone or in a browser. ## Design None of the reference apps (the Codex and Claude apps, Paseo, T3 Code) adds a machine to an account by an invite, so there is no app precedent to follow. The default follows this app's own rule for a PC that asks: a person on a device of the account presses Add on its card, here with the line's own proof in place of the number. Letting the PC join by itself is an opt-in switch, for a PC an agent sets up, with the one line under it that says what it allows. ## What the reviews changed Two reads before it opened: a Codex read of the step, and an independent adversarial review of it together with the step before (its test file `src/components/review-client-p12.test.ts`, 28 tests, all passing here). Each finding was reproduced with a failing test first and fixed, or answered with the guard that stops it; none is open. What a person sees differently because of them: an invite whose placement is not known is "not known yet" and keeps its line for the page's life; a clock that is behind makes no invite; Used, Revoked and Ended; the one-press card only on the line's own proof for the very card shown, judged again at every signature. ## Validation - On this head (607d773: the changes, the fixes of the eleven review threads, and main 50caddd merged in, which holds the step before it, #4642): `bun run check fast` green, 27415 pass, 0 fail, 244 skip in 1302 files; typecheck and build ok; `src/lib/relay/listJoin.contract.test.ts` (10 pass) and `src/lib/relay/listPin.contract.test.ts` (7 pass), one at a time. - Before that main-only merge, on the same changes over the step before (f55ec14), 2026-11-25: `bun run check fast` green (26954 pass, 0 fail); `bun run check integration` (CI's integration lane, one file at a time, in the self-hosted runner image) green, 2556 pass, 0 fail, 129 skip in 166 files; 14/14 browser scripts pass in the runner image (my-pcs-ways, relay-account-pcs, relay-first-link, relay-second-device-join, relay-new-pc-press, relay-shell-browser-qa, relay-join-browser-qa, account-list-device-browser-qa, account-list-seal-browser-qa, usage-account-management, add-pc-more-relay, relay-e2e, offline-typing-relay, pc-add-guidance). - Screenshots (390 and 1280, light, en and ko), from an in-memory account service, never a real session: the invite whose placement is not known; Used, Ended and Revoked; the one-press card with no sign-in code sentence; a clock that is behind. Not run: the macOS and Windows jobs (nothing here touches them). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <[email protected]>
What
Two things the PC lane's join by a plain invite needs from the in-memory account service (
shared/account-service-fake.ts), mirroring the account service's merged code (its main at7ad93f1):POST /v2/pc/list/keystakesinviteandinvite_proof, both or neither. The invite must be one the list holds open, and the proof must be the line's proof for the posted card. The proof is checked only withverifyLineProoffromshared/account-list-invite.ts(feat(shared): what an invite's line signs for a PC's card, with its challenge and vectors #4610,ovis-list-line/1), never as a redeem signature (rulings-plain-invite.md, addendum 03:30). Refusals:400 invalid_request,409 invite_not_in_list,400 invite_proof_invalid, and nothing is posted on any of them.GET /v2/lists/{list}/postsshows both members only on a post that carried them; a later post without them clears them.POST /v1/pc/completenow takes a current, confirmed listing with evidence of its own: completed already, a mailbox pull of that PC since the listing was made (pulled_since_listed), a digit admission, or a one-press admission it took. Before, the fake took only the last. So a PC of an account that has a list, which takes no admission (409 list_add), completes on its own pull, as with the service.Tests
lineChallenge(list, another card)posted asinvite_proofis refused, and so is one over this card's challenge.404 no_admissionon the take. Its pull names its listing, and the completion is then accepted. A device code's listing that nobody confirmed completes on no pull.server/account/list-join.contract.test.tsandscripts/plugin-join.contract.test.tsno longer stripinviteandinvite_proofoff the PC's post before it reaches the fake. The fake now takes and checks them, so the post goes on as the PC sent it. list-join's test of a list PC's receipt now also checks that the fake takes it (the listing'scompleted_atis set).Validation
bun test shared/account-service-fake src/lib/account/listAllow.test.ts: 169 pass, 0 fail (before merging main).bun --bun tsc --noEmit: clean.grep -rl account-service-fake server src scripts --include='*.contract.test.ts', each file on its own): 25 of 26 files pass.server/api.contract.test.tsandserver/relay/service.contract.test.tseach failed once under a load average of about 80 and passed on a rerun (201 and 84 pass).server/machine-profile-api.contract.test.tsfails 5 tests that look for local herdr sessions on this PC; it passes in CI and nothing in it touches the fake. After merging main:list-join50 pass,plugin-join8 pass,list-shadow22 pass.bun run check fast(through the heavy queue) on this head: passed.src/or the UI changes).🤖 Generated with Claude Code