Skip to content

docs(server): put back the notes the comment pass dropped (#4054) - #4086

Merged
devswha merged 1 commit into
mainfrom
docs/restore-notes-4054
Nov 17, 2026
Merged

devswha merged 1 commit into
mainfrom
docs/restore-notes-4054

Conversation

@devswha

@devswha devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

#4054 (server/, part 1 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 mixed block counts under its main kind.

Kind Findings accepted Lines
Security 402 ~720
Platform fact 211 ~445
Measured value (size, timing) 24 ~60
Attribution: mulberry32 in claude-images.test, "#362 by @WOULDU-pres" in api.contract.test 2 3
Trap (names a concrete breakage) 80 ~205

There are 783 HIGH/MEDIUM findings: 719 accepted, 42 traps declined, 9 rejected, 13 about the PR body (ignored).

Of the 13 LOW findings, three were fixed: the kept comment had been cut mid-sentence (claude-store.ts:148, claude-input.ts:247, codex.test.ts:1621). The other ten keep the same meaning in other words, so they were left.

14 notes Codex did not flag came back under the rule:

  • in this slice:
    • access.ts: "the request's Host header, as sent"
    • introductions.ts: the 30-day INTRODUCTION_TTL_MS reason
    • background-agent.ts: "throws herdr's pane_not_found"
    • background-agent.contract.test.ts: the 30 s FRAME_WAIT_MS reason
    • app-revision.ts: atStart, "a dist/ rebuilt since"
  • in the Claude files:
    • claude-store.ts: the 2 s PROCESS_MISS_TTL_MS reason; three inline catch notes ("gone, or not ours")
    • claude-subagents.ts: the BUSY_HOLD_MS reason; the busy() note "Claude writes a turn's prompt to its transcript as the turn begins"
    • claude-subagents.test.ts: the 16 MiB window and 5.5 MB agents sizes
  • agent-identity.ts: hc's Foreground.pid

Declined, rejected, skipped

42 trap findings were declined: they give a design reason, describe the code, or name a test target or regression. Examples:

  • api.contract.test.ts 3419, 3532, 3573 and six more: "regression (fails on main): ..."
  • bridge.test.ts 58, 67, 125, 195, 260: regression notes on PID reuse and EPERM, and the test's tunnel and buffering setup
  • account.contract.test.ts:1393 "a stop right then keeps only that"; mailbox.ts:364 "before this page is acknowledged ... keep the rest on disk"; attach-held.contract.test.ts:214 "the pane itself prints herdr's refusal"
  • claude-input.ts:194 "Positive proof of an ordinary empty input box"; claude-settings-file.ts:54 "a -- there included"; codex-images.ts:172 "never holds the bridge for more than a window's work"

9 findings were rejected:

  • claude-store.ts 294 and 296: the CTL_KERN / KERN_PROCARGS2 notes; refactor(server): drop comments the code can say, part 1 of 8 #4054 turned the numbers into named constants.
  • claude-transcript.ts:14: describes the parser.
  • codex-daemon.test.ts 182 and 256: "Then" lines that restate the assertion.
  • agent-launch.ts:1, bridge.ts:37, api.contract.test.ts 3306 and 3526: about our own code, or the test's probe.

Left out on purpose:

  • Narration in mixed blocks, for example "Tests pass a temp one." and the opening sentences of several doc blocks.
  • One case where only the note's later sentence came back: claude-transcript.ts claudeTranscriptStart, which starts "null while ...".

Security notes put back

  • access.ts:
    • field docs:
      • loopback forms
      • shared token (cookie or bearer)
      • the device the cookie belongs to
      • the tagged node names no owner
      • the sole login tailscale status proves
      • MagicDNS name and tailnet IPv4
      • OVIS_TAILSCALE_SERVE_ONLY
      • gated closes the gate
      • Portal proof, and X-Portal-User / X-Portal-Auth "as sent"
      • Host "as sent"
    • "127.devbox.example may point anywhere"
    • lanExposed: who is let in as open, and the bind scope
    • bindScope: a name is never resolved
    • inTailnet
    • no-login requests
    • Host-only proxy
    • forwardingHeaders versus cameThroughProxy
    • machineForwardingHeaders
    • PROXY_HEADERS
    • the trailing dot
    • addressesNode
    • isServeOwnerRequest
    • in decideAccess: a rebound page's Host; the sole-login proof and Funnel; the open grant refuses rebound names
  • access.test.ts: 31 case notes:
    • forged headers off loopback
    • tagged nodes pair
    • no owner known yet
    • the serve-only declaration
    • Tailscale proving nothing
    • unknown names
    • rebinding and public domains
    • a staged foreign login
    • Funnel
    • token precedence
    • LAN clients claiming the proxy
    • a named owner who does not match
    • a login header alone
    • a visitor's copied header against the token
    • URL-parser authorities
    • Portal proof versus X-Portal-User
    • loopback bind exposure
    • token and paired device close the gate
    • the serve ingress shape and unverified headers
  • access-authority.contract.test.ts: a rebound page is let in by neither the open grant nor a typed login; a tagged owner counts only at the tailnet name; controls for the PC's own names
  • auth.ts:
    • device cookie flags
    • legacy cookie names accepted for a year, and cleared on a fresh credential
    • a bearer header outlives sign-out
    • the open pre-auth routes
    • clearing the device cookie
    • no budget for an unknown address
    • shared hold for admitted addresses
    • the shared-budget bound
    • admit
    • a held Bearer never compared
    • the budget spent first
    • sign-out drops both credentials
    • the right token spends both waits
  • auth.test.ts:
    • a held request never reaches the comparison
    • per-address budgets
    • only the proxy-appended forwarded entry believed
    • the origin check: either cookie is session-bearing; the custom header is the non-browser proof; the exemption is the path; a missing Origin is refused
  • account/holds.ts:
    • the header: on disk, a stop lifts neither, an unparsable file holds every add
    • ACCOUNT_HELD_MAX
    • read errors hold every add
    • a confirmed barrier is not taken over
    • each file read separately
    • stale take-over
    • first successful link wins
    • enrollingMember
    • held keys
    • overflow
    • holds and full reasons
  • account/introductions.ts: ids derive from keys; an introduction is only a hint
  • account/records.ts:
    • AddGates docs
    • self-removal
    • held key or held signer
    • a waiting remove gates later adds in the batch
    • undecided keys
    • enrollment order
    • applyLink: the session is its authority
  • account/mailbox.ts:
    • admission TTL
    • pull floors for joins and refused sign-ins
    • PENDING_MAX
    • an unparsable queue is not empty
    • pendingError
    • gates
    • holdsEveryAdd
    • waitingRemoveKeys as blocked
    • one retry run at a time
    • admitted: 10 min and 10 s limits
    • pullForRefusedSignIn budget
    • freshen proof
    • wait: a relayed record never pushes one out
    • a full queue makes the remove undecided
    • nowhere to keep it
    • on disk before ack
    • stop on a local registry error
    • an add later in the page meets the remove
    • refused records acknowledged too
    • trim latch
    • the latch on disk first
  • account/routes.ts:
    • drive access and mutation guard
    • the watcher's one route
    • ?fresh=1 removals
    • who names the relay-pass account
    • the enrollment barrier on disk, never lifted by a refused link
    • a stale barrier taken over
    • the first successful link keeps the wait
    • only a member's session may leave a removal waiting
    • the caller is a member
    • held keys before any add
    • overflow
    • only the linking member hands over adds or ends the wait
  • account/account.contract.test.ts:
    • session authority
    • account key from the next sign-in
    • a local pairing wins
    • a damaged record dropped
    • the barrier survives restart
    • remove applied between rounds
    • a full queue latches
    • adds do not hold others
    • restart keeps a re-pairing
    • sign-in pull budget and equal timing
    • introduction scope
    • the old key's rights
    • relayed records push none out
    • the start-up repair keeps a newer row
  • alert-webhook.ts:
    • the secret field
    • who saved it
    • generation scoping
    • loopback http only for tests
    • canDeliver before each try
    • a loopback or relay link base never replaces a reachable one
    • a watching device refused before the routes
  • alert-webhook.test.ts: an ntfy topic is the whole secret; a save keeps the URL; open-LAN alerts last only while open
  • attach-held.contract.test.ts:
    • nothing typed through the waiting bridge, nor A's half-typed command
    • an observer may not take over
    • keys refused past the exit budget
  • background-agent.contract.test.ts: an agent whose files are links is none of this session's
  • claude-store.ts:
    • unreadable PID records
    • only a complete environment read proves "none exported"
    • ambiguous or unreadable records are never the default store
    • copied stores prove neither holder
    • a process gone or not ours
    • claudeStoreOf never substitutes the default store
    • an unreadable store is an error
    • background-job transcript matching, with state.json agreeing
    • bounded job-state read with no FIFO or link (Claude Code attach panes: follow-ups from #1645 #1876)
    • the /branch parent: non-blocking, no symlinks
    • a torn write gives no identity
    • attach clients
    • two stores claiming a process
    • walk proofs not shared
    • HERDR_PANE_ID inheritance
    • lastEntrypoint
    • ownSessionInstead
    • only a claude-<uid> folder this user owns
  • claude-store.test.ts: an unreadable environment gives no session; no links followed; a base this user owns is not another uid's
  • claude-subagents.ts:
    • header: only plain files read, ids are plain words, prompts and answers stay here
    • AGENT_ID
    • a quoted block is not a tool result
    • openPlain: FIFO or link swaps
    • another session's rows
    • linked or swapped folders list nothing
    • folder chain identity
    • validDetailId length
    • stillThere
    • foreign answers nothing
    • a replaced file or ancestor taints the read
    • a new Claude session cannot read it
  • claude-subagents.test.ts:
    • linked agent files and folders
    • linked parent transcript
    • another session's id
    • refusing to follow links
    • file identity
    • one foreign record taints the file
    • no prompt, event or argument leaks
  • claude-transcript.ts: terminal controls stripped in one pass; only a message's first block can be a header
  • claude-input.ts: Send anyway goes only over exactly that box; a restored draft counts only on a verified viewport
  • claude-images.test.ts: no picture from a rejected scan's boundary; the other picture is not served; a read vouches only for earlier lookups
  • claude-settings-file.ts:
    • %LOCALAPPDATA%, not %TEMP%
    • directories made without traversing a link
    • only a regular non-linked file with matching identities
    • an entry turned into a link is refused
  • cliproxy.ts, 38 notes on hidden Hub accounts:
    • identities widened only from shown rows
    • the hidden list must be the user's own regular file under the cap
    • only fixed messages cross the boundary (upstream errors echo credentials)
    • hidden or removed accounts' credentials never used
    • partial reads fail closed (blind)
    • a Hub or key change drops rows
    • an oversize save fails
    • checkCovered
    • both views must allow a read
    • a reused file name carries no rows
  • cliproxy.test.ts:
    • hidden accounts never read
    • ambiguity reads nothing
    • an uncovered key blinds, and the way out survives restart
    • Bob under Alice's file name
    • no older list
    • the hidden key alone
  • cliproxy.fake.ts: never reads credentials or calls a provider
  • cliproxy-routes.ts: pending OAuth sessions belong to this app
  • codex-steering.ts:
    • fresh re-asked, stale write withheld
    • the live composer only
    • only Send now interrupts, only for text
    • the caller rechecks identity, lease, authority and prompts
  • codex-daemon.ts:
    • only initialize, initialized and skills/list
    • experimentalApi false
    • never start a daemon
    • one provider per home
    • the home read from /proc only
  • codex-daemon.contract.test.ts: the pane's own home's daemon, never the server's
  • codex-images.ts:
    • the store anchor is taken once and blobs are read only from it
    • links inside or above the store
    • the blob must be a regular file hashing to its digest, the same file after the read
    • a tool picture refuses remote URLs, paths and svg
    • hash refs keep base64 and paths out
    • held attachment, no FIFO wait
    • bound history only
  • codex-images.test.ts: later opens meet the other folder
  • codex-binding.contract.test.ts: no other rollout stands in; the id alone ties nothing
  • codex-process-store.test.ts and codex-process-lock-store.test.ts: no inferred store across a descriptor change; ownership rechecked
  • codex-processes.test.ts:
    • no weaker fall-through
    • remote-resumed thread
    • shared daemon on pane A
    • another user's process
    • a rename before the stat
    • a screen match proves no file
  • codex.test.ts:
    • name without UUID needs agreeing ids
    • the name proves integrity, not parenthood
    • a link's own name contradicts the header
    • outside the store stays out
    • an unrelated later rollout is not the base
  • api.contract.test.ts:
    • unheld locks select nothing
    • bridge token: GET only, /api/access its own, wrong token opens nothing
    • same-origin gate first
    • other PC's bridge and browser token
    • cross-site pages make no folders and read no repo contents
    • prompt files not written through symlinks
    • an observer must not resize or seed the pty
    • no-token gate sources
    • rebinding page pairs
    • a rejected identity is not an absent one
    • mutation guard
    • first pairing closes the gate, and revoking never reopens it
    • plugin .env token
    • a visitor's login header meets the token
    • open-LAN warning only for that state; Funnel never open
    • watcher prompt redacted and capped at 1 MiB
    • named store never falls back
    • watchers cannot write preferences
    • no secrets in the diagnostics facts
    • first cookie use confirms pairing
    • move badge needs the bridge token
    • a damaged registry is not a first install
    • proxy and rebound-name ingress
  • bridge.ts:
    • registered conditions
    • never overwrite a live bridge
    • fails closed without the guard
    • relay client-ahead cap
  • bridge.test.ts: a malformed birth once overwrote the live descriptor; a host name may resolve elsewhere
  • cmd.ts: each cwd is only a candidate; the session must validate inside it
  • client-connection-log.ts:
    • a trickling body gives up its slot, with one deadline for the whole body
    • only allow-listed fields logged
    • the quota is charged after validation
  • agent-catalog-install.ts: other fields refused, no command or platform
  • agent-catalog-detect.ts: where another program has the binary's name, nothing is looked up or run
  • agent-catalog-routes.ts and agents-routes.ts: read-only GET, access gate first
  • agent-catalog-routes.test.ts: a watching device never reruns the user's shell
  • agy.ts: a renamed-over file waits for the next read to authorize it
  • agy-store.ts:
    • only paths the selected process holds
    • a failed holder query proves nothing
    • only a fresh complete scan is singleton evidence
  • catalog-sources.ts:
    • providers only read
    • the asking server's stores, never a process-wide default
    • builtin rows never removed or added
  • catalog.conventions.test.ts: only the terminal attachment may take over, after an explicit user request

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

Restores, word for word, the security notes, platform facts, measured
values, attribution and concrete-breakage traps that the comment pass in
#4054 deleted from server/ (access, auth, account, the agent catalog and
launch, bridge, the Claude readers, cliproxy, cmd, the Codex daemon and
queue), after checking each finding of a Codex review of the merged
commit. Comments only; no code changes.

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

coderabbitai Bot commented Nov 17, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 73176f4 and 50d993f.

Files selected for processing: 79

  • server/access-authority.contract.test.ts
  • server/access.test.ts
  • server/access.ts
  • server/account/account.contract.test.ts
  • server/account/holds.ts
  • server/account/introductions.ts
  • server/account/mailbox.ts
  • server/account/records.ts
  • server/account/routes.ts
  • server/adopt-legacy-env.ts
  • server/agent-catalog-detect.test.ts
  • server/agent-catalog-detect.ts
  • server/agent-catalog-install.test.ts
  • server/agent-catalog-install.ts
  • server/agent-catalog-routes.test.ts
  • server/agent-catalog-routes.ts
  • server/agent-identity.test.ts
  • server/agent-identity.ts
  • server/agent-launch.ts
  • server/agent-name.ts
  • server/agent-process.test.ts
  • server/agent-process.ts
  • server/agent-tasks.ts
  • server/agent-version.test.ts
  • server/agent-version.ts
  • server/agents-routes.test.ts
  • server/agents-routes.ts
  • server/agy-store.ts
  • server/agy.test.ts
  • server/agy.ts
  • server/alert-webhook.test.ts
  • server/alert-webhook.ts
  • server/api.contract.test.ts
  • server/app-revision.ts
  • server/attach-held.contract.test.ts
  • server/attach-output.ts
  • server/auth.test.ts
  • server/auth.ts
  • server/background-agent.contract.test.ts
  • server/background-agent.ts
  • server/background-wait.ts
  • server/bridge.test.ts
  • server/bridge.ts
  • server/catalog-sources.ts
  • server/catalog.conventions.test.ts
  • server/chat-history.test.ts
  • server/claude-command-history.test.ts
  • server/claude-command-history.ts
  • server/claude-images.test.ts
  • server/claude-input.ts
  • server/claude-plan.ts
  • server/claude-senpi-notices.test.ts
  • server/claude-session.contract.test.ts
  • server/claude-settings-file.ts
  • server/claude-store.test.ts
  • server/claude-store.ts
  • server/claude-subagents.test.ts
  • server/claude-subagents.ts
  • server/claude-transcript.ts
  • server/client-connection-log.ts
  • server/cliproxy-routes.ts
  • server/cliproxy.fake.ts
  • server/cliproxy.test.ts
  • server/cliproxy.ts
  • server/cmd.test.ts
  • server/cmd.ts
  • server/codex-binding.contract.test.ts
  • server/codex-daemon.contract.test.ts
  • server/codex-daemon.test.ts
  • server/codex-daemon.ts
  • server/codex-images.test.ts
  • server/codex-images.ts
  • server/codex-linked-completion.test.ts
  • server/codex-process-lock-store.test.ts
  • server/codex-process-store.test.ts
  • server/codex-processes.test.ts
  • server/codex-steering.ts
  • server/codex.contract.test.ts
  • server/codex.test.ts
  • 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 merged commit 49d8b66 into main Nov 17, 2026
24 checks passed
@devswha
devswha deleted the docs/restore-notes-4054 branch November 17, 2026 21:51
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