project-brain 0.14.0 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -12
- package/package.json +10 -6
- package/templates/skills/brain-audit/SKILL.md +134 -0
- package/templates/skills/brain-audit/references/abuse.md +59 -0
- package/templates/skills/brain-audit/references/accessibility.md +55 -0
- package/templates/skills/brain-audit/references/ai.md +51 -0
- package/templates/skills/brain-audit/references/api.md +47 -0
- package/templates/skills/brain-audit/references/backend.md +48 -0
- package/templates/skills/brain-audit/references/complexity.md +52 -0
- package/templates/skills/brain-audit/references/concurrency.md +60 -0
- package/templates/skills/brain-audit/references/consistency.md +59 -0
- package/templates/skills/brain-audit/references/contract-drift.md +58 -0
- package/templates/skills/brain-audit/references/cost.md +60 -0
- package/templates/skills/brain-audit/references/database.md +59 -0
- package/templates/skills/brain-audit/references/dependencies-licensing.md +59 -0
- package/templates/skills/brain-audit/references/devops.md +61 -0
- package/templates/skills/brain-audit/references/documentation.md +56 -0
- package/templates/skills/brain-audit/references/failure.md +58 -0
- package/templates/skills/brain-audit/references/flow-integrity.md +61 -0
- package/templates/skills/brain-audit/references/frontend.md +51 -0
- package/templates/skills/brain-audit/references/functional.md +39 -0
- package/templates/skills/brain-audit/references/future.md +31 -0
- package/templates/skills/brain-audit/references/goal.md +38 -0
- package/templates/skills/brain-audit/references/i18n.md +61 -0
- package/templates/skills/brain-audit/references/infrastructure.md +62 -0
- package/templates/skills/brain-audit/references/mobile.md +58 -0
- package/templates/skills/brain-audit/references/observability.md +55 -0
- package/templates/skills/brain-audit/references/packaging.md +52 -0
- package/templates/skills/brain-audit/references/performance.md +58 -0
- package/templates/skills/brain-audit/references/privacy.md +63 -0
- package/templates/skills/brain-audit/references/product.md +34 -0
- package/templates/skills/brain-audit/references/prompt-spec-gap.md +41 -0
- package/templates/skills/brain-audit/references/reachability.md +58 -0
- package/templates/skills/brain-audit/references/scalability.md +55 -0
- package/templates/skills/brain-audit/references/security.md +75 -0
- package/templates/skills/brain-audit/references/testing.md +58 -0
- package/templates/skills/brain-audit/references/versioning-compatibility.md +59 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Prompt/Spec Gap
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
Run it last. It needs the findings from the other modules as raw material.
|
|
6
|
+
|
|
7
|
+
## Reconstruct the implied ask
|
|
8
|
+
|
|
9
|
+
- [ ] For each significant subsystem, write the one-sentence request that would plausibly have produced it ("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.
|
|
11
|
+
- [ ] Each gap that the code also missed is a finding. Each gap the code handled anyway is worth naming as a strength — it tells you where the team's instincts are good.
|
|
12
|
+
|
|
13
|
+
## Dimensions a prompt routinely omits
|
|
14
|
+
|
|
15
|
+
Walk this list against the subsystem under audit. These are the categories that almost never appear in a request and almost always matter:
|
|
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.
|
|
27
|
+
|
|
28
|
+
## Spec vs. implementation drift
|
|
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. A requirement with no test is a hope.
|
|
32
|
+
- [ ] Deviations that were the right call but never recorded. The code is correct and the document is now lying — that is a real finding, and the cheapest one to fix.
|
|
33
|
+
|
|
34
|
+
## Output
|
|
35
|
+
|
|
36
|
+
Report this module as two lists, not as severities:
|
|
37
|
+
|
|
38
|
+
1. **Gaps the implementation also missed** — these become findings in their proper module, cross-referenced here.
|
|
39
|
+
2. **Gaps the implementation covered anyway** — these are not defects. State them, because they tell the reader which dimensions this team does not need reminding about, and which they do.
|
|
40
|
+
|
|
41
|
+
Then name the single dimension most likely to be omitted from the *next* request on this codebase, with the evidence that led you there.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Reachability
|
|
2
|
+
|
|
3
|
+
Is this code reachable at all? This module runs on the call graph, so it answers with certainty where a grep-based auditor can only guess.
|
|
4
|
+
|
|
5
|
+
**Before reporting anything here as dead, rule out** — and state which you ruled out: public API surface, dynamic dispatch, reflection, string-keyed registries, framework-convention entry points (route files, migrations, plugin folders), test-only usage, and cross-repo consumers. `find_callers` returning empty means *no in-repo caller*, nothing more.
|
|
6
|
+
|
|
7
|
+
## Dead exports
|
|
8
|
+
|
|
9
|
+
- [ ] For each exported symbol, `find_callers`. Empty ⇒ candidate. Cross-check against the exclusion list above before reporting.
|
|
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.
|
|
13
|
+
|
|
14
|
+
## Dead endpoints
|
|
15
|
+
|
|
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.
|
|
19
|
+
|
|
20
|
+
## Unreachable branches
|
|
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 read in code, default `false`, never set anywhere. 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. The fallback path is the only path that ever runs.
|
|
25
|
+
- [ ] Catch blocks for exceptions the try block cannot raise.
|
|
26
|
+
|
|
27
|
+
## Declared but unused
|
|
28
|
+
|
|
29
|
+
Sweep each category and report the orphans:
|
|
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.
|
|
37
|
+
|
|
38
|
+
## Used but never declared — the inverse gap
|
|
39
|
+
|
|
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
|
+
|
|
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.
|
|
48
|
+
|
|
49
|
+
## Severity guidance
|
|
50
|
+
|
|
51
|
+
| Situation | Severity |
|
|
52
|
+
|---|---|
|
|
53
|
+
| Client calls an endpoint that does not exist | Critical / High |
|
|
54
|
+
| Code reads an env var or column nothing provides | High |
|
|
55
|
+
| Feature flag permanently off, gating shipped code | Medium |
|
|
56
|
+
| Exported symbol with zero callers, exclusions ruled out | Medium |
|
|
57
|
+
| Unused asset, dependency, or locale key | Low |
|
|
58
|
+
| Declared-and-unused type or config option | Info / Low |
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Scalability
|
|
2
|
+
|
|
3
|
+
What breaks when there is more of everything? Gate: a queue, worker, or background jobs were detected.
|
|
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.
|
|
6
|
+
|
|
7
|
+
## Horizontal readiness
|
|
8
|
+
|
|
9
|
+
- [ ] No state lives only in one process's memory. In-memory caches, counters, session maps, and rate-limit buckets all diverge across instances.
|
|
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. Otherwise every instance runs the cron.
|
|
12
|
+
- [ ] Local filesystem writes are either ephemeral or explicitly shared storage. A file written on one instance and read on another silently fails behind a load balancer.
|
|
13
|
+
|
|
14
|
+
## Queues and workers
|
|
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. At-least-once delivery is the norm, so a job that runs twice must be safe.
|
|
18
|
+
- [ ] Failed jobs go somewhere — a dead-letter queue, a retry with backoff, or an alert. Silent drop is the default failure mode and it is `High`.
|
|
19
|
+
- [ ] Retries are bounded. An infinite retry on a poison message blocks the queue.
|
|
20
|
+
- [ ] Job payloads carry identifiers, not whole objects. Fat payloads make the queue the database.
|
|
21
|
+
- [ ] Concurrency per consumer is bounded and configurable.
|
|
22
|
+
|
|
23
|
+
## Data growth
|
|
24
|
+
|
|
25
|
+
- [ ] Every table, collection, log, and index has an answer to "what bounds this?" Unbounded growth with no retention policy is a finding even when it is slow.
|
|
26
|
+
- [ ] Queries that work today at current row counts — state the count at which each becomes a problem.
|
|
27
|
+
- [ ] Batch jobs that process everything rather than only what changed. These get slower every day by construction.
|
|
28
|
+
- [ ] Pagination is cursor-based where the dataset is large; offset pagination degrades linearly.
|
|
29
|
+
|
|
30
|
+
## Backpressure
|
|
31
|
+
|
|
32
|
+
- [ ] Producers slow down or shed load when consumers fall behind. Unbounded buffering between them just moves the failure.
|
|
33
|
+
- [ ] Bounded pools exist for connections, workers, and concurrent outbound calls.
|
|
34
|
+
- [ ] Rate limits protect downstream dependencies, not only inbound callers.
|
|
35
|
+
- [ ] Timeouts are shorter than the caller's timeout, so failures surface at the right layer.
|
|
36
|
+
|
|
37
|
+
## Degradation
|
|
38
|
+
|
|
39
|
+
- [ ] Under load the system degrades rather than collapsing — sheds optional work, serves stale cache, returns a clear 503.
|
|
40
|
+
- [ ] Non-critical work is genuinely non-blocking. A failing analytics call must not fail the request.
|
|
41
|
+
- [ ] Health checks reflect real capacity, not just process liveness.
|
|
42
|
+
|
|
43
|
+
## Severity guidance
|
|
44
|
+
|
|
45
|
+
| Situation | Severity |
|
|
46
|
+
|---|---|
|
|
47
|
+
| Failed jobs silently dropped | High |
|
|
48
|
+
| In-memory state that breaks with a second instance | High |
|
|
49
|
+
| Unbounded retry on a poison message | High |
|
|
50
|
+
| Scheduled job with no leader election | High |
|
|
51
|
+
| Non-idempotent job under at-least-once delivery | High |
|
|
52
|
+
| No backpressure between producer and consumer | Medium |
|
|
53
|
+
| Unbounded data growth with no retention policy | Medium |
|
|
54
|
+
| Batch job that reprocesses everything | Medium |
|
|
55
|
+
| Offset pagination over a large dataset | Low |
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
Gate: auth, external input, or a network boundary was detected.
|
|
4
|
+
|
|
5
|
+
**Scope discipline.** This module finds and reports defects in the audited codebase. It does not write exploits, and it does not produce working attack payloads. A finding names the vulnerable line, the class of attack, and the fix.
|
|
6
|
+
|
|
7
|
+
Trace every input from where it enters to where it is used. `find_callees` from the entry point, or `trace_path` from the handler to the sink. An input that reaches a sink without passing validation is the finding.
|
|
8
|
+
|
|
9
|
+
## Injection sinks
|
|
10
|
+
|
|
11
|
+
Enumerate the sinks, then check what reaches each one:
|
|
12
|
+
|
|
13
|
+
- [ ] **Query** — any query built by concatenation or interpolation from external input. Parameterised or nothing. `Critical`.
|
|
14
|
+
- [ ] **Shell** — `exec`, `spawn` with a shell, or a command string built from input. Prefer argument arrays with no shell.
|
|
15
|
+
- [ ] **Filesystem** — a path built from input. Check for `..` traversal and absolute-path override; the fix is resolve-then-verify-inside-root, not string filtering.
|
|
16
|
+
- [ ] **Code** — `eval`, `new Function`, dynamic `require`/`import` of an input-derived name, deserialisation of untrusted data.
|
|
17
|
+
- [ ] **Template/markup** — unescaped interpolation into HTML, `innerHTML`, `dangerouslySetInnerHTML`.
|
|
18
|
+
- [ ] **Model prompt** — untrusted text concatenated into instructions; see `abuse.md` and `ai.md`.
|
|
19
|
+
|
|
20
|
+
## AuthN
|
|
21
|
+
|
|
22
|
+
- [ ] Credential comparison is constant-time. `search_code` for `===` against a token or secret.
|
|
23
|
+
- [ ] Passwords are hashed with a slow, salted algorithm — never a plain digest, never encrypted, never stored raw.
|
|
24
|
+
- [ ] Sessions and tokens expire, and expiry is checked with the correct comparison. An off-by-one on `<` vs `<=` at an expiry boundary is a real defect.
|
|
25
|
+
- [ ] Tokens are validated for signature, issuer, audience, and expiry — not merely decoded.
|
|
26
|
+
- [ ] Logout invalidates server-side, not only client-side.
|
|
27
|
+
|
|
28
|
+
## AuthZ
|
|
29
|
+
|
|
30
|
+
- [ ] Every protected operation checks authorisation, and the check is on the server. `find_callers` on the authorisation helper, then compare against the full list of protected handlers — the gap is the finding.
|
|
31
|
+
- [ ] Authorisation is checked against the *resource*, not only the *route*. Being logged in is not permission to read record 42.
|
|
32
|
+
- [ ] No object reference from the client is trusted as ownership proof.
|
|
33
|
+
- [ ] Privilege escalation paths: can a user set their own role, quota, or flags through a mass-assigned update?
|
|
34
|
+
- [ ] Default is deny. A new endpoint added tomorrow should be closed unless opened.
|
|
35
|
+
|
|
36
|
+
## Secrets
|
|
37
|
+
|
|
38
|
+
- [ ] No secret in source, config committed to the repo, test fixture, or log line. `search_code` for `secret`, `password`, `token`, `api_key`, `private_key`, `Bearer`.
|
|
39
|
+
- [ ] No secret in an error message, stack trace, or debug output.
|
|
40
|
+
- [ ] Secrets come from the environment or a secret manager, and absence fails loudly at startup.
|
|
41
|
+
- [ ] Check git history if a secret is found in the working tree — removal from HEAD does not remove it from history. Report the need for rotation.
|
|
42
|
+
|
|
43
|
+
## Transport and headers
|
|
44
|
+
|
|
45
|
+
- [ ] TLS enforced; no plaintext transport for credentials or user data. No disabled certificate verification — `search_code` for `rejectUnauthorized: false` and equivalents.
|
|
46
|
+
- [ ] CORS is not permissive-with-credentials. A wildcard origin plus credentials is `High`.
|
|
47
|
+
- [ ] Cookies are `HttpOnly`, `Secure`, and have an appropriate `SameSite`.
|
|
48
|
+
- [ ] State-changing requests are protected against cross-site forgery where cookie auth is used.
|
|
49
|
+
|
|
50
|
+
## Information disclosure
|
|
51
|
+
|
|
52
|
+
- [ ] No stack trace, internal path, dependency version, or query text reaches a client. Cross-reference `failure.md`.
|
|
53
|
+
- [ ] Error messages do not distinguish "no such user" from "wrong password".
|
|
54
|
+
- [ ] Directory listing, source maps, and debug endpoints are disabled in production.
|
|
55
|
+
- [ ] Logs do not contain credentials, tokens, or personal data — cross-reference `privacy.md`.
|
|
56
|
+
|
|
57
|
+
## Dependencies
|
|
58
|
+
|
|
59
|
+
- [ ] Known-vulnerable dependencies. Report the advisory, not a guess. Cross-reference `dependencies-licensing.md`.
|
|
60
|
+
- [ ] Lockfile present and committed, so builds are reproducible.
|
|
61
|
+
|
|
62
|
+
## Severity guidance
|
|
63
|
+
|
|
64
|
+
| Situation | Severity |
|
|
65
|
+
|---|---|
|
|
66
|
+
| Injection sink reachable from unvalidated external input | Critical |
|
|
67
|
+
| Missing authorisation on a protected operation | Critical |
|
|
68
|
+
| Secret committed to the repository | Critical |
|
|
69
|
+
| Password stored unhashed or reversibly | Critical |
|
|
70
|
+
| Certificate verification disabled | High |
|
|
71
|
+
| Authorisation checked on route but not on resource | High |
|
|
72
|
+
| Wildcard CORS with credentials | High |
|
|
73
|
+
| Non-constant-time secret comparison | Medium |
|
|
74
|
+
| Missing cookie security attributes | Medium |
|
|
75
|
+
| Internal detail disclosed in an error | Medium |
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Testing
|
|
2
|
+
|
|
3
|
+
Gate: test files are present **or conspicuously absent**. The absence case is the point — "this project has no tests" is a finding, not a reason to skip the module.
|
|
4
|
+
|
|
5
|
+
Coverage percentage is not the question. The question is: **which defects would this suite have caught?** Take the findings from the other modules and ask, for each, why no test failed.
|
|
6
|
+
|
|
7
|
+
## Does the suite prove anything
|
|
8
|
+
|
|
9
|
+
- [ ] For each confirmed finding elsewhere in this audit, identify the missing test. That list is the most valuable output of this module.
|
|
10
|
+
- [ ] Tests assert behaviour, not implementation. A test that breaks on every refactor and passes through every real bug is negative value.
|
|
11
|
+
- [ ] Tests would fail if the feature broke. Try it mentally on the most important test: mutate the logic and ask whether an assertion catches it.
|
|
12
|
+
- [ ] No test asserts only that a function was called. Call-count assertions on a mock prove the test's own wiring.
|
|
13
|
+
- [ ] Assertions are specific — `toEqual` on a shape rather than `toBeDefined`, expected values rather than `expect.anything()`.
|
|
14
|
+
|
|
15
|
+
## What is not covered
|
|
16
|
+
|
|
17
|
+
- [ ] Error paths. Most suites test only the happy path; cross-reference `failure.md` and check each error branch has a test.
|
|
18
|
+
- [ ] Boundaries: empty, one, many, maximum, negative, zero, unicode, very long.
|
|
19
|
+
- [ ] Concurrency. Tests run operations one at a time, which is why the defects in `concurrency.md` survive green suites. Note explicitly which are untestable as written.
|
|
20
|
+
- [ ] Idempotency and re-run paths.
|
|
21
|
+
- [ ] Migration and upgrade paths — reading state written by the previous version.
|
|
22
|
+
- [ ] The packaged artefact, as a consumer would use it. Cross-reference `packaging.md`: the suite runs from the repository where every file exists, which is exactly why it misses packaging bugs.
|
|
23
|
+
|
|
24
|
+
## Test isolation
|
|
25
|
+
|
|
26
|
+
- [ ] **No test writes outside its own temporary directory.** Check for writes derived from the home directory, a global config path, or a shared data directory. A test that pollutes the developer's real environment is `High` — and it is easy to introduce accidentally when production code resolves paths from `homedir()`.
|
|
27
|
+
- [ ] Injection seams exist for anything that resolves a real path, spawns a process, or reaches the network — and the tests actually use them.
|
|
28
|
+
- [ ] Tests do not depend on execution order or on each other's leftovers.
|
|
29
|
+
- [ ] Each test cleans up on both the pass and the fail path.
|
|
30
|
+
- [ ] Nothing hits a real paid or external endpoint. Cross-reference `cost.md`.
|
|
31
|
+
|
|
32
|
+
## Determinism
|
|
33
|
+
|
|
34
|
+
- [ ] No dependence on wall-clock time, current date, timezone, or locale without control.
|
|
35
|
+
- [ ] No dependence on unseeded randomness.
|
|
36
|
+
- [ ] No fixed sleeps standing in for synchronisation — that is a flake with a timer.
|
|
37
|
+
- [ ] No dependence on a fixed port, or ports are allocated dynamically. Fixed ports collide under parallel runs and in CI.
|
|
38
|
+
- [ ] **Known flaky tests are tracked, not tolerated.** A test that fails one run in ten is a real signal being discarded. Report each one with its observed failure rate.
|
|
39
|
+
|
|
40
|
+
## Guard tests
|
|
41
|
+
|
|
42
|
+
- [ ] Where the codebase depends on two things agreeing — a manifest and a directory, a schema and a model, a gate table and a file set — a test asserts the agreement. Hand-maintained lists are fine; unguarded hand-maintained lists are not.
|
|
43
|
+
- [ ] **A guard nobody has watched fail is not a guard.** Verify each one by mutation: break the invariant deliberately, confirm the test fails, revert. Report guards that pass unconditionally.
|
|
44
|
+
|
|
45
|
+
## Severity guidance
|
|
46
|
+
|
|
47
|
+
| Situation | Severity |
|
|
48
|
+
|---|---|
|
|
49
|
+
| No tests at all for correctness-critical logic | High |
|
|
50
|
+
| Test writes outside its temp directory into a real user path | High |
|
|
51
|
+
| Tests hitting real paid or external endpoints | High |
|
|
52
|
+
| A confirmed defect that the suite could have caught but does not | High |
|
|
53
|
+
| Guard test that cannot fail | Medium |
|
|
54
|
+
| Flaky test tolerated and untracked | Medium |
|
|
55
|
+
| No test for any error path | Medium |
|
|
56
|
+
| Fixed sleep standing in for synchronisation | Medium |
|
|
57
|
+
| Fixed port causing collisions under parallel runs | Medium |
|
|
58
|
+
| Tests asserting implementation rather than behaviour | Low |
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Versioning & Compatibility
|
|
2
|
+
|
|
3
|
+
Gate: a published package manifest or a release workflow was detected.
|
|
4
|
+
|
|
5
|
+
Every published thing has consumers you cannot see. This module asks whether a consumer who upgrades will survive it.
|
|
6
|
+
|
|
7
|
+
## Public surface
|
|
8
|
+
|
|
9
|
+
- [ ] What is public is stated. Without a declared boundary, everything exported is public by accident and every internal rename is a breaking change.
|
|
10
|
+
- [ ] Internal-only exports are marked internal, or not exported. `find_callers` on each export — one with only in-repo callers is a candidate to unexport.
|
|
11
|
+
- [ ] Types and schemas that appear in public signatures are part of the contract, including their optional fields.
|
|
12
|
+
- [ ] Configuration keys, CLI flags, environment variables, and on-disk formats are public surface too. These are the ones teams forget.
|
|
13
|
+
|
|
14
|
+
## Breaking-change discipline
|
|
15
|
+
|
|
16
|
+
- [ ] Version numbers follow a stated scheme, and breaking changes actually bump the breaking component. A major-version-zero project should say what its stability promise is.
|
|
17
|
+
- [ ] For each recent change to public surface, classify it: added (minor), fixed (patch), removed or narrowed (major). Report any misclassification.
|
|
18
|
+
- [ ] These are breaking even when they look small: narrowing an accepted input, adding a required parameter, changing a default, changing an error type, changing a return shape, renaming a config key, tightening validation.
|
|
19
|
+
- [ ] Behavioural breaks count, not only signature breaks. Same types, different meaning is worse — it compiles and misbehaves.
|
|
20
|
+
|
|
21
|
+
## Deprecation
|
|
22
|
+
|
|
23
|
+
- [ ] Removals are preceded by a deprecation with a runtime warning and a stated replacement.
|
|
24
|
+
- [ ] Deprecations have a removal version, not just a label. Cross-reference `future.md`: an undated deprecation is kept forever.
|
|
25
|
+
- [ ] Both paths work during the overlap, and the old one is genuinely equivalent.
|
|
26
|
+
- [ ] Deprecation warnings are emitted once per process, not once per call.
|
|
27
|
+
|
|
28
|
+
## Data and state compatibility
|
|
29
|
+
|
|
30
|
+
- [ ] Persisted formats carry a version field. Without one, the next reader must guess.
|
|
31
|
+
- [ ] The new version reads state written by the previous version. Test it, do not assume it.
|
|
32
|
+
- [ ] Forward compatibility is decided deliberately: does an older version encountering newer state fail loudly or corrupt quietly? Loudly is the only acceptable answer.
|
|
33
|
+
- [ ] Migrations of on-disk or cached state are idempotent and recoverable if interrupted.
|
|
34
|
+
|
|
35
|
+
## Runtime and platform
|
|
36
|
+
|
|
37
|
+
- [ ] Declared engine and platform support matches what the code and dependencies actually require.
|
|
38
|
+
- [ ] Minimum supported versions are tested, not just declared. A CI matrix of one version supports one version.
|
|
39
|
+
- [ ] Newly used runtime APIs do not silently raise the real minimum below the declared one.
|
|
40
|
+
|
|
41
|
+
## Communication
|
|
42
|
+
|
|
43
|
+
- [ ] Changes are recorded somewhere a consumer will find — changelog, release notes, or migration guide.
|
|
44
|
+
- [ ] Breaking changes state the migration, not just the fact.
|
|
45
|
+
- [ ] Entries correspond to real commits; a changelog nobody maintains is worse than none because it is trusted.
|
|
46
|
+
|
|
47
|
+
## Severity guidance
|
|
48
|
+
|
|
49
|
+
| Situation | Severity |
|
|
50
|
+
|---|---|
|
|
51
|
+
| Breaking change shipped without a breaking version bump | High |
|
|
52
|
+
| Behavioural break with an unchanged signature | High |
|
|
53
|
+
| New version cannot read the previous version's persisted state | High |
|
|
54
|
+
| Persisted format with no version field | High |
|
|
55
|
+
| Removal with no prior deprecation | Medium |
|
|
56
|
+
| Deprecation with no removal version | Medium |
|
|
57
|
+
| Declared engine support wider than what the code requires | Medium |
|
|
58
|
+
| No declared public-surface boundary | Medium |
|
|
59
|
+
| Breaking change documented without a migration path | Low |
|