You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(shared): the join line names the account, and an invite is a key - #4556
The join line of the account's signed list now names the account, and an invite is a key. Both are
libraries in shared/; nothing in the server or the app calls them yet, so no behaviour changes.
The join line carries the account.ovis-join:1: is amended in place: its JSON is {"v":1,"service":…,"account":…,"list":…,"secret":…}, and list is empty while the account has
no list. No released build reads or writes a join line, so there is one form and one version; a
line in the earlier four-member form is refused (members). readJoinLine gives account and list (null for none); writeJoinLine takes them. New refusal reason: account.
An invite is a key (shared/account-list-invite.ts). The device that makes an invite makes a
P-256 key pair, gives the account service the public key alone and writes the line
(newInvite). The machine that joins proves it holds the line by a signature over ovis-invite-redeem/1 and the length-prefixed account, machine id, relay key and challenge id
(inviteRedeemBytes, signInviteRedeem, verifyInviteRedeem). The account service never holds
the private key or the line, so it cannot use an invite or sign for one.
docs/account-list.md describes the line, the invite and the redeem signature.
Vectors: shared/account-list-vectors/join/ (45) and shared/account-list-vectors/invite/ (19).
Two pieces of work that are not released yet, the account service's PC invites and ovis join,
move onto the list's formats before they ship, so there is never a second invite format: the line a
person pastes today is the line that will sign the list's invite and join entries later. With a
key instead of a shared secret, a breached account service cannot redeem an invite.
Validation
bun test shared/account-list-join.test.ts shared/account-list-invite.test.ts shared/account-list-entry.test.ts --timeout 60000:
253 pass, 0 fail.
An independent reader written separately (Python, cryptography) agrees with all 45 join vectors
(the two refusals for the caller among them) and all 19 invite vectors (the line's public key, the
signed bytes, each verdict, the make proof).
bun run check fast: exit 0, on the head with main merged in.
Skipped: the integration and browser suites (nothing outside shared/ imports these files).
After the review (second commit; no byte of a line or of a redeem message changed)
readJoinLine(line, { service, followsLists }) refuses a line for another account service
(other_service) and, for a caller that follows no lists, a line that names a list
(needs_lists), itself.
A line that was read gives no private key: signRedeem signs the redeem message of the line's
own account, encryptionKey only agrees on a shared secret. signInviteRedeem(line, { server_id, public_key, challenge_id }); newInvite is now in shared/account-list-join.ts.
inviteMakeBytes: what a device's key proof signs to make an invite, with the invite's public
key in it.
verifyInviteRedeem answers false for what is no redeem at all; one base64url helper
(canonicalBase64Url, exported from the entry's file: an export, no other change there).
Vectors: bytes for the four redeem vectors that lacked them; new files for a line too long, a
private value of 0 and of n, a signature with s = 0, r = n, s = n, an invite key off the curve
and in a second spelling, the reader's two refusals, the make proof. Join 45, invite 19.
Known limits
The line needs an https service origin, as before: a PC whose account service is plain http
(a local test service) cannot use join lines.
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]>
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
Join lines now include an account ID and can represent an optional list.
Added invite creation and redemption signature support.
Documentation
Added guidance on join-line formats, invite redemption, validation rules, and test examples.
Tests
Expanded coverage for account validation, optional lists, invite signatures, and malformed inputs.
The shared account-list join-line format now includes an account ID and supports entries without a list. New invite helpers create join lines and encode, sign, and verify redemption messages. Tests, vectors, and documentation cover the updated formats and validation cases.
Changes: Account-list join and invite flow
Layer / File(s)
Summary
Join-line account and optional-list format shared/account-list-join.ts, shared/account-list-join.test.ts, shared/account-list-vectors/join/*
Join lines now include a validated account ID and represent an absent list as null in the parsed result. Tests and vectors cover serialization, parsing, validation, and length limits.
Invite creation and redemption signatures shared/account-list-invite.ts, shared/account-list-invite.test.ts, shared/account-list-vectors/invite/*, docs/account-list.md
New helpers create invite lines and construct, sign, and verify redemption messages. Tests, vectors, and documentation describe valid inputs and rejection cases.
devswha/ovis#3996 — The issue describes the shared signed device-list library’s join-line step, which this change implements and documents.
Possibly related PRs
devswha/ovis#4103 — This change updates the join-line reader, writer, and test vectors introduced by that PR.
devswha/ovis#4549 — That PR’s invite confirmation and redemption flow uses the invite line contract addressed here.
Merge Risk: Minimal · previous review 6a7e9
This change updates the shared join-line format and adds invite helpers that nothing else imports yet, so current behavior is unchanged. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main changes: the join line now carries the account, and an invite is a key. Both match the changeset and the PR objectives. The title is a single sentence and is specific enou…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description follows the template's Change and Validation sections. Change explains the join-line format change, the new invite library, and the docs and vectors. It links the issue with 'Refs #399…
Full details: Title check
Explanation
The title names the two main changes: the join line now carries the account, and an invite is a key. Both match the changeset and the PR objectives. The title is a single sentence and is specific enough for a reader scanning history. It does not cover the vectors or the docs, which is expected.
Full details: Description check
Explanation
The description follows the template's Change and Validation sections. Change explains the join-line format change, the new invite library, and the docs and vectors. It links the issue with 'Refs #3996'. Validation lists the commands run, their results, and the skipped suites. The Why and Known limits sections go beyond the template. The Change section has a clear problem and resulting behaviour. Two points are unclear: the Validation section gives test counts (253 pass) and vector counts (45 and 19) that differ from the PR objectives' counts (102 passes, 37 join vectors, 12 invite vectors), and the description does not say which validation ran after the second commit. The description also does not name the issue that a maintainer agreed to, as the template asks for features; it gives only 'Refs #3996'.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Fix failing CI checks
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.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.
…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]>
Merged through pr-merge at head d1ed6b1af. 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.
Independent Opus review of the join line and the invite key at 6a7e902: no flaw in the bytes (an independent Python reader agrees with every vector; ten strictness mutations all caught); its one MEDIUM (the reader refuses a line for another account service, or with a list on a build that follows none, itself; callers get purpose-bound signing and ECDH capabilities, never a raw key) and L1-L6 fixed in d1ed6b1, closure read by the lead. No caller yet: no behaviour change.
Merged without a CodeRabbit review of the final head (it reviewed the first head with no actionable comments).
Review that stood in: an independent code-review agent read the formats at 6a7e902 (strict parsing of the line, the key's canonical form, domain separation of the redeem proof from every other signed message, binding and replay, the vectors). No flaw in the bytes: a separate Python reader and verifier written from the docs alone agreed with every vector, Node's WebCrypto agreed, and ten strictness mutations were all caught by the tests. Findings and how each was resolved (d1ed6b1, bytes unchanged):
MEDIUM: the two caller rules (act only on a line for this build's own account service; refuse a line that names a list on a build that follows none) lived only in callers, and forgetting the second fails open. Fixed: readJoinLine(line, { service, followsLists }) refuses both itself, and the result carries no private key: purpose-bound signRedeem and a non-extractable ECDH key instead.
LOW: bytes added to four redeem vectors; vector files for refusal classes only unit tests covered; the docs say how service is compared and what the account service learns at a redeem; verifyInviteRedeem never throws; one base64url helper (the only change to the entry file is the word export).
Nothing imports these files yet, so there is no behaviour change.
… (the join line); ovis status --json (#4549)
## What
`ovis join`: a new PC joins an Ovis account with a single-use invite
that a device signed in to the account made, with no sign-in on the PC.
It is built for a person at a new PC and for an agent setting one up
over SSH.
**Stacked on #4556** (head d1ed6b1: the signed list's join line names
the account, an invite is a key, and the line's reader refuses what its
caller must not act on). This PR is the one commit on top of it; merge
it after #4556.
- **The invite** is the signed list's join line (`ovis-join:1:`), read
with `readJoinLine`. It can come from `--invite-file <path>` (a regular
file only, read up to 4 KiB without blocking, so a FIFO or a device is
refused at once), from `-` (stdin), from `OVIS_INVITE`, or from argv.
Argv is accepted, but the help and docs name the file and stdin forms
first, because argv shows in the process list and lands in shell
history.
- **Checks before any request**: the line is read with
`readJoinLine(line, { service: <this PC's account service>,
followsLists: false })`, so the reader itself refuses a line for another
account service (`other_service`, exit 3) and one that names a list
(`needs_lists`, "needs a newer Ovis", exit 11), both with nothing sent.
The line never leaves the PC. It is not printed, logged, written or
sent; the redeem carries the invite's public key and the line's own
`signRedeem` over its account, this PC's ID and relay key, and that
request's challenge, made again for every try (no private key is ever
held by the command).
- **Confirmation before anything is sent**: at a terminal the command
names the invite's account and asks for a typed `yes`, as `ovis add`
does. `--account` takes the full id or its first 12 characters or more,
as `ovis add --account` does. A mismatch sends nothing at all and does
not name the invite's account. With no terminal, or with `--json`,
`--account` is required. Under the fleet preview it asks at a terminal
even with `--account`, as `add` does. Already in that account: exit 0
and the invite stays unused. In another account: refused, naming `ovis
logout`.
- **Redeem, then `ovis add`'s own path**: the relay comes on, the PC
builds the listing `ovis add` would make, proves itself with its own key
(`/api/account/pc-proof`), and calls `POST /v1/pc-invites/redeem`. It
then names the account for the relay pass and hands over to
`addByPress`, the same one-press wait and bind (no second admission
path). A plain invite waits while the service's `card_until` says the
card offers Add, counted on the service's clock, and asks once more as
that ends. An auto invite asks a few times. `addByPress` gained options
for this (`words`, `report`, `until`, `noneTries`, `askBeforeUnlist`,
`stopFast`); `ovis add`'s behaviour and text are unchanged, and all its
tests pass.
- **An answer that does not come, or comes unreadable** (a drop, a
timeout, a proxy's 5xx, an unparsable 200) may hide a listing the
service made. The redeem is asked again (the same PC and key get the
same 200); if the outcome is still unknown, the PC leaves the list by
its own proof and says the invite may be spent.
- **A run that ends unbound** (Ctrl+C, the card's time, an auto
admission that is not there, a refusal, an internal error) leaves the
account's list by its own proof (`POST /v1/pcs/{id}/leave`) and says so,
or says what to do. It closes the approve-here window, puts back the
account named for the relay pass, and turns off a relay it turned on. On
Ctrl+C it leaves first, inside the 10 s a stopped run has, after a 1 s
local read so a PC that just bound is not taken off, and still prints
its JSON object.
- **`--json`** prints one object on stdout whatever ends the run
(`internal`, exit 15, for its own errors), and everything else on
stderr. Exit codes, one per error name, are in `docs/relay.md` and `ovis
join --help`:
- 0 ok
- 1 `not_added` / `stopped`
- 2 `usage`
- 3 `invite_invalid`
- 4 `not_confirmed`
- 5 `account_mismatch`
- 6 `other_account`
- 7 `rate_limited`
- 8 `pc_add_cap`
- 9 `directory_full`
- 10 `service_unreachable`
- 11 `not_available`
- 12 `relay_unavailable`
- 13 `not_running`
- 14 `no_add`
- 15 `internal`
- **`ovis status --json`**: `{ version, running, server_id, relay: { on,
connected, phase } | null, account, account_known, waiting_for_add }`,
with no token, key or e-mail.
- **PC server, read-only for the own window except one write**:
- `server_id` and `relay_account` on `GET /api/relay`, for this PC's own
window and CLI only.
- `waiting_for_add` (a boolean) on `GET /api/account/status`.
- `{ "account": null }` on `POST /api/account/relay-account`, over a
direct connection only and only on a PC in no account (409 `in_account`
otherwise), forgets the named account.
- One press answers `409 listing_expired` when the service says a plain
invite's card ran out.
- **Test account service**: the invite routes per the final shapes.
Making takes `invite_key` and answers `{ id, account, expires_at, auto
}` with 409 `invite_key_used`, and refuses an auto invite with 429
`pc_add_cap` while the day's cap is full. Redeem takes `invite_key` +
`invite_signature`, checks the signature against the invite's own
account, and answers `card_until` and `admission_until`, the same for
every rerun. An invite and its auto admission live with the sign-in that
made it, as the account service does: after a sign-out an unused invite
redeems nothing, an untaken admission ends (`no_admission`, the listing
stays confirmed), and a rerun answers the same listing with
`admission_until` null.
- **Fix to `ovis add`, found while reviewing the installers**: `ovis add
--account A` on a PC already in account B returned 0 with "This PC is
already in an Ovis account (B)", so a scripted `--add --account A` (and
the installers' `--add --account` / `-Add -Account`) reported success
for the wrong account. It now exits 1 with "This PC is in another Ovis
account (B's start). Run ovis logout to take it out of that one first,
then run ovis add again."; the same account (its full id or 12-character
start) still ends with 0. `ovis join`'s other-account refusal (exit 6)
uses the same words.
## Why
The owner wants what a competing tool has: a signed-in device makes a
one-time invite, and the new PC (or an agent over SSH) runs one command
with it. The confirmation keeps an invite someone else handed over from
attaching this PC, and a terminal on it, to their account without the
person at the PC seeing which account it is.
## Validation
- `bun run check fast` (via `dori heavy join`): green on 0665a0b
(workflow syntax, generated files, typecheck, build, unit tests: 25157
pass, 0 fail)
- `scripts/plugin-join.test.ts` (34 tests), covering:
- every input form and the file reader (FIFO, folder, device, cap)
- grammar and service/list refusals with nothing sent, and nothing of
the line in output or in any request body
- the question and what was sent before it, `--account` by its start,
the mismatch naming no account, `--json` and preview asking rules
- plain and auto adds; the timeout, Ctrl+C and Ctrl+C during the redeem
request all leaving
- a lost redeem answer followed by the same 200; an unclear outcome
leaving; the service answering for another account
- auto retries and the auto leave; putting back the relay and the named
account; the last-second Add
- the service's `card_until`, every refusal's exit code and JSON, fresh
challenges per retry, internal errors as one object
- `scripts/plugin-join.contract.test.ts` (5, real server and state
folder):
- plain invite + Add binds; auto binds at once; stop leaves and forgets
the named account
- the invite is in no file of the state folder
- `waiting_for_add` seen true before the Add and false after
- one press answers `listing_expired`
- `server_id` and `relay_account` reach the own CLI but not a token
caller through a proxy (through dispatch); `account: null` forgets the
named account
- `scripts/plugin-link.test.ts`: `ovis add --account` for another
account than the PC's exits 1 with the logout line, and the same account
(full id or 12-character start) still exits 0. Written first and seen
failing (exit 0).
- `shared/account-service-fake.test.ts` (an invite and its admission end
with the maker's sign-in; a line signed for another account is the one
`invite_invalid`), `scripts/plugin-cli.test.ts`,
`scripts/plugin-link.contract.test.ts`, and the spawned `join`, `status
--json` and installer `--add` cases in `scripts/plugin.test.ts`.
- Skipped: the integration and browser suites (CI runs them); a run
against the staging account service (its new routes are not deployed);
screenshots (CLI only).
## Known limits
- `leave` answers 204 whether or not the PC was listed, so a listing a
device removed ("No") reads as taken off by this run.
- An auto invite rerun more than 10 minutes after its first redeem finds
no admission, says to ask for a new invite, and leaves the listing.
- This PR adds `relay_account` and the `null` form of `relay-account` to
the PC's API, for the own window and a direct connection only. It wants
a real review.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.2 <[email protected]>
…ers (#4559)
## What
The sealing and key-wrap library of the signed list: a pure module in
`shared/` (no I/O, no network, no storage). Nothing outside `shared/`
imports it, so no behaviour changes.
The account service stores the list but must not read the names in it
(labels, addresses, OS words). A kind puts those fields into one
`sealed` field, encrypted under the list's current epoch key, and every
member holds that key wrapped to an encryption key of its own.
- `shared/account-list-seal.ts`
- Member encryption keys: ECDH P-256, non-extractable on a device (kept
in IndexedDB), a stored PKCS8 key on a PC (the one form a join line's
secret has), spelled like every other key of the list.
- Epoch keys (32 random bytes), their wrap per member (ephemeral ECDH
P-256, HKDF-SHA256 with `ovis-list-wrap/1`, the list id, the epoch, the
member's key and the ephemeral key in the info, AES-256-GCM): 113 bytes,
a version byte, fixed length, strict text form.
- The link from an epoch to the one before (61 bytes) and `walkBack`,
which opens at most 1024 links a call.
- `sealFields` / `openSealed`: AES-256-GCM under a key made from the
epoch key, additional data = `ovis-list-seal/1`, the list id, seq and
epoch of the entry; the plaintext is the entry's own field form under
`ovis-list-sealed/1`, filled with a `pad` field to a multiple of 256
bytes. `sealFields` takes the commitment of the epoch and seals nothing
under a key that does not give it.
- `nextEpoch`: what a removal makes, given the members that stay (new
key, commitment, link, wraps).
- Opening is total: `{ open: true, value } | { open: false, why }` with
`missing`, `form`, `refused`, `other_key`, `bound`, `unavailable`.
Nothing that fails to open throws, so it can hide a name and never stop
an admission.
- `docs/account-list.md`: "Names the service cannot read" (the bytes)
and "The vectors of seal/".
- `shared/account-list-vectors/seal/`: 68 vectors (wrap, link, sealed
field; opens and every refusal).
- `scripts/account-list-seal-browser-qa.ts`, added to the browser lane:
the vectors and both directions (made in Bun, opened in the browser, and
back) with a key that cannot be exported.
## Decisions
- **Epoch key commitment (new, not in the first sketch of this
design).** A wrap is public-key encryption: anyone can wrap any key to a
member, the service included. Without more, the service could hand a
newly added member a key of its own and read what that member seals. So
the entry that opens an epoch carries `SHA-256("ovis-list-epoch-key/1"
|| list id || epoch || key)` in clear, under its signature, and
`openWrap` / `openLink` take a key only when it gives that commitment. A
wrong wrap then really only hides names. Epoch 0 is committed to in
entry 0, before the list has an id: 32 zero bytes stand for it there, so
that commitment binds the tag, epoch 0 and the key, and entry 0 itself
(whose hash is the list id) ties it to the list.
- **A key that does not match the commitment is a result of its own,
`other_key`**, apart from `refused` and `missing`: the name is hidden
all the same, and callers can say that the account service gave a wrong
key, which is a sign of tampering where the other codes may be a lost or
stale wrap.
- **Nonce of a sealed field: 96 random bits, never made from `seq`.** A
member whose entry n lost its place signs another entry n with other
fields; a nonce made from `seq` would then come twice under one key. The
chance of two equal nonces among n fields under one key is under n² /
2^97; a list is at most 16384 entries at the service, and with each
sealed a thousand times over under one key that is under 2^-49.
- **Nonce of a wrap: derived.** Each wrap has an ephemeral key of its
own, so HKDF gives both the AES key and the nonce (44 bytes); no nonce
is stored and there is nothing to change in one.
- **Entry 0 has no list id yet** (the id is the hash of the body that
holds `sealed`), so its additional data carries 32 zero bytes there; a
list id with seq 0, or none with a later seq, is `form`.
- **The epoch key never encrypts by itself**: fields and links use
separate HKDF subkeys.
- **Where an epoch opens belongs to the kinds layer**, not to this
module: it takes and gives values (a key, a commitment, a link) and
names no field.
- **A member's bad encryption key stops nobody**: `wrapEpochKey` gives
`null` for a key that is no point of the curve, and `nextEpoch` lists
such members as `unwrapped`.
- The library is stateless, so it cannot know which epoch is current or
when the last removal was. The doc says what callers must do ("Who
seals, and when").
- A stored key has the PKCS8 form of a join line's secret, so a key
carried by a line can open wraps made to it.
## After the independent review
No byte of a wrap, a link or a sealed field changed, and no earlier
vector; ten vectors were added. The review ran before the commitment
took the list id (b6e0abf), so that change is cross-checked separately
below.
- Sealed plaintexts are padded by `sealFields` itself (`pad`, zero
bytes, to 256 bytes or the next multiple); `openSealed` drops `pad` and
still reads an unfilled plaintext.
- `sealFields` requires the epoch's commitment; `walkBack` checks the
key it starts from and never throws; opening reads a caller's bytes only
once their length fits; generated public keys are checked to be keys of
the list.
- The doc gained "Who seals, and when" (only under the current epoch,
and only when its opening entry comes after the last removal; what
remains when a service withholds a removal), "every attempt makes a new
key", "What the service still learns", the version and tag rule, and
what counts toward the nonce bound.
- The second implementation in the test now reads with its own
base64url, field form and key prefix.
- Four `-made-in-python` vectors (a wrap with its commitment, a wrap of
epoch 0 with the commitment that has no list id, a link, a filled sealed
field) were written once by a Python script that shares no code with the
module or the list's readers (`hashlib` and the `cryptography` library).
The same script read all 68 vectors and gave every `expect`. The script
is not in the repo; the doc says how the vectors were made.
- The doc says what `other_key` means from a wrap (the account service
gave a wrong key) and from a link (the member that opened that epoch
wrote a wrong link).
## After CodeRabbit's review
Six threads, all fixed in 49475e1 and resolved; no byte of any format
changed.
- Every async function of the module takes what it is handed (keys,
bytes, the members array, the openings a walk may read) once, before its
first await. `wrapEpochKeyFor` makes a whole batch from one copy of the
key; `nextEpoch` reads the members that stay before it makes the link,
so a caller reusing its array meanwhile cannot get the new key wrapped
to someone else.
- `walkBack` asks `openings` only for `get`, so any read-only view of a
map will do.
- The doc says a sealed field is bound to a place (list, seq, epoch),
not to one entry, and counts sealings, not entries, toward the nonce
bound.
- The browser check rejects on an aborted IndexedDB transaction.
- A test opens a wrap with the `encryptionKey` a real join line gives
(the reader merged in #4556).
- Docs only, 7c8e464: an addition whose request did not place opens no
epoch (the account service places one only when it is needed); the
member signs the entry again on the new head and goes on under the
current epoch. The page says what remains when such an addition is given
up.
## Validation
- `bun test shared/account-list-seal.test.ts`: 126 pass (every vector
read by the module and by a second implementation written with
`@noble/*` only; a wrap for one member does not open with another's key;
no single changed bit of a wrap, a link or a sealed field opens; a
sealed field does not open under another list, seq or epoch; the walk
back yields every earlier key and stops at its bound and at
`LIST_EPOCH_WALK_MAX`; after a removal the removed member's wrap and key
open nothing sealed in the new epoch; junk of every kind is closed,
never thrown; inputs are read once).
- `scripts/account-list-seal-browser-qa.ts` in the CI runner image
(`herdr-ci-runner:local`, Chrome for Testing 153, through `bun run check
run`): 4 PASS lines, exit 0, at 49475e1 (after it: a docs commit and
merges of `main`). Also on this PC's Chrome.
- The same script with `SEAL_ENGINE=webkit` on the test Mac (Playwright
WebKit 26.6), at 7973f0b: 68 vectors and both directions pass. That
harness refuses to store a `CryptoKey` in IndexedDB (`DataCloneError`,
it has no Keychain key to wrap it with), so there the key stays in the
page that made it; the IndexedDB step is checked in Chromium only.
- `bun run check fast` at 18ebeaa (with `main` merged in): green, 25502
unit tests pass.
- Not run: `bun run check full`, the other browser scripts (nothing they
load changed).
## Known limits
- Sizes are hidden only up to the padding: the service sees in which
multiple of 256 bytes a plaintext ends.
- A member that holds the current epoch key reads every earlier epoch;
that is the purpose of the link.
- Which entry may open an epoch, the names of the clear fields (the
epoch number, the commitment, the link) and the rule that an entry's
epoch is the current one belong to the kinds layer, which is not in this
PR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.2 <[email protected]>
…hey build (#4566)
## Change
Adds the kinds layer of the account's signed list as a library: what
each kind of entry means, and
the state the entries build. It is ported from the contract's reference
implementation and amended
for what was decided since (PCs have a signing key, names are sealed,
existing accounts are carried
in). Nothing outside `shared/` imports it, so no behaviour changes. The
entry format and the
signers' rule (`shared/account-list-entry.ts`,
`shared/account-list-signers.ts`) are untouched.
`shared/account-list.ts`:
- **Nine kinds at level 1**: `genesis`, `device`, `pc`, `invite`,
`join`, `remove`, `carried`,
`card`, `epoch`. `readKind` reads an entry's own fields strictly;
`kindBody` writes the body a
caller signs, for every kind.
- **The state** (plain JSON): devices with power, role, `until` and
encryption key; PCs by relay
key with their signing and encryption keys and how they came in;
invites; the keys that are out;
the epochs. `takeEntry` for one entry, `replayList` and `shownList` on
the signers' replay and
going back, `readListState` for a saved state, `rowsNamed` for a caller
that loads rows.
- **A PC that a person added is a `full` signer** and is in while its
key is one. **A PC that
joined by an invite is no signer**: it lets devices in and can allow
nobody. A `join` counts only
for an open invite marked `auto`.
- **A card**: a newcomer signs its encryption key, the list, (a PC) its
relay key and (a join) its
invite before anybody adds it; an entry whose card is not its key's has
no effect.
- **Names are not in the clear.** An entry carries them in `sealed`,
which this layer never opens:
it checks the length and that the `epoch` beside it is the current one.
`namesFields` and
`readNames` say which fields are sealed. Sealing itself is not in this
PR.
- **`carried`** lets the device that starts a list for an account that
was in use name who was in
it; a carried device names its encryption key later with `card`.
- For callers: `listView`, `admitsDevice` (the one clock a member judges
an entry by: a device's
`until`, by the PC), `holdsPc`, and the invite's proof for reading the
log.
- **For whoever seals names** (after the review of the sealing):
`sealEpoch(state)` is the one place
that says whether a writer may seal and under which epoch (the current
one, only when it was
opened after the last entry that put a key out); `wrapKeys(state, now)`
leaves out a device past
its `until` and an invite past its `exp`, by the caller's clock.
- **A PC joins through the line it was given, and signs nothing somebody
else composed**:
`joinEntry(line, pc, place, sealed)` makes the card and the body from
the PC's own keys; the read
line gains `signJoin` and `signRead`, which sign only a `join` of the
line's own key on its own
list with no `adds` and no `ends`, and only its own read proof
(`shared/account-list-join.ts`,
the one file outside `account-list.ts` this PR changes).
- `cardBinding(card)`: what the number a person compares when adding a
PC is bound to (the
committed comparison of `shared/relay-pair-sas.ts`).
`docs/account-list.md` gains "The kinds" (the kinds, the card, what is
sealed, the state).
Refs #3996
## What the tests hold it to
- Each kind, each refusal's name and the order of the names; every
missing, extra or malformed
field; saved states that do not agree with themselves.
- Over generated histories (30 seeds, 70 entries each, any kind by
anybody about anybody): nobody
comes in but by a `full` signer's entry or the `join` of an open `auto`
invite that a `full`
signer placed; an entry by a key that is no signer changes nothing; a
`bound` key changes nothing
but its own end; out is out (a key that was ended never signs or opens
again, a PC that was put
out is never in again, its key is never a PC's again); a PC that joined
is never a signer by its
join.
- A lying service's entries on top of a member's list never add anybody,
and the member's state is
as if it had never been shown them; what a member holds never depends on
where an honest answer
was cut.
- Whatever fields an entry carries (3000 mutated entries), it reads as
no kind or as one that is
written back to the same fields.
- Every `takeEntry` in the suite also checks: nothing given is changed;
the result on the rows the
entry names equals the result on the whole state; the new state reads
again from its JSON; its
signers are the signers' own.
- Vectors: `kinds/` (118 lists with each entry's bytes, the outcomes and
the whole state), `card/`
(18), `names/` (22).
## After the adversarial review (no entry field and no card byte
changed)
- **An invite's time is over by the list's own time**, with no reader's
clock: the latest
`issued_at` of an entry a `full` signer signed that was not passed over
(`full_at` in the state).
A `join` after that has no effect (`invite_expired`), whoever places it.
- **`carried` counts only right after entry 0** (`carried_late` after),
and its role is `drive`.
**Only a `bound` device watches or has an `until`.**
- **A member signs only what counts**: `signListEntry` builds the entry
on the member's own state,
takes it as every member will, and refuses to sign anything else;
`signListEntries` for a batch,
`signGenesis`, and `joinEntry` on the state the PC read. So no honest
entry leaves a signer with
no name; `listView` lists such signers all the same, and the PC whose
key became one goes out
with that key (`ends_needed` for its relay key).
- `listClock`, `pcRemoval`, `account` in the state, and every reader
answers for nobody on a
member that is stopped for a replay.
- **After the review threads**: a member that is behind takes the keys a
person's `pc` gives a
carried PC that is in, so that every member puts that PC out by the same
entry; `readListState`
refuses a first device that could not come from entry 0, a PC key off
the curve and two PCs at
one place; a member that stopped after entries it took has vectors of
its own.
- **Nobody opens an epoch at will**: `signListEntry` refuses an `epoch`
that nothing calls for
(`epoch_not_needed`), so an entry that did not get its place is signed
again and sealed under the
same epoch. The doc also says an invite a PC joins with by itself is
made for one PC for now.
## Validation
- `bun test shared/account-list.test.ts --timeout 120000`: 342 pass, 0
fail; with the entry, join,
invite and sealing files beside it, 721 pass.
- An independent reader written separately (Python, `cryptography`)
agrees with all 18 card vectors
(bytes and verdicts) and with the cards inside the `kinds/` vectors:
each of the 84 entries that
count carries a card that holds for its own fields, and none of the 11
`card_invalid` ones does.
- The rules were broken one at a time: 28 changes before the review and
43 after it (the expiry,
the carried window, the signing helper, the clock, the readers on a
stopped member, the saved
state). The tests catch every one; two gaps found this way got a test.
- `bun run check fast`: exit 0, on the head with main merged in.
- Skipped: the integration and browser suites (nothing outside `shared/`
imports the files).
## Known limits
- A `full` signer can still make any key that was never a signer one,
the key of a PC that joined
by an invite among them: that is the signers' rule, which this PR does
not change. Such an entry
has no effect of its kind (`key_reused`), so the key is a signer with no
name: no PC and no
device, and it signs what its power allows. No member's own entry makes
one (`signListEntry`),
every member lists them, and the PC goes out with that key.
- A holder of an `auto` invite's line can name a relay key that is not
its own in a `join`, and a
service that is not honest places it. It opens nothing (a device still
holds a PC to its relay
key); it costs that PC its relay key in this list and shows the holder
the names. The PC comes
back as a new PC. The doc says so.
- A key that lets nobody in any more (a spent or expired invite, a
`bound` device past its `until`)
is still a `bound` signer until it is ended: its entries have no effect
and still take a place.
- A member that is behind does not know the keys of PCs that joined
after it fell behind. A `pc`
that names such a key for a carried PC has no effect for a member that
reads everything and is
taken by the one that is behind, which can then hold that PC after the
others put it out, until
it replays. Nobody who signs only what counts writes such an entry. The
doc says so, and a test
pins it.
- The generated histories here are of entries that a service places in
order. They do not model a
service that withholds, forks or replays the log: that is the signers'
file's ground and its
tests', and the follower's.
- No caller, no storage, no network, no sealing: those come in their own
PRs.
- It stands on #4556 (the join line) and #4559 (sealing), both merged;
the doc holds all three
parts.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Fable 5.2 <[email protected]>
… only the client (#4747)
Skips three non-required, server-side CI jobs on a pull request that
changes only the client. Every other event keeps the full suite.
## What is skipped, and when
| Job (none is a required check) | pull_request, only client paths
changed | any other pull_request | push to main | workflow_call
(Release, Pages) | workflow_dispatch |
|---|---|---|---|---|---|
| herdr-core live contract | skipped | runs | runs | runs | runs |
| Rust PTY host | skipped | runs | runs | runs | runs |
| Native macOS session identity | skipped | runs | runs | runs | runs |
| Fast checks, Integration and browser, Native Windows install, Hook
kill tests (container) | unchanged | unchanged | unchanged | unchanged |
unchanged |
"Only client paths" (`scripts/ci-server-reach.sh`): every changed path
is under `src/`, `public/` or `changelog.d/`, or is `index.html`, except
the client code the `ovis` command shares (`src/lib/account/`,
`src/lib/relay/`, `src/lib/nativeApp.ts`, `src/lib/shellMode.ts`). Any
other path, a path the script cannot read, or no path at all prints
`server=true`. Every event but a pull request exits Detect changes
before the script and leaves `server` unset, and the jobs run on `server
!= 'false'`.
## Why it is safe
- The three jobs build `crates/` and run bun tests of `server/`,
`shared/`, `tui/` and `scripts/`. They do not build the client; Fast
checks, Integration tests and the Browser regression jobs keep testing
it.
- `scripts/ci-server-reach.test.ts` reads the jobs' `bun test` paths
from ci.yml, follows every import, and also follows files read beside a
file (`new URL("…", import.meta.url)`, `join/resolve(import.meta.dir,
…)`). The test fails if any file reached that way is in a skipped path.
That is how it found the account and relay code `scripts/plugin.ts`
loads, which `tui/fidelity.live.test.ts` starts. Mutation checked:
making an ACP test read `public/manifest.webmanifest` fails it.
- The Rust job's `bun test` paths now start with `./`. A bare
`server/acp` filter also selects `src/lib/server/acp-view.test.ts`; the
test pins that every path is anchored.
- `scripts/release-ci-reuse.test.ts`: the new condition is one a push
run always meets (main's run still runs the jobs, so Release can take
it), and the filter step's end-to-end case asserts `server=false` only
for the client-only pull requests and no `server` line for push and
dispatch.
## Expected saving
4 of the last 100 merged PRs (#4556 to #4735) changed only these client
paths; the lead's earlier count was 5%. Each such PR run skips
herdr-core live (about 5 min), Rust PTY host (about 1.7 min, hosted when
the Rust runners are busy) and the macOS job (self-hosted Mac or
macos-15). This is a small saving; it frees the Rust/Linux pool for the
PRs that need it.
## Not changed (pre-existing, out of scope)
Detect changes' `code=false` (paths that are all docs-like: `docs/`,
`*.md`, `*.txt`, LICENSE, issue templates) already skips these jobs, and
Integration tests too, for e.g. `plugins/new/fixture.txt` alone. Both
reviewers noted it. This PR does not change that rule; it applies to the
required Integration job the same way.
## Revert
Revert this commit, or drop ` && needs.changes.outputs.server !=
'false'` from the three jobs' `if:`.
## Validation
- `bun run check fast` (TMPDIR under ~/.cache/ovis-tmp): passed (unit:
28148 pass, 0 fail; typecheck, build, workflow syntax ok)
- Guard tests: ci-server-reach, release-ci-reuse, pty-sidecar-workflow,
light-runner-workflow, privileged-jobs-workflow, workflow-needs,
ci-browser-reach, ci-runner-route, hook-kill-tests-workflow,
workflow-expression: 437 pass, 0 fail.
- Reviews: one gate reviewer and one Codex adversarial review
(gpt-6.2-sol-fast, xhigh) on bf9775f, both BLOCK on the same two
findings. Fixed: unanchored `bun test` paths, and the guard now follows
runtime reads (which found the shared client code). Not changed: the
pre-existing docs-only rule above.
Hold: this narrows checks, so it waits for the maintainer.
… instead of four (#4748)
Remote PC bundles (non-required) ran four GitHub-hosted jobs for every
pull request that touched `server/**` and similar paths: bundle-linux,
bundle-windows (both ubuntu-24.04), smoke-windows (windows-latest) and
ssh (ubuntu-24.04). bundle-windows and ssh each rebuilt the client and a
bundle that bundle-linux had just built. A pull request now runs the
same checks on two hosted runners. A tag or a manual run is unchanged.
## What runs, by event
| Job | pull_request (before) | pull_request (now) | push tag remote-v*
| workflow_dispatch |
|---|---|---|---|---|
| bundle (4-platform matrix) | skipped | skipped | runs | runs |
| bundle-linux | Linux bundle + smoke | Windows bundle (uploaded first),
Linux bundle + smoke, then a Node-only Linux bundle and the SSH checks |
skipped | skipped |
| bundle-windows | runs | **skipped** (bundle-linux uploads the same
artifact) | runs | runs |
| smoke-windows | runs | runs, on the uploaded artifact | runs | runs |
| ssh | runs | **skipped** (same three steps in bundle-linux) | runs |
runs |
| release | - | - | runs, now with an explicit condition | - |
Every check still runs on a pull request: the Linux and Windows smokes,
`ssh-integration.ts`, `ssh-password-docker.ts` and
`server/windows-native.test.ts`. Each part runs whatever became of the
others, as before. The Windows artifact goes up before any Linux check,
and smoke-windows starts on its upload
(`needs.bundle-linux.outputs.windows`), not on bundle-linux's result.
The SSH steps run after a failed Linux smoke, on a Linux bundle without
the Rust PTY host, as the ssh job builds it (so the Node PTY host stays
covered end to end).
Trigger: a pull request that changes only `server/**/*.test.ts`,
`shared/**/*.test.ts` or `server/**/*.md` no longer starts the workflow
(no bundle carries them). `server/windows-native.test.ts`, which
smoke-windows runs, still does. `scripts/ci-ssh-checks.sh` is added to
the paths.
The SSH steps' shell moved verbatim into `scripts/ci-ssh-checks.sh`
(parts `server`, `integration`, `password`), which both jobs call.
`release` needs `smoke-windows`, which now also needs bundle-linux, and
a tag skips bundle-linux. GitHub's implicit `success()` would then skip
`release` (`scripts/workflow-needs.test.ts` caught it). Its condition
now says outright: not cancelled, a remote-v tag, and bundle,
smoke-windows and ssh all succeeded.
## Evidence
- Today (2026-11-25 from 02:57 UTC) Remote PC bundles was the largest
non-required hosted user: about 570 pull_request jobs (146 bundle-linux,
144 bundle-windows, 143 ssh, 136 smoke-windows on windows-latest), with
an average queue wait of about 8 minutes on the Linux ones. Hook kill
tests (container), a required check, waited in the same hosted queue
(average 7.6 min). Native Windows install falls back to windows-latest
when winvm is busy.
- 69 of the last 100 merged PRs (#4556 to #4735) start this workflow; 2
of them changed only server unit tests or notes.
- In about 300 recent pull_request runs, the only failures were
`typecheck` failures in bundle-linux and bundle-windows together, which
Fast checks catches too. smoke-windows and ssh never failed alone.
## Expected saving
Two hosted jobs per pull request run: at today's rate about 280 fewer
hosted jobs a day (about 340 job-minutes of bundle-windows and ssh,
minus about 1.5 min more in bundle-linux), and two fewer queue waits per
run. smoke-windows now starts after bundle-linux's Windows build instead
of bundle-windows', at about the same point.
## Not changed (pre-existing, out of scope)
- The pull_request `paths` list is an allowlist: a path outside it (e.g.
`scripts/server-manifest.ts`) never started this workflow. Codex noted
it; this PR keeps the list as it was, apart from the test-only
exclusions.
- `ci-ssh-checks.sh password` probes Docker twice, as the inline step
did.
- A PR that changes only a server `*.contract.test.ts` no longer starts
the bundles; that file is an integration test, and no bundle carries it.
## Revert
Revert both commits. Or, minimally: drop `if: github.event_name !=
'pull_request'` from bundle-windows and ssh, and remove the four lines
after `'shared/**'` in the paths.
## Validation
- `bun run check fast` (TMPDIR under ~/.cache/ovis-tmp): passed (unit:
28136 pass, 0 fail; typecheck, build, workflow syntax ok)
- `scripts/remote-bundles-workflow.test.ts` (new): which jobs run per
event and which checks they run, the upload order, the artifact names
and paths of both producers against the downloader, the Node-only SSH
bundle, the release condition, the trigger events and the paths filter.
Mutation checked: removing the tag trigger, renaming the download
artifact, or making an SSH step unconditional each fails it. It does not
use `scripts/workflow-expression.ts`; that helper's guard keeps other
callers off it.
- Guard tests: workflow-needs, privileged-jobs-workflow,
release-ci-reuse, light-runner-workflow, ci-runner-route,
ci-browser-reach, pty-sidecar-workflow, ci-setup,
hook-kill-tests-workflow, desktop-workflow, workflow-expression: 448
pass, 0 fail.
- Not run: a hosted run of the changed jobs. This pull request's own run
of Remote PC bundles is the first.
- Reviews: one gate reviewer and one Codex adversarial review
(gpt-6.2-sol-fast, xhigh) on a94124c, both BLOCK. Fixed: the new test
no longer uses the restricted evaluator; the Windows artifact and smoke
no longer depend on the Linux checks passing; SSH runs on a Node-only
bundle again; tests cover triggers and artifact handoff. Not changed:
the items above.
Hold: this narrows where checks run, so it waits for the maintainer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
The join line of the account's signed list now names the account, and an invite is a key. Both are
libraries in
shared/; nothing in the server or the app calls them yet, so no behaviour changes.ovis-join:1:is amended in place: its JSON is{"v":1,"service":…,"account":…,"list":…,"secret":…}, andlistis empty while the account hasno list. No released build reads or writes a join line, so there is one form and one version; a
line in the earlier four-member form is refused (
members).readJoinLinegivesaccountandlist(nullfor none);writeJoinLinetakes them. New refusal reason:account.shared/account-list-invite.ts). The device that makes an invite makes aP-256 key pair, gives the account service the public key alone and writes the line
(
newInvite). The machine that joins proves it holds the line by a signature overovis-invite-redeem/1and the length-prefixed account, machine id, relay key and challenge id(
inviteRedeemBytes,signInviteRedeem,verifyInviteRedeem). The account service never holdsthe private key or the line, so it cannot use an invite or sign for one.
docs/account-list.mddescribes the line, the invite and the redeem signature.shared/account-list-vectors/join/(45) andshared/account-list-vectors/invite/(19).Refs #3996
Why
Two pieces of work that are not released yet, the account service's PC invites and
ovis join,move onto the list's formats before they ship, so there is never a second invite format: the line a
person pastes today is the line that will sign the list's
inviteandjoinentries later. With akey instead of a shared secret, a breached account service cannot redeem an invite.
Validation
bun test shared/account-list-join.test.ts shared/account-list-invite.test.ts shared/account-list-entry.test.ts --timeout 60000:253 pass, 0 fail.
cryptography) agrees with all 45 join vectors(the two refusals for the caller among them) and all 19 invite vectors (the line's public key, the
signed bytes, each verdict, the make proof).
bun run check fast: exit 0, on the head with main merged in.shared/imports these files).After the review (second commit; no byte of a line or of a redeem message changed)
readJoinLine(line, { service, followsLists })refuses a line for another account service(
other_service) and, for a caller that follows no lists, a line that names a list(
needs_lists), itself.signRedeemsigns the redeem message of the line'sown account,
encryptionKeyonly agrees on a shared secret.signInviteRedeem(line, { server_id, public_key, challenge_id });newInviteis now inshared/account-list-join.ts.inviteMakeBytes: what a device's key proof signs to make an invite, with the invite's publickey in it.
verifyInviteRedeemanswers false for what is no redeem at all; one base64url helper(
canonicalBase64Url, exported from the entry's file: anexport, no other change there).private value of 0 and of n, a signature with s = 0, r = n, s = n, an invite key off the curve
and in a second spelling, the reader's two refusals, the make proof. Join 45, invite 19.
Known limits
httpsservice origin, as before: a PC whose account service is plainhttp(a local test service) cannot use join lines.
🤖 Generated with Claude Code