@brokkai/slopcop 0.0.16 → 0.0.18

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
@@ -164,20 +164,23 @@ The binary carries two agent skills. `slopcop` teaches a coding agent how
164
164
  to check a change. `slopcop-audit` audits code that has already landed: it
165
165
  splits a commit range into module slices and checks them in parallel with
166
166
  hosted checks, then triages the findings into a fix plan. The binary also
167
- carries an automatic check hook for Claude Code and Codex. Run `slopcop init`
168
- inside the repository. It installs both skills into the repository-local
169
- directories below and names what it did:
167
+ carries automatic check and push-gate hooks for Claude Code, Codex and Grok.
168
+ Run `slopcop init` once for the machine. It installs both skills into the
169
+ user-level directories below and names what it did:
170
170
 
171
171
  | Location | Harness |
172
172
  | --- | --- |
173
- | `.agents/skills/slopcop/`, `.agents/skills/slopcop-audit/` | Codex and other agents |
174
- | `.claude/skills/slopcop/`, `.claude/skills/slopcop-audit/` | Claude Code and other agents |
173
+ | `~/.agents/skills/slopcop/`, `~/.agents/skills/slopcop-audit/` | Codex, Grok and other agents |
174
+ | `~/.claude/skills/slopcop/`, `~/.claude/skills/slopcop-audit/` | Claude Code and other agents |
175
175
 
176
- Init adds these paths to `.git/info/exclude`, leaves tracked files alone, and
177
- removes SlopCop's old user-level skill copies and hooks.
176
+ It leaves tracked files alone. A command run inside a checkout also removes
177
+ the hooks, skills and `.git/info/exclude` entries written by the earlier
178
+ per-repository releases. Other existing checkouts migrate themselves the first
179
+ time their old hook runs the upgraded binary, so setup does not have to be
180
+ repeated repository by repository.
178
181
 
179
182
  A skill that is already there is left alone by init, so running it again is
180
- safe. A check updates copies already in the repository, but creates none; login
183
+ safe. A check updates copies already installed, but creates none; login
181
184
  does not install the skill. An existing copy is rewritten when it differs from
182
185
  the skill bundled into the binary, so an agent follows the instructions of the
183
186
  slopcop version it runs. Each install records the version that wrote it, and
@@ -197,25 +200,25 @@ notice says where. A check's `json` and `sarif` reports carry the same update
197
200
  (see below). `slopcop init --no-skill` skips the install and any update of
198
201
  it.
199
202
 
200
- Init also adds a static-only `Stop` hook for Claude Code and Codex, and
201
- leaves everything else in the file as it was:
203
+ Init also adds a static-only `Stop` hook and a `PreToolUse` push gate for
204
+ Claude Code, Codex and Grok, and leaves everything else in each file as it was:
202
205
 
203
206
  | File | Harness |
204
207
  | --- | --- |
205
- | `.claude/settings.local.json` in the repository | Claude Code |
206
- | `.codex/hooks.json` in the repository | Codex |
208
+ | `settings.json` under `CLAUDE_CONFIG_DIR`, or `~/.claude` | Claude Code |
209
+ | `hooks.json` under `CODEX_HOME`, or `~/.codex` | Codex |
210
+ | `hooks/slopcop.json` under `GROK_HOME`, or `~/.grok` | Grok |
207
211
 
208
- The Claude Code and Codex settings also get a PreToolUse push gate. It
209
- blocks `git push`, `gh pr create`, and the GitHub MCP tools that push files or
210
- open a pull request until HEAD's tree has a passing check or valid override.
211
- Grok runs the Claude Code gate too, in a folder it trusts. Codex runs its gate
212
- only once you trust it with `/hooks`.
212
+ The push gate blocks `git push`, `gh pr create`, and the GitHub MCP tools that
213
+ push files or open a pull request until HEAD's tree has a passing check or
214
+ valid override. It is installed machine-wide but only enforces a repository
215
+ after SlopCop has created review state there. A repository that has never been
216
+ checked is left alone.
213
217
 
