Skip to content

refactor(server): drop comments the code can say, part 6 of 8 - #4063

Merged
devswha merged 2 commits into
mainfrom
refactor/no-comment-server-6
Nov 17, 2026
Merged

devswha merged 2 commits into
mainfrom
refactor/no-comment-server-6

Conversation

@devswha

@devswha devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

Part 6 of 8 for server/ in the repo-wide comment pass. This part covers:

  • pending input and requests
  • the pi, pi-ask and Portal code
  • preferences, and the plugin and plan routes
  • private state, process owner and start
  • prompt.ts and its monitor
  • push, the PTY host and sidecar, pull requests
  • the relay link, session, service, pairing and direct-connection code
  • the remote bundle, entry and host code
  • repo diff and log, and the runtime move
  • the tests of all of these

About 4,800 comment lines go. What stays:

  • The public contract: the /api/push, plan, plugin and preference route docs, the git error envelope and /diff/refs answer, the ping capabilities, and 0.4.x clients' lan_exposure reading.
  • Machine-read comments: the // fixed wait: markers.
  • Behaviour we cannot change:
    • herdr, pi, pi-ask, Portal (v2.6.1/v2.7.3 facts), omp, Codex and Claude Code
    • node-pty (checked in the installed 1.1.0), git and gh
    • Bun's send, idle timeout and WebSocket headers
    • RFC 8291, RFC 9112, RFC 6455
    • /proc and ps, PowerShell and sshd on Windows, Tailscale adapters, kill(2), close(2)

One false note goes: process-start.ts said btime stays put when the wall clock is stepped, and the kernel computes it from the wall clock at each read.

Every change was checked against origin/main by syntax tree. No test, script or doc reads a deleted comment.

This PR touches relay pairing and passes, push endpoints, Portal, pending input and prompt answers, with comments only apart from one test constant. It waits for a real review (AGENTS.md).

Code changes

  • server/prompt.test.ts: the pinned id "cb779b7d598a" is EARLIER_BRIDGE_CARD_ID.

Rules that only a comment stated (deleted, not enforced yet)

Security and privacy

  • Push (push.ts):
  • Relay connections:
    • Nothing on the network reaches Bun's HTTP parser without passing the direct-connection gate.
    • Direct connections use no TLS, because Noise against the pinned PC key proves the PC.
    • Clients not yet signed in are bounded apart from the relay's limits.
  • Relay pairing:
    • Pair-code tries are counted on the PC and a code is single use. The next handshake message is computed ahead, so the relay cannot time it.
    • Every refused sign-in takes the same time, so timing does not show which ids exist.
    • A closed pairing window never reopens after a restart or clock change, and closing it ends the comparisons shown.
    • Only the owner may pair this PC with another PC.
  • Relay state:
    • Permission is written to disk before the first outbound socket.
    • Old admissions close before a key is revoked.
    • A damaged identity or state file is never replaced or turned on.
    • The secret key is never logged.
  • Portal:
    • No address without a token or under serve-only.
    • Portal gets a minimal environment.
    • Secrets never go into an argument, a saved file, a log or an answer.
  • pi: only a socket the user owns, in a folder only the user can enter, speaks for a pi.
  • Leaks: remote-json.ts error messages never carry the URL, the token or the answer. The move roster carries no reasons and no agent's words.

Input and prompts

  • prompt.ts: no await between the check on the screen and the key write, and the Hermes check runs before the settle read.
  • runtime-move-run.ts:
    • Text goes only into an input line read as empty, and unreadable is not empty.
    • An agent that took work since is never typed into.
    • No restart runs one conversation twice.
  • pending-input.ts: never evict a send in progress, and sending_at is set before anything is typed.

State and processes

  • Files (private-state.ts, pty/host.ts):
    • Frequent writes never use the private-state writer, and a failed cleanup never hides the write error.
    • Installers replace a binary by rename, never in place.
  • Processes (process-owner.ts): recorded PIDs are only probed with signal 0, and elapsed-time estimates are never compared.
  • Locks and daemons:
    • runtime-move-lock.ts: a racer's socket file is never removed.
    • remote-entry.ts: a selected socket is never permission to replace a daemon.
  • Save order (preferences.ts): revision first, labels before mutes, and preferences.json put back on failure.

