project-brain 0.22.4 → 0.24.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 +191 -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/runtime.md +83 -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 |
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Runtime
|
|
2
|
+
|
|
3
|
+
Does the project's own tooling actually pass right now? Gate: the user explicitly enables execution, **and** the project declares at least one runnable command. The `executed` tier has sat in the Evidence Contract since this skill defined its tiers, reserved with no module to fill it — this is that module. It runs now, and only when both conditions hold together; either alone leaves it gated off.
|
|
4
|
+
|
|
5
|
+
Every other module in this skill reasons from source alone — a defect it reports is a claim about what the code would do, never a claim about what it did. This module is the one exception, and the exception is narrow: with the user's consent, it runs the commands the project's own authors already run — the script named `test` in `package.json`, a documented `typecheck`/`lint`/`build` target, a command already invoked by a CI workflow — and reads what actually happened. It does not repeat `tooling-baseline.md`'s inventory of what a project declares versus what CI enforces; it consumes that inventory to decide what is safe to run, then reports the result of running it. It does not repeat `testing.md`'s reading of test source either — that module tells you what a suite claims to prove and what shape its assertions take; this module tells you whether the suite the project already trusts currently passes.
|
|
6
|
+
|
|
7
|
+
The constraint carries no exceptions: **this module runs only commands the project itself already declares.** It never invents a command, installs a dependency, reaches the network beyond what a declared command already does on its own, touches a production system, or runs a script whose name implies mutation (`deploy`, `publish`, `migrate`, `seed`, `reset`, `clean`) without the user naming that exact script. A command not already declared somewhere does not get run speculatively — its absence is the finding, under Establish what the project declares, not a gap this module fills by guessing.
|
|
8
|
+
|
|
9
|
+
**Every finding from this module records the exact command, its exit code, and the relevant output line — that triple is what makes it `executed` rather than a better-dressed `inferred`.** "The tests fail" with no command, no exit code, and no failing assertion quoted has not earned the tier it claims; report it as `inferred` instead, because an unverifiable `executed` finding is worse than an honest one — the tier alone would let it reach Critical.
|
|
10
|
+
|
|
11
|
+
**A green run is evidence that the project's own checks pass, and it is exactly as strong as those checks are — nothing more.** Cross-reference `tooling-baseline.md`, which measures that strength directly: a green test run against a suite that only asserts `toBeTruthy()`, or a green lint run against a ruleset with its real rules disabled, is a true statement about a weak instrument. State which is true before citing a pass as reassurance.
|
|
12
|
+
|
|
13
|
+
## Establish what the project declares
|
|
14
|
+
|
|
15
|
+
- [ ] Locate the declared command surface before running anything — read `package.json` scripts, a `Makefile`, a documented `just`/`task` runner, or the CI workflow's own step list, cross-referencing `tooling-baseline.md`'s inventory rather than re-deriving it. Record the exact command string for each of test, typecheck, lint, and build; this module runs nothing it cannot cite from one of these sources.
|
|
16
|
+
- [ ] A category with no declared command ends the module for that category — state plainly which of test/typecheck/lint/build had nothing to run, and never substitute a guessed invocation. `npm test` on a project with no `test` script is npm's own fallback failure, not a declared command.
|
|
17
|
+
- [ ] Read the command's body or documented prerequisites before running it — an undeclared required env var or an expected service on a fixed port fails the run for reasons unrelated to the code under audit, and reporting that failure as a code defect misattributes it.
|
|
18
|
+
- [ ] Where a category has two candidate commands — a root script and a per-package one in a monorepo, or a local one that diverges from CI's — run the one `tooling-baseline.md`'s Declared-versus-enforced findings show CI actually invokes, not merely the one that exists.
|
|
19
|
+
|
|
20
|
+
## Execution safety
|
|
21
|
+
|
|
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
|
+
- [ ] 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.
|
|
24
|
+
- [ ] 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.
|
|
26
|
+
- [ ] 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.
|
|
27
|
+
|
|
28
|
+
## The cheap ladder
|
|
29
|
+
|
|
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.
|
|
31
|
+
- [ ] 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.
|
|
33
|
+
- [ ] 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
|
+
|
|
35
|
+
## The suite
|
|
36
|
+
|
|
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
|
+
- [ ] 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.
|
|
39
|
+
- [ ] 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.
|
|
40
|
+
- [ ] 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
|
+
- [ ] 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
|
+
- [ ] 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.
|
|
43
|
+
- [ ] Cross-reference the coverage run's per-file breakdown against symbols `complexity.md`/`reachability.md` already flagged as high-blast-radius — a 0% line on one of those is a sharper, measured version of an existing finding, not a new one.
|
|
44
|
+
|
|
45
|
+
## What execution closes
|
|
46
|
+
|
|
47
|
+
- [ ] `testing.md` lists "whether the suite actually passes right now" as beyond its static reach — the run above closes it directly. Cite the exit code, not a restatement.
|
|
48
|
+
- [ ] `testing.md` also lists real flake rate and whether a flagged order-dependency pattern has ever actually failed as unreachable statically — the repeat and shuffled-order runs close both, bounded by what ten repeats and one reorder can show. A clean result there is flake-free at that sampled rate, not flake-free forever.
|
|
49
|
+
- [ ] `tooling-baseline.md` lists "whether a committed report's zero findings reflect a genuinely clean pass or a scanner matching nothing" as unreachable statically — rerunning the same scanner now and diffing against the committed report closes it: an identical zero is corroboration, a fresh non-zero means the committed report was stale or the scanner regressed.
|
|
50
|
+
- [ ] Where a browser-driving command is separately declared — an axe-core CI script, a Lighthouse CI run — treat it as its own declared command under Establish what the project declares and run it the same way; its result is bounded, see What execution still does not settle, but it is real measurement where none existed before.
|
|
51
|
+
|
|
52
|
+
## What execution still does not settle
|
|
53
|
+
|
|
54
|
+
- [ ] 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
|
+
- [ ] 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 entirely unless the project separately declares a browser-driving command; this module does not open a browser on its own initiative.
|
|
59
|
+
|
|
60
|
+
## Out of static reach
|
|
61
|
+
|
|
62
|
+
- Whether a result holds on infrastructure other than the one this ran on — a different OS, CPU architecture, or language/runtime version can behave differently against an identical lockfile.
|
|
63
|
+
- Real-world flake rate beyond the sampled repeat count — ten repeats bounds a claim, it does not eliminate a rarer failure mode.
|
|
64
|
+
- 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
|
+
- 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
|
+
- Anything requiring a live third-party network dependency, a paid API, or a production credential this module is barred from reaching.
|
|
67
|
+
|
|
68
|
+
## Severity guidance
|
|
69
|
+
|
|
70
|
+
| Situation | Severity |
|
|
71
|
+
|---|---|
|
|
72
|
+
| Declared build fails | Critical |
|
|
73
|
+
| Declared test suite fails on the current tree | Critical |
|
|
74
|
+
| Committed `.only`/`fit`/`fdescribe` silencing the rest of the suite | High |
|
|
75
|
+
| Declared typecheck fails | High |
|
|
76
|
+
| Test flaky at 2 or more failures in ten repeats, untracked | High |
|
|
77
|
+
| Order-dependent failure surfaced by a reordered run | High |
|
|
78
|
+
| Declared lint fails against the project's own configured ruleset | Medium |
|
|
79
|
+
| Skipped tests present with no tracking issue or comment | Medium |
|
|
80
|
+
| Coverage run confirms 0% on a symbol another module flagged high-blast-radius | Medium |
|
|
81
|
+
| Committed scanner report contradicted by a fresh run of the same scanner | Medium |
|
|
82
|
+
| Test flaky at exactly one failure in ten repeats | Low |
|
|
83
|
+
| Result measured against a stale cache or drifted dependency install | Info |
|