…LL (S2-30..S2-34, S2-37 line) (#4311)
## Track E step 2: the app's account screens (S2-30, S2-31, S2-32, S2-33
minimal, S2-34, one S2-37 line), behind OVIS_ACCOUNT_OPENS_ALL
One PR for Track E's cleared set (relay-hub speed-up rule). Based on
Track D's #4324 head (`feat/s2-26-account-row-rights` 56b1e12, on main
a79d6ca with Tracks A and B merged); it merges right after #4324 and is
retargeted to main then. Supersedes #4294 (S2-30) and #4296 (S2-31).
Cleared by range-diff against the cleared heads (hub + security-triage,
latest: 150/150 '=' at e5ccb30).
### Flag off
With OVIS_ACCOUNT_OPENS_ALL off, a PC lists no account-opens-all/1 and
the app shows and sends nothing new; the PC's roster refuses the
account-records forward exactly as main does (403 forbidden, a5090b6 /
4f7bc54).
### Pieces and receipts
| Piece | Device table rows | Cleared head | Receipts | Ledger |
|---|---|---|---|---|
| S2-30 account open from the sign-in key | T34, T40, P7, P18, G5 |
e472ee0 (+ wire tests b0b57ca) | gate r1-r3, r3 CLEAR; t13r YES |
none |
| S2-31 device notices of the selected PC | P10, P15, T34, T57, T58 |
b441382 | gate r1-r3 CLEAR on 5fc3526; close-X and two-step label
deltas: hub read + t13r YES; lead OK on '2단계 인증 확인 안 됨' | none |
| S2-32 Not me with per-PC receipts | T51, T60, T65 | 4f7bc54 |
pre-review r1-r3; hub cleared 4f7bc54; t13r YES (d8b558a) |
postponed: already_applied wording, Not me after a refused refresh |
| S2-33 the new device's wait card (minimal) | T53, T57, T67, P17 |
f0b174b | hub r2: own commits clear; t13r YES (range-diff) | none |
| S2-34 pairing fingerprint on both surfaces | T71, T72, P11 | aa61b12
| hub cleared at r2; t13r YES (range-diff) | postponed: device wait up
to 5 s past PENDING_MS |
| S2-37 one line: relay-only PC limit on setup | T70 | 888aa72 | hub
cleared r3; t13r YES (range-diff) | none |
Postponed until after switch-on (final scope): It's me, S2-35, S2-36,
the rest of S2-37. Track B's S2-13 commits sit under S2-34 as
cherry-picks (pairing fingerprint, key proof, pending keys, b8edf9e);
they drop out when #4301 merges.
### Changed at the collapse (besides the rebase onto D)
- Conflicts resolved by keeping both sides: shared/relay-channel.ts (E's
negotiation guard + D's hold/receipts forwarding), shared/relay-mux.ts
(D's held/not_listed/admission + B's key_proof_required),
shared/relay-mux-engine.test.ts (both test blocks).
- e6dcb8d: the app offers Track D's ACCOUNT_OPENS_ALL_FEATURE; E's
copy of the constant is gone.
- ee7c9f4: S2-30's wire-byte tests folded in (they need D's decoder).
- One new pin for S2-33: a decoded held refusal reaches the shell's wait
card with its deadline, and with none while the notice is unpublished.
### Since the collapse (each red first; hub checked, security-triage
YES)
- CodeRabbit round: tab race on the sign-in key, lost registration
reply, holds without a deadline and clock skew, open admissions across a
reconnect, a late decline reply, pending keys on sign-out, and a failed
account-service post of Not me's block now kept with a one-tap retry of
the same signed ids (ledger S32-1 for durable retry). New sentence (lead
OK): 'The block did not go through yet.' / '차단이 아직 전달되지 않았어요.' + 'Try
again'.
- Docs: '### Limits of this release' in docs/account.md.
- Rebased onto Track D: B's S2-13 cherry-picks dropped (on main); the
roster block test now signs with members older than any join hold on a
PC that has caught up.
### End-to-end (loopback relay + fake account service, flag on; not
staging)
List admission with the app event socket staying open; the Google 'not
confirmed' notice; Not me through the owner-only roster forward; the
held wait card; fingerprint pairing + Decline; Revoke all: all PASS
(scripts/account-opens-all-e2e-qa.ts, local branch). Not run here: a
block queued before list admission, lift by an older two-step signer
(staging).
### Captures
http://100.106.153.26:18765/s2-screens/ (owner OK; lead OK on the one
new sentence).
### Exports (each new export with its production caller, tests excluded)
##### S2-30
## New exports and their production callers
| Export | Caller (file:line) |
|---|---|
| `accountDevice` | src/lib/relay/shell.tsx:407 |
| `ACCOUNT_OPENS_ALL_MUX_FEATURE` | shared/relay-channel.ts:142,
shared/relay-channel.ts:208 |
| `AccountOpenUnsupportedError` | shared/relay-channel.ts:23,
shared/relay-channel.ts:267 |
| `AccountRowImmutableError` | src/lib/account/accountDevice.ts:21,
src/lib/account/accountDevice.ts:38 |
| `isFatalRelayError` | src/lib/relay/transport.ts:291,
src/lib/relay/transport.ts:355 |
| `myPcs` | src/components/AccountSection.tsx:795,
src/components/RelayAccountPcs.tsx:24 |
| `newKey` | src/lib/account/signInKey.ts:18,
src/lib/account/store.ts:134 |
| `nextOpenStep` | src/lib/relay/shell.tsx:298 |
| `openRefusalOf` | src/lib/relay/shell.tsx:296,
src/lib/relay/transport.ts:60 |
| `registerSigningBytes` | shared/account-records.ts:173,
src/lib/account/service.ts:383 |
| `signInKey` | src/lib/account/store.ts:77,
src/lib/relay/accountController.ts:327 |
| `withAccountDevice` | src/lib/relay/shell.tsx:407 |
### Flag off
Nothing is offered or sent: the service answers 404 (registration
returns null), PCs list no capability, and HELLO is unchanged.
### Tests (written first, each red before its code)
- caaf00e test(app): register this sign-in's own key, keep QR or
digits when the service has no release (T34, G5, T40, P18)
- db09308 feat(app): register this sign-in's own key with the account
service, null when it has no release (T34, G5, T40, P18)
- 39717c3 test(app): only a PC that lists account-opens-all/1 offers
it (G5)
- ddb2b8f feat(app): read account-opens-all/1 from a PC's trusted
features (G5)
- 87b78a0 test(app): a held account sign-in waits, an unlisted one
retries once then offers QR or digits (T34, G5)
- 5b7b482 feat(app): decide the next step when a PC refuses the
account sign-in (T34, G5)
- 0ed6f9b test(app): each sign-in registers a key of its own once and
keeps its number (T34, P18, P21, G5)
- 1a39d8f feat(app): each sign-in registers a key of its own and keeps
its number (T34, P18, P21, G5)
- a89d360 test(app): read held, not_listed and admission from the PC's
refusal, anything else keeps today's handling (T34, G5)
- eddcf3f feat(app): read the PC's account refusal from the relay
sign-in error (T34, G5)
- a0cf7b8 test(app): offer the account-opens-all mux feature in the
relay HELLO only when asked (T34, G5)
- 19f2861 feat(app): offer the account-opens-all mux feature in HELLO
when signing in with the sign-in key (T34, G5)
- 811de61 test(app): sign in to a PC as this sign-in key's account
row, whose key never moves (T34, T40)
- 60b6612 feat(app): sign in to a PC as this sign-in key's account row
and never move its key (T34, T40)
### Validation
`bun run check fast` on the stack top feat/s2-36 at 43234892 (contains
S2-30..S2-36), on main 0839031, via dori heavy: workflow syntax,
generated types/themes fresh, typecheck, build, unit tests (145 s),
actionlint all ok. Per-branch: each tip's own tests + i18n + conventions
+ typecheck. Electron suite (S2-35) 131/131.
##### S2-31
## New exports and their production callers
| Export | Caller (file:line) |
|---|---|
| `DeviceNotices` | src/App.tsx:1137 |
| `keyFingerprint` | src/components/DevicePairedNotice.tsx:39 |
| `noticeSeen` | src/lib/useDeviceNotices.ts:47 |
| `TOLD_KINDS` | src/components/DevicePairedNotice.tsx:20 |
| `useDeviceNotices` | src/App.tsx:337 |
| `withNoticeAcked` | src/lib/useDeviceNotices.ts:52 |
| `withNoticeDecided` | src/lib/useDeviceNotices.ts:59 |
| `withNoticeReplay` | src/lib/useDeviceNotices.ts:38 |
### Flag off
Nothing new is shown or sent: the PC lists no account-opens-all/1, so
every new path stays closed.
### Tests (written first, each red before its code)
- c4ca972 test(app): device notices replay once, ack without deciding,
keep an open admission (T57, P15)
- 1b3a400 feat(app): keep each PC's device notices in journal order
until decided (T57, P15)
- 1341a2a test(app): each PC's notices show once, are acknowledged
once, and a dismiss decides nothing (T57, G5)
- b1b22d2 feat(app): show each PC's device notices and acknowledge
them on that PC (T57, G5)
### Captures
http://100.106.153.26:18765/s2-screens/ (owner OK required before merge)
### Validation
`bun run check fast` on the stack top feat/s2-36 at 43234892 (contains
S2-30..S2-36), on main 0839031, via dori heavy: workflow syntax,
generated types/themes fresh, typecheck, build, unit tests (145 s),
actionlint all ok. Per-branch: each tip's own tests + i18n + conventions
+ typecheck. Electron suite (S2-35) 131/131.
### Since the gate-CLEAR head 5fc3526 (hub + t13r YES on each delta)
- Owner's close X: e7f47e1 red, d82159a fix (an open admission
notice hides locally only; no onDismiss, no ack, no answer).
- Two-step label (owner's Google decision, lead OK on the wording):
e06d278, 182a66c, 8d567de reds; b441382 fix (a list admission
whose two_step is present and not set/verified shows '2단계 인증 확인 안 됨' /
'Two-step sign-in not confirmed' even without a method).
#### New exports and production callers (tests excluded)
| Export | Production caller |
|---|---|
| DeviceNotices | src/App.tsx:1137 |
| keyFingerprint | server/push.ts:440, server/push.ts:599,
server/push.ts:605 |
| noticeSeen | src/lib/useDeviceNotices.ts:47 |
| NoticeSocket | src/lib/useDeviceNotices.ts:20 |
| PcNotices | src/lib/deviceNotices.ts:27, src/lib/deviceNotices.ts:41,
src/lib/deviceNotices.ts:45 |
| TOLD_KINDS | src/components/DevicePairedNotice.tsx:21 |
| useDeviceNotices | src/App.tsx:337 |
| withNoticeAcked | src/lib/useDeviceNotices.ts:52 |
| withNoticeDecided | src/lib/useDeviceNotices.ts:59 |
| withNoticeReplay | src/lib/useDeviceNotices.ts:38 |
None is tests-only.
##### S2-32
| Export | Production caller |
|---|---|
| ACCOUNT_SIGN_OUT_EVENT | src/components/AccountDeviceNotices.tsx:133,
src/components/AccountDeviceNotices.tsx:137,
src/lib/account/service.ts:504 |
| answerOnPc | src/lib/account/noticeAnswer.ts:57 |
| AnswerSocket | src/lib/account/noticeAnswer.ts:16,
src/lib/account/noticeAnswer.ts:48 |
| BlockOutcomes | src/components/AccountDeviceNotices.tsx:104 |
| BlockSend | src/lib/account/fleet-block.ts:60,
src/lib/account/fleet-block.ts:62, src/lib/account/fleet-block.ts:67 |
| canBlockAdmission | src/components/AccountDeviceNotices.tsx:40,
src/lib/account/fleet-block.ts:22 |
| FleetBlock | src/components/AccountDeviceNotices.tsx:39,
src/lib/account/fleet-block.ts:35, src/lib/account/fleet-block.ts:65 |
| indexedAccountService | src/components/AccountDeviceNotices.tsx:47,
src/components/AccountDeviceNotices.tsx:89,
src/components/AccountSection.tsx:192 |
| notMeBlocks | src/components/AccountDeviceNotices.tsx:51 |
| NotMeButton | src/components/AccountDeviceNotices.tsx:105 |
| notMeTransports | src/components/AccountDeviceNotices.tsx:76 |
| OwnKey | src/components/AccountDeviceNotices.tsx:17,
src/lib/account/fleet-block.ts:12, src/lib/account/fleet-block.ts:21 |
| postSafetyRecord | src/components/AccountDeviceNotices.tsx:92 |
| recordsOnPc | src/lib/account/noticeAnswer.ts:64,
src/lib/account/noticeAnswer.ts:65 |
| sendBlocks | src/components/AccountDeviceNotices.tsx:90 |
| useAccountDeviceNotices | src/App.tsx:336 |
| withBlockReceipt | src/lib/account/fleet-block.ts:79 |
None is tests-only. Not me posts the signed block to the account service
(POST /v1/safety-records, ovis-sh/account #44) and to each roster PC;
the roster forward of POST account/records is owner-only
(server/machine-api.ts) and carries x-herdr-machine for the receiver's
origin check. A PC reads blocked only on its own channel's receipt.
##### S2-33
| Export | Production caller |
|---|---|
| holdWaitMs | src/components/JoinWait.tsx:34 |
| JoinWait | src/components/AddPcSheet.tsx:165,
src/components/RelayShellScreens.tsx:272 |
None is tests-only.
##### S2-34
| Export | Production caller |
|---|---|
| declinePendingKey | src/App.tsx:1137 |
| KeyFingerprintWait | src/components/AddPcSheet.tsx:167,
src/components/RelayShellScreens.tsx:267 |
| PendingKeys | src/App.tsx:1137 |
| useRosterEvents | src/App.tsx:319 |
None of Track E's is tests-only. Rows from Track B's S2-13 (#4301:
pairing fingerprint, key proof, pending-key routes, incl.
PAIR_FINGERPRINT_PATTERN which only B's test uses) sit under this branch
as cherry-picks and drop out when S2-13 merges and this branch rebases;
they are listed in #4301.
##### S2-37 line
| Export | Production caller |
|---|---|
| relayOnlyPc | src/components/RelayOnlyWarning.tsx:21,
src/components/SetupGuide.tsx:778, src/components/SetupGuide.tsx:1117 |
| RelayOnlyWarning | src/components/SetupGuide.tsx:75,
src/components/SetupGuide.tsx:841 |
None is tests-only.
---------
Co-authored-by: sisyphus-dev-ai <[email protected]>
Track D of step 2 (S2-24..S2-29): a PC trusts its account's device list. Everything is behind
OVIS_ACCOUNT_OPENS_ALL(off by default); with the flag off, nothing changes.Layers (one branch each, stacked; this PR carries the whole stack, as ruled for one combined review):
b25ba2c2admitListedRows(stage then commit), Revoke-all intent and recovery, unknown snapshot fields ignored,two_step/provider9bad6f14not_supporteduntil its UI ships3bc14b17756c0da3ovis recover --releasethrough S2-15a694a4d6017f7104Design rows: device-row-states rev 8 (P5-P24, R1-R10, S19-S27, T19-T73, G1-G15, H1-H2). Every behaviour change landed red first; each red commit names its rows.
Flag off
With
OVIS_ACCOUNT_OPENS_ALLoff, behaviour is byte-identical to main, with TWO accepted differences:shared/relay-mux.tsparseSessionErroris stricter: aSESSION_ERRORthat carries a hold on a code other thanheld, or receipts on a code that may not carry them, is refused asprotocol_errorinstead of the extra field being ignored. Only a flag-on PC ever sends those fields, and this is the shared wire decoder with no flag in reach. Test:shared/relay-mux.test.ts"S25: a held refusal carries its hold state, and only a held refusal does". (Lead's decision.)devices.jsonrow that a flag-on run leftheld(its join hold or notice undecided, a device the owner has not yet had the chance to refuse) is not admitted with the flag off: its sign-in is refused like an unpaired key, it stays listed, Revoke all ends it, and it is never deleted, so turning the flag back on restores it held. The same rule covers a merge: with the flag off, when a sibling's copy of a row isheldon a new key K2, the merge keeps the row on the key this PC admitted (K1) instead of moving it to K2 as main would, so the owner's unconfirmed key stays out until the flag is back on (security-triage's ruling). Test:server/state-merge-held.contract.test.ts"flag off: a held twin on a new key leaves the row on its admitted key". Main never writesheld, and the flag is also the owner's rollback switch (security-triage's ruling). Test:server/account/carried-hold.contract.test.ts"flag off: a held member survives rollback listed but cannot sign in or sign records".Gated so flag off matches main, each with a flag-off test: the socket's It's me answer (only when notices exist), a null session row at sign-in (closes
auth_failedonly with the flag on; flag off unwatches as before), and the refusal of data frames on a closed relay session (flag on only).Moves that look broad but run only with the flag on:
server/dispatch.tslocalRoster/ machine events andwithoutHiddenTokens: R7, a listed account row's/wsgets only this PC's roster with hidden tokens removed; reached only when the caller is a listed account row.server/index.tssafetyLog.fold(): runs only when the safety log exists (flag on), and now after the snapshot lifts are journalled (8dcac5c), since folding drops whole records.Review checklist
DeviceStore.admitListedRows(server/devices.ts:1117, callersserver/account/account-devices.ts:218, :293); freshness, access and notices go out only for returned ids. Reds:server/account/waiting-block-list.contract.test.ts, readmitted and promoted cases.DeviceStore.mayAnswerNotice,server/devices.ts:2531).two_stepmissing or unrecognised meansunknown(not confirmed). No PC-side signature covers snapshot device entries; nested signed records stay strict.server/core/socket.ts:203answersnot_supportedbefore the store.receiptsBySigner(key, account)(server/devices.ts:2355), lift subscription (server/account/account-catch-up.ts:30), recovery release wiring (account-catch-up.ts:25, :27,server/index.ts:332,server/devices.ts:1371).Access-test fixture changes (assertions unchanged): R1/T19 twins, T51, T36, T47 now complete a whole read first (P7/T42: a member still waiting for its first whole read has no approver or signer standing). G3 and T70 were fixed in code; B's T70 fixture is unchanged.
New exported functions and their production callers
AccountCatchUpserver/index.ts:614ACCOUNT_DEVICES_FILEserver/account/account-devices.ts:40ACCOUNT_DEVICES_MAXserver/account/account-devices.ts:257AccountDeviceStoreserver/account/account-row-source.ts:11accountDispatchRefusalserver/dispatch.ts:197ACCOUNT_OPENS_ALL_FEATUREserver/relay/session.ts:351AccountOrderserver/account/account-order.ts:48ACCOUNT_ORDER_FILEserver/account/account-order.ts:72accountReadAllowedserver/account/dispatch-rights.ts:45accountRouteActionserver/account/dispatch-rights.ts:44accountRouteGuardserver/account/dispatch-rights.ts:43accountRowMayserver/account/dispatch-rights.ts:47accountRowsForserver/account/account-catch-up.ts:21accountSignInRefusalserver/relay/session.ts:380applyAccountRecordsserver/account/mailbox.ts:484assembleSnapshotserver/account/snapshot-read.ts:101AUTH_RECEIPTS_MAXserver/relay/session.ts:397CatchUpGateserver/account/account-catch-up.ts:12CLEAREDserver/account/account-device-state.ts:101connectionDataserver/core/index.ts:1dispatchMutationRegisteredserver/account/dispatch-rights.ts:42DISPATCH_MUTATIONSserver/dispatch-routes.ts:46DISPATCH_READSserver/account/account-row-rights.ts:129expiresAtserver/account/account-devices.ts:163EXPIRY_DAYSserver/account/account-devices.ts:22firstDeviceserver/account/account-device-state.ts:77HandedLiftsserver/devices.ts:546holdSecondsLeftserver/account/account-devices.ts:129isRowDropserver/account/device-journal.ts:97ITS_ME_MIN_AGE_MSserver/account/join-hold.ts:40JOIN_HOLD_MSserver/account/account-devices.ts:239listNoticesserver/index.ts:327loadAccountDevicesserver/account/account-devices.ts:41LOCAL_DRIVE_POSTSserver/account/account-row-rights.ts:123mayEndHoldserver/account/account-devices.ts:139OrderConflictserver/account/account-order.ts:149parseHoldStateshared/relay-mux.ts:212parseUsedReportPromotedHoldsserver/devices.ts:548pullForRefusedSignInserver/account/mailbox.ts:422readSnapshotserver/account/mailbox.ts:231recoveryActsserver/account/recovery-server.ts:69RELAY_CONTROLSserver/account/account-row-rights.ts:112RevokeAllIntentserver/devices.ts:563rowDropserver/account/account-devices.ts:102SNAPSHOT_MAX_PAGESserver/account/snapshot-read.ts:64snapshotPortsserver/index.ts:619SnapshotWriteRefusedserver/account/account-catch-up.ts:53stageMailboxAddsserver/account/mailbox.ts:245STALE_READ_MSserver/account/account-catch-up.ts:67verifyRelayProofserver/devices.ts:1861withRowDropserver/account/removal-evidence.ts:138Ledger (MUST-CLOSE before S2-38)
ledger/s2-25-r8, ledger/s2-29-r4, ledger/s2-d-rebase, ledger/s2-28-r3, ledger/s2-27-r3 (C2), each with its failing test.
Validation
Per layer,
bun test server/account/ shared/ server/relay/ server/core/socket.test.ts server/devices.test.ts server/dispatch.test.tsandbun run typecheck: S2-24 2167, S2-25 2247, S2-29 2290, S2-28 2309, S2-27 2340, S2-26 2370 pass; machine-profile relay tests timed out only on loaded remote hosts and pass 82/82 alone.bun run check fastat the top: all steps pass exceptserver/machine-core-choice.test.ts"default herdr older peer", which fails on main a79d6ca as well.Reviews so far: relay-hub gate and security-triage pre-reviews per layer; the combined gate on 017f710 is running.