You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(relay, site, installers): drop comments the code can say, keep platform facts - #4040
The third area of the repo-wide comment pass (after #4036 and #4038). It covers:
relay/, push-relay/ and integrations/
telemetry/, except worker.ts, whose bytes are pinned to the deployed Worker
site/demo/, ovis-site/ and public/sw.js
the installers (install.sh, install.ps1) and the root config (vite.config.ts, bunfig.toml, herdr-plugin.toml, .coderabbit.yaml)
About 1,850 comment lines go. Comments that explain a code surprise of our own were removed, and where a rename or one helper could say the same thing, the code now says it.
What stays is behaviour we cannot change:
Services: Cloudflare Workers and Durable Objects, APNs and FCM, Cloudflare Pages.
Browsers: iOS notifications, Safari push, Chrome's PDF viewer.
POSIX shells under curl | sh: SIGTTIN, set -e inside conditions, Rosetta's uname -m, busybox and uutils races, systemd and launchd.
Windows: PowerShell 5.1 and cmd.
Specs and tools: RFCs 8030, 8032, 8292 and 6455, and xterm, herdr and the agents that the demo's fake server copies.
Also kept:
the installers' usage headers, which are their public contract
the licence credits (LobeHub Icons, Simple Icons)
every comment inside text the installers write out (the ovis launcher, run.sh/run.ps1, the inline JS)
the comment whose address scripts/ovis-site.test.ts tells people to read
Every comment-only change was checked against origin/main:
TypeScript and JavaScript: by syntax tree.
CSS: comments stripped.
Shell, PowerShell, TOML and YAML: whole-line comments dropped. I read the few trailing # … comments and C# comments inside install.ps1's Add-Type strings by hand.
Code changes (mechanical, no behaviour change)
relay/core.ts: oldestToMakeRoom(list, max) replaces three copies of list.slice(0, Math.max(0, list.length - MAX + 1)).
site/demo/transport.ts: builds the view key from PANE_VIEW_KEY_PREFIX and paneStorageId(LOCAL_MACHINE, …) instead of writing ovis:view: by hand.
Dropped the shellcheck disable=SC2086 on foreground_ids. No shellcheck runs on the installers, and the split it hid is listed below.
vite.config.ts: xtermSource → patchedXtermSource.
Left open (redesigns, not done here)
relay/:
Room.open and Room.sweep each work out when a socket was last heard from.
Room.authorize buries "the stricter pass wins on a tie".
sweepPass's warm-first order is only a sort.
pair-room.ts ATTEMPT_BYTES/PAIR_CLOSE copy shared/relay-pair-code.ts and are kept equal only by a test.
The pass_kid === undefined compatibility branch.
Info is written before a refusal so that owns() handles the close.
worker.ts PASS_CHECKED trusts a header that handle strips and sets again.
RelayRoom's send uses queueMicrotask to avoid re-entering Room.
push-relay/worker.ts register: the limiter order could be one named gate.
public/sw.js:
BUILD, BUILD_FILES and RELAY_RESOURCES are build-stamped placeholders. A rename needs scripts/service-worker-build.ts with it.
isPage really checks for the shell fallback.
keepShell both fills the new cache and retires the old ones.
FRESH_SHELL is the only link to requestFreshShell.
A port message without status means "selected".
answerButtons mixes the "can't reach the PC" check into validation.
Two tap paths race through module-level maps.
query copies pageSearch.
The hosted shell's # deep link has no builder.
openRelayDatabase copies the schema in src/lib/relay/device.ts.
ovis-site/assets/platform.js:DESKTOP.mac has no tip on purpose, the *_ALT English text doubles as a translation key, and macArch() without an argument means "Apple silicon".
site/demo/:
agentScreens.bottom must match what src/lib/inputRow.ts parses, and the cursor offsets are magic.
layOutRoster and the timestamp shift could be named steps.
later fires only while the socket is open.
install.sh:
foreground_ids relies on word splitting.
gh_api copies bounded's watcher, and the "capture under bounded" pattern is written three times.
release_js, rust_host_runs, node_fits and find_core copy checks in scripts/plugin.ts, server/pty/ and server/herdr-core/discovery.ts.
launcher_text, add_reads_answers and node_link tell what a release can do by grepping its source.
add_pc uses seven early returns that set flags.
manifest_entry parses signed JSON with sed.
install_lock is hand-rolled.
ref_not_moved is not explained by its code.
Exit codes 22 | 37 should be narrowed to a 404.
install.ps1:
Ed25519 points travel as BigInteger[].
Enter-InstallLock has a known race with three installs at once.
$herdrState copies scripts/plugin-state.ts.
Get-RecordedServer, the inline git reader, and about 180 lines of top-level repair logic.
vite.config.ts:dirty mixes "dirty" with "could not tell", and the plugin order (themeBootstrapBuild first) is not enforced.
Validation
bun run check fast: passed (18,563 unit tests, typecheck, build, generated files).
bun test relay/: 891 pass. scripts/install* tests: 203 pass. scripts/install-binary.test.ts passes after the rename. scripts/ovis-site.test.ts, scripts/conventions.test.ts, the sw.js and demo tests: all pass.
sh -n install.sh passes. install.ps1 was not parsed here (no pwsh); GitHub's Windows runner runs it.
Comment-only check as above. The code differences are exactly the changes listed.
…ep platform facts
The third area of the repo-wide comment pass: relay/, push-relay/,
telemetry/ (not the pinned worker.ts), integrations/, site/demo/,
ovis-site/, public/sw.js, the installers and the root config. About
2,100 comment lines go; notes on Cloudflare, APNs/FCM, browsers, POSIX
shells, Windows and the RFCs stay, and so do comments inside text the
installers write out. oldestToMakeRoom replaces three copies of the
same cap arithmetic in relay/core.ts, the demo builds its view key with
the app's PANE_VIEW_KEY_PREFIX and paneStorageId, and
INSTALL_LOCK_WAIT_SECONDS and patchedXtermSource say their units and
source.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
Refactor
Updated relay capacity handling and install-lock configuration; adjusted demo reporting and pane preference storage. Most other changes remove explanatory comments without changing behavior.
Tests
Added coverage for VAPID key normalization and authorization rejection, APNs token reuse, and the updated install-lock setting.
This pull request removes explanatory comments across installer, relay, push-relay, demo, integration, configuration, and site code. It also makes small changes to installer behavior, relay eviction helper usage, push-relay tests, demo pane storage, and Vite alias naming.
Changes: Repository updates
Layer / File(s)
Summary
Installer behavior and lock setting install.sh, install.ps1, scripts/install-binary.test.ts
The installer renames the lock-wait variable, checks for Perl before prompting, changes settings-file rewriting, and removes a temporary checkout before cloning. The test uses the renamed variable.
Relay admission and connection lifecycle relay/*
Relay eviction uses a shared helper to select entries for removal. Other relay code and tests mainly lose comments; their described runtime logic and assertions remain unchanged.
Push registration and delivery push-relay/*
A test checks that padded Base64 VAPID keys are normalized. Worker and configuration comments are removed without changing the described behavior or settings.
Demo transport and pane storage site/demo/*
Agent-pane view preferences use the pane-view key prefix and a machine-scoped pane storage ID. Other demo ranges mainly remove comments.
Configuration, integrations, and site comments .coderabbit.yaml, bunfig.toml, herdr-plugin.toml, integrations/*, ovis-site/*, public/sw.js, telemetry/*, vite.config.ts
Comments are removed or shortened across these areas. Vite aliases now use patchedXtermSource instead of xtermSource.
This change mostly removes comments, with a few small renames and a shared helper that keep existing behavior. No concrete merge-blocking risk was identified, and the reported tests pass.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the three areas the PR touches (relay, site, installers) and the main change, removing comments the code can express while keeping platform-specific facts. The diff is almost entirely …
Description check
The description follows the repository template in substance. It has a Change section that describes the problem and resulting behavior, and a Validation section listing the checks run and their resul…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the three areas the PR touches (relay, site, installers) and the main change, removing comments the code can express while keeping platform-specific facts. The diff is almost entirely comment removal plus a few small mechanical renames, so the title matches the changeset. It is somewhat long at 86 characters, which is a minor concern rather than a mismatch.
Full details: Description check
Explanation
The description follows the repository template in substance. It has a Change section that describes the problem and resulting behavior, and a Validation section listing the checks run and their results. The template asks for a linked issue for features, which does not apply to this refactor. It does not reference CONTRIBUTING.md or a changelog.d entry, and it does not mention contract-test coverage for HTTP/WS changes, though the PR touches relay code. These gaps are non-critical.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Reviewing files that changed from the base of the PR and between f35b252 and 28b94c9.
Files selected for processing: 42
.coderabbit.yaml
bunfig.toml
herdr-plugin.toml
install.ps1
install.sh
integrations/gjc.test.ts
integrations/gjc.ts
integrations/pi-ask.test.ts
integrations/pi-ask.ts
ovis-site/_worker.js
ovis-site/assets/beta.js
ovis-site/assets/platform.js
ovis-site/style.css
public/sw.js
push-relay/test-push.ts
push-relay/worker.test.ts
push-relay/worker.ts
push-relay/wrangler.toml
relay/bun-limits.test.ts
relay/bun-limits.ts
relay/bun.test.ts
relay/bun.ts
relay/core.ts
relay/load-smoke.ts
relay/pair-room.test.ts
relay/pair-room.ts
relay/pass.ts
relay/relay-test-client.ts
relay/server-proof.test.ts
relay/shell-mirror.test.ts
relay/shell-mirror.ts
relay/worker.test.ts
relay/worker.ts
relay/wrangler.toml
scripts/install-binary.test.ts
site/demo/agentScreens.ts
site/demo/fixtures.ts
site/demo/history.ts
site/demo/transport.ts
telemetry/worker.test.ts
telemetry/wrangler.toml
vite.config.ts
Files with no reviewable changes: 26
.coderabbit.yaml
bunfig.toml
herdr-plugin.toml
integrations/gjc.test.ts
integrations/pi-ask.test.ts
ovis-site/assets/beta.js
push-relay/test-push.ts
push-relay/worker.test.ts
push-relay/worker.ts
relay/bun-limits.test.ts
relay/bun-limits.ts
relay/bun.test.ts
relay/bun.ts
relay/load-smoke.ts
relay/pair-room.test.ts
relay/pair-room.ts
relay/pass.ts
relay/relay-test-client.ts
relay/server-proof.test.ts
relay/shell-mirror.test.ts
relay/shell-mirror.ts
site/demo/agentScreens.ts
site/demo/fixtures.ts
site/demo/history.ts
telemetry/worker.test.ts
telemetry/wrangler.toml
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.
Merged head 13c7cce69d02 as c0ed61532120 on GitHub's checks, with no unresolved review threads.
Reviewer
Verdict
Note
machine-proof
CLEAR
supervisor-read
CLEAR
The owner's refactor (relay, site, installers), merged by the merge pass on his word. A machine proof removed comments per language and compared the merge base with the head: every file is identical once comments are removed, except renames that a fresh reviewer read as behaviour-neutral (oldestToMakeRoom in relay/core.ts, xtermSource in vite.config.ts, INSTALL_LOCK_WAIT to INSTALL_LOCK_WAIT_SECONDS in install.sh, never read from the environment). Two commits by the merge pass's worker are on top: site/demo/transport.ts keeps main's literal pane view key, because importing it from src/lib/settings.ts pulled React and every dictionary into the public demo's startup script (1.2 MB instead of 267 KB); and the comments no test can hold are put back.
Deleted comments that carried a reason were sorted before the merge (the owner's rule F): A=93 (a test already holds the reason), B=34 (tests to write, security and trap first: among them install.ps1's download size limit and its refusal of redirects off https, the re-check after an async pass renewal in relay/core.ts, a refused pairing socket in relay/pair-room.ts), C=14 (put back on this branch).
One deleted shellcheck directive in install.sh is read by nothing (CI runs actionlint with shellcheck off).
## What
Part 1 of 5 for `scripts/` in the repo-wide comment pass (after #4036,
#4038 and #4040). This part covers:
- the a–ci browser regressions and QA scripts
- the build and check tooling: `check.ts`, `check-report.ts`,
`build-cache.ts`, `build-xterm.ts`, `build-site.ts`, `build-server.ts`,
`ci-browser*.ts`/`.sh`, `ci-flakes-issue.ts`
- the installer tests (`install-*.test.ts`)
- the inbox regressions and the join kit (`scripts/join/`)
About 3,450 comment lines go. The usage headers of `check.ts`,
`ci-browser-parallel.ts`, `ci-browser-timings.ts` and
`ci-flakes-issue.ts` went: `docs/development.md` already documents those
commands and their variables.
What stays:
- **Machine-read comments:** every `// fixed wait:`
(`scripts/fixed-sleeps.ts` reads them), and the `@ts-expect-error` on
`app/web/shell.js`'s import.
- **The join kit's contract:** the usage and exit-code block of
`join.sh`.
- **Behaviour we cannot change:** POSIX shells and job control, Linux
`/proc` and zombies, socket path limits, `ps` locale, git, Vite,
TypeScript, xterm, Playwright, Chromium and WebKit, `@legendapp/list`
(checked in its source), and GitHub's API limits.
Every comment-only change was checked against `origin/main`: TypeScript
by syntax tree, shell with whole-line comments dropped. No test, script
or doc reads a deleted comment: each agent searched `*.test.ts`,
`scripts/` and `docs/` for a phrase of every comment before deleting it.
## Code changes (mechanical, no behaviour change)
- `scripts/inbox-mode-demo-regression.ts`: the drawer's second-tap wait
takes `SECOND_TAP_MS` from `src/lib/useSidebarLayout.ts` (passed into
`waitForFunction`) instead of a bare `400`.
- `scripts/join/join.sh`: dropped a `shellcheck disable=SC2086`. No
shellcheck runs on scripts, and the split it hid is listed below.
## Left open (redesigns, not done here)
- **`check.ts`:**
- `HERDR_TEST_SHARDS` defaults to 1 because timing-bound contract tests
fail four at a time.
- `askTicket` ranks a lock without a ticket at `-Infinity`.
- `takeTicket` bumps `queuedAt + 1` for a clock set back.
- `retire` leaves a known window for two claims.
- `acquire` checks the queue twice, and `alone` treats a pre-slot holder
as owning the PC.
- **`ci-browser-parallel.ts stopRun`:** its refused/unmarked/seen sets
and the grace after SIGKILL.
- **`ci-browser.sh`:** the scripts whose evidence code changes what they
check are an unnamed case list.
- **`check.test.ts descendant`:** relies on when a SIGTERM handler takes
effect.
- **`build-cache.ts`:** the cache's event rule, the
`shared/vendor/*/dist` regex, "stop waiting once another job holds the
lock", and the per-run lock name.
- **`build-server.ts artifact`** (a lazy import so sign and verify run
without packages), and **`build-site.ts`**'s `/icons/` rewrite (the
client could use relative paths).
- **`app-shell.test.ts`:** the `@ts-expect-error` goes once
`app/web/shell.js` has a declaration file.
- **Unnamed timings and duplicated values:**
- `android-ime-regression.ts` has a bare typing pace.
- `install-hint-demo-regression.ts HOLD_DEMO_TURN` copies a 4500 ms hold
from `site/demo/transport.ts`, and so do several other scripts.
- `NO_RESIZE_WAIT_MS` is a bare 1 s.
- Several fixed waits for "frames to have gone out" in
`inbox-mode-demo-regression.ts` could poll `window.inboxFixture.frames`.
- `join.contract.test.ts` sleeps 2 s where it could use `DWELL_MS`.
- **`inbox-mode-*-regression.ts`:** pass their part through
`INBOX_MODE_PART`, where the main script could export `run(part)`.
- **`join.sh`:**
- Globals carry results: `$pid`, `j_b`, `j_got`.
- `j_refusal` and `J_HERDR_REFUSED` match the server's English sentences
instead of a reason code.
- `j_remove`'s return codes 0–4 have no names.
- `$J_PROFILE_ENV $J_PREVIEW_ENV` are left unquoted on purpose.
- The 37/38/39 decision could be a function.
- **`join.contract.test.ts`:** the flag files under `/var/tmp/fake-*`
are declared nowhere, and `serveHerdr` takes a positional boolean.
## Validation
- `bun run check fast`: passed (18,567 unit tests, typecheck, build,
generated files).
- Unit tests of every touched test file and of the modules that import a
touched one: all pass (349 + 405 + 203 + 15, plus
`scripts/conventions.test.ts`).
- `sh -n` on `join.sh`; `SECOND_TAP_MS` imports from a plain Bun script
(`400`).
- Not run here: the browser regressions themselves (their code changed
only in the one wait above) and `join.contract.test.ts` (needs
containers). CI's browser jobs run the regressions.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: sisyphus-dev-ai <[email protected]>
#4081)
## What
#4040 (`relay/`, `site/`, `push-relay/`, `public/` and the installers)
was part of the repo-wide comment pass and merged before the owner's
rule for comment-removal PRs: security notes, platform facts, measured
values, third-party attribution, Rust SAFETY notes and traps that name a
concrete breakage stay. This PR puts back what it dropped of those, word
for word where the code is unchanged, on today's `main`.
How the notes were picked: a Codex adversarial review (gpt-6.2-sol,
reasoning high) of the merged commit against its parent listed every
deleted comment it took for a kept kind; each finding was checked
against the code before the pass and today's file, and put back only
when it is one of those kinds. A trap came back only when it names what
the obvious change would break. Notes whose code has since moved sit on
that code now; notes whose code is gone, or that are no longer true,
stay out.
`install.sh` and `install.ps1` are left out: the kit cannot yet prove a
comment-only change in them (its shell and PowerShell readers lose track
of a quoted string partway through each file), so their notes wait for a
kit fix. The counts below include them.
Comments only: no code changes. The refactor-merge kit's `proof.sh`
checks that every file is identical once comments are removed; lint
directives (which it counts as code) stay out.
## Details
### Lines restored per kind (approximate; a mixed block is counted under
its main kind)
| Kind | Findings accepted | Lines |
|---|---|---|
| Security | 244 (incl. 5 not flagged by Codex) | ~547 |
| Platform fact | 78 (incl. 1 not flagged) | ~156 |
| Measured value | 8 | ~15 |
| Trap (names a concrete breakage) | 45 (incl. 2 not flagged) | ~84 |
| Non-prose (`# shellcheck disable=SC2086 # two numbers, split on
purpose`) | 1 | 1 |
The not-flagged ones are mirror notes of flagged ones: core.ts
`keepaliveAt`, the pair-room.ts `lapsed` doc, bun.test.ts "one address
over its limit never uses up the cap every address shares", the
worker.ts `alarmWrites` "a later one never undoes an earlier one", and
three push-relay test cases (wrong-token signature, wrong-key signature,
wrong-audience signature).
### Declined, rejected, skipped
- 26 trap findings were declined. They give a design reason, describe
the code or name a test target. Examples:
- relay/bun.ts:40 and worker.ts:316: "a pairing room's key cannot be a
server_id" (an invariant)
- public/sw.js: "Every build is a worker of its own ... BUILD_FILES"
- ovis-site/_worker.js: "where a 302 used to show them herdrweb.dev"
- site/demo/transport.ts: "on a slow runner its checks can come after
4.5s" (a test hook)
- 8 findings were rejected:
- relay/core.ts:81: the rewrite still states the same Cloudflare
keepalive fact
- relay/wrangler.toml:12: "its SQLite storage stays empty" is out of
date (pass_until is stored now)
- public/sw.js:633: "no key to subscribe with here" only describes the
early return
- ovis-site/assets/platform.js:12 and ovis-site/style.css:118: the kept
sentence is whole; what was dropped describes code or layout
- site/demo/transport.ts:371: the kept sentence is whole
- site/demo/fixtures.ts:52: the `RESUME_FLAGS` name already says it
- 1 was already on main: the sw.js Safari "every push shows a
notification" note, kept and moved by #4040 itself.
### Security notes put back (file, a few words)
- herdr-plugin.toml: the release server is checked against the signed
manifest
- relay/bun-limits.ts, bun.ts: pairing rooms counted apart; per-address
socket cap; settings fail closed; pass-flag precedence; active buckets
never evicted; per-PC budget; behind a TLS proxy, stores nothing; open
default with no pass policy; authorization lives as long as the room;
refused, never evicted
- relay/core.ts: frames passed unread (end-to-end encrypted); key proof
before the room; slot, proof and warm caps; usage reports carry no
address; close-code meanings; pass skew and renewal bounds; limiter
order and per-PC rescue; signature-check cost bounds; the address is
never kept; the stricter pass wins; constant-time proof; sweep
enforcement
- relay/pair-room.ts (+ test): CPace untrusted-relay header; attempt
isolation; the public nameplate; host key proof; passes re-checked
against revocations, old attachments too; one host trying at a time;
proof limited to this nameplate; a refused second host leaves the real
one
- relay/pass.ts: modes, keys and revocations; what `exp` and `noNew`
mean; Bun relay will not start, the Worker turns passes off;
`passMayHold` is no signature check; how enforcement is reported
- relay/shell-mirror.ts: byte-for-byte deploy check and the box as a
trust root; archive containment; promote only while the same build is
served
- relay/worker.ts (+ test): refused requests never wake a Durable
Object; trust in the pass-checked header; fail-open settings; hashed
usage key; storage only for PC rooms while passes are on; no data before
proof; the real PC keeps the room; clients need no pass; data sockets
cannot send relay control; renewal bound to its PC
- relay/wrangler.toml: no frame, address or connection_id in usage,
three months' retention; limiter order and backstop; per-PC budget; ~150
us per signature check; staging apart from production; the staging trust
key
- push-relay/worker.ts: the token never leaves the relay; key pinned so
nobody claims an endpoint first; no key that could decrypt; the address
only keys a limiter, never stored or logged; APNs secrets and the FCM
account's privilege; backstop asked second; per-endpoint, per-phone and
per-token limits; one VAPID key spelling; VAPID audience and time;
bounded body read; a registration proves nothing about the token; cached
APNs and Google tokens; APNs and FCM deletions never cross
- push-relay/worker.test.ts, test-push.ts: the relay never sees the
private half; address not stored; one endpoint per PC pinned to its key;
refused before the body is read; per-address limit before the shared
cap; a sandbox registration by someone else leaves the real one; Topic
header vs content; throwaway keys, so the phone cannot decrypt
- push-relay/wrangler.toml, telemetry/wrangler.toml: secrets never in
the file; the D1 id is "an id, not a secret"
- public/sw.js: only the shell build stamps the relay contract; PC app
scope, not the render host or `~`; the SameSite=Strict, referrer and
Sec-Fetch rule; no caching, only this PC's windows; a paired PC is not
trusted with the shell origin; script-src and ~render isolation; only
the shell may frame a PC's file; each PC's own worker and subscription;
other windows are other PCs'; answers go through the server's check; tap
counts only with consent; the pane rides in the fragment
- vite.config.ts: an untracked or dirty tree is not that revision;
"non-Git build: unverified"; test hooks only in the demo build
- integrations/pi-ask.ts: nothing reads or types into the terminal; only
this pid's stale socket is unlinked
- ovis-site/assets/platform.js: the desktop app is not code-signed yet,
so SmartScreen asks
- site/demo/transport.ts: who may type or send the first message (the
asking socket, any attached socket); no real credential in the device
fixtures; the relay fixture opens no socket and holds no credential; the
Portal stays refused; when a real server sends the LAN warning;
breadcrumbs never leave the demo; no management credentials or OAuth;
the tombstone answers only its owner; the alert webhook is never posted;
messages belong to the live connection; observers leave the shared grid
alone; nothing typed where no agent is; a lost claim never becomes
input; revalidate the claim before sending; only a live owner drains the
queue; first messages held for an explicit send
## Validation
- `bun run check fast`: passed (18,593 unit tests, typecheck, build,
generated themes and types).
- `proof.sh` (comments only), `ready.sh` (required checks, threads,
CodeRabbit, main) before the merge.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
…d from shell and PowerShell files (#4115)
## What
The restore PRs #4081, #4083 and #4087 put back the notes the comment
pass dropped but should have kept (security notes, traps that name what
breaks, platform facts, measured values). They held back eight shell and
PowerShell files, because the refactor kit's comments-only proof cannot
prove them (see "Kit proof" below). This PR puts back the notes in those
files.
| File | Dropped by |
|---|---|
| `install.sh`, `install.ps1` | #4040 |
| `scripts/ci-runner-route.sh`, `scripts/windows-install.test.ps1` |
#4047 |
| `scripts/self-hosted-runner/run.sh`,
`scripts/self-hosted-runner/build-cache-promote.sh`,
`scripts/self-hosted-runner/hook-test-harness.sh`,
`scripts/relay-ios-sim.sh` | #4049 |
The notes were written against older code, so each one was read against
the code beside it now. The second commit changes 12 that no longer
matched, for example:
- `run.sh`: the startup check covers the cgroup parent as well as the
CPU list (#4061), and runners also mount their build cache outbox.
- `install.sh`, `install.ps1`: the install lock is a pid file created
only where none exists, not the folder.
- `install.sh`: the herdr-core plugin build follows
`herdr-plugin.toml`'s pre-flight step (#3800).
- `windows-install.test.ps1`: the case reads `$state.badBinary`, not
`releaseDown`.
No code changes. One code line differs only in its comment:
`install.ps1`'s `} catch { $job = [IntPtr]::Zero }` gets its trailing
note back. No shellcheck or PSScriptAnalyzer directive comes back.
## Kit proof
`~/.dori-sa/kit/refactor-merge/proof.sh 4115` at 4769efc ends with
**FAIL**. Of the 8 files it proves 1 (`install.ps1`) and lists 7 as
differing. Each one's first difference is "inside a string or heredoc":
the kit's shell and PowerShell reader has lost track of the quoting by
then and reads the restored comment as string text. This is the misread
these files were held back for. Each file was checked again with the
language's own parser, base 9df15d6 against this head:
- `shfmt -mn` (shfmt 3.14.1's parser, which drops comments) prints the
same output for `install.sh`, `ci-runner-route.sh`, `run.sh`,
`build-cache-promote.sh` and `hook-test-harness.sh`.
- `relay-ios-sim.sh`: two of its notes are inside the `remote.sh`
heredoc, the script it runs on eamac. They are comments in that script,
but text to this one. `shfmt -mn` gives the same output for the
heredoc's script, and for the file with the heredoc emptied.
- `install.ps1` and `windows-install.test.ps1`: PowerShell 7.6's
`Parser.ParseFile` gives the same token list (comments and newlines left
out) on both sides, 6,005 and 10,476 tokens.
So this PR needs the owner's merge: the kit's rule is to merge only on
PASS.
## Validation
- `bun run check fast`: passed (18,673 unit tests, typecheck, build,
generated themes and types).
- `bash -n` on the six `.sh` files; `bun test
scripts/conventions.test.ts`.
- `git show HEAD~1 HEAD | grep -E '^[+-][^+-]' | grep -vE '^[+-]\s*#'`
prints only that `install.ps1` line.
Left open, not merged, on the owner's word.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The third area of the repo-wide comment pass (after #4036 and #4038). It covers:
relay/,push-relay/andintegrations/telemetry/, exceptworker.ts, whose bytes are pinned to the deployed Workersite/demo/,ovis-site/andpublic/sw.jsinstall.sh,install.ps1) and the root config (vite.config.ts,bunfig.toml,herdr-plugin.toml,.coderabbit.yaml)About 1,850 comment lines go. Comments that explain a code surprise of our own were removed, and where a rename or one helper could say the same thing, the code now says it.
What stays is behaviour we cannot change:
curl | sh: SIGTTIN,set -einside conditions, Rosetta'suname -m, busybox and uutils races, systemd and launchd.Also kept:
ovislauncher,run.sh/run.ps1, the inline JS)scripts/ovis-site.test.tstells people to readEvery comment-only change was checked against
origin/main:# …comments and C# comments insideinstall.ps1's Add-Type strings by hand.Code changes (mechanical, no behaviour change)
relay/core.ts:oldestToMakeRoom(list, max)replaces three copies oflist.slice(0, Math.max(0, list.length - MAX + 1)).site/demo/transport.ts: builds the view key fromPANE_VIEW_KEY_PREFIXandpaneStorageId(LOCAL_MACHINE, …)instead of writingovis:view:by hand.install.sh:INSTALL_LOCK_WAIT→INSTALL_LOCK_WAIT_SECONDS.scripts/install-binary.test.tsfollows.shellcheck disable=SC2086onforeground_ids. No shellcheck runs on the installers, and the split it hid is listed below.vite.config.ts:xtermSource→patchedXtermSource.Left open (redesigns, not done here)
relay/:Room.openandRoom.sweepeach work out when a socket was last heard from.Room.authorizeburies "the stricter pass wins on a tie".sweepPass's warm-first order is only a sort.pair-room.ts ATTEMPT_BYTES/PAIR_CLOSEcopyshared/relay-pair-code.tsand are kept equal only by a test.pass_kid === undefinedcompatibility branch.owns()handles the close.worker.ts PASS_CHECKEDtrusts a header thathandlestrips and sets again.RelayRoom'ssendusesqueueMicrotaskto avoid re-enteringRoom.push-relay/worker.ts register: the limiter order could be one named gate.public/sw.js:BUILD,BUILD_FILESandRELAY_RESOURCESare build-stamped placeholders. A rename needsscripts/service-worker-build.tswith it.isPagereally checks for the shell fallback.keepShellboth fills the new cache and retires the old ones.FRESH_SHELLis the only link torequestFreshShell.statusmeans "selected".answerButtonsmixes the "can't reach the PC" check into validation.querycopiespageSearch.#deep link has no builder.openRelayDatabasecopies the schema insrc/lib/relay/device.ts.ovis-site/assets/platform.js:DESKTOP.machas notipon purpose, the*_ALTEnglish text doubles as a translation key, andmacArch()without an argument means "Apple silicon".site/demo/:agentScreens.bottommust match whatsrc/lib/inputRow.tsparses, and the cursor offsets are magic.fixtures.RESUME_FLAGScopiesserver/session-history.ts.layOutRosterand the timestampshiftcould be named steps.laterfires only while the socket is open.install.sh:foreground_idsrelies on word splitting.gh_apicopiesbounded's watcher, and the "capture underbounded" pattern is written three times.release_js,rust_host_runs,node_fitsandfind_corecopy checks inscripts/plugin.ts,server/pty/andserver/herdr-core/discovery.ts.launcher_text,add_reads_answersandnode_linktell what a release can do by grepping its source.add_pcuses seven early returns that set flags.manifest_entryparses signed JSON withsed.install_lockis hand-rolled.ref_not_movedis not explained by its code.22 | 37should be narrowed to a 404.install.ps1:BigInteger[].Enter-InstallLockhas a known race with three installs at once.$herdrStatecopiesscripts/plugin-state.ts.Get-RecordedServer, the inline git reader, and about 180 lines of top-level repair logic.vite.config.ts:dirtymixes "dirty" with "could not tell", and the plugin order (themeBootstrapBuildfirst) is not enforced.Validation
bun run check fast: passed (18,563 unit tests, typecheck, build, generated files).bun test relay/: 891 pass.scripts/install*tests: 203 pass.scripts/install-binary.test.tspasses after the rename.scripts/ovis-site.test.ts,scripts/conventions.test.ts, thesw.jsand demo tests: all pass.sh -n install.shpasses.install.ps1was not parsed here (nopwsh); GitHub's Windows runner runs it.🤖 Generated with Claude Code