Skip to content

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

Merged
devswha merged 3 commits into
mainfrom
feat/account-list-fake-plain-invite-2
Nov 25, 2026
Merged

devswha merged 3 commits into
mainfrom
feat/account-list-fake-plain-invite-2

Conversation

@devswha

@devswha devswha commented Nov 24, 2026

Copy link
Copy Markdown
Owner

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 at 7ad93f1):

  • A PC's post carries the plain invite's line proof. POST /v2/pc/list/keys takes invite and invite_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 with verifyLineProof from shared/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}/posts shows both members only on a post that carried them; a later post without them clears them.
  • A PC completes its listing on its own pull. POST /v1/pc/complete now 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

  • The plain invite's proof: posted, shown and cleared. Then the refusals: the form, an invite the list never held or a member put out, and a proof by another key, for another PC, account or card, or junk. The attack the addendum names is a test: a redeem signature over lineChallenge(list, another card) posted as invite_proof is refused, and so is one over this card's challenge.
  • The completion: a list account's PC is refused before its first pull and gets 404 no_admission on 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.
  • Mutation check: removing the line-proof check, the pull as evidence, or the confirmed-listing condition each fails a test.
  • feat(account): a PC joins an account that keeps a signed list by that list alone #4630's server/account/list-join.contract.test.ts and scripts/plugin-join.contract.test.ts no longer strip invite and invite_proof off 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's completed_at is 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.
  • The contract suites that use the fake (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.ts and server/relay/service.contract.test.ts each failed once under a load average of about 80 and passed on a rerun (201 and 84 pass). server/machine-profile-api.contract.test.ts fails 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-join 50 pass, plugin-join 8 pass, list-shadow 22 pass.
  • bun run check fast (through the heavy queue) on this head: passed.
  • Skipped: browser regressions (nothing in src/ or the UI changes).

🤖 Generated with Claude Code

devswha and others added 3 commits November 25, 2026 05:15
…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]>
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Documentation
    • Clarified the invite and proof required when a PC joins a list, and the conditions for completing a listing.
  • Tests
    • Added coverage for accepting valid invite proofs and rejecting invalid or unlisted invites.
    • Added checks for listing completion after mailbox pulls and confirmed device admission.
    • Preserved invite details when forwarding list-key posts in the test flows.

The fake account service now validates invite proofs on PC list-key posts, retains accepted invite details in post views, and uses mailbox-pull evidence when deciding whether a confirmed listing can be completed.

Changes: Account list join

Layer / File(s) Summary
Validate and expose invite-backed posts
shared/account-service-fake.ts, shared/account-service-fake.list.test.ts, scripts/plugin-join.contract.test.ts, server/account/list-join.contract.test.ts, docs/account-list.md, changelog.d/account-service-fake-plain-invite-post.md
PC list-key posts require invite and invite_proof together. The service checks that the invite is open in the list and verifies the proof against the account, PC, and card before storing the post. Post views expose retained invite details. Tests and contract harnesses forward and check the original request.
Track listing evidence for completion
shared/account-service-fake.ts, shared/account-service-fake.list.test.ts, server/account/list-join.contract.test.ts, docs/account-list.md
Mailbox pulls mark a listing as pulled, and relisting preserves that marker. Completion requires a current, confirmed listing and evidence such as a prior completion, mailbox pull, digit admission, or taken one-press admission.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Other

Possibly related issues

Possibly related PRs

  • devswha/ovis#4556: Adds the shared invite and join-line proof library used by this PR.
  • devswha/ovis#4582: Adds the signed-list routes and state model that this PR extends.
  • devswha/ovis#4608: Adds the list_add behavior connected to this PR’s listing-completion evidence rule.
Merge Risk: Minimal · up to d1e6a

This change updates the in-memory account-service fake and its tests and docs. It has no production runtime impact. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the in-memory account service fake accepts a PC's list post carrying the plain invite's line proof, and PC completion on its own mailbox pull. It matches the raw summa…
Description check Passed The description follows the template's two sections, What and Validation. The What section explains the change, the refusal cases, and the completion rules, and links the related issue and PR (#4610, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the in-memory account service fake accepts a PC's list post carrying the plain invite's line proof, and PC completion on its own mailbox pull. It matches the raw summary and objectives. The title is long (126 characters) but it is specific and not vague.

Full details: Description check

Explanation

The description follows the template's two sections, What and Validation. The What section explains the change, the refusal cases, and the completion rules, and links the related issue and PR (#4610, #4630). The Validation section lists the commands run, their results, the failures seen under load, and the skipped browser checks. The template's Change section asks for a linked issue for features. The description cites #4610 and #4630 and a ruling document, but it does not link a maintainer-agreed issue for this feature, so that part is incomplete. The changelog requirement is also not addressed: the raw summary shows a changelog.d entry, but the description does not mention it. These gaps are minor, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 40a2587 and d1e6ad3.

Files selected for processing: 6

  • changelog.d/account-service-fake-plain-invite-post.md
  • docs/account-list.md
  • scripts/plugin-join.contract.test.ts
  • server/account/list-join.contract.test.ts
  • shared/account-service-fake.list.test.ts
  • shared/account-service-fake.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

@devswha
devswha merged commit 61b616a into main Nov 25, 2026
21 checks passed
@devswha
devswha deleted the feat/account-list-fake-plain-invite-2 branch November 25, 2026 00:14
@devswha

devswha commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head d1e6ad35a. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit reviewed this head.

Test-only fake of the account service: it now takes a PC's post with the plain invite's line proof (checked with verifyLineProof, never as a redeem signature) and completes a list PC's listing on its own mailbox pull, as the account service does; the PC's join tests stop stripping the two post members and assert the accepted completion. No caller in the product. No independent review: it changes nothing a PC or a device does.

devswha added a commit that referenced this pull request Nov 25, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant