project-brain 0.24.0 → 0.26.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.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/package.json +6 -6
  3. package/templates/project.claude.md +1 -1
  4. package/templates/skills/brain-audit/SKILL.md +17 -7
  5. package/templates/skills/brain-audit/references/abuse.md +36 -11
  6. package/templates/skills/brain-audit/references/accessibility.md +50 -22
  7. package/templates/skills/brain-audit/references/ai.md +39 -15
  8. package/templates/skills/brain-audit/references/analytics.md +34 -11
  9. package/templates/skills/brain-audit/references/api.md +38 -13
  10. package/templates/skills/brain-audit/references/backend.md +41 -9
  11. package/templates/skills/brain-audit/references/browser.md +146 -0
  12. package/templates/skills/brain-audit/references/complexity.md +22 -12
  13. package/templates/skills/brain-audit/references/concurrency.md +36 -18
  14. package/templates/skills/brain-audit/references/consistency.md +32 -9
  15. package/templates/skills/brain-audit/references/contract-drift.md +34 -16
  16. package/templates/skills/brain-audit/references/cost.md +45 -23
  17. package/templates/skills/brain-audit/references/cross-surface-parity.md +38 -11
  18. package/templates/skills/brain-audit/references/database.md +43 -17
  19. package/templates/skills/brain-audit/references/dependencies-licensing.md +27 -12
  20. package/templates/skills/brain-audit/references/design-system.md +40 -17
  21. package/templates/skills/brain-audit/references/devops.md +32 -17
  22. package/templates/skills/brain-audit/references/documentation.md +38 -16
  23. package/templates/skills/brain-audit/references/failure.md +40 -18
  24. package/templates/skills/brain-audit/references/feature-flags.md +31 -15
  25. package/templates/skills/brain-audit/references/flow-integrity.md +42 -10
  26. package/templates/skills/brain-audit/references/frontend.md +40 -12
  27. package/templates/skills/brain-audit/references/functional.md +31 -11
  28. package/templates/skills/brain-audit/references/future.md +28 -7
  29. package/templates/skills/brain-audit/references/goal.md +15 -6
  30. package/templates/skills/brain-audit/references/i18n.md +30 -8
  31. package/templates/skills/brain-audit/references/idempotency.md +46 -24
  32. package/templates/skills/brain-audit/references/infrastructure.md +43 -13
  33. package/templates/skills/brain-audit/references/mobile.md +37 -15
  34. package/templates/skills/brain-audit/references/multi-tenancy.md +41 -12
  35. package/templates/skills/brain-audit/references/numeric.md +33 -16
  36. package/templates/skills/brain-audit/references/observability.md +43 -19
  37. package/templates/skills/brain-audit/references/packaging.md +39 -13
  38. package/templates/skills/brain-audit/references/performance.md +43 -13
  39. package/templates/skills/brain-audit/references/privacy.md +38 -15
  40. package/templates/skills/brain-audit/references/product.md +29 -10
  41. package/templates/skills/brain-audit/references/prompt-spec-gap.md +34 -10
  42. package/templates/skills/brain-audit/references/reachability.md +38 -18
  43. package/templates/skills/brain-audit/references/repo-history.md +23 -16
  44. package/templates/skills/brain-audit/references/runtime.md +48 -10
  45. package/templates/skills/brain-audit/references/scalability.md +37 -10
  46. package/templates/skills/brain-audit/references/security.md +46 -22
  47. package/templates/skills/brain-audit/references/state-model.md +44 -15
  48. package/templates/skills/brain-audit/references/supply-chain.md +42 -13
  49. package/templates/skills/brain-audit/references/temporal.md +37 -14
  50. package/templates/skills/brain-audit/references/testing.md +38 -14
  51. package/templates/skills/brain-audit/references/tooling-baseline.md +34 -18
  52. package/templates/skills/brain-audit/references/type-safety.md +38 -19
  53. package/templates/skills/brain-audit/references/usability.md +78 -0
  54. package/templates/skills/brain-audit/references/versioning-compatibility.md +34 -12
  55. package/templates/skills/brain-audit/references/visual-design.md +38 -12
  56. package/templates/skills/brain-audit/references/web-metadata.md +47 -19
  57. package/templates/skills/brain-record/SKILL.md +297 -0
  58. package/templates/skills/brain-record/assets/build-video.sh +142 -0
  59. package/templates/skills/brain-record/assets/record.mjs +283 -0
  60. package/templates/skills/brain-record/references/pitfalls.md +233 -0
  61. package/templates/skills/brain-worktree/SKILL.md +103 -0
@@ -11,15 +11,17 @@ Everything below is established by reading test source and config — this modul
11
11
  ## Does the suite prove anything
12
12
 
13
13
  - [ ] For each confirmed finding elsewhere in this audit, identify the missing test — `search_code` the file/function named in the finding against the test suite; no matching test file or describe block is the gap. That list is the most valuable output of this module.