Left open (redesigns, not done here)

  • Relay and push:
  • Prompts and input:
    • prompt.ts:
      • The held and bound switches.
      • The prompt-id binding type.
      • The order of the omp/Hermes/pi checks.
    • pending-input.ts: positional booleans and the macOS start tolerance.
    • pi-ask-bridge.ts's four states, and the "(Recommended)" label read back by the client.
  • Remote hosts and processes:
    • remote-host.ts's inline install-lock shell scripts.
    • process-start.ts's /proc parse copied four times.
    • private-state.ts's bare path return.
  • Smaller items:
    • preferences.ts's 125-line save.
    • pi-tree.ts's three passes, pi.ts's "\0unread" marker.
    • runtime-move-lock.ts's test hook in production code.

Validation

  • bun run check fast: passed (18,591 unit tests, typecheck, build, generated files).
  • Unit tests that import a touched module, one file per bun test call: 34 + 41 + 55 + 39 + 55 files, prompt.test.ts (467) included, all passing.
  • Contract tests were edited (comments only) but not run here. CI runs them.

🤖 Generated with Claude Code

The sixth server/ slice of the repo-wide comment pass: pending input
and requests, the pi, pi-ask and Portal code, preferences, the plugin
and plan routes, private state, process owner and start, prompt and its
monitor, push, the PTY host and sidecar, pull requests, the relay link,
session, service, pairing and direct-connection code, the remote
bundle, entry and host code, repo diff and log, and the runtime move,
with their tests. About 4,800 comment lines go; the API contract, the
`fixed wait:` markers, and notes on herdr, pi, Portal, node-pty, git,
gh, Bun, RFCs 8291, 9112 and 6455, /proc, PowerShell and sshd stay. One
false note goes: btime does move when the wall clock is stepped. The
earlier bridge's card id in prompt.test.ts is a named constant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

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

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Expanded coverage for queued input handling, prompt parsing and answers, Pi transcript images and large histories, relay pairing and pass behavior, and push-notification scenarios.
    • Added checks for invalid ping identifiers and additional version-format edge cases.
    • Updated test helpers and timing; existing application behavior is otherwise unchanged.

The pull request removes explanatory comments and documentation across many server modules. It also adds or adjusts a limited set of tests and helpers. Most implementation behavior remains unchanged.

Changes: Server-wide cleanup and test updates

