Visual Studio Code, rebuilt in Rust
VSRustium agent instructions
VSRustium is a Rust/GPUI port of VS Code 1.148.0 (README.md). Upstream VS Code is a checkout in upstream/ (VSCODE_SRC), never edited: the upstream changes the port needs are port/patches/*.patch and port/product.json.
The owner's message wins over this file. This file wins over a skill, a document and a comment in the code: where two of them disagree, follow the higher one and name the disagreement in the report.
Three ways to lose work or leak it:
- Never edit
upstream/. A change the port needs there is a file inport/patches. - Never touch another session's worktree (
git worktree list), and never push tomainunless the owner asked for it. - The repository is public: no credentials, personal data, host names or internal links in code, commits, pull requests or docs. Name a secret by its variable, never by its value.
The port's state, about 1 MB: search it with rg, never read it whole.
- The ledger, the one source of truth.
port/ledger.md, the open work: decisions, milestones with their "done when" checks and status;port/ledger/done.mdthe closed work.port/ledger/units/<area>.md, the Units table: one row per upstream unit with its milestone, status, open gaps and the narrowest check that proves it (rg -n '^\| workbench/contrib/scm ' port/ledger/units). A gap leaves its cell and an item turnsdoneand moves todone.mdin the commit that closes it;bun port/tools/ledger-check.tschecks the tables agree. A row that tracks a GitHub issue names it asvsrustium#N;bun port/tools/ledger-issues.tslists where the rows and the issues disagree. port/notes.md: decisions, traps and findings per milestone, reached from the ledger rows (rg -n '^## ' port/notes.mdlists its sections).
How the code is built, read before the first edit in an area:
ARCHITECTURE.md: the crates, the processes, the path of a key and of a frame, the invariants. Read it before a change that crosses a module or adds one.docs/README.md: the table from the code a change touches to the area document to read, the table of shared helpers to reuse before adding one, and the libraries that differ from the stock ones.docs/recipes.md: the steps to start a task, close a gap, add a command, answer a host call, cover every surface and ship.GLOSSARY.md: the port's own words (unit, gap, verified, lane, gate). Use them as defined, in reports, commits and test names.docs/memory-safety.md: read before a change tounsafecode, FFI, a raw pointer or aSend/Syncimpl.docs/performance.md: read before a change to arender,key_context, a list row, tokenization or startup.
Rules:
- Port 1:1: match upstream 1.148.0's behavior, look and tests, citing the upstream file. A difference is a decision in
port/notes.mdor a ledger row that is notverified. - Builds, tests and GUI runs go to the Studio:
port/tools/studio '<cmd>', GUI tools withport/tools/studio --lane '<cmd>'. - Run tests with
port/tools/cargo-test [-p <crate>] <filter>, and every other cargo command ascargo gc <cmd>(boundsnative/target): only failures and summaries, and a filter that matches nothing fails. - Markdown: one paragraph per source line, no hard wrapping.
- UI labels use title-style capitalization, as upstream's.
- Remove temporary files and scripts made while working.
- Release channel by tag: a version or tag ending in
-insider(v1.148.0.1-insider) is a pre-release, published as a GitHub pre-release; one without it (v1.148.0.1) is latest (stable), published as GitHub's latest release. unsafeonly inappandexthost, each block under a// SAFETY:comment that names the fact it relies on, its file a row of the inventory indocs/memory-safety.md. The check:cargo gc clippy -p app -p exthost --all-targets -- -A clippy::all.- Speed and memory are the product: the goal is the fastest editor there is, ahead of Zed on every benchmark and lowest in RAM, with every VS Code feature (
docs/performance.md). Every change picks the design that costs the least time and memory; one that makes a measured number worse names it and why in the report. - No I/O and no work in proportion to the whole document or tree on the main thread in a hot path. A change to a hot path reports the numbers of its gate (
docs/performance.md) from before and after. - Before writing a piece that is new to the project from scratch, read how 2 or 3 open-source projects do it, and name them with the choice in
port/notes.md. - Documents cite code as a path plus a symbol, never a line number. After a rename, a move or a deleted symbol:
bun port/tools/docs-check.ts.
Agent skills
Issue tracker
GitHub Issues in rokartur/vsrustium via gh. See docs/agents/issue-tracker.md.
Pull requests
Open every pull request through .agents/skills/pr/SKILL.md, the repo's own pr skill. It replaces the global one here, because it adds the vsrustium remote and the labels the review bot leaves to a person. It asks rokartur-review for review only when the user asks.
Triage labels
needs-triage, needs more info, ready-for-agent, ready-for-human, wontfix. See docs/agents/triage-labels.md.
Domain docs
Single-context: GLOSSARY.md at the root, extended by /domain-modeling when a term is resolved; decisions in port/notes.md. See docs/agents/domain.md.