214
- Codex reads the repository's `.codex/hooks.json` only once you trust the
215
- project in Codex, and runs a new or changed hook only once you trust it too:
216
- open Codex in the repository and review it with `/hooks`. Init never writes that trust itself, and reminds you each
217
- time it runs, since Codex says nothing of a hook it skips. The hook stays the
218
- same from one release to the next, so an update does not ask for it again.
218
+ Codex runs a new or changed user-level hook only once you trust it: open Codex
219
+ and review it with `/hooks`. Init never writes that trust itself. The hook
220
+ stays the same from one release to the next, so an update does not ask for it
221
+ again.
219
222
 
220
223
  When the agent stops, the hook checks the working tree through the same
221
224
  hosted API, but only when all of these hold:
@@ -276,9 +279,9 @@ put `slopcop` on `PATH`, and each user still signs in.
276
279
  `managed-settings.d/`): a `Stop` group with `"type": "command"`,
277
280
  `"command": "slopcop hook claude || true"`, `"timeout": 720` and
278
281
  `"statusMessage": "Checking the change with SlopCop"`. Under
279
- `allowManagedHooksOnly` the hooks init writes to the repository's
280
- `.claude/settings.local.json`, the push gate included, are blocked, so the
281
- managed hook is the only one that runs. Claude Code runs
282
+ `allowManagedHooksOnly` the user-level hooks init writes to
283
+ `settings.json`, the push gate included, are blocked, so the managed hook is
284
+ the only one that runs. Claude Code runs
282
285
  an identical handler from several settings files once.
283
286
  - **Codex:** define the `Stop` hook under `[hooks]` in the managed
