project-brain 0.22.4 → 0.23.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/skills/brain-audit/SKILL.md +174 -8
- package/templates/skills/brain-audit/references/abuse.md +34 -24
- package/templates/skills/brain-audit/references/accessibility.md +41 -21
- package/templates/skills/brain-audit/references/ai.md +28 -18
- package/templates/skills/brain-audit/references/analytics.md +73 -0
- package/templates/skills/brain-audit/references/api.md +27 -17
- package/templates/skills/brain-audit/references/backend.md +24 -16
- package/templates/skills/brain-audit/references/complexity.md +30 -17
- package/templates/skills/brain-audit/references/concurrency.md +28 -19
- package/templates/skills/brain-audit/references/consistency.md +32 -24
- package/templates/skills/brain-audit/references/contract-drift.md +30 -19
- package/templates/skills/brain-audit/references/cost.md +35 -24
- package/templates/skills/brain-audit/references/cross-surface-parity.md +70 -0
- package/templates/skills/brain-audit/references/database.md +42 -24
- package/templates/skills/brain-audit/references/dependencies-licensing.md +34 -23
- package/templates/skills/brain-audit/references/design-system.md +99 -0
- package/templates/skills/brain-audit/references/devops.md +38 -24
- package/templates/skills/brain-audit/references/documentation.md +35 -23
- package/templates/skills/brain-audit/references/failure.md +33 -21
- package/templates/skills/brain-audit/references/feature-flags.md +87 -0
- package/templates/skills/brain-audit/references/flow-integrity.md +58 -33
- package/templates/skills/brain-audit/references/frontend.md +36 -19
- package/templates/skills/brain-audit/references/functional.md +38 -17
- package/templates/skills/brain-audit/references/future.md +32 -12
- package/templates/skills/brain-audit/references/goal.md +19 -12
- package/templates/skills/brain-audit/references/i18n.md +37 -23
- package/templates/skills/brain-audit/references/idempotency.md +76 -0
- package/templates/skills/brain-audit/references/infrastructure.md +31 -22
- package/templates/skills/brain-audit/references/mobile.md +32 -23
- package/templates/skills/brain-audit/references/multi-tenancy.md +74 -0
- package/templates/skills/brain-audit/references/numeric.md +70 -0
- package/templates/skills/brain-audit/references/observability.md +36 -21
- package/templates/skills/brain-audit/references/packaging.md +27 -19
- package/templates/skills/brain-audit/references/performance.md +48 -21
- package/templates/skills/brain-audit/references/privacy.md +39 -25
- package/templates/skills/brain-audit/references/product.md +31 -12
- package/templates/skills/brain-audit/references/prompt-spec-gap.md +25 -18
- package/templates/skills/brain-audit/references/reachability.md +28 -20
- package/templates/skills/brain-audit/references/repo-history.md +65 -0
- package/templates/skills/brain-audit/references/scalability.md +35 -22
- package/templates/skills/brain-audit/references/security.md +50 -33
- package/templates/skills/brain-audit/references/state-model.md +73 -0
- package/templates/skills/brain-audit/references/supply-chain.md +64 -0
- package/templates/skills/brain-audit/references/temporal.md +66 -0
- package/templates/skills/brain-audit/references/testing.md +49 -24
- package/templates/skills/brain-audit/references/tooling-baseline.md +77 -0
- package/templates/skills/brain-audit/references/type-safety.md +68 -0
- package/templates/skills/brain-audit/references/versioning-compatibility.md +33 -22
- package/templates/skills/brain-audit/references/visual-design.md +89 -0
- package/templates/skills/brain-audit/references/web-metadata.md +72 -0
|
@@ -6,47 +6,59 @@ Distinct from `Security`, which asks whether data can be stolen. This module ask
|
|
|
6
6
|
|
|
7
7
|
## Inventory first
|
|
8
8
|
|
|
9
|
-
You cannot audit what you have not enumerated
|
|
9
|
+
You cannot audit what you have not enumerated, and unlike most modules in this skill, the inventory here is not inference — **the schema's field names are the probe, and they are already sitting in plain text.** Read them literally before doing anything else; every later section reuses this list rather than rediscovering fields case by case.
|
|
10
10
|
|
|
11
|
-
- [ ]
|
|
12
|
-
- [ ] Free-text
|
|
13
|
-
- [ ] For each field
|
|
14
|
-
- [ ]
|
|
11
|
+
- [ ] `search_code` schema, model, and migration files (or `get_module` on the data-layer module) and read every column and field name against a checklist: name, email, phone, address, IP, device id, precise location / lat / lng, government id, payment or card details, biometrics, health, date of birth — and anything a foreign key derives from these. This single pass is the inventory; do not skip it and guess later. The two-tier split — ordinary identifiers versus the higher-sensitivity group (government id, payment details, biometrics, health) — follows NIST SP 800-122's PII / "sensitive PII" distinction; treat a hit in the sensitive group as the stronger finding when the same gap (no stated purpose, no retention limit) applies to both.
|
|
12
|
+
- [ ] Free-text columns count and cannot be enumerated by name alone — `search_code` for columns named `notes`, `comment`, `bio`, `description`, `message`, `feedback`. Flag each as "unbounded content, requires manual read of sample call sites" rather than pretending the column name tells you what is inside it.
|
|
13
|
+
- [ ] For each inventoried field, trace its lifecycle: `find_callers` on its accessor to see where it is read, `trace_path` from the API input that sets it to the write that persists it. Where it enters, where it lands, and what touches it in between is the row this checklist is actually building.
|
|
14
|
+
- [ ] Collected-but-never-read fields are the cheapest finding in this module. `find_callers` on the read path for the column — empty, with `Reachability`'s exclusions in `reachability.md` ruled out, means it is a candidate. Stop collecting it rather than justifying it.
|
|
15
15
|
|
|
16
16
|
## Egress — where does it go
|
|
17
17
|
|
|
18
|
-
- [ ]
|
|
19
|
-
- [ ] **Error reports and logs are the most common accidental egress.**
|
|
20
|
-
- [ ] **Prompts are egress.**
|
|
21
|
-
- [ ] Client-side scripts that
|
|
22
|
-
- [ ] Backups, exports, and fixtures —
|
|
18
|
+
- [ ] Enumerate third parties first: `get_architecture` dependencies plus `search_code` for known SDK imports — analytics, error reporting, logging platforms, LLM providers, support-tool SDKs, CDNs. A third party you have not named cannot be checked.
|
|
19
|
+
- [ ] **Error reports and logs are the most common accidental egress.** `search_code` the error-reporting SDK's capture call (`Sentry.captureException`, `.captureMessage`, or equivalent) and read literally what is passed — a scrubbed error object, or the full request with headers and body attached.
|
|
20
|
+
- [ ] **Prompts are egress.** `search_code` the LLM SDK call site and read what is interpolated into the messages/prompt argument against the field inventory above — if an inventoried field lands there, that data left the system. Cross-reference `ai.md`.
|
|
21
|
+
- [ ] Client-side scripts that read personal data from the page or from storage: `search_code` `localStorage`/`sessionStorage`/cookie reads adjacent to an analytics `track()`/`identify()` call — the adjacency is what makes it egress rather than a UI convenience.
|
|
22
|
+
- [ ] Backups, exports, and fixtures — `search_code` test fixtures and seed files for realistic-looking emails and names. **Rule out first:** `example.com`, `test@test.com`, and obviously synthetic names (`Jane Doe`, `Test User`) are not the finding. A fixture using a real corporate domain, or a name that resolves to an actual person, is — confirm which one you are looking at before reporting it.
|
|
23
23
|
|
|
24
24
|
## Minimisation
|
|
25
25
|
|
|
26
|
-
- [ ] Each field has a purpose
|
|
27
|
-
- [ ] Precision
|
|
28
|
-
- [ ]
|
|
29
|
-
- [ ]
|
|
26
|
+
- [ ] "Each field has a stated purpose" is not checked field-by-field on suspicion — walk the inventory list and, for each entry, look for a comment, schema doc, or data dictionary stating why it is collected. Report the absence once, across the whole inventory, with the count of fields with no stated purpose — not as N separate findings.
|
|
27
|
+
- [ ] Precision: read the field's declared type against what the feature needs — a `timestamp` where a year would do, a `lat`/`lng` pair where a region would do. The schema states the precision directly; no inference needed.
|
|
28
|
+
- [ ] Pseudonymous where possible: `search_code` whether downstream tables and services key on the real PII field (email, phone) directly, or on an internal id that only resolves to PII at one boundary.
|
|
29
|
+
- [ ] PII in a URL or in logs: `search_code` route definitions for path parameters shaped like `:email`, `:phone`, `/user/:name`, and logger call sites that would capture a query string carrying one of the inventoried fields.
|
|
30
30
|
|
|
31
31
|
## Retention and deletion
|
|
32
32
|
|
|
33
|
-
- [ ]
|
|
34
|
-
- [ ] Deletion is
|
|
35
|
-
- [ ] Soft delete
|
|
36
|
-
- [ ]
|
|
33
|
+
- [ ] Retention enforced, not just declared: for each store the inventory names, `search_code` for a scheduled job, cron entry, or TTL index tied to it. A store with no matching job is a policy with no enforcement — report it as such, don't assume one exists off-repo.
|
|
34
|
+
- [ ] Deletion completeness is a diff, not a guess: `find_callers` on the account/data-deletion handler, then `find_callees` to enumerate every store it actually touches. The gap between that set and the full inventory from the first section is the finding — name the stores deletion misses.
|
|
35
|
+
- [ ] Soft delete: `find_symbol` the delete function and read its body — does it set a flag/mark a row, or actually remove or anonymise it? Then check whether user-facing copy (`search_code` the confirmation string) calls this "delete" when it is really a flag flip.
|
|
36
|
+
- [ ] Log retention: `search_code` the logging platform's retention or TTL configuration and compare it against how long the inventoried fields persist elsewhere — a log line living longer than the record it was copied from is the finding.
|
|
37
37
|
|
|
38
38
|
## User rights
|
|
39
39
|
|
|
40
|
-
- [ ] Export
|
|
41
|
-
- [ ] Deletion
|
|
42
|
-
- [ ] Consent
|
|
43
|
-
- [ ] Defaults
|
|
40
|
+
- [ ] Export completeness: `find_symbol` the export/data-download handler, `find_callees` from it, and compare the fields it actually serialises against the full inventory — a data export returning the profile table only, while the inventory lists five other stores, is the finding, named field by field.
|
|
41
|
+
- [ ] Deletion requestable: `search_code` for a deletion-request endpoint, or its documented process if the flow is manual (support ticket, admin action) — either counts, but one of them must exist and be discoverable from the code.
|
|
42
|
+
- [ ] Consent recorded: `search_code` the schema for a `consent`/`consented_at`-shaped column, then `find_callers` on it to confirm it is actually checked before the gated use, not merely written and ignored.
|
|
43
|
+
- [ ] Defaults: read the signup or settings handler for a data-sharing/marketing flag and its default value in the schema or the handler's initial-state literal — defaulting to opted-in is the finding.
|
|
44
|
+
- [ ] Opt-out signal handling: `search_code` for `Sec-GPC` or Global Privacy Control handling and, where present, trace whether it drives a visible confirmation state (an "opt-out honoured" indicator) rather than only a silent internal flag flip — CCPA/CPRA requires the confirmation be visible to the user, effective 2026-01-01. Its total absence in a project that otherwise implements a cookie/tracking consent banner is the finding, not merely a missing UI polish item.
|
|
45
|
+
- [ ] Deletion refusal names the reason: `find_symbol` the deletion handler's refusal branch (a legal-hold, active-subscription, or fraud-prevention exception) and read whether it records or returns which exception applied, versus silently no-op'ing the request with no trace of why. CCPA/CPRA requires a business to state which statutory exception it is relying on when it declines a deletion request.
|
|
44
46
|
|
|
45
47
|
## Boundaries
|
|
46
48
|
|
|
47
|
-
- [ ]
|
|
48
|
-
- [ ] Test
|
|
49
|
-
- [ ] Debug and admin tooling that displays personal data
|
|
49
|
+
- [ ] Jurisdiction: `search_code` region or data-residency configuration and cloud provider region settings — a stated region is a pass; an unstated one is `undetermined`, not compliant.
|
|
50
|
+
- [ ] Test/staging holding real PII: reuse the fixture probe from Egress, and additionally `search_code` seed scripts for signs of copying from production — `pg_dump`, `mysqldump`, `cp prod`, a script name containing `prod` or `production`.
|
|
51
|
+
- [ ] Debug and admin tooling that displays personal data: `find_symbol` the admin route or debug endpoint, confirm an auth-middleware call guards it, and `search_code` for an audit-log call on the same path — display without an audit trail is the finding even when access control is present.
|
|
52
|
+
|
|
53
|
+
## Out of static reach
|
|
54
|
+
|
|
55
|
+
- Whether a third party actually honours a deletion or consent-withdrawal request once data has left this codebase — the contract may say so; the repo cannot prove compliance.
|
|
56
|
+
- Whether a DSAR/export response is actually transmitted through a secure channel (encrypted email, secure transfer, a dedicated portal) versus plaintext — the handler's code shows what it constructs, not how it was delivered at runtime.
|
|
57
|
+
- Statutory response-time compliance (GDPR's one-month/extendable-to-three window, CCPA's 15-business-day opt-out window) — these are process SLAs, not code properties; a handler existing says nothing about whether it runs in time.
|
|
58
|
+
- Real backup-restore behaviour: whether restoring an old backup resurrects data a user had deleted. This needs a live restore, not a reading of the backup job's code.
|
|
59
|
+
- Infrastructure-level logs outside this repo — load balancer access logs, CDN logs, cloud provider audit trails — that may carry PII in URLs or headers the application code never sees.
|
|
60
|
+
- Whether staging or test data is *actually* real personal data, versus merely shaped like it. The fixture and seed-script probes above find the shape; confirming the content needs a live database read.
|
|
61
|
+
- User-perceived clarity of consent language and UI — whether a real user would understand what they agreed to. That is a comprehension question, not a static one.
|
|
50
62
|
|
|
51
63
|
## Severity guidance
|
|
52
64
|
|
|
@@ -59,5 +71,7 @@ You cannot audit what you have not enumerated. Build the list before checking an
|
|
|
59
71
|
| No retention limit on a store of personal data | Medium |
|
|
60
72
|
| Personal data used in a URL or as a key | Medium |
|
|
61
73
|
| Field collected but never read | Medium |
|
|
74
|
+
| Deletion refusal with no recorded statutory exception | Medium |
|
|
75
|
+
| Opt-out/GPC signal received with no visible confirmation | Medium |
|
|
62
76
|
| Consent withdrawal not propagated downstream | Medium |
|
|
63
77
|
| Precision higher than the purpose requires | Low |
|
|
@@ -6,29 +6,48 @@ Start with `get_architecture` and `repo_map`. The highest-PageRank symbols are t
|
|
|
6
6
|
|
|
7
7
|
## Users and jobs
|
|
8
8
|
|
|
9
|
-
- [ ] The repo states who the user is. If no doc says it, infer it from
|
|
9
|
+
- [ ] The repo states who the user is. `search_code`/`search_context` the README opening and package description for an audience statement. If no doc says it, infer it from `repo_map`'s top entry points and say you inferred it — that ambiguity is itself worth reporting.
|
|
10
10
|
- [ ] Each primary user job maps to a real, reachable code path. Trace one with `trace_path` from entry point to effect.
|
|
11
|
-
- [ ] Nothing in the codebase serves a user the docs never mention. Unexplained surface is either an undocumented feature or abandoned work.
|
|
11
|
+
- [ ] Nothing in the codebase serves a user the docs never mention. Cross-check `repo_map`'s highest-PageRank symbols against the stated audience, then `find_callers` on any that don't match. Rule out an internal/admin/ops surface never meant for the documented user before calling it unexplained. Unexplained surface is either an undocumented feature or abandoned work.
|
|
12
12
|
|
|
13
13
|
## Surface coherence
|
|
14
14
|
|
|
15
|
-
- [ ] One way to do each thing, or a stated reason for more than one.
|
|
16
|
-
- [ ] Naming is consistent with the user's vocabulary, not the implementation's.
|
|
17
|
-
- [ ] Defaults serve the common case.
|
|
18
|
-
- [ ] Error messages tell the user what to do next, not what went wrong internally.
|
|
15
|
+
- [ ] One way to do each thing, or a stated reason for more than one. `search_code` for near-duplicate command/route names sharing a verb or noun — three overlapping commands that half-solve the same job is a product defect before it is a code defect.
|
|
16
|
+
- [ ] Naming is consistent with the user's vocabulary, not the implementation's. `find_symbol` the CLI flag or API field; a name matching an internal class or table rather than a user concept leaks the model.
|
|
17
|
+
- [ ] Defaults serve the common case. `find_symbol` the entry point's signature and count required parameters with no default for the single most common invocation — more than zero is the finding.
|
|
18
|
+
- [ ] Error messages tell the user what to do next, not what went wrong internally. `search_code` the error-message strings raised at trust boundaries; a message that names an internal type, class, or file path is the finding.
|
|
19
19
|
|
|
20
20
|
## Onboarding path
|
|
21
21
|
|
|
22
|
-
- [ ] There is a shortest path from install to first value, and it is documented. Follow it literally against the repo and note every step that is missing, wrong, or assumed.
|
|
23
|
-
- [ ] Prerequisites are stated before they are needed, not discovered by failure.
|
|
24
|
-
- [ ] The first-run experience handles the empty state — no data, no config, no index.
|
|
22
|
+
- [ ] There is a shortest path from install to first value, and it is documented. Follow it literally against the repo — `find_symbol` each command it names — and note every step that is missing, wrong, or assumed.
|
|
23
|
+
- [ ] Prerequisites are stated before they are needed, not discovered by failure. Read the doc's install section top to bottom; a prerequisite mentioned only in a later troubleshooting section is the finding.
|
|
24
|
+
- [ ] The first-run experience handles the empty state — no data, no config, no index. `find_symbol` the entry point invoked on a fresh checkout and read its behaviour when the expected file/config is absent.
|
|
25
25
|
|
|
26
26
|
## Feature economics
|
|
27
27
|
|
|
28
|
-
- [ ] For each feature, is there evidence anyone uses it?
|
|
29
|
-
- [ ] Features that exist only for one caller
|
|
30
|
-
- [ ] Configuration options that no code branches on.
|
|
28
|
+
- [ ] For each feature, is there evidence anyone uses it? `find_callers` the feature's entry point — zero in-repo callers plus no doc mention is a maintenance cost with no return. Cross-check with `Reachability`.
|
|
29
|
+
- [ ] Features that exist only for one caller. `find_callers` each exported feature entry point; exactly one caller is a candidate for inlining. Rule out a deliberately public API awaiting external consumers — check the manifest for a declared `exports`/public-package marker before reporting it as unused.
|
|
30
|
+
- [ ] Configuration options that no code branches on. `search_code` the option name in the parser, then `find_callers` on the parsed value. Rule out a string-keyed/reflective read (see `reachability.md`'s exclusion list) before calling it decorative.
|
|
31
31
|
|
|
32
32
|
## Reporting
|
|
33
33
|
|
|
34
34
|
Product findings are the easiest to state as opinion and the hardest to defend. Anchor each one: a `file:line`, a missing doc section, or a traced path that dead-ends. If the only evidence is your judgement, mark the confidence low and say what would settle it.
|
|
35
|
+
|
|
36
|
+
## Out of static reach
|
|
37
|
+
|
|
38
|
+
- Whether the stated user actually matches who uses the product in practice — usage data is not in source.
|
|
39
|
+
- Whether the onboarding path *feels* short to a newcomer, versus its literal step count.
|
|
40
|
+
- Whether an error message is genuinely clear to the user it addresses, beyond "does it name an internal detail".
|
|
41
|
+
- Product-market judgements — whether the job being served is worth serving at all.
|
|
42
|
+
|
|
43
|
+
## Severity guidance
|
|
44
|
+
|
|
45
|
+
| Situation | Severity |
|
|
46
|
+
|---|---|
|
|
47
|
+
| Undocumented subsystem serving no stated user, exclusions ruled out | Medium |
|
|
48
|
+
| Onboarding step missing, wrong, or order-dependent and undocumented | Medium |
|
|
49
|
+
| Naming that leaks the implementation into the user-facing surface | Medium |
|
|
50
|
+
| More than one command/route half-solving the same job, no stated reason | Medium |
|
|
51
|
+
| Error message exposing internal detail instead of next action | Low |
|
|
52
|
+
| Config option no code branches on, exclusions ruled out | Low |
|
|
53
|
+
| Feature with exactly one in-repo caller and no public-API marker | Low |
|
|
@@ -2,34 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
What would a reasonable request for this work have failed to ask for? This is the meta module: it audits the *instructions*, not the code. It exists because the most expensive omissions are the ones nobody thought to specify.
|
|
4
4
|
|
|
5
|
-
Run it last. It needs the findings from the other modules as raw material.
|
|
5
|
+
Run it last. It needs the findings from the other modules as raw material. It is also the most opinion-prone module in this skill — the "implied ask" is a reconstruction, not a fact, so every gap below must resolve to a probe against real code, not a guess about what someone meant.
|
|
6
6
|
|
|
7
7
|
## Reconstruct the implied ask
|
|
8
8
|
|
|
9
|
-
- [ ] For each significant subsystem, write the one-sentence request that would plausibly have produced it
|
|
10
|
-
- [ ] List what that sentence does **not** say but the implementation needed anyway: error handling, empty states, concurrency, cleanup, migration, observability, docs.
|
|
11
|
-
- [ ]
|
|
9
|
+
- [ ] For each significant subsystem — pick them from `repo_map`'s top-ranked symbols or `get_architecture`'s module list, not intuition — write the one-sentence request that would plausibly have produced it, e.g. "add project scoping to the structural tools".
|
|
10
|
+
- [ ] List what that sentence does **not** say but the implementation needed anyway: error handling, empty states, concurrency, cleanup, migration, observability, docs. Use the fixed dimension list below — do not improvise new dimensions per subsystem, or the coverage becomes unrepeatable across audits.
|
|
11
|
+
- [ ] For each dimension, `find_symbol` the subsystem's entry point and read its handling directly — do not infer from the interface alone. A gap the code also missed is a finding in its proper module, cross-referenced here. A gap the code handled anyway is worth naming as a strength — it tells you where the team's instincts are good.
|
|
12
12
|
|
|
13
13
|
## Dimensions a prompt routinely omits
|
|
14
14
|
|
|
15
|
-
Walk this list against the subsystem under audit.
|
|
15
|
+
Walk this list against the subsystem under audit. Each dimension names its probe; a dimension with no probe run against it produces no finding, not an `inferred` one.
|
|
16
16
|
|
|
17
|
-
- [ ] **Failure** — what happens when the dependency is down, the disk is full, the token expired mid-operation.
|
|
18
|
-
- [ ] **Empty and boundary** — zero items, one item, maximum items, first run, nothing configured.
|
|
19
|
-
- [ ] **Concurrency** — two of these at once, the same operation twice, a partial run resumed.
|
|
20
|
-
- [ ] **Cleanup** — what removes what this created. Most requests say "add", none say "and remove".
|
|
21
|
-
- [ ] **Idempotency** — running it twice.
|
|
22
|
-
- [ ] **Migration** — what happens to state written by the previous version.
|
|
23
|
-
- [ ] **Observability** — how anyone would know this broke in production.
|
|
24
|
-
- [ ] **Test isolation** — whether running the tests touches anything outside the temp directory.
|
|
25
|
-
- [ ] **Ownership** — whether this writes to a path someone else owns.
|
|
26
|
-
- [ ] **Docs** — whether the thing that ships is discoverable by the person who needs it.
|
|
17
|
+
- [ ] **Failure** — what happens when the dependency is down, the disk is full, the token expired mid-operation. `search_code` the dependency's call site for a surrounding try/catch or error branch. Rule out a global error-handler/middleware catching it upstream before calling the local absence a gap.
|
|
18
|
+
- [ ] **Empty and boundary** — zero items, one item, maximum items, first run, nothing configured. `find_symbol` the subsystem's entry point and read for a guard on empty/undefined input before the main logic runs.
|
|
19
|
+
- [ ] **Concurrency** — two of these at once, the same operation twice, a partial run resumed. `search_code` for a lock, mutex, transaction wrapper, or advisory-lock pattern around the operation. Rule out a single-writer guarantee provided by the runtime itself (a single-threaded worker, a queue with concurrency 1) before flagging its absence.
|
|
20
|
+
- [ ] **Cleanup** — what removes what this created. `search_code` the resource name alongside a `delete`/`remove`/`teardown` verb. Rule out a TTL/auto-expiry mechanism that makes explicit deletion unnecessary. Most requests say "add", none say "and remove" — an unmatched create with neither is the gap.
|
|
21
|
+
- [ ] **Idempotency** — running it twice. Cross-reference the static probe in `functional.md`'s State and idempotency section; reuse its finding rather than re-deriving it here.
|
|
22
|
+
- [ ] **Migration** — what happens to state written by the previous version. `search_code` a migrations directory or a version-check branch reading old-shape data; its absence next to a changed persisted shape is the gap.
|
|
23
|
+
- [ ] **Observability** — how anyone would know this broke in production. `search_code` a logger/metrics/tracing call inside the subsystem's error branch; a silent catch block is the gap.
|
|
24
|
+
- [ ] **Test isolation** — whether running the tests touches anything outside the temp directory. `search_code` the test file for a hardcoded path, a shared fixture directory, or missing setup/teardown around external state.
|
|
25
|
+
- [ ] **Ownership** — whether this writes to a path someone else owns. `search_code` the write target's path construction. Rule out a path shared by documented convention or contract before calling it a boundary violation.
|
|
26
|
+
- [ ] **Docs** — whether the thing that ships is discoverable by the person who needs it. Cross-reference `documentation.md`'s coverage checks; reuse its finding rather than re-deriving it here.
|
|
27
27
|
|
|
28
28
|
## Spec vs. implementation drift
|
|
29
29
|
|
|
30
|
-
- [ ] Where written specs, plans, or ADRs exist, compare them to the code. Report both directions: spec'd and not built, built and not spec'd.
|
|
31
|
-
- [ ] Assertions in specs that no test enforces.
|
|
32
|
-
- [ ] Deviations that were the right call but never recorded.
|
|
30
|
+
- [ ] Where written specs, plans, or ADRs exist, compare them to the code. `search_code` the specced behaviour's keyword in the implementation to confirm it exists. Report both directions: spec'd and not built, built and not spec'd.
|
|
31
|
+
- [ ] Assertions in specs that no test enforces. `search_code` the spec's stated requirement's keyword inside the test directory — zero hits means a requirement with no test, which is a hope, not a guarantee.
|
|
32
|
+
- [ ] Deviations that were the right call but never recorded. Diff the spec's described approach against what `find_symbol` shows was actually built; a difference with no comment or ADR explaining it means the code is correct and the document is now actively lying.
|
|
33
|
+
|
|
34
|
+
## Out of static reach
|
|
35
|
+
|
|
36
|
+
- Whether an omitted dimension was actually acceptable to skip for this subsystem's risk profile — that is a judgement call, not a probe result.
|
|
37
|
+
- Whether a gap the code "handled anyway" was deliberate foresight or an accidental side effect of a stricter library default.
|
|
38
|
+
- Whether the reconstructed one-sentence ask matches the real request, when no ticket, issue, or commit message records it.
|
|
39
|
+
- Dimensions genuinely outside this fixed list — one this list itself omits stays invisible to the audit.
|
|
33
40
|
|
|
34
41
|
## Output
|
|
35
42
|
|
|
@@ -8,43 +8,51 @@ Is this code reachable at all? This module runs on the call graph, so it answers
|
|
|
8
8
|
|
|
9
9
|
- [ ] For each exported symbol, `find_callers`. Empty ⇒ candidate. Cross-check against the exclusion list above before reporting.
|
|
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. These are the cheap, high-value deletions.
|
|
12
|
-
- [ ] Types, interfaces, and enums declared and never referenced.
|
|
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.
|
|
12
|
+
- [ ] 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
13
|
|
|
14
14
|
## Dead endpoints
|
|
15
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
|
-
- [ ] Routes registered but never mounted, or mounted behind a router nobody attaches.
|
|
18
|
-
- [ ] The inverse: a client calling a path that no handler serves. This is `High` — it fails in production, not at build.
|
|
17
|
+
- [ ] 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` — it fails in production, not at build.
|
|
19
19
|
|
|
20
20
|
## Unreachable branches
|
|
21
21
|
|
|
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 — flag
|
|
24
|
-
- [ ] Environment variables read by code but set by no `.env.example`, no CI config, no Dockerfile, no docs.
|
|
25
|
-
- [ ] Catch blocks for exceptions the try block cannot raise.
|
|
22
|
+
- [ ] 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.
|
|
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 — 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.
|
|
26
26
|
|
|
27
27
|
## Declared but unused
|
|
28
28
|
|
|
29
29
|
Sweep each category and report the orphans:
|
|
30
30
|
|
|
31
|
-
- [ ] Assets — images, fonts, icons, static files referenced by nothing.
|
|
32
|
-
- [ ] i18n keys present in locale files, referenced by no call site (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.
|
|
34
|
-
- [ ] Config options accepted by the parser, consumed by nothing.
|
|
35
|
-
- [ ] Dependencies in the manifest, imported by nothing (defer licensing depth to `dependencies-licensing.md`).
|
|
36
|
-
- [ ] Database columns, indexes, and tables that no query touches.
|
|
31
|
+
- [ ] 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
|
+
- [ ] 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
|
+
- [ ] 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
|
+
- [ ] 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
37
|
|
|
38
38
|
## Used but never declared — the inverse gap
|
|
39
39
|
|
|
40
40
|
**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
41
|
|
|
42
|
-
- [ ] Environment variables read in code but declared in no `.env.example`, schema, or deployment manifest. Works on the author's machine, `undefined` in production.
|
|
43
|
-
- [ ] i18n keys referenced by call sites but missing from one or more locale files — the missing locale renders the raw key to a user.
|
|
44
|
-
- [ ] Asset paths built at runtime (string concatenation, template literals) pointing at files that do not exist.
|
|
45
|
-
- [ ] Code reading a database column that no migration creates.
|
|
46
|
-
- [ ] Imports of packages absent from the manifest — resolved today only by a transitive hoist that the next lockfile update will remove.
|
|
47
|
-
- [ ] Config keys consumed by code but rejected or ignored by the config parser.
|
|
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 key literal against every locale file; a key present in the default locale and absent from another is the finding — the missing locale renders the raw key to a user.
|
|
44
|
+
- [ ] 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, then confirm no migration file declares it.
|
|
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.
|
|
47
|
+
- [ ] 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
|
+
## Out of static reach
|
|
50
|
+
|
|
51
|
+
- Dynamic dispatch through a string-keyed registry whose key is computed at runtime (config-driven plugin loading) — reachable in practice, invisible to the call graph.
|
|
52
|
+
- Code loaded through `eval`, a database-stored script, or a plugin fetched at runtime.
|
|
53
|
+
- Whether a branch this module calls dead is actually exercised by a remote feature-flag value never committed to the repo.
|
|
54
|
+
- An exported symbol with zero in-repo callers that is the published API surface for a separate downstream repo this audit cannot see.
|
|
55
|
+
- Whether an undeclared env var is supplied by infrastructure-as-code, a secrets manager, or a platform dashboard outside version control.
|
|
48
56
|
|
|
49
57
|
## Severity guidance
|
|
50
58
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Repo History
|
|
2
|
+
|
|
3
|
+
What does the commit log reveal that the working tree cannot? Gate: the project is a git repository.
|
|
4
|
+
|
|
5
|
+
`security.md` has one reactive line: check history when a secret turns up in the working tree. This module is the proactive counterpart — it reads history whether or not anything is currently wrong, because churn, ownership, and buried secrets are findings on their own. **Narrow execution exception**: this is the one module in the skill permitted to run commands, and only four — `git log`, `git rev-list`, `git ls-files`, `git cat-file`, together with their strictly read-only siblings (`git branch -a`, `git tag`, `git shortlog -s -n`) for enumerating refs and authors. None of these mutate the repository. State this exception is unique to this module; no other reference file may use it. **A shallow clone makes every check below `undetermined`, not `not applicable`** — a shallow history has already discarded the evidence, and reporting the check as clean would be wrong in the specific way this skill exists to prevent.
|
|
6
|
+
|
|
7
|
+
## Shallow-clone check (run first)
|
|
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`.
|
|
10
|
+
|
|
11
|
+
## Secrets and sensitive data
|
|
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.
|
|
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
|
+
|
|
16
|
+
## Repository weight
|
|
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) — cross-reference the large-blob list above against file extensions that should be build products, not source.
|
|
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
|
+
|
|
22
|
+
## Churn as a risk map
|
|
23
|
+
|
|
24
|
+
- [ ] Highest-churn files across the project's life — `git log --all --pretty=format: --name-only` and tally frequency by path. The code that changes most is where defects concentrate; a file with disproportionate churn relative to its size is worth a closer look regardless of what it does.
|
|
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.
|
|
26
|
+
- [ ] 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
|
+
## Ownership and bus factor
|
|
29
|
+
|
|
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.
|
|
32
|
+
|
|
33
|
+
## Commit hygiene
|
|
34
|
+
|
|
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.
|
|
38
|
+
- [ ] 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
|
+
- [ ] 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). A steady trickle of reverts against one area is instability the churn ranking alone will not surface, because a revert and its original commit both count as ordinary churn.
|
|
41
|
+
|
|
42
|
+
## History rewrite evidence
|
|
43
|
+
|
|
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
|
+
|
|
46
|
+
## Out of static reach
|
|
47
|
+
|
|
48
|
+
- Whether a secret found in history has already been rotated — the audit can prove exposure, not remediation status.
|
|
49
|
+
- 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
|
+
- Author identity beyond the name/email recorded in the commit — a shared machine or CI bot account can misattribute ownership.
|
|
51
|
+
- 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.
|
|
52
|
+
|
|
53
|
+
## Severity guidance
|
|
54
|
+
|
|
55
|
+
| Situation | Severity |
|
|
56
|
+
|---|---|
|
|
57
|
+
| Live secret found in history, not present in HEAD | Critical |
|
|
58
|
+
| Secret present in HEAD and in history | Critical |
|
|
59
|
+
| Tracked file that should be gitignored and carries credentials | High |
|
|
60
|
+
| File both high-churn and structurally central, single author | High |
|
|
61
|
+
| Commit touching an implausible file count with no review trail | Medium |
|
|
62
|
+
| Large binaries committed and still weighing on every clone | Medium |
|
|
63
|
+
| Stale branches with no merge path | Low |
|
|
64
|
+
| TODO/FIXME meaningfully older than its surrounding code | Low |
|
|
65
|
+
| Commit message convention inconsistently followed | Info / Low |
|
|
@@ -2,43 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
What breaks when there is more of everything? Gate: a queue, worker, or background jobs were detected.
|
|
4
4
|
|
|
5
|
-
`Performance` asks how fast one operation is. This module asks what happens at ten times the load, ten times the data, and two instances instead of one.
|
|
5
|
+
`Performance` asks how fast one operation is. This module asks what happens at ten times the load, ten times the data, and two instances instead of one. Most checks below are `read` once you find the file and `inferred` on the actual future volume — state which.
|
|
6
6
|
|
|
7
7
|
## Horizontal readiness
|
|
8
8
|
|
|
9
|
-
- [ ] No state lives only in one process's memory
|
|
10
|
-
- [ ] Nothing depends on being the only instance
|
|
11
|
-
- [ ] Scheduled work has a leader election or a distributed lock.
|
|
12
|
-
- [ ] Local filesystem writes are either ephemeral or
|
|
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.
|
|
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.
|
|
13
13
|
|
|
14
14
|
## Queues and workers
|
|
15
15
|
|
|
16
|
-
- [ ] Every queue has a consumer, and every consumer has a producer. Cross-reference the half-wired pairs table in `flow-integrity.md` — an unconsumed queue grows forever.
|
|
17
|
-
- [ ] Jobs are idempotent.
|
|
18
|
-
- [ ] Failed jobs go somewhere
|
|
19
|
-
- [ ]
|
|
20
|
-
- [ ]
|
|
21
|
-
- [ ]
|
|
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 make consumers idempotent. 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
|
+
- [ ] 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.
|
|
20
|
+
- [ ] 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
|
+
- [ ] 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
|
+
- [ ] 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.
|
|
22
23
|
|
|
23
24
|
## Data growth
|
|
24
25
|
|
|
25
|
-
- [ ] Every table, collection, log, and index has an answer to "what bounds this?"
|
|
26
|
-
- [ ] Queries that work today at current row counts
|
|
27
|
-
- [ ] Batch jobs that process everything rather than only what changed
|
|
28
|
-
- [ ] Pagination is cursor-based where the dataset is large
|
|
26
|
+
- [ ] Every table, collection, log, and index has an answer to "what bounds this?": `search_code` for a retention/TTL/cleanup job referencing each table name. Report the ones with no hit once, as a single finding with the full list — not one finding per table.
|
|
27
|
+
- [ ] Queries that work today at current row counts: read the query (`find_symbol`/`expand_context`) and state the row count at which an unindexed filter or full scan degrades. This is `inferred` without a real count from the schema or a migration comment — cap it at `Medium` accordingly.
|
|
28
|
+
- [ ] Batch jobs that process everything rather than only what changed: `search_code` the batch job's query for a narrowing clause (`WHERE updated_at >`, `WHERE processed = false`) versus an unfiltered `.findAll()`/`SELECT *`. A job that reprocesses the whole table gets slower every day by construction.
|
|
29
|
+
- [ ] Pagination is cursor-based where the dataset is large: `search_code` the listing route/query for `OFFSET`/`.skip(` versus a cursor or keyset parameter (`after:`, `WHERE id >`). Offset pagination degrades linearly as the table grows.
|
|
29
30
|
|
|
30
31
|
## Backpressure
|
|
31
32
|
|
|
32
|
-
- [ ] Producers slow down or shed load when consumers fall behind.
|
|
33
|
-
- [ ]
|
|
34
|
-
- [ ]
|
|
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.
|
|
34
|
+
- [ ] 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
|
+
- [ ] 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
|
+
- [ ] 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.
|
|
36
38
|
|
|
37
39
|
## Degradation
|
|
38
40
|
|
|
39
|
-
- [ ] Under load the system degrades rather than collapsing
|
|
40
|
-
- [ ] Non-critical work is genuinely non-blocking
|
|
41
|
-
- [ ] Health checks reflect real capacity, not just process liveness.
|
|
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.
|
|
42
|
+
- [ ] 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 checks reflect real capacity, not just process liveness: `find_symbol` the health-check handler and read it — a handler that returns `200` unconditionally is a liveness check wearing a readiness check's name.
|
|
44
|
+
|
|
45
|
+
## Out of static reach
|
|
46
|
+
|
|
47
|
+
- Actual behaviour under N concurrent instances — nothing here is run.
|
|
48
|
+
- Whether observed traffic ever approaches the stated bound, or the crossover row count named above.
|
|
49
|
+
- True queue throughput versus producer rate under real load.
|
|
50
|
+
- Real failover or leader-election behaviour during an actual node loss.
|
|
51
|
+
- Whether a rate limit or bounded pool is sized correctly for real downstream capacity, versus merely present.
|
|
42
52
|
|
|
43
53
|
## Severity guidance
|
|
44
54
|
|
|
@@ -49,7 +59,10 @@ What breaks when there is more of everything? Gate: a queue, worker, or backgrou
|
|
|
49
59
|
| Unbounded retry on a poison message | High |
|
|
50
60
|
| Scheduled job with no leader election | High |
|
|
51
61
|
| Non-idempotent job under at-least-once delivery | High |
|
|
62
|
+
| Exactly-once guarantee assumed for a side effect outside the transport's actual transactional boundary | High |
|
|
52
63
|
| No backpressure between producer and consumer | Medium |
|
|
53
64
|
| Unbounded data growth with no retention policy | Medium |
|
|
54
65
|
| Batch job that reprocesses everything | Medium |
|
|
66
|
+
| Dead-letter queue with no redrive or replay path — failures accumulate unread | Medium |
|
|
67
|
+
| Reactive backpressure operator used with no bounded capacity (default-unbounded buffer) | Medium |
|
|
55
68
|
| Offset pagination over a large dataset | Low |
|