Skip to content

feat(account): a PC pinned to its account's signed list lets devices in by that list alone - #4607

Merged
devswha merged 104 commits into
mainfrom
feat/account-list-pc-enforce
Nov 24, 2026
Merged

devswha merged 104 commits into
mainfrom
feat/account-list-pc-enforce

Conversation

@devswha

@devswha devswha commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

What

A PC can be pinned to its account's signed list. A pinned PC lets its account's devices in only by entries that members signed and that it checked itself. This is the PR that changes who can open a PC, for a PC that is pinned; a PC that is not pinned works as on main.

No screen pins a PC in this PR. A person at the PC names the list at POST /api/account/list/pin (this PC's own window and CLI alone), and the PC pins it once that list holds an entry for the PC's own key at its own relay key. Never on the account service's word, and one press never pins.

The rule

On a pinned PC, a session opened through the account (its id is accountDeviceId(server_id, key)) is the list's to answer for, and nothing else's. It is let in when the PC's own copy holds that key as a device that is in; as the list's role; until the list's until, when a timer of the PC's own closes the open session; and not while an alarm holds the key back or the copy cannot be read. A row of the PC's own devices under that id gives it nothing more, whoever wrote it and whenever: a member's add from before the pin, a join allowed by digits.

A pairing made at the PC by a code has an id of its own and is the PC's own business: it keeps the role the PC gave it, the list's watch and until do not reach it, and removing the key from the list does.

  • The pin lives with the binding in account-pc.json (binding.list), not in the list's own file: a lost or deleted account-list.json unpins nothing. While the file holds a pin, or that the list removed the PC, it is written as version 2, which an Ovis from before the list refuses to read. That was run for real against v0.5.9 and against main before this PR: both refuse the file ("unknown version"), block the device registry with Step 2 on and off, and leave the file's bytes as they were. Every write of the file, the other folder's included, is lock, read, reconcile, write: a pin and a removal's receipt on disk are never lost, a binding the file holds cleared never comes back from memory, and the service's word clears no pinned binding. A second server on the folder takes the file in before an unlisting, before a snapshot's rows are committed, and every five seconds.
  • Rows come from the list. The snapshot's devices and its removed decide no row.
  • A removal is prompt, complete and survives. Each page of a read reaches the copy, and closes the sessions it ends, before the next request goes out; a page a member hands over waits for no request. A removal is kept also when the read then stops at an entry this Ovis is too old to place. It is enforced from memory when its save fails. What the PC denied and could not save does not come back by a restart: a mark beside the copy (account-list-owed.json) names the denial itself (the removed key and the place of its entry; the key whose time passed and that time), is written before the PC acts, is read at a start before the copy and without it, and goes only once the write that makes it unnecessary is on disk. While it stands its keys are refused; a start on a copy that does not reach a removal it names lets nobody of the list in until a read reached that place, or the account service answered one whole read.
  • No session under an account's id without the list. The check is in one place, where a session takes its device (enter in server/relay/session.ts), so it holds for every way such a row comes to a session: a sign-in, a pairing confirmed on the PC's screen that reuses the row, a comparison by digits. Sessions open under such an id end with auth_changed when the PC pins, also on a second server of the folder that learns of the pin from the file. A server that follows no list (started with Step 2 off) and finds the PC pinned closes its account part and says why.
  • A PC the list removed does not come back by a press, the service's word, an old log, a restart or Step 2 turned off: only as a new PC, after Reset relay identity.
  • The service cannot unbind a pinned PC or shut out a device it holds. An existing pin is honoured at start whatever the local Step 2 setting says.
  • Who approves a join from afar: a member of the PC's own devices only while the list holds its key to drive with full power.
  • It says so. GET /api/account/status (list), GET /api/account/list (reason) and ovis status --json (list, problem) carry one sentence a person can act on for each case in which a pinned PC lets nobody in: the copy cannot be read, an alarm, a lost copy with an alarm, stopped at a later level, reading again after a lost copy, started with a change it had not saved, and its other state folder's keys missing.
  • The other state folder never takes a pin (the simpler of the two ways the round-2 ruling allows). A folder whose other folder holds a pin it does not hold itself lets only the PC itself in, writes nothing of its own, and says which folder holds the pin. A folder of another PC changes nothing for the pin.

docs/account.md, "The account's signed list on a PC", has the rules and a table of what each word of the account service does on a pinned PC against one that is not.

Release order (rule E5)

Nothing in this PR makes a PC pin by itself, and nothing a released app does can: the second condition needs an entry for the PC that a member signed. Anything that makes a PC pin ships in the same release as the app change that signs in with the list's member key. A device signs in to a pinned PC with its member key, not with today's sign-in key, and its link is refused list_followed: an app from before that change would be shut out of a pinned PC.

Known limits

  • A join by comparing digits makes a row that opens nothing until the list holds its key. The row is written under the account's id for the key, so by the rule above it counts only while the list holds that key. The steps after this one (the PC's own Allow, and the app's) write the entry with the join.
  • Step 2's blocks still freeze by the account service's numbering: a freeze can shut list devices out; nothing lets one in.
  • A removal the account service withholds has no way to the PC yet. The PC's side is built and tested (it takes a page any member hands it, at once), and no route calls it in this PR. Until the session routes land, a removed device still opens a pinned PC that the service keeps the removal from.
  • A PC let in to watch on another PC's word (a vouched PC) has a row that does not record which PC it is. If the list later removes that PC, the row stays until it is revoked here. New vouched joins are held to the list, and checked again in the turn that writes the row.
  • An entry of a later level stops the PC. A pinned PC that comes to an entry this build cannot place lets no account device in until Ovis on it is updated, and says so. No new level may be written before the PCs are updated.
  • Another PC of the account (a vouched join) watches a pinned PC for one session only. Its row has the account's id for the key it showed, the list holds no device under that key, and the row does not record which PC it is, so its later sign-in is refused and it is not taken again while the row stands. Letting the list answer for it needs the row to record the relay key the join proved.
  • A folder of another relay identity is still merged when Step 2 is off. That is main's behaviour (the same line in v0.5.9), not this PR's, and wants a fix of its own.
  • An older Ovis that is already running when the PC pins still holds the version-1 document in memory, and its next write puts it over the pin (one that is started later refuses the file). Stop every older Ovis on the PC before it joins a list; the docs and the changelog fragment say so.
  • A disk that takes no write at all, the mark included, with a stop before it does: the copy on disk is then older than what the PC acted on, and nothing on disk says so.
  • A pinned PC shows list devices as "Device" (it does not open the sealed names yet). The devices the list held at the pin wait for no join hold; a device the list lets in later waits its ten seconds. For a migrated list the docs rule that no row the PC already held gets a hold or a notice (not built here).

Pushes

  1. 9e94612e6: the PR as opened.

  2. This push. It closes:

    • the independent review (1 HIGH, 4 MEDIUM, 4 LOW): its 24 tests are in the branch as server/account/list-pinned-review.contract.test.ts and pass; 11 of them failed on 9e94612e6. H1 (the rule above), M1 (pages), M2 and M3 ("It says so"), M4 (who approves), L2 (this body said every list device waits a hold at the pin: wrong, corrected above), L3 (queued work after a stop), L4 (a copy made for other keys);
    • a second read of the head (8 HIGH by its own count, 2 MEDIUM, 1 LOW), each reproduced by a failing test first: a removal behind the next page; a removal before a stop; a failed removal over an offline restart; the account id inheriting a pairing's role; a second server erasing the pin; a fresh sibling folder; Step 2 off after a removal of the PC; a foreign sibling's pin; a failed floor write; the alarm's retry; the sign-in budget; list_add said as an outage;
    • CodeRabbit's 10 threads: 9 fixed, 1 answered (the pin route is not gated by a flag: see the thread).
    • Mutants: M3 and M18 are pinned by new tests (each checked by removing the guard); M5, M13, M35 by the review's tests. M7 stays masked by the role lookup at the sign-in.
  3. Round 2, this push. It closes a third read of the fix round itself (rulings R2-1 to R2-7), each with a failing test first:

    • a comparison's session opened by a row the list does not hold; sessions under an account's id left open at the pin;
    • the mark said only an hour: it now names what is owed, outlives the copy, and is discharged only by the write that makes it unnecessary;
    • one writer discipline for account-pc.json (a removed binding came back from a second server's memory; the other folder's file was written from an old read; a lock that could not be deleted looped);
    • the sibling folder: adoption is removed in favour of "closed, with the reason". The review's R6 group is rewritten to that rule, and its R6b and R15 are folded into it, so the reviewer's file now holds 24 tests of which 4 are new to this rule;
    • queued work after a stop writes nothing; ovis status --json asks a closed PC why; the pin's id is pinned_list in both answers.
    • Not as ruled: the closed folder's reason does not offer ovis add, because a closed folder takes no add.
  4. Round 3, this push. It closes the last read of round 2 (rulings R3-1 to R3-9, all nine in this push), each with a failing test first:

    • R3-1: the list's check moved into enter, the one place every session passes; the answers file lists every caller with its guard. The screen-confirmed pairing that reuses a row under an account's id opened a session;
    • R3-2: a server that learns of a pin from the file ends its sessions under account ids; one that follows no list closes its account part;
    • R3-3: a read error under the lock aborts the write (only a missing file is "no document"); nothing is written without the lock;
    • R3-4: looking at the file every five seconds reads nothing while it is unchanged, and cancels no approval for a change that is neither the binding nor the pin;
    • R3-5: a removal in the mark keeps every row of the key out, a pairing under its own id too;
    • R3-6 to R3-9: the mark waits for the removal's own record; only a read that reaches the service's head lifts the hold on the others; a closed sibling folder's start writes nothing to either folder (tested on the bytes of every file); nothing makes list keys after a stop, and the key lock's wait ends.

Validation

  • bun run check fast (through the shared queue): green on the pushed head.
  • On the pushed head, one file at a time: every server/account/*.contract.test.ts, server/relay/*.contract.test.ts, server/api.contract.test.ts, server/device-access.contract.test.ts, server/relay-pc-account.contract.test.ts, server/state-merge.test.ts, scripts/plugin-*.contract.test.ts: 75 files, 1404 pass, 0 fail.
  • Older releases against a version-2 file: run in checkouts of v0.5.9 and of main before this PR (module and whole server, Step 2 on and off).
  • Not run: browser regressions (no src/ change), the Windows and macOS jobs.

🤖 Generated with Claude Code

devswha and others added 30 commits November 24, 2026 08:35
The join line of the account's signed list is amended in place, before
anything reads it: its JSON is v, service, account, list, secret, and
list is empty while the account has no list. A line in the earlier
four-member form is refused.

shared/account-list-invite.ts adds what makes an invite a key: the device
makes the P-256 pair and gives the account service the public key alone
(newInvite), and the machine that joins signs ovis-invite-redeem/1 with
the account, its id, its relay key and the challenge id
(inviteRedeemBytes, signInviteRedeem, verifyInviteRedeem).

Vectors: join/ rewritten with the account and nine added, invite/ new.
Nothing outside shared/ imports these files.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The signed list's names (labels, addresses, OS words) go into one
`sealed` kind field that the account service stores and cannot read.
This adds the pure library for it; nothing outside shared/ imports it.

- Member encryption keys: ECDH P-256, non-extractable on a device, a
  stored PKCS8 key on a PC, spelled like every other key of the list.
- Epoch keys, their wrap per member (ephemeral ECDH, HKDF-SHA256,
  AES-256-GCM), the link from an epoch to the one before and the walk
  back with a bound.
- A commitment to each epoch key that the opening entry carries in
  clear: a wrap is public-key encryption, so without it the service
  could hand a new member a key of its own.
- `sealed`: AES-256-GCM bound to the entry's list, seq and epoch, with
  a random nonce.
- Opening is total: what does not open is a result, never a throw.

53 vectors, read by the module, by a second implementation in the test
and by Chromium with a key that cannot be exported.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The kinds layer opens an epoch with an entry of its own after a
removal, so the sealing page and comments no longer say the removal
does. A test pins that a key in the list's PKCS8 form reads as a
stored encryption key.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The join line of the account's signed list is amended in place, before
anything reads it: its JSON is v, service, account, list, secret, and
list is empty while the account has no list. A line in the earlier
four-member form is refused.

shared/account-list-invite.ts adds what makes an invite a key: the device
makes the P-256 pair and gives the account service the public key alone
(newInvite), and the machine that joins signs ovis-invite-redeem/1 with
the account, its id, its relay key and the challenge id
(inviteRedeemBytes, signInviteRedeem, verifyInviteRedeem).

Vectors: join/ rewritten with the account and nine added, invite/ new.
Nothing outside shared/ imports these files.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The commitment is now SHA-256 over its tag, the list id, the epoch and
the key. Epoch 0 is committed to in entry 0, before the list has an
id: 32 zero bytes stand for it there, and the doc says what that
commitment binds. The doc also states the bound of random nonces under
one epoch key against the size of a list, and that a key which does
not match the commitment is a result of its own (`other_key`) that
callers report. Vectors regenerated, five added.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…hey build

shared/account-list.ts says what each kind of entry means, on top of the
entry format and the signers' rule, which are unchanged. It is ported
from the contract's reference implementation and amended for what was
decided since.

Level 1 is nine kinds: genesis, device, pc, invite, join, remove,
carried, card and epoch. A PC that a person added has a signing key and
is a full signer; a PC that joined by an invite is no signer. A newcomer
signs a card for its encryption key before anybody adds it. Names are
sealed, and this layer never opens them: it checks the length and that
the epoch beside them is the current one. carried lets the device that
starts a list for an account in use name who was in it.

The state is plain JSON: devices with power, role, until and encryption
key, PCs by relay key, invites, the keys that are out, the epochs.
takeEntry, replayList, shownList, readListState, rowsNamed, builders for
every kind, and what a caller reads from a state (listView,
admitsDevice, holdsPc, wrapKeys).

Tests over generated histories hold it to: nobody comes in but by a full
signer's entry or the join of an open auto invite, a bound key changes
nothing but its own end, and out is out. Vectors: kinds/ 101, card/ 18,
names/ 22. Nothing outside shared/ imports the file.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…outes, with a tamper mode

The in-memory account service now answers Part D's list routes on the
accounts, sessions and PCs its /v1 routes already hold: the genesis, which
list, the log in pages, wraps, placing a batch at the head (whole or not at
all, compare-and-swap, only entries the shared library takes as counts),
the second lock (a device's claim with its card, a PC's post of its keys
tied to the directory listing, a join only through the PC route of the PC
it names), the mailbox pull's with_list, and the OVIS_LIST_ACCOUNTS-style
switch. Tamper hooks per list let a test make the service lie (inject an
entry, a wrap of its own, withhold a tail, report a head, fork two
readers, cut pages, answer another list, flip a byte, refuse with
head_moved forever, drop wraps) to prove a member survives it.

Co-Authored-By: Claude Opus <[email protected]>
…y, review fixes

After the independent review; no byte of a wrap, a link or a sealed
field changes, and no earlier vector.

- sealFields fills every plaintext up to a multiple of 256 bytes with a
  `pad` field and requires the commitment of the epoch: a key that does
  not give it seals nothing. openSealed drops `pad`.
- walkBack checks the key it starts from against its own epoch's
  commitment and never throws.
- Opening reads a caller's bytes only once their length can be the
  thing's; generated public keys are checked to be keys of the list.
- The doc says who seals and when (only under an epoch opened after the
  last removal), that every attempt makes a new key, what the service
  still learns, how versions and tags go together, and what counts
  toward the nonce bound.
- Six vectors added (an ephemeral X not below p, filled plaintexts);
  the second implementation in the test now reads with its own
  base64url, field form and key prefix.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
… off the switch nothing is spent

Co-Authored-By: Claude Opus <[email protected]>
…hey build

shared/account-list.ts says what each kind of entry means, on top of the
entry format and the signers' rule, which are unchanged. It is ported
from the contract's reference implementation and amended for what was
decided since.

Level 1 is nine kinds: genesis, device, pc, invite, join, remove,
carried, card and epoch. A PC that a person added has a signing key and
is a full signer; a PC that joined by an invite is no signer. A newcomer
signs a card for its encryption key before anybody adds it. Names are
sealed, and this layer never opens them: it checks the length and that
the epoch beside them is the current one. carried lets the device that
starts a list for an account in use name who was in it.

The state is plain JSON: devices with power, role, until and encryption
key, PCs by relay key, invites, the keys that are out, the epochs.
takeEntry, replayList, shownList, readListState, rowsNamed, builders for
every kind, and what a caller reads from a state (listView,
admitsDevice, holdsPc, wrapKeys).

Tests over generated histories hold it to: nobody comes in but by a full
signer's entry or the join of an open auto invite, a bound key changes
nothing but its own end, and out is out. Vectors: kinds/ 101, card/ 18,
names/ 22. Nothing outside shared/ imports the file.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…n build does

Mirrors the service's /v2 routes where Part D's prose left a choice: the
batch is judged entry by entry (holds, counts, then no carried, invites only
from a sign-in, a join by its PC, the list's size), then the second lock,
the wraps and the head at the write; posts are used up like claims, and a
claim is one per key; removals alone spend the first signer's own counter;
a genesis takes any wraps for its own epoch and members; a PC's call off the
switch spends its proof unless no account is named; a missing sign-in is the
unknown route unless every account is named; wraps read gives the latest 256.

Co-Authored-By: Claude Opus <[email protected]>
…n, and gives no private key

After the review of the join line and the invite. No byte of a line or
of a redeem message changes.

readJoinLine is told the account service its caller uses and whether its
caller follows lists, and refuses any other line itself (other_service,
needs_lists), before the secret is given to the runtime. What it gives
back holds no key that signs what a caller hands it: signRedeem signs the
redeem message of the line's own account, and encryptionKey only agrees
on a shared secret. signInviteRedeem takes the read line; newInvite moves
beside the line's writer.

inviteMakeBytes is what a device's key proof signs to make an invite: the
proof for adding a PC, with the invite's public key in it. verifyInviteRedeem
answers false for what is no redeem at all. One base64url helper, the
entry's own, now exported.

Vectors: bytes for the four redeem vectors that lacked them, and files
for the refusals that only unit tests held (a line too long, a private
value out of range, a signature out of range, an invite key off the curve
or in a second spelling, the two refusals for the caller, the make proof).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
… copy

shared/account-list-follower.ts is the pure piece every member runs to
get from the copy it saved, and what the account service or another
member just handed it, to what it holds as true. The service only stores
the log and may withhold, replay or show two members two histories, so
nothing here takes its word for who is in. The entry, the signers and
the kinds are unchanged: every entry is taken by shownList and
replayList.

A member is pinned to one list id, by where the id came from (its own
genesis, the head of the member that allowed it, the entry that adds a
PC, or what a PC let in before the account had a list), and a pin is
one-way. takePage takes one page from the service or a peer and gives
the new copy, who came and went, a verdict from a closed set and the
next request; the result never depends on where pages were cut, and a
head the entries do not reach is never caught up. Another history under
the footing changes nothing, and is an alarm only when the page proves
that a key which was a signer there signed it: the member then keeps
its own history, still takes removals, and lets in nobody it did not
hold when the alarm rose.

Two members compare footings and take the missing entries from each
other, so a removal the service withholds from one reaches it from the
other, and two members on two histories both get the alarm. What a PC
decides (admitsSession, pcOfKey, shownPcs) reads its copy alone. When a
member reads is one function of its copy, its clock and what happened.
The save is one text with a sum, read back whole or not at all by a
replay from entry 0.

Tests over generated histories with a service that injects its own
entries, withholds, replays, forks, cuts pages anywhere, lies about its
head, serves another list and changes single characters. Vectors: save/
22. Nothing outside shared/ imports the file.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
… invite or a browser whose time is over

After the review of the sealing.

sealEpoch(state) is the one place that says whether a writer may seal an
entry's names and under which epoch: the current one, and only when it
was opened after the last entry that put a key out. Otherwise the writer
seals nothing.

wrapKeys(state, now) leaves out a device past its until and an invite
past its exp, by the caller's clock: an old line or a borrowed browser
is given no later key. The clock chooses only whom a key is wrapped to.

readNames passes by a field named pad, as it does any field it does not
know.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…dPurpose gains list-genesis and list-claim

The mirrored challenge route, challenge store and proof check go: a genesis
and a claim now ask the fake's own provedKey (POST /v1/pcs/challenge,
pcAddSigningBytes) with the list id in the place of the server_id and the
claimed key, or nothing, in the place of the listing.

Co-Authored-By: Claude Opus <[email protected]>
… a PC

cardBinding is SHA-256 over a card's bytes: what the committed comparison
of shared/relay-pair-sas.ts is bound to when a PC is added with a number
on two screens. Each card vector in form carries it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ich signs nothing a caller composes

The line that was read gains two closures beside signRedeem: signJoin
signs only the body of a join of the line's own key on the line's own
list that adds no key and ends none, and signRead only the proof for
reading that list with that key. Both judge the bytes they sign.

joinEntry is what a PC calls: it hands over its own signing key pair,
encryption key and relay key and where the entry stands; the card and
the body are made here. So a PC cannot be made to sign a join that
somebody else composed. signReadProof takes the line; the key and the
list are the line's.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…all or nothing

Rulings from the review of the kinds layer, on the follower's side.

A member's clock counts for no less than it showed before: each page and
each hint is taken at the hour the caller hands over, the copy keeps the
latest as seen_at, and admitsSession judges a device's until by
memberClock. A clock that was set back lets nobody in past its until.

A PC that was in the account before the list follows a list only when it
had let in the first signer and every device the list carries in. A
carried key is a full signer, so narrowing who is let in one by one kept
nothing out: not_held_before is gone, and such a PC lets nobody in.

shownDevices and admittedDevices list who is in and who a PC lets in
now, so no caller repeats the alarm's hold-back. The save has one more
member, seen_at; the vectors are written again (23).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…code with the module

Four vectors written once by a Python script (hashlib and the
`cryptography` library): a wrap with its commitment, a wrap of epoch 0
with the commitment that has no list id, a link and a filled sealed
field. The same script read every other vector and gave its expect.
The doc says how they were made, and what `other_key` means from a wrap
and from a link.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
devswha and others added 18 commits November 24, 2026 21:44
…n on disk; a list's removal and a foreign folder at a start

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ws could not be written

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…es the take for a list account

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ned PC; sessions under an account id end at the pin

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…a sibling folder never takes a pin

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…is owed; one writer discipline for the binding's file; a sibling folder takes no pin; no session by the row of a comparison

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…lder pinned a moment ago

Co-Authored-By: Claude Fable 5.2 <[email protected]>
… is in one place, inside enter

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…no work without the lock; the refresh reads nothing while the file is unchanged

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ons under account ids; one that follows no list closes its account part; an owed removal covers every row of the key

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…a read to the service's head lifts the hold; nothing makes keys after a stop; the key lock's wait ends

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…one place for a row under an account's id; a second server that learns of a pin; the lock and the refresh; what the mark covers

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@devswha

devswha commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Reviews that stand in for CodeRabbit on this head (a06e9bf)

CodeRabbit reviewed 68f0fee (its 10 threads are answered and resolved) and did not review the two heads after it. This PR changes who can open a PC, so these reviews stand in:

  • One independent adversarial review (a reviewer that did not write the PR; 1 HIGH, 4 MEDIUM, 4 LOW; 24 tests). All 24 tests are in the branch and pass; every finding was closed with a failing test first.
  • Three independent read-throughs by a second model, one per fix round. Each finding was reproduced as a failing test before its fix, or answered with the guard that stops it.

The last read (of 6b0578c) and how each finding was closed in c6262e0

finding closure
A row under the account's id for a key reached a session by paths other than the digits comparison (a pairing confirmed on the PC's screen that reuses such a row) The list's check is in ONE place, inside the relay session's enter(): on a pinned PC such a row opens a session only as the list says and only for a key the session proved. Every caller of enter() is listed with its guard in the PR body. Tests in list-pinned.contract.test.ts and pair-sas.contract.test.ts.
A second Ovis server on the same state folder kept its sessions and its old rules after the first one pinned A server that learns of a pin, whoever wrote it, ends its sessions under account ids (auth_changed); a server that follows no list closes its account part and says why. list-pinned-review.contract.test.ts, pc-binding.test.ts.
A read error under the binding's lock was taken for "no document", and work could run without the lock Only ENOENT means no document; any other read or parse failure aborts the write; a lock that cannot be made is an error. pc-binding.test.ts.
The 5-second look at the file read and parsed it every time, and a listing_id written by another server withdrew a pending approval on a PC with no list The look compares the file's mtime, size and inode first and reads nothing while it is unchanged; listeners hear only another binding or a pin. pc-binding.test.ts.
A removal the PC acted on but had only in its mark covered the list's access, not a pairing of the same key under its own id stale() asks the mark: every row of the key is out. list-pinned.contract.test.ts.
The mark for a removal was dropped before the removal's own record was on disk; a refused page counted as a whole read; a closed sibling folder still wrote a merge record; keys could be made after stop() All four closed, tests in list-follow.test.ts, list-pinned-review.contract.test.ts, list-keys.test.ts.

The maintainer's lead session read the first five closures in the diff before merging. No further read was run on c6262e0.

Known limit (in docs/account.md and the changelog fragment)

An older Ovis that is ALREADY RUNNING on the same folder can write its old-format file over a pin; one started later refuses the file. Stop older Ovis on a PC before it joins a list.

Nothing in a released build pins a PC yet: the callers of the pin ship with the PC's join step and the app's list steps.

@devswha
devswha merged commit c3361ac into main Nov 24, 2026
22 of 23 checks passed
@devswha

devswha commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Merged through pr-merge at head a06e9bfd7. 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 said it did not review (a limit or a skip) since this head.

CHANGES WHO CAN OPEN A PC. From this PR on, a PC that is pinned to its account's signed list lets a device of the account in only as the list says: a session under the account's id for a key opens with the list's role or not at all, and ends when the list removes the key; only a pairing made at the PC under an id of its own keeps its own role. Nothing pins a PC yet in a released build (the pin's callers ship with P7 and the app's P11/P11b), so no installed PC changes behaviour by this merge.
Reviews: one independent adversarial review (Opus; 24 tests, all in the branch) and three Codex Astra reads; every finding has a red test first, listed per finding in the PR body and the lane's answers file. Round 3 (the last read): the list's check is in one place inside the relay session's enter(), with every caller listed; a second Ovis on the folder that learns of a pin closes its account-id sessions, and one that follows no list closes its account part; a read error under the binding's lock aborts the write and nothing is written without the lock; the 5-second look reads nothing while the file is unchanged; an owed removal covers every row of the key. The lead read R3-1 to R3-5 in the diff at c6262e0; no further Codex round was run on round 3.
Known limit, in docs/account.md and the changelog fragment: an older Ovis that is ALREADY RUNNING on the same folder can write its old-format file over a pin; an older one started later refuses the file. Stop older Ovis on a PC before it joins a list.

@devswha
devswha deleted the feat/account-list-pc-enforce branch November 24, 2026 18:39
devswha added a commit that referenced this pull request Nov 24, 2026
… the account's signed list (#4625)

## What

A PC that a person added to its account's signed list can let a new
device into the list itself, and a device of the list can allow one on
such a PC from its own app. This is the PC's half of the Allow (the wire
is Part E6 of the list's formats; the app's half is the client lane's).

**From the PC itself.** The Allow in the PC's own window, and the digits
typed at `ovis approve`, sign the new device's `device` entry with the
PC's own list key and place it at the account service. The service
places it only while a sign-in of the account has claimed that device's
key, so a PC alone, or whoever drives it, lets in nobody. The device is
in once the PC's own copy shows the entry, never on the service's
answer.

**From a device of the list.** On a pinned PC, a device signed in with
the key the list holds for it sees the joins into the list that wait
there, hears of them on its own socket, and decides one, only when the
list holds it to drive with full power (what may add a device to the
list may approve its join). The PC signs nothing on such an approval:
the member signs the entry, and the PC lets the newcomer in when its
copy holds it.

**A PC that follows no list answers and tells what main does**, byte for
byte: no new member in a waiting pairing, no second event, the same
refusal codes.

## The wire

- Feature `account-list-allow-1`. `PAIR_REQUEST` gains `list_enc` and
`list_card` (both or neither); a PC that did not select the feature
ignores them and takes the frame as before, so a PC with no list and an
app that sends them still pair. `PAIR_CHALLENGE` gains `list`; `AUTH_OK`
gains `list: { id, seq, hash }`, the place of the newcomer's own entry.
- The session of a list join carries that receipt and serves nothing
else: every call answers 403 `sign_in_required`, and the device signs in
with its list key afterwards. The receipt goes by the list's answer,
whatever row this PC holds for the key: a row under the account's id
with another role, or a pairing under an id of its own (the device then
signs in by its list key over that pairing's row).
- When no entry lets the device in, the join ends `auth_failed` with a
cause in `message`: `list_not_claimed`, `list_service_away`,
`list_head_lost`, `list_not_in`, `list_pc_behind`, else `list_refused`.
No pairing of the PC's own stands in for the list.
- `GET /api/relay/pairings` and `POST /api/relay/pairing` for a device
of the list: the joins into the list (`list: true`), a first join too,
never a join that brought no card nor one asked under the PC's own
add-me screen. A device the list holds to watch, or with bound power,
gets 403 `list_cannot_allow`. The right is read from the PC's copy at
each call.
- The same device hears `remote-pairings` on its own `/ws`, beside the
PC's roster. The right is asked again at every telling and when the list
changes what it lets in, for a member of the PC's own devices too: a
subscriber that lost it (the PC pinned a list that holds its key to
watch, say) is told once that nothing waits.
- **The member signs only after the new device confirmed.** A waiting
join into the list says `confirmed: true` (and the `remote-pairings`
event is sent again) once the new device's `PAIR_CONFIRM` arrived, so a
device that gives up before that is nobody's member. An approval from
afar that comes before it is refused, **409 `not_confirmed`**, and the
join waits as it did. From the moment approval and confirm are both in,
the PC waits 30 seconds for the member's entry (it asks the service
every 3 seconds, takes a page a device hands over at once, and at the
end asks once more with a read begun when the 30 seconds are over),
outside its read queue.
- `GET /api/relay/joins` marks a list join `list`, and `list_behind` on
a PC whose Ovis is older than what a member wrote into the list. `ovis
approve`, and the terminal that watches after `ovis add`, then say that
the approval was received, or that Ovis on this PC needs an update;
never "let in", for a first join and a later one alike.
- `POST /api/account/introduce` takes `list`, and `GET
/api/account/introduction` answers `{ pcs, list? }`, on a PC that
follows no list (E6's case 2).
- `GET /api/account/list` has `behind`.

## Rules it holds

- **One signature per place.** The signed request is kept beside the
PC's copy (`account-list-allow.json`, 0600, created and never written
over) until the copy is past the head it was signed on. Another Allow at
that head (of the same device, or of another: the kept one goes first),
one after a restart, and another Ovis on the same state folder send
those very bytes and sign nothing else there. An entry that cannot be
kept is not sent.
- **An answer that does not say whether the entry was placed is no
refusal**: a lost answer and a 5xx of a gateway are reconciled against
the log before the device is answered, and told as "the service is
away", not as a lost place.
- **What the PC signs goes by its own clock as it reads now**, held
against the list's own time only (`issued_at` is never before the entry
it follows). The hour the PC saved lets in and refuses, and signs
nothing; the account service's clock is never read.
- **A PC that is behind signs nobody in** (a member wrote what this Ovis
is too old to read): it says so, and a device of the account can still
allow the newcomer.
- The PC signs only for a person at the PC: an approval from another
browser that drives it, and a member's approval, sign nothing here.
- What the PC itself holds against the key, its own place in the
account, and whether its copy still lets it sign (no alarm, nothing it
cannot read) are asked before each submission and once more **when its
proof to the service is made, right before the entry leaves the PC**.
- **Another PC of the account** (a vouched join) records the relay key
its join proved on its row (`vouched_pc`). On a pinned PC the list
answers for it by that key: it is let in to watch while the list holds
that PC, at its comparison and at every later sign-in, and is put out
when the list removes it. This closes the limit #4607 stated.

## Release order (rule E5)

This ships in one release with the next step of this lane (the two
session routes a device hands entries over, `POST
/api/account/list/head` and `/page`) and with the app that signs in with
its list key. Until that step is in, a removal, and a member's new
entry, reach a pinned PC through the account service's log only. Nothing
here makes a PC pin.

## Reviews, and what this push answers

- An independent adversarial review (0 HIGH, 3 MEDIUM, 2 LOW traced; 3
untraced) and a second read of the step. Every traced finding is fixed
with a failing test first, and the review's own 16 tests are in the
suite (`server/account/list-allow-review.contract.test.ts`). The two
untraced ones that reproduce are fixed (a restart and two servers on one
folder; a member of the PC's own devices that kept hearing the joins).
- CodeRabbit's 13 threads: 12 fixed, 1 answered without a change (the
carrier's deadline: a join with a card never waits for the listing's
verdict, and `placing` is set in the same turn as `verifying`).

## Choices in this push, for the maintainer

- A refusal the account service NAMES (a 4xx with a code,
`list_stopped`) forgets the kept request: the service said it placed
nothing, and otherwise one refused card would hold back every later
Allow at that head.
- A kept request that cannot be read refuses every Allow of this PC
(`list_refused`) until a person removes the file: what the PC signed is
then not known.
- While the kept entry is one of a device this PC has since come to hold
back, an Allow of another device at that head is refused until the head
moves: the kept one may not go out, and signing another there would be a
second signature.

## Not covered

- `ovis approve` says "approval received" for a list join and does not
wait for the read-back before it ends.
- The carrier's longer deadline during a placement is tested through the
session's `placing` flag only, not the carrier's own timer.
- A PC whose own key cannot sign (it joined by an invite) still shows a
join as one it can approve in its own window; such a PC does not exist
before the next step, which owns that hint.
- A row of another PC of the account made before `vouched_pc` was
recorded names no PC, and opens nothing on a pinned PC: that PC compares
again.
- Two small fixes have no test of their own: `Retry-After` waits are
capped at 10 s; a placement wait holds no queue.

## Validation

- `bun run check fast` (through the shared queue) on the pushed tree:
green, 26693 pass, 0 fail.
- The integration suite as CI runs it (`bun run test:integration`, in a
herdr test session of its own) on the pushed head c450a89: 164 files,
2530 pass, 6 fail, all in two files that reach this PC's own running
herdr and are stopped by the tests' guard against it
(`server/machine-profile-api.contract.test.ts`;
`server/account/step2-upgrade-crash.contract.test.ts`, whose child
process answers `live_herdr_refused`). Neither is touched here, and both
passed in CI on the previous head. The first push was red in CI's
Integration lane for a test of this PR
(`server/own-window.contract.test.ts`: the in-process decision of an
own-window approval now carries `own: true`); it is fixed here.
- Not run: browser regressions (no `src/` change), the Windows and macOS
jobs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.2 <[email protected]>
devswha added a commit that referenced this pull request Nov 24, 2026
…the list, and a member approves it there (#4635)

## Who gets into an account, and how

Before this change, a new device of an account that keeps a signed list
could not join through a PC
that lets devices in by that list (a pinned PC, #4607, #4625): it came
with no card, so the PC made
a pairing of its own that opens nothing, and the device was never in the
list. A device of the
account could not approve such a join from its own app either.

After it:
- A new device joins a pinned PC **only by an entry of the list**,
signed by a member of the list
(or by the PC itself, from its own window) **after its own person said
the numbers match**. A
  device that gives up before that is nobody's member.
- The device is handed its place in the list by the PC, follows the list
from there, and opens the
PC with the key the list holds for it. Nothing of the PC's own pairing
stands in for the list.
- A member signs only for a device the PC says confirmed, and sends
nothing more for a device its
own copy shows put out meanwhile, or under another member key than the
one it began with.
- Joins on PCs that follow no list, and accounts with no list, go
exactly as before: the same
  frames, deadlines and words.

## What

The app's half of joining an account through a PC that lets devices in
by the account's signed
list (a pinned PC), for the new device and for the device of the account
that approves it.

- **The new device brings its card** (`shared/relay-channel.ts`
`listCard`, `shell.tsx`,
`accountController.ts`). A device that waits to be let into its
account's list, its claim of its
key standing, offers `account-list-allow-1` with a join of the account.
To a PC that selects
it, and to no other, its `PAIR_REQUEST` carries `list_enc` and
`list_card`.
The claim is read for the join: the app reads its list first (which
makes the claim again where
it is due) and brings the card only where that read shows the claim for
the sign-in and the key
the join signs with; a view drawn before the page slept decides nothing.
- **It stops early at another list.** The PC's `PAIR_CHALLENGE` names
the list it follows. Where
that is not the list the card is for, the attempt ends before any digits
are shown.
- **Its person presses "The numbers match".** A member signs the device
in on that word, so a join
the PC took the card for is never confirmed by itself: also the sheet a
PC's own page put up, and
a first join's challenge (`approve_on`), keep the number with the press
until it is made. Any
  other join is as before.
- **It is handed its place** (`listPlace`). The `AUTH_OK` of a join the
PC allowed names the list
and the place of the entry that let the device in. The device takes a
place only from a PC that
took its card, and only in the list the card names, and follows the list
from there by its own
read of the log. A PC that took the card and names no place is refused
(`auth_failed`,
`list_refused`) before anything is saved. No pairing is saved: that
session serves nothing
else, so the app closes it at once and opens the PC anew with the key
the list holds (the front
page, where the place could not be taken). The place is kept for the
account the card was made
for alone, also where the sign-in ended or moved meanwhile: a sign-in to
that account again takes it
up. A join that brought the card waits the comparison's 90 seconds and
then up to the PC's own 90
for its entry, and meanwhile sends the relay's own keepalive every
minute (the relay closes a socket
  that sent nothing for two minutes; no PC sees it).
- **When no entry lets it in**, the PC ends the join and names the
cause, which the app says in
words of its own: no sign-in of the account claimed the key, the entry
could not be placed in
time, a device of the account approved and the PC did not see the entry
in time (the words say
what the PC saw, never that the list did not take it), Ovis on the PC is
older than the list,
  or anything else.
- **A device of the account that approves on such a PC signs only for a
device that confirmed**
(`join.ts` `approveForAccount`, `AccountApprovalPrompt.tsx`). The PC
signs nothing on that
approval and lets the device in only by an entry of the list, which the
approver signs. The
order built: for a join the PC marks `list`, the card holds **Approve**
until the PC says that
the new device's person pressed **The numbers match** (`confirmed`), and
says what to press
there; then the approval, and right after it the entry, signed, placed
and handed to the PC.
A device that gives up before its confirm is nobody's member. Nothing is
approved where the
approver cannot write its list. Where the list does not take the device
after the approval, a
card says why ("<device> is not in your account": such a PC made no
pairing, so never "added to
  <PC> only") and **Try again** signs it in.
- **Nothing more for a device put out meanwhile** (`join.ts`
`holdsStill`). On any PC, before the
introduction that names the account's PCs and again before the old `add`
is signed, the
approver's own copy must still hold the new device as in, in the list
and under the member key
  the approval began with; otherwise nothing more is sent.

- **Its relay socket stays open for the whole wait.** A join that
brought its card may wait longer
than the relay keeps a silent socket (two minutes): it sends the relay's
own keepalive every
  minute meanwhile, which the relay answers itself and no PC ever sees.
- **A join with no card on a pinned PC** is that PC's own pairing, which
no device is told was
confirmed: the approver's card says to approve it on that PC's own
screen.
- **The member's introduction names the place in both cases** (formats
E6); a pinned PC drops it.

Strings in en, ko, ja and zh.

## Release order (E5)

A new device of a list account can join a pinned PC only with this
change, and a device of the
account can approve one there only with it. It ships in the same release
as the PC's join step
(#4630, the change that lets a PC join a list and pin it by a person's
act), never after it.

## Reviews (both closed)

- **An independent adversarial review** of the app's join step
(`review-client-p11b.md`): 0 HIGH,
2 MEDIUM, 2 LOW traced, 3 untraced. All four traced findings are fixed
here, each with the test
that failed first; its test file is in the suite as
`src/lib/relay/review-client-p11b.test.ts`
(its four findings and its thirteen guards pass). The untraced three are
answered: a join with no
card on a pinned PC is shown confirmed to nobody
(`listJoin.contract.test.ts` pins it against a
real pinned PC), and the other two are by design. The three tests that
killed mutants only by
hanging now fail within a second (the approval tests' pause moves their
clock).
- **A Codex read** of the same step (`astra-cl11j.md`): 1 HIGH, 7
MEDIUM, 1 LOW. All fixed here,
each with a failing test first, except the LOW (the account controller's
`dispose` and the list
  follower), which #4622 fixed.

## Not in this PR

- The page a member hands over is taken by a pinned PC from a device's
session only with the PC's
join step (#4630). Until then the approver's hand-over is refused there,
and the PC reads the
entry from the account service within its half minute. Checked locally
with #4630's branch
merged in: the page is handed (`/api/account/list/head`, then
`/api/account/list/page` answers
  `caught_up` at the new device's entry).
- A device approved while its PC was away from the account service is
told that the PC did not
  see its entry in time, and asks again.

## Validation

- `bun run check fast` on the pushed head (origin/main 7c9db5e merged
in, CodeRabbit's threads
answered): 26907 pass, 0 fail. `src/lib/relay/listJoin.contract.test.ts`
on it: 5 pass.
- On b258554 (before the merges of main, #4633 and the fixes for
CodeRabbit's review):
- the integration suite as CI runs it (`bun run check integration`, 4
shards, in the CI runner
image): 2566 pass, 0 fail, 129 skip in 167 files,
`src/lib/relay/listJoin.contract.test.ts`
included. That file puts the app's own channel against a real pinned PC
session with the
account service in memory: a person at the PC allows a new device; a
device of the account
approves one (nothing until the new device confirmed, then the approval
and the entry it
signs); a key no sign-in claimed is told so; a card for another list
stops before any digits;
    a join with no card is shown confirmed to nobody.
- Browser regressions in the CI runner image, each through `bun run
check run`, all passing:
`relay-second-device-join-regression`, `relay-join-browser-qa`,
`relay-shell-browser-qa`,
`my-pcs-ways-regression`, `relay-account-pcs-regression`,
`relay-first-link-regression`,
    `relay-new-pc-press-regression`, `account-list-device-browser-qa`,
`usage-account-management-regression`, `add-pc-more-relay-regression`,
`relay-e2e-regression`,
`offline-typing-relay-regression`, `pc-add-guidance-regression`. None
has a pinned PC: they show
that a join and an approval on a PC that follows no list go as before.
- Screenshots at 390 wide, light, English and Korean, from pages built
from the components: the
approval card with **Approve** held and the line that says what to
press, and with the device
confirmed; the new device's sheet waiting for **The numbers match**; its
`list_not_in` failure;
  the approver's card for a device that is not in the account.
- Not run locally: `bun run check full`, the Windows and macOS jobs.

🤖 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