Layer / File(s) Summary
Pending input, Pi, and prompt coverage
server/pending-input*, server/pi*, server/prompt*
Comments were removed across pending-input, Pi, and prompt modules. Tests add pending-input owner-limit and hold checks, Pi tool-output and image checks, and OmO call-matching cases.
Relay and pairing coverage
server/relay/*, server/relay-pc*
Comments were removed from relay and pairing code and tests. Tests add relay-link and new-session cases. The WebSocket test helper changes how it signals guarded-write settlement.
Portal, runtime, and supporting modules
server/portal*, server/preferences*, server/process-*, server/pty/*, server/push*, server/remote-*, server/repo-*, server/runtime*, other server/*
Comments were removed across these modules and tests. Portal tests add malformed-version cases, and the ping contract test checks rejection of a non-string ping ID.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Refactor

Merge Risk: Minimal · previous review 06d6c

This change mostly removes comments from server code and tests, with a few added test cases. No behavior change is identified. Contract tests were not run locally by the author, so rely on CI before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "refactor(server): drop comments the code can say, part 6 of 8" matches the changeset, which removes explanatory comments and JSDoc across many server files. It is a conventional-commit styl…
Description check Passed The description follows the repository template's intent: it explains what changed (comment removal across the listed server areas), lists the retained public contract and behavior-related comments, a…
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: Title check

Explanation

The title "refactor(server): drop comments the code can say, part 6 of 8" matches the changeset, which removes explanatory comments and JSDoc across many server files. It is a conventional-commit style title and names the scope (server) and the change (comment removal). The "part 6 of 8" phrase is series metadata rather than a description of the change, and the title does not mention the one code change (the EARLIER_BRIDGE_CARD_ID test constant) or the btime comment correction, but those are minor relative to the main change.

Full details: Description check

Explanation

The description follows the repository template's intent: it explains what changed (comment removal across the listed server areas), lists the retained public contract and behavior-related comments, and gives validation results (bun run check fast, per-file unit test runs, and a note that contract tests were edited but not run). The template asks for a Change section that describes the problem and resulting behavior, and this PR does not state a problem or link an issue. The description is long and uses many headings beyond the template, and the validation section does not clearly list the single check commands for the contract tests. Under the policy, the description is mostly complete, so it passes, with a note that the Change section could state the motivation more directly.

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4610b9c and 06d6ce2.

Files selected for processing: 125

  • server/pending-input.test.ts
  • server/pending-input.ts
  • server/pending-requests.ts
  • server/pi-ask-bridge.ts
  • server/pi-delivery.test.ts
  • server/pi-delivery.ts
  • server/pi-large-history.test.ts
  • server/pi-models.test.ts
  • server/pi-models.ts
  • server/pi-questionnaire.test.ts
  • server/pi-questionnaire.ts
  • server/pi-session-label.ts
  • server/pi-session-metadata.test.ts
  • server/pi-session-metadata.ts
  • server/pi-tree.test.ts
  • server/pi-tree.ts
  • server/pi.contract.test.ts
  • server/pi.test.ts
  • server/pi.ts
  • server/ping.contract.test.ts
  • server/plan-routes.ts
  • server/plugin-actions.ts
  • server/plugin-routes.ts
  • server/plugins.contract.test.ts
  • server/portal.test.ts
  • server/portal.ts
  • server/preferences.test.ts
  • server/preferences.ts
  • server/preview.ts
  • server/private-state.test.ts
  • server/private-state.ts
  • server/process-owner.test.ts
  • server/process-owner.ts
  • server/process-start.test.ts
  • server/process-start.ts
  • server/profile-marker.test.ts
  • server/profile-marker.ts
  • server/project-favicon.test.ts
  • server/project-favicon.ts
  • server/prompt-monitor.test.ts
  • server/prompt-monitor.ts
  • server/prompt-watch.contract.test.ts
  • server/prompt.contract.test.ts
  • server/prompt.test.ts
  • server/prompt.ts
  • server/pty/host.test.ts
  • server/pty/host.ts
  • server/pty/pty-host.mjs
  • server/pty/session.test.ts
  • server/pty/session.ts
  • server/pty/sidecar.ts
  • server/pty/smoke.mjs
  • server/pull-request.test.ts
  • server/pull-request.ts
  • server/push-health.contract.test.ts
  • server/push.fake.ts
  • server/push.test.ts
  • server/push.ts
  • server/question-steps.test.ts
  • server/reattach.contract.test.ts
  • server/relay-pc-account-owner.test.ts
  • server/relay-pc-account.contract.test.ts
  • server/relay-pc.contract.test.ts
  • server/relay-pc.test.ts
  • server/relay-pc.ts
  • server/relay/admissions.ts
  • server/relay/direct-gate.ts
  • server/relay/direct.contract.test.ts
  • server/relay/direct.ts
  • server/relay/identity.test.ts
  • server/relay/identity.ts
  • server/relay/link.test.ts
  • server/relay/link.ts
  • server/relay/new-session.contract.test.ts
  • server/relay/pair-code.test.ts
  • server/relay/pair-code.ts
  • server/relay/pair-sas.contract.test.ts
  • server/relay/pairing-approvals.test.ts
  • server/relay/pairing-approvals.ts
  • server/relay/pass.contract.test.ts
  • server/relay/pass.test.ts
  • server/relay/pass.ts
  • server/relay/routes.ts
  • server/relay/service.contract.test.ts
  • server/relay/service.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
  • server/release-notes.test.ts
  • server/release-notes.ts
  • server/remote-bundle.test.ts
  • server/remote-bundle.ts
  • server/remote-entry.contract.test.ts
  • server/remote-entry.test.ts
  • server/remote-entry.ts
  • server/remote-host.ts
  • server/remote-json.test.ts
  • server/remote-json.ts
  • server/remote-move.ts
  • server/repo-diff.test.ts
  • server/repo-diff.ts
  • server/repo-log.test.ts
  • server/repo-log.ts
  • server/request-log.contract.test.ts
  • server/request-log.test.ts
  • server/request-log.ts
  • server/retention-budget.ts
  • server/route-envelope.contract.test.ts
  • server/rpc-diagnostics.test.ts
  • server/rpc-guard.test.ts
  • server/rpcCount.test.ts
  • server/runtime-move-install.contract.test.ts
  • server/runtime-move-lock.test.ts
  • server/runtime-move-lock.ts
  • server/runtime-move-remote.test.ts
  • server/runtime-move-run.test.ts
  • server/runtime-move-run.ts
  • server/runtime-move-service.contract.test.ts
  • server/runtime-move-service.test.ts
  • server/runtime-move.contract.test.ts
  • server/runtime/capabilities.test.ts
  • server/runtime/capabilities.ts
Files with no reviewable changes: 91

  • server/pending-input.ts
  • server/pending-requests.ts
  • server/pi-ask-bridge.ts
  • server/pi-delivery.test.ts
  • server/pi-delivery.ts
  • server/pi-models.test.ts
  • server/pi-models.ts
  • server/pi-questionnaire.ts
  • server/pi-session-label.ts
  • server/pi-session-metadata.test.ts
  • server/pi-session-metadata.ts
  • server/ping.contract.test.ts
  • server/plan-routes.ts
  • server/plugin-actions.ts
  • server/plugin-routes.ts
  • server/plugins.contract.test.ts
  • server/portal.test.ts
  • server/preferences.test.ts
  • server/preferences.ts
  • server/preview.ts
  • server/private-state.test.ts
  • server/process-owner.test.ts
  • server/process-start.test.ts
  • server/process-start.ts
  • server/profile-marker.test.ts
  • server/profile-marker.ts
  • server/project-favicon.test.ts
  • server/project-favicon.ts
  • server/prompt-monitor.test.ts
  • server/prompt-monitor.ts
  • server/prompt-watch.contract.test.ts
  • server/prompt.contract.test.ts
  • server/pty/host.test.ts
  • server/pty/host.ts
  • server/pty/sidecar.ts
  • server/pty/smoke.mjs
  • server/pull-request.test.ts
  • server/pull-request.ts
  • server/push-health.contract.test.ts
  • server/push.fake.ts
  • server/question-steps.test.ts
  • server/relay-pc-account-owner.test.ts
  • server/relay-pc-account.contract.test.ts
  • server/relay-pc.contract.test.ts
  • server/relay-pc.test.ts
  • server/relay/admissions.ts
  • server/relay/direct-gate.ts
  • server/relay/direct.contract.test.ts
  • server/relay/identity.test.ts
  • server/relay/identity.ts
  • server/relay/link.test.ts
  • server/relay/link.ts
  • server/relay/new-session.contract.test.ts
  • server/relay/pair-code.test.ts
  • server/relay/pair-sas.contract.test.ts
  • server/relay/pairing-approvals.test.ts
  • server/relay/pass.contract.test.ts
  • server/relay/pass.test.ts
  • server/relay/routes.ts
  • server/relay/service.contract.test.ts
  • server/relay/session-port.contract.test.ts
  • server/relay/test-helpers.ts
  • server/relay/virtual-socket.ts
  • server/release-notes.test.ts
  • server/release-notes.ts
  • server/remote-bundle.ts
  • server/remote-entry.contract.test.ts
  • server/remote-entry.test.ts
  • server/remote-host.ts
  • server/remote-json.test.ts
  • server/remote-json.ts
  • server/remote-move.ts
  • server/repo-diff.test.ts
  • server/repo-diff.ts
  • server/repo-log.test.ts
  • server/repo-log.ts
  • server/request-log.test.ts
  • server/retention-budget.ts
  • server/route-envelope.contract.test.ts
  • server/rpc-diagnostics.test.ts
  • server/rpc-guard.test.ts
  • server/rpcCount.test.ts
  • server/runtime-move-install.contract.test.ts
  • server/runtime-move-lock.test.ts
  • server/runtime-move-remote.test.ts
  • server/runtime-move-run.test.ts
  • server/runtime-move-service.contract.test.ts
  • server/runtime-move-service.test.ts
  • server/runtime-move.contract.test.ts
  • server/runtime/capabilities.test.ts
  • server/runtime/capabilities.ts

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

@devswha
devswha merged commit 8f78d85 into main Nov 17, 2026
29 checks passed
@devswha
devswha deleted the refactor/no-comment-server-6 branch November 17, 2026 17:57
@devswha

devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 2fe98888d8ce as 8f78d8589c67 on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
machine-proof CLEAR
rule3 CLEAR

The owner's refactor (server, part 6 of 8), merged by the merge pass on his word under rule 3. A machine proof removed comments and compared the merge base with the owner's head: 124 of the 125 files are identical. The one that differs, server/prompt.test.ts, names a card id it expects (EARLIER_BRIDGE_CARD_ID, the same bytes, used only in the expectation); a fresh reviewer and Codex were clear, 467 tests pass at both ends.

The deleted comments were searched for the five kinds the owner keeps (883 distinct hit lines); a fresh reviewer kept 93 blocks, put back word for word by the merge pass's worker: the bearer token kept away from the PTY host, sidecar and attach; secrets never in argv or logs; no request forgery through push endpoints or redirects; link-local addresses never dialed; the pairing window not reopenable by the clock or a failed save; the session-socket ownership check; git's safety flags; the VAPID-key trap; Windows facts and the macOS socket path limit; and measured timings.

devswha added a commit that referenced this pull request Nov 18, 2026
)

## What

#4063 (`server/`, part 6 of 8) 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.

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 block that mixes kinds
counts under its main kind)

| Kind | Findings accepted | Lines |
|---|---|---|
| Security | 648 | ~1043 |
| Platform fact | 303 | ~538 |
| Measured value | 35 | ~65 |
| Trap (names a concrete breakage) | 147 | ~283 |
| Attribution | 2 ("#2503 review by @jpcarranza94", "order by
@jpcarranza94 in #2503") | ~2 |
| Not flagged by Codex, under the rule | 11 (mirrors of flagged notes,
plus 3 more; see below) | ~14 |
| LOW "cut mid-sentence" fixes | 2 | 2 |

The 1,336 HIGH and MEDIUM findings break down as:
- 1,135 accepted
- 149 traps declined
- 52 rejected: all 37 "false body claim" findings, including the two on
files the PR never changed (scripts/omp-question-compat.ts,
server/dispatch.ts), and 15 others

Of the 5 LOW findings, three cut kept comments now read whole:
- process-start.test.ts "never after the process started ...", restored
so "... and close" has its first half
- prompt.test.ts "An inert child supplies a real process environment
...", restored so "it says so once it runs" has its subject
- runtime-move-service.contract.test.ts:42, fixed by restoring :39

The other two are left: plugins.contract.test.ts:12 still reads whole,
and pty-host.mjs:72 is answered by the restored EIO note.

The not-flagged notes include:
- relay-pc.ts: "DIRECT_PORT, not imported: that module listens"
- pi-models.ts: the 4 MiB catalog cap
- pi-delivery.test.ts: the sparse 200 MiB hole
- relay-pc.contract.test.ts: "port 1 on loopback refuses at once"
- portal.test.ts: `CHILD_MS`
- identity.ts: the `public_key` encoding
- repo-log.ts `commitsOf`
- rpc-diagnostics.test.ts: the connect wait

### Declined, rejected, left out

- **149 trap findings declined.** They give a design reason, describe
the code, or name a test target. Examples:
- pending-input.ts:95: "never evict an in-flight send" names no
breakage.
- prompt.ts:1833/1909: "a move is a new asking, begun before its first
key" describes the code.
- push.test.ts:414, 477, 1124, 1299 and process-owner.test.ts:100/107:
"regression (fails on ...)" notes that name the test target.
- session.ts:271: "relay hints are answered in AUTH_OK, not WELCOME",
declined as #4036 declined it.
- **15 rejected besides the body claims.** Examples:
- pi.contract.test.ts:139 is a duplicated line; the identical line above
it survives.
- request-log.test.ts Given/When/Then lines whose test names already say
it.
- pending-input.ts:328 "its held messages stay with their owners"
narrates `forget`.
- pi-session-label.ts:163 "native falsy preambles" was left out as
unsure.
- **Stale.** process-start.ts:27 keeps only its first sentence. The
"btime stays put when the clock is stepped" clause is false, as the
merged PR's body says.
- **Narration trimmed** from mixed blocks; the kept sentences are word
for word. Examples:
  - pi-session-metadata.ts header: only the checked-descriptor sentence
  - openRelayPcTunnel: only the 127.0.0.1-behind-a-token paragraph
  - piBranchSegments and piAbandonedTurns docs
  - the preferences.ts header
  - many prompt.ts blocks
  - remote-host.ts and runtime-move-lock.ts headers

### Security notes put back (short)

- **pending-input / pending-requests:** a recycled PID is no match;
agent-only kept on a saved copy's resend; held messages never offered to
automatic delivery; a moved send waits for an explicit Send; withdrawal
receipts outlive the owner's close; retired submit ids cannot run again.
- **pi.ts / pi-ask-bridge.ts:** sessions only inside the store, links
resolved; the extension socket must be the user's own in the process's
own agent dir; a pi that left the front, or shares it, no longer speaks
for the pane; an unread environment names no profile; a stale report
from the bridge's profile is not valid; `unknown` is never room for
keys; the extension re-checks createdAt and the session.
- **pi-delivery / pi-session-* / pi-tree / pi-large-history:**
  - delivery proof:
- the descriptor and the path must name the captured append-only prefix
    - the log is not an integrity checksum for arbitrary edits
  - checked descriptor, never a reopened path:
    - null refuses an identity
    - a parser stays private until its key is re-checked
  - instrumentation counts only, never labels or paths
  - escapes and controls always take the checked path
  - repeated ids are never trusted
  - abandoned records stay unreachable
  - pictures need real raster bytes and a drawn call
- **pi.test / pi.contract.test:** cursors from another conversation or
file are refused; image refs stay in their store; escaped JSON is still
a clear; a pane's profile, never the bridge's own environment.
- **relay-pc.ts and its tests:**
  - Pairing:
    - Noise NK pairing like a phone, revocable
    - only one first channel pairs, and only through the relay
    - a vouched pairing sends nothing and counts nothing
    - members compare digits, never B's screen
    - a ticket is good once
  - The key:
    - the PKCS#8 key is the only secret
    - mode 0600, kept only after AUTH_OK
    - no key is written after removal
  - Dialing:
    - only dialable carriers are kept and dialed
    - a revoked PC stops for good
- Updates: install pinned to the release shown, cancelled only by the
asker.
  - Who may pair PCs: the owner from a direct, driving window only.
- **relay/** (C1, C2):
  - Admission and pairing:
    - admission limits
    - identity rotation and the key-derived server_id
    - drive authority and the origin gate on routes
    - WS_OPEN, PAIR and PAIR_REQUEST refusals on direct carriers
    - SAS binding and both-confirm rules
    - pair-code single use, timing-safe M1
    - the pairing window, caps and closes
  - Relay passes:
    - passes only to Ovis's relays, in headers, never in the URL
    - grace and enforce rules
  - The direct listener:
    - gate caps, head deadline, the gate header secret
    - loopback only behind the gates
- **push.ts / push tests / push.fake.ts:**
  - Storage:
    - push-keys.json privacy
    - endpoints stored as hashes
    - retired marks per owner
  - Who sees and acts:
    - status only to the owning key holder
    - a watching device gets no buttons
    - the open LAN gets no status
    - buttons approve only what the alert shows
  - Delivery:
    - no plain-http endpoint but the loopback fake
    - a denied send records nothing
    - revocation clears marks and history
- **portal.ts / portal.test.ts:** the `PORTAL_ENV` allowlist; recovery
bound to pid and identity; never stop another server's Portal;
per-launch proof; the bearer link is never kept or logged; visitor
identity headers dropped.
- **preferences, pull-request, preview, profile-marker, project-favicon,
ping, plugins:**
  - an oversized body is refused unread
  - gh's error text is stripped of escapes
  - `OVIS_PREVIEW` is no security boundary
  - the marker file is 0600 and a regular file only
  - favicon roots must be absolute
  - `agent_only` passes through the relay
  - a header-less POST never reaches a plugin route
- **private-state, process-*, pty/*, remote-*, repo-*, request-log,
route-envelope, rpc-guard, runtime-move-*:**
  - The PTY host:
    - vouched for by SHA-256 and version
    - a private CLI gets no server credentials
  - Remote PCs:
    - remote bundles verified, never kept partial
    - chosen sockets validated before any ping
    - byte caps counted after decompression
- Git: refnames, revisions and paths validated; untracked files never
followed out of the repository.
  - Headers and logs: CRLF injection cannot forge log fields.
  - Route checks:
    - every check runs before herdr is reached
    - a watching device and other sites learn no files
  - Runtime moves:
    - flock-held move lock, holder proven by token
    - the bridge token opens no runtime switch

## 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]>
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