From 1da4168ae2ab8c5598b178ad42c9842b54850a73 Mon Sep 17 00:00:00 2001 From: Josef Schlehofer Date: Tue, 1 Dec 2026 09:20:03 +0100 Subject: [PATCH] docs: say how changes and automated tools are expected to work here Nothing told contributors that a change lands in the Go client first, or how to work with automated tools. AGENTS.md and CONTRIBUTING.md now say both, and that a person approves every push and comment. --- .github/pull_request_template.md | 4 ++ AGENTS.md | 67 ++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 16 ++++++++ 3 files changed, 87 insertions(+) create mode 100644 AGENTS.md create mode 100644 CONTRIBUTING.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index ffcd708..761ece9 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -9,3 +9,7 @@ - [ ] `cargo fmt --all -- --check` is clean - [ ] If behaviour differs from the Go implementation, the README's "Differences from the Go implementation" section says so and why +- [ ] A change to options, output or the protocol has already merged in the + Go client +- [ ] I have read [AGENTS.md](../blob/master/AGENTS.md) and approved + everything in this pull request myself diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..cafa15b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,67 @@ +# AGENTS.md + +For coding agents and other automated tools, and for the people who run them. +The same rules apply to changes written by hand. + +## What this project is + +`librespeed-cli` here is the Rust port of the Go client +[librespeed/speedtest-cli](https://github.com/librespeed/speedtest-cli). It is +meant to behave like the Go client: the same options, exit codes, messages and +report formats. + +- A change to the protocol, the options or the output goes to the Go client + first. It comes here after it has merged there. A pull request that is ahead + of the Go client waits or is closed. +- A difference from Go that is meant to stay is listed under "Differences from + the Go implementation" in `README.md`, with the reason. +- `tests/parity` runs both clients against the same servers and compares what + they print. The Go commit it uses is `GO_COMMIT` in `tests/parity/cases.rs` + and `LIBRESPEED_GO_COMMIT` in `.github/workflows/ci.yml`. Do not loosen its + normalizer or rewrite its expectations to make a change pass. If the two + clients differ, the change is wrong or the difference belongs in the README. + +## Rules the code keeps + +- Text from a server or a server list is untrusted. It goes through + `output::sanitize` before it reaches the terminal or a report, and CSV text + goes through `csv_text` in `src/report.rs`. +- Numbers in JSON are written the way Go writes them, through `go_float` in + `src/report.rs`. +- The build keeps working with `--no-default-features --features native-tls`, + on the Rust version `Cargo.toml` names, and on 32-bit targets without 64-bit + atomics. +- `.github/workflows/ci.yml` is also the gate of the release workflow. A job + added there can block a release. + +## Before you open or update a pull request + +Run what CI runs: + +```sh +cargo fmt --all -- --check +cargo clippy --all-targets -- -D warnings +cargo test +cargo test --no-default-features --features native-tls +``` + +For a change to options, output or the protocol, also run the parity test. +`README.md` says how under "Testing". + +## Pull requests and comments + +- A person reads and approves every push and every comment before it goes out, + and can explain every line of the change. +- A pull request does one thing. Its description says what changes for a user, + such as a new CSV column, JSON key or message. +- Push when the change is ready, not after each finding. Do not ask an + automated reviewer for a new review after every push, and do not change code + only because one asked. A person decides first whether the finding is right. +- Comment to answer a maintainer or to explain a decision. Post no status + updates, no repeated summaries of test runs and no mentions of yourself. The + description and the commits are the record. +- Do not open the same change in several repositories at once. Start where it + has to land first and wait for it to merge. + +Maintainers may close or lock a pull request or an issue that does not follow +this. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8e38e00 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contributing + +Bug reports and pull requests are welcome. + +- This client follows the Go client. A new feature or a change to the output + goes to [librespeed/speedtest-cli](https://github.com/librespeed/speedtest-cli) + first and comes here after it has merged there. +- Run the checks from the pull request template before you push. +- You may use an AI tool to write code or text. You are still the author: read + and approve everything before it is pushed or posted, and be ready to + explain it. +- Keep the discussion short. Comment when there is something to say, and post + no status updates. + +[AGENTS.md](AGENTS.md) has the full rules, for tools and for the people who +run them.