project-brain 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +6 -6
- package/templates/project.claude.md +1 -1
- package/templates/skills/brain-audit/SKILL.md +17 -7
- package/templates/skills/brain-audit/references/abuse.md +36 -11
- package/templates/skills/brain-audit/references/accessibility.md +50 -22
- package/templates/skills/brain-audit/references/ai.md +39 -15
- package/templates/skills/brain-audit/references/analytics.md +34 -11
- package/templates/skills/brain-audit/references/api.md +38 -13
- package/templates/skills/brain-audit/references/backend.md +41 -9
- package/templates/skills/brain-audit/references/browser.md +146 -0
- package/templates/skills/brain-audit/references/complexity.md +22 -12
- package/templates/skills/brain-audit/references/concurrency.md +36 -18
- package/templates/skills/brain-audit/references/consistency.md +32 -9
- package/templates/skills/brain-audit/references/contract-drift.md +34 -16
- package/templates/skills/brain-audit/references/cost.md +45 -23
- package/templates/skills/brain-audit/references/cross-surface-parity.md +38 -11
- package/templates/skills/brain-audit/references/database.md +43 -17
- package/templates/skills/brain-audit/references/dependencies-licensing.md +27 -12
- package/templates/skills/brain-audit/references/design-system.md +40 -17
- package/templates/skills/brain-audit/references/devops.md +32 -17
- package/templates/skills/brain-audit/references/documentation.md +38 -16
- package/templates/skills/brain-audit/references/failure.md +40 -18
- package/templates/skills/brain-audit/references/feature-flags.md +31 -15
- package/templates/skills/brain-audit/references/flow-integrity.md +42 -10
- package/templates/skills/brain-audit/references/frontend.md +40 -12
- package/templates/skills/brain-audit/references/functional.md +31 -11
- package/templates/skills/brain-audit/references/future.md +28 -7
- package/templates/skills/brain-audit/references/goal.md +15 -6
- package/templates/skills/brain-audit/references/i18n.md +30 -8
- package/templates/skills/brain-audit/references/idempotency.md +46 -24
- package/templates/skills/brain-audit/references/infrastructure.md +43 -13
- package/templates/skills/brain-audit/references/mobile.md +37 -15
- package/templates/skills/brain-audit/references/multi-tenancy.md +41 -12
- package/templates/skills/brain-audit/references/numeric.md +33 -16
- package/templates/skills/brain-audit/references/observability.md +43 -19
- package/templates/skills/brain-audit/references/packaging.md +39 -13
- package/templates/skills/brain-audit/references/performance.md +43 -13
- package/templates/skills/brain-audit/references/privacy.md +38 -15
- package/templates/skills/brain-audit/references/product.md +29 -10
- package/templates/skills/brain-audit/references/prompt-spec-gap.md +34 -10
- package/templates/skills/brain-audit/references/reachability.md +38 -18
- package/templates/skills/brain-audit/references/repo-history.md +23 -16
- package/templates/skills/brain-audit/references/runtime.md +48 -10
- package/templates/skills/brain-audit/references/scalability.md +37 -10
- package/templates/skills/brain-audit/references/security.md +46 -22
- package/templates/skills/brain-audit/references/state-model.md +44 -15
- package/templates/skills/brain-audit/references/supply-chain.md +42 -13
- package/templates/skills/brain-audit/references/temporal.md +37 -14
- package/templates/skills/brain-audit/references/testing.md +38 -14
- package/templates/skills/brain-audit/references/tooling-baseline.md +34 -18
- package/templates/skills/brain-audit/references/type-safety.md +38 -19
- package/templates/skills/brain-audit/references/usability.md +78 -0
- package/templates/skills/brain-audit/references/versioning-compatibility.md +34 -12
- package/templates/skills/brain-audit/references/visual-design.md +38 -12
- package/templates/skills/brain-audit/references/web-metadata.md +47 -19
- package/templates/skills/brain-record/SKILL.md +297 -0
- package/templates/skills/brain-record/assets/build-video.sh +142 -0
- package/templates/skills/brain-record/assets/record.mjs +283 -0
- package/templates/skills/brain-record/references/pitfalls.md +233 -0
- package/templates/skills/brain-worktree/SKILL.md +103 -0
|
@@ -2,27 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
Is this code reachable at all? This module runs on the call graph, so it answers with certainty where a grep-based auditor can only guess.
|
|
4
4
|
|
|
5
|
-
**Before reporting anything here as dead, rule
|
|
5
|
+
**Before reporting anything here as dead, name which rule-out categories were checked and which applied** — not just that rule-outs were considered: public API surface (check the manifest's `exports`/`main`/`types` fields), dynamic dispatch (`search_code` the bare identifier as a string literal, since a registry keyed by name will not appear as a call), reflection, string-keyed registries, framework-convention entry points (route files, migrations, plugin folders), test-only usage, and cross-repo consumers. `find_callers` returning empty means *no in-repo caller*, nothing more — for Android static analysis specifically, averaged across 13 call-graph tools measured against 1,000 Android apps, static analysis missed 61% of dynamically-executed methods (Samhi, Just, Bissyandé, Ernst & Klein, "Call Graph Soundness in Android Static Analysis," arXiv preprint, 2024, https://arxiv.org/abs/2407.07804), so a blanket "rule-outs considered" with no category named satisfies the letter of this requirement while missing its point.
|
|
6
6
|
|
|
7
7
|
## Dead exports
|
|
8
8
|
|
|
9
|
-
- [ ] For each exported symbol, `find_callers`. Empty ⇒ candidate. Cross-check against the exclusion list above before reporting.
|
|
9
|
+
- [ ] For each exported symbol, `find_callers`. Empty ⇒ candidate. Cross-check against the exclusion list above before reporting — the same "unused export ⇒ safe to drop" inference is what Rollup's `treeshake.moduleSideEffects` performs at the bundler level, with the identical false-positive risk this exclusion list guards against (Rollup core team, official framework documentation, current, https://rollupjs.org/configuration-options/#treeshake-modulesideeffects).
|
|
10
10
|
- [ ] `impact` on each candidate to confirm the blast radius is genuinely zero — a symbol with no direct callers but a live transitive path is not dead.
|
|
11
|
-
- [ ] Whole modules whose every export is unreferenced — `find_callers` on each export in the module; if all come back empty, `find_symbol` the module's own barrel/index file to confirm nothing re-exports it either. These are the cheap, high-value deletions.
|
|
11
|
+
- [ ] Whole modules whose every export is unreferenced — `find_callers` on each export in the module; if all come back empty, `find_symbol` the module's own barrel/index file to confirm nothing re-exports it either. These are the cheap, high-value deletions — webpack's own `sideEffects: false` declaration is the bundler-side version of this exact check, with the same "verify before dropping" warning: marking a package side-effect-free when it isn't "can cause serious issues" (webpack core team, official framework documentation, current, https://webpack.js.org/guides/tree-shaking/).
|
|
12
|
+
- [ ] In a JS/TS project, cross-check `find_callers`-empty export candidates against the package's own `sideEffects` field (`package.json`) and any `treeshake.moduleSideEffects` bundler config — `search_code` for both. A file the project itself already declares side-effect-free and `find_callers` shows unreferenced is corroborated from two independent tools (the code graph and the bundler's own static analysis); a file marked `sideEffects: true` or listed in the side-effect array despite having no callers is a signal the maintainers know something the call graph doesn't — treat it as excluded pending human confirmation, not as a stronger candidate. Refuted if the file's side-effect declaration traces to something unrelated to reachability (a bare `import './x.css'`, a global assignment) — `search_code` the file's own content before treating the mismatch as suspicious (webpack core team, official framework documentation, current, https://webpack.js.org/guides/tree-shaking/; Rollup core team, official framework documentation, current, https://rollupjs.org/configuration-options/#treeshake-modulesideeffects).
|
|
12
13
|
- [ ] Types, interfaces, and enums declared and never referenced — `find_callers` on the type name where the indexer tracks type references; otherwise `search_code` the bare identifier and rule out matches inside comments or string literals before counting a hit.
|
|
13
14
|
|
|
14
15
|
## Dead endpoints
|
|
15
16
|
|
|
16
|
-
- [ ] Every server route / handler: does any client in the repo call it? `search_code` the path literal, then `trace_path` from the client call site to the handler.
|
|
17
|
+
- [ ] Every server route / handler: does any client in the repo call it? `search_code` the path literal, then `trace_path` from the client call site to the handler. An endpoint no in-repo client calls is exactly OWASP's "improper inventory" precondition — their worked example shows a forgotten beta/legacy host with the same functionality as production but missing a rate-limit control enabling account takeover by brute force, not just clutter (OWASP API Security Project, OWASP API Security Top 10 2023, 2023, https://owasp.org/API-Security/editions/2023/en/0xa9-improper-inventory-management/).
|
|
17
18
|
- [ ] Routes registered but never mounted, or mounted behind a router nobody attaches — `find_callers` on the router-registration call itself (`app.use(router)`, `router.register(...)`); zero callers means every route inside it never sees traffic, regardless of what each one looks like individually.
|
|
18
|
-
- [ ] The inverse: a client calling a path that no handler serves — `search_code` the path string at client/fetch call sites, then `find_symbol` for a matching route definition. No match on the server side is the finding. This is `High`
|
|
19
|
+
- [ ] The inverse: a client calling a path that no handler serves — `search_code` the path string at client/fetch call sites, then `find_symbol` for a matching route definition. No match on the server side is the finding. This is `High` at read; `trace_path` from the client call site to the mutation/handler that would have served it, proving the call sits on a state-changing path, promotes it to `Critical` once traced.
|
|
19
20
|
|
|
20
21
|
## Unreachable branches
|
|
21
22
|
|
|
22
|
-
- [ ] Conditions that cannot be true: checks after an early return, mutually exclusive guards, `if (x)` where `x` is a constant —
|
|
23
|
-
- [ ] Feature flags permanently off — `search_code` the flag key; if the default is `false` and no config file, CLI flag, or admin surface in the repo ever sets it `true`, the gated code is dead until someone flips it, and nobody remembers it exists.
|
|
24
|
-
- [ ] Environment variables read by code but set by no `.env.example`, no CI config, no Dockerfile, no docs — `search_code` the variable name across those four locations. A hit nowhere means the fallback path is the only path that ever runs.
|
|
25
|
-
- [ ] Catch blocks for exceptions the try block cannot raise —
|
|
23
|
+
- [ ] Conditions that cannot be true: checks after an early return, mutually exclusive guards, `if (x)` where `x` is a constant — Read the guard chain at the cited `file:line` and confirm the earlier branch already excludes this one. This is CWE-561's exact mechanism via its CWE-570/571 children, "Expression is Always False/True" (MITRE, CWE, current, https://cwe.mitre.org/data/definitions/561.html), and the JS/TS case is already automated as a shipped lint rule — ESLint's `no-unreachable` flags code after `return`/`throw`/`continue`/`break` because "unreachable statements are usually a mistake" (OpenJS Foundation / ESLint core team, official tool documentation, current, https://eslint.org/docs/latest/rules/no-unreachable).
|
|
24
|
+
- [ ] Feature flags permanently off — `search_code` the flag key; if the default is `false` and no config file, CLI flag, or admin surface in the repo ever sets it `true`, the gated code is dead until someone flips it, and nobody remembers it exists — Knight Capital's "Power Peg" logic was deprecated and left on the servers in exactly this dead-until-flipped state; a repurposed flag byte flipped it live on one server and cost "$460 million loss in 45-minutes" (Doug Seven, public engineering post-mortem quoting SEC Release No. 70694, 2014, https://dougseven.com/2014/04/17/knightmare-a-devops-cautionary-tale/). When the flag defaults `false` in the repo, name which remote sources were and were not checked before calling the gated code dead: a feature-flag service (LaunchDarkly/Unleash/GrowthBook-style SDK call site — `search_code` the flag key as an SDK argument), an admin/ops dashboard the repo cannot see, or infrastructure-as-code outside this repo; a hit on an SDK call site that resolves the flag remotely downgrades the finding from "dead" to "gated by config this repo cannot see." State explicitly which of these are out of static reach rather than implying the repo-only search settled the question.
|
|
25
|
+
- [ ] Environment variables read by code but set by no `.env.example`, no CI config, no Dockerfile, no docs — `search_code` the variable name across those four locations. A hit nowhere means the fallback path is the only path that ever runs — config-in-environment is the canonical pattern this check assumes: "config varies substantially across deploys, code does not" (Heroku / Adam Wiggins et al., The Twelve-Factor App, current, https://12factor.net/config).
|
|
26
|
+
- [ ] Catch blocks for exceptions the try block cannot raise — Read the try body at the cited lines; if nothing inside it can throw the caught type, or cannot throw at all, the catch is dead code hiding a wrong assumption. Rule out a catch deliberately broader than the callee's current throw surface, written as a guard against a future dependency change — state which you checked.
|
|
26
27
|
|
|
27
28
|
## Declared but unused
|
|
28
29
|
|
|
@@ -30,20 +31,20 @@ Sweep each category and report the orphans:
|
|
|
30
31
|
|
|
31
32
|
- [ ] Assets — images, fonts, icons, static files referenced by nothing — `search_code` the filename, without extension, to also catch dynamic path construction, across templates, components, and stylesheets. Zero hits is an orphan.
|
|
32
33
|
- [ ] i18n keys present in locale files, referenced by no call site — `search_code` the key string against the translation call (`t(`, `i18n.t(`, `useTranslation`); defer depth to the `i18n` module if it is in the confirmed set.
|
|
33
|
-
- [ ] Environment variables declared in `.env.example` / config schema, read by nothing — `search_code` the variable name in application source; a hit only inside the example file means it is declared and dead.
|
|
34
|
+
- [ ] Environment variables declared in `.env.example` / config schema, read by nothing — `search_code` the variable name in application source; a hit only inside the example file means it is declared and dead — the same Twelve-Factor config-in-environment assumption this module's other env-var checks rely on (Heroku / Adam Wiggins et al., The Twelve-Factor App, current, https://12factor.net/config).
|
|
34
35
|
- [ ] Config options accepted by the parser, consumed by nothing — `find_callers` on the field access (`config.optionName`); empty means the option is parsed and then ignored.
|
|
35
36
|
- [ ] Dependencies in the manifest, imported by nothing — `search_code` the package name as an import specifier (defer licensing depth to `dependencies-licensing.md`).
|
|
36
|
-
- [ ] Database columns, indexes, and tables that no query touches — `search_code` the column/table name across query builders, ORM models, and raw SQL.
|
|
37
|
+
- [ ] Database columns, indexes, and tables that no query touches — owned by `database.md` (`search_code` the column/table name across query builders, ORM models, and raw SQL); reuse its finding, do not re-report.
|
|
37
38
|
|
|
38
39
|
## Used but never declared — the inverse gap
|
|
39
40
|
|
|
40
41
|
**This is the check almost nobody runs, and it is where the expensive bugs hide.** The declared-but-unused direction wastes bytes; this direction breaks at runtime.
|
|
41
42
|
|
|
42
|
-
- [ ] Environment variables read in code but declared in no `.env.example`, schema, or deployment manifest — `search_code` the variable name in source, then confirm its absence from those three locations with the same search. Works on the author's machine, `undefined` in production.
|
|
43
|
-
- [ ] i18n keys referenced by call sites but missing from one or more locale files — `search_code` the
|
|
43
|
+
- [ ] Environment variables read in code but declared in no `.env.example`, schema, or deployment manifest — `search_code` the variable name in source, then confirm its absence from those three locations with the same search. Works on the author's machine, `undefined` in production — the direction where the Twelve-Factor promise that config is "easy to change between deploys without changing any code" breaks hardest, because the variable was never wired into deploy-time config at all (Heroku / Adam Wiggins et al., The Twelve-Factor App, current, https://12factor.net/config).
|
|
44
|
+
- [ ] i18n keys referenced by call sites but missing from one or more locale files — owned by `i18n.md` (`search_code` the translation call, diff literal keys against each locale file); reuse its finding, do not re-report. This module keeps only the declared-but-unreferenced direction (line 32).
|
|
44
45
|
- [ ] Asset paths built at runtime (string concatenation, template literals) pointing at files that do not exist — `search_code` the template-literal fragment (e.g. `` `/icons/${ ``) and check the resolved directory for each value it can actually interpolate.
|
|
45
|
-
- [ ] Code reading a database column that no migration creates — `search_code` the column name in query/model code,
|
|
46
|
-
- [ ] Imports of packages absent from the manifest — `search_code` the import specifier, then check the manifest; a match with no manifest entry is resolved today only by a transitive hoist that the next lockfile update will remove.
|
|
46
|
+
- [ ] Code reading a database column that no migration creates — owned by `database.md` (`search_code` the column name in query/model code, confirmed against no migration file declaring it); reuse its finding, do not re-report.
|
|
47
|
+
- [ ] Imports of packages absent from the manifest — `search_code` the import specifier, then check the manifest; a match with no manifest entry is resolved today only by a transitive hoist that the next lockfile update will remove — also covered by `dependencies-licensing.md`'s imported-but-not-declared check; report once.
|
|
47
48
|
- [ ] Config keys consumed by code but rejected or ignored by the config parser — `find_symbol` the parser/schema definition and diff its accepted keys against every `config.<key>` access site `search_code` returns.
|
|
48
49
|
|
|
49
50
|
## Out of static reach
|
|
@@ -53,14 +54,33 @@ Sweep each category and report the orphans:
|
|
|
53
54
|
- Whether a branch this module calls dead is actually exercised by a remote feature-flag value never committed to the repo.
|
|
54
55
|
- An exported symbol with zero in-repo callers that is the published API surface for a separate downstream repo this audit cannot see.
|
|
55
56
|
- Whether an undeclared env var is supplied by infrastructure-as-code, a secrets manager, or a platform dashboard outside version control.
|
|
57
|
+
- Whether a module with no referenced exports is still required for its import-time side effects (e.g. `import './setup'` for global registration alone) — this module's structural probes track export usage, not import-time execution.
|
|
58
|
+
- Coverage-tool-measured actual dead code (lines never hit by any test or production run) — this module's probes are static graph queries; cross-reference `runtime.md` for execution-based coverage.
|
|
59
|
+
- Whether an npm dependency with no local import satisfies a peerDependency contract for another workspace package — this module reads import statements, not manifest-to-manifest peer constraints.
|
|
60
|
+
- A route reachable only through infrastructure-level routing (reverse proxy, API gateway config) not declared in this repo's own router configuration.
|
|
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
|
+
| `network.jsonl` | Code or a plugin actually fetched over the wire during a confirmed flow (`eval`, a database-stored script) | Medium |
|
|
69
|
+
| `final-state.md` | A branch this module calls dead actually exercised by a live remote feature-flag value, reachable through the UI | High |
|
|
70
|
+
| `network.jsonl` | A route this module flagged dead-by-no-in-repo-caller is actually reached through the UI (a client built dynamically — a CMS-driven nav, or a string-templated fetch URL `search_code` cannot resolve) — the route path appears as a request host+path during a confirmed flow. Refuted if the match is on path segments only (e.g. `/api/users/42` matching pattern `/api/users/:other`) — confirm against the request's full path plus its response status and headers (a 200/204 with the handler's characteristic response headers, versus a catch-all 404), since `network.jsonl` records a response body only on 4xx/5xx and a matched 200 route has none to inspect. | High |
|
|
71
|
+
| `final-state.md`, `screenshots/` | A feature flag this module found defaulting to `false` in the repo is actually `true` at runtime for this environment, and the gated UI renders. Refuted if the flag could be `true` only for this session's specific user/cohort (an A/B test, an internal-only override) — state whether the browser session used real or synthetic credentials before treating this as proof the flag is `true` for all users. | High |
|
|
72
|
+
| `network.jsonl` | An asset this module flagged as an orphan (zero `search_code` hits by filename) is actually requested by the browser during a confirmed flow — a request for that exact filename/path. Refuted if the request is a browser-generated implicit fetch (favicon, source map) unrelated to intentional application reference — check the request's initiator if the tool captures one before treating this as a live reference. | Medium |
|
|
56
73
|
|
|
57
74
|
## Severity guidance
|
|
58
75
|
|
|
59
76
|
| Situation | Severity |
|
|
60
77
|
|---|---|
|
|
61
|
-
| Client calls
|
|
62
|
-
|
|
|
78
|
+
| Client calls a state-changing endpoint that does not exist, traced to a state-changing path | Critical |
|
|
79
|
+
| Client calls a state-changing endpoint that does not exist, not traced | High |
|
|
80
|
+
| Client calls a read-only endpoint that does not exist | High |
|
|
81
|
+
| Code reads an env var nothing provides | High |
|
|
63
82
|
| Feature flag permanently off, gating shipped code | Medium |
|
|
64
83
|
| Exported symbol with zero callers, exclusions ruled out | Medium |
|
|
65
84
|
| Unused asset, dependency, or locale key | Low |
|
|
66
|
-
| Declared-and-unused type or
|
|
85
|
+
| Declared-and-unused type or interface | Info |
|
|
86
|
+
| Declared-and-unused config option | Low |
|
|
@@ -6,42 +6,43 @@ What does the commit log reveal that the working tree cannot? Gate: the project
|
|
|
6
6
|
|
|
7
7
|
## Shallow-clone check (run first)
|
|
8
8
|
|
|
9
|
-
- [ ] Confirm the clone is complete before trusting any result below — `git rev-list --count HEAD` compared against the commit count the remote reports, or the presence of a `.git/shallow` file. Every check in this module downgrades to `undetermined` on a shallow clone, not `not applicable`.
|
|
9
|
+
- [ ] Confirm the clone is complete before trusting any result below — `git rev-list --count HEAD` compared against the commit count the remote reports, or the presence of a `.git/shallow` file. Every check in this module downgrades to `undetermined` on a shallow clone, not `not applicable`. `git clone --depth` "create[s] a shallow clone with a history truncated to the specified number of commits," implying `--single-branch` by default (Git project, official reference documentation, current, https://git-scm.com/docs/git-clone).
|
|
10
10
|
|
|
11
11
|
## Secrets and sensitive data
|
|
12
12
|
|
|
13
|
-
- [ ] Secrets removed from HEAD but still present in history. `git log -p -S'<pattern>'` (the pickaxe search) for known secret shapes — `AKIA`, `-----BEGIN`, `sk_live_`, a `.env` file that was ever committed then later deleted. A hit means rotation is required regardless of what HEAD looks like today; removal from HEAD does not remove it from any clone already made.
|
|
13
|
+
- [ ] Secrets removed from HEAD but still present in history. `git log -p -S'<pattern>'` (the pickaxe search) for known secret shapes — `AKIA`, `-----BEGIN`, `sk_live_`, a `.env` file that was ever committed then later deleted. A hit means rotation is required regardless of what HEAD looks like today; removal from HEAD does not remove it from any clone already made — "these hardcoded secrets become part of your Git history and remain accessible even after being removed from the latest commit," and addressing a leak "requires more than deleting the file; you must also revoke and replace the credential" (GitHub, official vendor documentation, current, https://docs.github.com/en/code-security/concepts/secret-security/secret-leakage-risks). TruffleHog "scans full git history by default, meaning secrets buried in old commits get surfaced even if they were deleted in later commits" (Truffle Security, official OSS project README, current, https://github.com/trufflesecurity/trufflehog). Before a hit is reported as a live-secret finding, check the matched string against the credential provider's real shape (`AKIA[0-9A-Z]{16}` for an AWS access key, the fixed prefix length for `sk_live_`, etc.) rather than a bare substring match, and check the surrounding diff for test-fixture or documentation context. A hit that fails the shape check or sits inside a `test/`, `fixtures/`, or `*.example` path is downgraded to Low pending manual confirmation, not reported at the check's default High — the same discipline TruffleHog's own `verified`/`unverified` split exists for, since "verification eliminates the vast majority of false positives" a bare pattern match produces (Truffle Security, official OSS project README, current, https://github.com/trufflesecurity/trufflehog).
|
|
14
14
|
- [ ] `.gitignore` gaps proven by tracked files, not assumed from the ignore file's intent — `git ls-files` and check the output for `.env`, `*.pem`, `credentials.json`, local IDE config, or a build-output directory that should never have been tracked.
|
|
15
15
|
|
|
16
16
|
## Repository weight
|
|
17
17
|
|
|
18
|
-
- [ ] Large blobs sitting in history whether or not they are still in HEAD. `git rev-list --objects --all` piped to `git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'`, sorted by size. A binary removed from HEAD still weighs on every fresh clone forever unless the history itself is rewritten.
|
|
19
|
-
- [ ] Generated or vendored artefacts committed at any point (build output, `node_modules`, lockfile-generated files committed alongside source) —
|
|
18
|
+
- [ ] Large blobs sitting in history whether or not they are still in HEAD. `git rev-list --objects --all` piped to `git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)'`, sorted by size. A binary removed from HEAD still weighs on every fresh clone forever unless the history itself is rewritten. Files over 50 MiB trigger a push warning; files over 100 MiB are hard-blocked without Git LFS, and repositories are recommended to stay under 1 GB (GitHub, official vendor documentation, current, https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github). Cross-reference the large-blob list against those thresholds and against `.gitattributes` LFS filter patterns (`search_code` for `filter=lfs`); a historical blob over 100 MiB with no LFS pattern covering its extension is a finding independent of whether it survives in HEAD — a fresh clone of this repository may already be unable to push cleanly to a new host-backed remote. Refuted if the object predates a later `git lfs migrate` and the path is now covered by `.gitattributes` — the blob still weighs on old clones but a fresh clone from a point after migration is unaffected; state which is true.
|
|
19
|
+
- [ ] Generated or vendored artefacts committed at any point (build output, `node_modules`, lockfile-generated files committed alongside source) — Read the large-blob list above against file extensions that should be build products, not source.
|
|
20
20
|
- [ ] The same large asset re-committed repeatedly under a changing name or path (`asset-v1.psd`, `asset-v2.psd`) — each version is a permanent addition to history weight even after the file is later deleted, and `git rev-list --objects` will show every one of them as distinct, undeletable objects.
|
|
21
21
|
|
|
22
22
|
## Churn as a risk map
|
|
23
23
|
|
|
24
|
-
- [ ] Highest-churn files across the project's life — `git log --all --pretty=format: --name-only` and tally frequency by path
|
|
25
|
-
- [ ] Cross-reference that churn ranking against `repo_map`'s structural (PageRank) ranking. A file that is both high-churn and structurally central is the highest-risk file in the repository, and the overlap is not visible from either ranking alone.
|
|
24
|
+
- [ ] Highest-churn files across the project's life — `git log --all --pretty=format: --name-only` and tally frequency by path, but treat the raw tally as a screening list, not a verdict: Nagappan & Ball (ICSE 2005, peer-reviewed) found "absolute measures of code churn are poor predictors of defect density," while their relative measures — churn normalized by size and time span — were "highly predictive," distinguishing fault-prone from non-fault-prone components at 89% accuracy on Windows Server 2003 (Nachiappan Nagappan, Thomas Ball, ICSE 2005, https://www.microsoft.com/en-us/research/publication/use-of-relative-code-churn-measures-to-predict-system-defect-density/). Compute relative churn per file — total lines changed (`git log --all --numstat`, summed added + deleted) divided by the file's current line count — alongside the raw touch-count tally, and rank by the relative measure before flagging a file as high-churn. A file touched often but by one line each time ranks lower than the raw tally suggests; a file touched rarely but rewritten wholesale each time ranks higher. Refuted if a high relative-churn ratio on a small file comes entirely from one squash-merge, reformat, or license-header update commit — open that single commit's diff before treating it as sustained defect-prone instability.
|
|
25
|
+
- [ ] Cross-reference that churn ranking against `repo_map`'s structural (PageRank) ranking. A file that is both high-churn and structurally central is the highest-risk file in the repository, and the overlap is not visible from either ranking alone — a hotspot, in Adam Tornhill's sense, is code that is both frequently changed *and* structurally/complexity-significant, not high-churn alone (Adam Tornhill, *Your Code as a Crime Scene*, 2nd ed., Pragmatic Bookshelf, 2024, https://pragprog.com/titles/atcrime2/your-code-as-a-crime-scene-second-edition/).
|
|
26
|
+
- [ ] For files flagged high-churn, pull the commit dates touching that file (`git log --follow --format=%ad -- <path>`) and note whether the churn is concentrated in a short burst (e.g., one refactor week) or spread across the project's life. Steady, spread churn on a structurally central file is a stronger risk signal than a single historical burst; report which shape it is, not just the count — entropy-based measures of a change's temporal distribution outperformed raw prior-modification counts as fault predictors in a case study across six projects (Ahmed E. Hassan, ICSE 2009, https://sailresearch.github.io/sail-website/data/pdfs/ICSE2009_PredictingFaultsUsingTheComplexityOfCodeChanges.pdf). Refuted if the burst corresponds to one documented, dated refactor/rename/reformat commit — cross-check the commit message and diff shape for that window before treating it as iterative instability.
|
|
26
27
|
- [ ] Commits touching an implausible number of files in one change — `git log --format=%H --shortstat`, looking for outliers well above the commit-size norm the rest of the log establishes. A 400-file commit is not reviewed the way a 4-file commit is, whatever the message claims.
|
|
27
28
|
|
|
28
29
|
## Ownership and bus factor
|
|
29
30
|
|
|
30
|
-
- [ ] For files identified as high-churn or structurally central, the distinct set of authors — `git log --follow --format=%an -- <path>`, deduplicated. A file touched by exactly one author across its entire life is a bus-factor finding independent of how good that author is.
|
|
31
|
-
- [ ] Compare author concentration on critical-path files against the project's overall author list (`git shortlog -s -n`). A file maintained by one person in a project with ten contributors is a different risk than the same pattern in a two-person project.
|
|
31
|
+
- [ ] For files identified as high-churn or structurally central, the distinct set of authors — `git log --follow --format=%an -- <path>`, deduplicated. A file touched by exactly one author across its entire life is a bus-factor finding independent of how good that author is. Truck factor — the minimum number of people who'd have to leave before a project is in serious trouble — was ≤2 for 65% of 133 studied popular GitHub systems (Guilherme Avelino, Leonardo Passos, Andre Hora, Marco Tulio Valente, ICPC 2016, https://arxiv.org/abs/1604.06766).
|
|
32
|
+
- [ ] Compare author concentration on critical-path files against the project's overall author list (`git shortlog -s -n`). A file maintained by one person in a project with ten contributors is a different risk than the same pattern in a two-person project. When reporting single-author concentration on a high-churn/central file, state the comparison baseline explicitly: the project's total distinct-author count (`git shortlog -s -n`) alongside the flagged file's author count. A single-author file in a project with only 1-2 total contributors is the empirical norm, not a finding — 65% of studied GitHub projects already have an overall truck factor ≤2 (Avelino et al., ICPC 2016, https://arxiv.org/abs/1604.06766) — reserve the flag for a single-author file inside a project with 5 or more overall contributors.
|
|
32
33
|
|
|
33
34
|
## Commit hygiene
|
|
34
35
|
|
|
35
|
-
- [ ] Commit message convention — read a sample of `git log --format=%s` and determine whether the log already follows one (Conventional Commits, a ticket-prefix convention, or none at all), then flag messages that break the majority pattern the log itself establishes. Do not import an external convention the project never adopted.
|
|
36
|
-
- [ ] TODO/FIXME age measured from the commit that introduced the line, not assumed from when it was last read — `git log -S'TODO' --follow -- <path>` (or `-G` for a regex match) to find the introducing commit and its date. A comment's age is evidence; a guess at its age is not.
|
|
37
|
-
- [ ] Stale branches — `git branch -a` (or `--no-merged`) for branches with no recent activity and no open path to being merged. Each one is either abandoned work or work nobody remembered to land.
|
|
36
|
+
- [ ] Commit message convention — read a sample of `git log --format=%s` and determine whether the log already follows one (Conventional Commits, a ticket-prefix convention, or none at all), then flag messages that break the majority pattern the log itself establishes. Do not import an external convention the project never adopted. Conventional Commits defines the exact `<type>[optional scope]: <description>` grammar (`feat`, `fix`, `!`/`BREAKING CHANGE:` footer, etc.) a log sample would be compared against if that is the convention in use (Conventional Commits, official specification v1.0.0, current, https://www.conventionalcommits.org/en/v1.0.0/).
|
|
37
|
+
- [ ] TODO/FIXME age measured from the commit that introduced the line, not assumed from when it was last read — `git log -S'TODO' --follow -- <path>` (or `-G` for a regex match) to find the introducing commit and its date. A comment's age is evidence; a guess at its age is not. When a file has more than one TODO/FIXME comment, do not date a specific one from `git log -S'TODO'` alone — `-S` reports commits where the *total occurrence count* of the string changed in that file, not commits that touched one particular line, so it can return the commit that added a different TODO in the same file (Git project, official reference documentation, 2.26.0, https://git-scm.com/docs/git-log/2.26.0). Narrow with `git log -G'TODO.*<distinguishing text from the current line>'` (matches any commit whose diff touched a line containing that text) before citing a date, or state the age as a range across all count-changing commits when a specific line cannot be isolated.
|
|
38
|
+
- [ ] Stale branches — `git branch -a` (or `--no-merged`) for branches with no recent activity and no open path to being merged. Use no commit in the last 6 months as the default staleness threshold, or the project's own documented one if it states a shorter/longer window. Each one is either abandoned work or work nobody remembered to land.
|
|
38
39
|
- [ ] Tags left behind with no corresponding release artefact, or a release process that no longer produces the tags it once did — `git tag` against the release workflow's tagging step.
|
|
39
40
|
- [ ] Ratio of non-descriptive commit messages (`wip`, `fix`, `temp`, `asdf`, single words) against the log's total — sample `git log --format=%s` and quantify rather than citing an anecdote or two. A handful is normal; a third of the log is a process gap.
|
|
40
|
-
- [ ] Frequency of revert commits — `git log --all --grep='^Revert'` (or the project's own revert convention).
|
|
41
|
+
- [ ] Frequency of revert commits — `git log --all --grep='^Revert'` (or the project's own revert convention). Use more than 3 reverts on one path in 3 months as the default threshold for a steady trickle rather than an anomaly — instability the churn ranking alone will not surface, because a revert and its original commit both count as ordinary churn.
|
|
41
42
|
|
|
42
43
|
## History rewrite evidence
|
|
43
44
|
|
|
44
|
-
- [ ] Evidence of a force-push or history rewrite that was not communicated — `search_code` `README`, `CONTRIBUTING`, or `CHANGELOG` for any note about a rewritten history (squash, author-scrub, secret purge), and treat an unexplained gap or a sudden un-followable `--follow` chain on a file as a signal worth naming, not proving. **Falsify before flagging**: a repository imported from another VCS or squash-merged by convention will show the same shape without anything having gone wrong — confirm which explanation fits before reporting either way.
|
|
45
|
+
- [ ] Evidence of a force-push or history rewrite that was not communicated — `search_code` `README`, `CONTRIBUTING`, or `CHANGELOG` for any note about a rewritten history (squash, author-scrub, secret purge), and treat an unexplained gap or a sudden un-followable `--follow` chain on a file as a signal worth naming, not proving. **Falsify before flagging**: a repository imported from another VCS or squash-merged by convention will show the same shape without anything having gone wrong — confirm which explanation fits before reporting either way. "Rewriting history will change the hashes of the commits that introduced the sensitive data and all commits that came after," and the rewritten commits "may still be accessible elsewhere: in any clones or forks..., directly via their SHA-1 hashes in cached views..., through any pull requests that reference them" (GitHub, official vendor documentation, current, https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository).
|
|
45
46
|
|
|
46
47
|
## Out of static reach
|
|
47
48
|
|
|
@@ -49,17 +50,23 @@ What does the commit log reveal that the working tree cannot? Gate: the project
|
|
|
49
50
|
- Reflog entries and any commits genuinely orphaned by a rewrite — a fresh or shallow clone has already lost this evidence, and it cannot be reconstructed from what remains.
|
|
50
51
|
- Author identity beyond the name/email recorded in the commit — a shared machine or CI bot account can misattribute ownership.
|
|
51
52
|
- Whether a high-churn file's churn reflects real defect density or an unrelated cause (generated file, formatter re-run, mass rename) — the ranking is a prioritisation signal, not a verdict on its own.
|
|
53
|
+
- Whether this clone's history has already diverged from the remote via an unseen force-push — the allowed commands read the local clone only, and confirming the remote's current state needs a network operation outside this module's read-only set.
|
|
54
|
+
- Whether a secret found in history is still valid and exploitable right now — that needs a live API call against the credential's own provider, which this module does not make. Treat every hit as live until the owning team confirms rotation.
|
|
55
|
+
- Whether a high-churn, structurally central file's history of changes actually caused a shipped defect or incident — the churn/centrality overlap is a prioritisation signal from this repository alone, not a verdict tied to any real outage.
|
|
56
|
+
- Whether two differently-named or differently-emailed entries in the author list are actually one person split across machines or accounts — without a maintained `.mailmap` this module reports what git recorded, not who really wrote it.
|
|
52
57
|
|
|
53
58
|
## Severity guidance
|
|
54
59
|
|
|
55
60
|
| Situation | Severity |
|
|
56
61
|
|---|---|
|
|
57
|
-
| Live secret found in history, not present in HEAD |
|
|
58
|
-
| Secret present in HEAD and in history
|
|
62
|
+
| Live secret found in history, not present in HEAD | High |
|
|
63
|
+
| Secret present in HEAD and in history — defer to `security.md`'s traced Critical when its `find_callers` probe shows the literal reaching a live client/service constructor; otherwise | High |
|
|
59
64
|
| Tracked file that should be gitignored and carries credentials | High |
|
|
60
65
|
| File both high-churn and structurally central, single author | High |
|
|
61
66
|
| Commit touching an implausible file count with no review trail | Medium |
|
|
62
67
|
| Large binaries committed and still weighing on every clone | Medium |
|
|
68
|
+
| Structurally central file with steady, spread churn across its life (not a single burst) | Medium |
|
|
63
69
|
| Stale branches with no merge path | Low |
|
|
64
70
|
| TODO/FIXME meaningfully older than its surrounding code | Low |
|
|
65
|
-
| Commit message convention
|
|
71
|
+
| Commit message convention established but occasionally broken | Low |
|
|
72
|
+
| No commit message convention discernible from the log at all | Info |
|
|
@@ -20,23 +20,39 @@ The constraint carries no exceptions: **this module runs only commands the proje
|
|
|
20
20
|
## Execution safety
|
|
21
21
|
|
|
22
22
|
- [ ] Every command runs under a timeout, and the value used is recorded in the finding. No industry default exists to defer to — of the harnesses with a public execution model, only Claude Code documents a numeric figure (120s soft, 600s hard); state the bound this run used rather than assuming a reader knows it.
|
|
23
|
-
- [ ]
|
|
23
|
+
- [ ] Record the test runner's own per-test timeout separately from the harness's overall command timeout already required above — Bun's runner defaults to 5000ms per test (`--timeout`), and Jest/Vitest/pytest each carry their own default or config key (Oven, official CLI documentation, current, https://bun.sh/docs/cli/test). A suite with a slow integration test that exceeds the runner's per-test default reports an individual test timeout distinct from, and often well before, the harness's own session-level bound — the two are not the same number and neither substitutes for the other. Refuted if the tight per-test timeout is a deliberate guard on a known-slow integration test the project documents (a comment, a CI config note) rather than an unnoticed default catching a test that simply grew slower over time.
|
|
24
|
+
- [ ] Network access during the run is scoped to what the declared command itself needs. A test suite reaching out during a run neither described nor requested by its own configuration is a finding in its own right — cross-reference `security.md` — not something silently permitted because the run was allowed to start. OWASP's own CI/CD risk catalogue names untrusted code executing inside a build/test pipeline as a top mechanism — CICD-SEC-3 Dependency Chain Abuse and CICD-SEC-4 Poisoned Pipeline Execution both cite real incidents of compromised packages reaching the network at install/run time (OWASP, official project page, current, https://owasp.org/www-project-top-10-ci-cd-security-risks/).
|
|
25
|
+
- [ ] Record the Node.js major version and any `--unhandled-rejections` mode the declared command's environment sets. Since Node 15, an unhandled promise rejection defaults to crashing the process as an uncaught exception unless the mode is overridden to `warn` — Node's own docs: an unhandled `'unhandledRejection'` "will be raised as an uncaught exception" by default (Node.js project, official API documentation, current, https://nodejs.org/api/process.html#exit-codes) — a suite run on an older major, or with the mode overridden, can exit 0 while an unhandled rejection was logged and discarded mid-run. Read the captured output for `UnhandledPromiseRejectionWarning` lines even on a green exit code. Refuted if the warning traces to a test double deliberately rejecting to exercise the code's own error handling, and a test assertion inside the same test consumes it — refuted by tracing the specific rejection to that pattern rather than treating every warning line as a leak.
|
|
24
26
|
- [ ] Nothing in the run writes outside the checked-out working tree — cross-reference `testing.md`'s isolation checks (`homedir()`, a hardcoded absolute path). A suite that fails this check is not executed to completion; its failure mode is reported and the run stops there.
|
|
25
|
-
- [ ] A script whose name implies mutation (`deploy`, `publish`, `migrate`, `seed`, `reset`, `clean`) is recorded under Establish what the project declares but never executed on the strength of appearing there — only on the user naming that exact script by name.
|
|
27
|
+
- [ ] A script whose name implies mutation (`deploy`, `publish`, `migrate`, `seed`, `reset`, `clean`) is recorded under Establish what the project declares but never executed on the strength of appearing there — only on the user naming that exact script by name. GitHub's own Codespaces security guidance is the closest source to this principle: a repository's own build/config files can run arbitrary code, isolation is VM-level only, and the primary guidance is "you should only open and work within repositories you know and trust" (GitHub, official product documentation, current, https://docs.github.com/en/codespaces/reference/security-in-github-codespaces).
|
|
26
28
|
- [ ] State begins clean before every run: a frozen install (`npm ci`, `pnpm install --frozen-lockfile`, or the project's equivalent) against the committed lockfile, not a reused `node_modules`. Note whether a build cache was warm or cold — a result measured against drifted dependencies or a stale cache is evidence about that drift, not about the code.
|
|
29
|
+
- [ ] Before the frozen install this module already requires, `search_code` `package.json` for `preinstall`/`postinstall`/`prepare` scripts. These execute automatically at install time, before any declared test/lint/build command runs, and sit outside the "this module runs nothing it cannot cite" guarantee unless recorded here explicitly — name what a lifecycle script does and whether it reaches the network, rather than treating the frozen install as inert. OWASP's own CI/CD risk catalogue names exactly this mechanism — CICD-SEC-3 Dependency Chain Abuse, citing real npm-package incidents "with millions of weekly downloads" executing malicious code via install-time scripts (OWASP, official project page, current, https://owasp.org/www-project-top-10-ci-cd-security-risks/). Refuted if the lifecycle script is a narrowly-scoped, documented build step (e.g. compiling a native binding) reaching only the declared package registry — refuted by reading the script body and confirming it does only that.
|
|
30
|
+
|
|
31
|
+
## Long-running commands
|
|
32
|
+
|
|
33
|
+
Everything above assumes a command that terminates. A `dev`/`start`/`preview`/`serve` script does not, and starting one is a different contract — this section is that contract, and `browser.md` relies on it rather than restating it. A server is started only when the user enabled execution **and** named the purpose that needs it (browser observation, or a declared smoke test against a live port); it is never started to "see what happens".
|
|
34
|
+
|
|
35
|
+
- [ ] The port comes from the script itself or its documented config (`PORT=` in the script body, a `--port` flag, `.env.example`, the framework's config file) — record where it was read from. If that port is already bound, stop and report which process holds it (`lsof -i :<port>` or the platform equivalent, quoted). Never pick another port, never kill the occupant.
|
|
36
|
+
- [ ] An already-running server is reused only when the user names its URL. A server answering on a framework's default port is not assumed to be this project's — a stale process from another checkout looks identical from the outside, and every observation against it would be about the wrong code.
|
|
37
|
+
- [ ] Readiness is an HTTP probe against the target URL, repeated until a 2xx/3xx or a stated timeout (default 60 s; record the value used). A server that never answers is this module's finding — record the command, the elapsed time, and the last stderr line — and browser observation reports `not applicable (target never became ready)` rather than walking a dead URL.
|
|
38
|
+
- [ ] The server's stdout/stderr is captured for the whole session and cited by line where a browser-side finding has a server-side counterpart (a 500 in `network.jsonl` with its stack trace in the server log is one finding, `observed` on the browser side and `executed` on this side, not two).
|
|
39
|
+
- [ ] Teardown is unconditional: the process this module started is stopped when the last flow finishes or fails, including on error, and the report records that it was stopped. A server the audit did not start is never stopped.
|
|
27
40
|
|
|
28
41
|
## The cheap ladder
|
|
29
42
|
|
|
30
|
-
- [ ] Typecheck first. Record exit code and, on failure, the error count. A failing typecheck makes every later step's findings suspect — code that does not typecheck may not build or behave the way the suite assumes — so treat this failure as gating, not as one finding among several.
|
|
43
|
+
- [ ] Typecheck first. Record exit code and, on failure, the error count. A failing typecheck makes every later step's findings suspect — code that does not typecheck may not build or behave the way the suite assumes — so treat this failure as gating, not as one finding among several. A non-zero exit is the language-agnostic signal a step failed — Node's own process docs describe exactly this convention for its own runtime (default exit code 1 on an uncaught exception, `process.exitCode` preferred for graceful reporting) (Node.js project, official API documentation, current, https://nodejs.org/api/process.html#exit-codes).
|
|
31
44
|
- [ ] Lint second, after typecheck. Record exit code and violation count. A lint failure does not gate the remaining steps the way a typecheck failure does, but a ruleset the project itself enforces and currently fails is `tooling-baseline.md`'s declared-versus-enforced gap made concrete, and belongs cited there too.
|
|
32
|
-
- [ ] Build third. Record exit code and, on failure, the first fatal error. A failing build means every other finding this audit makes about wiring or flow completion (`flow-integrity.md`) describes code that cannot currently ship — say so explicitly rather than letting those findings stand unqualified.
|
|
45
|
+
- [ ] Build third. Record exit code and, on failure, the first fatal error. A failing build means every other finding this audit makes about wiring or flow completion (`flow-integrity.md`) describes code that cannot currently ship — say so explicitly rather than letting those findings stand unqualified. (Node.js project, official API documentation, current, https://nodejs.org/api/process.html#exit-codes — same exit-code-as-signal convention.)
|
|
33
46
|
- [ ] State the ladder's stopping point plainly. If typecheck fails, say whether lint and build were still attempted or skipped, and why — a module that silently stops after step one looks identical to one that never attempted steps two and three.
|
|
34
47
|
|
|
35
48
|
## The suite
|
|
36
49
|
|
|
37
|
-
- [ ] Run the declared test command once. Record exit code, wall-clock duration, and the pass/fail/skip counts from the runner's own summary line — this is the module's core `executed` finding, and every other check in this section refines it.
|
|
38
|
-
- [ ]
|
|
39
|
-
- [ ]
|
|
50
|
+
- [ ] Run the declared test command once. Record exit code, wall-clock duration, and the pass/fail/skip counts from the runner's own summary line — this is the module's core `executed` finding, and every other check in this section refines it. pytest's own exit-code reference draws exactly this distinction: exit code 0 means "all collected tests passed," code 5 means "no tests were collected" — a materially different event a bare boolean can't distinguish (pytest project, official reference documentation, current, https://docs.pytest.org/en/stable/reference/exit-codes.html).
|
|
51
|
+
- [ ] Distinguish "the runner collected zero tests" from "the runner ran tests and they all passed" — pytest exits 5 specifically for the former, a distinct code from 0's "all passed" (pytest project, official reference documentation, current, https://docs.pytest.org/en/stable/reference/exit-codes.html); a JS runner printing "0 tests, 0 passed, 0 failed" at exit code 0 is the same trap under a convention that does not give it its own code. A zero-collected run is reported as a finding on its own, never folded into a pass. Refuted if the category is a new package or module with no tests yet, and that is stated in the project's own docs or explicitly named out of scope by the user's consent for this run — refuted when either is true, not treated as silently expected.
|
|
52
|
+
- [ ] Name skipped and pending tests, not just their count — `search_code` the source for `.skip`/`xit`/`xdescribe`, then confirm the run's own output reports the same number. A mismatch means the skip markers moved since whatever baseline the project last recorded. Jest's own docs document `.skip`/`xit`-family markers as the mechanism (Meta / OpenJS, official framework documentation, current, https://jestjs.io/docs/api); Bun supports the same Jest-family `test.skip`/`describe.skip` syntax alongside its own `test.todo()` marker (Oven, official CLI documentation, current, https://bun.sh/docs/cli/test) — a `search_code` scoped to `test.todo()` alone undercounts a Bun suite using `test.skip`/`describe.skip` too; match the full pattern set to the declared runner before concluding zero skips.
|
|
53
|
+
- [ ] Match the skip/pending `search_code` pattern to the declared runner, not only the JS-flavored `.skip`/`xit`/`xdescribe` this module already names: `@pytest.mark.skip`/`@pytest.mark.xfail` for pytest, `t.Skip()`/`t.Skipf()` for Go's testing package, `test.skip`/`describe.skip`/`test.todo()` for Bun (Oven, official CLI documentation, current, https://bun.sh/docs/cli/test). A search scoped to the wrong runner's syntax reports zero skips on a suite that has them.
|
|
54
|
+
- [ ] A committed `.only`/`fit`/`fdescribe` is a finding independent of whether the run currently passes — it silences the rest of the suite for every contributor who runs it locally, and a CI run would show a misleadingly small pass count if it slipped past review. Jest's own docs warn "you wouldn't check code using `test.only` into source control" (Meta / OpenJS, official framework documentation, current, https://jestjs.io/docs/api); Vitest goes further and throws in CI when a committed `.only` slips through, provided `allowOnly` was not overridden (Vitest core team, official framework documentation, current, https://vitest.dev/api/#test-only).
|
|
55
|
+
- [ ] Where the declared runner ships a built-in CI guard against a committed `.only` (Vitest's `allowOnly`, on by default in CI), `search_code` the test config for that option being overridden to `true`. If it is, the check above cannot lean on the runner having already caught this in the project's own CI — its absence from a red CI run is not evidence there is no committed `.only`, only evidence the guard was turned off. The CI throw is real but explicitly gated behind `allowOnly` not being set otherwise (Vitest core team, official framework documentation, current, https://vitest.dev/api/#test-only). Refuted if the project's runner predates the guard, or does not ship one (Jest has no equivalent automatic CI throw) — checked from the declared package version before flagging the override as meaningful.
|
|
40
56
|
- [ ] Repeat the run **ten times** against an unchanged tree. Ten is not arbitrary — it is the threshold Google's own flaky-test infrastructure uses to reclassify a passing-after-failure test as flaky (Luo et al., FSE 2014). Report the observed rate (`n/10`) rather than a bare "flaky" label.
|
|
41
57
|
- [ ] Where the runner supports randomised or reversed ordering, run it once out of committed order and diff the result against the unshuffled run. iDFlakies (ICST 2019) found roughly half of real flaky tests are order-dependent — invisible to a suite that only ever runs in the order it is committed in.
|
|
42
58
|
- [ ] Where a coverage script is separately declared, run it and read the number for exactly what it proves: which lines executed at least once. Kochhar, Lo, Lawall & Nagappan (*IEEE Transactions on Reliability* 66(4), 2017) found coverage has an insignificant correlation with post-release defects — the number is real and measured, but it is evidence of exercised lines, never of correctness, and must never be reported as the latter.
|
|
@@ -53,9 +69,9 @@ The constraint carries no exceptions: **this module runs only commands the proje
|
|
|
53
69
|
|
|
54
70
|
- [ ] A green run proves the project's own checks pass and nothing beyond what those checks were written to catch. Restate this in the finding itself, not only here — a green `executed` result inherits every blind spot `tooling-baseline.md` already found in what the tooling actually enforces.
|
|
55
71
|
- [ ] Mutation score, behaviour under real production traffic, environment-dependent flakiness (a different CI runner, timezone, locale), and whether a mocked seam faithfully reproduces its real dependency all stay out of reach — none are observable from a local run, however many times repeated.
|
|
56
|
-
- [ ] An axe-core run, where declared, is bounded at roughly 57% of real-world accessibility issues per Deque's own study of over 2,000 audits — a different and larger figure than the share of WCAG success criteria automatable, which is smaller and commonly conflated with it. The rest still needs `accessibility.md`'s manual checks.
|
|
57
|
-
- [ ] A Lighthouse or Core Web Vitals lab run, where declared, is `executed`-tier for the single run it performed and nothing beyond — usable as a regression check against a prior run, never as proof of a real-world pass. It cannot measure INP at all (INP requires a genuine user interaction) and only partially observes CLS, so it never substitutes for the field data `performance.md` already lists as out of reach.
|
|
58
|
-
- [ ] Rendering correctness, the keyboard walk, and real screen-reader output stay out of reach
|
|
72
|
+
- [ ] An axe-core run, where declared, is bounded at roughly 57% of real-world accessibility issues per Deque's own study of over 2,000 audits — a different and larger figure than the share of WCAG success criteria automatable, which is smaller and commonly conflated with it. The rest still needs `accessibility.md`'s manual checks. (Deque Systems, official company blog, current, https://www.deque.com/blog/automated-testing-study-identifies-57-percent-of-digital-accessibility-issues/ — analysis of 2,000+ audits and ~300,000 documented issues; the 57% figure is by volume/severity of issues found, not by the smaller, commonly-conflated measure of the share of WCAG success criteria automatable.)
|
|
73
|
+
- [ ] A Lighthouse or Core Web Vitals lab run, where declared, is `executed`-tier for the single run it performed and nothing beyond — usable as a regression check against a prior run, never as proof of a real-world pass. It cannot measure INP at all (INP requires a genuine user interaction) and only partially observes CLS, so it never substitutes for the field data `performance.md` already lists as out of reach — `browser.md`'s driven session closes the INP gap directly via a real interaction in `vitals.md`. web.dev's own INP article: "it's possible for a page to return no INP value... the user never clicked, tapped, or pressed a key" — a lab run with no interaction cannot report it at all (web.dev/Google, official vendor documentation, current, https://web.dev/articles/inp).
|
|
74
|
+
- [ ] Rendering correctness, the keyboard walk, and real screen-reader output stay out of reach for **this module** unless the project separately declares a browser-driving command — that limitation is specific to running the project's own declared tooling; `browser.md` reaches all three unconditionally via its own separate consent.
|
|
59
75
|
|
|
60
76
|
## Out of static reach
|
|
61
77
|
|
|
@@ -64,6 +80,19 @@ The constraint carries no exceptions: **this module runs only commands the proje
|
|
|
64
80
|
- Whether a currently-green suite would still be green against a change the project has not made yet; this module reports the present state of the tree, not a prediction.
|
|
65
81
|
- Whether the commands this module ran are the ones a human contributor actually runs day to day, versus a stale or aspirational script nobody invokes.
|
|
66
82
|
- Anything requiring a live third-party network dependency, a paid API, or a production credential this module is barred from reaching.
|
|
83
|
+
- Whether the machine this module's commands ran on was itself adequately isolated from other work — this module reports on the project's declared commands, not on its own execution environment's security posture.
|
|
84
|
+
- Whether a lifecycle script's network call is malicious — this module can name that a lifecycle script ran and what it reached, not judge intent.
|
|
85
|
+
- Whether this run's install matched CI's own install flags exactly — cross-reference `tooling-baseline.md`'s CI workflow reading before treating a script-observation run as equivalent to CI's own.
|
|
86
|
+
|
|
87
|
+
## What browser observation closes
|
|
88
|
+
|
|
89
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
90
|
+
|
|
91
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
92
|
+
|---|---|---|
|
|
93
|
+
| `network.jsonl` | Request/response shape (method, URL, status, size, duration) of a live third-party network dependency actually called during a confirmed flow | Info |
|
|
94
|
+
| This module's own server stdout/stderr capture (cited by line) cross-referenced against `network.jsonl` | A 5xx in `network.jsonl` on a confirmed flow has its matching stack trace in the captured server log — one finding, not two. Refuted when the 5xx comes from a deliberately stubbed/mocked endpoint the flow exercises to test error-handling UI — checked by finding the stub's own marker (a mocked route registered in the flow's test/fixture config, a fixture file serving that error) rather than by the exception's absence, which the pairing already requires. | High |
|
|
95
|
+
| This module's own readiness-probe log (command, elapsed time, last stderr line) cited against `steps.md` | `browser.md`'s "not applicable (target never became ready)" result has its `executed`-tier root cause in this module's own readiness-probe finding. Refuted when the target URL was user-supplied rather than started by this module — in that case this module's readiness probe never ran and is irrelevant to the browser-side non-result. | High |
|
|
67
96
|
|
|
68
97
|
## Severity guidance
|
|
69
98
|
|
|
@@ -73,11 +102,20 @@ The constraint carries no exceptions: **this module runs only commands the proje
|
|
|
73
102
|
| Declared test suite fails on the current tree | Critical |
|
|
74
103
|
| Committed `.only`/`fit`/`fdescribe` silencing the rest of the suite | High |
|
|
75
104
|
| Declared typecheck fails | High |
|
|
105
|
+
| Declared `dev`/`start`/`preview` server never answered the readiness probe within the recorded timeout | High |
|
|
106
|
+
| Server the audit started could not be confirmed stopped at teardown | High |
|
|
107
|
+
| Test runner collected zero tests, reported as a pass rather than its own finding | High |
|
|
108
|
+
| Lifecycle install script (`preinstall`/`postinstall`/`prepare`) reaches the network with no documented, narrow purpose | High |
|
|
109
|
+
| Port the declared script binds is already held by a process outside the audit (server not started, occupant named) | Medium |
|
|
76
110
|
| Test flaky at 2 or more failures in ten repeats, untracked | High |
|
|
77
111
|
| Order-dependent failure surfaced by a reordered run | High |
|
|
78
112
|
| Declared lint fails against the project's own configured ruleset | Medium |
|
|
79
113
|
| Skipped tests present with no tracking issue or comment | Medium |
|
|
80
114
|
| Coverage run confirms 0% on a symbol another module flagged high-blast-radius | Medium |
|
|
81
115
|
| Committed scanner report contradicted by a fresh run of the same scanner | Medium |
|
|
116
|
+
| Runner's built-in CI `.only` guard (e.g. Vitest `allowOnly`) overridden off | Medium |
|
|
117
|
+
| Unhandled promise rejection logged and discarded mid-run on a green exit code | Medium |
|
|
82
118
|
| Test flaky at exactly one failure in ten repeats | Low |
|
|
119
|
+
| Skip/pending search scoped to the wrong runner's syntax, undercounting real skips | Low |
|
|
120
|
+
| Runner's own per-test timeout exceeded, distinct from the harness's session timeout | Low |
|
|
83
121
|
| Result measured against a stale cache or drifted dependency install | Info |
|
|
@@ -6,19 +6,22 @@ What breaks when there is more of everything? Gate: a queue, worker, or backgrou
|
|
|
6
6
|
|
|
7
7
|
## Horizontal readiness
|
|
8
8
|
|
|
9
|
-
- [ ] No state lives only in one process's memory: `search_code` for a module-level `Map`/`Set`/object literal used as a cache, counter, or session store, then `find_callers` to confirm it is written on the request path rather than populated once from static config.
|
|
10
|
-
- [ ] Nothing depends on being the only instance: `search_code` for in-process locks, singletons holding mutable state, and interval timers — each one runs N times with N instances.
|
|
9
|
+
- [ ] No state lives only in one process's memory: `search_code` for a module-level `Map`/`Set`/object literal used as a cache, counter, or session store, then `find_callers` to confirm it is written on the request path rather than populated once from static config. Rule out a cache whose loss on restart or divergence across instances is harmless (a pure memoisation cache, not a session/counter store) — state whether the value is safe to be instance-local before flagging. This probe is shared with `concurrency.md`'s module-level mutable-state check; that module owns the race-condition read, this one owns the multi-instance read — cross-reference rather than double-report. Twelve-factor processes "are stateless and share-nothing" — nothing cached in memory or on disk can be assumed to survive to a future request or job (Adam Wiggins, The Twelve-Factor App, "VI. Processes," current, https://12factor.net/processes).
|
|
10
|
+
- [ ] Nothing depends on being the only instance: `search_code` for in-process locks, singletons holding mutable state, and interval timers — each one runs N times with N instances. "Sticky sessions are a violation of twelve-factor and should never be used or relied upon" (Adam Wiggins, The Twelve-Factor App, "VI. Processes," current, https://12factor.net/processes).
|
|
11
11
|
- [ ] Scheduled work has a leader election or a distributed lock: `search_code` for `setInterval`/a cron import/a scheduler registration, then read the surrounding code for a lock/leader check (`SETNX`, an advisory lock, an "only run on leader" guard). Rule out a genuinely single-replica deployment — read the deploy manifest or Dockerfile replica count — before flagging.
|
|
12
|
-
- [ ] Local filesystem writes are either ephemeral or explicit shared storage: `search_code` for `fs.writeFile`/`createWriteStream` and check the target path against a shared-storage prefix (S3, a mounted volume) versus a local `/tmp`-style path. A file written on one instance and read on another silently fails behind a load balancer.
|
|
12
|
+
- [ ] Local filesystem writes are either ephemeral or explicit shared storage: `search_code` for `fs.writeFile`/`createWriteStream` and check the target path against a shared-storage prefix (S3, a mounted volume) versus a local `/tmp`-style path. A file written on one instance and read on another silently fails behind a load balancer — the same share-nothing constraint applies to disk as to memory (Adam Wiggins, The Twelve-Factor App, "VI. Processes," current, https://12factor.net/processes).
|
|
13
13
|
|
|
14
14
|
## Queues and workers
|
|
15
15
|
|
|
16
16
|
- [ ] Every queue has a consumer, and every consumer has a producer: `search_code` the queue/topic name literal and confirm it appears at both a publish call (`.publish`/`.send`/`.enqueue`) and a consume call (`.consume`/`on('message'`). Cross-reference the half-wired pairs table in `flow-integrity.md` — an unconsumed queue grows forever.
|
|
17
|
-
- [ ] Jobs are idempotent: `find_symbol` the job handler and read its write path. An `INSERT` with no unique constraint or dedup key, run under at-least-once delivery, double-writes on redelivery. Rule out that the transport itself guarantees exactly-once (name it) before flagging — but check the guarantee's actual scope first: Kafka's exactly-once semantics (idempotent producer + transactions) covers Kafka-to-Kafka only — offsets, state stores, output topics — not a database write or HTTP call the handler makes as a side effect; SQS FIFO's deduplication is a 5-minute window on the *send* path (`MessageDeduplicationId` or a content hash), not a guarantee the handler itself won't run twice after redelivery; RabbitMQ makes no exactly-once claim at all — its own docs say to
|
|
17
|
+
- [ ] Jobs are idempotent: `find_symbol` the job handler and read its write path. An `INSERT` with no unique constraint or dedup key, run under at-least-once delivery, double-writes on redelivery. Rule out that the transport itself guarantees exactly-once (name it) before flagging — but check the guarantee's actual scope first: Kafka's exactly-once semantics (idempotent producer + transactions) covers Kafka-to-Kafka only — offsets, state stores, output topics — not a database write or HTTP call the handler makes as a side effect (Confluent, Kafka documentation, "Kafka delivery semantics," current, https://docs.confluent.io/kafka/design/delivery-semantics.html); SQS FIFO's deduplication is a 5-minute window on the *send* path (`MessageDeduplicationId` or a content hash), not a guarantee the handler itself won't run twice after redelivery (AWS, SQS Developer Guide, "Using the message deduplication ID in Amazon SQS," current, https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html); RabbitMQ makes no exactly-once claim at all — its own docs say "consumer applications will need to perform deduplication or handle incoming messages in an idempotent manner" (Broadcom, RabbitMQ documentation, "Reliability Guide," current, https://www.rabbitmq.com/docs/reliability). A rule-out that doesn't name which of these applies, and confirm the side effect stays inside that boundary, is not a rule-out.
|
|
18
18
|
- [ ] Failed jobs go somewhere: `search_code` for the queue library's failure hook (`on('failed'`, a dead-letter binding, a `.catch(` around job processing). Silent drop is the default failure mode in most libraries and it is `High`.
|
|
19
|
-
- [ ] The dead-letter destination is actually drained by something: `search_code` for a redrive/replay path (SQS's `StartMessageMoveTask`, a scheduled job reading the DLQ, an alert wired to DLQ depth) versus a DLQ that exists only as a naming convention. Replay tooling varies by platform — SQS supports redrive natively; Kafka Connect's dead-letter topic (sink connectors only — source connectors have no DLQ mechanism at all) is a plain topic with no built-in replay; Azure Service Bus has no built-in redrive either. A DLQ nothing reads is a slower version of silent drop.
|
|
19
|
+
- [ ] The dead-letter destination is actually drained by something: `search_code` for a redrive/replay path (SQS's `StartMessageMoveTask`, a scheduled job reading the DLQ, an alert wired to DLQ depth) versus a DLQ that exists only as a naming convention. Replay tooling varies by platform — SQS supports redrive natively; Kafka Connect's dead-letter topic (sink connectors only — source connectors have no DLQ mechanism at all) is a plain topic with no built-in replay; Azure Service Bus has no built-in redrive either. A DLQ nothing reads is a slower version of silent drop. Nothing drains a DLQ automatically — messages leave only through a deliberate redrive action, and a retention period shorter than the source queue's lets them silently expire before anyone looks (AWS, SQS Developer Guide, "Using dead-letter queues in Amazon SQS," current, https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html).
|
|
20
|
+
- [ ] Where a dead-letter queue sits behind a FIFO or otherwise order-dependent queue, the ordering consequence is explicit: `search_code` for the DLQ/redrive configuration attached to a queue whose name, library, or surrounding code implies ordering matters (a FIFO queue, a sequence/version field in the payload). Redriving a DLQ out of order silently breaks any downstream logic that assumed messages arrive in send order. Refuted if the queue's ordering guarantee is not actually load-bearing anywhere downstream (no code keys logic off arrival order) — trace the consumer's handling before flagging. AWS explicitly warns against pairing a DLQ with a FIFO queue unless breaking strict message order is acceptable (AWS, SQS Developer Guide, "Using dead-letter queues in Amazon SQS," current, https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html).
|
|
20
21
|
- [ ] Retries are bounded: `search_code` for the retry/backoff config (`attempts:`, `backoff:`, `maxRetries`) on the job/queue definition. Read the library's default when no config is present — several default to infinite.
|
|
21
|
-
- [ ]
|
|
22
|
+
- [ ] Backoff on retries is randomized (jitter), not a fixed interval or a bare exponential curve with no jitter: `search_code` for the backoff config/implementation and check for a random/jitter term. A synchronized fixed or jitter-free exponential backoff means every failed caller retries in lockstep, turning a brief dip into a retry storm exactly when the backend is recovering. Refuted if a single-instance caller, or a retry population small enough that lockstep retries cannot meaningfully exceed normal peak load, does not produce a storm — state the caller cardinality before flagging. "Always use randomized exponential backoff when scheduling retries" — un-jittered retries are themselves what adds load on top of an already-overloaded backend (Google, Site Reliability Engineering book, "Addressing Cascading Failures," current, https://sre.google/sre-book/addressing-cascading-failures/).
|
|
23
|
+
- [ ] On SIGTERM, a worker process finishes or requeues its current job rather than dropping it mid-processing: `search_code` for a SIGTERM/SIGINT handler in the worker entrypoint and read whether it stops pulling new jobs, waits for or requeues the in-flight one, before exiting — versus an immediate `process.exit()` or no handler at all (the platform's default kill behaviour). Refuted (downgrades to Info, not a defect) if the queue library itself already requeues on ack timeout (the job was never acked, so it naturally redelivers) — confirm the library's redelivery-on-no-ack behaviour before flagging the app code as the gap. "For a worker process, graceful shutdown is achieved by returning the current job to the work queue" (Adam Wiggins, The Twelve-Factor App, "IX. Disposability," current, https://12factor.net/disposability).
|
|
24
|
+
- [ ] Job payloads carry identifiers, not whole objects: Read a handful of `.enqueue`/`.publish` call sites — a full domain object in the payload instead of an id is the finding. Fat payloads make the queue the database.
|
|
22
25
|
- [ ] Concurrency per consumer is bounded and configurable: `search_code` for the consumer's concurrency/prefetch setting; its absence means the library's own default applies, which is worth stating explicitly.
|
|
23
26
|
|
|
24
27
|
## Data growth
|
|
@@ -30,17 +33,30 @@ What breaks when there is more of everything? Gate: a queue, worker, or backgrou
|
|
|
30
33
|
|
|
31
34
|
## Backpressure
|
|
32
35
|
|
|
33
|
-
- [ ] Producers slow down or shed load when consumers fall behind: `search_code` for a queue-depth check, an ack wait, or a `pause()`/`resume()` hook (Node stream `highWaterMark`, a Kafka consumer's `pause()`) before the next publish. The absence signature is concrete: unbounded array/queue growth with no size cap, a fan-out that spawns one promise or goroutine per item with no semaphore or worker-pool limit, or a publish loop with no await/ack-wait between sends. Unbounded fire-and-forget publishing just moves the failure downstream.
|
|
36
|
+
- [ ] Producers slow down or shed load when consumers fall behind: `search_code` for a queue-depth check, an ack wait, or a `pause()`/`resume()` hook (Node stream `highWaterMark`, a Kafka consumer's `pause()`) before the next publish. The absence signature is concrete: unbounded array/queue growth with no size cap, a fan-out that spawns one promise or goroutine per item with no semaphore or worker-pool limit, or a publish loop with no await/ack-wait between sends. Unbounded fire-and-forget publishing just moves the failure downstream. `writable.write()` returns `false` once the internal buffer exceeds `highWaterMark`, and `pause()`/`resume()` toggle a readable stream out of and back into flowing mode — the concrete mechanism this check looks for in Node code (OpenJS Foundation, Node.js API documentation, "Backpressuring in Streams," current, https://nodejs.org/api/stream.html#backpressuring-in-streams); a well-behaved backend should likewise "accept only the requests it can process and reject the rest" rather than queue indefinitely (Google, Site Reliability Engineering book, "Handling Overload," current, https://sre.google/sre-book/handling-overload/).
|
|
34
37
|
- [ ] A reactive/streaming operator that claims to handle backpressure is actually bounded: `search_code` for the operator call and check whether a capacity argument is present — Project Reactor's `onBackpressureBuffer()` is unbounded by default unless given an explicit max size. An unconfigured "backpressure-handling" operator can still exhaust memory under sustained overload.
|
|
35
38
|
- [ ] Bounded pools exist for connections, workers, and concurrent outbound calls: `search_code` for the pool config (`maxConnections`, `pool: { max: }`, an HTTP agent's `maxSockets`). Its absence means the client library's own unbounded default applies. This is the bulkhead pattern — a slow or saturated dependency should exhaust only its own pool, not one shared with every other dependency; a single HTTP client or connection pool reused across multiple downstream services is the common way this fails. Cross-reference `Failure`'s circuit-breaker check — the two patterns are usually paired.
|
|
36
39
|
- [ ] Rate limits protect downstream dependencies, not only inbound callers: `search_code` for a throttle wrapper around outbound calls to a third-party dependency, separate from the inbound API gate.
|
|
37
|
-
- [ ] Timeouts are shorter than the caller's timeout, so failures surface at the right layer: read the timeout set on each outbound client (`find_symbol`/read the client construction) and compare it against the framework's own request timeout.
|
|
40
|
+
- [ ] Timeouts are shorter than the caller's timeout, so failures surface at the right layer: read the timeout set on each outbound client (`find_symbol`/read the client construction) and compare it against the framework's own request timeout. Prefer deadline propagation to independently invented per-layer timeouts (Google, Site Reliability Engineering book, "Addressing Cascading Failures," current, https://sre.google/sre-book/addressing-cascading-failures/).
|
|
38
41
|
|
|
39
42
|
## Degradation
|
|
40
43
|
|
|
41
|
-
- [ ] Under load the system degrades rather than collapsing: read the failure path of the top-ranked handler from `repo_map` for a stale-cache fallback or an explicit `503`, versus an unhandled exception that takes the whole request down.
|
|
44
|
+
- [ ] Under load the system degrades rather than collapsing: read the failure path of the top-ranked handler from `repo_map` for a stale-cache fallback or an explicit `503`, versus an unhandled exception that takes the whole request down. A well-behaved backend accepts only what it can process and rejects the rest early (Google, Site Reliability Engineering book, "Handling Overload," current, https://sre.google/sre-book/handling-overload/); a cache in front of a slow/unreliable dependency is one concrete mechanism for this, per the check below.
|
|
45
|
+
- [ ] A cache sitting in front of a slow/unreliable dependency distinguishes a refresh TTL from a serve-stale TTL, rather than evicting to empty the moment one TTL expires: `search_code` for the cache read path and `expand_context` to check for two TTL values (or equivalent soft/hard staleness handling) versus a single TTL after which the key is simply gone and every reader falls through to the dependency at once. Refuted if the cache is a pure single-request memoization cache with no fallback role (loss is harmless, per the horizontal-readiness rule-out above) — confirm the cache is capacity-relevant, not latency-only, before flagging. The soft-TTL/hard-TTL split is the documented mechanism for degrading gracefully instead of failing when a cache backend is down, and it is also what prevents cache stampede — many clients requesting the same uncached key at once overloading the downstream (AWS, Builders' Library, "Caching challenges and strategies," current, https://aws.amazon.com/builders-library/caching-challenges-and-strategies/).
|
|
46
|
+
- [ ] When the system sheds load under detected overload (a queue-depth check, a 503 path, a circuit breaker opening), it sheds low-priority work first rather than rejecting indiscriminately: `find_symbol` the shedding/overload-guard code and read whether it distinguishes request/job criticality (a tag, a route class, a priority field) before rejecting, versus a single uniform threshold applied to everything alike. Refuted if the system has genuinely homogeneous request criticality (every request is equally essential) — state that this was considered before flagging its absence. Google's own four criticality levels (CRITICAL_PLUS/CRITICAL/SHEDDABLE_PLUS/SHEDDABLE) exist specifically so overload sheds the traffic that matters least first (Google, Site Reliability Engineering book, "Handling Overload," current, https://sre.google/sre-book/handling-overload/).
|
|
42
47
|
- [ ] Non-critical work is genuinely non-blocking: `search_code` for an `await` on an analytics/telemetry call inside a request handler with no surrounding try/catch or fire-and-forget wrapper — a failing optional call must not fail the request.
|
|
43
|
-
- [ ] Health
|
|
48
|
+
- [ ] Health-check readiness-vs-liveness is owned by `observability.md` (`find_symbol` the liveness/readiness endpoints); reuse its finding, do not re-report. This module keeps only the capacity angle.
|
|
49
|
+
- [ ] The health/readiness check handler does no work that shares a bottleneck with normal request handling (no shared thread pool, no DB call on the same connection pool that's already saturated): `find_symbol` the health-check handler and `find_callees` to see what it touches. A health check that queries the same exhausted resource it's meant to report on will fail exactly when the instance is under the load that made it worth checking. Refuted if the shared dependency check is intentional and shallow (a lightweight `SELECT 1` on its own low-cost connection, not a query competing for the same saturated pool) — read the query cost before flagging. Under thread starvation specifically, health checks "may fail if the health check endpoint can't be served in time" — a self-inflicted removal of capacity at the exact moment the instance is already struggling (Google, Site Reliability Engineering book, "Addressing Cascading Failures," current, https://sre.google/sre-book/addressing-cascading-failures/).
|
|
50
|
+
|
|
51
|
+
## What browser observation closes
|
|
52
|
+
|
|
53
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number. This module is fundamentally about behaviour under concurrency, scale, and multi-instance deployment — properties a single browser session walking one instance, one time, structurally cannot exercise. Most of its checks (horizontal readiness, data growth, most of backpressure and queues/workers) have no browser-observable signature at all; the rows below are the only places a normal read-only walk can incidentally surface evidence, and even those are corroboration for a `search_code`/`read` finding, not standalone proof.
|
|
54
|
+
|
|
55
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
56
|
+
|---|---|---|
|
|
57
|
+
| `network.jsonl` request URLs during a listing/scroll flow — presence of `offset=`/`page=` params versus a cursor/`after=`/keyset param | Pagination is cursor-based where the dataset is large. Refuted if the dataset walked is small enough that offset pagination hasn't yet crossed into the degradation range this check cares about — this only confirms the mechanism used, not that it currently hurts. Confirms the mechanism only; the existing static check already owns the Low-severity finding once the mechanism is known. | Info |
|
|
58
|
+
| `network.jsonl` — a `429`/`503` response with a `Retry-After` header observed on a request made during the walk | Producers slow down or shed load when consumers fall behind, confirmed to actually fire, not just exist in code. Refuted if the `429`/`503` seen is on an unrelated auth/rate-limit gate, not this specific backpressure mechanism — confirm the response is on a path this check is actually about before crediting it. A positive confirmation promotes the static `read` finding toward `observed` when it fires; it does not itself create a new defect. | Info |
|
|
59
|
+
| `screenshots/` + `final-state.md` + `console.jsonl`/`network.jsonl`, if a flow step happens to hit a genuinely overloaded or slow-responding backend during the walk | Under load the system degrades rather than collapsing — an unhandled 500/blank page versus a stale-data banner or explicit error state. A single lab walk at normal load essentially never reaches real overload — this row almost never fires, recorded so the auditor doesn't over-credit a quiet bundle; a clean pass here proves nothing about behaviour under load, only that this specific request, this one time, didn't fail — state that explicitly rather than reading it as a pass on this check. | Info |
|
|
44
60
|
|
|
45
61
|
## Out of static reach
|
|
46
62
|
|
|
@@ -49,6 +65,11 @@ What breaks when there is more of everything? Gate: a queue, worker, or backgrou
|
|
|
49
65
|
- True queue throughput versus producer rate under real load.
|
|
50
66
|
- Real failover or leader-election behaviour during an actual node loss.
|
|
51
67
|
- Whether a rate limit or bounded pool is sized correctly for real downstream capacity, versus merely present.
|
|
68
|
+
- Whether throughput actually degrades (retrograde scaling) past some concurrency level, versus merely scaling sublinearly — this needs a real load test at multiple concurrency levels, which this module does not run.
|
|
69
|
+
- Whether the configured jitter window is wide enough to prevent a retry storm in practice — this module confirms jitter exists, not that it's sized correctly for real failure/recovery timing.
|
|
70
|
+
- A DLQ with no redrive code found may still have a documented manual runbook outside the repository — absence of code is not proof of absence of process.
|
|
71
|
+
- Whether an automated failover in this system can produce the same cross-region split-brain writes as a real incident of this shape — this needs to be tested against the actual failover tooling, not inferred from source.
|
|
72
|
+
- Whether the health check's shared dependency is the thing that actually saturates under load — this module proves the dependency is shared, not that it's the bottleneck.
|
|
52
73
|
|
|
53
74
|
## Severity guidance
|
|
54
75
|
|
|
@@ -60,9 +81,15 @@ What breaks when there is more of everything? Gate: a queue, worker, or backgrou
|
|
|
60
81
|
| Scheduled job with no leader election | High |
|
|
61
82
|
| Non-idempotent job under at-least-once delivery | High |
|
|
62
83
|
| Exactly-once guarantee assumed for a side effect outside the transport's actual transactional boundary | High |
|
|
84
|
+
| Health-check handler shares a bottleneck with the load it is meant to report on, traced (`find_callees`) | High |
|
|
63
85
|
| No backpressure between producer and consumer | Medium |
|
|
64
86
|
| Unbounded data growth with no retention policy | Medium |
|
|
65
87
|
| Batch job that reprocesses everything | Medium |
|
|
66
88
|
| Dead-letter queue with no redrive or replay path — failures accumulate unread | Medium |
|
|
67
89
|
| Reactive backpressure operator used with no bounded capacity (default-unbounded buffer) | Medium |
|
|
90
|
+
| Unjittered backoff risking a synchronized retry storm | Medium |
|
|
91
|
+
| Worker drops its in-flight job on SIGTERM instead of finishing or requeuing it | Medium |
|
|
92
|
+
| Cache with a single TTL and no soft/hard staleness split in front of a slow/unreliable dependency | Medium |
|
|
93
|
+
| DLQ paired with a FIFO/ordered queue with no explicit ordering treatment on redrive | Medium |
|
|
68
94
|
| Offset pagination over a large dataset | Low |
|
|
95
|
+
| Load shedding applied uniformly, with no priority/criticality distinction | Low |
|