@brokkai/slopcop 0.0.17 → 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"`,
@@ -459,24 +462,60 @@ similarity, pass `--policy-id slopcop.similarity`.
459
462
  For this check, function source from the change is sent to third-party
460
463
  embedding and model providers used by the hosted service.
461
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
+
462
489
  ### Modes and local review
463
490
 
464
491
  `slopcop check` runs hosted static analysis and local LLM review concurrently
465
492
  by default. Use `--mode static` or `--static` for only the hosted check; use
466
493
  `--mode ai` or `--ai` for only local review. A single captured snapshot
467
494
  includes committed, uncommitted, and untracked work, except ignored files.
468
- 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.
469
497
 
470
498
  Reviewers, in priority order, are GPT Terra (`terra`) and GPT Sol (`sol`) through
471
499
  Codex ACP, DeepSeek Flash (`flash`) through dsh ACP, and Claude Haiku (`haiku`)
472
500
  through Claude ACP. Each uses the newest model of its family at high effort.
473
501
  `slopcop init` probes each family once when reviewers are not configured and
474
- mode is not static, then saves the first two that work (or one). Configured
475
- reviewers are left alone; unset `review.reviewers` and run init to pick again.
476
- `slopcop init --no-reviewers` skips probing. A check runs exactly the configured
477
- 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
478
515
  entries; duplicates allowed) with `slopcop config set review.reviewers terra,sol`.
479
- 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`;
480
519
  adapter commands are under `review.adapters.<codex|dsh|claude>.command`.
481
520
  The prompt carries the captured diff. Reviewers read repository content,
482
521
  which is untrusted. Claude and DeepSeek reviewers may only read and search
@@ -504,6 +543,27 @@ files, deletions, renames, mode changes, and binary content. Git-ignored files
504
543
  stay out, except selected `.slopcop/policies` rules, which must travel because
505
544
  the service evaluates them from the patched checkout.
506
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
+
507
567
  A check run by a Claude Code, Codex or OpenCode agent also sends which models wrote the
508
568
  change, so the service can tie each finding to the model that wrote its file.
509
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.17",
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",