walkdiff 0.0.0-stage → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +82 -0
- package/LICENSE.md +105 -0
- package/README.md +268 -2
- package/SECURITY.md +136 -0
- package/app-ui/assets/index-C67lFF6-.js +63 -0
- package/app-ui/assets/index-tNGj7j9a.css +1 -0
- package/app-ui/index.html +13 -0
- package/package.json +35 -4
- package/report-ui/assets/index-Dz8FNp8V.css +1 -0
- package/report-ui/assets/index-GjC9TYrP.js +81 -0
- package/report-ui/index.html +15 -0
- package/scanner-pins/semgrep-requirements.txt +1302 -0
- package/walkdiff.mjs +10322 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- **npm package:** Walkdiff can be published to npm, so people will run `npx walkdiff app` instead of cloning the repository. Releases publish from GitHub Actions with provenance and no stored token.
|
|
6
|
+
- **`walkdiff setup`,** and scanners install on first use: they now live in your cache folder, `~/.cache/walkdiff/scanners`, rather than inside the code, and don't depend on npm install scripts. `--offline` skips installing them.
|
|
7
|
+
## 0.4.0
|
|
8
|
+
|
|
9
|
+
- **Fairer "Large change":** requirements files locked with hashes now count as lockfiles, so generated lines no longer inflate the size.
|
|
10
|
+
- **App top bar:** the review list and Settings now have the logo and the same bar as reports.
|
|
11
|
+
- **Wording:** the PR comment now says "1 place … uses" rather than "use".
|
|
12
|
+
- **Licence check:** list the licences your team accepts under `dependencies.allowedLicenses` in `.walkdiff.json`, and new dependencies under any other licence, or with none declared, are flagged. It's off until you set a list.
|
|
13
|
+
- **Ruff now installs with Walkdiff,** so Python PRs stop listing it as not run.
|
|
14
|
+
- **zizmor checks GitHub Actions workflows** a PR changes, for problems such as injection and over-broad permissions. It only reads the workflow, and a PR can't silence it. There's no equivalent for GitLab CI yet.
|
|
15
|
+
- **Dependency trust check:** new direct dependencies are flagged if they're known malicious, aren't on npm, PyPI or crates.io, were first published in the last 30 days, or have a name one character from a popular package. List your own packages under `dependencies.private` in `.walkdiff.json` to keep them private.
|
|
16
|
+
- **Malicious packages rank High:** known malicious versions found in lockfiles no longer show as Medium.
|
|
17
|
+
- **`requirements/*.in` files are now read** as dependency lists, along with `requirements*.in`.
|
|
18
|
+
- **Shows where AI review really goes:** with `ANTHROPIC_BASE_URL` set, Settings, the review list and errors now name that address instead of saying Anthropic, and a repository rule limiting AI to `anthropic` no longer passes. Plain http is refused unless the address is on this machine.
|
|
19
|
+
|
|
20
|
+
## 0.3.0
|
|
21
|
+
|
|
22
|
+
- **Redesigned brief:** a top bar on every page shows the logo, where you are and your progress, and the brief now has a clear starting card and a sidebar with the numbers and each check's result.
|
|
23
|
+
- **Clearer PR comment:** it now has the Walkdiff logo, tables, code font for names, and findings that link straight into the PR's diff.
|
|
24
|
+
- **No more "security level":** "Low" sounded like a verdict, but Walkdiff runs pattern and secret scans on added lines, not a security audit. Comments and reports now say what was found, such as "No security findings", and which checks looked.
|
|
25
|
+
- **Easier to read Impact tab:** each change now starts collapsed under a headline saying what depends on it, most exposed first, with a warning colour when removed or renamed code is still in use.
|
|
26
|
+
- **Shorter AI review:** it now leads with where the code differs from the description, then questions to answer, one line each, with explanations on demand. Points about a change also appear beside its code on the review path.
|
|
27
|
+
- **See why changes are highlighted:** the brief explains how the path is chosen, what it leaves out and what it can miss. Flagged changes now always stay on the path, whatever its limit, and findings it can't reach are called out.
|
|
28
|
+
- **Results per check:** the Risks tab has a table of every check with its issues, or why it didn't run, and the brief sums it up.
|
|
29
|
+
- **Link back to all reviews** on the brief and the review path, in the app.
|
|
30
|
+
- **AI choice respected when adding a PR again:** in the app, adding a PR already on the list now uses the **Include AI review** box as it is, instead of ignoring it.
|
|
31
|
+
- **The app opens your browser:** `pnpm walkdiff app` now opens the review list. Use `--no-open` to turn this off.
|
|
32
|
+
- **Coverage for each PR, with no setup:** Walkdiff now looks for a report in CI artifacts of the PR's latest commit and in files the PR adds to a folder, in the app too. Or choose **Attach coverage** on a review: the report updates at once, with no restart.
|
|
33
|
+
- **Clearer all-clear:** the brief and the PR comment now say what was found absent and name the checks used, instead of saying "the checks that ran".
|
|
34
|
+
- **Semgrep, gitleaks and osv-scanner now install with Walkdiff,** so reports stop saying they didn't run, in CI too. `pnpm install` fetches pinned versions and checks them against hashes in this repository, on macOS and Linux. Semgrep needs Python 3.10 or later.
|
|
35
|
+
- **oxlint and jscpd now install with Walkdiff,** so they work with no extra setup, including in CI, at versions pinned in the lockfile. Earlier global installs are no longer used.
|
|
36
|
+
- **Post your review:** in the app, post comments and Comment, Approve or Request changes from the finish screen, to GitHub or GitLab. Nothing is posted until you press the button, and Walkdiff refuses if the PR has new commits since the report was made.
|
|
37
|
+
- **Conversation:** the app shows existing threads in a new tab and beside each change, where you can reply and resolve them, plus who has reviewed so far.
|
|
38
|
+
- **Fewer false warnings:** reports no longer list "Change history" under checks that didn't run on every PR. It was never built, so it wasn't a gap you could do anything about. It's still planned.
|
|
39
|
+
- **Syntax highlighting:** code in the report is now coloured for Rust, TypeScript, JavaScript and Python, in light and dark mode, alongside the added and removed colours and edited-word marks. Other files stay plain, and so do very long lines and very large files, to keep the page fast.
|
|
40
|
+
- **Breaking changes:** Walkdiff flags public APIs, database migrations, environment variables and config keys that could break other code or a deployment. Each one is a stop on the review path that says what could break and which callers are affected. These findings never change the security level. See [Breaking changes](README.md#breaking-changes). The review model schema is now version 11.
|
|
41
|
+
- **Settings page:** the app now has a page to turn optional checks on or off, choose the AI provider and model, test the connection, and see what leaves your machine.
|
|
42
|
+
- **More AI providers:** besides Anthropic, Walkdiff can use any OpenAI-compatible service or a local model such as Ollama, with `--ai-provider openai-compatible --ai-base-url <address> --ai-model <name>`. Keys come from `WALKDIFF_AI_API_KEY`, and only https addresses are accepted unless the model is on your machine.
|
|
43
|
+
- **Team limits on AI:** `"ai": { "providers": ["local"] }` in `.walkdiff.json` limits where a repository's code can be sent.
|
|
44
|
+
- **Changes since your last review:** progress and comments now belong to the PR, not the commit. After a new push, ticks stay on what didn't change, and anything you reviewed that did change comes first, showing the difference from the version you saw. Progress saved by earlier versions isn't carried over.
|
|
45
|
+
- **Test evidence:** `--coverage` reads an LCOV or Cobertura report and shows whether each change's lines ran in tests. Changes whose lines didn't run rank higher. Also available as the Action's `coverage-file` input and the GitLab template's `WALKDIFF_COVERAGE` variable. The review model schema is now version 10.
|
|
46
|
+
|
|
47
|
+
## 0.2.0
|
|
48
|
+
|
|
49
|
+
- **Renamed to Walkdiff.** The command is now `pnpm walkdiff`, the config file is `.walkdiff.json`, and the trusted hosts variables are `WALKDIFF_TRUSTED_GITHUB_HOSTS` and `WALKDIFF_TRUSTED_GITLAB_HOSTS`. An existing `.lens.json` keeps working, but the old variables don't, so set the new ones or tokens won't be sent to those hosts. Saved reviews aren't moved, so the app starts with an empty list.
|
|
50
|
+
- **Code quality:** Walkdiff flags complexity, long functions and lint problems in the code a PR adds, using built-in measures and optional Ruff, oxlint and jscpd. Findings appear as reasons on the review path and never change the security level.
|
|
51
|
+
|
|
52
|
+
## 0.1.0
|
|
53
|
+
|
|
54
|
+
The first release, published under the name Lens. Walkdiff is early software, so expect changes, and it hasn't had an independent security audit.
|
|
55
|
+
|
|
56
|
+
### The review
|
|
57
|
+
|
|
58
|
+
- **Guided review:** the report opens on a brief with what to check and where to start, then takes you through the changes that matter most, explaining why each one is there.
|
|
59
|
+
- **Progress and comments:** mark changes as reviewed and leave comments, on the path or in All changes. Both are saved in your browser, by commit. Comments can be copied for the PR, but aren't posted to it yet.
|
|
60
|
+
- **Whole functions:** each changed function or type appears whole, before and after, for Rust, TypeScript, JavaScript and Python. Other languages get a line diff.
|
|
61
|
+
- **Impact:** where the rest of the code uses what changed, and which callers the PR didn't touch.
|
|
62
|
+
- **Risks:** a security level, built-in rules for secrets, risky APIs and sensitive areas, and known vulnerabilities through OSV.
|
|
63
|
+
- **Security scanners:** optional Semgrep, gitleaks and osv-scanner.
|
|
64
|
+
- **AI review:** optional reading order, description check and questions. Nothing is sent without `--ai`.
|
|
65
|
+
|
|
66
|
+
### Using it
|
|
67
|
+
|
|
68
|
+
- `walkdiff review` for a single report, and `walkdiff app` to keep track of several reviews.
|
|
69
|
+
- A GitHub Action and a GitLab CI template that add a report and a summary comment to each PR.
|
|
70
|
+
- Team rules in `.walkdiff.json`, read from the merge base so a PR can't change its own rules.
|
|
71
|
+
|
|
72
|
+
### Security
|
|
73
|
+
|
|
74
|
+
- Tokens go only to github.com, gitlab.com and hosts you trust.
|
|
75
|
+
- Pull request code is never built or run.
|
|
76
|
+
- See [SECURITY.md](SECURITY.md) for the guarantees and their limits.
|
|
77
|
+
|
|
78
|
+
### Known limits
|
|
79
|
+
|
|
80
|
+
- Not yet tried against a real GitLab merge request, GitHub Enterprise, self-managed GitLab or a live AI review.
|
|
81
|
+
- The review path's ranking uses simple rules, and hasn't been tested with reviewers yet. It can rank an important change too low, so use All changes when in doubt.
|
|
82
|
+
- Progress doesn't carry over to a new push.
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Juan Miguel Salamanca Zafra
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,269 @@
|
|
|
1
|
-
|
|
1
|
+
<img src="docs/assets/walkdiff-logo.svg" alt="" width="48" height="48">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# walkdiff
|
|
4
|
+
|
|
5
|
+
A review companion for GitHub pull requests and GitLab merge requests. `walkdiff review <url>` fetches the
|
|
6
|
+
change, analyzes it, and serves a local report. (Working name; the project name is still an open decision.)
|
|
7
|
+
|
|
8
|
+
Status: early release, [v0.4.0](CHANGELOG.md). To run it on your team's PRs, see the [pilot guide](docs/pilot.md).
|
|
9
|
+
|
|
10
|
+
**Documentation:** [getting started](docs/getting-started.md), [configuration](docs/configuration.md), [troubleshooting](docs/troubleshooting.md), [security policy](SECURITY.md).
|
|
11
|
+
|
|
12
|
+
## What the report shows
|
|
13
|
+
|
|
14
|
+
The report opens on a brief: what to check, how many changes need attention, and where to start. A review path then takes you through the changes that matter most, one at a time, with why each one is there, its code, callers and tests. You can mark changes as reviewed and leave comments, and everything else stays one link away under **All changes**. In the app, you can then post your review to the PR and join the discussion.
|
|
15
|
+
|
|
16
|
+
All changes has five tabs, including **Conversation** in the app: **Changes** (files, the map of each file and the changed units), **Impact** (where other code uses what changed), **Risks** (each check's result and every finding) and **AI review**. Each tab shows a count, and its name in the URL lets you link to it, as in `#risks`.
|
|
17
|
+
|
|
18
|
+
- **Changed units, not hunks.** For Rust, TypeScript/JavaScript and Python, each changed function, method,
|
|
19
|
+
type or class appears once, whole, before and after, with edited words marked. A class shows only the
|
|
20
|
+
code it owns; its methods are separate cards.
|
|
21
|
+
- **A map of each file.** When a file has several changed units, an outline shows which ones changed among all its definitions, how big they are, and which changed function calls which. Cards are in reading order: types first, then helpers before the code that calls them, with collapsed changes last.
|
|
22
|
+
- **Change facts.** Each modified function lists what changed without reading it, worked out from the syntax: parameters, return type, calls added or removed, and more or fewer error paths and branches.
|
|
23
|
+
- **Noise collapsed.** Formatting-only and comment-only edits, renames with unchanged bodies, and units moved
|
|
24
|
+
unchanged between files or containers are folded away. Lockfiles, vendored and generated files (by path
|
|
25
|
+
or a `@generated` / `DO NOT EDIT` header) are grouped as skippable.
|
|
26
|
+
- **Blast radius.** For every function, method or type the PR changes, removes or renames, the report
|
|
27
|
+
lists where the rest of the code still uses it, linked to the host at the head commit, and flags the
|
|
28
|
+
callers this PR did not touch. Removed and renamed units show any references left behind.
|
|
29
|
+
- **Risks and security findings.** Built-in rules flag likely secrets (redacted in the report), risky APIs
|
|
30
|
+
such as `eval`, `shell=True`, raw HTML or `unsafe` (only in code, not comments or strings), sensitive
|
|
31
|
+
areas such as auth, payments, migrations and CI, new dependencies, and known vulnerabilities in
|
|
32
|
+
dependency versions new to `package-lock.json`, `Cargo.lock`, `poetry.lock`, `uv.lock` or pinned
|
|
33
|
+
requirements (via [OSV](https://osv.dev); `--offline` skips it). Review signals add large PRs, missing
|
|
34
|
+
test changes and removed or renamed units that untouched code still uses. The report says what was
|
|
35
|
+
found rather than grading the change, and lists the checks that ran and those that did not. These are
|
|
36
|
+
pattern and secret scans of added lines, not a security audit. [Security scanners](#security-scanners) add more when installed.
|
|
37
|
+
- **Breaking changes.** Flags changes that could break other code or a deployment, and puts them on the
|
|
38
|
+
review path saying what could break and who is affected. [More below](#breaking-changes).
|
|
39
|
+
- **AI review (opt-in, `--ai`).** A suggested reading order that groups the changed units into chapters,
|
|
40
|
+
a check of the PR description against the code (matches, contradicts, not in the description, not found),
|
|
41
|
+
and specific questions to answer before approving. Every statement must cite lines of the change; the
|
|
42
|
+
engine checks each citation against what the model was shown and discards the rest. Results are cached
|
|
43
|
+
per prompt, and the report shows tokens used and the estimated cost.
|
|
44
|
+
- **Line diff fallback** for other languages, skipped files, and on demand.
|
|
45
|
+
|
|
46
|
+
References are found by name and syntax, not type resolution: each carries a confidence (exact when
|
|
47
|
+
qualified with the unit's type, likely for a direct use, possible for `x.method()` on an unknown type),
|
|
48
|
+
and parameters or locals that shadow the name are ignored. Names in more than 200 files (`new`, `get`)
|
|
49
|
+
are reported as too common to trace.
|
|
50
|
+
|
|
51
|
+
Known limits: changes inside test callbacks such as `describe(...)`/`it(...)` show under "imports & top
|
|
52
|
+
level"; a unit both moved and edited shows as removed plus added; no syntax highlighting yet.
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
Requires Node.js 22.18 or newer (it runs the TypeScript sources directly), pnpm and git.
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
pnpm install
|
|
60
|
+
pnpm walkdiff review https://github.com/owner/repo/pull/123
|
|
61
|
+
pnpm walkdiff review https://gitlab.com/group/project/-/merge_requests/45 --no-serve --out ./report
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Set `GITHUB_TOKEN` (or `GH_TOKEN`) and `GITLAB_TOKEN` for private repositories and higher API rate limits.
|
|
65
|
+
GitHub Enterprise and self-managed GitLab work by URL; tokens go to them only once they're [trusted](docs/configuration.md#tokens-and-trusted-hosts). Run `pnpm walkdiff --help` for all options.
|
|
66
|
+
|
|
67
|
+
## Keep track of several reviews
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
pnpm walkdiff app
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
This runs a local page at `http://127.0.0.1:4317/`. Paste a pull request or merge request link to add it; analyses run one at a time, and the list shows each review's status and counts, and flags medium or high severity security findings. Refresh re-runs a review after new commits. The list is kept in SQLite under `~/.local/share/walkdiff`, so it survives restarts. If `GITHUB_TOKEN` is not set, the app asks the GitHub CLI for its login on that PR's host.
|
|
74
|
+
|
|
75
|
+
The server listens only on your machine, refuses requests for any other host name, and its API needs a key that is created each run.
|
|
76
|
+
|
|
77
|
+
## Private repositories
|
|
78
|
+
|
|
79
|
+
Private repositories and merge requests work once a token is in the environment. It is used for both the host's API and fetching the code, and it stays out of the command line and the cached repository's config.
|
|
80
|
+
|
|
81
|
+
**GitLab**: create a personal or project access token with the `read_api` and `read_repository` scopes (`api` if you will also post comments with `walkdiff comment`):
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
GITLAB_TOKEN=<token> pnpm walkdiff review https://gitlab.com/group/project/-/merge_requests/123
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**GitHub**: use a token that can read the repository. With the GitHub CLI:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
GH_TOKEN=$(gh auth token) pnpm walkdiff review https://github.com/owner/repo/pull/123
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`GITHUB_TOKEN` works too. Self-managed GitLab and GitHub Enterprise are recognized from the URL and use the same variables, once listed in `WALKDIFF_TRUSTED_GITLAB_HOSTS` or `WALKDIFF_TRUSTED_GITHUB_HOSTS`. Without a token, a private repository usually answers 404, and walkdiff says which variable to set.
|
|
94
|
+
|
|
95
|
+
Tokens and code stay on your machine, apart from the host itself, package names and versions sent to [OSV](https://osv.dev) (`--offline` skips that), and the code sent to the model if you pass `--ai`.
|
|
96
|
+
|
|
97
|
+
## In CI
|
|
98
|
+
|
|
99
|
+
The GitHub Action (`navasvarela/walkdiff@v0.4.0`) and the GitLab template (`ci/gitlab-ci.yml`) generate the report for each PR, keep it as a job artifact, and post one summary comment that is updated on each push. The [pilot guide](docs/pilot.md) has the setup. Locally, `walkdiff review` also works without a URL inside a CI job, and `walkdiff comment --report <dir> --report-url <url>` posts the summary.
|
|
100
|
+
|
|
101
|
+
## AI review
|
|
102
|
+
|
|
103
|
+
`--ai` sends the changed code, the PR title and description to Claude (`claude-opus-5-5` by default;
|
|
104
|
+
`--ai-model` to change it) through the official Anthropic SDK. Credentials come from `ANTHROPIC_API_KEY`
|
|
105
|
+
or an `ant auth login` profile. `--ai-max-input-tokens` (default 40,000, about $0.16 of input) caps the
|
|
106
|
+
prompt; past it, units are sent by name only and the report says how many. Without `--ai`, nothing is
|
|
107
|
+
sent. A repository can forbid AI review entirely with `"ai": { "allowed": false }` in `.walkdiff.json`.
|
|
108
|
+
|
|
109
|
+
## Security scanners
|
|
110
|
+
|
|
111
|
+
Walkdiff installs pinned versions of [Semgrep](https://semgrep.dev),
|
|
112
|
+
[gitleaks](https://github.com/gitleaks/gitleaks), [osv-scanner](https://github.com/google/osv-scanner),
|
|
113
|
+
[Ruff](https://docs.astral.sh/ruff/) and [zizmor](https://docs.zizmor.sh/) on its first run, or when you run
|
|
114
|
+
`walkdiff setup`, checked against hashes in this repository, on macOS and Linux. They live in
|
|
115
|
+
`~/.cache/walkdiff/scanners`, just for Walkdiff. Semgrep needs Python 3.10 or later. If one can't be
|
|
116
|
+
installed, Walkdiff still runs, and the Risks tab lists it under "Not checked". Copies on your `PATH`
|
|
117
|
+
are used only when Walkdiff has none of its own. `--offline` skips installing them.
|
|
118
|
+
|
|
119
|
+
| Scanner | Finds | Network |
|
|
120
|
+
| --- | --- | --- |
|
|
121
|
+
| Semgrep | Risky code patterns, using the `p/default` rules | Downloads rules; your code is not uploaded |
|
|
122
|
+
| gitleaks | Secrets | None |
|
|
123
|
+
| osv-scanner | Known vulnerabilities in `pnpm-lock.yaml`, `yarn.lock` and `bun.lock` | Sends package names and versions to OSV |
|
|
124
|
+
|
|
125
|
+
Only findings on lines the PR added are reported, and `--offline` skips Semgrep and osv-scanner.
|
|
126
|
+
Scanners read a temporary copy of the changed files, without your tokens in their environment. A PR
|
|
127
|
+
cannot silence them: `# nosemgrep` and `gitleaks:allow` comments are ignored, and scanner config files
|
|
128
|
+
in the PR (`.gitleaks.toml`, `.semgrepignore` and others) are not used. Those files are not scanned either.
|
|
129
|
+
|
|
130
|
+
Choose Semgrep's rules in `.walkdiff.json`; an empty list turns Semgrep off:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{ "scanners": { "semgrep": { "rules": ["p/default", "p/owasp-top-ten"] } } }
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
CI runners need the scanners installed in the job before running Walkdiff.
|
|
137
|
+
|
|
138
|
+
## Breaking changes
|
|
139
|
+
|
|
140
|
+
Walkdiff flags changes that could break other code or a deployment, under the "Breaking change" category
|
|
141
|
+
in the Risks tab. Each one is a stop on the review path that says what could break and who is affected,
|
|
142
|
+
ranked above ordinary medium findings and below high ones. These findings never count as security findings,
|
|
143
|
+
because they expose nothing to an attacker.
|
|
144
|
+
|
|
145
|
+
The rules read syntax, not types, so they say "may break" unless a required parameter changed and calls
|
|
146
|
+
to the function are left behind. They would rather stay quiet than raise a false alarm.
|
|
147
|
+
|
|
148
|
+
**Public APIs**, for Rust, TypeScript, JavaScript and Python: a removed or renamed function or type, an
|
|
149
|
+
item that stops being public, removed or newly required parameters, and changed parameter or return types.
|
|
150
|
+
Other changes aren't flagged, such as a renamed parameter in Rust or TypeScript, a new optional parameter,
|
|
151
|
+
or a wider parameter type. Being marked public isn't enough, since apps mark their own modules that way too.
|
|
152
|
+
A change also needs someone it can affect:
|
|
153
|
+
|
|
154
|
+
| Language | Public | Other projects can reach it when |
|
|
155
|
+
| --- | --- | --- |
|
|
156
|
+
| Rust | A bare `pub` (not `pub(crate)`) | The crate has `src/lib.rs`, isn't `publish = false`, and every module up to the root is `pub mod` or re-exports it |
|
|
157
|
+
| TypeScript, JavaScript | `export` | The package isn't `private` and its entry point exports it, directly or through `export ... from` |
|
|
158
|
+
| Python | No leading underscore | The project has a build backend, no part of the module path starts with an underscore, and `__all__`, if any, lists it |
|
|
159
|
+
|
|
160
|
+
Otherwise it's flagged only if calls this PR didn't touch remain in the repository. Python and TypeScript
|
|
161
|
+
functions under a framework's decorator are skipped, as the decorator can change how they're called. So is a
|
|
162
|
+
name that's still available after its definition went, through an alias, a `__getattr__` shim or a move to
|
|
163
|
+
another file. A removal that untouched code still uses shows up as a broken reference instead.
|
|
164
|
+
|
|
165
|
+
**Database migrations:** dropped or renamed tables and columns and changed column types, in raw SQL (including
|
|
166
|
+
Prisma, Goose, dbmate and Flyway files), Alembic, Django, Rails, Knex, Sequelize and TypeORM. Only the added lines
|
|
167
|
+
that run on the way up count, so rollbacks aren't flagged. Neither are temporary tables, or names the
|
|
168
|
+
same PR creates, such as a table rebuilt or a column replaced under its old name. It's high only when code still
|
|
169
|
+
mentions an unusual name. Django's `AlterField` isn't checked, since it mostly changes options.
|
|
170
|
+
|
|
171
|
+
**Config and environment:**
|
|
172
|
+
|
|
173
|
+
- A variable renamed in a `.env.example`-style file, or code that now reads a new variable instead of an old
|
|
174
|
+
one. Deployments set the old name, so these are always flagged.
|
|
175
|
+
- A variable removed from an env file, CI config or Compose file while code still needs it. A read with a fallback
|
|
176
|
+
doesn't count, and in `apps/`, `packages/`, `services/` or `libs/` only the same project counts.
|
|
177
|
+
- A key removed from a config file (`config/*.yml`, `settings.toml`, `appsettings.json`, `*.example.json` and
|
|
178
|
+
similar) while code still reads it. Ordinary words like `name` are left out, as matches on them mean little.
|
|
179
|
+
|
|
180
|
+
Not covered yet: public struct fields and interface members, new required trait methods, re-exports removed from an entry point
|
|
181
|
+
without the definition changing, and inputs of a GitHub Action's `action.yml`.
|
|
182
|
+
|
|
183
|
+
## Code quality
|
|
184
|
+
|
|
185
|
+
Walkdiff flags poor implementations and bad practice in the code a PR adds, under the "Code quality"
|
|
186
|
+
category in the Risks tab. These findings never count as security findings.
|
|
187
|
+
|
|
188
|
+
**Function metrics** are built in and cover Rust, TypeScript and Python. A function is flagged when
|
|
189
|
+
the PR adds it over a limit, pushes it over one, or makes one already over the limit at least 20%
|
|
190
|
+
worse. The Changes tab also shows each modified function's complexity change. Test code is left out.
|
|
191
|
+
|
|
192
|
+
| Metric | Limit |
|
|
193
|
+
| --- | --- |
|
|
194
|
+
| Complexity (decision points) | 15 |
|
|
195
|
+
| Nesting depth | 4 |
|
|
196
|
+
| Lines | 80 |
|
|
197
|
+
| Parameters | 6 |
|
|
198
|
+
|
|
199
|
+
**Three scanners** add to this. None of them use the network. oxlint and jscpd install with Walkdiff, at versions pinned in its lockfile, and Ruff is optional:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
brew install ruff
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
| Scanner | Finds | Reads |
|
|
206
|
+
| --- | --- | --- |
|
|
207
|
+
| Ruff | Likely bugs and bad practice in Python (rules `F`, `B`, `E7`, `E9`) | Changed files |
|
|
208
|
+
| oxlint | Likely bugs in TypeScript and JavaScript | Changed files |
|
|
209
|
+
| jscpd | New code of 10 lines or more copied from elsewhere | All source at the PR's head, except tests |
|
|
210
|
+
|
|
211
|
+
Walkdiff uses its own rules for these scanners and does not read your `ruff.toml`, `.oxlintrc.json` or
|
|
212
|
+
`.jscpd.json`, whether they are in the PR or on the default branch. Comments such as `# noqa` and
|
|
213
|
+
`eslint-disable` are still honoured, because each one is visible in the diff.
|
|
214
|
+
|
|
215
|
+
Rust has no linter here: Clippy can run a PR's build scripts and macros, so Walkdiff does not run it on
|
|
216
|
+
untrusted code. Design problems, such as a wrong abstraction, are for human or AI review.
|
|
217
|
+
|
|
218
|
+
To turn all of this off for a repository, add this to `.walkdiff.json` on the default branch:
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{ "quality": { "enabled": false } }
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## Team rules
|
|
225
|
+
|
|
226
|
+
A `.walkdiff.json` at the repository root adds sensitive areas, excludes paths from risk rules, and can
|
|
227
|
+
forbid AI review. A PR is always judged by the version on its merge base, so its own edits to the file
|
|
228
|
+
take effect only after merge, and are reported as a finding:
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"riskPaths": [{ "pattern": "src/ledger/**", "severity": "high", "reason": "Moves customer funds" }],
|
|
233
|
+
"ignore": ["tests/fixtures/**"],
|
|
234
|
+
"ai": { "allowed": true },
|
|
235
|
+
"feedback": { "url": "https://forms.example.com/walkdiff" }
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## How it works
|
|
240
|
+
|
|
241
|
+
1. **Providers** (`packages/providers`) parse the URL and read the PR from the host's API, including its merge base.
|
|
242
|
+
2. **Engine** (`packages/engine`) fetches only the merge-base and head commits (depth 1) into a cached bare
|
|
243
|
+
repository under `~/.cache/walkdiff/repos`, builds the file list and hunks from `git diff`, classifies noise,
|
|
244
|
+
and parses both versions of each file with tree-sitter (WASM) to extract and compare units
|
|
245
|
+
(`src/syntax`: one small spec per language, a shared walker, token fingerprints for comparison).
|
|
246
|
+
`src/impact` then scans the head commit's source for the changed names and parses the matching files
|
|
247
|
+
to resolve references, `src/risk` runs the risk rules and dependency checks, and `src/ai` builds the
|
|
248
|
+
prompt, calls the model and validates its citations. Git commands whose
|
|
249
|
+
output is parsed run without user and system git config, which can otherwise change the output format.
|
|
250
|
+
3. The **review model** (`packages/review-model`) is the JSON contract between the engine and every
|
|
251
|
+
consumer, validated with Zod on both sides.
|
|
252
|
+
4. The **CLI** (`packages/cli`) writes the report as one self-contained HTML file, plus `review.json` as
|
|
253
|
+
data, and serves it on `127.0.0.1`. The page also opens directly from disk, which is how CI artifacts
|
|
254
|
+
are used.
|
|
255
|
+
5. The **report UI** (`packages/report-ui`) is a React app built with Vite.
|
|
256
|
+
|
|
257
|
+
## Development
|
|
258
|
+
|
|
259
|
+
```sh
|
|
260
|
+
pnpm lint
|
|
261
|
+
pnpm typecheck
|
|
262
|
+
pnpm test
|
|
263
|
+
pnpm build:ui
|
|
264
|
+
pnpm --filter @walkdiff/report-ui dev # needs a review.json in packages/report-ui/public
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## License
|
|
268
|
+
|
|
269
|
+
[FSL-1.1-ALv2](LICENSE.md), the Functional Source License. You can use, modify and redistribute this software for any purpose except offering it as a competing commercial product or service, and internal use is explicitly allowed. Each version becomes available under the Apache License 2.0 two years after its release. This is source-available, not an OSI-approved open source license.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
Walkdiff reads private code and uses tokens that can reach it, so you should be able to check what it does with both. This page says what Walkdiff guarantees, what it doesn't, and how to verify it.
|
|
4
|
+
|
|
5
|
+
> **Status: draft.** Walkdiff is pre-release software and hasn't had an independent security audit.
|
|
6
|
+
|
|
7
|
+
## Reporting a vulnerability
|
|
8
|
+
|
|
9
|
+
[Report it privately through GitHub](https://github.com/navasvarela/walkdiff/security/advisories/new). Please don't open a public issue, and leave real secrets and private code out of your report.
|
|
10
|
+
|
|
11
|
+
Walkdiff is maintained by one person, so these are goals, not contractual promises:
|
|
12
|
+
|
|
13
|
+
| Step | Goal |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| First reply | 3 working days |
|
|
16
|
+
| Assessment | 10 working days |
|
|
17
|
+
| Fix for a confirmed high or critical issue | 30 days |
|
|
18
|
+
|
|
19
|
+
Only the latest release is supported. Testing against your own installation is welcome. Please don't test against other people's repositories, accounts or reports.
|
|
20
|
+
|
|
21
|
+
## What Walkdiff guarantees
|
|
22
|
+
|
|
23
|
+
Each guarantee describes the latest release and has an automated test or setting behind it.
|
|
24
|
+
|
|
25
|
+
### Your code
|
|
26
|
+
|
|
27
|
+
| Guarantee | How it's enforced |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Walkdiff never builds, installs or runs code from a PR | It only reads commits from a bare repository and parses them. The GitHub Action doesn't check out the PR |
|
|
30
|
+
| Code isn't sent to any AI service unless you ask | AI review needs `--ai`, or the checkbox in the app |
|
|
31
|
+
| A team can limit where code goes | `"ai": { "providers": ["local"] }` in `.walkdiff.json`. Both the merge base and the PR have to allow the provider |
|
|
32
|
+
| A repository can forbid AI review | `"ai": { "allowed": false }` in `.walkdiff.json`. A PR can't remove this, because if either version forbids it, it's blocked |
|
|
33
|
+
| Walkdiff has no telemetry and no server of its own | It collects no usage data, and the only network destinations are listed below |
|
|
34
|
+
| A report can't contact anything outside the app | Every report carries a Content Security Policy that blocks network requests, so script injected through a PR has nowhere to send data. In the app, a report can call the app itself, and nothing else |
|
|
35
|
+
| Walkdiff only changes something on the host when you press a button | Posting a review, replying and resolving each need a click, and only happen in the local app. The command line and reports opened from a file can't do them, and CI only posts its summary comment |
|
|
36
|
+
| A review only speaks for the code you read | Walkdiff refuses to post if the PR has new commits since the report was made, and the review is tied to that commit |
|
|
37
|
+
| A page can't aim your token at another host | The host comes from the saved review, never from the request, and these actions need the key created each time the app starts |
|
|
38
|
+
| Local servers aren't reachable from your network | They listen only on `127.0.0.1` and refuse other host names, which blocks DNS rebinding |
|
|
39
|
+
| Local files are private to your user account | Reports, cached repositories and the review list are created for your user only, and the default folders are closed to other users |
|
|
40
|
+
|
|
41
|
+
### Your credentials
|
|
42
|
+
|
|
43
|
+
| Guarantee | How it's enforced |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| A token only goes to hosts you trust | `github.com`, `gitlab.com` and hosts you list. See [trusted hosts](docs/configuration.md#tokens-and-trusted-hosts) |
|
|
46
|
+
| A token doesn't go to the wrong kind of host, or over plain http | Whole origins are compared, for each kind of token |
|
|
47
|
+
| A redirect can't carry a token to another host | Walkdiff refuses cross-host API redirects, and git doesn't follow redirects while it holds a token |
|
|
48
|
+
| AI keys aren't stored | They come from the environment, and the settings have no field for them |
|
|
49
|
+
| An AI key and your code only go over https, or to this machine | Other addresses are refused, and redirects aren't followed |
|
|
50
|
+
| Tokens stay out of command lines and repository config | They reach git through its environment |
|
|
51
|
+
| Third-party scanners don't get your tokens | They run with a minimal environment, on a temporary copy of the changed files |
|
|
52
|
+
| Bundled scanners are pinned | oxlint and jscpd install at exact versions from the lockfile, which CI enforces, so an update reaches you only through a Walkdiff change |
|
|
53
|
+
| Walkdiff doesn't store your tokens | It reads them from the environment or the GitHub CLI each time |
|
|
54
|
+
|
|
55
|
+
### Secrets in pull requests
|
|
56
|
+
|
|
57
|
+
| Guarantee | How it's enforced |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| Findings don't show a detected secret | Evidence is redacted in the report and left out of the PR comment |
|
|
60
|
+
| Known credential formats are redacted from AI prompts | Prompts pass through redaction just before sending, including private key bodies |
|
|
61
|
+
| Credential files aren't sent to AI at all | `.env`, `*.pem`, `*.key`, `.npmrc` and similar are left out by name |
|
|
62
|
+
|
|
63
|
+
### Tampering with results
|
|
64
|
+
|
|
65
|
+
| Guarantee | How it's enforced |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| A PR can't relax its own rules | `.walkdiff.json` is read from the merge base, and editing it is itself a finding |
|
|
68
|
+
| A PR can't silence scanners | Suppression comments are ignored, and scanner config files in the PR aren't used |
|
|
69
|
+
| A PR can't instruct the AI to act | The AI has no tools and can only return a structured review. Every statement must cite lines it was shown, and the rest is discarded |
|
|
70
|
+
|
|
71
|
+
## What Walkdiff doesn't guarantee
|
|
72
|
+
|
|
73
|
+
- **"No security findings" doesn't mean a change is safe.** Walkdiff runs pattern and secret scans on the lines a PR adds. It doesn't trace data through the code, reason about permissions or run anything, so it isn't a security audit. The report lists the checks that didn't run.
|
|
74
|
+
- **Secret detection isn't complete.** Redaction recognises known formats and common assignments. A secret in an unusual format can still reach an AI prompt, so don't use `--ai` on a PR you know contains secrets.
|
|
75
|
+
- **The Changes tab shows the code as it is.** A secret in a PR is redacted from findings, but still appears in the diff, in the report and in `review.json`.
|
|
76
|
+
- **Prompt injection can mislead the AI review.** Someone writing a PR can try to influence what it says, so treat its output as a hint and not as a verdict.
|
|
77
|
+
- **Coverage can be faked.** In CI, a PR's own code produces the coverage report, so someone trying to deceive could fake it. It helps honest reviewers, and isn't a security control.
|
|
78
|
+
- **Reference finding is by name and syntax,** so the Impact tab can miss callers or match the wrong ones.
|
|
79
|
+
- **A flaw in the report page could post as you.** In the app, a report can call the API that posts reviews, using your token. PR text is always shown as text, never as HTML, but if script ever got onto that page, it could post comments or approve in your name, on that review's host only.
|
|
80
|
+
- **Walkdiff doesn't protect you from your own machine.** Files are stored unencrypted, and anything running as your user can read them.
|
|
81
|
+
|
|
82
|
+
## What leaves your machine
|
|
83
|
+
|
|
84
|
+
| Destination | What is sent | When | How to stop it |
|
|
85
|
+
| --- | --- | --- | --- |
|
|
86
|
+
| The PR's host | Your token if the host is trusted, and requests for the PR and its code. Your comments and decisions when you post a review | Always; posting only when you press the button | - |
|
|
87
|
+
| [OSV](https://osv.dev) | Names and versions of dependencies changed in the PR, **including private package names** | By default | `--offline` |
|
|
88
|
+
| npm, PyPI and crates.io | Names of new direct dependencies, **including private package names** unless listed in `dependencies.private` | When a PR adds a dependency | `--offline`, Settings, or `dependencies.private` |
|
|
89
|
+
| Semgrep registry | A rule download; code isn't uploaded | During a review, unless turned off | `--offline`, or an empty rule list |
|
|
90
|
+
| Your AI provider (Anthropic by default, or the address in `ANTHROPIC_BASE_URL` if that's set) | Changed code, and the PR's title and description | Only with `--ai` or the app's AI option | Leave it off, forbid it in `.walkdiff.json`, or use a local model |
|
|
91
|
+
|
|
92
|
+
You choose the AI provider, so check how it handles your data. For Anthropic, see [its privacy documentation](https://privacy.anthropic.com).
|
|
93
|
+
|
|
94
|
+
## The report in CI
|
|
95
|
+
|
|
96
|
+
The report isn't hosted by Walkdiff. It's a single HTML file stored by your own CI system.
|
|
97
|
+
|
|
98
|
+
| | GitHub Actions | GitLab CI |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| **Stored as** | A workflow artifact, in GitHub's storage | A job artifact, on your GitLab instance |
|
|
101
|
+
| **Private repository** | People with read access to the repository | Depends on the project's job artifact access |
|
|
102
|
+
| **Public repository** | **Any signed-in GitHub user** | **Public, unless you restrict it** |
|
|
103
|
+
| **Kept for** | 14 days, set with `retention-days` | 14 days, set with `expire_in` |
|
|
104
|
+
|
|
105
|
+
For the people who can already read the repository, the report adds little exposure, but keep these in mind:
|
|
106
|
+
|
|
107
|
+
- **Public repositories:** reports are effectively public. That includes any AI review output, so assume anything in the PR is public too.
|
|
108
|
+
- **Secrets stay until the artifact expires:** removing a secret from a PR doesn't remove it from reports already generated. If a secret was committed, revoke it, then delete the workflow run's artifact.
|
|
109
|
+
- **The download address:** when someone signed in opens the link, GitHub redirects to a temporary storage address. Anyone who has that address can use it until it expires, so don't paste it anywhere.
|
|
110
|
+
- **Downloaded copies:** a report someone saved stays on their machine, with no expiry and no access control.
|
|
111
|
+
- **The PR comment:** it shows finding titles and file paths, never code or evidence. Everyone who can see the PR sees it, and it may reach them by email.
|
|
112
|
+
- **GitLab:** check the project's visibility and its [job artifact settings](https://docs.gitlab.com/ci/jobs/job_artifacts/), especially "Public pipelines".
|
|
113
|
+
|
|
114
|
+
## Using Walkdiff safely in CI
|
|
115
|
+
|
|
116
|
+
- **Pin the action to a release tag or, better, a full commit SHA**, not `@main`, so a later change can't reach your CI without your review. Release tags are signed.
|
|
117
|
+
- **Use the narrowest token.** The default `github.token` with `contents: read` and `pull-requests: write` is enough.
|
|
118
|
+
- **Don't use `pull_request_target`.** Use `on: pull_request`, as in the [pilot guide](docs/pilot.md).
|
|
119
|
+
- **Keep the Anthropic key out of fork PRs.** GitHub doesn't give secrets to `pull_request` runs from forks by default, so keep it that way.
|
|
120
|
+
|
|
121
|
+
## How the project is built
|
|
122
|
+
|
|
123
|
+
| Measure | Status |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| Signed commits required on `main` | On, enforced by a repository ruleset |
|
|
126
|
+
| Changes to `main` go through a pull request; no force-push or deletion | On |
|
|
127
|
+
| CodeQL code scanning | On |
|
|
128
|
+
| GitHub secret scanning and push protection | On |
|
|
129
|
+
| Dependabot alerts | On |
|
|
130
|
+
| Lockfile enforced in CI (`--frozen-lockfile`) | On |
|
|
131
|
+
| Dependency install scripts blocked | On, pnpm's default |
|
|
132
|
+
| Scanners downloaded by `pnpm install` must match pinned hashes, with no package setup code run | On |
|
|
133
|
+
| GitHub Actions pinned to commit SHAs | On |
|
|
134
|
+
| Default workflow token is read-only | On |
|
|
135
|
+
|
|
136
|
+
**Commit history:** `main` includes early commits that are unsigned, or signed with a key GitHub doesn't recognise. The signing requirement applies to new commits, because rewriting published history would break existing links.
|