@brokkai/slopcop 0.0.8 → 0.0.9

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
@@ -101,6 +101,25 @@ installs `slopcop.exe` to `%LOCALAPPDATA%\Programs\slopcop`, and adds that
101
101
  directory to the user `Path`. `SLOPCOP_VERSION`, `SLOPCOP_INSTALL_DIR`, and
102
102
  `SLOPCOP_NO_MODIFY_PATH` override its defaults.
103
103
 
104
+ ### Upgrade notice
105
+
106
+ Every response from the service names its newest release in the
107
+ `SlopCop-Latest-Version` header. When that is newer than the running build,
108
+ the CLI prints one line on stderr, never stdout, so `--format json` and
109
+ `sarif` stay clean:
110
+
111
+ ```text
112
+ slopcop v0.0.9 is available (you have v0.0.7). Upgrade: npm install --global @brokkai/slopcop@latest
113
+ ```
114
+
115
+ The command follows the channel the binary was installed through (npm, npx,
116
+ pip, pipx, or uv), judged by where it lives, and links back here otherwise.
117
+ The notice prints at most once a day; the time of the last one is kept in
118
+ `slopcop/update-notice` next to the config. `dev` builds, `Stop` hook runs, and
119
+ runs with `$SLOPCOP_NO_UPDATE_NOTICE` set to any non-empty value never print
120
+ it. A service that no longer accepts a version answers `client_outdated`
121
+ (HTTP 426), which exits `2`.
122
+
104
123
  ### Go
105
124
 
106
125
  ```console
@@ -230,7 +249,8 @@ it (it already has an active repository and is charged), the service refuses
230
249
  the check with `repository_add_unconfirmed` until a person confirms: at a
231
250
  terminal `check` prints what it costs, asks `Add owner/name to "Workspace"?
232
251
  [y/N]`, and on a yes sends the check again; with no terminal, as for an agent
233
- or CI, it exits `2` with the service's remedy. A workspace's first repository
252
+ or CI, it exits `4` with the service's remedy and, in `json`, a `failed`
253
+ report naming the code. A workspace's first repository
234
254
  is added without asking. Deleting repositories, archiving
235
255
  workspaces, members, credits and repository settings stay in the web app. The
236
256
  commands exit `0` on success and `2` with the service's message and remedy
@@ -245,13 +265,19 @@ slopcop --root ../repo --base HEAD~1
245
265
  ```
246
266
 
247
267
  The base commit defaults to the merge base with the branch upstream, then the
248
- merge base with `origin/HEAD`, then `HEAD`. The service must already have the
268
+ merge base with `origin/HEAD`, then `HEAD` when neither is known. When the
269
+ upstream merge base yields an empty patch, as on a branch whose commits are all
270
+ pushed, the CLI uses the merge base with `origin/HEAD` instead, so a check
271
+ right after a push still covers the branch. The service must already have the
249
272
  base commit in its clone; a missing one comes back as the service's
250
273
  `base_not_found` message and remedy.
251
274
 
252
275
  Every run sends one check request, even when the working tree matches the base
253
276
  and the patch is empty. A clean result or a failure always comes from the
254
- service.
277
+ service. A report for an empty patch comes with a note on stderr that suggests
278
+ `--base`, and `json` adds `"emptyChange": true` (`sarif`:
279
+ `properties["slopcop.emptyChange"]`): a clean result then means nothing
280
+ changed was checked.
255
281
 
256
282
  Flags:
257
283
 
@@ -342,8 +368,8 @@ summary line such as `1 new finding across 1 file(s); 72 already in the code |
342
368
  Analysis complete`, and any omitted new findings or
343
369
  incomplete checks. `json` prints `status`, `baseCommit`, `summary`
344
370
  (`newFindings` and `existingFindings` count the split), `findings` (each with
345
- `new` and its `id`), `incomplete`, and `failure` when the analysis did not
346
- complete. `sarif` prints a SARIF 2.1.0 log whose results carry `baselineState`
371
+ `new` and its `id`), `incomplete`, `failure` when the analysis did not
372
+ complete, and `emptyChange` when the patch was empty. `sarif` prints a SARIF 2.1.0 log whose results carry `baselineState`
347
373
  `new` and the finding id in `properties["slopcop.findingId"]`. `--format` only
348
374
  changes the rendering, never the request, so the service answers the same check
349
375
  whichever is used.
@@ -354,6 +380,7 @@ whichever is used.
354
380
  | `1` | A new finding crossed `--fail-on` |
355
381
  | `2` | No new finding crossed `--fail-on`, but a check was incomplete; or the CLI or service failed |
356
382
  | `3` | The check was still running when `--timeout` ran out |
383
+ | `4` | The service refused the check, and only a person can clear it |
357
384
  | `130`, `143` | Interrupted before the check answered: `130` for Ctrl-C, `143` for SIGTERM |
358
385
 
359
386
  Only `clean` exits `0`: a status this CLI does not know exits `2`, so a newer
@@ -394,8 +421,20 @@ after some: `slopcop login` when the remedy is to sign in, the listing to
394
421
  choose from after `workspace_not_found` or `workspace_repository_not_found`,
395
422
  and `slopcop whoami` after `repository_disabled`, since the workspace that
396
423
  disabled it is the one this login is bound to, and `--workspace` after
397
- `owner_required`. A failed request prints no
398
- report on stdout.
424
+ `owner_required`. A failed check exits `4` when only a person can clear the
425
+ refusal (`auth_required`, `auth_expired`, `account_required`,
426
+ `repo_not_indexed`, `app_not_installed`, `app_no_repo_access`,
427
+ `gitlab_not_connected`, `no_access`, `insufficient_credits`,
428
+ `repository_disabled`, `repository_add_unconfirmed`,
429
+ `workspace_repository_limit_reached`, `active_repository_limit_reached`,
430
+ `owner_required`, and `browser_required`), so a script can stop instead of
431
+ retrying, and `2` otherwise. Stderr starts with the code, as in `slopcop:
432
+ repository_add_unconfirmed: …`. `human` prints nothing on stdout; `json`
433
+ prints `{"status": "failed", "code": …, "message": …, "remedy": …,
434
+ "retryable": …}`, plus `installUrl` or `topUpUrl` when the service sent one;
435
+ `sarif` prints a run with `slopcop.status` `failed`, whose invocation is
436
+ unsuccessful and carries an `error` notification whose descriptor id is the
437
+ code.
399
438
 
400
439
  ## API
401
440
 
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.8",
3
+ "version": "0.0.9",
4
4
  "description": "Static analysis for coding agents and CI: check a change through the hosted SlopCop API",
5
5
  "keywords": [
6
6
  "agents",