@brokkai/slopcop 0.0.19 → 0.0.21

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 CHANGED
@@ -23,9 +23,9 @@ The full documentation is at <https://docs.slopcop.com>.
23
23
  The hosted static analyzer needs no per-language install. Local review uses your
24
24
  existing harness logins and Node.js with `npx`. `--mode ai` needs no SlopCop
25
25
  login, enabled repository, or supported origin. Use `--mode static` for a
26
- hosted-only check or CI without reviewer harness logins. A check never adds a
27
- repository; `--if-enabled` skips one the workspace has not enabled, and says it
28
- was skipped.
26
+ hosted-only check or CI without reviewer harness logins. A check of a
27
+ repository the workspace has never added adds it; `--if-enabled` skips one the
28
+ workspace has disabled, and says it was skipped.
29
29
 
30
30
  ## Install
31
31
 
@@ -49,7 +49,9 @@ CLI, and keeps the login the machine has. `SLOPCOP_VERSION`,
49
49
 
50
50
  Without a code, `curl -fsSL https://slopcop.com/install | sh` does the same and
51
51
  signs in through the browser device flow instead (see [Sign in](#sign-in)).
52
- Then run `slopcop enable` in each repository you want checked.
52
+ Then open your agent in any repository you want checked: its first check adds
53
+ the repository to your workspace (repositories are free; a check uses a free
54
+ check, then credits). `slopcop enable` is optional; see [Account](#account).
53
55
 
54
56
  ### Other channels
55
57
 
@@ -149,6 +151,28 @@ runs with `$SLOPCOP_NO_UPDATE_NOTICE` set to any non-empty value never print
149
151
  it. A service that no longer accepts a version answers `client_outdated`
150
152
  (HTTP 426), which exits `2`.
151
153
 
154
+ ### Automatic updates
155
+
156
+ A slopcop installed by the install script, or by hand from a release archive,
157
+ updates itself. When the service reports a newer release, the command first
158
+ finishes its own work, then downloads that release, checks the archive against
159
+ its `checksums.txt`, and replaces its own binary:
160
+
161
+ ```text
162
+ slopcop: updating from v0.0.7 to v0.0.9...
163
+ slopcop: updated from v0.0.7 to v0.0.9; the next run uses it.
164
+ ```
165
+
166
+ The line goes to stderr. An update that fails never fails the command: it
167
+ prints the upgrade notice with the reason, and is tried again a day later.
168
+ `slopcop update` does the same on request. A slopcop installed through npm,
169
+ pip, pipx or uv is not replaced, because that tool owns the file; it gets the
170
+ notice above, and `slopcop update` names the command to run. Nothing updates
171
+ itself when `$SLOPCOP_NO_AUTO_UPDATE` or `$CI` is set, so a job keeps the
172
+ version it installed, or in a `Stop` hook run. Only a release build is replaced:
173
+ a `dev` build, or one built ahead of a release, stays as built, and a
174
+ pre-release is never installed by itself.
175
+
152
176
  ### Go
153
177
 
154
178
  ```console
@@ -227,7 +251,7 @@ hosted API, but only when all of these hold:
227
251
  session's subagents included), or the working tree has a changed
228
252
  dependency manifest or lockfile (see below);
229
253
  - slopcop is signed in, and the workspace a check would use
230
- (`$SLOPCOP_WORKSPACE`, or the login's) has the repository active
254
+ (`$SLOPCOP_WORKSPACE`, the one the checkout is mapped to, or the login's) has the repository active
231
255
  (`slopcop repo list`), so nothing is sent from other repositories;
232
256
  - the tree differs from the last check in the session, including a check the
233
257
  agent ran by hand.
@@ -263,10 +287,9 @@ Use `slopcop init --no-hooks` to install only the skill, or
263
287
  Ordinary checks do not reinstall a removed hook. The skill remains the way to
264
288
  check from other harnesses.
265
289
 
266
- The hook is dormant in a repository until it is enabled in the workspace. Run
267
- `slopcop enable` in the checkout, at a terminal, to add it and run its first
268
- check. The hook then checks what an agent writes and hands findings back; it
269
- never adds a repository and sends nothing for one that is not active.
290
+ The hook checks what an agent writes and hands findings back. Its first check
291
+ of a repository the workspace has never added adds it, as any check does; it
292
+ sends nothing for one the workspace has disabled or has past its active limit.
270
293
 
271
294
  ### Managed rollout
272
295
 
@@ -314,7 +337,9 @@ printed.
314
337
  The service URL defaults to `https://slopcop.com`; `--service` or
315
338
  `$SLOPCOP_SERVICE` names another for one command. Each service keeps its own
316
339
  login: `slopcop --service <url> login` leaves the others signed in and the
317
- default as it is, and a login is only sent to the service that issued it.
340
+ default as it is, unless the default has no login (as on a machine's first
341
+ login), in which case that service becomes the default and login says so. A login is only sent to the service that
342
+ issued it.
318
343
  `slopcop login --default` or `slopcop service use <url>` changes the default,
319
344
  after asking at a terminal, and `slopcop service list` shows the stored logins. A command that talks to
320
345
  another service than `https://slopcop.com` says so on stderr.
@@ -329,33 +354,37 @@ Precedence:
329
354
  | --- | --- |
330
355
  | Service URL | `--service`, `$SLOPCOP_SERVICE`, the default stored by `slopcop login --default` or `slopcop service use`, `https://slopcop.com` |
331
356
  | Token | `$SLOPCOP_TOKEN`, the login stored for that service |
332
- | Workspace (`check`, `enable`, `status`, `ignore`, `unignore`, `ignored`, `repo`) | `-w`/`--workspace`, `$SLOPCOP_WORKSPACE`, the one the login is bound to |
357
+ | Workspace (`check`, `enable`, `status`, `ignore`, `unignore`, `ignored`, `repo`) | `-w`/`--workspace`, `$SLOPCOP_WORKSPACE`, the one this machine maps the checkout's repository to, the one the login is bound to |
333
358
 
334
359
  ## Workspace and repositories
335
360
 
336
- A login runs its checks and ignores in, and bills, one workspace: the one
337
- active in the browser when the login was approved.
361
+ A login is bound to one workspace: the one active in the browser when the
362
+ login was approved. Its checks and ignores run in, and bill, that workspace,
363
+ unless this machine maps the repository to another of your workspaces.
338
364
 
339
365
  ```console
340
366
  slopcop whoami # account, this login's workspace, its plan, the service URL
341
367
  slopcop status # this checkout's repository, and whether the workspace checks it
342
- slopcop enable # add this checkout's repository to the workspace, at a terminal
368
+ slopcop enable # optional: add this checkout's repository now, and say which workspace
343
369
  slopcop workspace list # the account's workspaces; * marks this login's
370
+ slopcop workspace map "Acme team" # check this checkout's repository there from now on, at a terminal
371
+ slopcop workspace unmap # go back to the login's workspace for this repository
372
+ slopcop workspace mappings # the repositories this machine maps, and to which workspace
344
373
  slopcop workspace use "Acme team" # move this login (not the browser) to another, by name or id
345
374
  slopcop check -w "Acme team" # check in, and bill, another workspace this once
346
375
  slopcop repo list # the workspace's repositories: active, disabled, or over the limit
347
- slopcop repo disable acme/widgets # stop checking and charging for one (owner only)
376
+ slopcop repo disable acme/widgets # stop checking one (owner only)
348
377
  slopcop repo enable acme/widgets # turn it back on, within the workspace's active limit
349
378
  ```
350
379
 
351
380
  `status`, `whoami`, `workspace list` and `repo list` take `--format human|json`,
352
- as do `workspace use` and `repo enable|disable` for their answer. Every active
353
- repository after a workspace's first costs credits every 30 days; a disabled
354
- one is not checked or charged and keeps its reports, findings and settings.
381
+ as do `workspace use` and `repo enable|disable` for their answer. Repositories
382
+ are free; checks use the workspace's free checks for the month, then credits. A
383
+ disabled repository is not checked and keeps its reports, findings and settings.
355
384
  `repo enable` and `repo disable` ask you to type the repository's `owner/name`
356
385
  and refuse when stdin is not a terminal: an agent or CI job runs with your
357
386
  login, and the service cannot tell it from you, so changing what the workspace
358
- pays stays a step you take yourself.
387
+ checks stays a step you take yourself.
359
388
  `workspace use` moves every agent and script using this login, not only the
360
389
  one that runs it, so it asks `[y/N]` and refuses when stdin is not a terminal.
361
390
  To check in another workspace without moving anyone, `check`, `status`,
@@ -363,28 +392,54 @@ To check in another workspace without moving anyone, `check`, `status`,
363
392
  (or `$SLOPCOP_WORKSPACE`) for that one command; the login stays where it was. Give agents that share a login their
364
393
  own `--workspace` instead of switching it.
365
394
 
395
+ `workspace map <name|id>` makes every checkout of the repository `origin`
396
+ names, on this machine, check in that workspace, so one login checks work
397
+ repositories in a team workspace and your own in your personal one. `slopcop
398
+ enable` maps the checkout to the workspace it adds the repository to. The
399
+ mapping is kept in `config.json`, by service and repository URL; it decides
400
+ which workspace pays, so `workspace map` and `workspace unmap` ask `[y/N]` and
401
+ refuse when stdin is not a terminal. `--workspace` and `$SLOPCOP_WORKSPACE`
402
+ still win for one command, and `slopcop status` prints the workspace a
403
+ checkout gets and a `Chosen by` line saying why. A mapping to a workspace that
404
+ was archived, or that your account left, stops the check with
405
+ `workspace_not_found` instead of falling back to another workspace. The first
406
+ check of a repository with no mapping, when your account has more than one
407
+ workspace, notes once which workspace it runs in and any other of yours that
408
+ has the repository; the check still runs.
409
+
366
410
  Names match without regard to case; when two workspaces share a name, or two
367
411
  providers a repository name, pass the id the listing prints.
368
412
 
369
- `slopcop enable`, run inside a checkout at a terminal, adds the repository the
370
- `origin` remote names to the workspace that checks and bills it, and runs its
371
- first check. It names the workspace and what adding the repository costs, asks
372
- you to type the repository's `owner/name`, and refuses when stdin is not a
373
- terminal. A repository that is already added but disabled is enabled again;
374
- one that is already active is left alone. An agent runs with your login and
375
- the service cannot tell it from you, so adding a repository stays a step you
376
- take yourself.
377
-
378
- The static half never adds a repository. A check of one the workspace has not
379
- added exits `4` with `repository_not_enabled` and sends nothing; `status` shows
380
- the same state, and a check that is not at a terminal asks nothing. Once a
381
- person has approved adding one, `check --add-repository --workspace <name|id>`
382
- carries that approval without a terminal; the flag needs `--workspace` (the flag
383
- itself, not `$SLOPCOP_WORKSPACE`), so an approval given for one workspace cannot
384
- add the repository to the one the login happens to point at. The flag changes
385
- nothing for a repository already in that workspace. `slopcop enable` says `added
386
- owner/name to "Workspace"` on stderr, and `json` reports `"repositoryAdded":
387
- true`. Deleting repositories, archiving workspaces, members, credits and
413
+ `slopcop enable` is optional. Run inside a checkout, it adds the repository the
414
+ `origin` remote names to the workspace that checks and bills it, runs its first
415
+ check, and maps this machine's checkouts of it to that workspace. It does not
416
+ ask: the workspace is the one `--workspace` names, else the one the checkout is
417
+ mapped to, else the login's, and it says which one on stderr along with how to
418
+ undo it:
419
+
420
+ ```console
421
+ $ slopcop enable
422
+ slopcop: added Acme/widgets to "Acme team"; your agent's changes here are checked there from now on.
423
+ slopcop: wrong workspace? Run `slopcop workspace map <name>` here to check it in another (`slopcop workspace list` names them), then `slopcop repo disable Acme/widgets --workspace "Acme team"` to remove it from "Acme team".
424
+ ```
425
+
426
+ An account with one workspace gets the first line alone, ending with the
427
+ `slopcop repo disable owner/name` that undoes it. Before it adds a repository another of your
428
+ workspaces already has, it says so, since both would then check and bill it.
429
+ A repository that is already active is left alone. One that someone disabled
430
+ is enabled again, but only at a terminal: an agent running with your login does
431
+ not undo that choice.
432
+
433
+ A check does not need `enable` first: a check of a repository the workspace has
434
+ never added adds it to the workspace the check runs in (the login's, or the one
435
+ `--workspace` names), which then pays for its checks, so an agent is not
436
+ stopped to ask. A check of one the workspace has disabled exits `4` with
437
+ `repository_disabled`, and one past the active limit with
438
+ `active_repository_limit_reached`; these stop before the local reviewers start,
439
+ so the report has no review. A check that adds a repository says `added owner/name to "Workspace"` on stderr, and `json` reports
440
+ `"repositoryAdded": true` and `addedToWorkspace`: the workspace, how it was
441
+ chosen, and how to check the repository in another one instead. `--add-repository` is no longer needed; it is still
442
+ accepted. Deleting repositories, archiving workspaces, members, credits and
388
443
  repository settings stay in the web app. `enable` exits with its first check's
389
444
  result; the other account commands exit `0` on success and `2` with the
390
445
  service's message and remedy otherwise, as `ignore` does.
@@ -393,7 +448,7 @@ service's message and remedy otherwise, as `ignore` does.
393
448
 
394
449
  ```console
395
450
  slopcop # check the change in the current checkout
396
- slopcop check --if-enabled # automatic check: skip a repository not enabled here
451
+ slopcop check --if-enabled # automatic check: skip a repository disabled here
397
452
  slopcop check --format json # same, machine-readable
398
453
  slopcop --root ../repo --base origin/main
399
454
  ```
@@ -446,8 +501,7 @@ Flags:
446
501
  | `--no-policy-discovery` | skip `.slopcop/policies` rules |
447
502
  | `--timeout DURATION` | how long to wait for the result (default `10m`) |
448
503
  | `-w`, `--workspace NAME\|ID` | check in, and bill, this workspace of the account instead of the login's |
449
- | `--if-enabled` | check only when the repository is active in the workspace; otherwise exit `0` without sending a check |
450
- | `--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 |
504
+ | `--if-enabled` | skip a repository the workspace has disabled or has past its active limit, exiting `0` without sending a check; one it has never added is added |
451
505
  | `--verbose` | print the resolved request to stderr, and name each inconclusive check in `human` |
452
506
 
453
507
  The hosted `slopcop.similarity` check runs by default, including when the
@@ -459,8 +513,11 @@ or the check's exit code. Check notices, including partial comparison notices,
459
513
  appear as notes and do not make analysis incomplete. To select only
460
514
  similarity, pass `--policy-id slopcop.similarity`.
461
515
 
462
- For this check, function source from the change is sent to third-party
463
- embedding and model providers used by the hosted service.
516
+ This is the one hosted check that is not rule-based: the hosted service sends
517
+ function source to third-party providers. An embedding provider receives the
518
+ functions the change adds or edits and, to index the repository, the functions
519
+ in the rest of its source files, not only the ones the change touches. A model
520
+ receives each changed function with the existing functions closest to it.
464
521
 
465
522
  A finding of the hosted `slopcop.dependencies.known-vulnerability` check is a
466
523
  known-vulnerable dependency version the change brings in. Its location is the
@@ -502,6 +559,9 @@ through Claude ACP. Each uses the newest model of its family at high effort.
502
559
  mode is not static, then saves the first two that work (or one) as reviewers
503
560
  and the rest that work as `review.fallbacks`. Configured reviewers are left
504
561
  alone; unset `review.reviewers` and run init to pick again.
562
+ The probe skips a family whose login or API key is plainly missing (Codex or
563
+ Claude Code never logged in here, `DEEPSEEK_API_KEY` unset), and prints one
564
+ line when none work; `slopcop init --verbose` says why each one failed.
505
565
  `slopcop init --no-reviewers` skips probing. A reviewer that cannot start does
506
566
  not stop the others. One that ends without a verdict runs once more in a fresh
507
567
  session; if it still fails, the next unused fallback stands in for it,
@@ -523,7 +583,9 @@ files; Slopcop refuses their requests to run commands or change files. Codex
523
583
  reviewers run in Codex's read-only sandbox.
524
584
  CI normally uses `--mode static`.
525
585
 
526
- Review state and logs are under `<git-dir>/slopcop/`. A complete review is
586
+ Review state and logs are under `<git-dir>/slopcop/`. `slopcop review show
587
+ [--format human|json|sarif]` prints the latest review again, rebuilding each
588
+ reviewer's reply from its log, without running a reviewer. A complete review is
527
589
  reused when nothing relevant changed. A nonempty check with a clean review
528
590
  and a completed static result with no new findings at or above
529
591
  `gate.blockOn` (default `error`) records `refs/slopcop/reviewed/<tree>`.
@@ -564,6 +626,12 @@ Patterns are relative to the repository root; quote globs so the shell does
564
626
  not expand them. They only override the size filter and do not exclude other
565
627
  changed source files. Service payload limits still apply to the resulting patch.
566
628
 
629
+ Changed files that `.bifrostignore` or `[check] exclude` keep out of every
630
+ check are left out of the upload and local review too, listed in
631
+ `omittedFiles` with reason `excluded`; `--include` does not bring them back.
632
+ A deleted file is sent without its old content, so removing a large folder
633
+ does not cost its size.
634
+
567
635
  A check run by a Claude Code, Codex or OpenCode agent also sends which models wrote the
568
636
  change, so the service can tie each finding to the model that wrote its file.
569
637
  The CLI finds the agent's session from its environment and reads that
@@ -686,13 +754,14 @@ rare in static analysis, typically at a library boundary, so this is the norm
686
754
  rather than a gap. Each report still says where they are, so a reviewer can
687
755
  judge what a `clean` result is worth: `human` prints one `Inconclusive:` line
688
756
  with the count and how many concern only files the change does not write, and
689
- `--verbose` names each check. `json` lists them in `inconclusive`, each with
690
- `policyId`, `reason` and `elsewhere` (true when it concerns only files the
691
- change does not write), beside the `summary.inconclusive` count. `sarif` adds
692
- a `note` notification per check with `slopcop.inconclusive` and
693
- `slopcop.elsewhere` properties. The service names at most 50; the counts
694
- cover the rest. It does not yet say which files or lines each one concerns,
695
- or what evidence was missing. A check that timed out or
757
+ `--verbose` names each check and the files it concerns. `json` lists them in
758
+ `inconclusive`, each with `policyId`, `reason`, `detail`, `files` (when the
759
+ analyzer named every file the check concerns) and `elsewhere` (true when it
760
+ concerns only files the change does not write), beside the
761
+ `summary.inconclusive` count. `sarif` adds a `note` notification per check
762
+ with `slopcop.inconclusive` and `slopcop.elsewhere` properties and one
763
+ location per file. The service names at most 50; the counts cover the rest.
764
+ It does not yet say which functions or lines each one concerns. A check that timed out or
696
765
  that Bifrost judged unreliable is incomplete and counts wherever it is.
697
766
 
698
767
  The service applies `--fail-on` and sets the status; the exit code follows it.
@@ -726,13 +795,14 @@ disabled it is the one this login is bound to, and `--workspace` after
726
795
  refusal (`auth_required`, `auth_expired`, `account_required`,
727
796
  `repo_not_indexed`, `app_not_installed`, `app_no_repo_access`,
728
797
  `gitlab_not_connected`, `no_access`, `insufficient_credits`,
729
- `repository_disabled`, `repository_not_enabled`,
730
- `repository_add_unconfirmed`, `workspace_repository_limit_reached`,
798
+ `repository_disabled`, `repository_add_unconfirmed`, `workspace_repository_limit_reached`,
731
799
  `active_repository_limit_reached`, `owner_required`, and `browser_required`),
732
800
  so a script can stop instead of retrying, and `2` otherwise. The CLI refuses a
733
- check of a repository the workspace has not added locally, as
734
- `repository_not_enabled`, before sending anything. Stderr starts with the
735
- code, as in `slopcop: repository_not_enabled: …`. `human` prints nothing on
801
+ check of a repository the workspace has disabled locally, as
802
+ `repository_disabled`, and one past the active limit as
803
+ `active_repository_limit_reached`, before sending anything or starting the
804
+ local reviewers. Stderr starts with the code, as in `slopcop:
805
+ repository_disabled: …`. `human` prints nothing on
736
806
  stdout; `json` prints `{"status": "failed", "code": …, "message": …,
737
807
  "remedy": …, "retryable": …}`, plus `installUrl` or `topUpUrl` when the
738
808
  service sent one; `sarif` prints a run with `slopcop.status` `failed`, whose
@@ -754,8 +824,8 @@ The CLI calls `POST <service>/v1/check` with a bearer token:
754
824
  }
755
825
  ```
756
826
 
757
- `addRepository` is sent only after a person confirms adding the repository, at
758
- the terminal or with `--add-repository`. The service rejects any other field.
827
+ `addRepository` is sent when the workspace has never added the repository, so
828
+ the check adds it. The service rejects any other field.
759
829
  With `--workspace`, every request, the check's, the ignore's and the account
760
830
  routes', carries the workspace's id in the `SlopCop-Workspace` header; a name
761
831
  is first looked up with `GET <service>/v1/whoami`. The response carries `status`,
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brokkai/slopcop",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Static analysis for coding agents and CI: check a change through the hosted SlopCop API",
5
5
  "keywords": [
6
6
  "agents",