agent-roast 0.7.0 → 0.8.1
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 +100 -7
- package/dist/{chunk-YGHNTWHX.js → chunk-U7OCVA3D.js} +1061 -648
- package/dist/cli.js +56 -31
- package/dist/index.d.ts +47 -4
- package/dist/index.js +11 -1
- package/package.json +8 -3
- package/schema.json +138 -0
package/README.md
CHANGED
|
@@ -106,9 +106,65 @@ regressions) may appear in the report/summary rather than as an inline PR annota
|
|
|
106
106
|
Use a separate SARIF category for introduced-findings review; it does not represent
|
|
107
107
|
a full scan of all outstanding alerts.
|
|
108
108
|
|
|
109
|
-
Install 0.
|
|
109
|
+
Install 0.8.1: `npx agent-roast@0.8.1 review --base origin/main`. For local development,
|
|
110
110
|
run `npm run build` and use `node dist/cli.js`.
|
|
111
111
|
|
|
112
|
+
### Precise exceptions (since 0.8.0)
|
|
113
|
+
|
|
114
|
+
Use `npx agent-roast@0.8.1 check --format json`, or build this checkout with
|
|
115
|
+
`npm run build` and run `node dist/cli.js`.
|
|
116
|
+
|
|
117
|
+
Some skipped integrations or abstract stubs are intentional. In 0.8.0 you can accept
|
|
118
|
+
one exact finding without switching off the rule or ignoring its whole file:
|
|
119
|
+
|
|
120
|
+
1. Run `node dist/cli.js check --format json` and inspect the evidence. Findings
|
|
121
|
+
include a stable `fingerprint` (rule, relative filename and trimmed source snippet).
|
|
122
|
+
2. Add a reviewed `exceptions` entry to the root `.agentroastrc.json`, with the
|
|
123
|
+
fingerprint, the **total** allowed occurrence count, a reason and an expiry date.
|
|
124
|
+
3. Run the check again. Accepted findings remain visible with their reason/date;
|
|
125
|
+
additional duplicate occurrences still block. Expired exceptions stop applying.
|
|
126
|
+
Use a full `check` to revisit old findings; `review` continues gating newly
|
|
127
|
+
introduced debt, so expiration does not turn unchanged old debt into a new finding.
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"exceptions": [
|
|
132
|
+
{
|
|
133
|
+
"fingerprint": "f4d1212234f00381d0eaed359e3229fe4ff47388affc9eac0d0d89daffea13d6",
|
|
134
|
+
"count": 1,
|
|
135
|
+
"reason": "Integration sandbox unavailable; restore under ENG-42",
|
|
136
|
+
"expires": "2026-11-15"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The example fingerprint is for `it.skip('temporary');` in `auth.test.ts`; copy the
|
|
143
|
+
fingerprint from **your** report. Expiry includes the specified day in UTC. Changing
|
|
144
|
+
the rule, path or source snippet requires review again. Counts from an exception and
|
|
145
|
+
baseline do not add together to accept extra identical occurrences.
|
|
146
|
+
|
|
147
|
+
For committed/staged context reviews the allowance must already exist in the trusted
|
|
148
|
+
base/HEAD policy. A candidate PR or unstaged config cannot approve itself; first
|
|
149
|
+
commits use built-in defaults. `check` intentionally reads the current root policy.
|
|
150
|
+
Use `--ignore-exceptions` with `check`, `review` or `--staged` to inspect accepted
|
|
151
|
+
findings again. This flag does not disable a separately supplied baseline.
|
|
152
|
+
Exceptions apply to these context/current-source workflows; historical and legacy
|
|
153
|
+
added-line audits do not apply them. A full scan can use baseline adoption for old
|
|
154
|
+
debt, while exceptions record temporary reviewed decisions about particular findings.
|
|
155
|
+
|
|
156
|
+
JSON/Markdown/terminal reports separate accepted exceptions from actionable findings.
|
|
157
|
+
SARIF retains accepted records with `suppressions` and their justification/expiry;
|
|
158
|
+
JSON and SARIF include stable occurrence identities. SARIF omits code snippets but
|
|
159
|
+
includes exception reasons, so review those before sharing reports.
|
|
160
|
+
|
|
161
|
+
An offline editor schema is included as `schema.json` in the npm package. When using
|
|
162
|
+
a local dev dependency, set `$schema` to `./node_modules/agent-roast/schema.json`.
|
|
163
|
+
Ignore policies are bounded to 1,000 patterns of at most 1,024 characters each.
|
|
164
|
+
Unknown settings, invalid severities and malformed exceptions fail with exit 2.
|
|
165
|
+
Root policy must be a regular UTF-8 file no larger than 64 KiB. Simple ignore globs
|
|
166
|
+
support `*`, `?`, `**` and directory prefixes; they are not full `.gitignore` syntax.
|
|
167
|
+
|
|
112
168
|
### Baseline adoption
|
|
113
169
|
|
|
114
170
|
A baseline explicitly accepts the findings present at adoption time. It does not fix
|
|
@@ -205,7 +261,10 @@ Since 0.7.0, `--staged` (also `review --staged`) compares the **full source**
|
|
|
205
261
|
of changed files in HEAD and the Git index. It detects deletion-only empty handlers
|
|
206
262
|
and retains comment context. Existing findings do not block; additional occurrences
|
|
207
263
|
do. Unstaged edits, untracked files and `git add -N` intent-to-add entries are excluded.
|
|
208
|
-
The
|
|
264
|
+
The older 0.6.0 `--staged` command checks only added index lines. Since
|
|
265
|
+
0.8.0, it also reads Git's temporary candidate index during real `commit -a` / `--only`
|
|
266
|
+
hooks. An alternate `GIT_INDEX_FILE` outside this checkout's Git metadata is refused
|
|
267
|
+
with exit 2; it cannot silently redirect the check to a different commit.
|
|
209
268
|
|
|
210
269
|
Policy comes from HEAD. Staged/unstaged config edits cannot weaken this check and
|
|
211
270
|
are reported; adopt policy changes in a separately reviewed commit. With no HEAD,
|
|
@@ -219,6 +278,11 @@ The JSON schema version for context reviews is now `1.1.0`.
|
|
|
219
278
|
The generated hook uses the locally installed CLI (`--no-install`) and blocks on configured error rules instead of scoring
|
|
220
279
|
old commits. It preserves an existing pre-commit hook.
|
|
221
280
|
|
|
281
|
+
`init` resolves the repository root even when run from a package/subdirectory, so
|
|
282
|
+
its policy is used by `check` and its workflow can be discovered by GitHub. Outside
|
|
283
|
+
a Git repository, initialization uses the supplied directory. Its output shows the
|
|
284
|
+
actual destination and existing policy/hooks are preserved.
|
|
285
|
+
|
|
222
286
|
### Configure what blocks a change
|
|
223
287
|
|
|
224
288
|
Create `.agentroastrc.json` (or run `npx agent-roast init`):
|
|
@@ -248,8 +312,10 @@ Configurations generated by older versions may contain unsupported rules such as
|
|
|
248
312
|
`hallucinated-package`, `empty-catch` or `mock-leak`; remove these entries and use
|
|
249
313
|
`swallowed-error` for empty catches.
|
|
250
314
|
|
|
251
|
-
Exit codes: `0` passed, `1` blocking findings/score threshold, `2` invalid
|
|
252
|
-
|
|
315
|
+
Exit codes: `0` passed, `1` blocking findings/score threshold, `2` invalid configuration,
|
|
316
|
+
Git refs or an incomplete scan. Since 0.8.0, legacy/history CLI audits also return 2
|
|
317
|
+
when lines were skipped or supported source was marked binary by Git attributes,
|
|
318
|
+
instead of treating missing coverage as a clean result. `--format json` also works for history audits. A history
|
|
253
319
|
sample below 200 added lines has no score, but its findings are still shown.
|
|
254
320
|
|
|
255
321
|
### GitHub Actions Integration
|
|
@@ -279,6 +345,10 @@ jobs:
|
|
|
279
345
|
format: github
|
|
280
346
|
```
|
|
281
347
|
|
|
348
|
+
To pilot the Action without blocking on findings, set `advisory: true`. It passes
|
|
349
|
+
an explicit empty fail-on list; invalid configuration, Git errors and incomplete
|
|
350
|
+
scans still fail. The `v1` Action installs 0.8.1. The CLI equivalent is `--fail-on ''`.
|
|
351
|
+
|
|
282
352
|
> **Security Note:** `agent-roast` runs in an isolated runner directory (`$RUNNER_TEMP`) with `--ignore-scripts` to neutralize malicious `.npmrc` files in untrusted pull requests. `pull_request_target` is not supported.
|
|
283
353
|
|
|
284
354
|
---
|
|
@@ -323,26 +393,49 @@ noise; these are heuristic checks and can have false positives and missed findin
|
|
|
323
393
|
Use this as a focused review aid for skipped tests, compiler suppressions and obvious
|
|
324
394
|
stubs, alongside a compiler, test runner and language-aware linter. Findings identify
|
|
325
395
|
patterns, not proof of AI authorship or developer intent. Deliberate skips and abstract
|
|
326
|
-
methods can be legitimate.
|
|
327
|
-
|
|
396
|
+
methods can be legitimate. Since 0.8.0, the analyzer improves language-specific checks, multiline skips/assertions,
|
|
397
|
+
Rust raw strings/lifetimes and Java/Kotlin text blocks. Contiguous comments, Python
|
|
398
|
+
docstrings and multiline empty handlers are recognized. Template interpolation, complex language syntax and context outside
|
|
328
399
|
the added diff in legacy audit modes are not fully parsed. Custom test API aliases,
|
|
329
400
|
computed property calls and type/import resolution are not handled. Panic loops are an observational history heuristic.
|
|
401
|
+
Test registration options such as Node's `test('name', { skip: true }, fn)` and
|
|
402
|
+
`{ only: true }` are currently not inspected; use explicit `.skip`/`.only` APIs and
|
|
403
|
+
the runner's CI safeguards. Regexp masking is contextual, not a full JavaScript
|
|
404
|
+
parser. Formatting across contiguous lines is supported for casts, empty catches
|
|
405
|
+
and placeholder errors, but legacy added-line audits cannot recover missing hunks.
|
|
330
406
|
The discipline score summarizes added history; it does not certify current code quality.
|
|
331
407
|
`check` reports actionable findings without assigning a personality or quality score.
|
|
408
|
+
History attribution is based on explicit text/identity heuristics; it does not prove
|
|
409
|
+
AI authorship. Since 0.8.0, the analyzer avoids classifying ordinary people by name fragments
|
|
410
|
+
or treating every automation bot as an AI author. Use `--all` for all commits.
|
|
411
|
+
|
|
412
|
+
The website demos are synthetic illustrations, labeled as such. Older GIF/video
|
|
413
|
+
assets are legacy demonstrations, not performance measurements or adoption evidence.
|
|
414
|
+
See [related tools and design choices](docs/product/related-tools.md) for approaches
|
|
415
|
+
reviewed in Semgrep, Ruff, Gitleaks, reviewdog and eslint-plugin-jest. No third-party
|
|
416
|
+
implementation was copied.
|
|
332
417
|
|
|
333
418
|
### Development
|
|
334
419
|
|
|
420
|
+
Develop/build/test with Node.js 20.19+ (or 22.12+). The distributed CLI still supports
|
|
421
|
+
Node.js 18+. Patched Vitest 4 and build tooling are development dependencies only;
|
|
422
|
+
CI runs the current test runner on Node 22 while CLI subprocesses and actual Git hooks
|
|
423
|
+
are exercised on Node 18/20/22 using `AGENT_ROAST_TEST_NODE`.
|
|
424
|
+
|
|
335
425
|
```bash
|
|
336
426
|
npm ci
|
|
337
427
|
npm run typecheck
|
|
338
428
|
npm test
|
|
429
|
+
|
|
430
|
+
# Optional end-to-end CLI checks in disposable Git repositories
|
|
431
|
+
node scripts/verify-user-workflows.mjs dist/cli.js
|
|
339
432
|
```
|
|
340
433
|
|
|
341
434
|
`npm test` builds the distribution first so CLI integration and bundle checks run
|
|
342
435
|
against current code. Regression tests use disposable Git repositories. The programmatic
|
|
343
436
|
`auditPullRequest({ staged: true })` API retains the legacy added-lines contract;
|
|
344
437
|
use `reviewStagedChanges()` for the new context comparison and `ReviewResult`.
|
|
345
|
-
The composite Action installs exactly 0.
|
|
438
|
+
The composite Action installs exactly 0.8.1. For local development, use
|
|
346
439
|
`node dist/cli.js --staged` after building.
|
|
347
440
|
|
|
348
441
|
### Author & Support
|