@brokkai/slopcop 0.0.11 → 0.0.12
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/README.md +93 -53
- package/native/darwin_amd64/slopcop +0 -0
- package/native/darwin_arm64/slopcop +0 -0
- package/native/linux_amd64/slopcop +0 -0
- package/native/linux_arm64/slopcop +0 -0
- package/native/windows_amd64/slopcop.exe +0 -0
- package/native/windows_arm64/slopcop.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,10 +18,14 @@ and the certainty behind it. The analysis is
|
|
|
18
18
|
engine rather than a language model, so a finding traces back to a rule instead
|
|
19
19
|
of to a guess.
|
|
20
20
|
|
|
21
|
+
The full documentation is at <https://docs.slopcop.com>.
|
|
22
|
+
|
|
21
23
|
There is no local analyzer and nothing to install per language: the CLI ships
|
|
22
|
-
the change and prints what comes back, and it never
|
|
23
|
-
|
|
24
|
-
prompts, one request, and the analyzer's exit contract.
|
|
24
|
+
the change and prints what comes back, and it never reports a check as passed
|
|
25
|
+
without the service. The command is built for agents and one-shot CI: no
|
|
26
|
+
prompts, one request, and the analyzer's exit contract. A check never adds a
|
|
27
|
+
repository; `--if-enabled` skips one the workspace has not enabled, and says it
|
|
28
|
+
was skipped.
|
|
25
29
|
|
|
26
30
|
## Install
|
|
27
31
|
|
|
@@ -129,7 +133,7 @@ go install github.com/BrokkAi/slopcop/cmd/slopcop@latest
|
|
|
129
133
|
Go 1.25 or newer is required to build. A plain `go install` reports `dev` as
|
|
130
134
|
its version; in a clone, `make install` stamps the version from `git describe`.
|
|
131
135
|
|
|
132
|
-
##
|
|
136
|
+
## Set it up in an agent
|
|
133
137
|
|
|
134
138
|
The binary carries the agent skill that teaches a coding agent how to run
|
|
135
139
|
slopcop, plus an automatic check hook for Claude Code and Codex. `slopcop init`
|
|
@@ -138,10 +142,15 @@ present, and names what it did:
|
|
|
138
142
|
|
|
139
143
|
| Location | Harness |
|
|
140
144
|
| --- | --- |
|
|
141
|
-
| `~/.agents/skills/slopcop/` | Codex, opencode |
|
|
145
|
+
| `~/.agents/skills/slopcop/` | Codex, opencode, Cursor, and other agents |
|
|
142
146
|
| `~/.claude/skills/slopcop/` | Claude Code, opencode |
|
|
143
147
|
| `$CODEX_HOME/skills/slopcop/`, or `~/.codex/skills/slopcop/` | Codex home |
|
|
144
148
|
|
|
149
|
+
When none of those harness directories is present, init writes the
|
|
150
|
+
vendor-neutral `~/.agents/skills/slopcop/` instead, which Codex, opencode,
|
|
151
|
+
Cursor and other agents read. A fresh machine therefore has the skill before
|
|
152
|
+
any harness has created its configuration directory.
|
|
153
|
+
|
|
145
154
|
A skill that is already there is left alone by init, so running it again is
|
|
146
155
|
safe. `slopcop login` and every check also install the skill in those
|
|
147
156
|
directories, rewriting one that differs from the skill bundled into the binary,
|
|
@@ -218,6 +227,11 @@ Use `slopcop init --no-hooks` to install only the skill, or
|
|
|
218
227
|
Ordinary checks do not reinstall a removed hook. The skill remains the way to
|
|
219
228
|
check from other harnesses.
|
|
220
229
|
|
|
230
|
+
The hook is dormant in a repository until it is enabled in the workspace. Run
|
|
231
|
+
`slopcop enable` in the checkout, at a terminal, to add it and run its first
|
|
232
|
+
check. The hook then checks what an agent writes and hands findings back; it
|
|
233
|
+
never adds a repository and sends nothing for one that is not active.
|
|
234
|
+
|
|
221
235
|
## Sign in
|
|
222
236
|
|
|
223
237
|
```console
|
|
@@ -240,7 +254,7 @@ Precedence:
|
|
|
240
254
|
| --- | --- |
|
|
241
255
|
| Service URL | `--service`, `$SLOPCOP_SERVICE`, stored by `slopcop login`, `https://slopcop.com` |
|
|
242
256
|
| Token | `$SLOPCOP_TOKEN`, stored value |
|
|
243
|
-
| Workspace (`check`, `ignore`, `repo`) | `-w`/`--workspace`, `$SLOPCOP_WORKSPACE`, the one the login is bound to |
|
|
257
|
+
| Workspace (`check`, `enable`, `status`, `ignore`, `unignore`, `ignored`, `repo`) | `-w`/`--workspace`, `$SLOPCOP_WORKSPACE`, the one the login is bound to |
|
|
244
258
|
|
|
245
259
|
## Workspace and repositories
|
|
246
260
|
|
|
@@ -249,6 +263,8 @@ active in the browser when the login was approved.
|
|
|
249
263
|
|
|
250
264
|
```console
|
|
251
265
|
slopcop whoami # account, this login's workspace, its plan, the service URL
|
|
266
|
+
slopcop status # this checkout's repository, and whether the workspace checks it
|
|
267
|
+
slopcop enable # add this checkout's repository to the workspace, at a terminal
|
|
252
268
|
slopcop workspace list # the account's workspaces; * marks this login's
|
|
253
269
|
slopcop workspace use "Acme team" # move this login (not the browser) to another, by name or id
|
|
254
270
|
slopcop check -w "Acme team" # check in, and bill, another workspace this once
|
|
@@ -257,8 +273,8 @@ slopcop repo disable acme/widgets # stop checking and charging for one (owner o
|
|
|
257
273
|
slopcop repo enable acme/widgets # turn it back on, within the workspace's active limit
|
|
258
274
|
```
|
|
259
275
|
|
|
260
|
-
`whoami`, `workspace list` and `repo list` take `--format human|json`,
|
|
261
|
-
`workspace use` and `repo enable|disable` for their answer. Every active
|
|
276
|
+
`status`, `whoami`, `workspace list` and `repo list` take `--format human|json`,
|
|
277
|
+
as do `workspace use` and `repo enable|disable` for their answer. Every active
|
|
262
278
|
repository after a workspace's first costs credits every 30 days; a disabled
|
|
263
279
|
one is not checked or charged and keeps its reports, findings and settings.
|
|
264
280
|
`repo enable` and `repo disable` ask you to type the repository's `owner/name`
|
|
@@ -267,36 +283,42 @@ login, and the service cannot tell it from you, so changing what the workspace
|
|
|
267
283
|
pays stays a step you take yourself.
|
|
268
284
|
`workspace use` moves every agent and script using this login, not only the
|
|
269
285
|
one that runs it, so it asks `[y/N]` and refuses when stdin is not a terminal.
|
|
270
|
-
To check in another workspace without moving anyone, `check`, `
|
|
271
|
-
`repo` take `-w`/`--workspace <name|id>`
|
|
272
|
-
command; the login stays where it was. Give agents that share a login their
|
|
286
|
+
To check in another workspace without moving anyone, `check`, `status`,
|
|
287
|
+
`ignore`, `unignore`, `ignored` and `repo` take `-w`/`--workspace <name|id>`
|
|
288
|
+
(or `$SLOPCOP_WORKSPACE`) for that one command; the login stays where it was. Give agents that share a login their
|
|
273
289
|
own `--workspace` instead of switching it.
|
|
274
290
|
|
|
275
291
|
Names match without regard to case; when two workspaces share a name, or two
|
|
276
|
-
providers a repository name, pass the id the listing prints.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
the
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
service
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
providers a repository name, pass the id the listing prints.
|
|
293
|
+
|
|
294
|
+
`slopcop enable`, run inside a checkout at a terminal, adds the repository the
|
|
295
|
+
`origin` remote names to the workspace that checks and bills it, and runs its
|
|
296
|
+
first check. It names the workspace and what adding the repository costs, asks
|
|
297
|
+
you to type the repository's `owner/name`, and refuses when stdin is not a
|
|
298
|
+
terminal. A repository that is already added but disabled is enabled again;
|
|
299
|
+
one that is already active is left alone. An agent runs with your login and
|
|
300
|
+
the service cannot tell it from you, so adding a repository stays a step you
|
|
301
|
+
take yourself.
|
|
302
|
+
|
|
303
|
+
A check never adds a repository. A check of one the workspace has not added
|
|
304
|
+
exits `4` with `repository_not_enabled` and sends nothing; `status` shows the
|
|
305
|
+
same state, and a check that is not at a terminal asks nothing. Once a person
|
|
306
|
+
has approved adding one, `check --add-repository --workspace <name|id>`
|
|
307
|
+
carries that approval without a terminal; the flag needs `--workspace` (the
|
|
308
|
+
flag itself, not `$SLOPCOP_WORKSPACE`), so an approval given for one workspace
|
|
309
|
+
cannot add the repository to the one the login happens to point at. The flag
|
|
310
|
+
changes nothing for a repository already in that workspace. `slopcop enable`
|
|
311
|
+
says `added owner/name to "Workspace"` on stderr, and `json` reports
|
|
312
|
+
`"repositoryAdded": true`. Deleting repositories, archiving workspaces,
|
|
313
|
+
members, credits and repository settings stay in the web app. `enable` exits
|
|
314
|
+
with its first check's result; the other account commands exit `0` on success
|
|
315
|
+
and `2` with the service's message and remedy otherwise, as `ignore` does.
|
|
295
316
|
|
|
296
317
|
## Check
|
|
297
318
|
|
|
298
319
|
```console
|
|
299
320
|
slopcop # check the change in the current checkout
|
|
321
|
+
slopcop check --if-enabled # automatic check: skip a repository not enabled here
|
|
300
322
|
slopcop check --format json # same, machine-readable
|
|
301
323
|
slopcop --root ../repo --base origin/main
|
|
302
324
|
```
|
|
@@ -336,7 +358,8 @@ Flags:
|
|
|
336
358
|
| `--no-policy-discovery` | skip `.slopcop/policies` rules |
|
|
337
359
|
| `--timeout DURATION` | how long to wait for the result (default `10m`) |
|
|
338
360
|
| `-w`, `--workspace NAME\|ID` | check in, and bill, this workspace of the account instead of the login's |
|
|
339
|
-
| `--
|
|
361
|
+
| `--if-enabled` | check only when the repository is active in the workspace; otherwise exit `0` without sending a check |
|
|
362
|
+
| `--add-repository` | add the repository to the workspace `--workspace` names, which then pays for it, without asking at a terminal; for after the user approved it. A check without it never adds a repository |
|
|
340
363
|
| `--verbose` | print the resolved request to stderr, and name each inconclusive check in `human` |
|
|
341
364
|
|
|
342
365
|
### What is sent
|
|
@@ -406,6 +429,16 @@ with a one-line confirmation, and otherwise exits `2` with the service's
|
|
|
406
429
|
message and remedy; `finding_not_found` means the id is unknown or comes from a
|
|
407
430
|
check outside your workspace.
|
|
408
431
|
|
|
432
|
+
To undo a mistaken ignore, run `slopcop unignore <id>` with the id it was
|
|
433
|
+
ignored from, or the same finding's id from any later check of the repository.
|
|
434
|
+
Later checks of the repository report the finding again. Unignoring a finding
|
|
435
|
+
that is not ignored is fine; it exits and fails like `ignore`.
|
|
436
|
+
|
|
437
|
+
`slopcop ignored` lists the findings your workspace ignored in this repository,
|
|
438
|
+
newest first, 25 per page (`--page <n>`), with each one's id for `unignore`,
|
|
439
|
+
location, rule, and when and by whom it was ignored. `--format json` prints the
|
|
440
|
+
service's answer.
|
|
441
|
+
|
|
409
442
|
### Output and exit codes
|
|
410
443
|
|
|
411
444
|
The service answers structured data; the CLI renders it. `human` prints one
|
|
@@ -465,8 +498,10 @@ New findings that cross `--fail-on` exit `1` even when some check did not
|
|
|
465
498
|
complete.
|
|
466
499
|
|
|
467
500
|
While the service answers `check_running`, the CLI waits the `Retry-After` it
|
|
468
|
-
names and asks again until `--timeout` runs out
|
|
469
|
-
|
|
501
|
+
names and asks again until `--timeout` runs out. It asks by the `checkId` the
|
|
502
|
+
answer carries (`GET /v1/check/{checkId}`), so the change is uploaded once; a
|
|
503
|
+
service that sends no `checkId`, or no longer knows it, gets the same request
|
|
504
|
+
again, which attaches to the same running check. If it is still running then, the CLI exits `3`, prints the
|
|
470
505
|
service's message and remedy on stderr, and in `json` prints
|
|
471
506
|
`{"status": "pending", "retryAfter": 5, "message": …, "remedy": …}` on stdout
|
|
472
507
|
(`sarif` prints a run with `slopcop.status` `pending`). Running the same check
|
|
@@ -479,23 +514,23 @@ rewrite them. The remedies name no client, so the CLI adds its own command
|
|
|
479
514
|
after some: `slopcop login` when the remedy is to sign in, the listing to
|
|
480
515
|
choose from after `workspace_not_found` or `workspace_repository_not_found`,
|
|
481
516
|
and `slopcop whoami` after `repository_disabled`, since the workspace that
|
|
482
|
-
disabled it is the one this login is bound to, `--workspace` after
|
|
483
|
-
`owner_required
|
|
484
|
-
|
|
485
|
-
`repository_add_unconfirmed`. A failed check exits `4` when only a person can
|
|
486
|
-
clear the refusal (`auth_required`, `auth_expired`, `account_required`,
|
|
517
|
+
disabled it is the one this login is bound to, and `--workspace` after
|
|
518
|
+
`owner_required`. A failed check exits `4` when only a person can clear the
|
|
519
|
+
refusal (`auth_required`, `auth_expired`, `account_required`,
|
|
487
520
|
`repo_not_indexed`, `app_not_installed`, `app_no_repo_access`,
|
|
488
521
|
`gitlab_not_connected`, `no_access`, `insufficient_credits`,
|
|
489
|
-
`repository_disabled`, `
|
|
490
|
-
`
|
|
491
|
-
`owner_required`, and `browser_required`),
|
|
492
|
-
retrying, and `2` otherwise.
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
`
|
|
497
|
-
|
|
498
|
-
|
|
522
|
+
`repository_disabled`, `repository_not_enabled`,
|
|
523
|
+
`repository_add_unconfirmed`, `workspace_repository_limit_reached`,
|
|
524
|
+
`active_repository_limit_reached`, `owner_required`, and `browser_required`),
|
|
525
|
+
so a script can stop instead of retrying, and `2` otherwise. The CLI refuses a
|
|
526
|
+
check of a repository the workspace has not added locally, as
|
|
527
|
+
`repository_not_enabled`, before sending anything. Stderr starts with the
|
|
528
|
+
code, as in `slopcop: repository_not_enabled: …`. `human` prints nothing on
|
|
529
|
+
stdout; `json` prints `{"status": "failed", "code": …, "message": …,
|
|
530
|
+
"remedy": …, "retryable": …}`, plus `installUrl` or `topUpUrl` when the
|
|
531
|
+
service sent one; `sarif` prints a run with `slopcop.status` `failed`, whose
|
|
532
|
+
invocation is unsuccessful and carries an `error` notification whose
|
|
533
|
+
descriptor id is the code.
|
|
499
534
|
|
|
500
535
|
## API
|
|
501
536
|
|
|
@@ -529,7 +564,13 @@ could be ignored omits it.
|
|
|
529
564
|
`slopcop ignore <id>` calls `POST <service>/v1/ignore` with the same bearer
|
|
530
565
|
token and `{"findingId": "<id>"}`, and gets back
|
|
531
566
|
`{"findingId": "<id>", "status": "ignored"}`. Failures use the same closed
|
|
532
|
-
contract, including `finding_not_found`.
|
|
567
|
+
contract, including `finding_not_found`. `slopcop unignore <id>` calls
|
|
568
|
+
`POST <service>/v1/unignore` the same way and gets back
|
|
569
|
+
`{"findingId": "<id>", "status": "unignored"}`, also when the finding was not
|
|
570
|
+
ignored.
|
|
571
|
+
`slopcop ignored` calls `GET <service>/v1/ignores?repoUrl=<url>&page=<n>`
|
|
572
|
+
(`page` zero-based) and gets back `repository`, `total`, `page`, `pageSize` and
|
|
573
|
+
`ignores`, newest first; see the [API reference](docs/src/content/docs/reference/api.md).
|
|
533
574
|
|
|
534
575
|
The account commands use the same bearer token. `GET <service>/v1/whoami`
|
|
535
576
|
answers `account`, `workspace` (`id`, `name`, `kind`, `role`, `current`),
|
|
@@ -571,13 +612,13 @@ linux, darwin, and windows for amd64 and arm64, packages `tar.gz` archives
|
|
|
571
612
|
and a snapshot build on every change, and `make release-check` runs the same
|
|
572
613
|
locally when GoReleaser is installed. The same tag push then packs
|
|
573
614
|
`@brokkai/slopcop` from those release archives and publishes it to npm with
|
|
574
|
-
[trusted publishing](docs/npm-publishing.md), so the package needs no npm
|
|
615
|
+
[trusted publishing](docs/src/content/docs/contribute/npm-publishing.md), so the package needs no npm
|
|
575
616
|
token.
|
|
576
617
|
|
|
577
618
|
The same tag also packs a wheel per release target from the binaries GoReleaser
|
|
578
619
|
just built, installs the wheel for every platform GitHub can run, and
|
|
579
620
|
publishes `brokk-slopcop` to PyPI with
|
|
580
|
-
[trusted publishing](docs/pypi-publishing.md), so that package needs no PyPI
|
|
621
|
+
[trusted publishing](docs/src/content/docs/contribute/pypi-publishing.md), so that package needs no PyPI
|
|
581
622
|
token either.
|
|
582
623
|
|
|
583
624
|
Layout:
|
|
@@ -594,6 +635,5 @@ Layout:
|
|
|
594
635
|
| `npm` | launcher, packer, and tests of the `@brokkai/slopcop` package |
|
|
595
636
|
| `packaging/pypi` | wheel packer and launcher of the `brokk-slopcop` package |
|
|
596
637
|
| `skills/slopcop` | the agent skill the binary embeds and installs |
|
|
597
|
-
| `docs
|
|
598
|
-
| `docs/pypi-publishing.md` | PyPI release flow and trusted publisher setup |
|
|
638
|
+
| `docs` | the documentation site at <https://docs.slopcop.com> (Astro Starlight), including the npm and PyPI release flows |
|
|
599
639
|
| `.goreleaser.yaml` | tag release build, archives, and checksums |
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|