# Contributing to RayTrace Thanks for wanting to help. This guide is how to set up a checkout, run the tests, and open a pull request. The product itself — local and cloud sandboxes, the MCP server, and the dashboard — is described in the [README](README.md). If RayTrace is useful to you, a star on the repo helps other developers find it. Questions or want to pick up more issues? Join us on Discord: https://discord.gg/k7VWV5Gac9 ## What you need - **Node.js 22.16 or newer** (`node --version`) and npm - **Git** - For trying a **local sandbox** from your checkout: macOS 13.5 or later, or Linux with Lima, QEMU, and access to `/dev/kvm`. Windows is experimental; RayTrace doesn't download Lima there. `raytrace doctor` (or `node bin/raytrace.mjs doctor`) checks what's missing. ## Set up ```sh git clone https://github.com/RayTrace-Inc/RayTrace.git cd RayTrace npm install npm run build # dashboard -> dist/dashboard npm run typecheck npm test node bin/raytrace.mjs # run the CLI from this folder ``` To use your checkout as the MCP server in Claude Code: ```sh claude mcp add --scope user raytrace -- node /path/to/RayTrace/bin/raytrace.mjs mcp ``` To try it without touching your real setup, give it its own home and port: ```sh mkdir -p /tmp/rt && echo RAYTACE_PORT=18797 > /tmp/rt/config.env RAYTRACE_HOME=/tmp/rt node bin/raytrace.mjs setup --no-claude-code ``` `npm run dashboard:dev` runs the dashboard with hot reload, using the API from a running RayTrace. Before you open a pull request, run: ```sh npm test npm run typecheck npm run build ``` ## Project layout ``` raytrace-cli/ ├── bin/raytrace.mjs # CLI entry ├── src/ # CLI: sandbox, MCP, auth, Lima, report, upload ├── proxy/ # recording, evidence store, playground, traces ├── worker/sandbox/ # gVisor sandbox image, collector, Lima config ├── dashboard/ # local dashboard (Vite and React) ├── python/ # PyPI wrapper and wheel build ├── test/ # CLI tests (`npm test` also runs proxy/*.test.mjs) └── docs/ # guides and screenshots ``` ## Internship challenge 🏆 Merged contributions earn points on a public [leaderboard](https://github.com/RayTrace-Inc/RayTrace/discussions/185). The top 3 get the chance to join the RayTrace team as remote, paid interns. The full announcement is [discussion #186](https://github.com/RayTrace-Inc/RayTrace/discussions/186). ### Claiming work 1. **Pick an open issue.** Issues labelled `good first issue` are the place to start. 2. **Comment `/claim` on it.** A bot assigns you if a slot is free. Up to 3 people can claim an issue at a time; a `feature` worth 10 points or more has 1 slot. Being assigned is the claim: other comments don't reserve anything, and commenting `/claim` again doesn't take a second slot. `/unclaim` gives yours back. 3. **Raise a pull request within 24 hours** of claiming: open one (a draft is fine) that says `Closes #N` or `Part of #N`. Otherwise the bot drops your claim and someone else can take over. 4. **One claim without a pull request at a time, and at most 2 open pull requests.** The bot refuses a new claim until you've linked a pull request to your current one or released it. 5. **Your pull request must link an issue you're assigned to.** The **Points** check fails otherwise, and a pull request on an issue you haven't claimed scores 0. (A bug you found yourself, or a docs fix with no issue, needs no claim.) 6. **Best pull request wins.** Even if all 3 claimants raise a pull request for the same issue, maintainers merge only the best pull request and only that pull request earns the points — the others score 0. Talk to each other on the issue if you want to coordinate. 7. **Big features need a design first.** Anything over about 400 changed lines, and every `feature` issue worth 10 points or more, needs a design comment on the issue and the `design-approved` label before you write the code. Large pull requests without it are closed without review. Splitting a feature? Say which part you're taking (`Part of #N`). ### Points > [!IMPORTANT] > **Every pull request must state the points it claims** in the **Points** > section of the pull request template, and why. **Pull requests that don't > claim points are closed without review.** > > The number you claim is a request, not a promise. A maintainer confirms it > with a `points:N` label before merging, and may accept it, lower it, or > reject it (`points:0`). The **Points** check fails until the description > claims points and a maintainer has added the label. | Contribution | Points | |---|---| | A `feature` issue | that issue's `points:N` label (3, 5, 10 or 15) | | Part of a feature (`Part of #N` in the PR) | up to the feature's points, set by a maintainer | | A bug **you found and fixed** that wasn't already reported | 2 | | A fix for a bug that is **already reported** in an issue | 1 | | A bug report a maintainer labels `bug:confirmed` | 1 | | Docs, cleanup and any other merged PR | 1 | - **No standalone test-only pull requests.** Opening PRs that only add unit tests (without fixing a bug or building a feature) is against the rules and earns 0 points — those PRs will be closed. Add tests alongside your feature or bug-fix PRs. - **−1 if a maintainer has to finish it.** When a maintainer has to make changes on top of your pull request before it can merge, it earns 1 point less. - **Pull requests have a 24-hour window to get merged.** Pull requests opened after the cutoff in [`.github/stale-prs.json`](.github/stale-prs.json) that remain open past 24 hours without merging (including unaddressed requested changes or failing checks) are automatically closed. If you think it is a genuine PR, reopen it and reach out to the founders directly on [Discord](https://discord.gg/k7VWV5Gac9). - **Quality over quantity.** Pull requests need tests and passing CI. Tiny pull requests split up to collect points, or generated changes nobody tested, get `points:0`. AI tools are fine; you are responsible for understanding and testing what you submit. - **Run the sandbox locally and attach before/after `.png` screenshots.** Passing unit tests (or screenshots of `npm test`) are not enough on their own. Every contributor pull request must: 1. Explain in the PR description **what was changed and how you solved it**. 2. Run a real local sandbox (`raytrace sandbox create --local` / `raytrace connect` / `raytrace open`) and attach **distinct Before and After `.png` screenshots** under `**Before:**` and `**After:**` in the PR description showing the real behavior before and after your change. The automated **PR Evidence** check ([`.github/workflows/pr-evidence.yml`](.github/workflows/pr-evidence.yml)) posts a bot comment and fails CI until both the explanation and the before/after `.png` screenshots are attached (maintainers may apply `evidence:skip` for pure docs/typo PRs where screenshots don't apply). - A `points:N` label on a pull request always wins. Link the issue with `Closes #N` or `Part of #N`. - Pull requests merged from December 3, 2026 count. Maintainers' pull requests, bots and unmerged pull requests don't. Maintainers have the final say on points. The check is [`.github/workflows/points-check.yml`](.github/workflows/points-check.yml). PR evidence (explanation + before/after `.png` screenshots) is enforced by [`.github/workflows/pr-evidence.yml`](.github/workflows/pr-evidence.yml). Claims are handled by [`.github/workflows/claims.yml`](.github/workflows/claims.yml) (settings in [`.github/claims.json`](.github/claims.json)). Stale pull requests are auto-closed by [`.github/workflows/stale-prs.yml`](.github/workflows/stale-prs.yml) (settings in [`.github/stale-prs.json`](.github/stale-prs.json)). The board is recomputed from GitHub by [`.github/workflows/leaderboard.yml`](.github/workflows/leaderboard.yml) (scoring in [`.github/scripts/leaderboard.mjs`](.github/scripts/leaderboard.mjs), settings in [`.github/leaderboard.json`](.github/leaderboard.json)). ## Where help is needed These are real gaps, already named in the README. If an issue for the one you want isn't open yet, open one first and say you'd like to take it. - **Windows.** Local sandboxes are experimental; Lima isn't downloaded on Windows. Honest docs and collected failure reports would help, and so would making first-run work there. - **Codex prompts.** In local sandboxes, Codex's prompts don't reach the dashboard's Prompts page yet. Commands, file changes and network connections are already recorded. - **First-run of the local VM.** The first `raytrace sandbox create --local` sets up a Lima VM and can take a few minutes. Clearer status and recovery when that gets stuck would help a lot of first-time users. - **Docs.** A short demo GIF for the README, and anything in `docs/` that is unclear after you try the product yourself. Look at [Issues](https://github.com/RayTrace-Inc/RayTrace/issues) for `good first issue`, `bug`, `feature` and `nice to have`. If you want to do something that isn't listed, open an issue before a large pull request. ## Pull requests 1. Fork the repo and create a branch from `main`, named for what it does (`fix/codex-prompts-page`, `docs/windows-setup`). 2. Keep the change focused on one concern. Follow the style of the surrounding code. The CLI and proxy are JavaScript (`.mjs`); the dashboard is TypeScript and React. 3. Add or update tests when you change behavior. CLI tests live in `test/`, proxy tests next to the files they cover in `proxy/`. 4. Run `npm test`, `npm run typecheck`, and `npm run build`. 5. Run the sandbox locally (`raytrace sandbox create --local` / `raytrace connect` / `raytrace open`) and capture **Before** and **After** `.png` screenshots showing the real behavior working end-to-end (unit-test screenshots alone are not enough). 6. Open a pull request that explains **what changed and how you solved it**, links the issue, and attaches your **Before** and **After** `.png` screenshots under `**Before:**` and `**After:**` (enforced by CI). 7. Fill in the template's **Points** section with the points you claim and why. A pull request without it will be closed (see [Internship challenge](#internship-challenge-)). 8. Reply to review comments within 24 hours, or the pull request is closed. ## Reporting bugs and proposing features For a bug, include your OS, `node --version`, the command or MCP prompt you ran, what you expected, what happened, and any output from `raytrace doctor` or logs under `~/.raytrace/logs/` (redact secrets). For a feature, say what problem it solves and how you think it should work. ## Releasing (maintainers) Each release goes to npm (`@raytrace-cli/cli`) and PyPI (`raytrace-cli`) at the same version. The pip package is the npm package plus an official Node.js build, one wheel per platform. PyPI does not allow the name `raytrace`. Every PR merged into `main` automatically increments the patch version, creates a release commit and tag, creates a GitHub Release, and publishes npm. Before merging, use one optional PR label to override the default: | Label | Increment | |---|---| | no label or `release:patch` | `0.13.0` → `0.13.1` | | `release:minor` | `0.13.0` → `0.14.0` | | `release:major` | `0.13.0` → `1.0.0` | | `release:skip` | no version change or publishing | Only one release label is allowed; conflicting or unknown release labels fail without creating a release. Add labels before merging. The workflow queues merged PRs instead of cancelling earlier queued releases (up to GitHub's 100-run queue limit). Rerunning the same merged-PR workflow reuses its release commit and tag. The version commit is pushed as a tag only, never to main, so `package.json` on main does not change; the next version counts from the highest `vX.Y.Z` tag. Releases use the latest main when their queued run starts, so they can include other already merged PRs. The merge run only makes the tag and the GitHub Release. It then starts a second, dispatched run of the same workflow to publish: npm's trusted publishing refuses a run started by a pull request event. `npm-publish.yml` checks the tag against `package.json`, runs typechecking and tests, builds the dashboard through `prepack`, and publishes to npm. It uses the `npm` GitHub environment and npm trusted publishing (OIDC), with no npm token secret. The package's `repository.url` must match `Godcreatebugs/raytrace-cli` for provenance. The npm trusted publisher must specify owner `Godcreatebugs`, repository `raytrace-cli`, workflow `npm-publish.yml`, environment `npm`, and allow `npm publish`. A newly configured publisher must complete its first actual publish within two days; otherwise recreate the expired connection on npm. The same dispatched run builds the pip wheels, installs them on Linux, macOS and Windows, and uploads them to PyPI. PyPI trusted publishing uses GitHub OIDC, so there is no PyPI token. The upload job is in `pip.yml` and uses the `pypi` environment. On pypi.org, add a GitHub trusted publisher for project `raytrace-cli` with owner `Godcreatebugs`, repository `raytrace-cli`, workflow `pip.yml`, and environment `pypi`. Do that before the first upload. Leave the GitHub `pypi` environment without required reviewers so a release does not wait for a click. After npm and PyPI for that version are both up, the run publishes the [MCP Registry](https://registry.modelcontextprotocol.io) entry. No registry secret: the job uses GitHub OIDC. It rewrites `server.json`'s version to the release (main keeps `package.json`'s version, as it does for npm) and runs `mcp-publisher`. The server name is `io.github.Godcreatebugs/raytrace`. npm is verified from `mcpName` in `package.json`; PyPI is verified from the `mcp-name:` line in `python/README.md`, which is the wheel's description. A registry version cannot be edited later, so the job runs only once both packages exist. For a retry, run **Publish npm package** from the Actions tab, on `main`, and enter the release tag. npm and PyPI are skipped when that version is already there; the registry is skipped when that version is already listed. npm registry errors fail the job instead of attempting a publish. Prereleases are excluded from automatic publishing. Already published Releases are not triggered retroactively. To retry a failed automatic release, rerun its merged-PR workflow; to publish an existing tag, use the manual action. `v0.17.4` was tagged before the PyPI upload existed, and its npm publish stopped in the tests. After the trusted publisher is saved, run **Publish npm package** with tag `v0.17.4`. That uploads the wheels and lists the server. Tags from before the registry metadata (`v0.17.3` and earlier) cannot be listed: those npm releases have no `mcpName`. Merging a pull request produces a patch release unless that PR has `release:skip`. The wheel build still checks the archives with `twine check`. The Node.js version bundled in them is `NODE_VERSION` in `python/build_wheels.py`. A version can only be uploaded to PyPI once, and the PyPI page's description (`python/README.md`) only changes with a new version. ## License By contributing, you agree that your contributions are licensed under the MIT License, the same as the rest of the project. See [LICENSE](LICENSE).