Skip to content

feat(server): admit paired devices and serve HTTP and terminals over a relay session - #2476

Merged
devswha merged 9 commits into
mainfrom
feat/relay-session-auth
Oct 31, 2026
Merged

devswha merged 9 commits into
mainfrom
feat/relay-session-auth

Conversation

@devswha

@devswha devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Summary

Lets the server accept a paired phone's requests through an end-to-end encrypted relay session, keyed by the device's own key. The relay link that would carry those sessions is not in this PR, so nothing reaches this code from the network yet. Builds on #2436 (PR-C: Noise NK, the Ovis Mux v1 codec and engine, and the relay identity), which is merged; this branch is rebased onto main.

  • feat(server): admit paired devices through the relay by device key (todo 8)
    • a relay principal: ServerContext.peer can be { kind: "relay", device, sessionId }, and decideAccess admits it as via: "relay";
    • device enrollment with a P-256 public key (DeviceStore.pairRelay) and signature checks (matchRelay);
    • pairing-code attempts shared with cookie pairing, limits on code issuance and relay failures;
    • via_relay on listed devices; ObservedIngress gains relay.
  • feat(server): serve HTTP and event streams over a relay session (todo 9): server/relay/session.ts.
    • Admission: AUTH with a device signature, or PAIR with a code, over the protected Noise channel.
    • HTTP/SSE are carried over mux streams with per-route deadlines and bounded source queues.
    • Security headers, identity encoding, logging and page-media isolation are kept.
  • feat(server): carry terminal sockets over the relay with their own flow control (todo 10): server/relay/virtual-socket.ts adapts a mux WS stream to the core socket, so /ws attaches run over the relay with per-stream credit.
  • 655d2eae fix(server): keep sessions open when a paired device is renamed: ports only the server side of 9f971b24. Rename and same-role updates keep native WS/SSE and relay sessions open; role changes and revocation still close stale authority. Renaming during WebCrypto verification preserves a valid proof.
  • fccf9cae fix(server): report pairing rate limits over the relay as rate limits: resolves F2 nit 1. PAIR admission sends auth_failed with the native rate-limit message instead of internal_error, as suggested by F2; relay HTTP retains the native 429 pairing_rate_limited response and Retry-After. PAIR is a session frame, not an HTTP request, and has no HTTP status.

Security model

  • Who a relay request is. A relay request is identified only by ServerContext.peer, which only RelaySession sets after a verified AUTH or PAIR. It is never taken from headers or cookies.
    • For a relay peer, the dispatcher ignores the source IP, proxy and Tailscale headers, x-forwarded-for, presented tokens and the device cookie.
    • The request carries only the allowlisted request headers; the session sets origin and sec-fetch-site itself.
  • Routes a relay peer cannot use. /api/auth and /api/devices/pair answer 403 device_key_required to a relay peer. A relay device never holds a cookie: its token_hash hashes a random token that is never issued.
  • AUTH signature. The signature covers ovis-relay-auth/1 || 32-byte fresh nonce || server_id. It is strict base64url, 64 bytes, and checked against a canonical P-256 SPKI, and AUTH is accepted once per session.
    • matchRelay re-reads the device after the WebCrypto await and refuses the proof if the role or key changed meanwhile.
  • Ordering. HTTP_OPEN/WS_OPEN are refused until authenticate() has run, and their device_id must equal it. authenticate() runs only after the match/pair, a has() re-check and the onRevoke registration. A setup frame after authentication is a protocol error.
  • Revocation. Revoking a device or changing its role closes its session (auth_revoked/auth_changed): in-flight HTTP streams are reset and virtual sockets get 1008. A rename or same-role update does not. Every new stream re-checks devices.has. Role changes remain a defence without a production UI or HTTP role-change route.
  • Serve-only installs refuse AUTH/PAIR.
  • First relay enrollment. It closes the device gate on disk before the device is admitted, and clears unconfirmedFirstPairs.

What is NOT user-visible yet

  • No relay link, relay service or /api/relay routes (later PRs), so no code path opens a relay session in production. The new code is reached only by the contract tests.
  • No client relay channel, hosted shell, settings panel, i18n or changelog fragment. The client change is one line: DevicesPanel shows via_relay, which no device can have yet.

