judgelint 0.2.0-x86_64-linux → 0.2.2-x86_64-linux
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +74 -0
- data/README.md +66 -7
- data/libexec/judgelint +0 -0
- metadata +1 -2
- data/lib/rubygems_plugin.rb +0 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4dae6f5f5e9fd33ae7c3a831d1f097db46f329845ea6c5d90a979cd6eb309706
|
|
4
|
+
data.tar.gz: dbfad61daa8ffc5ac52ac97bc6b9b455f081224b0eaecf36a3ce73bd7cf1f524
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 719691e6c0e7117a198c8bfb6962bba4e32a7e6aea820d079b8755ab37db9c62e2d1bd817fb517a7745dbc490345d37956cee0bcf8eb933ee9f08508bc13e0c6
|
|
7
|
+
data.tar.gz: 7ddede0ac667d6af31ce4985545ed673877f426c46597b6459d28c3492c73db1111cdaf67dd093659cabc13a7e9fd0179747b0e9005e84fed0a5f966440dfe1b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.2 (2026-10-30)
|
|
4
|
+
|
|
5
|
+
Fixes from a third review of 0.2.1, which found ways around its fixes.
|
|
6
|
+
|
|
7
|
+
- `--pr` judges what the pull request committed. Untracked files, like ones
|
|
8
|
+
an earlier CI step wrote, aren't part of it and are never sent, whatever
|
|
9
|
+
the pull request's `.gitignore` says, and a tracked file a step changed is
|
|
10
|
+
read as committed.
|
|
11
|
+
- `--pr` reads the base branch's cache into memory and leaves the
|
|
12
|
+
checkout's `.judgelint/cache.bin` alone.
|
|
13
|
+
- `--base` and `--pr` work with `check` only. `judgelint test --pr` used to
|
|
14
|
+
run, ignore `--pr`, and use the pull request's config.
|
|
15
|
+
- Under `--base` or `--pr`, these now fail the run instead of passing:
|
|
16
|
+
- a changed file with a NUL byte near its start, which counted as binary
|
|
17
|
+
and was left out (images, fonts, archives and other formats that are
|
|
18
|
+
never code are still left out);
|
|
19
|
+
- a rule the model refused to answer for one window when another passed;
|
|
20
|
+
- a changed file that leads outside the project, or to nothing.
|
|
21
|
+
- Deleting or moving a file asks about its directory's directory rules.
|
|
22
|
+
- An empty file is asked about by rules about whole files and directories.
|
|
23
|
+
- If git fails to list the project's files, that's an error. Before, the
|
|
24
|
+
gitignore check was skipped and ignored files could be sent.
|
|
25
|
+
- The project's `.judgelint.yml` must be a regular file inside the project,
|
|
26
|
+
1 MB at most. A config named with `--config` can be anywhere.
|
|
27
|
+
- Files are opened with no links allowed in the path, so a directory
|
|
28
|
+
swapped for a link while judgelint runs can't lead it outside.
|
|
29
|
+
- Runs that share a cache no longer drop each other's answers.
|
|
30
|
+
- A custom endpoint's answers are cached under the address and headers its
|
|
31
|
+
`${VAR}`s resolve to. Custom endpoints, and presets with headers,
|
|
32
|
+
ask again once.
|
|
33
|
+
- A failed request stops the run: no more requests go out, from that file
|
|
34
|
+
or any other.
|
|
35
|
+
Requests go out 32 at a time across files. Responses are capped at 4 MB.
|
|
36
|
+
- A file too large for every model is skipped before its questions are
|
|
37
|
+
made, and a directory's files are capped at 4 MB together.
|
|
38
|
+
- Control characters in file names and endpoint errors are escaped in
|
|
39
|
+
output, and so are GitHub workflow commands (a leading `::`, or `##[`), so
|
|
40
|
+
they can't forge a CI annotation.
|
|
41
|
+
- A header whose `${VAR}` isn't set is an error; it was sent as written.
|
|
42
|
+
The key's header is marked sensitive. `price_per_million` can't be
|
|
43
|
+
negative. Cached choices must add up to one. YAML is parsed with
|
|
44
|
+
explicit limits.
|
|
45
|
+
- CI runs cargo-deny and zizmor, builds with the oldest supported Rust,
|
|
46
|
+
and builds the binaries with cargo-auditable. Dependabot updates the
|
|
47
|
+
actions and crates. install.sh checks the build attestation, for the
|
|
48
|
+
release's tag and workflow, when the GitHub CLI is signed in.
|
|
49
|
+
|
|
50
|
+
## 0.2.1 (2026-10-29)
|
|
51
|
+
|
|
52
|
+
Security fixes, after two reviews of 0.2.0. A pull request could change the
|
|
53
|
+
config or specs to send code and environment variables to its own server,
|
|
54
|
+
read files outside the project, or pass with answers it made up.
|
|
55
|
+
|
|
56
|
+
- `--pr` reads `.judgelint.yml`, the specs and the cache from the base
|
|
57
|
+
branch, not the pull request.
|
|
58
|
+
- Every file sent to a model, including `context:` files and a directory
|
|
59
|
+
rule's files, must be inside the project, not reached through a link that
|
|
60
|
+
leaves it, not ignored by git, not binary, and at most 4 MB.
|
|
61
|
+
- A provider pointed at another `api_base` doesn't get the provider's key;
|
|
62
|
+
set `api_key_env` for it. Its answers are cached apart.
|
|
63
|
+
- Plain http goes only to localhost. Redirects aren't followed. Responses
|
|
64
|
+
are capped at 16 MB, and a request at 60 seconds.
|
|
65
|
+
- Under `--base` or `--pr`, a changed file that's skipped or refused fails
|
|
66
|
+
the run.
|
|
67
|
+
- An added line that looks like a diff header no longer hides changed lines.
|
|
68
|
+
- Malformed answers and cached values that aren't probabilities are errors
|
|
69
|
+
or misses, not passes.
|
|
70
|
+
- A model with no price fails the cost check unless you pass `--yes` or set
|
|
71
|
+
`price_per_million`. Servers on localhost cost nothing.
|
|
72
|
+
- Errors show the URL as configured, before `${VAR}` is filled in.
|
|
73
|
+
- Releases carry build attestations, are built with a pinned Rust, and push
|
|
74
|
+
the gems from CI. The gem no longer replaces its command with a link to the
|
|
75
|
+
binary, which could break after an uninstall.
|
|
76
|
+
|
|
3
77
|
## 0.2.0 (2026-10-28)
|
|
4
78
|
|
|
5
79
|
- judgelint is written in Rust now. The gem carries the binary for macOS and
|
data/README.md
CHANGED
|
@@ -18,8 +18,13 @@ The script installs to `~/.local/bin`, or to `$JUDGELINT_INSTALL_DIR`. The
|
|
|
18
18
|
binaries are on the [releases page](https://github.com/jpcamara/judgelint/releases)
|
|
19
19
|
for macOS and Linux, on arm64 and x86_64. Linux needs glibc 2.34 or newer
|
|
20
20
|
(Ubuntu 22.04, Debian 12, RHEL 9). `gem install judgelint` installs the same
|
|
21
|
-
binary.
|
|
22
|
-
`cargo install --git https://github.com/jpcamara/judgelint`.
|
|
21
|
+
binary. On another Unix, or an older glibc, build it with Rust:
|
|
22
|
+
`cargo install --git https://github.com/jpcamara/judgelint`. It doesn't build
|
|
23
|
+
on Windows.
|
|
24
|
+
|
|
25
|
+
Each release's archives and gems carry a build attestation from the GitHub
|
|
26
|
+
Actions run that built them, from the tagged source. To check one:
|
|
27
|
+
`gh attestation verify judgelint-aarch64-apple-darwin.tar.gz --repo jpcamara/judgelint`.
|
|
23
28
|
|
|
24
29
|
## Getting started
|
|
25
30
|
|
|
@@ -228,15 +233,64 @@ judgelint --pr # changes in the current pull request
|
|
|
228
233
|
judgelint --pr --format github # GitHub annotations on the changed lines (json and sarif work too)
|
|
229
234
|
```
|
|
230
235
|
|
|
231
|
-
These only
|
|
232
|
-
context, so existing code doesn't block a new pull request
|
|
233
|
-
|
|
236
|
+
These ask only about the lines that changed, with the rest of the file as
|
|
237
|
+
context, so existing code doesn't block a new pull request. When the model
|
|
238
|
+
says the clearest violation is on a line the change didn't touch, it
|
|
239
|
+
doesn't count, even if a changed line breaks the same rule less clearly.
|
|
240
|
+
A new file is
|
|
234
241
|
all changed lines. Rules about a whole file (`scope: file`) still read the
|
|
235
|
-
whole file when any of it changed
|
|
242
|
+
whole file when any of it changed, and a directory rule asks about a
|
|
243
|
+
directory when a file in it was changed, added or deleted. Only `check`
|
|
244
|
+
takes `--base` and `--pr`. `--pr` gets the base branch from GitHub
|
|
236
245
|
Actions, GitLab, Buildkite, Bitbucket, Azure Pipelines,
|
|
237
246
|
`JUDGELINT_BASE_BRANCH`, or `gh`. Fetch enough history for git to find the
|
|
238
247
|
merge base.
|
|
239
248
|
|
|
249
|
+
Under `--base` or `--pr`, a changed file judgelint can't judge fails the
|
|
250
|
+
run: one too large for the model, one the model refused to answer about,
|
|
251
|
+
even in part, one that leads outside the project, or a binary one. Images,
|
|
252
|
+
fonts, archives and other formats that are never code are left out instead.
|
|
253
|
+
|
|
254
|
+
### Pull requests from people you don't trust
|
|
255
|
+
|
|
256
|
+
`--pr` reads `.judgelint.yml`, the specs, and `.judgelint/cache.bin` from the
|
|
257
|
+
base branch, not from the pull request, so a pull request can't change the
|
|
258
|
+
rules it's checked against, where its code is sent, or the answers it's
|
|
259
|
+
judged by. New or changed conventions apply once they're merged. The base
|
|
260
|
+
branch's cache is read into memory, and the checkout's own is left alone.
|
|
261
|
+
|
|
262
|
+
`--pr` judges what the pull request committed. Anything else in the
|
|
263
|
+
checkout, like a file an earlier CI step wrote, is never sent, whatever the
|
|
264
|
+
pull request's `.gitignore` says.
|
|
265
|
+
|
|
266
|
+
Run judgelint with `--pr` on pull requests; a plain `judgelint` or `--base`
|
|
267
|
+
run uses the checked-out files as they are.
|
|
268
|
+
|
|
269
|
+
`--pr` trusts the branch a pull request targets, so only check pull requests
|
|
270
|
+
against branches that only trusted people push to.
|
|
271
|
+
|
|
272
|
+
Even so, give the job only the model's API key. The pull request's code is
|
|
273
|
+
still what's being read, and the model can be argued with: a comment in the
|
|
274
|
+
code can sway its answer. judgelint is a reviewer, not a security gate.
|
|
275
|
+
|
|
276
|
+
## What gets sent
|
|
277
|
+
|
|
278
|
+
For each file a rule checks, the model gets the file's path and its whole
|
|
279
|
+
contents, numbered, with the spec's text and any `context:` files the rule
|
|
280
|
+
names. A directory rule sends every file in the directory. Nothing else on
|
|
281
|
+
your machine is read or sent:
|
|
282
|
+
|
|
283
|
+
- Only files inside the directory judgelint runs in, and none reached
|
|
284
|
+
through a link that leads out of it.
|
|
285
|
+
- In a git repository, only files git tracks or would add, never ignored
|
|
286
|
+
ones. Under `--pr`, only files git tracks.
|
|
287
|
+
- No binary files, and nothing over 4 MB, or 4 MB for a directory's files
|
|
288
|
+
together.
|
|
289
|
+
|
|
290
|
+
Requests go to the model's API over https, or plain http to a server on
|
|
291
|
+
your own machine. The API key goes only to its own provider's address: a
|
|
292
|
+
provider pointed somewhere else with `api_base` needs its own `api_key_env`.
|
|
293
|
+
|
|
240
294
|
## Configuration
|
|
241
295
|
|
|
242
296
|
judgelint runs without a config file. `.judgelint.yml` has four settings:
|
|
@@ -248,8 +302,13 @@ ignore: ["vendor/**"] # files no rule checks, and READMEs that aren't specs
|
|
|
248
302
|
max_cost_usd: 1.00 # refuse a run estimated to cost more, unless --yes
|
|
249
303
|
```
|
|
250
304
|
|
|
305
|
+
A model judgelint has no price for, like any model on OpenRouter, needs a
|
|
306
|
+
`price_per_million` (see below) before a run will spend money on it, or
|
|
307
|
+
`--yes`. A server on your own machine costs nothing.
|
|
308
|
+
|
|
251
309
|
Every run prints what it cost. Answers are cached in `.judgelint/cache.bin`,
|
|
252
310
|
so a file that hasn't changed costs nothing. Commit the cache to share it.
|
|
311
|
+
Runs at the same time can share it too.
|
|
253
312
|
`judgelint --help` lists the flags.
|
|
254
313
|
|
|
255
314
|
List two models to average their answers, like `models: [typesafe,
|
|
@@ -270,7 +329,7 @@ For any other System One or Decisions endpoint, add a mapping to `models`:
|
|
|
270
329
|
models:
|
|
271
330
|
- api_base: https://gateway.example.com/${TEAM} # ${VAR} reads the environment
|
|
272
331
|
model: some-decider
|
|
273
|
-
api_key_env: GATEWAY_KEY
|
|
332
|
+
api_key_env: GATEWAY_KEY # sent only to this api_base
|
|
274
333
|
# path: /v1/systemone protocol: system_one|decisions auth: bearer|basic|none|header:<name>
|
|
275
334
|
# headers: {} provider_options: {} price_per_million: 0.04 batch_size: 32
|
|
276
335
|
```
|
data/libexec/judgelint
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: judgelint
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: x86_64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- JP Camara
|
|
@@ -25,7 +25,6 @@ files:
|
|
|
25
25
|
- LICENSE
|
|
26
26
|
- README.md
|
|
27
27
|
- exe/judgelint
|
|
28
|
-
- lib/rubygems_plugin.rb
|
|
29
28
|
- libexec/judgelint
|
|
30
29
|
homepage: https://github.com/jpcamara/judgelint
|
|
31
30
|
licenses:
|
data/lib/rubygems_plugin.rb
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Ships only in judgelint's platform gems, which carry the native binary in
|
|
4
|
-
# libexec/. After installing one, point the judgelint command straight at the
|
|
5
|
-
# binary instead of at RubyGems' Ruby wrapper, which spends about 40 ms
|
|
6
|
-
# loading Ruby and RubyGems before it gets there.
|
|
7
|
-
Gem.post_install do |installer|
|
|
8
|
-
next unless installer.spec.name == "judgelint"
|
|
9
|
-
|
|
10
|
-
native = File.join(installer.spec.full_gem_path, "libexec", "judgelint")
|
|
11
|
-
command = File.join(installer.bin_dir, "judgelint")
|
|
12
|
-
next unless File.executable?(native) && File.file?(command)
|
|
13
|
-
|
|
14
|
-
File.delete(command)
|
|
15
|
-
File.symlink(native, command)
|
|
16
|
-
end
|