Skip to content

docs(scripts): put back the notes the comment pass dropped (#4049) - #4087

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

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

Conversation

@devswha

@devswha devswha commented Nov 17, 2026

Copy link
Copy Markdown
Owner

What

#4049 (scripts/, part 4 of 5) 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.

run.sh, build-cache-promote.sh, hook-test-harness.sh, relay-ios-sim.sh are left out: the kit cannot yet prove a comment-only change there (its shell and PowerShell readers lose track of a quoted string partway through the file), so those notes wait for a kit fix.

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

Committed: 92 files, +951 / -17 lines (the 17 are cut or reworded comments replaced by their original wording)

kind findings lines (approx.)
security 185 457
platform fact 103 207
trap naming a concrete breakage 83 188
measured value 15 19
non-prose (install.ps1 reads stopped ) 2 2
altered / cut mid-sentence, original wording back 25 75
Rust SAFETY 0 0

The provers print nothing (prove_ts, prove_other) and verify.ts reports checked 92, problems 0.

Held, not committed (the kit reads them as "inside a string or heredoc")

4 files, 83 findings, about 258 lines. Their whole diffs are in these patches, which apply cleanly to main:
Most of these are security notes (41 findings).

Security notes put back (committed)

  • plugin.ts: token kept owner-only and out of herdr's log; settings files hold the token; profile record read
    from one descriptor, bounded; owner socket trusted only when owned, mode-checked, not a link; door pinned per
    command; no authorization on the owner socket; machine profile pairs through the relay only; health never
    falls back to TCP; auth fields; PC's terminal is the approver; typed-ahead lines and pipes approve nothing;
    digits re-read; signals take the code back; QR is a key, terminal only; phone is the one Tailscale writer.
  • plugin-tui.ts: OVIS_TOKEN/URL withheld from the TUI's environment.
  • plugin.test.ts: token never printed, health asks only the owner socket, TCP control, typed digits would approve,
    pairing code replaced before the package check.
  • privileged-jobs-workflow.test.ts: the runner-registration threat model and rule set header; reviewed actions
    at exact refs; artifact actions by any spelling; anything not read-only counts as write; case variants
    refused; reusable-workflow if checked repo-wide; no download by id; Pages found by four signs; Release
    hands the Mac app workflow every secret.
  • pty-sidecar.ts, server-artifact.ts, server-install.ts, server-manifest.ts, server-install.test.ts,
    server-binary-workflow.test.ts: crate tree ties a host to sources; host record removed first, never trusted;
    manifest signature, version, size and SHA-256 checked before anything changes; NoBinaryRelease only on 404;
    https-only redirects; archive members without .. or links; committed key only, test key by option;
    installed binary re-verified; Ed25519 over exact bytes; strict base64; duplicate keys refused; schema
    fail-closed; version check beside the signature; sign job leaves no key line; deploy job never reads the key.
  • release-ci-reuse.ts/.test.ts, release-validate-workflow.test.ts, release-notes.ts: which CI run may stand
    for a release; attempt-bound, skipped is not passed; one-line annotation; restored builds sha256-checked;
    Release restores no cache; effective token permissions; attest jobs cannot tag or release; output parser
    refuses extra lines; release notes cannot open a tag.
  • self-hosted-runner.test.ts, job-started.sh, vm-runner.sh, hook-test-container.sh: kill tests only behind a
    proven guard; cache never writable; unclearable outbox means no cache; own network namespace; root-owned
    lock files; no other host mount; mirror bound to its repository; exact repository name; only the proven
    direct parent is signalled; name is not an executable; claim floods and stale claims; fail-closed hook
    header; pid digits only; token to config.sh only; DNS rule scope; never a job without the firewall.
  • relay-pairing-prompt, relay-panel, relay-shell, relay-media, relay-dashboard(-fixtures), relay-e2e,
    relay-join, relay-second-device-join: approve guards (focus, Tab, double-click, labels); QR code taken
    back on join; visitor and serve-only limits; relay switch closes the device gate; non-extractable keys;
    requests stay off the shell host; damaged or forged offers refused before any socket; revocation clears
    the key; push isolated per PC; render host runs no script before consent; foreground-only session report;
    CSP-only negative control.
  • replay-clipboard, secret-input, terminal-input, terminal-early-keys, terminal-attach, terminal-file-input,
    sticky-modifiers, terminal-autoswitch, terminal-keyboard: replayed OSC 52 never copies (older bridge,
    permission off, reconnect, pane switch, observer, retirement); secrets masked, dropped on disconnect, never
    drafted or held offline; no auto-replay before readiness; held drafts not bypassed by keys or paste; a
    newline in a path is not Enter; text dressed as a PNG refused; observers get no control.
  • portal-regression.ts, telemetry-regression.ts: test-herdr.ts import keeps the user's session out;
    telemetry keeps nothing from before an off and tells nothing while off. Also pty-compare, ssh-integration,
    ssh-password-docker, security-summary, revision-bound-update, session-history, repo-diff, pwa-update,
    push-health, prompt-dock: isolation, watch-only refusals, store-bound Resume, auth boundary offline.

Declined or already there (43)

  • Traps without a concrete breakage (25): design reasons, test targets, fixture gating (e.g. plugin.ts
    HERDR_SOCKET precedence, prompt-dock focus choices, tab-menu "must not open the gate").
  • Measured values that only cite the demo's 4500 ms timer hold or describe a settle loop (7); platform facts
    that describe a fixture (2); one rewritten Vite note that kept its meaning (service-worker-build.ts).
  • PR-body claims (6), remote-bundle-smoke.ts XDG note already intact (the PR's added one-line duplicate was
    removed), HANGUL_INK_EM now documented at its constant in src/.

For the owner

Left out after review: the 40-line security header of scripts/privileged-jobs-workflow.test.ts. #4049 dropped it on purpose because scripts/self-hosted-runner/README.md ("Security model") carries it, and its rule 3 predates #4058's pull-request Mac runs-on form, so putting it back word for word would restore an out-of-date rule.

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

@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 4 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 7bec1d2.

Files selected for processing: 92

  • scripts/plugin-tui.ts
  • scripts/plugin.test.ts
  • scripts/plugin.ts
  • scripts/portal-regression.ts
  • scripts/preferences-sync-regression.ts
  • scripts/preflight.sh
  • scripts/privileged-jobs-workflow.test.ts
  • scripts/prompt-card-timing-demo-regression.ts
  • scripts/prompt-dock-demo-regression.ts
  • scripts/pty-compare.ts
  • scripts/pty-sidecar-attach.sh
  • scripts/pty-sidecar.ts
  • scripts/push-health-demo-regression.ts
  • scripts/push-settings-regression.ts
  • scripts/pwa-update-browser-qa.ts
  • scripts/quiet-port.test.ts
  • scripts/quiet-port.ts
  • scripts/readme-media/banner.ts
  • scripts/readme-media/compose.ts
  • scripts/readme-media/stage.ts
  • scripts/relay-dashboard-browser-qa.ts
  • scripts/relay-dashboard-fixtures.ts
  • scripts/relay-e2e-regression.ts
  • scripts/relay-ios-sim.test.ts
  • scripts/relay-join-browser-qa.ts
  • scripts/relay-media-browser-qa.ts
  • scripts/relay-open-bench.ts
  • scripts/relay-pairing-prompt-regression.ts
  • scripts/relay-panel-regression.ts
  • scripts/relay-qa-teardown-regression.ts
  • scripts/relay-second-device-join-regression.ts
  • scripts/relay-shell-browser-qa.ts
  • scripts/release-ci-reuse.test.ts
  • scripts/release-ci-reuse.ts
  • scripts/release-guards.ts
  • scripts/release-notes.ts
  • scripts/release-validate-workflow.test.ts
  • scripts/remote-bundle-smoke.ts
  • scripts/render-crash-demo-regression.ts
  • scripts/replay-clipboard-demo-regression.ts
  • scripts/repo-diff-browser-qa.ts
  • scripts/restored-draft-demo-regression.ts
  • scripts/revision-bound-update-demo-regression.ts
  • scripts/secret-input-regression.ts
  • scripts/security-summary-demo-run.ts
  • scripts/self-hosted-runner.test.ts
  • scripts/self-hosted-runner/hook-test-container.sh
  • scripts/self-hosted-runner/job-started.sh
  • scripts/self-hosted-runner/vm-runner.sh
  • scripts/server-artifact.ts
  • scripts/server-binary-workflow.test.ts
  • scripts/server-install.test.ts
  • scripts/server-install.ts
  • scripts/server-manifest.ts
  • scripts/service-worker-build.ts
  • scripts/session-history-browser-qa.ts
  • scripts/session-history-fixture-data.ts
  • scripts/split-view-regression.ts
  • scripts/ssh-integration.ts
  • scripts/ssh-password-docker.ts
  • scripts/sticky-modifiers-regression.ts
  • scripts/sw-navigation.test.ts
  • scripts/tab-agent-mark-demo-regression.ts
  • scripts/tab-overflow-regression.ts
  • scripts/tab-switch-bench.ts
  • scripts/tap-targets-demo-regression.ts
  • scripts/telemetry-deployed.test.ts
  • scripts/telemetry-regression.ts
  • scripts/telemetry-report.test.ts
  • scripts/terminal-arrows-clicks-regression.ts
  • scripts/terminal-attach-regression.ts
  • scripts/terminal-autoswitch-demo-regression.ts
  • scripts/terminal-bundled-mono-regression.ts
  • scripts/terminal-cjk-punctuation-regression.ts
  • scripts/terminal-command-arrows-regression.ts
  • scripts/terminal-command-backspace-regression.ts
  • scripts/terminal-composition-regression.ts
  • scripts/terminal-copy-off-regression.ts
  • scripts/terminal-copy-regression.ts
  • scripts/terminal-ctrl-enter-regression.ts
  • scripts/terminal-dispose-browser-qa.ts
  • scripts/terminal-early-keys-demo-regression.ts
  • scripts/terminal-file-input-regression.ts
  • scripts/terminal-file-links-regression.ts
  • scripts/terminal-ghostty-demo-regression.ts
  • scripts/terminal-hangul-seam-regression.ts
  • scripts/terminal-images-demo-regression.ts
  • scripts/terminal-ime-diagnostic.ts
  • scripts/terminal-input-regression.ts
  • scripts/terminal-ipad-ime-regression.ts
  • scripts/terminal-keyboard-demo-regression.ts
  • scripts/terminal-keyboard-suggestions-regression.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 0bbae15 into main Nov 17, 2026
31 checks passed
@devswha
devswha deleted the docs/restore-notes-4049 branch November 17, 2026 21:58
devswha added a commit that referenced this pull request Nov 18, 2026
…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]>
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