Integration notes

  • Commits are cherry-picked with -x from the verified todo commits 8db86dce, 3151c496 and e6958bc4. ff429a45 on the integration branch is the same patch as 3151c496 (equal git patch-id), so it is covered.
  • Conflict: server/dispatch.ts bridgePath. Kept main's /api/usage/statusline and todo 8's relay-aware ip.
  • Conflicts with Portal sign-in (feat(portal): put Portal's own sign-in in front of the public address #2065), rebasing onto main: shared/access.ts AccessVia keeps both "portal" and "relay". server/dispatch.ts keeps main's portalProven and the relay-aware identity; portalProven is also gated on relayPeer === undefined, so a relay peer's headers never count as a Portal proof (the relay branch of decideAccess already runs first, and x-portal-* is not in the relay request-header allowlist). handleMachineRequest keeps main's Portal recheck timer and adds the relay body budget.
  • Semantic conflict: main's telemetry (feat(telemetry): count the day's screens, ways in, prompt answers and alerts #2392) types WS ingress as TelemetryIngress, which has no relay. observedIngress() never returns relay, because a relay peer has no IP and gets unknown. So its return type is narrowed to Exclude<ObservedIngress, "relay"> in the todo-8 commit. This needs no telemetry contract change and no runtime change. Each commit typechecks on its own.
  • Later fixes: the server part of 9f971b24 is included here as 655d2ea; its client and hosted-shell QA changes remain in PR-G. Other fixes touch files that land in a later PR:
Commit Touches here Also touches Goes to
9f971b24 fix(relay): keep a relay session open when its device is renamed Server part ported here as 655d2ea src/lib/relay/{shellState,transport}*, scripts/relay-shell-browser-qa.ts Server: PR-D; client/QA: PR-G
3867dc95 fix(client): queue relay requests while every stream slot is busy shared/relay-mux-engine.ts src/lib/relay/transport*, docs/relay-mux-limits.md PR-G
9b93f0cc fix(relay): reuse the active pairing code in relay offers server/devices.ts, its test server/relay/service* PR-F
ece75165 / 8afdede4 fix(relay): require the PC to prove its key none relay/*, server/relay/{identity,link}.ts PR-F
70edcd26 fix(client): send every API request of the hosted shell through the relay none src/lib/*, QA script PR-G

Review

This PR changes authentication and an HTTP/WS contract, so it waits for a real review. The code-review agent's F2 findings and how each was resolved are in a PR comment.

Validation

Rebased onto main after #2436 was squash-merged (git rebase --onto origin/main 4ac9e3eb; base origin/main 4149232, head fccf9caed6f5cc3d54f17fbbc3ca574dd50a6090). The two Portal conflicts above were resolved by hand; there were no others.

  • bun install --frozen-lockfile: exit 0.
  • timeout 900 bun run typecheck: exit 0.
  • bun test --timeout 15000 server/relay server/devices.test.ts server/device-access.contract.test.ts (check fast does not run the relay contract suites): 129 pass, 0 fail in 5 files, run twice.
  • CHECK_DIR=/var/tmp/ck-prd timeout 1800 bun run check fast: exit 0; revision.testedSha equals HEAD fccf9caed6f5cc3d54f17fbbc3ca574dd50a6090. Workflow syntax, generated types/themes, typecheck, build and unit tests ok; unit: 9854 pass, 0 fail, 41 skip in 623 files.

bun run check full (run before this rebase, on the earlier PR-D head 144bc89b; not re-run after it): exit 1 with 7 failures, all reproduced on untouched origin/main (4c62f57, a scratch worktree) with the same errors, and none in files this PR touches:

failure origin/main PR-D
server/copilot.contract.test.ts: Copilot stand-in not detected fails fails, same error
server/api.contract.test.ts: Grok, Agy, Muse and Codex (native tool call id) fixture processes did not start (4 tests) 181 pass / 4 fail 181 pass / 4 fail, same errors
server/hermes.contract.test.ts: Hermes stand-in did not become the pane's foreground process 8 pass / 1 fail 8 pass / 1 fail, same error
browser lane scripts/ui-contexts-regression.ts: Resource temporarily unavailable (os error 11) (host pid exhaustion) fails fails in check full; passes alone

The fixture-start failures are environmental to the test host (they also fail inside a fresh cgroup); the browser-lane failure is the host's pid limit. Integration lane otherwise: 941 pass, 6 fail, 23 skip in 60 files.

All verification commands unset FFMPEG and set TMPDIR=/var/tmp; retained check isolation uses CHECK_DIR under /var/tmp because the runner otherwise hardcodes /tmp. LSP diagnostics could not initialize because the installed TypeScript 7 package has no tsserver.js; the repository typecheck passed instead.

Skipped: native Windows install (CI owns it).

devswha and others added 5 commits October 31, 2026 17:59
Authenticate trusted relay contexts independently of HTTP credentials. Enroll P-256 public keys atomically with a closed gate, share pairing-code attempts, limit code issuance and relay failures, and invalidate sessions on device updates.

Validation: covering access/devices/contract/dispatch suite: baseline 87 passed; implementation 116 passed twice. Focused relay-device suite: 23 passed. bun run typecheck passed. Signature server-identity mutation failed as expected and was restored. Isolated signed pairing and ten curl header-forgery requests passed; QA port released. check fast deferred to the PR gate as requested.
(cherry picked from commit 8db86dcea604e707ce89e082861fb8bbac2e2059)
Admit protected relay sessions by device key or pairing code, bind revocation before AUTH_OK, and dispatch HTTP/SSE with per-route deadlines and bounded source queues. Preserve security headers, identity encoding, logging, and relay page-media isolation. Expose the WebSocket adapter hook for todo 10.

The existing codec rejected forged identity headers before the session could drop them. Add opt-in receive-side filtering through the existing codec and engine; default strict decoding and all syntax/size gates remain unchanged.

Validation: 396 covering and convention tests pass, then all 30 encrypted session contracts pass again; bun run typecheck passes. Negative cookie-forwarding mutation fails as expected and is restored. Baseline had one pre-existing 5-second SSE stress-test timeout; final covering run uses the documented 15-second per-test budget. Preferences keeps its existing PUT contract; POST remains 405 for drive.
Co-authored-by: sisyphus-dev-ai <[email protected]>
(cherry picked from commit 3151c49640c6ee832e221eb00826d4fec857cf94)
…ow control

Co-authored-by: sisyphus-dev-ai <[email protected]>
(cherry picked from commit e6958bc4479b9ae40701d8b324bbd628e3e45caa)
@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Code-review agent findings (F2) and their resolutions

This PR changes authentication and an HTTP/WS contract (relay principal, relay sessions, virtual sockets), so it waits for a real review (AGENTS.md). This comment records the plan's F2 code review and how each finding was resolved. The review covered the whole e2ee-relay series, not only this PR: the main diff origin/main...e9bf2704 plus the delivery branches, then a delta review of e9bf2704..4f6e8188. Most fixes land in the PR that owns the files they touch. The server part of 9f971b24 is ported separately into this PR so its rename regression does not wait for PR-G.

Verdict: APPROVE with should-fixes. No blocker, CRITICAL or HIGH finding. For the auth boundary in this PR (todos 8-10), the reviewer found no path that lets a relayed request reach a drive or interact route without a verified device signature. It found no way for the relay to read or forge traffic, and no crash path from a malformed frame. Test runs by the reviewer: 643 pass (main diff) and 592 + 11 pass (delta), 0 fail.

Full report: .omo/evidence/e2ee-relay/F2-code-review.md. The "Source" values below are commits on the integration branch feat/relay-e2e. "Lands in PR-X" means that commit is cherry-picked with -x into that later PR, and its SHA there is not known yet.

Should-fix, main review (S1-S5)

# Finding Where Resolution Verification
S1 Anyone who knows a server_id could take over the PC's relay control socket (third-party DoS; confidentiality held because NK pins the server key) relay/core.ts:203-211, :97-101 server_id is now derived from the PC's key, and the PC must answer a challenge on both control and data sockets before it gets a slot (4401 on failure). Source 8afdede4 (orig. ece75165). Lands in PR-F (it touches relay/* from PR-E and server/relay/link.ts from PR-F). .omo/evidence/fix-relay-server-proof-gate-review.md; relay/server-proof.test.ts
S2 The hosted-shell SW passed a PC's answer through on the shared app.ovis.sh origin without enforcing a sandbox (lateral movement between paired PCs) public/sw.js:175-188, :214-224 The SW forces sandbox (except PDF), script-src 'none' and nosniff. These are appended, so a PC policy can only add restrictions. Source e08949fc. Lands in PR-G. .omo/evidence/fix-sw-isolation-gate-review.md; src/relay-resource-worker.test.ts
S3 The blob fallback kept the PC-supplied MIME type and dropped its CSP, while the shell allows frame-src blob: src/lib/relay/resources.ts:40,76-78; server/static.ts:130-133 Allowlist: only raster image/* (SVG demoted), video/*, audio/* and application/pdf keep their type; everything else becomes application/octet-stream. Source 3145ea9e. Lands in PR-G. .omo/evidence/fix-sw-isolation-gate-review.md; src/lib/relay/resources.test.ts
S4 The self-hosted Bun relay had no default abuse bounds relay/bun.ts:14-16, :29-44 Default limits of 120/min per address, 600/min global, 1024 sockets, 256 rooms and 4096 addresses, reserved before upgrade. Source bc1006a5 (orig. ca7e8d11), plus a01bde0a / e8fc8397. Lands in PR-E. .omo/evidence/relay-default-budget-gate-review.md, .omo/evidence/relay-test-clock-gate-review.md; relay/bun-limits.test.ts
S5 update() closed every revocation listener (cookie WS, machine SSE, relay session) on any update; the role-change branch has no production caller server/devices.ts:393-405 Resolved on this branch by 655d2ea, porting only the server part of 9f971b24. Rename and same-role updates preserve sessions and a rename during signature verification preserves the proof. Role changes still close stale authority as a defence; there is no production UI or HTTP role-change route. Client changes stay in PR-G. The watch-only line was dropped from docs/relay.md in the docs branch. Five rename regressions failed before the fix and passed after it. Native WS/SSE survive rename and same-role updates, then close on role change or revoke (WS 1008); attached relay downgrade/readmission also passes.

Should-fix, delta review (M1-M4)

# Finding Where Resolution Verification
M1 A failed pinned-ffmpeg download or SHA-256 mismatch did not fail the CI step .github/workflows/ci.yml:378, :448 The step assigns first, then echoes, so -e stops it. Source 2ef2706e. Lands in PR-H (CI wiring of todo 23). .omo/evidence/e2ee-relay-f2-delta-final-gate-review.md; .omo/evidence/e2ee-relay/fix-f2-delta.txt
M2 The PC treated every 4401 as permanent, including transient proof expiry and its own close server/relay/link.ts:108-114,123; relay/core.ts:279,333 4401 is now only for unrecoverable proof failures. Expiry is retryable, and the PC's own "no challenge" close has its own reason. link.test.ts covers this. Source ae48fa6d. Lands in PR-F. .omo/evidence/e2ee-relay-f2-delta-final-gate-review.md
M3 An 877-line agent draft (.omo/drafts/e2ee-relay-mux-spec.md) was force-added commit 4f6e8188 Dropped. The todo-27 commit was re-made without it (c2b1c8fe) and shipped in PR-C #2436 (squash-merged as b81e604), which has no .omo/ file. .omo/evidence/e2ee-relay-f2-delta-final-gate-review.md
M4 A test that could not fail ("ignores FFMPEG set in the parent environment") scripts/ci-browser.test.ts:150-161 Decision: removed, as the reviewer recommended. The orchestrator first declined M4. The fix executor deleted the test anyway (in 2ef2706e). The gate accepted that because the four remaining cases still fail when the lane's environment isolation is reverted. Lands in PR-H with M1. .omo/evidence/e2ee-relay-f2-delta-final-gate-review.md

A follow-up from L7 (refused HTTP streams beside open WS streams) is also fixed: the client queues relay requests while every stream slot is busy (source 3867dc95). It lands in PR-G. Verified in .omo/evidence/e2ee-relay-f2-delta-final-gate-review.md.

Nit resolved on this branch

Main-review nit 1 (PairingRateLimitedError in server/relay/session.ts) is resolved by fccf9ca. PAIR admission now sends auth_failed with the native rate-limit message instead of internal_error, using the existing session contract and F2's suggested mapping. PAIR has no HTTP status. Relay HTTP pairing preserves native HTTP 429, pairing_rate_limited, and Retry-After. The PAIR regression failed with internal_error before the fix and passed after it; the relay HTTP parity test also passes.

Nits not addressed

Accepted as they stand; none is a security boundary. Each can be a follow-up.

Main review:
2. server/relay/routes.ts:16-18: local_required on offer is cosmetic and has no comment saying it is not a boundary (docs/relay.md says so).
3. server/relay/service.ts offer() reuses a pending Devices-panel code. This was kept on purpose (9b93f0cc): one code pairs either kind of device, and both are drive.
4. scripts/shell-build.ts:108: ovis-render-ready is posted, but nothing listens for it.
5. public/sw.js:153-160: the 5 s timer covers only window selection, not a stalled transport.fetch.
6. shared/relay-mux-engine.test.ts: evidence console.logs still print on every run.
7. server/relay/link.ts: minSupportedClient: "0.4.20" is still a literal.
8. release.yml shell-deploy: contents: write still covers the whole job.
9. relay-deploy.yml: bun test ./relay runs again after the reusable CI.

Delta review:

  • L1 scripts/ci-ffmpeg.sh:28: the cached binary is trusted by its version string only (the .gz hash is checked).
  • L2 relay/bun-limits.test.ts:59: the test name says "default rate limiting", but the test passes explicit limiters.
  • L3 shared/relay-mux-engine.test.ts:1084: a constant-arithmetic assertion.
  • L4 src/relay-resource-worker.test.ts:72: the expected sandbox flag reuses the implementation's MIME parse.
  • L5 relay/core.ts:216: whoever knows the PC's public key can hold the 4 pending-proof slots. The resulting 1013 is retried. No README sentence added.
  • L6 shared/relay-mux-engine.ts:19: the 384 KiB bulk window can delay interactive frames on very slow links. This is documented in docs/relay-mux-limits.md; an adaptive window is a follow-up.
  • L8 relay/bun-limits.ts:45: the admission scan is linear, and scripts/relay-ios-sim.test.ts pins log wording.

What this means for this PR

The two findings in this PR's files are resolved here: S5's server rename behavior in 655d2ea, and nit 1's pairing-rate-limit handling in fccf9ca. No client files from later PRs were ported. Native WS/SSE rename, same-role, role-change and revoke behavior was exercised on this branch, not inferred from the integration branch.

Verification on the PR-D branch

  • HEAD: fccf9caed6f5cc3d54f17fbbc3ca574dd50a6090, rebased onto main after feat(shared): add the Ovis relay crypto, mux and offer foundations #2436 merged. The rename fix is 655d2ea and the rate-limit fix is fccf9ca.
  • Frozen install and repository typecheck passed. bun test --timeout 15000 server/relay server/devices.test.ts server/device-access.contract.test.ts: 129 pass, 0 fail, run twice.
  • timeout 1800 bun run check fast passed: 9854 pass, 0 fail, 41 skip in 623 files; revision.testedSha equals HEAD.
  • Before the rebase, the five rename regressions failed without 655d2ea's change and passed with it, and the PAIR rate-limit regression received internal_error without fccf9ca's change and passed with it.
  • bun run check full (earlier head 144bc89b): 7 failures, all reproduced on untouched origin/main with the same errors; see the PR body's Validation.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

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.

Run configuration

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
Summary

Summary by CodeRabbit

  • New Features
    • Added secure relay access for paired devices, with role-based permissions, device authentication, and support for HTTP and WebSocket connections.
    • Device listings now indicate when access is through a relay.
    • Pairing-code requests and failed relay pairing attempts are rate-limited.
  • Bug Fixes
    • Starting Portal and retrieving remote access settings through a relay now use the server’s actual listening port.
    • Revoking a paired device or changing its role closes its active connections.

This pull request adds relay-device authentication and a protected relay session for HTTP and WebSocket requests. It adds relay-specific access decisions, pairing limits, request and stream controls, and tests for authentication, dispatch, lifecycle behavior, and server-port reporting.

Changes: Relay transport

Layer / File(s) Summary
Relay device authentication and access
shared/access.ts, server/devices.ts, server/access.ts, server/dispatch.ts, server/*access*.test.ts, server/devices.test.ts, server/dispatch.test.ts, server/file-routes.ts, src/components/DevicesPanel.tsx
Device storage and authentication support relay public keys, signature verification, pairing and failure limits, and relay-device identification. Access decisions use the authenticated relay peer and its role. Dispatch uses relay identity instead of socket credentials, and device role changes close active streams.
Relay session and HTTP dispatch
shared/relay-mux*.ts, server/relay/session.ts, server/relay/test-helpers.ts, server/relay/session.contract.test.ts, server/relay/session-port.contract.test.ts, changelog.d/relay-server-port.md
RelaySession handles admission and HTTP dispatch over the mux. Request headers can be filtered during decoding. Contract tests cover request validation, streaming, pairing, cancellation, and relay server-port reporting.
Relay WebSocket adapter
server/core/server-core.ts, server/relay/virtual-socket.ts, server/relay/session.ts, server/relay/session-ws.contract.test.ts, server/relay/session.contract.test.ts
VirtualSocket connects mux streams to core socket handlers. Tests cover WebSocket delivery, buffering, close behavior, revocation, and carrier loss.
Relay event-stream budgets
server/machine-api.ts, server/dispatch.ts, server/relay/session.ts, server/relay/session.contract.test.ts
Machine event streams reserve and release bytes against relay budgets. Relay sessions enforce event-stream limits, and tests cover heartbeat delivery, cancellation, and oversized frames.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Possibly related PRs

  • devswha/ovis#2436: Adds the secure channel and mux foundations used by RelaySession.
  • devswha/ovis#2403: Adds the SocketLike and dispatch seams used by VirtualSocket.
  • devswha/ovis#1977: Adds durable device revocation and active-connection closure, which the relay session extends.

Suggested reviewers: rabbitson87

Merge Risk: Minimal · previous review 15df4

This change adds server-side relay session support that production traffic cannot reach yet. No merge-blocking issue was found. The changelog fragment's heading is a minor classification point the author can adjust if desired.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 31.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: paired-device admission and HTTP and terminal serving through relay sessions.
Description check Passed The description provides detailed change behavior, security constraints, integration scope, linked prior work, validation commands and results, contract-test coverage, skipped checks, and known full-c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description provides detailed change behavior, security constraints, integration scope, linked prior work, validation commands and results, contract-test coverage, skipped checks, and known full-check failures. It uses a "## Summary" heading instead of the template's "## Change" heading, but the required change information is present.

Full details: Docstring Coverage

Explanation

Docstring coverage is 31.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 22 functions across 20 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Share

@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Code review (stands in for CodeRabbit, which skipped this PR)

Reviewed head fccf9caed6f5cc3d54f17fbbc3ca574dd50a6090 against origin/main 41492320 (19 files, +2376/-44). The earlier review is not repeated here. This review covers what the rebase onto main's Portal sign-in (#2065) changed, then the whole PR diff again.

Verdict: APPROVE with one should-fix. No CRITICAL or HIGH finding. A relay peer can never be treated as Portal-proven, Tailscale-proven, loopback, token-holding or bridge-authorized. Requests that Portal vouches for behave exactly as on main.

CRITICAL

None.

HIGH

None.

MEDIUM (should-fix)

M1. Portal started over the relay is pointed at the default port, not this server's port.

  • Where: server/relay/session.ts:259 sets port: undefined in the relay ServerContext, and server/dispatch.ts:352 then passes { port: ctx.port ?? DEFAULT_PORT } (7317) to handlePortalRequest.
  • Why the relay reaches it: a drive relay device can POST /api/portal/start. standingAccess refuses only via === "portal". updateRequestAllowed passes because relayHeaders sets origin to the request's own host and sec-fetch-site: same-origin, and x-herdr-update is in REQUEST_HEADERS.
  • What goes wrong: PortalService.start stores serverPort = request.port (server/portal.ts:499-500) and Portal's upstream becomes 7317. On a server that is not on 7317 (the maintainer's main app runs on 17421), Portal would front the wrong server or nothing. Its saved state then names the wrong port, so stop()/resume ownership checks (portal.ts:486, 585) misjudge it. This is new reachability created by combining main's Portal with relay contexts.
  • Fix: carry the real port into the relay context, for example a port in RelaySessionOptions set by the link. Or refuse /api/portal/start and /stop with device_key_required-style 403 over the relay, as /api/auth and /api/devices/pair already do.

LOW

  • L1. /api/access over the relay reports remoteAccess(DEFAULT_PORT) (server/dispatch.ts:430), which has the same cause as M1. It is read-only, but it can show the wrong tailscale serve state. The M1 port fix fixes this too.
  • L2. Test gap: relay and Portal together. server/dispatch.test.ts:39 sends cookie, bearer, Tailscale and XFF headers with a relay principal, but no x-portal-proof/x-portal-user/x-portal-auth, and no Portal service that vouches. server/access.test.ts:12 likewise leaves portal: { proven: true } out of its relay-first case.
    • The behavior is safe today, protected three ways:
      • the mux header allowlist drops x-portal-* (shared/relay-mux.ts:52);
      • portalProven requires relayPeer === undefined (dispatch.ts:152);
      • decideAccess checks relay first (access.ts:250).
    • No test pins the last two layers against Portal specifically. Suggested: in the relay dispatch test, use a Portal stub whose vouches throws, add x-portal-* headers, and assert via: "relay". Also add portal: { proven: true, ... } to the access.test relay case.
  • L3. Relay /ws telemetry records ingress unknown. observedIngress runs with peerKnown: false on the local /ws path (dispatch.ts:306-308), while /api/health reports relay. This affects telemetry only.
  • L4. startPairing allows 10 codes per 10 minutes for the whole store (server/devices.ts, codeIssues). It is shared by every caller, including the owner on the PC itself. The HTTP side returns a proper 429 with Retry-After. Only an authenticated drive principal can reach it, so this is UX only.
  • L5. 20 failed relay PAIRs lock relay pairing for every caller for 10 minutes (relayFailures, relayBlockedUntil). This is an accepted trade-off: a caller needs the PC's relay key to send PAIR, and 5 wrong guesses already end a pending code anyway. Noted for the docs.

Checked and fine

  • Order of access decisions. decideAccess returns the relay principal before checking the token, device cookie, Portal, the token gate, Tailscale or open access (server/access.ts:250).
  • Relay principal source. It comes only from ctx.peer, which only RelaySession.context() builds after a verified AUTH/PAIR and AUTH_OK commit.
  • Credentials ignored for a relay peer (dispatch.ts:117-152):
    • no requestIP, so loopback=false;
    • forwarded, funnel, tailscaleLogin and forwardedFor are forced off;
    • bridgeAuthorized=false and presented=null, so no token guess is counted or matched;
    • no cookie lookup;
    • identityOf is skipped (all-null identity);
    • portalProven=false.
  • Request headers. Defense in depth: the mux filter on the server side drops non-allowlisted request headers after syntax and size checks (shared/relay-mux.ts:156-159), and relayHeaders rebuilds the header set with a fixed origin. No cookie, host, authorization, x-portal-*, tailscale-* or x-forwarded-* gets in. set-cookie is not in RESPONSE_HEADERS.
  • Portal-proven requests on a socket are unchanged. portalProven is main's expression ANDed with relayPeer === undefined. server/portal.test.ts and server/open-access.test.ts (main's Portal tests) pass on this head: 81 pass, 0 fail.
  • Portal recheck timer. portalRecheckMs is set only when access.via === "portal" (dispatch.ts:235), which a relay peer can never be. Relay SSE gets deviceId, so handleMachineRequest uses devices.onRevoke(deviceId, …), never the timer. Relay /ws gets no recheckMs. The timer therefore cannot outlive a relay session or close one.
  • Revocation.
    • On a role change or revoke, the session closes as auth_changed/auth_revoked. It resets HTTP streams and closes virtual sockets with 1008.
    • SSE also closes through onRevoke.
    • principal() checks devices.has again on every OPEN.
    • matchRelay drops a proof whose role or key changed during WebCrypto.
  • Watch role. It goes through the existing readOnly gates. /api/auth and /api/devices/pair are refused over the relay, so a relay session cannot mint a cookie or a second device.
  • Bounds.
    • The relay SSE budget is reserved before enqueue and released by pull and cleanup. Every path that does not enqueue ends with drop(), which releases it.
    • Each source is capped at 3 MiB and each session at 32 MiB.
    • The rate-limit key is relay:<deviceId>, not the session or a forged XFF; dispatch.test.ts covers this.
  • Page media. It is not issued over the relay: file-routes.ts:79 sets the media source to null for via === "relay".

Skill-perspective check (remove-ai-slops / programming)

Applied from the documented criteria; the skill files were not loaded in this run. The new tests:

  • assert behavior at the boundaries, such as spies proving cookies and Tailscale are never inspected, and per-device 429 keying;
  • do not mirror constants and are not tautological;
  • add no needless parsing in production. The only new validation, isRelayPublicKey and matchRelay input checks, sits at the trust boundary.

No violation found.

Tests run (fresh detached worktree, bun install --frozen-lockfile)

  • bun run typecheck: exit 0.
  • bun test --timeout 15000 server/relay server/dispatch.test.ts server/access.test.ts server/devices.test.ts server/device-access.contract.test.ts: 208 pass, 0 fail (7 files).
  • bun test --timeout 15000 server/portal.test.ts server/open-access.test.ts: 81 pass, 0 fail.
  • Not run: bun run check fast/full and browser/Windows lanes.

@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Follow-up to #2476 (comment), addressed in 5819122 (fix(server): give relay requests the server's real port).

M1. Portal started over the relay is pointed at the default port, not this server's port.
L1. /api/access over the relay reports remoteAccess(DEFAULT_PORT).

RelaySessionOptions now requires the server's resolved listening port and passes it to every relay request context (HTTP and WebSocket). The session setup supplies app.port after binding, matching the native context's Bun.Server.port source. PR-D currently has no production carrier/link constructor; its only session construction site is the relay fixture, and future link constructors must supply the required port.

Two real protected-channel regressions in server/relay/session-port.contract.test.ts failed before the production fix: the Portal stand-in received --http-route /=7317 instead of /=39367, and /api/access returned 7317 instead of listener 34549. After the fix, both pass. The Portal test exercises POST /api/portal/start through the authenticated mux and real Portal service, observes the stand-in runner's arguments through a subscribed filesystem event, and checks the saved ownership port. No public relay is contacted.

L2. Test gap: relay and Portal together.

The dispatch regression now configures a Portal service whose vouches would return true, sends x-portal-proof, x-portal-user and x-portal-auth alongside driving cookies and tokens, and asserts the watch device remains via: relay, with its device ID and watch permissions. It also asserts Portal proof checking is never called. The access regression now supplies a proven driving Portal identity alongside the watch relay principal and still selects only that relay principal.

L3. Relay /ws telemetry records ingress unknown.

Left unchanged as requested: TelemetryIngress in shared/telemetry.ts excludes relay, and telemetryUsage validates incoming usage against that allowlist. Adding relay would extend the shared telemetry/receiver contract rather than fix only dispatch. Health already reports relay; terminal telemetry remains unknown.

L4. startPairing allows 10 codes per 10 minutes for the whole store.
L5. 20 failed relay PAIRs lock relay pairing for every caller for 10 minutes.

Accepted trade-offs, unchanged: authenticated driving callers share the code-issue budget, and peers holding the PC's relay key share the failed-PAIR lockout. A pending code still ends after five wrong guesses.

Validation: bun install --frozen-lockfile and bun run typecheck passed. The requested bun test --timeout 15000 server/relay server/dispatch.test.ts server/access.test.ts server/devices.test.ts server/device-access.contract.test.ts server/portal.test.ts server/open-access.test.ts passed twice, each 291 pass / 0 fail. timeout 1800 bun run check fast passed: 9,854 pass / 0 fail / 41 skip, workflow syntax, generated files, typecheck and build all green. Its report has status: success, verification.status: verified, unchanged clean source, and testedSha == HEAD == 5819122cbe56dc8904471e26bd58c0647c8bfb5f. Full/browser/native-platform lanes were not run locally; GitHub CI is being watched with the requested foreground command. One push; no merge and no additional review request.

@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

L2 now covered over a real encrypted relay session: 15df422

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional comments: 1
changelog.d/relay-server-port.md-1-3: 1

1-3: Minor · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Delete this ### Fixed entry or move it to ### Maintenance.

The fragment says relay sessions now use the server's listening port. Relay sessions are not in any release. The PR also states that the relay link is not included, so production traffic cannot reach this code. The wrong-port defect existed only inside this PR series. A ### Fixed line in CHANGELOG.md would tell users about a fix for a feature they never had. CONTRIBUTING.md says a fragment is for "a change users notice".

Proposed fix
-### Fixed
-- Starting Portal and reading remote access settings over a relay session now use this server's
-  listening port instead of the default port.
+### Maintenance
+- Relay sessions pass this server's listening port to Portal startup and `/api/access`.

Sources: Coding guidelines, Learnings


Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4149232 and 15df422.

Files selected for processing: 21
  • changelog.d/relay-server-port.md
  • server/access.test.ts
  • server/access.ts
  • server/core/server-core.ts
  • server/device-access.contract.test.ts
  • server/devices.test.ts
  • server/devices.ts
  • server/dispatch.test.ts
  • server/dispatch.ts
  • server/file-routes.ts
  • server/machine-api.ts
  • server/relay/session-port.contract.test.ts
  • server/relay/session-ws.contract.test.ts
  • server/relay/session.contract.test.ts
  • server/relay/session.ts
  • server/relay/test-helpers.ts
  • server/relay/virtual-socket.ts
  • shared/access.ts
  • shared/relay-mux-engine.ts
  • shared/relay-mux.ts
  • src/components/DevicesPanel.tsx

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

@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Strict auth review by the merge pass at 15df422 (own repros on the PR's relay test helpers). Not clean for 0.4.22; it waits.

HIGH, reproduced:

  1. server/relay/virtual-socket.ts:21-30: after the phone closes the terminal socket normally, a key already waiting to be typed still goes through. On a real isolated pane, Enter ran after the close arrived. A native socket drops it (nothing a user typed is sent after a disconnect).
  2. server/relay/virtual-socket.ts:29 with shared/relay-mux-engine.ts:446-462: messages are handled one at a time, so an observe request waits behind a key in flight and that key is typed. A native socket refuses the same key once observe is asked.

Passed: device AUTH (the signature covers a fresh per-session nonce plus the server id, so it can't be replayed into another session or after revocation; unknown keys refused; a watch device stays watch through the relay, all 140 write calls refused like a cookie watch device); PAIR (shared five-try budget with cookie pairing, single-use, expiry, serve-only refusal, issue limit); principal confusion (forged cookies, tokens, loopback, Tailscale and Portal headers, Host and Origin dropped; CSRF guard still required; a relay device gets exactly a paired device's rights); bounds (32 streams, bounded queues, 64 MiB+1 body gets 413).

Notes: the signature binds the per-session nonce, not the Noise transcript; route deadlines are idle timeouts, so a one-byte-per-59 s trickle keeps a request open (LOW). Still unwired (the only RelaySession is in test helpers); missing: identity/offer publishing, carrier and routing, guarded handshake, session creation, shutdown, phone client. It depends on #2495 (#2471 fixes) before wiring; #2495 does not fix the two HIGHs. Touched tests 489/0 and typecheck pass; they pass despite both HIGHs, so each fix needs a test that fails today.

…e before them

A relay terminal socket handled one message at a time and ended only once
the last handler settled and its own CLOSE was sent. So a key waiting to be
typed when the phone closed the socket was still typed, and an observe
request waited behind a key in flight, which was typed.

Messages now reach the core as on a native socket, without waiting for the
previous one's handling, and the peer's graceful CLOSE detaches the core as
soon as the messages before it were handed over (WsStream.onPeerClose), even
while this side's CLOSE still waits behind output. Until then the socket
reads as open, so a reply to one of those messages is not taken for a
stalled socket.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Deploying ovis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5cb1417
Status: ✅  Deploy successful!
Preview URL: https://fa238df1.ovis.pages.dev
Branch Preview URL: https://feat-relay-session-auth.ovis.pages.dev

View logs

@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Both HIGHs from the strict auth review are fixed in 5cb1417 (fix(server): drop relay keys not yet typed at close, and apply observe before them). origin/main is merged in at 789fc39.

  • Cause: WsStream waited for each core handler before handing over the next message. The socket ended only once that handler settled and the server's own CLOSE went out.
  • Fix: VirtualSocket now hands each message to the core without waiting, as Bun does for a native socket, so a role change reaches the core before a key still in flight is typed. The new WsStream.onPeerClose ends the core connection as soon as the messages before the peer's graceful CLOSE have been handed over, even while this side's CLOSE still waits behind output. A key not yet written is then dropped (clients.has / mayType).
  • During that drain: the socket still reads as open, so a reply is not taken for a stall (4008).

Tests, in server/relay/session-ws.contract.test.ts, on a real pane in the isolated test session with port 0:

  • Two tests hold a guarded Enter in flight, then close the socket or ask for observe. Both failed on 15df422 because the marker command ran. Both pass now. A throwaway check of the same scenarios on a native socket also showed the command never ran.
  • A test pins onPeerClose while the server's CLOSE waits behind output that has no credit. It fails with the hook removed.
  • The handover test now replays a burst in one turn. It fails without the drain fix.

Validation: bun run check fast passed (9,900 pass / 0 fail / 41 skip, typecheck and build ok). Relay and mux tests: 169/0.

Reviews:

  • omo code review: APPROVE. Its two MEDIUMs (onPeerClose untested, a reply during the drain closing as 4008) are fixed above.
  • Codex Terra (gpt-6.1-terra, xhigh), two rounds. Its MEDIUM and LOW are fixed. Declined, as native parity:
    • Core work no longer bounded by mux credit: native sockets don't bound it either, so a core-wide bound would be a separate change.
    • A 4008 when a reply crosses the 1 MiB output cap during a drain: connections.send applies the same check to native sockets.

@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Delta auth re-review by the merge pass at 5cb1417 (own repros on a real isolated pane): both HIGHs fixed and no longer reproduce (server/relay/virtual-socket.ts:27,31; shared/relay-mux-engine.ts:489,517). Variants all refused the key and ran nothing: close codes 1000/1001/1008/4008/empty, abort, carrier loss, mux reset, observe with 8 keys queued, observe then interact, revocation mid-queue, close or revocation while output is held, key and close in one burst; nothing typed is sent after a disconnect. The declined 4008 item is not an issue (it only changes the close code of a socket already closing). LOW: 1,024 core handlers can wait while the relay buffer shows 0 bytes; a close refuses all of them, as on a native socket. AUTH, PAIR and principal handling unchanged by the main merge (passed in the first review). The 4 new tests fail on the pre-fix code and pass 20/20 over 5 repeats; relay and mux tests 347/347, typecheck pass. Verdict: clean for 0.4.22 as unwired code; it must not be wired before #2495 (the #2471 fixes), which merges first.

devswha added a commit that referenced this pull request Oct 31, 2026
…the identity private (#2471) (#2495)

Fixes #2471.

The relay foundation added in #2436 is not wired into the app yet. This
fixes the three review findings in it before anything connects to the
relay. Each fix has a test that fails on main.

## Changes

**Carrier size is checked before decoding** (`shared/relay-e2ee.ts`)
- A guard now sits between the carrier and the vendored paseo-e2ee
channel. The vendored files are unchanged and still match their SHA-256
manifest.
- Before this, the vendored channel decoded and allocated a whole
message, and only the mux codec rejected an oversized frame afterwards.
- Now a message larger than the protected record of a maximum mux frame
(`MAX_FRAME_BYTES`) closes the carrier undecoded. The limit applies to
binary frames, to base64 text (by its decoded size) and to text frames
whose data arrives as bytes.

**The handshake queue is bounded**
- Until the handshake completes, the daemon counts every inbound
message: per connection by count and bytes, and across all connections
by bytes.
- Each queued message is charged a 64-byte overhead, so empty messages
cannot escape the byte budget.
- Past any cap the connection closes with 4002. The budget is released
when the handshake completes or the carrier closes.
- A handshake whose carrier closed while its ready was being sent never
fires `onopen`, never delivers the messages it queued, and its
`openDaemonSecureChannel` promise rejects.
- Client sends queued before the handshake now have a byte cap as well
as the existing count cap. A refused send no longer uses up a count
slot.

**The identity file is kept private** (`server/relay/identity.ts`)
- On POSIX, an existing `relay/identity.json` that group or others can
read is changed back to 0600 when it loads. That covers both the normal
load and the path where another creator published first.
- If its mode cannot be changed, loading fails with
`identity_unreadable`.
- New files were already written 0600 through `private-state.ts`.
Windows is unaffected.

This PR does not touch `shared/relay-mux.ts`,
`shared/relay-mux-engine.ts` or any file changed by #2476.

## Validation
- `bun run check fast` passed: typecheck, build and unit tests. It ran
on the commit before a rebase onto main that touched none of these
files.
- `bun test shared/relay-e2ee.spike.test.ts
server/relay/identity.test.ts` gave 56 pass, 0 fail.
- On main, the new tests fail on behaviour:
  - an oversized record is decoded and delivered;
  - a stalled handshake never closes;
  - an identity file left at 0644 stays 0644.
- Each fix was also reverted on its own to confirm its test fails:
in-flight close, `isBinary` limit, per-message overhead, and
`onopen`/resolve after close.
- Reviews: a code-review agent and three passes of an independent model
review. Their findings were fixed, or declined with a reason:
- Declined: text limits count UTF-16 code units, because valid carrier
text is ASCII and the length already bounds memory.
- Declined: closing links in the budget test, because `afterEach`
already closes every link the test opens.
- Skipped: `bun run check full` and the Windows checks. CI covers those.
@devswha

devswha commented Oct 31, 2026

Copy link
Copy Markdown
Owner Author

Merging 5cb1417 on the maintainer's go (into 0.4.22 once clean): the server admits paired devices and serves HTTP and terminals over a relay session, keyed by the device's own P-256 key; the relay link itself is not wired yet. Strict auth reviews by the merge pass (records above): device AUTH binds a fresh per-session nonce plus the server id (no replay into another session or after revocation), a watch device stays watch through the relay, pairing shares the cookie pairing's attempt budget and is single-use, forged headers inside the tunnel are dropped and a relay device gets exactly a paired device's rights, streams and bodies are bounded. Two HIGHs in the relay terminal socket (a key typed after close, a key typed while observe waited) were fixed by lane fix-2476 and re-checked clean. Lands after #2495 (the #2471 relay fixes); wiring must come after both. LOW: route deadlines are idle timeouts; the signature binds a per-session nonce, not the Noise transcript.

@devswha
devswha merged commit 4ca7d24 into main Oct 31, 2026
29 of 31 checks passed
@devswha
devswha deleted the feat/relay-session-auth branch October 31, 2026 13:56
devswha added a commit that referenced this pull request Oct 31, 2026
Part E of the end-to-end encrypted relay series (plan todo 11 and the
relay half of todo 22).
PR-D (#2476) is merged, so this PR is based directly on `main`.

## What this adds

- `relay/`: the meeting point for a PC running Ovis and a phone or
browser that cannot reach it
directly (`relay.ovis.sh`). Both sides dial out. The relay pairs their
WebSockets by the PC's
  `server_id` and passes frames through unchanged.
- `relay/core.ts`: a platform-neutral routing core with `GET /health`
and
`GET /v1/ws?server_id=<32
hex>&role=server|client[&connection_id=..]&v=1`, plus the control
messages `assigned`, `sync`, `connected` and `disconnected` and the
`{"type":"ping"}` keepalive.
- `relay/worker.ts` and `relay/wrangler.toml`: a Cloudflare Worker with
one Durable Object per
`server_id`. The keepalive is answered by `setWebSocketAutoResponse`, so
an idle PC never wakes
the Durable Object. The idle close runs from a Durable Object alarm and
keeps its 120 s floor
    across an eviction.
- `relay/bun.ts`: the same core as a plain Bun server, used by the tests
and by anyone who runs
their own relay. It has no rate limiter by default; `startBunRelay({
limiters })` accepts
    Cloudflare's limiter shape.
- `relay/load-smoke.ts`: a load smoke script (`--pcs 200 --clients 4`)
that exits 1 unless every
    frame arrives intact and in order.
- `.github/workflows/relay-deploy.yml`: deploys the relay from CI only.
It runs on a push to main
that touches `relay/**` (after the reusable CI passes) or on a manual
run from main. The job runs
in the `production` environment: `bun test ./relay`, then `bunx wrangler
deploy`, then a health
check that requires a 2xx answer from `https://relay.ovis.sh/health` (5
attempts, 20 s each).
- `scripts/relay-deploy-workflow.test.ts`: guard tests for the workflow.
They execute the real
health step against a local 200, 302 and 503, and cover the
skip-on-missing-secrets path.
- `scripts/ci-tests.ts` and `tsconfig.json` now include `relay/`, so
Fast checks runs and
  typechecks it.

## What the relay sees

Frames are end-to-end encrypted between the device and the PC (Noise NK,
earlier PRs), so the
relay carries ciphertext it has no key for. It never parses or logs a
frame.

Per socket, the relay sees:
- the `server_id`, the role and the `connection_id`;
- when frames pass and how large they are;
- the connecting address, used only as the key of the per-address rate
limiter.

It keeps nothing. Routing state lives in memory and, on Cloudflare, in
the socket's own
attachment. A client's early frames are held in memory only until its
data socket attaches. The
Durable Object's SQLite storage stays empty (it holds only the idle
alarm), Workers Logs are off
(`[observability] enabled = false`), and the code writes no log lines.
The relay imports nothing
from `server/` or `src/`.

## Limits

| Limit | Value | Past it |
|---|---|---|
| frame size | 64 KiB (Ovis frames stay under about 22 KiB) | close
`1009` |
| clients per `server_id` | 8 | close `1013` |
| clients waiting for a data socket, per `server_id` | 4 | close `1013`
|
| frames held for a waiting client | 200 frames or 1 MiB | close `1013`
|
| idle | 120 s with no frame or keepalive (at most 150 s after a Durable
Object eviction) | close `1001` |
| connections per address (Cloudflare) | 30 per minute | `429`,
`Retry-After: 60` |
| connections from all addresses (Cloudflare) | 600 per minute | `429`,
`Retry-After: 60` |

The other close codes:
- `1008`: a duplicate control socket (the newest wins), an unknown wire
version, or a second data
  socket for one client.
- `1012`: the PC side went away. Clients should reconnect.
- A malformed query gets `400`, and a request that is not an upgrade
gets `426`.

## Worker vs Bun

Both adapters share `core.ts` and the same per-socket limits. The Worker
(`relay.ovis.sh`) adds
Cloudflare's rate limiters, Durable Object hibernation and the
alarm-driven idle close. The Bun
server is for tests and self-hosting behind a TLS proxy, and applies no
rate limit unless given
limiters. Its default socket and room limits arrive in a later PR in
this series (see Placement).

## Deploy and the owner's Cloudflare setup

The Cloudflare production secrets now exist. On 2026-10-31 the GitHub
environment `production`
(protection rule: required reviewers) held `CLOUDFLARE_ACCOUNT_ID` and
`CLOUDFLARE_API_TOKEN`
(checked with `gh secret list --env production`; the values were not
read). So once this PR
merges, the Relay deploy job will actually deploy `relay.ovis.sh`: it
waits for the `production`
environment's reviewer to approve, then tests, deploys and checks
health. The
`Relay deploy skipped` notice applies only while either secret is
missing. The one-time setup,
for reference:

1. A Cloudflare account on the Workers Paid plan (Durable Objects need
it), with a billing alert
at $20 a month, and the `ovis.sh` zone. The first deploy attaches
`relay.ovis.sh` as the
   Worker's custom domain.
2. A GitHub environment named `production`, optionally with the
maintainer as required reviewer.
3. A Cloudflare API token and the account id, saved as
`CLOUDFLARE_API_TOKEN` and
`CLOUDFLARE_ACCOUNT_ID`. They must be secrets of the `production`
environment, not repository
   secrets.

After the first deploy, check that `curl -i
https://relay.ovis.sh/health` returns 200 (the job's
health step already requires a 2xx). Both relay.ovis.sh and app.ovis.sh
answered 525 when checked
on 2026-10-30, before any deploy.

## Validation

### Review fixes (HEAD 754fc48)

bb19ff5 pins Wrangler 4.156.0 in the deploy step and the README, and
adds a guard test.
754fc48 documents the health-check retries in the README. Run on HEAD
`754fc48b`:
`bun run typecheck` exit 0; `bun test ./relay
scripts/relay-deploy-workflow.test.ts` once: 32 pass,
0 fail (the new guard test fails against the unpinned workflow);
actionlint 1.7.12 on
`relay-deploy.yml` exit 0; `CHECK_DIR=/var/tmp/ck-pre2 timeout 1800 bun
run check fast` exit 0
(10005 pass, 0 fail, 41 skip in 627 files), `report.json` `testedSha`
equals HEAD. Skipped:
the wrangler dry-run was not repeated (only the version pin changed).

### Rebase onto main 4ca7d24 (2026-10-31, after PR-D #2476 merged)

Rebased the four commits from PR-D's last head 5cb1417 onto
`origin/main` 4ca7d24 (the PR-D
squash) with `git rebase --onto`, without conflicts. HEAD is now
`86cb7cbd`. The diff against main is
the 13 files listed above: `relay/` (10 files),
`.github/workflows/relay-deploy.yml`,
`scripts/relay-deploy-workflow.test.ts`, `scripts/ci-tests.ts` and
`tsconfig.json`.

Run on HEAD `86cb7cbd`:
- `bun install --frozen-lockfile`: exit 0, no changes.
- `bun run typecheck`: exit 0.
- `bun test --timeout 15000 server/relay src/lib/relay shared relay
scripts/relay-deploy-workflow.test.ts`,
  run once: 557 pass, 0 fail in 24 files.
- `actionlint` 1.7.12 (the version `scripts/check.ts` pins) on
`.github/workflows/relay-deploy.yml`:
  exit 0, no findings.
- `bunx wrangler deploy --dry-run --outdir <tmp>` in `relay/` (wrangler
4.156.0): exit 0. The bundle
is 13.72 KiB (4.05 KiB gzip), with bindings RELAY (Durable Object),
RELAY_LIMITER and
  RELAY_GLOBAL_LIMITER.
- `CHECK_DIR=/var/tmp/ck-pre timeout 1800 bun run check fast`: exit 0.
Workflow syntax, generated
types and themes, typecheck, build, and unit tests (10004 pass, 0 fail,
41 skip in 627 files).
  `report.json` `testedSha` equals HEAD `86cb7cbd`.

The sections below are from earlier heads.

### Restack onto PR-D 5cb1417 (2026-10-31, second pass)

PR-D's merge pass added 789fc39 (merge of origin/main) and 5cb1417
(two HIGH auth fixes in `server/relay/virtual-socket.ts` and
`shared/relay-mux-engine.ts`: keys not yet typed when the peer closes
are dropped, and observe is applied before keys still in flight).
Rebased onto PR-D 5cb1417 without conflicts. Nothing in this stack
changes either fix: the only stack commit touching those files (PR-G's
"queue relay requests while every stream slot is busy") just adds
`MuxEngine.onStreamAvailable`. `git range-diff` shows all four patches
identical.

On HEAD ccb380f5: `bun install --frozen-lockfile` no changes; `bun run
typecheck` exit 0; `bun test --timeout 15000 server/relay src/lib/relay
shared relay` once: 536 pass / 0 fail in 24 files; `check fast` ran once
at the top of the stack (PR-I bfff437d), not on this head. The sections
below are from earlier heads.

Rebased without conflicts from the old PR-D head e609c307 onto PR-D's
current head `15df422f`
(PR-D rebased on main, with main's Portal sign-in merge and its review
fixes). `git range-diff`
shows all four patches identical. Run on HEAD `25a0d163`:
- `bun install --frozen-lockfile`: exit 0, no changes.
- `bun run typecheck`: exit 0.
- `bun test ./relay scripts/relay-deploy-workflow.test.ts`, run twice:
31 pass, 0 fail both times.
- `bun test --timeout 15000 server/relay`: 65 pass, 0 fail.
- `actionlint` 1.7.12 (sha256-verified release binary, the version
`scripts/check.ts` pins) on
  `.github/workflows/relay-deploy.yml`: exit 0, no findings.
- `bunx wrangler deploy --dry-run --outdir <tmp>` in `relay/` (wrangler
4.156.0): exit 0. The
bundle is 13.72 KiB (4.05 KiB gzip), with bindings RELAY (Durable
Object), RELAY_LIMITER and
  RELAY_GLOBAL_LIMITER.
- `CHECK_DIR=/var/tmp/ck-pe4 timeout 1800 bun run check fast`: exit 0.
Workflow syntax, generated
types and themes, typecheck, build, and unit tests (9885 pass, 0 fail,
41 skip in 626 files).
  `report.json` `testedSha` equals HEAD.

Earlier runs: HEAD `6ef9ff81` (on PR-D e609c307) passed typecheck, the
relay tests and check fast.
The pre-rebase HEAD `9109786f`:
- `bun install --frozen-lockfile`: exit 0.
- `bun run typecheck`: exit 0.
- `bun test ./relay scripts/relay-deploy-workflow.test.ts`, run twice:
31 pass, 0 fail both times.
- `bunx wrangler deploy --dry-run --outdir <tmp>` in `relay/`: exit 0.
The bundle is 13.72 KiB
(4.05 KiB gzip), with bindings RELAY (Durable Object), RELAY_LIMITER and
RELAY_GLOBAL_LIMITER.
- `actionlint` 1.7.12 (sha256-verified release binary) on
`.github/workflows/relay-deploy.yml`:
  exit 0, no findings.
- `bun run check fast`: exit 0. Workflow syntax, generated types and
themes, typecheck, build, and
unit tests (9537 pass, 0 fail, 36 skip in 599 files). `report.json`
`testedSha` equals HEAD.

Skipped:
- `bun run check full` and the browser/integration lanes. Nothing in
this PR runs in a browser.
- A live deploy and the `relay.ovis.sh` health check. The secrets are in
place, so the Relay
deploy job runs them after merge, once the `production` reviewer
approves.
- This run did not repeat the load smoke (`bun relay/load-smoke.ts --pcs
200 --clients 4`) or the
1000-frame forward and 17th-client cap QA. Their evidence comes from the
todo 11 run on the same
code (range-diff shows identical patches): `task-11-forward.txt`,
`task-11-cap.txt` and
  `task-11-load.txt`.

## Placement of later relay fixes (not in this PR)

| Commit | Goes to | Why |
|---|---|---|
| 8afdede4 server proof | PR-H | It also changes `server/relay/link.ts`
(PR-F) and the e2e and shell QA scripts (todo 23 / PR-H). |
| ae48fa6d transient proof refusal | PR-H | It builds on 8afdede4's
proof refusal. It also changes `server/relay/link.ts` (PR-F). |
| bc1006a5 Bun relay default limits | PR-H | It changes
`scripts/relay-e2e-regression.ts` (todo 23) and
`scripts/relay-shell-browser-qa.ts`. |
| a01bde0a per-address budget | PR-H | It builds on bc1006a5 and changes
`scripts/relay-media-browser-qa.ts` (todo 17). |
| e8fc8397 test clock for the limits | PR-H | It builds on bc1006a5's
`relay/bun-limits.test.ts`. |

No changelog fragment: the relay has no user-facing entry point until
the server link (PR-F)
and the settings toggle (PR-G) land.

---------

Co-authored-by: sisyphus-dev-ai <[email protected]>
devswha added a commit that referenced this pull request Nov 2, 2026
## Release 0.4.22

The release PR, prepared by step 1 of
[docs/development.md#releasing](https://github.com/devswha/ovis/blob/main/docs/development.md#releasing)
on main `41492320` (#2453 the last merge), refreshed to main `99a6671f`
(#2582 the last merge).

**Do not merge yet:** the owner tests main and judges the final build
before release. No tag and no Release run from this PR's author.

- **Version:** `version` is 0.4.22 in `package.json` and
`herdr-plugin.toml`.
- **Changelog:** `bun scripts/changelog-fold.ts 0.4.22` (2026-10-31,
local) folded 20 fragments into the 2026-10-31 section of `CHANGELOG.md`
(23 entries with the hand entry), linked their PRs and deleted the
fragments; `changelog.d` holds only `README.md`.
- `by @login` on every outside contributor's PR link: #2453 @jokkopucko,
#2452 @jokkopucko, #2442 @nahwan-kim, #2463 @zerodice0, #2468
@Yoonwoo-Ha, #2065 @rabbitson87 (both entries), #2466 @jpcarranza94,
#2467 @jpcarranza94, #2457 @YuuuXie, #2420 @cheol-95 (both entries),
#2459 @Haeminway1, #2450 @briantcl1992, #2448 @briantcl1992.
- One outside PR had no fragment and got an entry by hand: #2448
(installer test no longer finds the host's Node, Maintenance).
- Issue reporters: #2442's entry credits @Ploppy3, who asked for
herdr-core support in #2439. The other fixed issues were filed by the
PR's own author (#2460 @zerodice0, #2464 @jpcarranza94, #2419 @cheol-95,
#2089 @rabbitson87) or the maintainer (#2444), so the PR credit covers
them.
- Two fragments ran past the changelog's width (#2443, #2446); their
entries are re-wrapped, words unchanged.
- Folded after the PR opened (merge of main `653613cb`, by hand per the
release steps): #2474 (Pi Chat message with leading/trailing spaces, a
tab or a trailing `@mention` no longer stuck "waiting for transcript",
Fixed), credited `reported by @BeerBelly69` (he reported issue #2454;
the PR is the maintainer's, so the earlier `by @BeerBelly69` was
corrected in `90536524`). Its fragment is deleted; `changelog.d` holds
only `README.md`. The release summaries are unchanged: their fixed list
is already at five lines.
- Folded in a second refresh (merge of main `98c1f5e0`, by hand): #2475
(a reconnecting or reloading browser gets back its follow-up's lost
"sent" receipt, Fixed), credited `reported by @christso`, who filed
#2421 and proposed the approach. Its fragment is deleted; `changelog.d`
holds only `README.md`. The release summaries are unchanged (fixed list
already at five lines).
- Folded in a third refresh (merge of main `af20e0a4`, by hand): #2490
(Chat keeps its messages mounted when the pane's skill names load, so a
decoded image no longer drops back to its loading slot, Fixed), credited
`by @nocstah` (outside PR, no linked issue); #2483 (a Copilot turn stays
whole when its pictures pass the page window, Fixed); #2479 (Chat shows
the pictures in a Copilot CLI session, Added); #2482 (Chat shows the
picture attached to a Hermes prompt, Added). #2483, #2479 and #2482 are
maintainer PRs; #2483's issue #2478 is the maintainer's, so no reporter
credit. #2480 (site only) had no fragment. Their fragments are deleted;
`changelog.d` holds only `README.md`. The release summaries are
unchanged: the fixed list is already at five lines, and the two new
picture features stay in the changelog only (the new list has room for
them if the owner wants them there).
- Folded in a fourth refresh (merge of main `4ca7d24d`, by hand): #2481
(Grok pictures in Chat), #2477 (svg figures, `reported by @affeek`, who
filed #2441 and co-authored the PR), #2498 (dollar math, `reported by
@kjohnsen`, #2407), #2484 (Expand thinking / Collapse work defaults,
`reported by @altgans and @Ploppy3`, #2346 and #2228) under Added; #2494
(`by @todor-a`), #2491 (`by @nocstah`), #2487, #2486, #2472 (`reported
by @matiemer`, #2462) and #2476 (relay session uses the server's port)
under Fixed. 10 fragments deleted; `changelog.d` holds only `README.md`.
Every entry's credit was re-checked with GraphQL (PR author, closing
issues' authors, commit authors): #2487's #2374, #2486's #2485 and
#2483's #2478 are the maintainer's, so no reporter credit.
- Folded in a fifth refresh (merge of main `f5370d54`, by hand): #2503
(Claude question card steps and Back, `reported and co-authored by
@jpcarranza94`, who filed #2465 and co-authored the fix), #2502 (tab
name from its first message, `reported by @vibewriter-hand`, #2019) and
#2505 (a note on a diff line goes into the next message; #1603 is the
maintainer's, so no credit) under Added; #2506 (OmO, Codex and Hermes
question cards move between questions without answering; it closes no
issue, so no credit) under Fixed. 4 fragments deleted; `changelog.d`
holds only `README.md`. #2499's hand-written relay entry is kept. All
four PRs are the maintainer's; credits re-checked with GraphQL (PR
author, closing issues' authors, commit authors).
- Sixth refresh (merge of main `feb3ae09`, head `e3b0dc37`): main had no
fragment left to fold. #2504 (the owner's PR, no fragment) gets a hand
entry under Added next to #2499's: the PC side of the relay, which
answers the relay's server proof, `/api/relay` start/stop routes
restricted to the owner and to direct connections, and a relay QR from
`plugin pair`; off by default with no Settings switch yet. No credit
(maintainer PR). It stays out of the release summaries (off by default,
no UI).
- Seventh refresh (merge of main `a683e3ff`, head `7855c73c`): folded
#2509's two fragments by hand, two entries under Added (the phone side
of the relay: the hosted shell that pairs from the PC's relay QR and
opens the app end-to-end encrypted; files and chat images through the
relay) and one under Fixed (the iOS and Android apps no longer show the
hosted shell's home-screen hint). Each says the relay is off by default.
#2499's entry now says Ovis uses the relay only once a PC's relay link
is started. No credit (maintainer PR). The fragments are deleted;
`changelog.d` holds only `README.md`. The relay stays out of the release
summaries.
- Eighth refresh (merge of main `0b215abf`, head `f76f3ae4`): folded
#2514's three fragments by hand under Fixed (relay connection limits and
the 30 s wait for an absent PC, proof of the PC's relay key, the hosted
shell's copy-on-select and relay-control requests) and added a hand
entry for #2514 under Added: remote access through the Ovis relay can be
turned on in **Settings → Phone & devices** (off by default), with the
iOS and Android apps opening a relay-paired PC from its link;
app.ovis.sh is deployed separately. #2499, #2504 and #2509's entries no
longer say there is no Settings switch: they now say the relay is turned
on in Settings. No credit (maintainer PR). Also folded #2511 (Claude
task-list scan on file workers, Fixed, `by @duytbp`) and #2518 (feedback
typed on Claude Code's plan card keeps Claude planning, Fixed, `by
@jpcarranza94`, who also reported #2517, so no separate reporter
credit). #2515 is docs only, no fold. 5 fragments deleted; `changelog.d`
holds only `README.md`.
- Ninth refresh (merge of main `fbb97b62`, head `44048d5f`, fold in the
merge commit): folded 23 fragments by hand: 7 entries under Added
(#2514's rewritten relay-identity entry, which replaces its old Fixed
entry about the PC's relay key; #2519 Letta model pill `by @homebodify`;
#2522 relay bulk window and the relay overview, self-hosting and
hosted-shell attestation; #2524 DeepSeek Harness in the catalog), 3
under Changed (#2533 Connect a phone dialog and the `tailscale serve`
box; #2539 chat pictures shown whole) and 26 under Fixed: #2508; #2512
`by @lifeofpi-ux`; #2516; #2521, #2526, #2531, #2538, #2541, #2543,
#2545, #2547, #2549 and #2551 `by @jpcarranza94`; #2527 `reported by
@duytbp` (#2510); #2532; #2535 `reported by @devtm1123` (#2513). #2532's
#2523 is the maintainer's; @jpcarranza94's issues (#2525, #2537, #2540,
#2542, #2544, #2546, #2548, #2550) are covered by his PR credit. #2529
(perf) is not merged and stays out of 0.4.22. 23 fragments deleted;
`changelog.d` holds only `README.md`.
- Tenth refresh (merge of main `afdfb1e0`, head `1cfcfab7`, fold in the
merge commit), on the owner's OK for both: folded #2567 (Connect a phone
shows three choice cards and opens on the relay whenever it is offered,
with the relay's switch on its card on a tailnet; maintainer PR, no
credit) under Changed and #2555 (the New workspace folder picker's
compact row; `by @iwangjie`, no linked issue) under Fixed. 2 fragments
deleted; `changelog.d` holds only `README.md`. The IMPROVED summary line
now says the relay needs no Tailscale, in en, ko, ja and zh.
- Eleventh refresh (merge of main `2b620462`, head `13fa0181`, fold in
the merge commit), on the owner's go for each: folded 13 entries from 12
fragments by hand. Changed: #2562 (a chat starts loading when the press
begins, `by @jpcarranza94`), #2574 (Quote a selection into the message
box), #2578 (the relay's switch, reset and failures only in Connect a
phone). Fixed: #2564 and #2560 (two entries) `by @jpcarranza94`; #2554
`by @iwangjie`; #2577; #2576 (the session-bound conversation cache,
fixing the two HIGHs the post-merge Codex Terra review reproduced in
#2562 and #2545); #2572 `reported by @rkqksk` (#2557); #2570 `reported
by @nathanvale` (#2566); #2571 `reported by @altgans` (#2568); #2575
`reported by @matiemer` (#2558). @jpcarranza94's own issues (#2559,
#2561, #2563) are covered by his PR credit. 12 fragments deleted;
`changelog.d` holds only `README.md`. IMPROVED summary: "Select words in
a Chat reply to quote them into your message." replaces the spacing
line, in en, ko, ja and zh.
- Twelfth refresh (merge of main `64ae5e72`, head `3ae2133e`), on Dori's
go: folded #2580 under Fixed (the Cloudflare relay closes both ends of a
pair after a frame send fails, so they reconnect at once; maintainer PR,
no credit) and deleted its fragment. #2579 (guide only) has no fragment.
Summaries unchanged.
- Thirteenth refresh (merge of main `99a6671f`, head `aebaabbf`), on
Dori's go: folded #2582 under Fixed (`by @iwangjie`: the folder picker's
Show hidden waits for a loading folder; the path bar wraps at very
narrow widths) and deleted its fragment. Summaries unchanged.
- Maintainer PRs without a fragment and without a user-facing change
have no entry: #2436 (relay crypto/mux foundations, not wired yet),
#2445 (CI contract test against a pinned hc).
- **Release summaries:** en, ko, ja and zh each have 8 new, 8 improved
and 8 fixed lines (8 is the most a list the app reads may hold, 90
characters a line). New: remote access through the Ovis relay, turned on
in Settings (off by default), with app.ovis.sh shipping separately
(#2514); pictures in Chat for Copilot, Grok and Hermes (#2479, #2481,
#2482); svg figures (#2477); math with dollar signs (#2498); Portal
sign-in with watch-only visitors (#2065); DeepSeek Harness in Settings →
Agents with its conversations in Chat on Linux (#2524, #2453); tab names
from the first message (#2502); notes on diff lines (#2505). Improved:
Expand thinking / Collapse work defaults (#2484), Chat spacing that
follows the font size (#2491), key bar drag reorder (#2463), same-host
links in an in-app popup on phones (#2459), Claude question cards with
steps and Back (#2503), OmO, Codex and Hermes cards with Back and Next
(#2506), one Connect a phone dialog (#2533), pictures shown whole
(#2539). Fixed: panes again on Safari 16.4–17.3 and iOS 16.4+ (#2535),
Stop with a queued follow-up keeps the stopped message (#2547), a first
message reaches Claude Code (#2526), Codex Chat after a finished answer
(#2443), question cards show at once and stay (#2543), Chat no longer
redraws turns or jumps (#2538, #2545), a setting kept across a quick
reload (#2487), Claude's plan card in narrow panes (#2541). Moved to the
changelog only to fit the 8-line lists: Codex behind Kiro (#2420), Pi
messages with spaces (#2474), the Claude question card between questions
(#2466, #2467, now covered by the question-card line), short-phone
overlap (#2494), cross-tab settings (#2486), the Antigravity note
(#2472), plus the subagent poll perf (#2527), relay transport (#2516),
herdr-core no-watch (#2512) and the other Fixed entries above.
- **Remote bundle:** `REMOTE_BUNDLE_VERSION` rises from 40 to 41 because
the bundle inputs (`server/`, `shared/`, `bun.lock`) changed since
remote-v40. After merge: push `remote-v41` on the merged commit and wait
for the Remote PC bundles workflow before running Release.
- **Telemetry:** `telemetry/worker.ts` and `shared/telemetry.ts` are
unchanged since `telemetry/deployed.json`; no Worker deploy.

## Validation

- `bun scripts/release-guards.ts --base v0.4.21`: before the bump it
asked to raise `REMOTE_BUNDLE_VERSION` from 40 to 41 and nothing else;
after it, "Release 0.4.22: remote bundle, telemetry Worker and release
metadata are in order."
- `UNIT_TEST_WORKERS=4 dori heavy rel0422 -- bun run check fast` on this
branch: workflow syntax, generated types and themes, typecheck, build,
unit tests all ok. Unit: 9827 pass, 0 fail, 41 skip in 623 files.
- After folding #2474 (head `3de63b49`): `bun scripts/release-guards.ts
--base 653613c` "Release 0.4.22: remote bundle, telemetry Worker and
release metadata are in order."; `UNIT_TEST_WORKERS=4 dori heavy
refresh2473 -- bun run check fast` all ok, unit 9827 pass, 0 fail, 41
skip in 623 files.
- After folding #2475 and correcting the #2474 credit (head `90536524`):
`bun scripts/release-guards.ts --base 653613c` "Release 0.4.22: remote
bundle, telemetry Worker and release metadata are in order.";
`UNIT_TEST_WORKERS=4 dori heavy refresh2473b -- bun run check fast` all
ok, unit 9851 pass, 0 fail, 41 skip in 623 files.
- After folding #2490, #2483, #2479 and #2482 (head `0da3756d`;
`e6eb7df6` removed the fragments and `0da3756d` adds their CHANGELOG
entries, which that commit left out): `bun scripts/release-guards.ts
--base 98c1f5e` "Release 0.4.22: remote bundle, telemetry Worker and
release metadata are in order."; `UNIT_TEST_WORKERS=4 dori heavy
refresh2473c -- bun run check fast` all ok, unit 9855 pass, 0 fail, 41
skip in 623 files (with `TMPDIR` off the quota'd `/tmp` tmpfs; an
earlier run with the default `TMPDIR` hit `EDQUOT` there).
- After the fourth refresh (head `af31fa98`): `bun
scripts/release-guards.ts --base v0.4.21` and `--base origin/main` both
"Release 0.4.22: remote bundle, telemetry Worker and release metadata
are in order." main still has `REMOTE_BUNDLE_VERSION` 40 (no commit
since v0.4.21 touches it) and `remote-v41` is not tagged yet, so this
PR's 41 stays the one raise. `UNIT_TEST_WORKERS=4 dori heavy rel2473 --
bun run check fast` all ok, unit 9973 pass, 0 fail, 41 skip in 624
files.
- After the fifth refresh (head `b602a998`, merge of main `f5370d54`):
`bun scripts/release-guards.ts --base v0.4.21` and `--base origin/main`
both "Release 0.4.22: remote bundle, telemetry Worker and release
metadata are in order." (`REMOTE_BUNDLE_VERSION` stays 41).
`UNIT_TEST_WORKERS=4 dori heavy rel2473c -- bun run check fast` all ok,
unit 10107 pass, 0 fail, 41 skip in 631 files.
- After the sixth refresh (head `e3b0dc37`, merge of main `feb3ae09`):
`bun scripts/release-guards.ts --base v0.4.21` and `--base origin/main`
both "Release 0.4.22: remote bundle, telemetry Worker and release
metadata are in order." (`REMOTE_BUNDLE_VERSION` stays 41).
`UNIT_TEST_WORKERS=4 dori heavy rel2473d -- bun run check fast` all ok,
unit 10123 pass, 0 fail, 41 skip in 632 files.
- After the seventh refresh (head `7855c73c`, merge of main `a683e3ff`):
`bun scripts/release-guards.ts --base v0.4.21` and `--base origin/main`
both "Release 0.4.22: remote bundle, telemetry Worker and release
metadata are in order." (`REMOTE_BUNDLE_VERSION` stays 41).
`UNIT_TEST_WORKERS=4 dori heavy rel2473e -- bun run check fast` all ok,
unit 10314 pass, 0 fail, 41 skip in 644 files.
- After the eighth refresh (head `f76f3ae4`, merge of main `0b215abf`):
`bun scripts/release-guards.ts --base v0.4.21` and `--base origin/main`
both "Release 0.4.22: remote bundle, telemetry Worker and release
metadata are in order." #2514's and #2511's `server/` changes land
before `remote-v41` is tagged, so `REMOTE_BUNDLE_VERSION` stays 41.
`UNIT_TEST_WORKERS=4 dori heavy rel2473g -- bun run check fast` all ok,
unit 10363 pass, 0 fail, 41 skip in 649 files.
- After the ninth refresh (head `44048d5f`, merge of main `fbb97b62`):
`bun scripts/release-guards.ts --base v0.4.21` and `--base origin/main`
both "Release 0.4.22: remote bundle, telemetry Worker and release
metadata are in order." (`REMOTE_BUNDLE_VERSION` stays 41; `remote-v41`
is not tagged yet). `UNIT_TEST_WORKERS=4 dori heavy rel2473 -- bun run
check fast` all ok, unit 10511 pass, 0 fail, 41 skip in 654 files;
`server/release-notes.test.ts` and `src/lib/updateNotes.test.ts` 52
pass.
- After the tenth refresh (head `1cfcfab7`, merge of main `afdfb1e0`):
`bun scripts/release-guards.ts --base v0.4.21` and `--base origin/main`
both "Release 0.4.22: remote bundle, telemetry Worker and release
metadata are in order." (`REMOTE_BUNDLE_VERSION` stays 41; both PRs are
client-only). `UNIT_TEST_WORKERS=4 dori heavy rel2473j -- bun run check
fast` all ok, unit 10511 pass, 0 fail, 41 skip in 654 files;
`server/release-notes.test.ts` and `src/lib/updateNotes.test.ts` 52
pass.
- After the eleventh refresh (head `13fa0181`, merge of main
`2b620462`): `bun scripts/release-guards.ts --base v0.4.21` and `--base
origin/main` both "Release 0.4.22: remote bundle, telemetry Worker and
release metadata are in order." (`REMOTE_BUNDLE_VERSION` stays 41;
`remote-v41` is not tagged). `UNIT_TEST_WORKERS=4 dori heavy rel2473k --
bun run check fast` all ok, unit 10551 pass, 0 fail, 41 skip in 656
files; `server/release-notes.test.ts` and `src/lib/updateNotes.test.ts`
52 pass.
- After the twelfth refresh (head `3ae2133e`, merge of main `64ae5e72`):
both release guards "in order" (`--base v0.4.21` and `--base
origin/main`); `UNIT_TEST_WORKERS=4 dori heavy rel2473l -- bun run check
fast` all ok, unit 10553 pass, 0 fail, 41 skip in 656 files;
release-notes tests 52 pass.
- After the thirteenth refresh (head `aebaabbf`, merge of main
`99a6671f`): both release guards "in order" (`--base v0.4.21` and
`--base origin/main`); `UNIT_TEST_WORKERS=4 dori heavy rel2473m -- bun
run check fast` all ok, unit 10553 pass, 0 fail, 41 skip in 656 files;
release-notes tests 52 pass.
- Not run: `bun run check full` (integration and browser), left to CI;
no hands-on test of main, which is the owner's.

This is a release-metadata PR: it changes no code path. Per the release
steps, merge it after CI and the owner's go, then push `remote-v41`,
wait for its bundles, and run Release with `0.4.22`.






 [exit 0]
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