@blundergoat/gruff-ts 0.5.0 → 0.6.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/CHANGELOG.md +82 -0
- package/CONTRIBUTING.md +32 -25
- package/README.md +49 -50
- package/SECURITY.md +18 -31
- package/UPGRADING.md +101 -0
- package/bin/gruff-ts +3 -0
- package/docs/README.md +11 -10
- package/docs/agent-hook.md +32 -35
- package/docs/ci-integration.md +38 -24
- package/docs/configuration.md +160 -89
- package/docs/dashboard.md +12 -13
- package/docs/output-formats.md +100 -25
- package/docs/philosophy.md +2 -2
- package/docs/reports-and-ci.md +14 -172
- package/docs/rules.md +126 -98
- package/package.json +10 -8
- package/src/analyser.ts +817 -323
- package/src/baseline-file.ts +867 -0
- package/src/baseline-identity.ts +463 -0
- package/src/baseline-options.ts +139 -34
- package/src/baseline.ts +62 -68
- package/src/blocks.ts +512 -336
- package/src/changed-regions.ts +380 -79
- package/src/check-ignore.ts +28 -13
- package/src/class-rules.ts +445 -436
- package/src/cli-program.ts +915 -172
- package/src/cli.ts +9 -3
- package/src/comment-rules.ts +236 -418
- package/src/comment-scanner.ts +339 -47
- package/src/complexity-metrics.ts +111 -35
- package/src/config-load-error.ts +17 -8
- package/src/config-parse.ts +291 -98
- package/src/config-preservation.ts +81 -26
- package/src/config.ts +751 -223
- package/src/constants.ts +7 -6
- package/src/context-doc-rules.ts +182 -54
- package/src/dashboard.ts +88 -23
- package/src/dead-code-rules.ts +153 -74
- package/src/discovery.ts +493 -140
- package/src/doc-rules.ts +602 -126
- package/src/duplicate-test-group-rules.ts +359 -0
- package/src/findings-helpers.ts +134 -109
- package/src/findings.ts +47 -27
- package/src/fixture-purpose-rules.ts +194 -50
- package/src/github-actions-event-guards.ts +331 -0
- package/src/github-actions-rules.ts +328 -121
- package/src/hook-contract.ts +681 -255
- package/src/init-config.ts +163 -118
- package/src/inline-suppressions.ts +340 -0
- package/src/limit-band.ts +56 -0
- package/src/line-rules.ts +331 -468
- package/src/migrate-config.ts +670 -0
- package/src/naming-pushers.ts +32 -127
- package/src/parsed-script.ts +868 -314
- package/src/pillar-summary.ts +56 -40
- package/src/profiles.ts +86 -74
- package/src/project-config-rules.ts +324 -140
- package/src/project-rules.ts +237 -115
- package/src/public-exports.ts +102 -38
- package/src/report-html.ts +217 -85
- package/src/report-renderers.ts +821 -203
- package/src/rule-list.ts +166 -46
- package/src/rules.ts +100 -104
- package/src/safety-rules.ts +191 -132
- package/src/scoring.ts +249 -55
- package/src/security-flow-rules.ts +791 -115
- package/src/selectors.ts +169 -0
- package/src/sensitive-data-rules.ts +460 -387
- package/src/sensitive-exclusions.ts +435 -0
- package/src/source-text.ts +378 -104
- package/src/static-analysis-redundant-rules.ts +298 -41
- package/src/test-block-rules.ts +343 -253
- package/src/text-scans.ts +62 -11
- package/src/types.ts +220 -71
- package/tsconfig.json +2 -1
- package/src/process-exec-metadata.ts +0 -163
- package/src/test-fixtures.ts +0 -671
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,87 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.6.0 - 2026-11-29
|
|
4
|
+
|
|
5
|
+
A coordinated family release on Node 22.12+: all five gruff ports share JSON, SARIF, baseline, hook, and scoring contracts, the catalogue drops from 120 to 81 rules across 11 pillars, and 10,000+ file monorepos scan within the default heap. Every machine-readable contract changes; [UPGRADING.md](UPGRADING.md) has the migration and rollback steps.
|
|
6
|
+
|
|
7
|
+
### Breaking changes
|
|
8
|
+
|
|
9
|
+
- **BREAKING: Node.js 22.12 or newer is required** - The argument parser moves to Commander 15, which needs it; update within the 22 line or move to 24 or 26.
|
|
10
|
+
- **BREAKING: JSON moves to family v3 and `hook` to `gruff.hook.v2`, with no deprecation window** - `analyse` and `report --format=json` emit `gruff.analysis.v3`; `summary --format=json` emits `gruff.summary.v3`, the same envelope without `findings`, so `--top` affects text only.
|
|
11
|
+
- Gate on `schemaVersion`; read `file` (not `filePath`), `score.composite.{score,grade}`, and `paths.details` (not `paths.skipped`); absent `column`, `endLine`, and `symbol` are omitted, not `null`. Field table: [Output Formats](docs/output-formats.md).
|
|
12
|
+
- `hook` adds `run` and `suppressions` and exits `0` (passed), `1` (a requested `--fail-on`, `--fail-on-new`, or `--fail-on-diagnostics` gate tripped; `--fail-on-diagnostics` used to exit `2`), or `2` (fatal error).
|
|
13
|
+
- **BREAKING: baselines move to `gruff.baseline.v3`, and secrets cannot be baselined** - Rows store a line-free SHA-256 identity and an accepted count, so moved code keeps its review and same-named declarations stay distinct.
|
|
14
|
+
- SARIF `partialFingerprints.gruffFingerprint` uses the same identity, so code-scanning alerts close and reopen once.
|
|
15
|
+
- Sensitive-data findings get no baseline row and no `partialFingerprints`; suppress reviewed samples with `sensitiveExclusions:`.
|
|
16
|
+
- `0.5` baselines exit `2`; migrate them with `gruff-ts analyse --migrate-baseline <old> --generate-baseline <new>`.
|
|
17
|
+
- **BREAKING: 40 low-precision rules and 7 allowlist keys are removed (ADR-021)** - Each was right less than half the time in the 0.6.0 precision measurement:
|
|
18
|
+
- Complexity and design: `complexity.cognitive`, `design.deep-relative-import`.
|
|
19
|
+
- Documentation: `docs.magic-threshold-without-rationale`, `docs.stale-comment`, `docs.useless-docblock`.
|
|
20
|
+
- Modernisation: `modernisation.loose-equality`, `modernisation.nullish-coalescing-candidate`, `modernisation.object-spread-candidate`, `modernisation.optional-chaining-candidate`, `modernisation.public-property`.
|
|
21
|
+
- Naming: `naming.acronym-case`, `naming.boolean-prefix`, `naming.generic-function`, `naming.generic-parameter`, `naming.hungarian-notation`, `naming.inconsistent-casing`, `naming.negative-boolean`.
|
|
22
|
+
- Security and sensitive data: `security.floating-promise`, `security.github-actions-broad-permissions`, `security.insecure-random`, `security.process-exec`, `security.proto-access`, `security.risky-lifecycle-script`, `sensitive-data.hardcoded-env-value`, `sensitive-data.high-entropy-string`.
|
|
23
|
+
- Test quality: `test-quality.conditional-logic`, `test-quality.exception-type-only`, `test-quality.magic-number-assertion`, `test-quality.mock-only-test`, `test-quality.no-assertions`, `test-quality.no-throw-only-test`, `test-quality.only-skip`, `test-quality.sleep-in-test`, `test-quality.snapshot-only-test`.
|
|
24
|
+
- Maintainability (`waste.*`): `waste.commented-out-code`, `waste.console-log`, `waste.empty-function`, `waste.redundant-boolean-cast`, `waste.redundant-variable`, `waste.unused-parameter`.
|
|
25
|
+
- Allowlist keys: `acceptedBooleanNames`, `acceptedCasingPairs`, `bannedGenericNames`, `booleanPrefixes`, `hungarianPrefixes`, `knownAcronyms`, `negativeBooleanAllowed`.
|
|
26
|
+
- A config, `sensitiveExclusions:` entry, `--include-rule`/`--exclude-rule`, or `--show-rule`/`--hide-rule` naming a retired ID exits `2`; `gruff-ts migrate-config --config <old> --output <new>` prunes them and keeps surviving overrides.
|
|
27
|
+
- Baseline rows for retired rules load and report as resolved; `docs.missing-why-for-complex-code` keeps a fixed cognitive-complexity trigger of 15; ESLint `no-console`, `eqeqeq`, and `no-unused-vars` comments no longer suppress anything.
|
|
28
|
+
- **BREAKING: 12 rules are off by default (ADR-021)** - Turn one back on with `rules.<id>.enabled: true`:
|
|
29
|
+
- `complexity.cyclomatic`, `docs.missing-invariant-doc`, `docs.missing-side-effect-doc`, `security.inner-html`, `security.open-redirect-candidate`, `security.path-traversal-candidate`, `security.unsafe-deserialization`, `sensitive-data.aws-access-key`, `sensitive-data.database-url-password`, `sensitive-data.jwt-token`, `waste.swallowed-catch`, `waste.useless-return`.
|
|
30
|
+
- Configs from earlier `init` runs already set `enabled: true`; `gruff.strict` no longer enables or tightens `complexity.cyclomatic`; narrowing `--include-rule` to disabled rules exits `2`.
|
|
31
|
+
- **BREAKING: `sensitive-data.*` rules default to `warning`** - All 8 move down from `error`, so `--fail-on=error` no longer fails on secrets; use `--fail-on=warning` or set `severity: error` per rule.
|
|
32
|
+
- **BREAKING: exit gates move from `minimumSeverity:` to `failOn:`** - `minimumSeverity:` is now one display floor (`advisory`, `warning`, or `error`) that changes neither scores nor exit codes; a `0.5` per-command map under it exits `2` until `gruff-ts migrate-config` converts it.
|
|
33
|
+
- **BREAKING: `allowlists.secretPreviews` is removed and unknown rule keys exit `2`** - Secret reports always use fixed category markers, and a `rules.<id>` key other than `enabled`, `severity`, `threshold`, or `options` fails config loading.
|
|
34
|
+
- **BREAKING: scores are normalised and confidence-weighted** - Pillar scores scale by evaluated script count, so duplicating a project keeps its grade.
|
|
35
|
+
- Each pillar scores `floor + (100 - floor) / (1 + density / densityScale)` (`floor = 50`, `densityScale = 0.1`); error weight rises from `8` to `12`, advisory drops from `1.5` to `1`, and findings weigh by confidence (`0.5` low, `0.75` medium, `1.0` high).
|
|
36
|
+
- Seven rules change confidence: `docs.missing-why-for-complex-code`, `docs.suppression-without-rationale`, and `naming.identifier-quality` (medium to low); `docs.todo-without-tracking`, `size.parameter-count`, and `waste.any-type` (high to medium); `security.sql-concatenation` (high to low). Findings now always take catalogue confidence, so `docs.missing-exported-function-doc` and `docs.missing-internal-function-doc` emit at medium and `size.function-length` at high.
|
|
37
|
+
- `score.pillars[]` lists every rule-backed pillar with `applicable` and `grade`; with zero scripts evaluated, `score.composite.{score,grade}` is `null` (`Composite: n/a (nothing evaluated)`).
|
|
38
|
+
- **BREAKING: JSDoc tag rules cover every non-test callable** - `docs.missing-param-tag` and `docs.missing-return-tag` turn on `everyCallable`; set `everyCallable: false` on both to restore export-only scope.
|
|
39
|
+
- Test files are skipped and fixture directories are not; only `/** ... */` blocks with described tags count, not `//` or `/* */`; `docs.missing-return-tag` wants a described `@returns` even for `void`, `Promise<void>`, `asserts`, `never`, and `undefined`, but not for constructors or setters.
|
|
40
|
+
- Undocumented public methods of exported classes report as `docs.missing-exported-function-doc` (`warning`); private functions stay `docs.missing-internal-function-doc` (`advisory`).
|
|
41
|
+
- **BREAKING: `summary` defaults to `--fail-on none`** - It exits `0` unless `--fail-on` or `failOn.summary` is set.
|
|
42
|
+
- **BREAKING: `report --no-baseline` is removed** - `report` never applied baselines, so the flag now exits `2` as an unknown option.
|
|
43
|
+
- **BREAKING: bad `--changed-ranges` and `--baseline` inputs exit `2`** - An empty or malformed `--changed-ranges` gives one fatal `changed-region` diagnostic and no findings; a missing, malformed, or `0.5` `--baseline` gives one fatal `baseline-error` diagnostic and still shows findings.
|
|
44
|
+
- **BREAKING: `list-rules --format=json` uses the family rule record** - Rules carry `id` (was `ruleId`), `defaultSeverity` (was `severity`), and a `thresholds` map (was scalar `threshold`), and `list-rules <id> --format=json` nests one under `rule`; findings keep `ruleId`.
|
|
45
|
+
- **BREAKING: default discovery follows the family fallback policy** - `vendor`, `vendors`, `third_party`, `third-party`, `bower_components`, `dist` (any depth and case), and `*.min.*` are skipped even under a `.gitignore`, with reasons in `paths.details`; `--include-ignored` or naming the file still scans them.
|
|
46
|
+
- Other non-VCS fallbacks defer to any governing `.gitignore` and match at any depth, and `cache`, `generated`, `target`, and `tmp` are no longer skipped by default, so add them to `paths.ignore` when Git does not ignore them.
|
|
47
|
+
- Committed control folders stay scannable, explicit file arguments bypass Git and fallback exclusions, and VCS internals stay blocked even under `--include-ignored`.
|
|
48
|
+
- **BREAKING: custom tracking tokens move to `allowlists.trackingTokens`** - References such as ADR IDs or task paths no longer count automatically; list regexes there for `docs.todo-without-tracking`, `modernisation.ts-comment-without-rationale`, and `waste.swallowed-catch`.
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
|
|
52
|
+
- **`gruff-ts migrate-config`** - Converts a `0.5` config into a separate file: renames per-command `minimumSeverity:` to `failOn:`, prunes retired rules, allowlist keys, `allowlists.secretPreviews`, and retired `sensitiveExclusions:`, logs each change, and checks the result loads before writing it.
|
|
53
|
+
- **`analyse --migrate-baseline <old> --generate-baseline <new>`** - Carries reviews from a `0.5` baseline into `gruff.baseline.v3` and leaves the original alone; it refuses to write over its input or read an ambiguous multi-container file, and overwriting a non-v3 `gruff-baseline.json` needs `--force`.
|
|
54
|
+
- **`sensitiveExclusions:` config section** - Suppresses reviewed sensitive-data findings by exact `rule`, project-relative `path`, optional `symbol`, and required `reason`, counted in `suppressions` and text output without printing the secret; value- or message-matching keys exit `2`.
|
|
55
|
+
- **Rule and pillar selectors** - `--include-rule`, `--exclude-rule`, `--include-pillar`, and `--exclude-pillar` change which rules run and score (not allowed with `--history-file`); `--show-rule`, `--hide-rule`, `--show-pillar`, `--hide-pillar`, and `--min-severity` filter output without changing scores or exit codes.
|
|
56
|
+
- **Confidence, new-debt, diff-base, and deep-scan flags** - `--min-confidence <low|medium|high>` and `--fail-on-new` gate `analyse` and `hook`; `--diff-base <ref>` (or `-` for stdin) names the Git base and overrides `--diff`; `--deep-scan-budget <lines:bytes|off>` changes or turns off deep-scan bounds on `analyse`, `summary`, `report`, `hook`, and `dashboard`.
|
|
57
|
+
- **`test-quality.duplicate-test-body`, on by default** - Flags 3+ tests of 3+ statements in one block with matching normalized bodies and suggests a table-driven test; disable with `rules.test-quality.duplicate-test-body.enabled: false`.
|
|
58
|
+
- **Inline tool suppressions and `eval` deduplication** - ESLint (`no-eval`, `no-new-func`), Biome (`lint/security/noGlobalEval`, `lint/correctness/noUnusedImports`), and zizmor (`ignore[unpinned-uses]`, `ignore[dangerous-triggers]`) comments on or alone directly above the reported line suppress the matching finding, and an `eval` flagged by both `security.eval-call` and `security.unsafe-deserialization` reports once under `security.eval-call`; each removal is counted in `suppressions` (`inline` or `duplicate`) and kept in SARIF.
|
|
59
|
+
- **False-positive guidance** - All 50 medium- and low-confidence rules publish `falsePositiveShapes` in `list-rules <id>` and `list-rules --format=json`; the 31 high-confidence rules do not.
|
|
60
|
+
- **Two-band size and complexity findings** - `size.*` and `complexity.*` findings under 1.5x their threshold report as `advisory` (`metadata.limitBand: "lower"`) and advise not growing the unit; at 1.5x or more they keep their configured severity (`"upper"`) and advise splitting or simplifying.
|
|
61
|
+
- **AWS `ASIA` session keys** - `sensitive-data.aws-access-key` flags temporary `ASIA` keys as well as long-term `AKIA` keys.
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
|
|
65
|
+
- **Large monorepos fit Node's 4 GB heap** - Full scans of `openclaw` (17,296 files) and `vscode` (12,867 files) exit `0` instead of running out of memory.
|
|
66
|
+
- **Security and sensitive-data rules skip test, fixture, and example paths** - Paths under `test`, `tests`, `__tests__`, `spec`, `testdata`, `fixtures`, or `examples` (any case) and test filenames (`*.test.*`, `*.spec.*`, `*_test.go`, `test_*.py`, `*_test.py`, `*Test.php`) are skipped with counted `source: "built-in"` audit rows.
|
|
67
|
+
- **Trade-off:** a real secret or unsafe call committed under those paths is no longer reported.
|
|
68
|
+
- Twenty vendor-documented sample values (AWS example keys, the jwt.io token, Google's reCAPTCHA test site key, 14 test card numbers) and stock local database logins (`postgres:postgres`, `root:root`, `scott:tiger` on loopback or single-label hosts) stay quiet.
|
|
69
|
+
- **Stricter, consolidated documentation checks** - `docs.missing-param-tag` and `docs.stale-param-tag` report every missing or stale parameter in one finding; `docs.missing-exported-function-doc` and `docs.missing-internal-function-doc` list uncovered parameters, return values, or throws; `docs.missing-error-behavior-doc` needs an explicit `@throws`; file overviews and `// ----` dividers no longer count as function docs; and `docs.suppression-without-rationale` and `modernisation.ts-comment-without-rationale` accept a rationale in `//` lines directly above the directive.
|
|
70
|
+
- **Line counts and callable measurements** - `size.file-length` measures JS/TS only; code-line metrics (`size.function-length`, `size.file-length`, `design.large-module-concentration`, context-doc length) skip blank, comment-only, and decorator-only lines; `size.function-length`, `size.parameter-count`, and `complexity.cyclomatic` also measure object-literal `key: function` methods, member-assigned functions, `var` function expressions, and IIFEs; and `complexity.cyclomatic` counts a `switch` as one decision.
|
|
71
|
+
- **Clearer reports and diagnostics** - `analyse` text prints baseline and suppression totals and `summary` prints suppression totals; JSON adds `score.evaluatedFiles`, `score.scoredPillars`, per-file `penalty`, and zeroed baseline movement counts on generate and migrate runs; baseline collisions become non-fatal `baseline-collision` diagnostics instead of hiding findings; 11 line-pattern rules carry remediation text in JSON; and metric remediations stop advising higher thresholds.
|
|
72
|
+
- **Hotspot output carries diagnostics** - `--format=hotspot` adds the same `diagnostics` array as `--format=json`, so a `bounded-deep-scan` notice shows in every format.
|
|
73
|
+
- **Published tarball drops `src/test-fixtures.ts`** - Test fixtures and their synthetic credential strings no longer ship.
|
|
74
|
+
|
|
75
|
+
### Fixed
|
|
76
|
+
|
|
77
|
+
- **TypeScript false positives** - `waste.unused-import` handles inline `type` modifiers and `$` names (`$`, `$state`, `events$`) (14 to 2 findings on goat-flow, 126 to 78 on opencode); `docs.stale-param-tag` accepts destructured and dotted-key `@param` tags on all non-test `everyCallable` targets; `naming.short-variable` allows `t` typed as `TestContext` or in test files; `docs.missing-why-for-complex-code` skips `it`/`test` callbacks and accepts constraint words (`must`, `never`, `only`, `instead`) outside the function name; and `design.package-bin-missing` reports unbuilt `dist/`, `build/`, or `lib/` bins as `advisory` when `package.json` has a `build` script.
|
|
78
|
+
- **Security false positives** - `security.eval-call` and `security.inner-html` skip fixed strings and static templates; `security.javascript-url` skips equality comparisons; `security.weak-crypto` skips `createHmac("sha1", ...)`; `security.unsafe-deserialization` no longer treats Node `fs` reads as tainted; `security.disabled-tls-verification` skips test assertion expectations; `security.github-actions-secrets-in-pr` checks `on:` for `pull_request_target`, skips `secrets.GITHUB_TOKEN`, and honours exact `github.event_name` guards; `security.url-dependency` anchors on the dependency entry, not an `overrides` key; and callback-local `req`/`request`/`ctx` parameters no longer taint enclosing values.
|
|
79
|
+
- **Other false positives** - `modernisation.readonly-property-candidate` reports only `private` fields assigned solely in their own constructor; `sensitive-data.aws-access-key` treats only 16-`X` bodies as masked; `sensitive-data.database-url-password` skips TypeScript template literal types; `docs.missing-side-effect-doc` ignores `RegExp.exec`; `waste.unreachable-code` recognises braced `case`/`default` labels; `waste.swallowed-catch` accepts explained empty catches; and `waste.useless-return` skips a lone `return;` in `catch`.
|
|
80
|
+
- **Test-quality scanning** - `void it(...)` and `void test(...)` callbacks count as tests, and `test-quality.loop-in-test` accepts wrapped per-case messages and loop-derived expected values.
|
|
81
|
+
- **Launch-directory paths and failure envelopes** - Relative targets, `--config`, `--profile`, `--baseline`, `--generate-baseline`, `--migrate-baseline`, and `--history-file` resolve from the launch directory, not the project root; config and baseline errors print paths as typed, not host-absolute; only real config-load errors (not flag conflicts) emit a `config-error` envelope; and `summary --format=json` emits `gruff.summary.v3` on config and target refusals.
|
|
82
|
+
- **Diff refs, nested templates, hook duplicates, and the installed launcher** - `--diff-base` and `--since` pass explicit Git refs through without matching mode keywords such as `staged`; nested `${...}` template literals no longer desynchronise masking; `hook --diff` keeps newly added duplicate findings visible; and the installed `@blundergoat/gruff-ts` binary finds hoisted `tsx` from any working directory.
|
|
83
|
+
- **Staged diffs, unreadable hook inputs, and VCS directories** - `--diff staged` on `analyse` and `hook` keeps findings on staged lines that unstaged edits above have moved and leaves out lines that exist only in the working tree, newly staged files included; `hook` exits `2` with a fatal `read-error` when it cannot read a named input, instead of exiting `0` unscanned; and a target inside `.git`, `.hg`, or `.svn` stays unscanned when named from outside the repository.
|
|
84
|
+
|
|
3
85
|
## v0.5.0 - 2026-08-16
|
|
4
86
|
|
|
5
87
|
120 rules across 11 pillars on Node 22+. Every script rule now reads one shared syntax-only AST parse instead of walking lines, scoring changes shape, config and CLI validation fail instead of coercing, and the release gains gates that fail the build when a documented count or the scan surface drifts from the source.
|
package/CONTRIBUTING.md
CHANGED
|
@@ -18,49 +18,51 @@ npm test
|
|
|
18
18
|
npm run start-dev
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
CI runs the
|
|
22
|
-
`./bin/gruff-ts analyse . --fail-on=advisory`.
|
|
21
|
+
CI runs `npm run check` followed by `./bin/gruff-ts analyse . --fail-on=advisory`. You can run the full local gate (including docs-drift checks and shellcheck) with `bash scripts/preflight-checks.sh`.
|
|
23
22
|
|
|
24
|
-
## Project
|
|
23
|
+
## Project Layout
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
Runtime code lives under `src/`:
|
|
27
26
|
|
|
28
27
|
- `src/cli.ts` - thin bootstrap and public re-export shell.
|
|
29
|
-
- `src/cli-program.ts` - Commander
|
|
28
|
+
- `src/cli-program.ts` - Commander wiring and option normalization.
|
|
30
29
|
- `src/analyser.ts` - scan orchestration and per-file/project rule fanout.
|
|
31
|
-
- `src/discovery.ts` -
|
|
30
|
+
- `src/discovery.ts` - file discovery, `.gitignore`, and ignore classification.
|
|
31
|
+
- `src/parsed-script.ts` - shared syntax-only TypeScript AST helpers.
|
|
32
32
|
- `src/rules.ts` - canonical rule descriptor catalogue.
|
|
33
33
|
- `src/blocks.ts`, `src/line-rules.ts`, `src/class-rules.ts`,
|
|
34
34
|
`src/dead-code-rules.ts`, `src/doc-rules.ts`, `src/comment-rules.ts`,
|
|
35
35
|
`src/context-doc-rules.ts`, `src/fixture-purpose-rules.ts`,
|
|
36
|
-
`src/test-block-rules.ts`, `src/
|
|
37
|
-
`src/
|
|
38
|
-
packs.
|
|
39
|
-
- `src/sensitive-data-rules.ts` - sensitive-data
|
|
40
|
-
detectors.
|
|
41
|
-
- `src/project-config-rules.ts` - package
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
`src/
|
|
45
|
-
`src/
|
|
36
|
+
`src/test-block-rules.ts`, `src/duplicate-test-group-rules.ts`,
|
|
37
|
+
`src/security-flow-rules.ts`, `src/github-actions-rules.ts`, and
|
|
38
|
+
`src/safety-rules.ts` - focused rule packs.
|
|
39
|
+
- `src/sensitive-data-rules.ts` and `src/sensitive-exclusions.ts` - sensitive-data
|
|
40
|
+
detectors, exclusions, and built-in test-path skips.
|
|
41
|
+
- `src/project-config-rules.ts` and `src/project-rules.ts` - package, tsconfig,
|
|
42
|
+
and cross-file architecture rules.
|
|
43
|
+
- `src/baseline.ts`, `src/baseline-identity.ts`, `src/config.ts`,
|
|
44
|
+
`src/migrate-config.ts`, `src/profiles.ts`, `src/inline-suppressions.ts`,
|
|
45
|
+
`src/dashboard.ts`, `src/findings.ts`, `src/rule-list.ts`, `src/scoring.ts`,
|
|
46
|
+
`src/source-text.ts`, `src/text-scans.ts`, `src/report-renderers.ts`,
|
|
47
|
+
`src/constants.ts`, `src/types.ts` - shared helpers, contracts, and renderers.
|
|
46
48
|
- `src/*.test.ts` - Node test runner coverage for scanner behavior, rule
|
|
47
49
|
packs, fixtures, reports, and CLI surfaces.
|
|
48
50
|
|
|
49
51
|
Keep changes small and local. Do not add runtime dependencies beyond
|
|
50
|
-
`commander`, `tsx`, and `typescript` unless
|
|
52
|
+
`commander`, `tsx`, and `typescript` unless explicitly approved first.
|
|
51
53
|
|
|
52
|
-
##
|
|
54
|
+
## Making Rule Changes
|
|
53
55
|
|
|
54
56
|
When adding or changing a rule:
|
|
55
57
|
|
|
56
|
-
- Add or update
|
|
57
|
-
-
|
|
58
|
-
- Preserve the public `Finding` shape
|
|
59
|
-
|
|
58
|
+
- Add or update its `RuleDescriptor` in `src/rules.ts`.
|
|
59
|
+
- Add focused noisy and clean fixtures.
|
|
60
|
+
- Preserve the public `Finding` shape and fingerprint inputs unless a breaking
|
|
61
|
+
schema bump is planned.
|
|
60
62
|
- Add config threshold coverage when the rule has thresholds.
|
|
61
|
-
- Run `npm run check`.
|
|
63
|
+
- Run `npm run check` and `./bin/gruff-ts analyse . --fail-on=advisory`.
|
|
62
64
|
|
|
63
|
-
Every finding
|
|
65
|
+
Every finding needs a stable baseline identity. Baseline matching and SARIF alert grouping both read that identity rather than `fingerprint`.
|
|
64
66
|
|
|
65
67
|
## Documentation Changes
|
|
66
68
|
|
|
@@ -69,8 +71,13 @@ Update docs when behavior changes:
|
|
|
69
71
|
- `README.md` for user-facing workflow changes.
|
|
70
72
|
- `CHANGELOG.md` for release-visible changes.
|
|
71
73
|
- `docs/configuration.md` for config shape or threshold changes.
|
|
72
|
-
- `docs/
|
|
74
|
+
- `docs/output-formats.md` for output-format, schema, or exit-code changes.
|
|
75
|
+
- `docs/ci-integration.md` for CI and baseline changes.
|
|
76
|
+
- `docs/dashboard.md` for dashboard changes.
|
|
77
|
+
- `UPGRADING.md` for a change that breaks an existing project.
|
|
73
78
|
- `docs/releasing.md` for release process changes.
|
|
79
|
+
- `docs/reports-and-ci.md` is a retained compatibility page: point it at the owned pages above
|
|
80
|
+
rather than restating them there.
|
|
74
81
|
|
|
75
82
|
## Pull Request Checklist
|
|
76
83
|
|
package/README.md
CHANGED
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
# gruff-ts
|
|
2
2
|
|
|
3
|
-
`gruff-ts` governs AI-generated code. Wired in as a coding-agent hook, it
|
|
3
|
+
`gruff-ts` governs AI-generated code. Wired in as a coding-agent hook, it pushes an agent to produce changes a human who did not write them can sign off on: readable enough to verify by eye, guarded against unsafe patterns reviewers easily miss, and backed by tests that check real behavior instead of padding coverage.
|
|
4
|
+
|
|
5
|
+
Under the hood it is a lightweight static analyser for TypeScript and JavaScript. It scans source, tests, package metadata, and config files, then outputs reports for terminals, CI annotations, SARIF code scanning, static HTML, and a local dashboard. Because it relies on static heuristics, run it alongside `tsc`, ESLint, tests, dependency scanners, and code review rather than instead of them.
|
|
4
6
|
|
|
5
7
|
## Why gruff-ts Exists
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
When AI writes the code, the reviewer is never the author. The agent holds full context while editing; the human asked to approve the diff does not. Conventional linters assume an author who already understands the code and just wants it tidy. `gruff-ts` optimises for the person reviewing code they did not write.
|
|
8
10
|
|
|
9
|
-
That
|
|
11
|
+
That breaks into three goals:
|
|
10
12
|
|
|
11
|
-
- **Verifiable.** A reviewer
|
|
12
|
-
- **Secure where the eye slips.** Human
|
|
13
|
-
- **Honestly tested.**
|
|
13
|
+
- **Verifiable.** A reviewer should be able to confirm what a change does by reading it, without reconstructing what the agent had in mind. Complexity, size, naming, and documentation rules push code toward plain intent.
|
|
14
|
+
- **Secure where the eye slips.** Human reviewers routinely skim past disabled TLS verification, `eval` and `new Function`, injection-shaped string building, and committed secrets. Security and sensitive-data rules catch those mechanically.
|
|
15
|
+
- **Honestly tested.** Tests should buy confidence, not line count. The test-quality pillar flags tautological assertions, shape-only checks that duplicate TypeScript, unused mocks, unlabelled assertion loops, global state mutation, and copy-pasted test bodies so an agent cannot clear a "write tests" step with padding.
|
|
14
16
|
|
|
15
|
-
Documentation rules
|
|
17
|
+
Documentation rules are strict on purpose, even on a private one-liner. Coding agents often write code that looks plausible while misunderstanding the requirement. Requiring a doc comment stating intent, parameters, return behavior, and error conditions gives the reviewer an independent claim to check against the implementation - a mismatch between the comment and the code is an immediate warning sign.
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Run as a hook on agent edits, `gruff-ts` acts as a forcing function rather than passive advice: findings stay in the agent's way until it fixes them, so what reaches a human is already shaped for review. See [Philosophy](docs/philosophy.md) for more background.
|
|
18
20
|
|
|
19
21
|
## Status At A Glance
|
|
20
22
|
|
|
21
23
|
| Field | Value |
|
|
22
24
|
| --- | --- |
|
|
23
|
-
| Release line | `0.
|
|
24
|
-
| Runtime | Node.js `22+`; release CI covers 22, 24, and 26 |
|
|
25
|
+
| Release line | `0.6.0` |
|
|
26
|
+
| Runtime | Node.js `22.12+`; release CI covers 22, 24, and 26 |
|
|
25
27
|
| Runtime dependencies | `commander`, `tsx`, and `typescript` |
|
|
26
28
|
| Package | `@blundergoat/gruff-ts` |
|
|
27
29
|
| Binary | `gruff-ts` |
|
|
28
|
-
| Rule catalogue |
|
|
30
|
+
| Rule catalogue | 81 rules across 11 pillars |
|
|
29
31
|
| Primary config | `.gruff-ts.yaml`; `.gruff.json`, `.gruff.yaml`, and `.gruff.yml` are fallback files |
|
|
30
|
-
| Analysis schema | `gruff.analysis.
|
|
31
|
-
| Summary schema | `gruff.summary.
|
|
32
|
-
| Baseline schema | `gruff.baseline.
|
|
32
|
+
| Analysis schema | `gruff.analysis.v3` |
|
|
33
|
+
| Summary schema | `gruff.summary.v3` |
|
|
34
|
+
| Baseline schema | `gruff.baseline.v3` |
|
|
33
35
|
| Hotspot schema | `gruff.hotspot.v1` |
|
|
34
|
-
| Agent-hook schema | `gruff.hook.
|
|
36
|
+
| Agent-hook schema | `gruff.hook.v2` |
|
|
35
37
|
| Config schema | `gruff-ts.config.v0.1` |
|
|
36
38
|
| Severity gate | `--fail-on` with `none`, `advisory`, `warning`, `error` |
|
|
37
39
|
| Dashboard | `127.0.0.1:8767` by default |
|
|
@@ -40,7 +42,7 @@ Scanned file types include TypeScript, JavaScript, JSON, YAML, TOML, INI, XML, a
|
|
|
40
42
|
|
|
41
43
|
## Requirements
|
|
42
44
|
|
|
43
|
-
- Node.js `22+`, matching [`package.json`](package.json).
|
|
45
|
+
- Node.js `22.12+`, matching [`package.json`](package.json).
|
|
44
46
|
- npm for source-checkout development.
|
|
45
47
|
- Git only for diff modes.
|
|
46
48
|
|
|
@@ -96,13 +98,14 @@ Open `http://127.0.0.1:8767/` for the dashboard.
|
|
|
96
98
|
| `summary [paths...]` | Print compact score, pillar, rule, and file summaries. |
|
|
97
99
|
| `report [paths...]` | Render an HTML or JSON report to stdout or `--output`. |
|
|
98
100
|
| `init` | Write the default `.gruff-ts.yaml` to the current directory (`--force` to overwrite). |
|
|
101
|
+
| `migrate-config` | Rewrite a 0.5 config for 0.6 (pruning retired rules, allowlists, and exclusions and validating output), writing to a different file. |
|
|
99
102
|
| `list-rules` | Print rule metadata as text or JSON. |
|
|
100
103
|
| `list-profiles` | Print the built-in profiles (`gruff.minimal`, `gruff.recommended`, `gruff.strict`) with their rule-count summary, as text or JSON. |
|
|
101
104
|
| `check-ignore <paths...>` | Report whether each path is ignored (config, gitignore, or default) with the matching source and pattern; runs no analysis. |
|
|
102
|
-
| `hook [paths...]` | Emit the `gruff.hook.
|
|
105
|
+
| `hook [paths...]` | Emit the `gruff.hook.v2` coding-agent contract and capability metadata. |
|
|
103
106
|
| `dashboard` | Serve the local browser dashboard. |
|
|
104
107
|
| `completion [shell]` | Print a shell completion script for `bash`, `zsh`, or `fish`. |
|
|
105
|
-
| `list` | Show the registered command catalogue. Use `--help` on the root or a command for
|
|
108
|
+
| `list`, `help` | Show the registered command catalogue, and per-command help. Use `--help` on the root or a command for the same detail. |
|
|
106
109
|
|
|
107
110
|
Global console options match the broader gruff CLI surface: `--silent`, `--quiet`, `--ansi` / `--no-ansi`, `--no-interaction`, and `-v` / `-vv` / `-vvv`.
|
|
108
111
|
|
|
@@ -113,7 +116,7 @@ Global console options match the broader gruff CLI surface: `--silent`, `--quiet
|
|
|
113
116
|
| Format | Use it for |
|
|
114
117
|
| --- | --- |
|
|
115
118
|
| `text` | Human terminal output. |
|
|
116
|
-
| `json` | Full `gruff.analysis.
|
|
119
|
+
| `json` | Full `gruff.analysis.v3` report. |
|
|
117
120
|
| `html` | Self-contained inspection report. |
|
|
118
121
|
| `markdown` | Pull-request or issue comment summary. |
|
|
119
122
|
| `github` | GitHub Actions workflow annotations. |
|
|
@@ -130,7 +133,7 @@ Global console options match the broader gruff CLI surface: `--silent`, `--quiet
|
|
|
130
133
|
| `1` | At least one finding met `--fail-on`. |
|
|
131
134
|
| `2` | Fatal diagnostic such as missing input, parse error, config error, diff failure, baseline failure, or invalid input. |
|
|
132
135
|
|
|
133
|
-
`analyse`
|
|
136
|
+
`analyse` defaults to `--fail-on advisory`, while `summary`, `report`, and `hook` default to `--fail-on none` so an initial `summary` prints findings and exits `0`. The table above covers `analyse`, `summary`, and `report`; `hook` gates only when the caller asks and has [its own exit codes](docs/agent-hook.md#the-model). You can override defaults per project with `failOn:` in `.gruff-ts.yaml` (precedence: CLI flag > config > binary default; see ADR-004 and [Configuration](docs/configuration.md)).
|
|
134
137
|
|
|
135
138
|
## CI Usage
|
|
136
139
|
|
|
@@ -146,15 +149,15 @@ SARIF jobs can write an artifact for code scanning:
|
|
|
146
149
|
npx gruff-ts analyse . --format=sarif --fail-on=none > gruff-ts.sarif
|
|
147
150
|
```
|
|
148
151
|
|
|
149
|
-
|
|
152
|
+
A security gate can skip the adoption baseline and run only the security and sensitive-data pillars. Secret findings report at `warning`, so gate at `warning`:
|
|
150
153
|
|
|
151
154
|
```bash
|
|
152
|
-
npx gruff-ts analyse . --no-baseline --fail-on=
|
|
155
|
+
npx gruff-ts analyse . --no-baseline --include-pillar security,sensitive-data --fail-on=warning
|
|
153
156
|
```
|
|
154
157
|
|
|
155
158
|
## Configuration
|
|
156
159
|
|
|
157
|
-
`analyse` auto-
|
|
160
|
+
`analyse`, `summary`, `report`, and `hook` auto-load the first supported config file in the project root:
|
|
158
161
|
|
|
159
162
|
1. `.gruff-ts.yaml`
|
|
160
163
|
2. `.gruff.json`
|
|
@@ -174,13 +177,10 @@ allowlists:
|
|
|
174
177
|
acceptedAbbreviations:
|
|
175
178
|
- api
|
|
176
179
|
- cli
|
|
177
|
-
acceptedBooleanNames:
|
|
178
|
-
- verbose
|
|
179
|
-
- enabled
|
|
180
|
-
secretPreviews: []
|
|
181
180
|
|
|
182
181
|
rules:
|
|
183
182
|
complexity.cyclomatic:
|
|
183
|
+
enabled: true # off by default; a threshold alone does not turn it on
|
|
184
184
|
threshold: 10
|
|
185
185
|
severity: warning
|
|
186
186
|
size.file-length:
|
|
@@ -198,7 +198,7 @@ A `profile:` selects a named bundle of rules instead of enumerating every rule b
|
|
|
198
198
|
| --- | --- |
|
|
199
199
|
| `gruff.minimal` | Security and sensitive-data rules only - the smallest sanity gate for incremental adoption. |
|
|
200
200
|
| `gruff.recommended` | Every pillar at its default threshold and severity - identical to gruff's zero-config behaviour. |
|
|
201
|
-
| `gruff.strict` | Every pillar enabled with tightened size
|
|
201
|
+
| `gruff.strict` | Every pillar enabled with tightened size and design thresholds for high-bar repositories. |
|
|
202
202
|
|
|
203
203
|
`gruff-ts list-profiles` prints them with their enabled-rule counts. Select one in config or on the CLI:
|
|
204
204
|
|
|
@@ -213,6 +213,7 @@ profile:
|
|
|
213
213
|
extends: gruff.recommended # a built-in name OR a relative path like ./team-profile.yaml
|
|
214
214
|
rules:
|
|
215
215
|
complexity.cyclomatic:
|
|
216
|
+
enabled: true
|
|
216
217
|
threshold: 12
|
|
217
218
|
docs.missing-public-doc:
|
|
218
219
|
enabled: false
|
|
@@ -231,39 +232,35 @@ Semantics:
|
|
|
231
232
|
|
|
232
233
|
## Rules And Pillars
|
|
233
234
|
|
|
234
|
-
The current catalogue contains
|
|
235
|
+
The current catalogue contains 81 rules:
|
|
235
236
|
|
|
236
237
|
| Pillar | Rules |
|
|
237
238
|
| --- | ---: |
|
|
238
|
-
| `complexity` |
|
|
239
|
+
| `complexity` | 1 |
|
|
239
240
|
| `dead-code` | 1 |
|
|
240
|
-
| `design` |
|
|
241
|
-
| `documentation` |
|
|
242
|
-
| `maintainability` |
|
|
243
|
-
| `modernisation` |
|
|
244
|
-
| `naming` |
|
|
245
|
-
| `security` |
|
|
246
|
-
| `sensitive-data` |
|
|
241
|
+
| `design` | 4 |
|
|
242
|
+
| `documentation` | 15 |
|
|
243
|
+
| `maintainability` | 8 |
|
|
244
|
+
| `modernisation` | 9 |
|
|
245
|
+
| `naming` | 3 |
|
|
246
|
+
| `security` | 23 |
|
|
247
|
+
| `sensitive-data` | 8 |
|
|
247
248
|
| `size` | 3 |
|
|
248
|
-
| `test-quality` |
|
|
249
|
+
| `test-quality` | 6 |
|
|
249
250
|
|
|
250
251
|
Use `npx gruff-ts list-rules --format=json` for exact rule IDs, severities, confidence levels, remediation text, thresholds, and options.
|
|
251
252
|
|
|
252
253
|
## Baselines And Changed-Code Scans
|
|
253
254
|
|
|
254
|
-
For editor and coding-agent feedback,
|
|
255
|
+
For editor and coding-agent feedback, use `hook`. It emits `gruff.hook.v2` JSON and is advisory by default (`--fail-on none`): it publishes findings and exits `0`. It exits `1` only when a gate you asked for trips (`--fail-on`, `--fail-on-new`, or `--fail-on-diagnostics`), and `2` when the run could not happen. [Using gruff-ts As A Coding-Agent Hook](docs/agent-hook.md) covers the envelope, wiring, gate levels, and CI use:
|
|
255
256
|
|
|
256
257
|
```bash
|
|
257
258
|
npx gruff-ts hook --format=json --changed-ranges "3-3,8-10" src/foo.ts
|
|
258
259
|
npx gruff-ts hook --capabilities --format=json
|
|
259
260
|
```
|
|
260
261
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
advisory: findings exit `0`; operational failures such as invalid config exit `2` and are reported
|
|
264
|
-
in `config.error`.
|
|
265
|
-
|
|
266
|
-
Baselines suppress reviewed findings by stable fingerprint:
|
|
262
|
+
Baselines suppress reviewed findings by a line-free identity and the count each row accepts, so an
|
|
263
|
+
unrelated edit that shifts line numbers does not re-open reviewed debt:
|
|
267
264
|
|
|
268
265
|
```bash
|
|
269
266
|
npx gruff-ts analyse . --generate-baseline gruff-baseline.json --fail-on=none
|
|
@@ -292,7 +289,7 @@ Use `--changed-scope file` when a CI workflow intentionally wants every finding
|
|
|
292
289
|
files, including file-wide metrics such as `size.file-length`. The default `symbol` scope keeps
|
|
293
290
|
the coding-agent feedback focused on the changed line or enclosing declaration.
|
|
294
291
|
|
|
295
|
-
JSON output keeps the normal `findings` array and
|
|
292
|
+
JSON output keeps the normal `findings` array and reports the filtered count as `diff.filteredFindings` and `summary.suppressedFindings` when changed-region filtering is active.
|
|
296
293
|
|
|
297
294
|
## Dashboard
|
|
298
295
|
|
|
@@ -306,13 +303,13 @@ In polyglot repositories, `gruff-ts` defaults to port `8767`, `gruff-rs` default
|
|
|
306
303
|
|
|
307
304
|
## Trust Boundary
|
|
308
305
|
|
|
309
|
-
Default scans
|
|
306
|
+
Default scans read local source, config, and package metadata files only. `gruff-ts` does not execute target application code, run tests, type-check or emit through `tsc`, query package registries, or fetch vulnerability feeds. The runtime `typescript` dependency is used for syntax parsing only, `tsx` runs the shipped TypeScript source, and `commander` owns CLI parsing. Git runs only when you pass a diff mode. Sensitive-data findings print fixed category markers rather than matched secret characters or lengths across terminal, JSON, SARIF, GitHub, Markdown, hotspot, and HTML output.
|
|
310
307
|
|
|
311
308
|
## Stability Contract
|
|
312
309
|
|
|
313
|
-
|
|
310
|
+
`gruff-ts` treats rule IDs, finding fingerprints, baseline identities, `gruff.analysis.v3`, `gruff.summary.v3`, `gruff.baseline.v3`, `gruff.hotspot.v1`, `gruff.hook.v2`, `gruff-ts.config.v0.1`, SARIF output, and CLI exit codes as compatibility-sensitive. The three `v3` schemas arrive in `0.6.0` (replacing `gruff.analysis.v2`, `gruff.summary.v2`, and `gruff.baseline.v1` from `0.5.x`); see [Upgrading](UPGRADING.md) for every breaking change and migration step. Future breaking changes land only in coordinated releases and are documented in [CHANGELOG.md](CHANGELOG.md).
|
|
314
311
|
|
|
315
|
-
Analysis JSON
|
|
312
|
+
Analysis JSON uses `file` for findings and top offenders (the legacy `filePath` alias was removed in `0.6.0`). See [Output formats](docs/output-formats.md) for the v2-to-v3 field mapping.
|
|
316
313
|
|
|
317
314
|
## How It Compares
|
|
318
315
|
|
|
@@ -338,10 +335,12 @@ Source lives under `src/`: `src/cli.ts` is the bootstrap, `src/cli-program.ts` o
|
|
|
338
335
|
|
|
339
336
|
## Documentation
|
|
340
337
|
|
|
338
|
+
- [Docs index](docs/README.md)
|
|
339
|
+
- [Output formats](docs/output-formats.md)
|
|
340
|
+
- [Upgrading](UPGRADING.md)
|
|
341
341
|
- [Changelog](CHANGELOG.md)
|
|
342
342
|
- [Configuration](docs/configuration.md)
|
|
343
343
|
- [Rules catalogue](docs/rules.md)
|
|
344
|
-
- [Reports and CI](docs/reports-and-ci.md)
|
|
345
344
|
- [Contributing](CONTRIBUTING.md)
|
|
346
345
|
- [Security](SECURITY.md)
|
|
347
346
|
|
package/SECURITY.md
CHANGED
|
@@ -4,43 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
| Version | Supported |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| 0.
|
|
8
|
-
| 0.
|
|
7
|
+
| 0.6.x | Yes |
|
|
8
|
+
| 0.5.x and earlier | No |
|
|
9
9
|
|
|
10
10
|
## Reporting A Vulnerability
|
|
11
11
|
|
|
12
|
-
Do not
|
|
13
|
-
paths, or sensitive scan output.
|
|
12
|
+
Do not open a public issue containing exploit details, secrets, tokens, private paths, or sensitive scan output.
|
|
14
13
|
|
|
15
|
-
Use
|
|
16
|
-
the public repository. If private reporting is not available yet, contact the
|
|
17
|
-
maintainer through the preferred private channel before posting details
|
|
18
|
-
publicly.
|
|
14
|
+
Use GitHub's private vulnerability reporting on this repository if it is enabled. Otherwise, reach out to the maintainer privately before posting details publicly.
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
Include what helps reproduce and scope the report:
|
|
21
17
|
|
|
22
|
-
- A short description of the issue.
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
- Whether
|
|
26
|
-
logs.
|
|
27
|
-
- Whether a baseline, SARIF upload, GitHub annotation output, or dashboard scan
|
|
28
|
-
endpoint is involved.
|
|
18
|
+
- A short description of the issue and a minimal reproduction, if you have one.
|
|
19
|
+
- The command or output format affected.
|
|
20
|
+
- Whether sensitive data leaked into findings, reports, dashboard output, or logs.
|
|
21
|
+
- Whether a baseline, SARIF upload, GitHub annotation output, or the dashboard `/scan` endpoint is involved.
|
|
29
22
|
|
|
30
23
|
## Security Boundaries
|
|
31
24
|
|
|
32
|
-
- The dashboard is a local
|
|
33
|
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
## Disclosure Expectations
|
|
43
|
-
|
|
44
|
-
The maintainer should acknowledge valid private reports, assess impact, and
|
|
45
|
-
coordinate a fix before public disclosure. Public advisories should include the
|
|
46
|
-
affected versions, fixed version, and mitigation.
|
|
25
|
+
- The dashboard is a local tool that binds to `127.0.0.1` by default. Binding it to `0.0.0.0` exposes filesystem scanning to the network without authentication.
|
|
26
|
+
- Sensitive-data findings print fixed category markers rather than matched secret characters or secret-derived lengths.
|
|
27
|
+
- HTML output is built without a template engine, so every interpolated value must be HTML-escaped.
|
|
28
|
+
- `gruff-ts` runs static heuristics; it is not a vulnerability scanner or dependency advisory database.
|
|
29
|
+
- Baselines suppress reviewed findings by line-free identity and count, and sensitive-data findings can never be baselined. For a security gate that ignores adoption baselines, run `gruff-ts analyse . --no-baseline --fail-on=warning` (all `sensitive-data.*` rules default to `warning`, so `--fail-on=error` alone will not fail on them).
|
|
30
|
+
|
|
31
|
+
## Disclosure Process
|
|
32
|
+
|
|
33
|
+
Valid private reports are acknowledged, triaged for impact, and patched before public disclosure. Public advisories list affected versions, the fixed version, and mitigation steps.
|