# Contributing to SysKnife > **Want help. Want it loud, want it tested, want it shippable.** New > contributors are the lifeblood of this project. We would rather merge a > small, well-tested PR than a giant one that needs three rounds of > review. ## TL;DR ```sh git clone https://github.com/lacs-project/sysknife cd sysknife scripts/ci-local.sh --install-hooks npm ci --prefix apps/sysknife-shell # Run the whole suite (≈ 90s) cargo nextest run --workspace --locked # Make a change, open a PR. Conventional Commits style on the title. ``` A PR that passes CI, has tests, and follows the [trust-boundary rules](docs/architecture.md) is on track. **Running the suite on macOS?** The workspace suite is only *observed* on Linux: every job in `.github/workflows/ci.yml` is `runs-on: ubuntu-latest`. On a Mac, red does not mean your change broke something. The measured state as of `9d862835` (2026-10-01 survey, [#411](https://github.com/lacs-project/sysknife/issues/411), hosted `macos-26-arm64` runner): `sysknife-cli` does not compile there yet (`SocketTarget::Vsock` referenced without the `cfg` the variant itself carries), and with that package excluded the rest of the workspace runs with thirteen known host-assumption reds — distro-probe refusals in `sysknife-daemon` and two macOS `sun_path` length trips in `transport::listen`: ```sh cargo nextest run --workspace --locked --exclude sysknife-cli --no-fail-fast ``` The exact failing set, the platform record and the raw counts live in `tests/evidence/macos-survey.json`. Reds beyond that list are worth a look before blaming the platform — and if your change turns one of the thirteen green, update that evidence file in the same PR. --- ## Where the effort goes right now **Ubuntu is the active target**, across 22.04, 24.04 and 26.04. Live-VM evidence, action coverage and security review all point at the Debian-family path first. Fedora Atomic 41+ stays eligible and its rpm-ostree, Flatpak and toolbox action families still pass. It is deprioritized, not dropped, and what it needs is a current validation run rather than new code. See [docs/distro-support.md](docs/distro-support.md). **GUI work is paused.** The Tauri shell under `apps/sysknife-shell/` stays in the tree and must keep building, so workspace gates still cover it, but it is not where contributions are wanted today. Please pick something else from the table below. ## High-impact areas | Area | Why it matters | Difficulty | |---|---|---| | **Ubuntu LTS support** | The current suite is 100+ Ubuntu stories. Committed live-VM evidence covers 79 of those Ubuntu stories on each LTS release, with a committed replay twin that reproduces each run: 22.04, 24.04 and 26.04 all at 79/79. The 20+ additional stories are not yet included in a committed live-VM run. `ubuntu-vm.sh` accepts `UBUNTU_RELEASE=jammy\|noble\|resolute`. Remaining: story coverage for the cross-family actions, and every Debian-only action has a story. | medium | | **Distro detection coverage** | Robust `/etc/os-release` parsing for every release we claim to support. Pure-function tests against real fixture files, no integration mocks. The existing fixtures at the bottom of `crates/sysknife-core/src/distro.rs` show the shape. | easy | | **Action catalogue gaps** | Add a typed action (for example `EnableFirewallZone`). Small and isolated, and every PR carries the policy entry, the risk level and the tests. | easy | | **E2E story coverage** | Real prompts, real LLM, real daemon. The suite is 150+ stories: 50+ atomic + 100+ Ubuntu. What is left is the cross-family middle: of the action names available on both families, 46 are still untouched by any story, plus 10 Fedora-only and 0 Ubuntu-only ones. See #233 for the clustered map. | medium | | **Fedora Atomic validation** | The action families exist and `DistroId::is_supported()` returns true for Atomic 41 and up. Nobody has run `tests/e2e/atomic-vm.sh` against a current release. Needs Fedora Atomic hardware or a VM host. | tedious | | **Demo recording on real hardware** | Replace the bundled demo GIF with a 30-second recording on real Ubuntu 26.04 with rollback visible. | easy | ## Finding something to work on Issues carry a difficulty label: `easy`, `medium`, `hard` or `tedious`. Filter the tracker by [`good first issue`](https://github.com/lacs-project/sysknife/labels/good%20first%20issue) or [`help wanted`](https://github.com/lacs-project/sysknife/labels/help%20wanted) to find something self-contained. If the tracker looks thin, open an issue describing what you want to work on and we will scope it with you. No CLA and no copyright waiver. The project is MIT, and each commit carries a [DCO sign-off](#4-pull-request). ## Workflow ### 1. Pick or open an issue For anything substantial, open an issue first. We'll triage and confirm the design direction before you sink time into a PR. For tiny fixes (typos, comment improvements, a missing test), skip the issue and go straight to a PR. **Say so in the thread before you start.** We add the `claimed` label when someone does, and that label is what everyone else reads. Two contributors picked up the same issue a minute apart recently and one of them lost the work. A one-line comment prevents it. If an issue already carries `claimed` and the thread has been quiet for a week, say you are taking it over rather than opening a competing PR. **Windows and WSL line endings.** This repository pins tracked text to LF via `.gitattributes`. On Windows or WSL, configure this checkout with: ```sh git config core.autocrlf false ``` If an existing checkout already has CRLF line endings, first make sure the working tree is clean, then renormalise it: ```sh git config core.autocrlf false git rm --cached -r . && git reset --hard ``` `git reset --hard` discards local changes, so do not run the recovery sequence with work you have not committed or stashed. ### 2. Branch, code, test Workflow action pins keep an exact tag in the adjacent comment, for example `uses: actions/checkout@<40-hex SHA> # v7.0.1`. The tag must resolve to that commit, including when it is annotated. Only `dtolnay/rust-toolchain` may use `# stable (branch)`, and the verifier requires its pinned SHA to be reachable from that branch. Other actions and branches cannot use this marker. Keep existing SHAs when correcting comments; review action upgrades separately. Run `bash scripts/verify-action-pins.sh` to check these comments. It needs authenticated `gh`, Python 3, and PyYAML (`python3 -m pip install PyYAML`, also installed by yamllint). Both `docs-and-hygiene` and `scripts/ci-local.sh` require this check, including a working GitHub API connection. Offline regression tests run with `bash tests/release/action-pin-comments.test.sh`. Workflow checks also discover nested `.github/actions/**/action.yml` and `action.yaml` metadata. Composite `runs.steps[*].uses` references require the same SHA pins and version comments as workflow steps. Local and CI YAML linting use `bash scripts/lint-github-yaml.sh`; Node EOL checks include both setup-node versions and local JavaScript actions' `runs.using` runtime. An absent actions directory is allowed; an existing empty or unreadable directory fails discovery. Run `python3 tests/test_github_yaml.py` for the cross-gate fixtures (requires PyYAML and yamllint). The full `bash tests/release/release-rehearsal.test.sh` gate invokes these fixtures too, so install both before running it locally: `python3 -m pip install PyYAML==6.0.2 yamllint==1.38.0`. ```sh git checkout -b feat/ # … implement … cargo nextest run --workspace --locked cargo clippy --workspace --all-features --all-targets --locked -- -D warnings cargo fmt --all -- --check ``` **TDD is the project rhythm.** Write the failing test first, watch it fail, then write the minimum code to make it pass. The test suite is the contract. **One command runs the whole board.** ```sh scripts/ci-local.sh ``` It reproduces every gate CI runs, including the ones that only fail after the obvious ones pass: the evidence artifact below, the prose claim screen over every doc that carries a published figure, ShellCheck, and the registry manifests. A per-crate run like `cargo test -p sysknife-types` never touches those, so a green crate is not a green board. **Never type a figure.** Test counts, the action count, story-set sizes and story pass rates are rendered by `scripts/render_figures.py` from the artifact or source that produces them, and a number the claim checks match outside a marker fails the build. Add your tests, run the command below, and commit the evidence file together with whatever it re-rendered: ```sh UPDATE_TEST_BASELINE=1 scripts/test_baseline.sh ``` Figures that routine pull requests move are rounded floors ("2,000+"), so most PRs re-render nothing. The exact Rust and frontend counts are the README badges, read from the evidence file. The marker syntax is explained once, in [docs/contributing/testing.md](docs/contributing/testing.md#published-figures). `workspace-tests.json` stores the expected count for each suite and the canonical command that measures it. Verification re-runs the suite on the current checkout and requires the observed count to match. It makes no historical claim about a Git commit or measurement timestamp. Do not add provenance metadata by hand. `cargo-nextest` itself needs no system packages. If it is the missing piece, install it directly: ```sh cargo install cargo-nextest --locked ``` The GUI workspace members still need the platform libraries named in CI. If you cannot install those, do not estimate a count or edit the evidence metadata by hand. Leave `tests/evidence/workspace-tests.json` and the three prose files untouched. In the PR body, name the command you could not run and the missing tool or system library that blocked it. A maintainer will run the full suite and regenerate all four files before merge. This is the supported fallback; an honest missing measurement is better than metadata that describes a run which never happened. **When GUI library dependencies are missing, this fallback takes precedence over the Pre-Commit Gate in `CLAUDE.md`.** Run `scripts/ci-local.sh --no-postgres` and copy its summary into your PR body. Steps that fail only because the GUI libraries are missing are expected; name them and the missing library, and a maintainer will run the full suite before merge. CI gates both halves, so bumping the artifact alone turns `docs-and-hygiene` red after `rust` goes green. **Do not chase the figure.** It moved fifteen times in the twenty days to 2026-08-24, so on any PR that waits a day or two the number you recorded stops being the answer, and that is not your problem to solve. Record it once, say in the PR how many tests you added, and let the maintainer refresh it after later merges. Whoever merges is what moves the figure, so whoever merges carries it. If `rust` is red only on the baseline, the PR is not blocked on you. `scripts/test_baseline.sh` names both numbers when they disagree, in the form `rust suite has tests, baseline says `, so a red run tells you the answer rather than setting a puzzle. (Real digits are not written here on purpose: this file is screened by `scripts/check_evidence_claims.py`, and an illustrative figure reads as a published claim. That screen caught this very paragraph.) **Markdown links are discovered from the tracked tree.** Both local and remote CI call `scripts/markdown-link-files.sh`: every tracked Markdown file gets the deterministic source-relative check, while external URLs stay bounded to `scripts/markdown-link-external-files.txt`. Add a documented entry to `scripts/markdown-link-exclusions.txt` only when a source file must be skipped; the discovery test rejects exclusions that no longer name a tracked file. **Every release and E2E test must be reachable from a gate.** `scripts/check_test_reachability.sh` discovers `tests/release/*.test.sh` and `tests/e2e/*.test.sh`, then requires a standalone `bash ` command in a `run` step for each exact path in `ci.yml`, `e2e.yml`, or `release.yml`. Trailing comments and a `sudo` or `sudo -n` prefix are allowed. Other sudo options, comments alone, artifact paths, shell compound commands, heredoc text, and mentions in `ci-local.sh` do not count. Keep these test steps in that explicit form and add the invocation in the same change as a new test; a test without one makes both local and remote CI fail. This is a static invocation check. Literal-false `if` conditions and literal-true `continue-on-error` settings on a step or its job exclude that invocation, including their `${{ false }}` and `${{ true }}` expression forms. Other `if` expressions remain eligible, and the checker reports each dependency on stderr. A YAML block scalar containing just that command is supported. Multi-line shell scripts, including a command with a separate comment line, are not; give each test its own standalone step instead. The local hygiene runner discovers these test files automatically; do not also add explicit local invocations, which would run a test twice. The workflow parser uses PyYAML, already installed with CI's `yamllint` prerequisite. Install it into the same Python environment used to run the gate: `python3 -m pip install yamllint==1.38.0`. A missing parser or unreadable workflow fails the gate instead of falling back to text matching. **A change that touches no Rust skips the Rust gate.** The workspace suite exists to stop a Rust regression reaching `main`, and a diff with no `.rs` file in it cannot cause one: ```sh git diff --name-only upstream/main... | grep '\.rs$' # empty means the gate does not apply ``` For such a diff the gate is the Node suite for the package you touched, `scripts/check_evidence_claims.py`, and CI on Ubuntu. Run the claim screen even for a JavaScript change: `packages/setup/index.js` is in `CLAIM_FILES`, and the screen remains the claim-screen entry point. Story-family derivation delegates to `tests/e2e/run-stories.sh --metadata`, so story-related claim checks require Bash and the repository's normal POSIX-style environment. Say which of the three you ran. **Which release your change lands in.** While SysKnife is in the `0.y` series, a change that breaks a consumer moves the middle digit and everything else moves the last one. [docs/release.md](docs/release.md#version-numbering) carries the rules and the criteria for 1.0.0. Say so in your PR description when you remove or rename a public item, so it goes out in the right release. ### 3. Commit style The `container-image` check builds the shipped Dockerfile when an image input changes, then verifies the CLI version and uid 10001. It also proves the smoke checks reject an image reporting an incorrect version and one running as root. BuildKit caches layers between runs. The trigger set includes both Cargo manifests, all copied crate/CLI/Tauri sources, `.dockerignore`, Dockerfile, and the check itself; other paths are excluded by `.dockerignore` and are not copied into the build. Documentation-only changes still receive a successful check without a build. Repository administrators should require `container-image` in branch protection so Dependabot base-image updates cannot merge without this evidence. Conventional Commits on the title: ``` feat(daemon): add ConfigureFirewallZone action fix(brain): retry on transient OpenAI 5xx docs(readme): replace demo GIF with 26.04 capture ``` Bodies should explain *why*. The diff already says what. ### 4. Pull request - One PR per logical change. Big multi-concern PRs get split. - Add or update tests for any behaviour change. - Update docs alongside the code, not in a follow-up. - Title in Conventional Commits style (`fix(cli): …`, `docs: …`). No CI check enforces it; the squash merge uses the title as the commit subject. - Sign off every commit with `git commit -s`. The `Signed-off-by:` trailer certifies the [Developer Certificate of Origin](https://developercertificate.org/): you wrote the change, or have the right to submit it under the MIT licence. The `dco` check fails a pull request with an unsigned commit and prints the commands that sign off commits you already pushed. **Before you open it.** Three habits account for most of the rework on this tracker, and each is cheap: - Run `scripts/ci-local.sh`. A compile error in a crate your machine cannot build is still a compile error, and finding it costs a review round. - Read `git status` before committing. Plans, prompts, harness logs and scratch directories belong outside the tree. Stage explicit paths rather than `-A`, which also sweeps up anything a parallel session left behind. - Report only what you ran. If you filtered a test run by name, say which names. A validation list shorter than the diff describes coverage that does not exist, and the test it skipped is usually the one that fails. **Check `main` before calling a failure pre-existing.** `main` is green and its CI history is public. A failure that appears only on your branch is yours. One that appears only on your machine is worth an issue with the output, because a flake in this suite is worth knowing about either way. **Your first PR needs a maintainer to approve each CI run.** GitHub holds fork workflows until you have something merged here, and it holds them again after every push. An empty check board is not a green one, so wait for the runs to appear before drawing conclusions from them, and say so in the thread if they look stuck. ### 5. Review Every PR gets a review pass + a sonnet code-reviewer agent dispatch (automatic). Security-sensitive PRs (privilege boundary, IPC, validators, audit chain) also get a red-team agent dispatch. Aim for review turnaround under 48h; ping in the PR if you've been waiting longer. A reviewer checks, in this order: 1. **The trust boundary.** The change keeps every rule in [Trust-boundary rules](#trust-boundary-rules). A change that touches one of them gets the deeper pass described there. 2. **Tests that prove the change.** A fix or a behaviour change comes with a test that fails when the change is reverted, and the reviewer reverts it to watch that happen. A test that stays green without the fix does not count. 3. **The couplings a diff hides.** Adding or removing a Rust test moves `tests/evidence/workspace-tests.json` (`UPDATE_TEST_BASELINE=1 scripts/test_baseline.sh`). An edit to `packaging/sysknife-daemon.service` lands in the copy inside `tests/e2e/ubuntu-provision.sh` too. A `packaging/sysknife-*-edit` helper's own screen stays in step with the Rust validator it mirrors, element by element. 4. **Docs that move with the code.** A user-visible change updates the docs in the same PR, and published figures come from `` markers, never typed by hand. The maintainer writes the CHANGELOG entry at merge. 5. **A green board.** Every required check passes, `dco` included, on a branch that is up to date with `main`. A maintainer approves a PR that meets all five. Each review finding is marked blocking or optional, and only a blocking one holds the merge. When you and the reviewer disagree, keep the discussion on the PR; the maintainer decides and writes the reason there. ## Working with an AI assistant Use one if it helps. Several merged changes here were written with one, and [#274](https://github.com/lacs-project/sysknife/pull/274) is the model: the author named the tool that assisted, reviewed the whole diff themselves, and every figure in the description came from a run they had actually done. Two things are asked in return, and neither is about the tool. Read the diff before you open the PR. You are its author. Review here goes into tracing a change to a live path and mutation-testing the guards it touches, and that effort is wasted on a diff nobody has read. Do not let it write claims you have not checked. A validation checklist states what happened rather than offering a template to fill in. The costliest version of this is a confident summary attached to a branch that does not compile, because a reviewer who believes it stops reading. Disclosure is welcome and never counts against a PR. It tells a reviewer where to look harder, which helps both of us. ## Trust-boundary rules These are non-negotiable. A PR that breaks them is rejected on principle. 1. **The brain (`sysknife-brain`) MUST NOT make privileged calls.** It talks to the LLM and proposes typed actions. That's it. 2. **The shell (`sysknife-shell`) MUST NOT execute actions.** It renders plans and captures approval. The daemon executes. 3. **The daemon (`sysknife-daemon`) accepts only typed actions over IPC.** No shell strings, no eval, no JSON-RPC method that takes raw command bytes. 4. **Every privileged action ships with a risk level and a transaction-store row.** Any new D-Bus interaction it requires must be added to the central polkit allowlist (`packaging/50-sysknife.rules`). The daemon gates D-Bus actions through one allowlist file, not one polkit rule per action. 5. **`validated_safe_arg` is the boundary validator.** Any new action that interpolates a user-provided string into a command must validate at the boundary, not deep inside the executor. 6. **Constant-time compares for any auth-sensitive bytes** (tokens, request hashes). The HI-1/HI-2/HI-19 work in PR #179 set the pattern. If your change touches any of these, expect deeper review. That means the change is load-bearing. ## Reporting security issues For privilege escalation, auth bypass, audit-chain forgery, or data exposure, follow [`SECURITY.md`](SECURITY.md) instead of opening a public issue. We'll triage privately and credit you in the public advisory once fixed. ## Code of Conduct Be kind. Be precise. Disagree on technical merit, never on the person. Project enforces the [Contributor Covenant 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/). ## Long-form The full contributing guide, with every nuance and every "why we do it this way", lives at [`docs/contributing/CONTRIBUTING.md`](docs/contributing/CONTRIBUTING.md). Questions? Open a [GitHub Discussion](https://github.com/lacs-project/sysknife/discussions).