@xenos1996/usa 2.26.0 → 2.27.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/dist/engine/audit-config.d.ts +66 -0
- package/dist/engine/audit-config.d.ts.map +1 -0
- package/dist/engine/audit-config.js +148 -0
- package/dist/engine/audit-config.js.map +1 -0
- package/dist/engine/audit-types.d.ts +44 -0
- package/dist/engine/audit-types.d.ts.map +1 -0
- package/dist/engine/audit-types.js +2 -0
- package/dist/engine/audit-types.js.map +1 -0
- package/dist/engine/audit-warnings.d.ts +56 -0
- package/dist/engine/audit-warnings.d.ts.map +1 -0
- package/dist/engine/audit-warnings.js +116 -0
- package/dist/engine/audit-warnings.js.map +1 -0
- package/dist/engine/audit.d.ts +14 -38
- package/dist/engine/audit.d.ts.map +1 -1
- package/dist/engine/audit.js +9 -500
- package/dist/engine/audit.js.map +1 -1
- package/dist/engine/evaluate-packs.d.ts +37 -0
- package/dist/engine/evaluate-packs.d.ts.map +1 -0
- package/dist/engine/evaluate-packs.js +144 -0
- package/dist/engine/evaluate-packs.js.map +1 -0
- package/dist/engine/invariants.d.ts +8 -0
- package/dist/engine/invariants.d.ts.map +1 -1
- package/dist/engine/invariants.js +11 -0
- package/dist/engine/invariants.js.map +1 -1
- package/dist/engine/pack-selection.d.ts +21 -0
- package/dist/engine/pack-selection.d.ts.map +1 -0
- package/dist/engine/pack-selection.js +63 -0
- package/dist/engine/pack-selection.js.map +1 -0
- package/dist/engine/report-build.d.ts +22 -0
- package/dist/engine/report-build.d.ts.map +1 -0
- package/dist/engine/report-build.js +67 -0
- package/dist/engine/report-build.js.map +1 -0
- package/dist/foundation/interview.d.ts.map +1 -1
- package/dist/foundation/interview.js +16 -5
- package/dist/foundation/interview.js.map +1 -1
- package/package.json +17 -12
- package/rules/core/code-quality.yaml +12 -2
- package/rules/core/provenance-attestation.yaml +5 -0
- package/rules/core/security.yaml +1 -1
- package/rules/core/testing-assurance.yaml +19 -4
|
@@ -100,7 +100,12 @@ rules:
|
|
|
100
100
|
applies_when: { fact: 'lang:typescript' }
|
|
101
101
|
check:
|
|
102
102
|
kind: grep_absent
|
|
103
|
-
|
|
103
|
+
# `:\s*any\b` alone matched prose — "Degraded-never-empty: any fetch
|
|
104
|
+
# failure" in a doc comment — so the type-escape branch now requires a
|
|
105
|
+
# type position after the keyword (`: any,` `: any)` `: any[]` `: any =`).
|
|
106
|
+
# Masking comments instead is not an option here: `@ts-ignore` lives in a
|
|
107
|
+
# comment, and the rule exists to catch it.
|
|
108
|
+
pattern: '(@ts-ignore|@ts-expect-error|:\s*any\b(?=\s*[,;)\]}>=]|$)|\bas any\b|as unknown as)'
|
|
104
109
|
include: ['**/*.{ts,tsx}']
|
|
105
110
|
exclude: ['**/*.test.*', '**/*.spec.*', '**/*.d.ts']
|
|
106
111
|
why: 'Every `any` is a place the type system was told to stop helping. A few are fine; a pattern is a problem.'
|
|
@@ -204,7 +209,12 @@ rules:
|
|
|
204
209
|
kind: grep_wrong
|
|
205
210
|
pattern: '(TODO|FIXME|XXX|HACK|WORKAROUND)\b'
|
|
206
211
|
include: ['**/*.{ts,tsx,js,jsx,py,go,rs,java,kt,rb,php,cs,yml,yaml}']
|
|
207
|
-
|
|
212
|
+
# A fixture is a *sample of bad code*, not debt: CQ-010.yaml contains a
|
|
213
|
+
# TODO precisely so this rule has something to flag. Excluding them here
|
|
214
|
+
# (rather than from the audit index) keeps the fixtures visible to the
|
|
215
|
+
# rules that need to see them, e.g. TAS-011.
|
|
216
|
+
exclude:
|
|
217
|
+
['**/*.md', '**/docs/**', '**/node_modules/**', '**/fixtures/**', '**/__fixtures__/**']
|
|
208
218
|
why: 'A TODO with no owner and no ticket is a lie the codebase tells itself.'
|
|
209
219
|
remediation: 'Convert each one to a tracked issue with a link in the comment, or delete it if it no longer applies.'
|
|
210
220
|
|
|
@@ -58,6 +58,11 @@ rules:
|
|
|
58
58
|
# An empty signature file signs nothing — presence alone is not evidence.
|
|
59
59
|
non_empty: true
|
|
60
60
|
files:
|
|
61
|
+
# cosign's own default bundle name is `<artifact>.sigstore.json`
|
|
62
|
+
# (`cosign sign-blob --bundle x.sigstore.json`), which `*.sigstore`
|
|
63
|
+
# does not match — that gap made every cosign-signed repo fail this
|
|
64
|
+
# rule. `*.sigstore` stays for legacy bundles written with that suffix.
|
|
65
|
+
- '**/*.sigstore.json'
|
|
61
66
|
- '**/*.sigstore'
|
|
62
67
|
- '**/*.bundle'
|
|
63
68
|
- '**/*.sig'
|
package/rules/core/security.yaml
CHANGED
|
@@ -534,7 +534,7 @@ rules:
|
|
|
534
534
|
assert: { rule: SEC-014, status: [PASS] }
|
|
535
535
|
why: 'Sound tokens with expiry but no rate limiting leave a credential-stuffing window: each token check passes, the login endpoint still takes unlimited guesses.'
|
|
536
536
|
remediation: 'Rate-limit failed authentication (see SEC-014) on every endpoint that accepts these tokens.'
|
|
537
|
-
references: ['CWE-307'
|
|
537
|
+
references: ['CWE-307']
|
|
538
538
|
|
|
539
539
|
- id: INV-SEC-003
|
|
540
540
|
title: Validated input is also encoded on output
|
|
@@ -137,11 +137,22 @@ rules:
|
|
|
137
137
|
patterns:
|
|
138
138
|
- 'reports/**/*mut*'
|
|
139
139
|
- 'reports/mutation/**'
|
|
140
|
+
# Stryker's default config file has been `stryker.config.*` since v6;
|
|
141
|
+
# `stryker.conf.*` is the pre-6 name and is kept for older projects.
|
|
142
|
+
- 'stryker.config.*'
|
|
140
143
|
- 'stryker.conf.*'
|
|
141
144
|
- '.stryker.conf.*'
|
|
142
145
|
- '.mutmut*'
|
|
143
146
|
- 'mutants/**'
|
|
144
|
-
|
|
147
|
+
# A committed harness that mutates and asserts is evidence too — and
|
|
148
|
+
# stronger evidence than a config file, which proves only that someone
|
|
149
|
+
# installed a tool. USA mutates every rule check and asserts its own
|
|
150
|
+
# fixture flips (tests/integration/auditor-mutation.test.ts, ~100
|
|
151
|
+
# probes in every CI run); no third-party tool name appears anywhere in
|
|
152
|
+
# the repo, so the tool-only globs scored that work as absent.
|
|
153
|
+
- 'tests/**/*mutation*'
|
|
154
|
+
- 'tests/**/mutation/**'
|
|
155
|
+
why: 'Coverage tells you which lines ran, not whether the test would have failed if the line were wrong; a mutation config, report, or committed mutation harness proves the question was asked.'
|
|
145
156
|
remediation: 'Run mutation testing on the highest-risk module first and keep the config or report in the repo.'
|
|
146
157
|
references: ['Mutation-Testing']
|
|
147
158
|
|
|
@@ -178,7 +189,11 @@ rules:
|
|
|
178
189
|
class: operations
|
|
179
190
|
check:
|
|
180
191
|
kind: grep_present
|
|
181
|
-
|
|
192
|
+
# A declared budget of zero is a budget, and a stricter one than 2:
|
|
193
|
+
# the project has decided a flaky test is a failure, not a rerun. The
|
|
194
|
+
# earlier `[1-9]` required paying for retries, so the most honest
|
|
195
|
+
# answer a deterministic suite can give was scored as absent.
|
|
196
|
+
pattern: '(retr(?:y|ies)\s*:\s*\d|retries=\d|--retries[ =]\d|rerun-failed|flaky-test-retry|retry-on-failure)'
|
|
182
197
|
include:
|
|
183
198
|
[
|
|
184
199
|
'playwright.config.*',
|
|
@@ -190,8 +205,8 @@ rules:
|
|
|
190
205
|
'.github/workflows/*.yaml',
|
|
191
206
|
'.gitlab-ci.yml',
|
|
192
207
|
]
|
|
193
|
-
why: 'A
|
|
194
|
-
remediation: 'Declare
|
|
208
|
+
why: 'A declared retry budget says what the project does when a test fails twice: rerun it, or treat it as a defect. Either answer is a policy; silence means nobody decided.'
|
|
209
|
+
remediation: 'Declare the budget explicitly. Prefer retries: 0 and fix flakes; if reruns are unavoidable, set retries: 2 on CI only, track which tests consume it, and quarantine chronic consumers.'
|
|
195
210
|
references: ['Google-Testing-Blog:Flaky']
|
|
196
211
|
|
|
197
212
|
- id: TAS-010
|