284
287
  `requirements.toml` (`command = "slopcop hook codex || true"`,
@@ -306,18 +309,26 @@ already approved in your browser, so it needs neither.
306
309
  The browser flow prints a link that opens the approval page with the code
307
310
  filled in, plus the page and code to type in instead, and stores the token once
308
311
  the login is approved. Approve only if the page shows the code your terminal
309
- printed. The service URL defaults to `https://slopcop.com`; `--service`,
310
- `$SLOPCOP_SERVICE`, or a stored value override it.
312
+ printed.
311
313
 
312
- The credential lives in `slopcop/config.json` under the user config directory
313
- and is written owner-only. `slopcop logout` clears it.
314
+ The service URL defaults to `https://slopcop.com`; `--service` or
315
+ `$SLOPCOP_SERVICE` names another for one command. Each service keeps its own
316
+ 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.
318
+ `slopcop login --default` or `slopcop service use <url>` changes the default,
319
+ after asking at a terminal, and `slopcop service list` shows the stored logins. A command that talks to
320
+ another service than `https://slopcop.com` says so on stderr.
321
+
322
+ The credentials live in `slopcop/config.json` under the user config directory,
323
+ which is written owner-only. `slopcop logout` forgets the login for one
324
+ service, and `slopcop logout --all` every one.
314
325
 
315
326
  Precedence:
316
327
 
317
328
  | Value | Order |
318
329
  | --- | --- |
319
- | Service URL | `--service`, `$SLOPCOP_SERVICE`, stored by `slopcop login`, `https://slopcop.com` |
320
- | Token | `$SLOPCOP_TOKEN`, stored value |
330
+ | Service URL | `--service`, `$SLOPCOP_SERVICE`, the default stored by `slopcop login --default` or `slopcop service use`, `https://slopcop.com` |
331
+ | Token | `$SLOPCOP_TOKEN`, the login stored for that service |
321
332
  | Workspace (`check`, `enable`, `status`, `ignore`, `unignore`, `ignored`, `repo`) | `-w`/`--workspace`, `$SLOPCOP_WORKSPACE`, the one the login is bound to |
322
333
 
323
334
  ## Workspace and repositories
@@ -429,6 +440,9 @@ Flags:
429
440
  | `--fail-on never\|finding\|note\|warning\|error` | exit-1 threshold for new findings (default `finding`) |
430
441
  | `--certainty definite\|all` | report and fail on only `definite` findings (default), or on `possible` and `heuristic` ones too |
431
442
  | `--policy PATH` | repository-relative `.rqlp` file to evaluate (repeatable) |
443
+ | `--policy-id ID` | built-in policy ID (repeatable) |
444
+ | `--policy-pack PACK` | policy pack (repeatable) |
445
+ | `--policy-category CATEGORY` | policy category (repeatable) |
432
446
  | `--no-policy-discovery` | skip `.slopcop/policies` rules |
433
447
  | `--timeout DURATION` | how long to wait for the result (default `10m`) |
434
448
  | `-w`, `--workspace NAME\|ID` | check in, and bill, this workspace of the account instead of the login's |
@@ -436,24 +450,72 @@ Flags:
436
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 |
437
451
  | `--verbose` | print the resolved request to stderr, and name each inconclusive check in `human` |
438
452
 
453
+ The hosted `slopcop.similarity` check runs by default, including when the
454
+ repository has `.slopcop/policies` files. It reports similar
455
+ existing functions for functions in the change, with candidate paths, lines,
456
+ and a probability. Similarity findings have `info` severity, are always shown
457
+ regardless of `--certainty`, and are advisory: they never affect the push gate
458
+ or the check's exit code. Check notices, including partial comparison notices,
459
+ appear as notes and do not make analysis incomplete. To select only
460
+ similarity, pass `--policy-id slopcop.similarity`.
461
+
462
+ For this check, function source from the change is sent to third-party
463
+ embedding and model providers used by the hosted service.
464
+
465
+ A finding of the hosted `slopcop.dependencies.known-vulnerability` check is a
466
+ known-vulnerable dependency version the change brings in. Its location is the
467
+ lockfile entry, and the report adds the package, how it is installed and the
468
+ fix:
469
+
470
+ ```text
471
+ [error] slopcop.dependencies.known-vulnerability: lodash 4.17.20 has a known vulnerability
472
+ Location: package-lock.json:12
473
+ Certainty: definite
474
+ ID: 6b1f0c0e-0000-4000-8000-000000000003
475
+ Package: npm lodash@4.17.20, direct, from package.json
476
+ Advisory: GHSA-29mw-wpgm-hmr9 (CVE-2020-28500) https://osv.dev/vulnerability/GHSA-29mw-wpgm-hmr9
477
+ Fixed in: 4.17.21
478
+ Fix: npm install lodash@4.17.21 --save-exact (run at the repository root)
479
+ ```
480
+
481
+ A transitive dependency adds a `Via:` line, from the direct dependency down
482
+ to the package. `json` passes the same fields through as the finding's
483
+ `dependency` object, and `sarif` puts it in the result's
484
+ `slopcop.dependency` property. The client never reads lockfiles or asks an
485
+ advisory database itself, and drops a `dependency` object that is malformed,
486
+ oversized or unsafe to print, keeping the finding. `slopcop ignore` takes the
487
+ finding's id like any other.
488
+
439
489
  ### Modes and local review
440
490
 
441
491
  `slopcop check` runs hosted static analysis and local LLM review concurrently
442
492
  by default. Use `--mode static` or `--static` for only the hosted check; use
443
493
  `--mode ai` or `--ai` for only local review. A single captured snapshot
444
494
  includes committed, uncommitted, and untracked work, except ignored files.
445
- Reviewers read `git diff <baseTree> <snapshotTree>` themselves.
495
+ Reviewers read the captured diff after the same large-data filter used for
496
+ the hosted patch. The full snapshot still identifies the tree approved for push.
446
497
 
447
498
  Reviewers, in priority order, are GPT Terra (`terra`) and GPT Sol (`sol`) through
448
499
  Codex ACP, DeepSeek Flash (`flash`) through dsh ACP, and Claude Haiku (`haiku`)
449
500
  through Claude ACP. Each uses the newest model of its family at high effort.
450
501
  `slopcop init` probes each family once when reviewers are not configured and
451
- mode is not static, then saves the first two that work (or one). Configured
452
- reviewers are left alone; unset `review.reviewers` and run init to pick again.
453
- `slopcop init --no-reviewers` skips probing. A check runs exactly the configured
454
- reviewers and fails with exit `2` if one cannot run. Set the ordered list (1–4
502
+ mode is not static, then saves the first two that work (or one) as reviewers
503
+ and the rest that work as `review.fallbacks`. Configured reviewers are left
504
+ alone; unset `review.reviewers` and run init to pick again.
505
+ `slopcop init --no-reviewers` skips probing. A reviewer that cannot start does
506
+ not stop the others. One that ends without a verdict runs once more in a fresh
507
+ session; if it still fails, the next unused fallback stands in for it,
508
+ preferring another provider. The review is clean when at least
509
+ `review.minCompleted` reviewers (default 2, at most the number of reviewers)
510
+ finished clean, and fails with exit `2` when fewer did. Findings from any
511
+ reviewer count. The minimum only tolerates a failure when more reviewers can
512
+ run than it requires, so configure fallbacks on another provider than the
513
+ reviewers: one outage or empty account then cannot fail every check. Set the
514
+ ordered list (1–4
455
515
  entries; duplicates allowed) with `slopcop config set review.reviewers terra,sol`.
456
- Set `review.timeout` (default `20m`) or `mode` with `slopcop config set`;
516
+ Set `review.fallbacks` (ordered, like `review.reviewers`), `review.timeout`
517
+ (default `20m`), `review.minCompleted` (1 up to the number of reviewers) or
518
+ `mode` with `slopcop config set`;
457
519
  adapter commands are under `review.adapters.<codex|dsh|claude>.command`.
458
520
  The prompt carries the captured diff. Reviewers read repository content,
459
521
  which is untrusted. Claude and DeepSeek reviewers may only read and search
@@ -481,6 +543,27 @@ files, deletions, renames, mode changes, and binary content. Git-ignored files
481
543
  stay out, except selected `.slopcop/policies` rules, which must travel because
482
544
  the service evaluates them from the patched checkout.
483
545
 
546
+ By default, changed JSON data (`.json`, `.jsonl`, `.ndjson`, case-insensitive)
547
+ and Git-detected binary files are omitted when either the base or captured
548
+ version exceeds **500,000 bytes (0.5 MB)**. Source files and smaller JSON
549
+ configurations remain in scope. The filter runs before generating the upload
550
+ or local review diff, covers deletions and both sides of renames, and never
551
+ changes your files or index. Every report discloses omitted files: human output
552
+ names each path with its size and reason, JSON carries `omittedFiles`, and SARIF
553
+ carries `slopcop.omittedFiles`. Their contents were not analyzed; a passing
554
+ result covers the retained scope. If every change is omitted, the check is
555
+ `skipped`, sends nothing, and records no push approval.
556
+
557
+ Use repeatable `--include` paths or globs to opt particular data files back in:
558
+
559
+ ```console
560
+ slopcop check --include config/settings.json --include 'models/**/*.json'
561
+ ```
562
+
563
+ Patterns are relative to the repository root; quote globs so the shell does
564
+ not expand them. They only override the size filter and do not exclude other
565
+ changed source files. Service payload limits still apply to the resulting patch.
566
+
484
567
  A check run by a Claude Code, Codex or OpenCode agent also sends which models wrote the
485
568
  change, so the service can tie each finding to the model that wrote its file.
486
569
  The CLI finds the agent's session from its environment and reads that
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.16",
3
+ "version": "0.0.18",
4
4
  "description": "Static analysis for coding agents and CI: check a change through the hosted SlopCop API",
5
5
  "keywords": [
6
6
  "agents",