14
- - [ ] Tests assert behaviour, not implementation — read each test's assertions. A test that breaks on every refactor and passes through every real bug is negative value.
15
- - [ ] Tests would fail if the feature broke — pick the most important test, read the implementation it covers, and mentally invert one condition. If no assertion in the test would catch the inversion, the test is not proving what it claims to.
16
- - [ ] No test asserts only that a function was called — `search_code` for `toHaveBeenCalled()`/`toHaveBeenCalledWith()` with no accompanying assertion on a return value or side effect in the same test. Call-count assertions on a mock prove the test's own wiring, not the behaviour.
17
- - [ ] Assertions are specific — `search_code` for `toBeDefined()`, `toBeTruthy()`, `expect.anything()`, `assert.ok(` used where a specific expected value would fit. These pass on almost anything.
18
- - [ ] A test with many unlabelled assertions makes its own failure hard to diagnose — `search_code` test bodies for more than two or three bare assertion calls with no message argument and no single clear behaviour under test ("Assertion Roulette," a catalogued test smell). This is a maintainability finding, not a correctness one: the test still catches the bug, it just won't say which assertion caught it.
14
+ - [ ] Tests assert behaviour, not implementation — `search_code` the suite for the test covering a finding above, and `Read` its assertions. A test that breaks on every refactor and passes through every real bug is negative value. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 13 — https://abseil.io/resources/swe-book/html/ch13.html; Fowler, "Mocks Aren't Stubs," martinfowler.com — https://martinfowler.com/articles/mocksArentStubs.html)
15
+ - [ ] Tests would fail if the feature broke — `find_symbol` the implementation the most important test covers, `Read` it, and mentally invert one condition. If no assertion in the test would catch the inversion, the test is not proving what it claims to.
16
+ - [ ] No test asserts only that a function was called — `search_code` for `toHaveBeenCalled()`/`toHaveBeenCalledWith()` with no accompanying assertion on a return value or side effect in the same test. Call-count assertions on a mock prove the test's own wiring, not the behaviour. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 13 — https://abseil.io/resources/swe-book/html/ch13.html)
17
+ - [ ] Assertions are specific — `search_code` for `toBeDefined()`, `toBeTruthy()`, `expect.anything()`, `assert.ok(` used where a specific expected value would fit. These pass on almost anything. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html)
18
+ - [ ] A test with many unlabelled assertions makes its own failure hard to diagnose — `search_code` test bodies for more than two or three bare assertion calls with no message argument and no single clear behaviour under test ("Assertion Roulette," a catalogued test smell). This is a maintainability finding, not a correctness one: the test still catches the bug, it just won't say which assertion caught it. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html)
19
+ - [ ] Coverage thresholds, where configured, function as a floor — `search_code` for a `coverageThreshold`/`coverage.thresholds` block (Jest/Vitest) and check whether every metric (statements/branches/functions/lines) is set to the same round number (e.g. all 80) with no per-file or per-directory override. A single uniform ceiling number, on a codebase large enough to have files of very different risk, is a target chased for its own sake rather than a gap-driven floor. Refuted if the project's high-blast-radius files (per `complexity.md`/`reachability.md`) independently show materially higher coverage than the threshold — the number is a backstop, not the target. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 11 — https://abseil.io/resources/swe-book/html/ch11.html)
20
+ - [ ] Assertions that compare a `.toString()`/JSON-stringified rendering of an object rather than its structured fields — `search_code` for `.toString()).toBe(`/`.toString()).toEqual(`/`JSON.stringify(...)).toBe(` patterns in test bodies. These break on any change to unrelated formatting (field order, whitespace, a new optional field) with no change to the behaviour under test. Refuted where the string/serialized form itself is the contract under test (e.g., testing a formatter or serializer's own output) — there the stringified value is the behaviour, not an implementation detail leaking through. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html; Fowler, "Mocks Aren't Stubs," martinfowler.com — https://martinfowler.com/articles/mocksArentStubs.html)
19
21
 
20
22
  ## Test doubles
21
23
 
22
- - [ ] Mocks target code the project owns, not a third-party SDK or framework class reached directly — `search_code` the test suite for a mock/stub/spy applied to an imported third-party package. A mock of a dependency you don't own encodes an assumption about that dependency's contract that nothing revalidates; the contract can drift after a version bump while the mock — and the test — keeps passing. ("Don't mock what you don't own" — Freeman & Pryce, *Growing Object-Oriented Software, Guided by Tests*; reinforced in Google's own testing guidance.)
24
+ - [ ] Mocks target code the project owns, not a third-party SDK or framework class reached directly — `search_code` the test suite for a mock/stub/spy applied to an imported third-party package. A mock of a dependency you don't own encodes an assumption about that dependency's contract that nothing revalidates; the contract can drift after a version bump while the mock — and the test — keeps passing. ("Don't mock what you don't own" — Freeman & Pryce, *Growing Object-Oriented Software, Guided by Tests*; reinforced in Google's own testing guidance — Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 13 — https://abseil.io/resources/swe-book/html/ch13.html.) Rule out a mock of a narrow, stable stdlib-equivalent surface where drift risk is negligible. A third-party class or interface mocked identically in many test files is a systemic contract-drift risk, not just a per-file smell — `search_code` for the same imported third-party symbol appearing inside a mock/stub/spy call across three or more distinct test files; each duplicate is a separate, unrevalidated assumption about that dependency's contract. Refuted if the mocked surface is centralized behind one shared test helper/factory that all three-plus files import, since a contract change then needs only one fix, not N.
23
25
  - [ ] Where the codebase already wraps a third-party dependency in its own adapter, confirm tests mock the adapter and not the raw import — `search_code` for both the adapter's own test double and a direct mock of the underlying package inside the same test file. A test still reaching past the adapter defeats the reason the adapter exists.
24
26
 
25
27
  ## What is not covered
@@ -33,26 +35,28 @@ Everything below is established by reading test source and config — this modul
33
35
 
34
36
  ## Test isolation
35
37
 
36
- - [ ] **No test writes outside its own temporary directory.** `search_code` test files for `homedir()`, `os.homedir()`, a hardcoded absolute path, or a shared config/data directory. A write derived from any of these pollutes the developer's real environment and is `High` — and it is easy to introduce accidentally when production code resolves paths from `homedir()`.
37
- - [ ] Injection seams exist for anything that resolves a real path, spawns a process, or reaches the network — `search_code` test files for direct `fs.`, `child_process.`, or `http.`/`fetch(` calls that bypass a mock or an injected client. A direct call means the seam either doesn't exist or isn't used.
38
- - [ ] Tests do not depend on execution order or on each other's leftovers — `search_code` for module-level mutable state written in one test and read in another (a shared fixture reused without `beforeEach` resetting it).
38
+ - [ ] **No test writes outside its own temporary directory.** `search_code` test files for `homedir()`, `os.homedir()`, a hardcoded absolute path, or a shared config/data directory. A write derived from any of these pollutes the developer's real environment and is `High` — and it is easy to introduce accidentally when production code resolves paths from `homedir()`. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 14 — https://abseil.io/resources/swe-book/html/ch14.html)
39
+ - [ ] Injection seams exist for anything that resolves a real path, spawns a process, or reaches the network — `search_code` test files for direct `fs.`, `child_process.`, or `http.`/`fetch(` calls that bypass a mock or an injected client. A direct call means the seam either doesn't exist or isn't used. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 13 — https://abseil.io/resources/swe-book/html/ch13.html)
40
+ - [ ] Tests do not depend on execution order or on each other's leftovers — `search_code` for module-level mutable state written in one test and read in another (a shared fixture reused without `beforeEach` resetting it). (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html; Vitest core team, "Test Context," official docs — https://vitest.dev/guide/test-context.html)
39
41
  - [ ] Each test cleans up on both the pass and the fail path — `search_code` for cleanup code placed inside the test body versus inside `afterEach`/`finally`. Cleanup only at the end of the body is skipped whenever an earlier assertion throws.
40
- - [ ] Nothing hits a real paid or external endpoint — `search_code` for a live API base URL, an unmocked SDK client, or a real API key referenced inside a test file. Cross-reference `cost.md`.
42
+ - [ ] Nothing hits a real paid or external endpoint — `search_code` for a live API base URL, an unmocked SDK client, or a real API key referenced inside a test file. Cross-reference `cost.md`. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html)
43
+ - [ ] Tests that resolve a base URL to anything other than localhost/a mocked server are nonhermetic — `search_code` the test suite (setup files, env fixtures, base-URL constants) for a hostname that is not `localhost`/`127.0.0.1`/a recognized in-process mock server, and cross-reference `.env.test`/CI config for the same variable. A suite that shares a staging environment with other test runs, or with production traffic, cannot guarantee the determinism this module's other isolation checks assume. Refuted if the shared host is a read-only, purpose-built test fixture environment gated by a separate credential the CI job scopes exclusively to test runs, with no production traffic ever landing there. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 14 — https://abseil.io/resources/swe-book/html/ch14.html)
44
+ - [ ] Test setup that reads a fixture file, directory, or external resource without first checking it exists — `search_code` test files for `fs.readFileSync`/`fs.readFile`/equivalent calls inside `beforeEach`/`beforeAll`/test bodies with no adjacent `fs.existsSync`/try-catch guard, where the file is not created by that same setup block. The test passes only when the ambient filesystem happens to be in the state the author assumed. Refuted if the same `beforeEach`/`beforeAll` block creates the file earlier in its own body — existence is then guaranteed by construction, not assumed. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html)
41
45
 
42
46
  ## Determinism
43
47
 
44
48
  Flaky-test root causes have a stable, well-studied taxonomy (Luo et al., FSE 2014, independently reconfirmed since) clustering into non-determinism (races, shared mutable state, unseeded randomness), environment dependence (CI runner, timezone, locale), and order dependence (a test's pass depends on what ran before it). Of these, only non-determinism and order dependence leave a trace readable without executing the suite repeatedly — environment dependence is out of static reach entirely. The checks below, plus the isolation checks above, are what that reading finds.
45
49
 
46
- - [ ] No dependence on wall-clock time, current date, timezone, or locale without control — `search_code` for `new Date()`/`Date.now()` inside code the tests exercise, and check whether the suite injects or freezes the clock (fake timers, an injected clock parameter) rather than reading the real one.
50
+ - [ ] No dependence on wall-clock time, current date, timezone, or locale without control — `search_code` for `new Date()`/`Date.now()` inside code the tests exercise, and check whether the suite injects or freezes the clock (fake timers, an injected clock parameter) rather than reading the real one. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 14 — https://abseil.io/resources/swe-book/html/ch14.html)
47
51
  - [ ] No dependence on unseeded randomness — `search_code` for `Math.random(` (or the language equivalent) in tested logic and confirm the test either seeds it or mocks the call.
48
- - [ ] No fixed sleeps standing in for synchronisation — `search_code` test files for `sleep(`/`setTimeout(` used to wait for an async operation instead of awaiting it directly. That is a flake with a timer.
52
+ - [ ] No fixed sleeps standing in for synchronisation — `search_code` test files for `sleep(`/`setTimeout(` used to wait for an async operation instead of awaiting it directly. That is a flake with a timer. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html; Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 14 — https://abseil.io/resources/swe-book/html/ch14.html)
49
53
  - [ ] No dependence on a fixed port, or ports are allocated dynamically — `search_code` test setup for a literal port number (`.listen(3000)`). Fixed ports collide under parallel runs and in CI.
50
- - [ ] **Known flaky tests are tracked, not tolerated.** `search_code` for `test.skip`, `.only`, a retry/`flaky` annotation, or a comment naming a test as unreliable. A test that fails one run in ten is a real signal being discarded — report each one with its observed failure rate if the repo records it (a CI badge, a flake-tracking issue).
54
+ - [ ] **Known flaky tests are tracked, not tolerated.** `search_code` for `test.skip`, `.only`, a retry/`flaky` annotation, or a comment naming a test as unreliable. A test that fails one run in ten is a real signal being discarded — report each one with its observed failure rate if the repo records it (a CI badge, a flake-tracking issue). Cross-reference `runtime.md`, which reports a committed `.only`/`fit`/`fdescribe` in its own right, independent of whether the run currently passes. A global retry count greater than zero with no matching flaky-test record is the same signal inverted — `search_code` for `retries:` (Playwright/Vitest config) or a CI-level `--retries`/`--retry` flag set above 0 at the whole-suite level, then cross-reference this check; retries configured suite-wide, with no specific test named anywhere as the reason, mask exactly the signal this check exists to surface. Refuted if the retry count is scoped only to a CI job's known-nonhermetic large-test tier (e.g. only the e2e config, not unit config) and that scoping is itself documented in the same config file. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html; Playwright (Microsoft), "Retries," official docs — https://playwright.dev/docs/test-retries)
51
55
 
52
56
  ## Guard tests
53
57
 
54
58
  - [ ] Where the codebase depends on two things agreeing — a manifest and a directory, a schema and a model, a gate table and a file set — a test asserts the agreement. `search_code` for both things being compared (the manifest read, the directory listing) inside the test suite. Hand-maintained lists are fine; unguarded hand-maintained lists are not.
55
- - [ ] **A guard that cannot fail is not a guard.** Read the assertion itself rather than running it: an assertion comparing a value to itself (`expect(x).toEqual(x)`), one wrapped in a `try`/`catch` that swallows the failure, one behind a condition that is never true, or one that checks only that a function returned rather than what it returned — none of these can ever fail, regardless of what changes underneath them. Flag any guard test whose assertion has this shape.
59
+ - [ ] **A guard that cannot fail is not a guard.** Read the assertion itself rather than running it: an assertion comparing a value to itself (`expect(x).toEqual(x)`), one wrapped in a `try`/`catch` that swallows the failure, one behind a condition that is never true, or one that checks only that a function returned rather than what it returned — none of these can ever fail, regardless of what changes underneath them. Flag any guard test whose assertion has this shape. (testsmells.org, tsDetect test-smell catalogue — https://www.testsmells.org/pages/testsmells.html)
56
60
 
57
61
  ## Out of static reach
58
62
 
@@ -64,6 +68,20 @@ Flaky-test root causes have a stable, well-studied taxonomy (Luo et al., FSE 201
64
68
  - Coverage percentage as measured by a coverage tool — this module infers gaps from what it reads, it does not instrument a run.
65
69
  - Mutation score — the more strongly-correlated measure of test quality; this module can note the absence of a mutation-testing tool in the project config, but cannot compute or estimate the score itself.
66
70
  - Whether a guard test that is structurally capable of failing has ever actually caught a real regression.
71
+ - Whether a coverage number is enforced as a floor or chased as a ceiling in practice — this module reads the threshold's configuration, not the team's history of decisions around it. Cross-reference `repo-history.md`.
72
+ - Whether new behaviour reliably arrives with a test, project-wide and over time (the "Beyoncé Rule") — this module reads the current suite, not the commit-by-commit discipline that produced it.
73
+ - Whether a test named/directory-classified as "small" (Google's small/medium/large taxonomy) is actually free of I/O and blocking calls at run time — `search_code` can find an `fs.`/`http.` call inside such a file, but confirming the call never actually executes (a dead branch, an always-mocked path) requires running it; only `runtime.md` can confirm.
74
+ - Whether a test needing retries fails because of a genuine race or because it is marginally slow under load — this module can find the retry configuration, not run the test enough times to tell the two apart. Cross-reference `runtime.md`.
75
+
76
+ Where `Runtime` is enabled, see `runtime.md`'s "What execution closes" for the pass/fail, flake-rate, and order-dependency items above, and its declared-coverage run (`runtime.md`'s run-steps section) for the coverage item, where a coverage script is declared.
77
+
78
+ ## What browser observation closes
79
+
80
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
81
+
82
+ | Artefact | Gap it closes | Observed instance earns |
83
+ |---|---|---|
84
+ | `steps.md` cross-referenced with `search_code` of the e2e/integration test suite | A flow `browser.md` walked and confirmed working has no matching test in the suite — refuted if a test exists under a different name than the UI label; the auditor must actually open the candidate test file and confirm it exercises the same code path, not just that no name matches | High |
67
85
 
68
86
  ## Severity guidance
69
87
 
@@ -79,5 +97,11 @@ Flaky-test root causes have a stable, well-studied taxonomy (Luo et al., FSE 201
79
97
  | Fixed sleep standing in for synchronisation | Medium |
80
98
  | Fixed port causing collisions under parallel runs | Medium |
81
99
  | Mock of a third-party dependency the project doesn't own, wrapped nowhere | Medium |
100
+ | Same third-party type mocked identically across three or more test files, not centralized | Medium |
101
+ | Test suite resolves a base URL to a shared, non-local environment (nonhermetic) | Medium |
102
+ | Test setup reads a fixture/resource with no existence check (Resource Optimism) | Medium |
103
+ | Suite-wide retries configured with no matching flaky-test record | Medium |
82
104
  | Tests asserting implementation rather than behaviour | Low |
83
105
  | Assertion Roulette — many unlabelled assertions, unclear which failed | Low |
106
+ | Coverage threshold configured as a uniform ceiling, no per-file/per-directory floor | Low |
107
+ | Assertion compares a stringified/serialized rendering instead of structured fields (Sensitive Equality) | Low |
@@ -6,51 +6,57 @@ This audit otherwise reasons from source alone. Most projects already carry dete
6
6
 
7
7
  ## Inventory
8
8
 
9
- - [ ] Locate every tool config in the tree — `search_code` for `.eslintrc`/`eslint.config`, `.prettierrc`, `biome.json`, `.stylelintrc`, `ruff.toml`/`pyproject.toml`'s `[tool.ruff]`, `.flake8`, `mypy.ini`/`pyrightconfig.json`, `tsconfig.json`, `go.mod`/`.golangci.yml`, `.rubocop.yml`, `checkstyle.xml`, a test-runner config (`jest.config`, `vitest.config`, `pytest.ini`), a SAST/dependency-scanner config (`.semgrep.yml`, `.snyk`, `codeql.yml`, `trivy.yaml`, `.bandit`), `.pre-commit-config.yaml`, `.editorconfig`. Record what each declares — existence alone is not the finding, its content is.
10
- - [ ] Where tooling exists for one category but is conspicuously silent on an adjacent one the project clearly needs — a Python API handling auth with no `bandit`/`semgrep` config beside its `ruff` config — note the asymmetry; a gap in an otherwise-tooled project says more than a gap in an untooled one.
9
+ - [ ] Locate every tool config in the tree — `search_code` for `.eslintrc`/`eslint.config`, `.prettierrc`, `biome.json`, `.stylelintrc`, `ruff.toml`/`pyproject.toml`'s `[tool.ruff]`, `.flake8`, `mypy.ini`/`pyrightconfig.json`, `tsconfig.json`, `go.mod`/`.golangci.yml`, `.rubocop.yml`, `checkstyle.xml`, a test-runner config (`jest.config`, `vitest.config`, `pytest.ini`), a SAST/dependency-scanner config (`.semgrep.yml`, `.snyk`, `codeql.yml`, `trivy.yaml`, `.bandit`), `.pre-commit-config.yaml`, `.editorconfig`. Record what each declares — existence alone is not the finding, its content is. ESLint's own severity levels (`off`/0, `warn`/1, `error`/2) and its documented inline-disable format with a reason comment (ESLint team, official framework documentation, current, https://eslint.org/docs/latest/use/configure/rules) give this inventory something concrete to check each config against; `tsconfig.json`'s `strict` flag is itself a documented family of sub-flags (Microsoft (TypeScript team), official language documentation, current, https://www.typescriptlang.org/tsconfig/#strict); Biome ships "532 rules" with three distinct ways to disable them (Biome team, official framework documentation, current, https://biomejs.dev/linter/); and `.pre-commit-config.yaml` wires hooks into git via `pre-commit install` (pre-commit (Anthony Sottile), official tool documentation, current, https://pre-commit.com/).
10
+ - [ ] Where a TypeScript project's typescript-eslint config (flat-config array or legacy `extends` array) declares `recommended` with no `strict`/`strict-type-checked` entry alongside it — `search_code`/`Read` the config for the extends list — it is choosing the weaker tier, and the finding is that choice with no documented reason, not `strict`'s presence as a package: typescript-eslint ships `recommended` and `strict` from the same package, so `strict` being installed proves nothing about which tier the config actually extends. typescript-eslint's own docs describe `strict` as strictly additive to `recommended` and "more opinionated... might not apply to all projects" (typescript-eslint team, official framework documentation, current, https://typescript-eslint.io/users/configs) — framing this as a real, documented choice a project can make or fail to make consciously. Refuted if the project has a documented reason to stay on `recommended` (e.g. `strict` was tried and reverted per a comment or commit message found via `search_code`) — a deliberate choice is not a gap.
11
+ - [ ] Read the inventory above for a category the project tools while leaving an adjacent one it clearly needs untooled — a Python API handling auth with no `bandit`/`semgrep` beside its `ruff` config — note the asymmetry; a gap in an otherwise-tooled project says more than a gap in an untooled one.
11
12
  - [ ] Version-pin the tools themselves — `search_code` the manifest/lockfile for each tool's declared version. An unpinned linter/formatter version means the ruleset it enforces can shift between a CI run and a fresh clone without anyone touching the config.
13
+ - [ ] `search_code` for a `.husky/` directory and a `lint-staged` config (a `lint-staged` key in `package.json`, or `.lintstagedrc*`) alongside the existing `.pre-commit-config.yaml` search — where found, confirm via `search_code` on the CI workflow that the same commands the hook runs also appear as an explicit CI step; a Husky pre-commit hook is bypassable with `git commit --no-verify` exactly as a pre-commit hook is, so without CI parity its guarantee is local-only. Husky's own docs describe exactly this local-hook mechanism — git `core.hooksPath` wired via the npm `prepare` script — without stating any CI-parity guarantee (typicode (Husky), official tool documentation, current, https://typicode.github.io/husky/), the same asymmetry this module already names for pre-commit's Python-ecosystem file. Refuted if `lint-staged` invokes the identical linter/formatter binaries that a separate, already-inventoried CI step runs directly (not via `lint-staged`) on the full tree — the guarantee exists, just under a different invocation, and this is not a gap.
12
14
 
13
15
  ## Declared versus enforced
14
16
 
15
17
  The central check: a rule in a config nothing runs is a rule nobody obeys, and a scan that runs but does not gate the merge is theatre with a green checkmark.
16
18
 
17
19
  - [ ] For every config found above, confirm a CI step actually invokes it — `search_code` the CI workflow files for the tool's run command (`eslint`, `ruff check`, `mypy`, `go vet`, `semgrep ci`). A config present with no matching CI invocation is enforced only on whichever machine happens to run it locally, if any does.
18
- - [ ] Where CI does invoke it, confirm the step's failure fails the build. Cross-reference `devops.md`'s Pipeline integrity checks for the mechanics (`continue-on-error`, `|| true`, `--passWithNoTests`) — this module confirms the check exists and is wired in, `devops.md` owns whether it can actually fail; do not re-run that probe here.
19
- - [ ] Where a pre-commit framework is configured, confirm the same hooks also run in CI, not only pre-commit — diff `.pre-commit-config.yaml`'s hook list against the CI workflow's step list. A hook that only pre-commit runs is bypassable with `--no-verify` or a clone that skipped `pre-commit install`.
20
- - [ ] A scanner or checker that runs in CI but does not gate the merge — read the job's position in the workflow: a security-scan job with no branch-protection tie or `needs:` dependency feeding the merge check is informational only, and a red result there stops nothing.
20
+ - [ ] `search_code` the CI workflow for the tool's run command and confirm the step is wired into the gating job. Whether that step's failure can actually fail the build (`continue-on-error`, `|| true`, `--passWithNoTests`) is `devops.md`'s Pipeline integrity check; this module confirms only that the tool runs and is wired in. GitHub's own branch-protection docs are the reason wiring alone is not enough: "all required status checks must pass before collaborators can merge," but a check that runs and is never marked required does not block anything (GitHub, official product documentation, current, https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches).
21
+ - [ ] Where a pre-commit framework is configured, confirm the same hooks also run in CI, not only pre-commit — Read `.pre-commit-config.yaml`'s hook list and diff it against the CI workflow's step list. A hook that only pre-commit runs is bypassable with `--no-verify` or a clone that skipped `pre-commit install`. pre-commit's own docs are explicit that its hooks are bypassable per-hook via `SKIP` or wholesale via `--no-verify`, and separately document `pre-commit run --all-files` as the specific CI recipe for full-tree coverage (pre-commit (Anthony Sottile), official tool documentation, current, https://pre-commit.com/).
22
+ - [ ] Where the pre-commit-in-CI check above finds a `pre-commit run` invocation, `search_code` for whether `--all-files` is present — a bare `pre-commit run` in CI checks only the diff against the workflow's checkout base, which is narrower than what "the same hooks also run in CI" implies and can pass while files outside that diff still violate every configured hook. pre-commit's own CI guidance names `pre-commit run --all-files` as the specific recipe for "everything stays in tip-top shape" (pre-commit (Anthony Sottile), official tool documentation, current, https://pre-commit.com/), implying the flag is what makes a CI invocation equivalent in coverage to a full local run. Refuted if the CI job is intentionally scoped to changed-files-only as a fast pre-check ahead of a separate full-tree job later in the same workflow — confirm the second job exists before flagging.
23
+ - [ ] A scanner or checker that runs in CI but does not gate the merge — Read the job's position in the workflow: a security-scan job with no branch-protection tie or `needs:` dependency feeding the merge check is informational only, and a red result there stops nothing. With no required checks configured, GitHub's own docs state plainly "the branch has no merge restrictions" — a scan that runs is not the same fact as a scan that gates (GitHub, official product documentation, current, https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches).
21
24
 
22
25
  ## Suppression inventory
23
26
 
24
27
  The gap between what a tool would flag and what it actually flags. This owns the general shape; `type-safety.md` owns type-checker suppression density specifically — do not re-derive that count here.
25
28
 
26
- - [ ] Root-level rule disables across every config found in Inventory — `search_code` each config for a rules-off block (`"off"`/`0` in an eslint config, a bare `ignore =` in ruff/flake8, `disable=` in `.rubocop.yml`) — each is a policy decision covering the whole tree; list what it would otherwise have caught.
27
- - [ ] Per-file and per-line suppressions, tallied separately from root-level ones — `search_code` for inline disable comments (`eslint-disable-next-line`, `# noqa`, `# pragma: no cover`, `// nolint`) and group by file. A cluster in one file is a different finding than the same count spread thin.
28
- - [ ] Ignore files and exclude globs wide enough to remove a whole directory — read `.eslintignore`/`ignorePatterns`, `.prettierignore`, and each scanner's `exclude`/`paths-ignore`. A glob matching `**/legacy/**` or a `generated/` directory that is in fact hand-edited silently drops it from every check that config runs, not just one.
29
- - [ ] Confirm the type checker itself is inventoried and wired in per the checks above, but stop there — `any`/`@ts-ignore`/`# type: ignore` density, reason-carrying, and scope are `type-safety.md`'s probes, not this module's.
29
+ - [ ] Root-level rule disables across every config found in Inventory — `search_code` each config for a rules-off block (`"off"`/`0` in an eslint config, a bare `ignore =` in ruff/flake8, `disable=` in `.rubocop.yml`) — each is a policy decision covering the whole tree; list what it would otherwise have caught. ESLint's own severity model treats `"off"`/`0` as a first-class, documented setting, not an edge case — which is exactly why it needs auditing as a policy decision rather than assumed rare (ESLint team, official framework documentation, current, https://eslint.org/docs/latest/use/configure/rules).
30
+ - [ ] Where `tsconfig.json` sets `"strict": true`, `search_code` the same file (and any extended base config) for any of the strict-family flags (`noImplicitAny`, `strictNullChecks`, `strictFunctionTypes`, `strictBindCallApply`, `strictPropertyInitialization`, `noImplicitThis`, `alwaysStrict`, `useUnknownInCatchVariables`, `strictBuiltinIteratorReturn`) explicitly set to `false` alongside it — this silently narrows the guarantee `"strict": true` advertises to a reader without changing that flag's own visible value. TypeScript's own docs: `strict` "enables... all of the strict mode family options. You can then turn off individual strict mode family checks as needed" (Microsoft (TypeScript team), official language documentation, current, https://www.typescriptlang.org/tsconfig/#strict) — an officially supported but auditable pattern for silently weakening a guarantee that reads as fully strict. Refuted if the narrowed flag is scoped to a `tsconfig.*.json` covering only generated/vendored/legacy code via `include`/`exclude` (cross-reference the Coverage-of-the-tree check), not the production source tree.
31
+ - [ ] Per-file and per-line suppressions, tallied separately from root-level ones — `search_code` for inline disable comments (`eslint-disable-next-line`, `# noqa`, `# pragma: no cover`, `// nolint`) and group by file. A cluster in one file is a different finding than the same count spread thin. ESLint's own docs document an optional `--` reason section for disable comments and state that inline disables "should not be the default solution to resolve linting errors" (ESLint team, official framework documentation, current, https://eslint.org/docs/latest/use/configure/rules).
32
+ - [ ] Among the per-line suppressions tallied above, `search_code` for a disable comment with no reason text after it (a bare `eslint-disable-next-line no-console` versus `eslint-disable-next-line no-console -- reason`) and count them separately from justified ones — an unexplained suppression is unauditable by anyone but the author who wrote it. ESLint's own docs make the reason-comment format (the `--` section) the documented convention and state inline disables "should not be the default solution" (ESLint team, official framework documentation, current, https://eslint.org/docs/latest/use/configure/rules) — an undocumented one is the weaker case of an already-discouraged pattern. Refuted if the surrounding two lines of context make the reason self-evident (e.g. a suppressed rule immediately above a comment explaining the whole block) — quote that context before counting it as unexplained.
33
+ - [ ] Where `biome.json` is present, `search_code` for Biome's own suppression comments (`// biome-ignore <rule>: <reason>` and top-level suppressions) and tally them the same way as the ESLint/ruff/rubocop patterns already checked, plus `search_code` the lint script in `package.json`/CI for a `--skip=<group|rule>` flag, which is a root-level suppression invisible inside `biome.json` itself. Biome documents three distinct suppression surfaces — config `"off"`, inline/top-level suppression comments, and CLI `--skip` (Biome team, official framework documentation, current, https://biomejs.dev/linter/) — only the first of which a generic `search_code` for the existing suppression patterns would catch. `Medium` for a `--skip` flag found in the run command (parallels the existing root-level rule-disable row); `Info` for an individually justified `biome-ignore` comment (parallels the existing per-line row). Refuted if the `--skip`'d group is `nursery` (Biome's own unstable/experimental rule tier), which is a version-maturity exclusion, not a suppression of a stable finding.
34
+ - [ ] Ignore files and exclude globs wide enough to remove a whole directory — Read `.eslintignore`/`ignorePatterns`, `.prettierignore`, and each scanner's `exclude`/`paths-ignore`. A glob matching `**/legacy/**` or a `generated/` directory that is in fact hand-edited silently drops it from every check that config runs, not just one.
35
+ - [ ] Read the Inventory and Declared-versus-enforced checks above to confirm the type checker itself is inventoried and wired in, but stop there — `any`/`@ts-ignore`/`# type: ignore` density, reason-carrying, and scope are `type-safety.md`'s probes, not this module's.
30
36
 
31
37
  ## Committed tool output
32
38
 
33
39
  - [ ] `search_code` for a committed SARIF file, coverage report (`coverage/`, `lcov.info`, `.coverage`), scanner baseline, or audit log checked into the repo. Where one exists, read it directly — it is `read`-tier evidence a deterministic tool produced, not evidence this audit reasoned out, and it is the strongest input available to the rest of the audit.
34
- - [ ] Check its staleness before citing it — compare its embedded timestamp or generation commit against the current state of the files it describes. A report generated before the code it covers last changed is describing a version of the code that no longer exists.
35
- - [ ] Where a coverage report is committed, read the numbers for the specific modules other findings in this audit touch, and cite them directly rather than estimating — this is measured, not inferred, even though `testing.md` owns the qualitative test-quality checks around it.
36
- - [ ] A committed report showing zero findings from a scanner not wired into CI (per Declared versus enforced) is not evidence the code is clean — it is evidence of one run, possibly stale, that nothing repeats. State which is true before treating either as clean; a confident zero is exactly the "bug-free" framing that measurably suppresses detection elsewhere in this audit, and this module is where that framing enters.
40
+ - [ ] Check its staleness before citing it — Read its embedded timestamp or generation commit and compare it against the current state of the files it describes. A report generated before the code it covers last changed is describing a version of the code that no longer exists.
41
+ - [ ] Where a coverage report is committed, Read the numbers for the specific modules other findings in this audit touch, and cite them directly rather than estimating — this is measured, not inferred, even though `testing.md` owns the qualitative test-quality checks around it.
42
+ - [ ] Read the committed report's own CI-wiring status (per Declared versus enforced) before citing its zero findings as clean — a committed report showing zero findings from a scanner not wired into CI is not evidence the code is clean, it is evidence of one run, possibly stale, that nothing repeats. State which is true before treating either as clean; a confident zero is exactly the "bug-free" framing that measurably suppresses detection elsewhere in this audit, and this module is where that framing enters.
37
43
 
38
44
  ## Baseline files
39
45
 
40
46
  - [ ] Locate a baseline/ignore-existing-violations file for any scanner or linter (`.rubocop_todo.yml`, a generated ESLint baseline, a SonarQube/Semgrep baseline snapshot, mypy's `--baseline` output) — `search_code` for the tool's baseline-generation flag or a file matching its documented baseline naming.
41
- - [ ] Confirm the baseline only ever shrinks — check whether CI compares against it for new entries, or whether the baseline-regeneration command runs as part of the normal lint step, which re-freezes every current violation as newly accepted on every run. A baseline that regenerates itself is not a baseline, it is a ratchet permanently stuck at zero, and that is a finding, not neutral infrastructure.
42
- - [ ] A baseline with no visible owner, date, or shrink target is itself the finding — nobody is accountable for burning it down, and the tool it fronts has quietly become decoration for the code frozen inside it.
47
+ - [ ] Confirm the baseline only ever shrinks — `search_code` the CI config for a step comparing against it for new entries, versus the baseline-regeneration command running as part of the normal lint step, which re-freezes every current violation as newly accepted on every run. A baseline that regenerates itself is not a baseline, it is a ratchet permanently stuck at zero, and that is a finding, not neutral infrastructure.
48
+ - [ ] Read the baseline file located above for a visible owner, date, or shrink target — its absence is itself the finding: nobody is accountable for burning it down, and the tool it fronts has quietly become decoration for the code frozen inside it.
43
49
 
44
50
  ## Coverage of the tree
45
51
 
46
52
  - [ ] For each config's `include`/`exclude`, confirm which top-level directories it actually reaches — read the scope against `list_modules` or the repo tree. Generated code, vendored dependencies, and test directories excluded on purpose are correct; the same exclusion silently covering a feature directory is not.
47
- - [ ] Confirm test directories are excluded from *production-only rules*, not from the type checker outright — a config that drops `**/*.test.*` from type-checking entirely, rather than relaxing specific rules, lets test code drift from the types it exercises unnoticed. Cross-reference the test-time erosion check in `type-safety.md`.
53
+ - [ ] `search_code` the type-checker config for test directories excluded from *production-only rules* versus excluded from the type checker outright — a config that drops `**/*.test.*` from type-checking entirely, rather than relaxing specific rules, lets test code drift from the types it exercises unnoticed. Cross-reference the test-time erosion check in `type-safety.md`.
48
54
  - [ ] In a monorepo, confirm every package actually inherits the root config rather than shadowing it — `search_code` each package's own config for one that redefines rather than extends the root. A shadowed config is silent scope-narrowing nobody had to justify.
49
55
 
50
56
  ## What absence means
51
57
 
52
- - [ ] Where Inventory found no linter, no type checker, and no test runner at all for a language capable of having them, state it plainly: every defect this audit reports in that code was invisible to automation before this audit ran, and will be again the moment it ends. That is a scoping instruction for the rest of the module selection, not a caveat — `consistency.md` and `reachability.md` carry more weight here because nothing else is checking.
53
- - [ ] Where tooling covers one language or surface in a polyglot repo but not another — TypeScript linted, a Python service beside it left bare — name the asymmetry directly; it usually tracks which surface a team actually owns.
58
+ - [ ] Read the Inventory list above for a language capable of having a linter, type checker, or test runner that has none at all, and state it plainly: every defect this audit reports in that code was invisible to automation before this audit ran, and will be again the moment it ends. That is a scoping instruction for the rest of the module selection, not a caveat — `consistency.md` and `reachability.md` carry more weight here because nothing else is checking.
59
+ - [ ] `list_modules` to see every surface in a polyglot tree, then compare tooling coverage across them — TypeScript linted, a Python service beside it left bare — name the asymmetry directly; it usually tracks which surface a team actually owns.
54
60
 
55
61
  ## Out of static reach
56
62
 
@@ -58,7 +64,10 @@ The gap between what a tool would flag and what it actually flags. This owns the
58
64
  - Whether required CI checks are enforced by branch protection — a platform setting, not a file; cross-reference `devops.md`, which names this the same way.
59
65
  - Real flake or noise rate of a configured scanner — only observable from run history this audit cannot read.
60
66
  - Whether a tool absent from this repo runs upstream, in a monorepo sibling, or in an organisation-wide pipeline this audit cannot see.
61
- - Whether a committed report's zero findings reflect a genuinely clean pass or a scanner misconfigured to match nothing.
67
+ - Whether a committed report's zero findings reflect a genuinely clean pass or a scanner misconfigured to match nothing — closed by `runtime.md` when execution is enabled: it reruns the same scanner and diffs against the committed report.
68
+ - Whether `.editorconfig` (or any local-only hook config) is actually honored on a given contributor's machine — that depends on each person's own editor/tooling setup, invisible from the repository.
69
+ - Whether local git hooks are actually installed and firing on a given contributor's clone — that is local machine state, not something this audit's static read can confirm.
70
+ - Whether a branch-protection-required check was actually executed and passed, versus satisfied by being skipped or reported neutral — that is GitHub's run history, a platform state this audit's file read cannot see.
62
71
 
63
72
  ## Severity guidance
64
73
 
@@ -72,6 +81,13 @@ The gap between what a tool would flag and what it actually flags. This owns the
72
81
  | Root-level suppression disabling a rule tree-wide with no stated reason | Medium |
73
82
  | Exclude glob silently covering a live feature directory | Medium |
74
83
  | Baseline file with no owner, date, or shrink target | Medium |
84
+ | `tsconfig.json` sets `strict: true` with an individual strict-family flag explicitly turned back off outside a generated/vendored/legacy scope | Medium |
85
+ | Biome lint invocation carries an undocumented `--skip=<group\|rule>` flag | Medium |
86
+ | `pre-commit run` wired into CI without `--all-files`, checking only the diff rather than the full tree | Medium |
87
+ | Husky/lint-staged pre-commit hook with no matching CI step running the same commands | Medium |
75
88
  | Tooling asymmetry across languages/surfaces in one repo | Low |
76
89
  | Unpinned tool version in manifest/lockfile | Low |
90
+ | Bare suppression comment with no stated reason | Low |
91
+ | TypeScript project extends `recommended` typescript-eslint config with no `strict`/`strict-type-checked` entry and no documented reason | Low |
77
92
  | Isolated, justified per-line suppression | Info |
93
+ | Biome `biome-ignore` comment with a stated reason | Info |
@@ -6,44 +6,48 @@ A type checker is only as strong as the code's willingness to obey it. This modu
6
6
 
7
7
  ## Establish the baseline first
8
8
 
9
- - [ ] Locate the checker config: `search_code` for `tsconfig.json`, `mypy.ini`, `pyrightconfig.json`, `go.mod` (Go's checker is the compiler itself, not opt-in), `.flowconfig`. Record which strictness flags are actually set — `strict`, `noImplicitAny`, `strictNullChecks`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes` for TypeScript; `strict = True`, `disallow_untyped_defs`, `warn_return_any`, `warn_unreachable` for mypy. **Check the TypeScript major version first** (`package.json`): TypeScript 6.0 (March 2026) flipped `strict`'s default from `false` to `true` when the field is unset, and TypeScript 7.0 (July 2026, the native Go-ported compiler — current as of this writing) hardens that into a locked-in default. On TypeScript ≥6, an *absent* `strict` field means strict is already on — the finding worth chasing on a current project is an explicit `"strict": false` or a per-flag override that turns a strict-bundled check back off, not the field's absence. On TypeScript <6, absence still means unstrict, as this module originally assumed.
10
- - [ ] `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes` are never implied by `strict: true`, on any TypeScript version — both must be opted into individually. `noUncheckedIndexedAccess` adds `| undefined` to indexed-access results (`obj[key]` stops pretending the key is guaranteed present); `exactOptionalPropertyTypes` stops treating an omitted optional property the same as one explicitly set to `undefined`. Their absence from a config that otherwise looks maximally strict is a real, checkable gap, not house-style pedantry. mypy's equivalent gap is `warn_unreachable` — not included in `--strict` on any current mypy version, and the effective `--strict` flag set is documented to change between releases, so read it from the version actually pinned rather than assuming a fixed list.
11
- - [ ] **If the language is statically or gradually typed and no checker config exists anywhere in the tree, stop here and report that as the finding.** Nothing below applies to code nobody is checking.
9
+ - [ ] Locate the checker config: `search_code` for `tsconfig.json`, `mypy.ini`, `pyrightconfig.json`, `go.mod` (Go's checker is the compiler itself, not opt-in), `.flowconfig`. Record which strictness flags are actually set — `strict`, `noImplicitAny`, `strictNullChecks`, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes` for TypeScript; `strict = True`, `disallow_untyped_defs`, `warn_return_any`, `warn_unreachable` for mypy. **Check the TypeScript major version first** (`package.json`): TypeScript 6.0 (March 2026) flipped `strict`'s default from `false` to `true` when the field is unset — "most new projects want `strict` mode enabled" (Microsoft/TypeScript team, official release announcement, 2026, https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/) — and TypeScript 7.0 (July 2026, the native Go-ported compiler — current as of this writing) carries 6.0's `strict: true` default forward unchanged — it does not remove the ability to set `"strict": false`, so an explicit override in a 7.0 project is a deliberate choice to flag, not evidence of a stale or broken config (Microsoft/TypeScript team, official release announcement, 2026, https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/). On TypeScript ≥6, an *absent* `strict` field means strict is already on — the finding worth chasing on a current project is an explicit `"strict": false` or a per-flag override that turns a strict-bundled check back off, not the field's absence. On TypeScript <6, absence still means unstrict, as this module originally assumed.
10
+ - [ ] For a Python project using pyright, `Read` `pyrightconfig.json`'s `typeCheckingMode` (or `pyproject.toml`'s `[tool.pyright]` table). An absent field is not "unchecked" — pyright's own default is `"standard"`, a real ruleset — but it is also not `"strict"`: strict elevates roughly 30 additional rules (mandatory parameter/return annotations, `strictListInference`/`strictDictionaryInference`/`strictSetInference`, explicit generic type arguments) that standard leaves off (Microsoft/Pyright team, official documentation, current, https://github.com/microsoft/pyright/blob/main/docs/configuration.md). A codebase that looks fully annotated but was never bumped past the implicit default is passing a materially weaker check than its annotation density suggests. Refuted if the project explicitly and documentedly chose `"standard"` as policy (a CONTRIBUTING note, a CI comment, an ADR) rather than never having touched the setting; also confirm the file exists at all, since a genuinely absent config is the "no checker configured" finding above, not this one.
11
+ - [ ] `search_code` the checker config for `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes` — neither is ever implied by `strict: true`, on any TypeScript version; both must be opted into individually (Microsoft/TypeScript team, official framework documentation, TSConfig Reference, current, https://www.typescriptlang.org/tsconfig/#noUncheckedIndexedAccess). `noUncheckedIndexedAccess` adds `| undefined` to indexed-access results (`obj[key]` stops pretending the key is guaranteed present); `exactOptionalPropertyTypes` stops treating an omitted optional property the same as one explicitly set to `undefined`. Their absence from a config that otherwise looks maximally strict is a real, checkable gap, not house-style pedantry. mypy's equivalent gap is `warn_unreachable` — "not automatically enabled by the strict flag," and not part of the documented 13-flag `--strict` set on any current mypy version, so read it from the version actually pinned rather than assuming a fixed list (mypy core team, official documentation, current, https://mypy.readthedocs.io/en/stable/command_line.html).
12
+ - [ ] **If `search_code` above found no checker config anywhere in the tree for a statically or gradually typed language, stop here and report that as the finding.** Nothing below applies to code nobody is checking.
12
13
  - [ ] A config that declares strictness but scopes it away: `exclude` covering half the source tree, a `// @ts-nocheck` at file scope, a per-directory override that relaxes the root config. Read the `include`/`exclude` arrays literally — a strict root config with a permissive override is a strict config in name only.
13
14
 
14
15
  ## Suppression directives and their density
15
16
 
16
- - [ ] `search_code` for `: any`, `as any`, `@ts-ignore`, `@ts-expect-error`, `# type: ignore`, `# noqa`, `@SuppressWarnings`, `interface{}` (Go), `unknown as`, `!` non-null assertion clusters. Count occurrences and note which files concentrate them — a handful spread across a large codebase is normal drift; a third of one module is that module opting out of the type system entirely.
17
- - [ ] Each suppression should carry a reason — a comment or a linked issue explaining *why* the checker cannot express what's true here. A bare `@ts-ignore` with no comment is a silenced error, not a documented exception; distinguish the two counts.
18
- - [ ] `@ts-expect-error` vs `@ts-ignore` (or the mypy equivalent, a scoped `# type: ignore[code]` vs a bare one): the former fails loudly when the underlying error is fixed and the suppression becomes stale; the latter fails silently forever. A codebase using only the bare form has no mechanism to notice when a suppression outlives its cause.
19
- - [ ] Suppressions wrapping a large block rather than one line — the broader the scope, the more real errors it can be hiding besides the one it was written for.
17
+ - [ ] `search_code` for `: any`, `as any`, `@ts-ignore`, `@ts-expect-error`, `# type: ignore`, `# noqa`, `@SuppressWarnings`, `interface{}` (Go), `unknown as`, `!` non-null assertion clusters. Count occurrences and note which files concentrate them — a handful spread across a large codebase is normal drift; a third of one module is that module opting out of the type system entirely. "Using `any` disables all further type checking, and it is assumed you know the environment better than TypeScript" (Microsoft/TypeScript team, official handbook, current, https://www.typescriptlang.org/docs/handbook/2/everyday-types.html).
18
+ - [ ] Read each suppression found above for a reason — a comment or a linked issue explaining *why* the checker cannot express what's true here. A bare `@ts-ignore` with no comment is a silenced error, not a documented exception; distinguish the two counts.
19
+ - [ ] `search_code` for `@ts-expect-error` vs `@ts-ignore` (or the mypy equivalent, a scoped `# type: ignore[code]` vs a bare one): the former fails loudly when the underlying error is fixed and the suppression becomes stale; the latter fails silently forever. A codebase using only the bare form has no mechanism to notice when a suppression outlives its cause.
20
+ - [ ] Read each suppression found above for one wrapping a large block rather than one line — the broader the scope, the more real errors it can be hiding besides the one it was written for.
20
21
  - [ ] `any` on an **exported/public** function's parameter or return type specifically — `find_callers` to see how far the unsafety spreads. `any` inside a private helper's body is contained; `any` on a public signature leaks to every caller and their callers, silently.
21
- - [ ] The double-cast pattern `as unknown as X` (or `# type: ignore` immediately followed by a direct field access). A single `as X` at least has to satisfy some structural overlap with the source type; routing through `unknown` first discards that check entirely and admits the checker has nothing useful to say here.
22
+ - [ ] `search_code` for the double-cast pattern `as unknown as X` (or `# type: ignore` immediately followed by a direct field access). A single `as X` at least has to satisfy some structural overlap with the source type; routing through `unknown` first discards that check entirely and admits the checker has nothing useful to say here. "Because type assertions are removed at compile-time, there is no runtime checking associated with a type assertion" (Microsoft/TypeScript team, official handbook, current, https://www.typescriptlang.org/docs/handbook/2/everyday-types.html).
23
+ - [ ] `search_code` for `unknown` type usage across the codebase. A codebase with boundary-crossing code already located below (network responses, `JSON.parse`, webhook payloads) but zero or near-zero `unknown` occurrences suggests every genuinely-unstructured value was typed `any` instead of TypeScript's safer counterpart — `unknown` permits no property access, call, or arithmetic without a preceding `typeof`/`instanceof`/type-guard narrowing, where `any` permits everything unchecked; TypeScript's own release notes document `unknown` as requiring narrowing before any operation, "the type-safe counterpart of `any`" (Microsoft/TypeScript team, official handbook / TypeScript 3.0 release notes, current, https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html). Refuted if a runtime-validation library (zod/io-ts/pydantic, checked below) absorbs the narrowing internally and never surfaces `unknown` in application code — confirm the library is actually applied at the relevant boundaries before treating the absence as evidence of `any`-only handling.
22
24
 
23
25
  ## Boundary typing — the single most common failure
24
26
 
25
27
  Data crossing a trust boundary — a network response, `JSON.parse`, an environment variable, a database row, form input, a webhook payload — is typed by *assertion* (`as ResponseType`, a generic type parameter on `fetch`, an unchecked cast) rather than validated at runtime. This is the gap between "the code compiles" and "the type is true." TypeScript has not closed this gap natively: its types remain fully erased at compile time on every current version, including the 7.0 Go-ported compiler — there is no first-party mechanism to check a value's shape at runtime from a `type`/`interface` declaration, so a runtime validation library is not optional tooling here, it is the only fix that exists.
26
28
 
27
- - [ ] `search_code` for `as ` immediately following `JSON.parse(`, `.json()`, or an HTTP client call. An assertion here tells the checker to trust unverified bytes.
28
- - [ ] `search_code` for a runtime validation library (`zod` — v4 current, tree-shakeable imports — `io-ts`, `pydantic` — v2 current, Rust core — `class-validator`, `ajv`) and check whether it is actually applied at every boundary, or only at some of them — a `zod` schema imported by three of eight route handlers is five unvalidated ones. Also check the schema isn't overloaded with domain rules beyond parsing/shape validation — current practice keeps boundary validation and business-logic validation as separate steps, so a schema that half-does both is harder to audit for boundary coverage.
29
- - [ ] Environment variable access (`process.env.X`, `os.environ[...]`) typed as a non-optional string with no runtime check that it was actually set. The type says `string`; the runtime value can be `undefined`.
30
- - [ ] ORM query results whose row type is generated from the schema but whose *nullability* doesn't reflect an actual `LEFT JOIN` or optional relation in that specific query — the generated type is correct for the general case and wrong for this call site.
31
- - [ ] Generic type parameters on an HTTP client (`fetch<User>(...)`, `axios.get<User>(...)`) with no corresponding runtime check — this is an assertion wearing generic syntax, not a guarantee.
32
- - [ ] Route/query parameters typed as a narrow literal union (`'asc' | 'desc'`) but read from `req.query`/`req.params` with a bare cast rather than a runtime check — the URL can carry any string, and the type only describes the values the author expected, not the values a client can actually send.
29
+ - [ ] `search_code` for `as ` immediately following `JSON.parse(`, `.json()`, or an HTTP client call. An assertion here tells the checker to trust unverified bytes. Rule out a cast on a value that a preceding line in the same function already ran through a validator — read the few lines above the cast before flagging. "Because type assertions are removed at compile-time, there is no runtime checking associated with a type assertion" (Microsoft/TypeScript team, official handbook, current, https://www.typescriptlang.org/docs/handbook/2/everyday-types.html).
30
+ - [ ] `search_code` for a runtime validation library (`zod` — v4 current; `zod/mini` for tree-shakeable imports — `io-ts`, `pydantic` — v2 current, Rust core — `class-validator`, `ajv`) and check whether it is actually applied at every boundary, or only at some of them — a `zod` schema imported by three of eight route handlers is five unvalidated ones. Also check the schema isn't overloaded with domain rules beyond parsing/shape validation — current practice keeps boundary validation and business-logic validation as separate steps, so a schema that half-does both is harder to audit for boundary coverage. This is "parse, don't validate": "the difference between validation and parsing lies almost entirely in how information is preserved," and a parser returns a refined type that embeds the guarantee so downstream code never has to re-check it (Alexis King, canonical technical essay, 2019, https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/). `io-ts`'s `.decode()` and Zod's `.parse()` are the concrete implementations — Zod is "designed for runtime data validation at critical application boundaries — API responses, form submissions, and environment variables" (Colin McDonnell / Zod, official library documentation, current, https://zod.dev/ and https://zod.dev/basics; Giulio Canti / io-ts, official library documentation, current, https://github.com/gcanti/io-ts/blob/master/index.md).
31
+ - [ ] `search_code` for a hand-written `type`/`interface` declaration whose name mirrors a runtime-validation schema (e.g. `UserSchema` alongside a separately declared `interface User`) rather than the type being derived from the schema (`z.infer<typeof UserSchema>` for zod, `t.TypeOf<typeof Codec>` for io-ts). Two independently maintained declarations for the same boundary shape are a drift risk the type checker cannot catch: editing one and forgetting the other still compiles cleanly — deriving the static type from the schema maintains "a single source of truth" between the runtime schema and the static type, implying the hand-duplicated alternative is the documented anti-pattern (Colin McDonnell / Zod, official library documentation, current, https://zod.dev/). Refuted if the interface intentionally diverges from the schema on purpose — the schema validates a raw wire format that is deliberately transformed into a richer domain type before use — check for a mapping/transform function between the two before flagging as accidental drift.
32
+ - [ ] `search_code` for environment variable access (`process.env.X`, `os.environ[...]`) typed as a non-optional string with no runtime check that it was actually set. The type says `string`; the runtime value can be `undefined`.
33
+ - [ ] `search_code` for `LEFT JOIN` or the ORM's join/`include` method, then `Read` the generated row type for that query against the join's optionality — the generated type is correct for the general case and wrong when *this* query's nullability doesn't reflect an actual `LEFT JOIN` or optional relation.
34
+ - [ ] `Read` the same call sites located above for a generic type parameter on the HTTP client instead of a bare cast (`fetch<User>(...)`, `axios.get<User>(...)`) — same finding wearing generic syntax, with no corresponding runtime check.
35
+ - [ ] `search_code` for route/query parameters typed as a narrow literal union (`'asc' | 'desc'`) but read from `req.query`/`req.params` with a bare cast rather than a runtime check — the URL can carry any string, and the type only describes the values the author expected, not the values a client can actually send.
36
+ - [ ] `search_code` for a strict-equality (`===`) or `typeof` guard applied directly to a parsed query-string, JSON-body, or path-parameter value without a preceding array/object shape check (e.g. `req.query.sort === 'asc'`, `path === '__proto__'`). A client can supply an array or object where a scalar was assumed; `===`/`typeof` comparisons against the wrong runtime type silently evaluate to `false` rather than throwing, so the guard is bypassed, not tripped. This is the same class of bug the `immer` prototype-pollution bypass exploited: a security check that assumed a string got an array instead, and the equality comparison never caught it (CVE-2021-23436, CVSS 9.8, MITRE/NVD via GitHub Security Advisory, 2021, https://github.com/advisories/GHSA-33f9-j839-rf8h). Refuted if an upstream parsing layer or validation middleware already guarantees scalar-only values for this specific parameter before the guard runs — check the route's middleware chain / the framework's query-parser configuration before flagging; a guard on a value that is provably always server-generated (never client-supplied) is also not this finding.
33
37
 
34
38
  ## Lint-level escape hatches
35
39
 
36
- - [ ] Lint rules that would catch unsafe patterns (`@typescript-eslint/no-explicit-any`, `@typescript-eslint/no-unsafe-assignment`, `flake8` type-adjacent rules) disabled at the config root versus disabled per-line. A root-level disable is a policy decision; per-line disables should each carry the same reasoning bar as a suppression directive above.
37
- - [ ] The disable comment's scope: `/* eslint-disable */` for a whole file silences everything after it, including future violations nobody intended to allow.
40
+ - [ ] `search_code` the lint config for rules that would catch unsafe patterns (`@typescript-eslint/no-explicit-any`, `@typescript-eslint/no-unsafe-assignment`, `flake8` type-adjacent rules) disabled at the config root versus disabled per-line. A root-level disable is a policy decision; per-line disables should each carry the same reasoning bar as a suppression directive above.
41
+ - [ ] `search_code` for the disable comment's scope: `/* eslint-disable */` for a whole file silences everything after it, including future violations nobody intended to allow.
38
42
 
39
43
  ## Generated types
40
44
 
41
- - [ ] Types generated from an external source — an OpenAPI spec, a GraphQL schema, a database schema, protobuf — are actually regenerated in CI or on a documented trigger, not hand-edited after generation. `search_code` for the generation command in CI config; its absence means the committed types are a snapshot, not a contract. Cross-reference `contract-drift.md`, which owns whether the generated types still match the source of truth — this module only asks whether generation itself is live or has silently become manual.
45
+ - [ ] Generated types regenerated in CI — owned by `contract-drift.md` (`search_code` the CI config for the generation command); reuse its finding, do not re-report.
42
46
  - [ ] Hand-edits inside a file whose header says "auto-generated, do not edit" — `search_code` the generated-file banner text, then check for local modifications. The next regeneration silently reverts them.
43
47
 
44
48
  ## Test-time type erosion
45
49
 
46
- - [ ] Mocks and test doubles typed as `any` or with a partial/loose shape rather than satisfying the real interface. A production interface change that should break a test compile-time instead breaks nothing, because the mock never had to agree with the real type in the first place — the very place a type error would be cheapest to catch is where it's silenced.
50
+ - [ ] `search_code` for mocks and test doubles typed as `any` or with a partial/loose shape rather than satisfying the real interface. A production interface change that should break a test compile-time instead breaks nothing, because the mock never had to agree with the real type in the first place — the very place a type error would be cheapest to catch is where it's silenced. "Using `any` disables all further type checking" (Microsoft/TypeScript team, official handbook, current, https://www.typescriptlang.org/docs/handbook/2/everyday-types.html).
47
51
 
48
52
  ## Out of static reach
49
53
 
@@ -51,6 +55,18 @@ Data crossing a trust boundary — a network response, `JSON.parse`, an environm
51
55
  - Whether a suppression's stated reason is still true today.
52
56
  - Runtime type errors that never surface as a thrown exception (silent coercion, e.g. JS implicit `NaN` propagation).
53
57
  - The actual JS/Python values flowing through an `any`/`Any`-typed path in production.
58
+ - Whether suppression density correlates with AI-authored commits — that's a repo-history correlation, not a pattern this module's file-content probes reach.
59
+ - Whether the validator itself is exploitable at its pinned version — that's a dependency-audit concern, not a type-safety pattern this module's probes reach.
60
+ - Whether a locally-installed or CI-resolved TypeScript version diverges from the one declared here, changing which strict flags apply by default — this module reads the declared version, not the resolved one.
61
+
62
+ ## What browser observation closes
63
+
64
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
65
+
66
+ | Artefact | Gap it closes | Observed instance earns |
67
+ |---|---|---|
68
+ | `console.jsonl` | A thrown runtime `TypeError` (or equivalent) on a confirmed flow, whose stack frame lands on the exact `file:line` a static check already flagged (an `any` param, a bare `as X` cast, an unvalidated boundary read) — raises the confidence of the existing static finding rather than standing alone; reaches Critical only when the stack frame is additionally traced back to that exact site via `find_callers`/`trace_path`. Refuted if the stack trace points to a different file/line than the one already flagged — a coincidental TypeError elsewhere corroborates nothing. | High |
69
+ | `screenshots/`, `final-state.md` | A visibly wrong rendered value (`NaN`, the literal string `"undefined"`, an unexpectedly empty list) on a confirmed flow with no matching `console.jsonl` entry — the silent-coercion failure mode this module's "Out of static reach" section already names as unreachable from source alone. Refuted if the value is legitimately empty/zero for the test account or dataset used in this run — check whether a different account or dataset renders correctly before flagging | Low |
54
70
 
55
71
  ## Severity guidance
56
72
 
@@ -59,10 +75,13 @@ Data crossing a trust boundary — a network response, `JSON.parse`, an environm
59
75
  | No type checker configured for a typed language | High |
60
76
  | Boundary data trusted via assertion instead of runtime validation | High |
61
77
  | Root-level suppression scope covering most of the source tree | High |
62
- | Generated types no longer regenerated, drifting silently | Medium |
63
78
  | Hand-edits inside a file marked auto-generated | Medium |
64
79
  | Suppression directive with no reason and no expiry mechanism | Medium |
65
80
  | Lint rule disabled globally rather than at the violating line | Medium |
66
81
  | Dense cluster of suppressions in one module | Medium |
82
+ | Equality/`typeof` guard applied to an unnarrowed boundary value (array/object where a scalar was assumed) | High |
83
+ | Pyright `typeCheckingMode` left at the implicit `"standard"` default, never bumped to `"strict"` | Medium |
84
+ | Hand-declared type/interface duplicating a runtime-validation schema instead of derived from it | Medium |
85
+ | Near-zero `unknown` usage despite boundary-crossing code already present (inferred) | Medium |
67
86
  | Isolated, justified suppression with a linked reason | Low |
68
87
  | `@ts-expect-error` used correctly (fails when stale) | Info |
@@ -0,0 +1,78 @@
1
+ # Usability
2
+
3
+ Does using it actually go well? `accessibility.md` asks whether everyone *can* use it, `visual-design.md` asks whether it *reads* correctly, `flow-integrity.md` asks whether a flow *finishes* — this module asks the question underneath all three: once a flow is reachable, legible, and wired end to end, does moving through it feel efficient, forgiving, and honest about what is happening. Most of what usability research actually measures — task success, time-on-task, satisfaction — needs a real person and is out of this module's reach by construction; what is left is the narrower set of defects that predict those outcomes and that a form definition, an error handler, or one browser walk can prove: field counts past the point research shows people abandon, validation that fires before someone finishes typing, feedback that never arrives, an error that doesn't say what to do next. Where a check here would restate another module's territory it is cross-referenced instead of duplicated; where it needs a person, it is named under Out of static reach rather than guessed at. Gate: browser observation ran, and a UI framework or HTML entry point was detected.
4
+
5
+ This gate is stricter than `accessibility.md`'s and `visual-design.md`'s, which run on framework detection alone. Four of the checks below (Feedback and status's two, plus the error-text and tab-order checks) exist only as browser-bundle readings; the remaining eight still work source-only. Rather than let the module silently degrade to that thinner subset when observation is off, it gates on observation running instead, so the source-only checks are the ones that *also* work when browser observation runs, not the reason the module runs when it doesn't. Findings here are `observed` when they cite a bundle artefact and cap at Critical, `read` when they cite source and cap at High — never above those ceilings, per the Evidence Contract.
6
+
7
+ `accessibility.md` owns whether a control is reachable and named at all; this module owns whether using what's reachable is efficient and forgiving. `visual-design.md` owns craft — hierarchy, rhythm, state treatment — and fully covers Nielsen's Aesthetic and Minimalist Design heuristic, not re-litigated here. `frontend.md` owns whether a component is built correctly; this module owns whether what it builds, once running, behaves in the user's favour. `product.md` owns whether error copy leaks internal detail or matches documented vocabulary; this module owns whether the error that actually renders, when triggered, is specific and positioned correctly. `flow-integrity.md` owns whether the loading/empty/error triad is wired at all in source, and — off the same `steps.md` artefact, when browser observation ran — whether it actually renders and fires in time at runtime; this module owns a narrower question on top of both: once something renders, does what it says and where it's positioned actually help the person reading it. Same artefacts, different questions throughout — cross-reference, never duplicate.
8
+
9
+ ## Feedback and status
10
+
11
+ - [ ] An operation whose elapsed time (`steps.md`'s per-step timestamp) crosses 1 second shows a loading indicator in the matching `screenshots/` capture, and one crossing 10 seconds shows a percent-done indicator or a cancel affordance; the 0.1s instant case needs neither. `search_code` the component rendering that step to confirm the indicator is real markup, not a screenshot artefact. Refuted when the delay is a single cold-run lab artefact — cross-check `vitals.md`/`insights.md`'s cold/warm pair before charging the app (Jakob Nielsen, Nielsen Norman Group, 1993/2014, https://www.nngroup.com/articles/response-times-3-important-limits/ — the 0.1s/1s/10s thresholds and what each requires).
12
+ - [ ] Where a flow's own steps naturally produce an empty-result state, `Read` `final-state.md` and the matching `screenshots/` capture: the rendered state names whether the emptiness is loading, an error, or genuinely nothing here, and offers the available action directly rather than leaving it implicit. `search_code` the component rendering that state to confirm the message is real markup, not a screenshot artefact. Refuted when the walk never reached a genuinely empty state — report not observed, never manufacture one (Kate Kaplan, Nielsen Norman Group, 2021, https://www.nngroup.com/articles/empty-state-interface-design/ — what a designed empty state must communicate, and the named failure of a stale/blank container).
13
+
14
+ ## Forms and checkout friction
15
+
16
+ - [ ] `search_code` the checkout or primary signup form's field list and count required inputs; more than roughly 11 with no stated reason (a regulatory requirement, a business rule) is flagged against Baymard's field-reduction techniques. `Read` the form to confirm which fields are conditionally rendered versus always present before counting. Refuted when the extra fields are individually justified — name the justification before flagging the count (Edward Scott, Baymard Institute, 2024, https://baymard.com/blog/checkout-flow-average-form-fields — 11.3-field 2024 average, ~8-field achievable optimum).
17
+ - [ ] `search_code` the checkout/signup form for separate required `firstName`/`lastName` inputs with no single "Full name" alternative and no `autocomplete="name"` mapping — Baymard's testing shows this split produces the highest observed field-level hesitation of any checkout field. Refuted when a downstream legal-name field (billing, shipping, KYC) requires the split — name the consumer before flagging (Edward Scott, Baymard Institute, 2024, https://baymard.com/blog/checkout-flow-average-form-fields — 42% typed a full name into "First Name" when split; only 4% hesitate on a single field).
18
+ - [ ] `search_code` the address-form component for an `addressLine2` field rendered unconditionally rather than behind a "+ Add address line 2" disclosure toggle. Refuted when the target market has a high real incidence of multi-line addresses (dense urban numbering, a B2B market shipping to suites) where always-visible is the better default — name the market before flagging (Edward Scott, Baymard Institute, 2024, https://baymard.com/blog/checkout-flow-average-form-fields — 75% of audited sites don't hide it).
19
+ - [ ] `search_code`/`find_symbol` the checkout entry route for an auth-gate placed before the checkout flow rather than at or after confirmation, and `find_callers` to confirm the guard actually sits on the checkout path and not an unrelated account area. Refuted when the product is subscription- or account-bound by nature — name why before flagging (Edward Scott, Baymard Institute, 2024, https://baymard.com/blog/checkout-flow-average-form-fields — 84% of sites don't delay account creation; forced signup is a named abandonment driver).
20
+ - [ ] `search_code` the form's validation wiring for an `onChange`/`onInput` handler that raises an error on a field still being typed into, with no check for the field being blurred or complete first; a handler that only clears an already-shown error on keystroke is fine. `Read` the handler body to tell raise-on-keystroke from clear-on-keystroke apart. Refuted when the field is a fixed-length structured input (ZIP code, card number) validated at correct length, which is the recommended timing, not a violation of it (Edward Scott, Baymard Institute, 2024, https://baymard.com/blog/inline-form-validation — the quoted test-participant frustration and the structured-field exception; GOV.UK Design System, current, https://design-system.service.gov.uk/patterns/validation/ — validate on submit, not on blur, as the safer default). `frontend.md` owns whether this handler is built correctly; this module owns the user-facing consequence of its timing — cross-reference, not duplicate, if both modules run.
21
+
22
+ ## Errors and recovery
23
+
24
+ - [ ] After the one deliberately invalid, non-side-effecting form submission `browser.md` performs per flow with a form, `Read` the rendered error text captured in `steps.md`: it names the specific problem rather than "an error occurred", uses no blame language ("invalid", "illegal"), and appears next to the field rather than only in a toast. `search_code` the source string to confirm the browser rendered it verbatim rather than a fallback. Refuted when the submission never actually triggered client-visible validation and the message came back generic from a shared handler this flow doesn't own — trace its origin with `find_callers` before charging this flow (Tim Neusesser and Evan Sunwall, Nielsen Norman Group, 2023, https://www.nngroup.com/articles/error-message-guidelines/ — specific, plain, non-blaming, field-adjacent; GOV.UK Design System, current, https://design-system.service.gov.uk/components/error-message/ — same rules plus field-adjacent-and-in-summary; W3C WAI, WCAG 2.2 Understanding, current, https://www.w3.org/WAI/WCAG22/Understanding/error-identification.html — SC 3.3.1's floor: an error must be identified and described in text at all). Distinct from `product.md`'s message-leaks-internals check — this one is `observed`-tier and about the text that actually renders, not what the source defines; report once, in the module that reached it.
25
+ - [ ] `search_code` the form's submit-error handler for a `.focus()` call targeting an error-summary element or the first invalid field after a failed submission; its absence means a keyboard or screen-reader user's focus stays on the submit button with no route to discover what failed short of tabbing through the whole form again. `Read` the handler to confirm the focus target. Refuted when the error summary already sits inline immediately above the submit button, already in the tab path with no scroll or search required — name the layout before excusing it (GOV.UK Design System, current, https://design-system.service.gov.uk/patterns/validation/ — the explicit requirement to move keyboard focus to the error summary on a failed submission). Adjacent to but distinct from `accessibility.md`'s "async status changes are announced" check — that one asks whether a screen-reader user is told something changed, this one whether a keyboard user's focus actually moves there.
26
+ - [ ] `search_code` for `alert(`, `confirm(`, or `prompt(` calls in UI code paths — each blocks the entire page, cannot be restyled to match the app's own error design, and on `confirm()` gives no way to review what will happen before the single yes/no choice. `find_callers` on a match to rule out unreachable dead code before flagging, per this skill's standard dead-code caveats. Refuted when the call is unreachable — public API surface, dynamic dispatch, and framework-convention entry points ruled out first (Jakob Nielsen, Nielsen Norman Group, 1994/2024, https://www.nngroup.com/articles/ten-usability-heuristics/ — heuristic #3, User Control and Freedom).
27
+
28
+ ## Recognition and efficiency
29
+
30
+ - [ ] From the Tab-order sequence `browser.md` records in `a11y-snapshot.md`, count the tab stops from page load to the view's primary action; more than roughly 10 non-essential controls tabbed past to reach the action most users came for is a recognition/efficiency finding, independent of whether the order itself is correct. `search_code` the view's primary-action component to confirm which control this count targets. Refuted when the action is also reachable by a documented shortcut, or the view is an intentionally dense power-user surface (a data-grid, an admin console) — name which before flagging (Jakob Nielsen, Nielsen Norman Group, 1994/2024, https://www.nngroup.com/articles/ten-usability-heuristics/ — heuristic #7, Flexibility and Efficiency of Use). Uses the same artefact as `accessibility.md`'s "focus order follows visual order" check but asks a different question — cost of order, not correctness of it; both can run against the same walk without duplicating each other's finding.
31
+ - [ ] `search_code` common PII/contact inputs (email, name, phone, address, card number) for a missing or generic `autocomplete` attribute where the field's semantic type has a standard token (`email`, `name`, `tel`, `street-address`, `cc-number`) — a returning user is forced to recall and retype what the browser already knows. Refuted when `autocomplete="off"` is deliberate on a security-sensitive field (a password-reset token, a one-time code) where autofill would be wrong — name the field's purpose before flagging (Jakob Nielsen, Nielsen Norman Group, 1994/2024, https://www.nngroup.com/articles/ten-usability-heuristics/ — heuristic #6, Recognition Rather than Recall, extended here to browser-remembered values).
32
+
33
+ ## Out of static reach
34
+
35
+ Where a candidate check needs a real person rather than a probe, or would restate territory another module already owns, it is named here instead of guessed at or duplicated.
36
+
37
+ - Task success rate, time-on-task, or a SUS-style satisfaction score — needs real people attempting the task, not one lab walk.
38
+ - Whether copy genuinely reads as the target audience's own language, as opposed to matching the vocabulary the docs claim for that audience.
39
+ - Whether an existing keyboard shortcut is ever discovered or used — this module can confirm it exists, not that anyone uses it.
40
+ - Whether help text actually answers the question a user had — this module confirms help exists, not that it works.
41
+ - Nielsen heuristic #4, Consistency and standards — covered by `consistency.md` and `design-system.md`; not re-checked here.
42
+ - Nielsen heuristic #8, Aesthetic and minimalist design — covered by `visual-design.md`; not re-checked here.
43
+ - Confirmation before a destructive action — covered by `flow-integrity.md`'s "Missing confirmation on destructive actions" check, same probe pair (`search_code` the destructive handler, `find_callees` for a confirmation step); not re-checked here to avoid duplicating it.
44
+ - Whether browser observation was declined for this run — the whole module is off in that case (see Gate above), and every gap it would have closed is reported under Coverage Gaps, exactly as `browser.md`'s own declines are.
45
+
46
+ ## What browser observation closes
47
+
48
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
49
+
50
+ All four capture inputs below come from `browser.md`'s Usability inputs capture step — the elapsed-time timestamp, the Tab-order walk, the invalid-submit error text, and the natural empty/loading captures — already part of the shipped bundle.
51
+
52
+ | Artefact | Gap it closes | Observed instance earns |
53
+ |---|---|---|
54
+ | `steps.md` (elapsed time per step) + `screenshots/` | An operation crossing Nielsen's 1s threshold shows no loading indicator | Medium |
55
+ | `steps.md` (elapsed time per step) + `screenshots/` | An operation crossing Nielsen's 10s threshold shows no percent-done indicator or cancel path | High |
56
+ | `screenshots/` + `final-state.md` | Whether a naturally-occurring empty-result state communicates status and offers a path forward, instead of rendering a blank container | Medium |
57
+ | `steps.md` (post-invalid-submit error text) | Whether the error text that actually renders — not just what the source defines — is specific, plain-language, and field-adjacent | Medium |
58
+ | `a11y-snapshot.md` (Tab-order walk) | How many tab stops separate page load from the view's primary action | Low |
59
+
60
+ ## Severity guidance
61
+
62
+ Every ceiling below matches the probe tier that reaches it: `observed` checks (loading feedback, empty state, error text, tab order) top out at High or Medium here, not the Critical their tier would otherwise allow, because none of these situations is itself a broken flow; `read` checks stop at the contract's own High ceiling or lower.
63
+
64
+ | Situation | Severity |
65
+ |---|---|
66
+ | Loading operation exceeds 10s with no percent-done indicator or cancel path | High |
67
+ | Loading operation in the 1–10s band with no feedback at all | Medium |
68
+ | Naturally-occurring empty state renders as a blank container | Medium |
69
+ | Rendered post-submit error text is generic, blaming, or not field-adjacent | Medium |
70
+ | Validation fires before the field is complete | Medium |
71
+ | Focus does not move to the error summary after a failed submission | Medium |
72
+ | Account creation forced before checkout can complete | Medium |
73
+ | Checkout/signup field count materially exceeds the Baymard benchmark with no stated reason | Low |
74
+ | Split first/last name with no single-field fallback | Low |
75
+ | Address Line 2 always visible instead of progressively disclosed | Low |
76
+ | Native `alert`/`confirm`/`prompt` used for validation or confirmation | Low |
77
+ | Primary action buried more than ~10 tab stops from page load | Low |
78
+ | Repeat-entry field missing a standard `autocomplete` token | Low |