agent-roast 0.7.0 → 0.8.0
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 +87 -7
- package/dist/{chunk-YGHNTWHX.js → chunk-C423TSZF.js} +994 -607
- package/dist/cli.js +56 -31
- package/dist/index.d.ts +45 -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.0: `npx agent-roast@0.8.0 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.0 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,
|
|
@@ -248,8 +307,10 @@ Configurations generated by older versions may contain unsupported rules such as
|
|
|
248
307
|
`hallucinated-package`, `empty-catch` or `mock-leak`; remove these entries and use
|
|
249
308
|
`swallowed-error` for empty catches.
|
|
250
309
|
|
|
251
|
-
Exit codes: `0` passed, `1` blocking findings/score threshold, `2` invalid
|
|
252
|
-
|
|
310
|
+
Exit codes: `0` passed, `1` blocking findings/score threshold, `2` invalid configuration,
|
|
311
|
+
Git refs or an incomplete scan. Since 0.8.0, legacy/history CLI audits also return 2
|
|
312
|
+
when lines were skipped or supported source was marked binary by Git attributes,
|
|
313
|
+
instead of treating missing coverage as a clean result. `--format json` also works for history audits. A history
|
|
253
314
|
sample below 200 added lines has no score, but its findings are still shown.
|
|
254
315
|
|
|
255
316
|
### GitHub Actions Integration
|
|
@@ -279,6 +340,10 @@ jobs:
|
|
|
279
340
|
format: github
|
|
280
341
|
```
|
|
281
342
|
|
|
343
|
+
To pilot the Action without blocking on findings, set `advisory: true`. It passes
|
|
344
|
+
an explicit empty fail-on list; invalid configuration, Git errors and incomplete
|
|
345
|
+
scans still fail. The `v1` Action installs 0.8.0. The CLI equivalent is `--fail-on ''`.
|
|
346
|
+
|
|
282
347
|
> **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
348
|
|
|
284
349
|
---
|
|
@@ -323,15 +388,30 @@ noise; these are heuristic checks and can have false positives and missed findin
|
|
|
323
388
|
Use this as a focused review aid for skipped tests, compiler suppressions and obvious
|
|
324
389
|
stubs, alongside a compiler, test runner and language-aware linter. Findings identify
|
|
325
390
|
patterns, not proof of AI authorship or developer intent. Deliberate skips and abstract
|
|
326
|
-
methods can be legitimate.
|
|
327
|
-
|
|
391
|
+
methods can be legitimate. Since 0.8.0, the analyzer improves language-specific checks, multiline skips/assertions,
|
|
392
|
+
Rust raw strings/lifetimes and Java/Kotlin text blocks. Contiguous comments, Python
|
|
393
|
+
docstrings and multiline empty handlers are recognized. Template interpolation, complex language syntax and context outside
|
|
328
394
|
the added diff in legacy audit modes are not fully parsed. Custom test API aliases,
|
|
329
395
|
computed property calls and type/import resolution are not handled. Panic loops are an observational history heuristic.
|
|
330
396
|
The discipline score summarizes added history; it does not certify current code quality.
|
|
331
397
|
`check` reports actionable findings without assigning a personality or quality score.
|
|
398
|
+
History attribution is based on explicit text/identity heuristics; it does not prove
|
|
399
|
+
AI authorship. Since 0.8.0, the analyzer avoids classifying ordinary people by name fragments
|
|
400
|
+
or treating every automation bot as an AI author. Use `--all` for all commits.
|
|
401
|
+
|
|
402
|
+
The website demos are synthetic illustrations, labeled as such. Older GIF/video
|
|
403
|
+
assets are legacy demonstrations, not performance measurements or adoption evidence.
|
|
404
|
+
See [related tools and design choices](docs/product/related-tools.md) for approaches
|
|
405
|
+
reviewed in Semgrep, Ruff, Gitleaks, reviewdog and eslint-plugin-jest. No third-party
|
|
406
|
+
implementation was copied.
|
|
332
407
|
|
|
333
408
|
### Development
|
|
334
409
|
|
|
410
|
+
Develop/build/test with Node.js 20.19+ (or 22.12+). The distributed CLI still supports
|
|
411
|
+
Node.js 18+. Patched Vitest 4 and build tooling are development dependencies only;
|
|
412
|
+
CI runs the current test runner on Node 22 while CLI subprocesses and actual Git hooks
|
|
413
|
+
are exercised on Node 18/20/22 using `AGENT_ROAST_TEST_NODE`.
|
|
414
|
+
|
|
335
415
|
```bash
|
|
336
416
|
npm ci
|
|
337
417
|
npm run typecheck
|
|
@@ -342,7 +422,7 @@ npm test
|
|
|
342
422
|
against current code. Regression tests use disposable Git repositories. The programmatic
|
|
343
423
|
`auditPullRequest({ staged: true })` API retains the legacy added-lines contract;
|
|
344
424
|
use `reviewStagedChanges()` for the new context comparison and `ReviewResult`.
|
|
345
|
-
The composite Action installs exactly 0.
|
|
425
|
+
The composite Action installs exactly 0.8.0. For local development, use
|
|
346
426
|
`node dist/cli.js --staged` after building.
|
|
347
427
|
|
|
348
428
|
### Author & Support
|