Visual Studio Code, rebuilt in Rust
Rust
docs(notes): record the choices behind the documents and guardrails
rokarturdc8ca00d3464
diff --git a/port/notes.md b/port/notes.mdindex 3f98fc9561c..d7a928f914f 100644--- a/port/notes.md+++ b/port/notes.md@@ -1035,6 +1035,18 @@ What to do (milestone 21, in order):- Linux x64's apt downloads stalled at ~100 kB/s on the image's `azure.archive.ubuntu.com` mirror (12 and 15 min in 2 of 3 runs). [awalsh128/cache-apt-pkgs-action](https://github.com/awalsh128/cache-apt-pkgs-action) (Apache-2.0) caches the packages' files but restores neither dpkg's database nor the postinst triggers WebKitGTK and Mesa need, and its docs name the same stall with the fix the setup takes: apt pointed at `archive.ubuntu.com`. arm64 already uses `ports.ubuntu.com`.- Linux and Windows test jobs are `continue-on-error` until M23 and M24 close their test failures; `checks` and the macOS tests fail the run. Outside CI: ui-pair, pixel-check and api-tests, which drive the reference app in a GUI session on the Studio.+## Documents and guardrails (branch worktree-docs)++- The documents follow [rust-analyzer's architecture document](https://github.com/rust-lang/rust-analyzer/blob/master/docs/book/src/contributing/architecture.md) and [matklad's ARCHITECTURE.md convention](https://matklad.github.io/2021/02/06/ARCHITECTURE.md.html): one map of where things are and which invariants hold, code named by path and symbol, no line numbers, nothing that goes stale with each commit. [Ghostty's HACKING.md](https://github.com/ghostty-org/ghostty/blob/main/HACKING.md) is a how-to and has no map, so it was not the model. `port/tools/docs-check.ts` is the port's own addition: neither project checks its document against the code.+- Unsafe lints compared: [Bevy's Cargo.toml](https://github.com/bevyengine/bevy/blob/main/Cargo.toml) (MIT/Apache) has `unsafe_op_in_unsafe_fn` and `clippy::undocumented_unsafe_blocks` at `warn`, with `unsafe_code = "deny"` and a Miri job; [Zed's Cargo.toml](https://github.com/zed-industries/zed/blob/main/Cargo.toml) gates style lints (`dbg_macro`, `todo`) and has no unsafe lint. The port takes Bevy's two lints at `deny`: a warning does not fail a build. A workspace `unsafe_code = "deny"` does not fit, because `app` and `exthost` are FFI; the seven crates without unsafe code have `#![forbid(unsafe_code)]`.+- Clippy runs with `-A clippy::all`: the run is the SAFETY gate only. The other clippy lints give thousands of findings today and `cargo fmt --check` about 25,000 changed lines, so neither is a gate.+- Miri is not a check: the `diff` crate's tests did not finish in 17 minutes on the Studio, and the crates with unsafe code are FFI, which Miri does not run.+- cargo-deny over cargo-audit: one config (`native/deny.toml`) with a reason per ignored advisory. Licenses stay with `port/tools/check-licenses`.+- Found while writing the SAFETY comments: `terminal/profiles.rs` `login_shell` and `shell_env.rs` `passwd_shell` read `getpwuid`'s static buffer from two threads (now one `getpwuid_r` helper), and Free Port parsed the pid as the first field of the `lsof` line that is a number, the command name included, so a listener named `0` or `-1` made `kill` signal the app's process group or every process of the user (now `capture_pid`, as ptyService.ts `capturePid`).+- Performance gate compared with [Zed's tooling/perf](https://github.com/zed-industries/zed/tree/main/tooling/perf): `cargo perf-test` runs tests marked `#[perf]` under hyperfine, stores a JSON per run and `cargo perf-compare` reports the relative change between two runs. The port's gates are absolute limits in ignored tests (16 ms typing, 8 ms scroll frame) and `port/budgets.json` for the whole app, so a run fails without a stored base run. Not taken: the stored runs and the tracy profiler hook of Zed's gpui, which the Wu fork does not have.+- No measurement against Zed exists: `port/tools/bench` passes VS Code's arguments to each app and Zed is not on the Studio (`docs/performance.md` "Zed").+- The whole-app gate (`port/tools/bench-check.ts`) is proven on rows in the format of `port/tools/bench`, not on a live run: a live run needs a packaged release app and the GUI lane.+## Accepted platform differencesGPUI or Rust std limits Artur accepted as differences from 1.147.0; one line each.