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.
Files changed (53) hide show
  1. package/README.md +1 -1
  2. package/package.json +6 -6
  3. package/templates/skills/brain-audit/SKILL.md +191 -8
  4. package/templates/skills/brain-audit/references/abuse.md +34 -24
  5. package/templates/skills/brain-audit/references/accessibility.md +41 -21
  6. package/templates/skills/brain-audit/references/ai.md +28 -18
  7. package/templates/skills/brain-audit/references/analytics.md +73 -0
  8. package/templates/skills/brain-audit/references/api.md +27 -17
  9. package/templates/skills/brain-audit/references/backend.md +24 -16
  10. package/templates/skills/brain-audit/references/complexity.md +30 -17
  11. package/templates/skills/brain-audit/references/concurrency.md +28 -19
  12. package/templates/skills/brain-audit/references/consistency.md +32 -24
  13. package/templates/skills/brain-audit/references/contract-drift.md +30 -19
  14. package/templates/skills/brain-audit/references/cost.md +35 -24
  15. package/templates/skills/brain-audit/references/cross-surface-parity.md +70 -0
  16. package/templates/skills/brain-audit/references/database.md +42 -24
  17. package/templates/skills/brain-audit/references/dependencies-licensing.md +34 -23
  18. package/templates/skills/brain-audit/references/design-system.md +99 -0
  19. package/templates/skills/brain-audit/references/devops.md +38 -24
  20. package/templates/skills/brain-audit/references/documentation.md +35 -23
  21. package/templates/skills/brain-audit/references/failure.md +33 -21
  22. package/templates/skills/brain-audit/references/feature-flags.md +87 -0
  23. package/templates/skills/brain-audit/references/flow-integrity.md +58 -33
  24. package/templates/skills/brain-audit/references/frontend.md +36 -19
  25. package/templates/skills/brain-audit/references/functional.md +38 -17
  26. package/templates/skills/brain-audit/references/future.md +32 -12
  27. package/templates/skills/brain-audit/references/goal.md +19 -12
  28. package/templates/skills/brain-audit/references/i18n.md +37 -23
  29. package/templates/skills/brain-audit/references/idempotency.md +76 -0
  30. package/templates/skills/brain-audit/references/infrastructure.md +31 -22
  31. package/templates/skills/brain-audit/references/mobile.md +32 -23
  32. package/templates/skills/brain-audit/references/multi-tenancy.md +74 -0
  33. package/templates/skills/brain-audit/references/numeric.md +70 -0
  34. package/templates/skills/brain-audit/references/observability.md +36 -21
  35. package/templates/skills/brain-audit/references/packaging.md +27 -19
  36. package/templates/skills/brain-audit/references/performance.md +48 -21
  37. package/templates/skills/brain-audit/references/privacy.md +39 -25
  38. package/templates/skills/brain-audit/references/product.md +31 -12
  39. package/templates/skills/brain-audit/references/prompt-spec-gap.md +25 -18
  40. package/templates/skills/brain-audit/references/reachability.md +28 -20
  41. package/templates/skills/brain-audit/references/repo-history.md +65 -0
  42. package/templates/skills/brain-audit/references/runtime.md +83 -0
  43. package/templates/skills/brain-audit/references/scalability.md +35 -22
  44. package/templates/skills/brain-audit/references/security.md +50 -33
  45. package/templates/skills/brain-audit/references/state-model.md +73 -0
  46. package/templates/skills/brain-audit/references/supply-chain.md +64 -0
  47. package/templates/skills/brain-audit/references/temporal.md +66 -0
  48. package/templates/skills/brain-audit/references/testing.md +49 -24
  49. package/templates/skills/brain-audit/references/tooling-baseline.md +77 -0
  50. package/templates/skills/brain-audit/references/type-safety.md +68 -0
  51. package/templates/skills/brain-audit/references/versioning-compatibility.md +33 -22
  52. package/templates/skills/brain-audit/references/visual-design.md +89 -0
  53. package/templates/skills/brain-audit/references/web-metadata.md +72 -0
@@ -6,51 +6,64 @@ Read the pipeline as code, because it is. The same standards apply: no secrets i
6
6
 
7
7
  ## Pipeline integrity
8
8
 
9
- - [ ] The pipeline actually fails the build on test failure, type error, and lint error. `search_code` for `continue-on-error`, `|| true`, and `--passWithNoTests` — each one can turn a red build green.
10
- - [ ] Every check that matters locally also runs in CI. A test suite the pipeline does not run is decoration.
11
- - [ ] The pipeline runs on the branches and events that matter, including the merge target.
12
- - [ ] Required checks are actually required by branch protection, not merely present.
9
+ - [ ] The pipeline actually fails the build on test failure, type error, and lint error. `search_code` for `continue-on-error`, `|| true`, and `--passWithNoTests` — each one can turn a red build green. Rule-out: a `continue-on-error` on a genuinely advisory step (a nightly benchmark, an experimental linter) is not a defect; read what the step does before flagging it.
10
+ - [ ] Every check that matters locally also runs in CI. Read the scripts declared in `package.json`/`Makefile` and the setup steps in README or CONTRIBUTING, then read the CI workflow's actual step list — a script documented or runnable locally but never invoked by a workflow step is decoration, not a check.
11
+ - [ ] The pipeline triggers on the branches and events that matter. Read the workflow's `on:` block and confirm the merge-target branch and the PR event are both present — a workflow that only runs on `push` to `main` never gates the PR that lands there.
12
+ - [ ] Required checks are enforced by branch protection — **this is a platform setting, not a file in the repository.** (OpenSSF Scorecard's own `Branch-Protection` check hits the same wall and queries the GitHub API for it rather than reading source.) A ruleset file or `CODEOWNERS` checked into the repo is the only in-repo signal, and even that only proves a rule was declared, not that GitHub enforces it as required. State explicitly that enforcement itself is `undetermined` from source and belongs in `Out of static reach`; this module can confirm only that the check exists and runs.
13
13
 
14
14
  ## Reproducibility
15
15
 
16
- - [ ] Lockfile committed and CI installs from it exactly — a frozen/CI install, not a resolving one.
17
- - [ ] Action, image, and tool versions are pinned. A floating tag means yesterday's green build is not reproducible.
18
- - [ ] Build does not depend on ambient state — developer machine paths, pre-installed global tools, network resources that can change.
19
- - [ ] The same artefact that was tested is the one that deploys. Rebuilding between test and deploy tests one thing and ships another.
16
+ - [ ] Lockfile committed and CI installs from it exactly. `search_code` the CI workflow for the install command — `npm ci`, `yarn install --frozen-lockfile`, `pnpm install --frozen-lockfile` are frozen installs; a bare `npm install`/`yarn install` resolves and can silently drift the lockfile on every run.
17
+ - [ ] Action, image, and tool versions are pinned. `search_code` workflow files for `uses: <action>@v` — a version tag floats, a 40-character commit SHA does not. Read the Dockerfile's `FROM` line for the same distinction: a tag can be repointed by its publisher, a digest cannot.
18
+ - [ ] Build does not depend on ambient state. Read the workflow for steps referencing paths or tools outside the checked-out repository, and for a self-hosted runner whose pre-installed toolchain the workflow never declares — a hosted-runner workflow that suddenly needs a self-hosted label is the tell.
19
+ - [ ] The same artefact that was tested is the one that deploys. Read whether the deploy job downloads the build artefact the test job produced (`actions/upload-artifact` / `download-artifact` or equivalent) or invokes its own separate build step — two independent build invocations across jobs means the tested bits and the shipped bits are not provably identical.
20
20
 
21
21
  ## Secrets in CI
22
22
 
23
- - [ ] No secret in pipeline YAML, build args, or image layers. Build args are visible in image history.
24
- - [ ] Secrets are not echoed. `search_code` for debug flags in the pipeline (`set -x`, verbose modes) alongside secret usage.
25
- - [ ] Pull requests from forks cannot access secrets.
26
- - [ ] Third-party actions and images have pinned digests, or the supply-chain exposure is accepted deliberately.
23
+ - [ ] No secret in pipeline YAML, build args, or image layers. `search_code` for `secret`, `password`, `token`, `api_key` in workflow files and `Dockerfile`/`docker-compose` build-arg blocks. Rule-out: a hit that is `${{ secrets.X }}` or `${{ env.X }}` interpolation is the secrets manager working correctly; the finding is a literal string assigned where one of those references belongs — read each hit before reporting, do not flag the pattern name alone.
24
+ - [ ] Secrets are not echoed. `search_code` for `set -x` or `ACTIONS_STEP_DEBUG`/`ACTIONS_RUNNER_DEBUG` in steps that also reference `secrets.` — verbose mode prints the resolved command line, secret included.
25
+ - [ ] Pull requests from forks cannot access secrets. Read the workflow trigger: plain `pull_request` never exposes repository secrets to a fork's code, so do not flag it — that is the safe default and a common false alarm. `pull_request_target` combined with checking out the fork's ref (`ref: ${{ github.event.pull_request.head.sha }}`) is the dangerous "pwn request" pattern, because it runs with base-repo secrets against fork-controlled code.
26
+ - [ ] Two distinct platform mitigations narrow this, and neither is a substitute for reading the workflow. **Workflow-source pinning** (effective 2025-12-08): `pull_request_target` now always takes its workflow file and ref from the repository's default branch, regardless of the PR's base branch — this closes the older exploit of smuggling a malicious workflow version onto a stale non-default branch and waiting for it to trigger. **`actions/checkout` v7** (shipped 2026-06-18): blocks and fails a workflow that tries to check out unreviewed fork-PR code under `pull_request_target` or `workflow_run` — this is enforcement at the checkout step itself, not a change to which workflow file runs. Read the workflow's checkout step and its `actions/checkout` version against both dates before deciding which mitigation, if either, applies.
27
+ - [ ] The `actions/checkout` v7 enforcement was backported to the other supported majors on 2026-07-16 — v4, v5, and v6 all inherit the fork-checkout block automatically because they're floating tags GitHub repoints. **`v1` was not backported and does not block it.** `search_code` workflow files for `uses: actions/checkout@v1` under a `pull_request_target`/`workflow_run` trigger — that combination is now a concrete, readable finding, not an inference. The block also does not reach a workflow pinned to a fixed commit SHA predating the backport, or one that clones the fork's ref by hand instead of via `actions/checkout` — name which case applies before concluding the repo is covered.
28
+ - [ ] Third-party actions and images have pinned digests. `search_code` workflow files for `uses:` lines lacking a 40-character SHA — the convention is `uses: owner/action@<sha> # v4.2.2`, SHA resolved, tag kept only as a human-readable comment. A floating tag on a third-party action is a supply-chain dependency that can change underneath the pipeline without review; GitHub can enforce this org-wide via its actions-policy SHA-pinning setting (GA since August 2025), but that setting lives outside the repo and is not confirmable from source.
27
29
 
28
30
  ## Container hygiene
29
31
 
30
- - [ ] Multi-stage build so build tooling is not in the final image.
31
- - [ ] Runs as a non-root user.
32
- - [ ] Base image is specific and updatable, and something updates it.
33
- - [ ] Build context excludes what should not ship — `.git`, `node_modules`, `.env`, test fixtures. Check the ignore file exists and covers them.
34
- - [ ] Healthcheck defined, and it reflects readiness rather than only liveness.
32
+ - [ ] Multi-stage build so build tooling is not in the final image. Read the Dockerfile, count `FROM` stages, and confirm the final stage `COPY --from=` only the build output, never the compiler, package manager cache, or dev dependencies.
33
+ - [ ] Runs as a non-root user. `search_code` the Dockerfile for a `USER` directive — its absence means the container runs as root by default, and that is the finding, not an assumption to double-check.
34
+ - [ ] Base image is minimal, specific, and updatable. Read the `FROM` line: a distroless, Alpine, or `-slim` variant carries a materially smaller attack surface than a full `ubuntu`/`debian` image with the same tooling available to an attacker post-compromise — name which family is in use. A pinned tag or digest is checkable; `latest` or an untagged reference is not, and "something updates it" needs a Renovate/Dependabot config or equivalent — `search_code` for one.
35
+ - [ ] Build context excludes what should not ship. Read the `.dockerignore` file's actual contents — its mere existence proves nothing — and confirm `.git`, `node_modules`, `.env`, and test fixtures are each covered, not assumed covered by a wildcard that does not match them.
36
+ - [ ] Healthcheck defined, and it reflects readiness rather than only liveness. `search_code` for `HEALTHCHECK`, then read what it curls or invokes — a check that only confirms the process is running (e.g. hitting `/` with no dependency check) reports healthy while the database connection is down.
37
+ - [ ] Capabilities are dropped and the root filesystem is read-only wherever the application allows it. `search_code` the Dockerfile, compose file, or Kubernetes manifest for `cap_drop: [ALL]` / `--cap-drop=ALL` and `readOnlyRootFilesystem: true` / `read_only: true`. Their absence means the container keeps the full default Linux capability set and a writable root even after the non-root and multi-stage fixes above — a step past "not root," and the next thing 2026 hardening baselines check for.
35
38
 
36
39
  ## Deploy and rollback
37
40
 
38
- - [ ] There is a documented, tested rollback. An untested rollback is a hope.
39
- - [ ] Migrations and code deploys are ordered so a running old version does not break — cross-reference the destructive-migration check in `database.md`.
40
- - [ ] Deploys are atomic or gradual, not partial-and-visible.
41
- - [ ] Configuration differs from code, so a config change does not require a rebuild.
41
+ - [ ] A documented rollback path exists. `search_code` docs and runbooks for "rollback" and read the steps. This module can confirm only that a documented path exists, not that it has ever been exercised — whether it actually works under a real failure is `undetermined` from source and belongs in `Out of static reach`.
42
+ - [ ] Migrations and code deploys are ordered so a running old version does not break. Cross-reference the destructive-migration check in `database.md`: read migration files for additive-vs-destructive shape (a dropped or renamed column breaks the old version still running against it) and compare against the deploy workflow's ordering of migrate-then-deploy vs deploy-then-migrate.
43
+ - [ ] Deploys are atomic or gradual, not partial-and-visible. Read the deployment platform's config — a Kubernetes rolling-update strategy, a blue-green or canary configuration — for the actual cutover mechanism rather than assuming one.
44
+ - [ ] Configuration differs from code, so a config change does not require a rebuild. `search_code` for values that should be environment-driven but are hardcoded into source, and cross-reference the declared environment-variable list in `infrastructure.md`.
42
45
 
43
46
  ## Local parity
44
47
 
45
- - [ ] A new contributor can build and test with documented steps that work. Follow them literally and report each divergence.
46
- - [ ] Local and CI use the same tool versions.
47
- - [ ] Nothing required for development is available only to existing team members.
48
+ - [ ] A new contributor can build and test with documented steps that work. Read the setup steps in README or CONTRIBUTING and cross-check each command literally exists in `package.json`/`Makefile` — a documented command that has silently drifted from the actual script name is the finding, and following the steps as written is the probe, not a formality.
49
+ - [ ] Local and CI use the same tool versions. `search_code` for `.nvmrc`, `.tool-versions`, or an `engines` field, then compare the version it names against the version pinned in the CI workflow — a mismatch means "works on my machine" is provably possible.
50
+ - [ ] Nothing required for development is available only to existing team members. `search_code` setup docs for internal URLs or private registries and check whether an access-request process is documented alongside them; an undocumented internal dependency blocks every new contributor identically.
51
+
52
+ ## Out of static reach
53
+
54
+ - Whether required checks are actually enforced by branch protection — a platform setting invisible to source, not a file.
55
+ - Whether a documented rollback procedure has ever been executed successfully.
56
+ - True build reproducibility across machines and over time, beyond what pinned versions and lockfiles imply.
57
+ - Whether CI secrets are scoped correctly at the provider (environment restrictions, least-privilege service accounts) rather than merely referenced correctly in YAML.
58
+ - Real autoscaling and deploy-strategy behaviour under production load.
59
+ - Whether the pipeline's actual delivery performance meets any DORA benchmark — DORA's 2025 report reframed the classic four metrics into five (deployment frequency, lead time for changes, failed-deployment recovery time, change fail rate, deployment rework rate). This module can confirm a pipeline exists and how it's gated, not how often it fires or how long a change takes once merged — that needs CI run history and incident data outside source.
48
60
 
49
61
  ## Severity guidance
50
62
 
51
63
  | Situation | Severity |
52
64
  |---|---|
53
65
  | Secret in pipeline config, build arg, or image layer | Critical |
66
+ | `pull_request_target` checks out and runs fork-PR head, with no checkout-level block in effect (`actions/checkout@v1`, a pre-2026-07-16 pinned SHA, or a hand-rolled clone) | Critical |
54
67
  | Pipeline cannot fail the build (`\|\| true`, `continue-on-error`) | High |
55
68
  | Artefact rebuilt between test and deploy | High |
56
69
  | Container runs as root | High |
@@ -59,3 +72,4 @@ Read the pipeline as code, because it is. The same standards apply: no secrets i
59
72
  | Build depends on ambient developer state | Medium |
60
73
  | Build context ships `.git` or secrets | Medium |
61
74
  | Documented local setup that does not work | Medium |
75
+ | No capability drop or read-only root filesystem configured | Medium |
@@ -4,41 +4,50 @@ Can someone else use and change this? Documentation findings are verifiable: fol
4
4
 
5
5
  ## Correctness
6
6
 
7
- - [ ] Every documented command, path, flag, and signature exists. `search_code` each one. A documented flag the parser does not accept is `Medium`; readers trust docs over code.
8
- - [ ] Follow the install and first-run instructions exactly as written, on a clean assumption. Report every missing prerequisite, wrong path, and undocumented step.
9
- - [ ] Code examples match current signatures. Test one against the real symbol with `find_symbol`.
10
- - [ ] No documentation of features that no longer exist. Cross-reference `Reachability` for the inverse.
11
- - [ ] Claims about behaviour are true. This repo's own README claimed skills were "installed globally" when nothing installed them — a false claim is worse than a gap, because nobody investigates what they believe is handled.
7
+ - [ ] Every documented command, path, flag, and signature exists. `search_code` each one against the parser/dispatcher. A documented flag the parser does not accept is `Medium`; readers trust docs over code.
8
+ - [ ] Follow the install and first-run instructions exactly as written, on a clean-checkout assumption. `find_symbol` each command or script the doc names, in the order the doc gives them, and confirm each exists and accepts the arguments shown. Report every missing prerequisite, wrong path, and undocumented step.
9
+ - [ ] Code examples match current signatures. `find_symbol` the real signature and diff it literally against the example — parameter names, order, and return shape.
10
+ - [ ] No documentation of features that no longer exist. `search_code` the documented feature's name/symbol in the source; zero hits confirms removal. Rule out a rename before calling it stale — search under a plausible new name too. Cross-reference `Reachability` for the inverse.
11
+ - [ ] Claims about behaviour are true. `find_symbol` the function the claim describes and read it directly — do not accept the doc's wording as evidence of its own accuracy. This repo's own README once claimed skills were "installed globally" when nothing installed them; a false claim is worse than a gap, because nobody investigates what they believe is handled.
12
12
 
13
13
  ## Coverage
14
14
 
15
- - [ ] Purpose stated up front — what this is and who it is for. Cross-reference `goal.md`.
16
- - [ ] Every public entry point documented: commands, endpoints, exported functions, config keys, environment variables.
17
- - [ ] Every configuration option documented with its type, default, and effect.
18
- - [ ] Prerequisites and supported platforms stated, and matching what the code requires.
19
- - [ ] Failure modes documented: what common errors mean and what to do about them.
20
- - [ ] A path from install to first useful result, in order.
15
+ - [ ] Purpose stated up front — what this is and who it is for. `search_code`/`search_context` the README's opening section for an audience/purpose statement. Cross-reference `goal.md`.
16
+ - [ ] Every public entry point documented: commands, endpoints, exported functions, config keys, environment variables. `get_architecture`/`repo_map` for the full entry-point list, then `search_code` each name against the docs — an entry point with zero doc hits is the gap.
17
+ - [ ] Every configuration option documented with its type, default, and effect. `search_code` the config schema/parser for every key, then check each appears in docs with all three of type, default, and effect — name-only documentation is still a gap.
18
+ - [ ] Prerequisites and supported platforms stated, and matching what the code requires. `search_code` the manifest's engine/platform constraints (`engines`, `python_requires`, a Dockerfile base image) and diff against what the docs claim.
19
+ - [ ] Failure modes documented: what common errors mean and what to do about them. `search_code` the entry point's thrown/returned error messages and check each has a corresponding doc entry — an error string with no doc mention is the gap.
20
+ - [ ] A path from install to first useful result, in order. Read the doc top to bottom and confirm no step depends on a later one. Cross-reference `product.md`'s onboarding path check; reuse its finding rather than re-deriving it here.
21
21
 
22
22
  ## Structure
23
23
 
24
- - [ ] A reader can find what they need without reading everything. Reference material separate from tutorials.
25
- - [ ] Nothing important lives only in a comment, a commit message, or an issue.
26
- - [ ] Docs live near what they describe, so a change is likely to update both.
27
- - [ ] No duplicated documentation of the same thing in two places — they will diverge, and the reader cannot tell which is current.
24
+ - [ ] A reader can find what they need without reading everything. Documentation is organised by the reader's intent, not merely by feature area — the Diátaxis framework's four modes (tutorial: a hands-on lesson; how-to: steps toward one task; reference: facts, consulted rather than read; explanation: the background and the why) are the vocabulary practitioners actually use to name this split. `list_modules`, or read the docs directory tree directly — a single flat file mixing tutorial prose, task steps, and reference tables is the finding; note which of the four modes exist at all for this project and which are entirely absent, since a project with no explanation/why documentation has a different gap than one with no reference.
25
+ - [ ] Reference material reads cleanly as an isolated fragment. Read one reference page or section with no surrounding tutorial context and confirm it still makes sense on its own — a reference entry that depends on narrative set up earlier in a different document fails a reader who jumped straight to it mid-task, and fails identically for any retrieval-based system (a search index, or this skill's own project-brain) that surfaces the section as a standalone chunk.
26
+ - [ ] No step assumes knowledge the doc never states. Read each instruction in the install/first-run path and confirm every input it requires — an account, a config value, a secret, a prior step performed elsewhere — is documented as a prerequisite before it is used, not assumed already known to the reader.
27
+ - [ ] Nothing important lives only in a comment, a commit message, or an issue. `search_code` for a comment stating a constraint or contract with no counterpart in any doc file — that constraint is invisible to anyone who doesn't read that exact line.
28
+ - [ ] Docs live near what they describe, so a change is likely to update both. Compare the doc file's path to the code path it documents — a doc for `src/auth/` living only in a top-level `/docs` with no cross-link is more likely to rot.
29
+ - [ ] No duplicated documentation of the same thing in two places. `search_code` a distinctive phrase or heading from one doc file against the rest of the docs tree — a hit in a second file is the duplicate; they will diverge, and the reader cannot tell which is current. This is the single most commonly reported documentation defect in practice, ahead of any individual accuracy gap.
28
30
 
29
31
  ## In-code documentation
30
32
 
31
- - [ ] Non-obvious code explains **why**, not what. A comment restating the line is noise; a missing rationale on a surprising line is a real gap.
32
- - [ ] Public APIs document their contract: what they accept, what they return, what they throw, what they mutate.
33
- - [ ] Comments are current. A comment contradicting its code is `Medium` — cross-reference `consistency.md`.
34
- - [ ] Workarounds record why they exist and what would let them be removed. An unexplained workaround is permanent by default.
35
- - [ ] Deliberate deviations from an obvious approach say so, and say what was traded.
33
+ - [ ] Non-obvious code explains **why**, not what. Read a sample of comments near `repo_map`'s highest-PageRank symbols — a comment restating the line (`// increment i` above `i++`) is noise; a missing rationale on a surprising line (a magic number, an early return, a suppressed lint) is a real gap.
34
+ - [ ] Public APIs document their contract: what they accept, what they return, what they throw, what they mutate. `find_symbol` each exported function and check its docstring/JSDoc covers all four; a signature with none is the gap.
35
+ - [ ] Comments are current. `find_symbol` the commented code and read both together — a comment contradicting its code is `Medium`; cross-reference `consistency.md`.
36
+ - [ ] Workarounds record why they exist and what would let them be removed. `search_code` for `workaround`/`hack`/`XXX` and check each has an adjacent explanation — an unexplained workaround is permanent by default.
37
+ - [ ] Deliberate deviations from an obvious approach say so, and say what was traded. `search_code` a non-obvious implementation choice (a manual loop where a library call would be idiomatic) and check for a comment explaining the tradeoff.
36
38
 
37
39
  ## Maintenance
38
40
 
39
- - [ ] Something keeps docs honest — a test asserting required sections, a link check, or executable examples. Docs with no enforcement decay silently.
40
- - [ ] Onboarding docs name an owner, or are recent enough to trust.
41
- - [ ] Where specs, plans, or ADRs exist, they reflect what shipped. Cross-reference `prompt-spec-gap.md`; a plan describing a design the code abandoned actively misleads.
41
+ - [ ] Something keeps docs honest — a test asserting required sections, a link check, or executable examples. `search_code` the CI config and test directory for a docs-lint, link-check, or doctest step; its absence means docs decay silently.
42
+ - [ ] Onboarding docs name an owner, or are recent enough to trust. Read the doc's header/footer for an owner or last-updated marker; if absent and `Repo History` is in the confirmed module set, use the file's last-commit date as a proxy for trust.
43
+ - [ ] Where specs, plans, or ADRs exist, they reflect what shipped. `find_symbol` the component the spec describes and diff its real shape against the spec's. Cross-reference `prompt-spec-gap.md`; a plan describing a design the code abandoned actively misleads.
44
+
45
+ ## Out of static reach
46
+
47
+ - Whether a reader actually succeeds following the docs, versus the steps being present and in the right order.
48
+ - Whether an in-code comment's rationale is still true today, when nothing pins it to the constraint it described.
49
+ - Perceived clarity of an error message or doc passage to someone unfamiliar with the codebase.
50
+ - Whether the docs owner named in a header is still the right person to ask.
42
51
 
43
52
  ## Severity guidance
44
53
 
@@ -51,6 +60,9 @@ Can someone else use and change this? Documentation findings are verifiable: fol
51
60
  | Comment that contradicts its code | Medium |
52
61
  | Public entry point with no documentation | Medium |
53
62
  | Spec or plan describing an abandoned design | Medium |
63
+ | Instruction step assumes an undocumented prerequisite | Medium |
64
+ | One of the four Diátaxis modes entirely absent where the project needs it | Low |
65
+ | Reference material that only makes sense with tutorial context read first | Low |
54
66
  | Unexplained workaround | Low |
55
67
  | Same thing documented in two places | Low |
56
68
  | No enforcement keeping docs honest | Low |
@@ -6,42 +6,52 @@ The test suite proves the happy path. This module walks the other paths — and
6
6
 
7
7
  ## Error propagation
8
8
 
9
- - [ ] No swallowed errors. `search_code` for empty catch blocks, `.catch(() => {})`, and `catch` bodies that only log at debug level. Each one converts a failure into wrong behaviour.
10
- - [ ] Caught errors either handle or rethrow. Catching to log and continue with invalid state is the worst of both.
11
- - [ ] Error context survives the chain. A rethrown error that loses the original cause makes the real failure unfindable.
12
- - [ ] Errors are distinguishable by type or code, not by matching message strings. Message matching breaks on the next wording change.
9
+ - [ ] No swallowed errors: `search_code` for empty catch blocks, `.catch(() => {})`, and `catch` bodies that only log at debug level. Each one converts a failure into wrong behaviour.
10
+ - [ ] Caught errors either handle or rethrow: read the catch bodies found above — one that logs and then falls through to the next statement, with no `return`/`throw`, continues execution on invalid state. That is worse than either handling or propagating.
11
+ - [ ] Error context survives the chain: `search_code` for `throw new Error(` inside a `catch` block, then read whether it wraps the original (`{ cause: err }`) or discards it. A rethrow that loses the original cause makes the real failure unfindable.
12
+ - [ ] Errors are distinguishable by type or code, not by matching message strings: `search_code` for `.message ===`/`.message.includes(` used to branch on an error. Message matching breaks on the next wording change.
13
13
 
14
14
  ## Boundaries
15
15
 
16
- - [ ] Every external call is wrapped: network, filesystem, subprocess, database, parsing untrusted input.
17
- - [ ] Every external call has a timeout. Missing timeout is `High` — it turns a slow dependency into an outage.
18
- - [ ] Retries exist where the failure is transient, are bounded, and back off. Retrying a non-idempotent operation is worse than failing.
19
- - [ ] Non-transient failures are not retried. Retrying a 400 wastes time and hides the bug.
16
+ - [ ] Every external call is wrapped: `search_code` for the network/filesystem/subprocess/database client calls (`fetch(`, an HTTP client, `fs.`, `spawn(`, ORM query calls) and confirm each sits inside a try/catch or has a `.catch(`.
17
+ - [ ] Every external call has a timeout: read each client construction or call site found above for a `timeout` option or an `AbortSignal.timeout`. Missing timeout is `High` — it turns a slow dependency into an outage. Rule out a framework-level default timeout that applies even without an explicit one, and name it.
18
+ - [ ] Retries exist where the failure is transient, are bounded, and back off: `search_code` for a retry wrapper or library around each external call found above; read its config for a max-attempts and a backoff strategy — specifically jittered exponential backoff. Full Jitter (`random(0, min(cap, base*2^attempt))`) is the primary-source recommendation over a fixed interval or un-jittered exponential backoff, since it does the least total work against a recovering backend for comparable completion time (AWS Architecture Blog, "Exponential Backoff and Jitter").
19
+ - [ ] Non-transient failures are not retried: read the retry predicate (`shouldRetry`/`retryIf`) at each site found above — retrying unconditionally on any thrown error, including a 4xx, wastes time and hides the bug.
20
+ - [ ] Retries are capped by a budget shared across the process, not just a per-call max-attempts count: `search_code` for a retry-budget/limiter (a rolling ratio of retries to total requests, an explicit cap such as "no more than N retries per minute"). Per-call bounding still lets every concurrent caller retry independently, and across a chain of N layers each retrying k times, that multiplies to as many as k^N attempts at the bottom during an incident — the retry-storm mechanism (Google SRE book, "Addressing Cascading Failures").
21
+ - [ ] Repeated failures against the same dependency trip a circuit breaker rather than retrying every request into it indefinitely: `search_code` for a circuit-breaker library (resilience4j, Polly's `CircuitBreakerStrategy`, an in-house failure-counter-with-open-state) wrapping the client found above. The pattern is still current guidance — Microsoft's Azure Architecture Center revised its circuit-breaker page as recently as 2026-07-02 — even though Netflix's own Hystrix has been in maintenance mode since 2018 and its README now points to resilience4j; look for the pattern by behaviour, not for a specific library name.
20
22
 
21
23
  ## Partial failure
22
24
 
23
- - [ ] Multi-step operations state what happens when step 3 of 5 fails. Transaction, compensating action, or documented tolerance — pick one explicitly.
24
- - [ ] Nothing is left half-written: no partial config, no orphaned rows, no half-copied directory.
25
- - [ ] Operations that touch two systems have a reconciliation story. Cross-reference `Backend`.
26
- - [ ] Batch operations report which items succeeded and which failed, rather than one aggregate boolean.
25
+ - [ ] Multi-step operations state what happens when step 3 of 5 fails: `find_symbol` the multi-step function and read it for a transaction wrapper (`BEGIN`/`db.transaction(`) or explicit compensating-action calls after each step. Transaction, compensating action, or documented tolerance — pick one explicitly.
26
+ - [ ] Nothing is left half-written: in the same function, check whether later steps commit independently with no rollback path if an earlier one already succeeded — that is how partial config, orphaned rows, and half-copied directories happen.
27
+ - [ ] Operations that touch two systems (a database write paired with a message-broker publish, or a payment-provider call) are not done as two independent calls in the same handler — that shape fails two ways: the DB commits and the publish fails (the event is silently lost, with nothing recording that it should have happened), or the publish succeeds and the DB rolls back (a phantom event fires for a state change that never happened). `search_code` for an `outbox` table written in the same transaction as the business write, with a separate relay or CDC process doing the actual publish — that is the standard fix (the transactional outbox pattern; microservices.io/patterns/data/transactional-outbox.html). Its absence on a DB-write-then-publish handler is the finding regardless of whether a reconciliation job exists elsewhere — reconciliation is a mitigation for drift, not a substitute for atomicity. Cross-reference `Backend`.
28
+ - [ ] Batch operations report which items succeeded and which failed: `find_symbol` the batch handler's return shape — a single boolean or `void` return, rather than a per-item results array, is the finding.
27
29
 
28
30
  ## Degradation
29
31
 
30
- - [ ] Optional dependencies failing does not fail the whole operation. An analytics outage must not take down a request.
31
- - [ ] There is a defined degraded mode where one exists — cached data, reduced functionality, a clear message.
32
- - [ ] Degradation is visible. Silently serving stale data with no signal is how small outages become long ones.
32
+ - [ ] Optional dependencies failing does not fail the whole operation: `search_code` for an analytics/telemetry/non-critical SDK call inside a critical request handler and confirm it has its own try/catch, separate from the main operation's error path. An analytics outage must not take down a request.
33
+ - [ ] There is a defined degraded mode where one exists: `search_code` for a fallback branch on an optional dependency's failure — cached data, a default value, reduced functionality.
34
+ - [ ] Degradation is visible: read the fallback branch found above for a log line, metric, or response header signalling degraded mode. Silently serving stale data with no signal is how small outages become long ones.
33
35
 
34
36
  ## User-facing failure
35
37
 
36
- - [ ] Every error the user can hit produces something actionable — what happened, and what to do.
37
- - [ ] No stack trace, internal path, SQL, or provider error reaches the user. That is also an information-disclosure finding — cross-reference `Security`.
38
- - [ ] Failures the user caused are distinguishable from failures the system caused.
38
+ - [ ] Every error the user can hit produces something actionable: `search_code` the error-response construction (a global error handler, an API error formatter) and read its output for specific guidance versus a generic "something went wrong".
39
+ - [ ] No stack trace, internal path, SQL, or provider error reaches the user: read the error handler found above for direct serialisation of `err.stack`/`err.message` into the response body, and check whether it is gated by an environment check. That is also an information-disclosure finding — cross-reference `Security`.
40
+ - [ ] Failures the user caused are distinguishable from failures the system caused: read the error-class hierarchy or the status-code mapping in the handler above for a distinction (e.g. a validation error mapped to 4xx versus an internal error mapped to 5xx).
39
41
 
40
42
  ## Recovery
41
43
 
42
- - [ ] Restart-safety: the process can be killed at any point and restarted without corruption.
43
- - [ ] Interrupted operations are resumable, or safely re-runnable from the start. Cross-reference the idempotency check in `functional.md`.
44
- - [ ] Anything that can be left in a bad state has a way out — a repair command, a documented manual procedure, or self-healing.
44
+ - [ ] Restart-safety: the process can be killed at any point and restarted without corruption. Reuse the multi-step write path read under Partial failure — a write path with no atomic commit is not restart-safe, whether or not the process actually restarts mid-write.
45
+ - [ ] Interrupted operations are resumable, or safely re-runnable from the start: `search_code` for a checkpoint mechanism — a stored progress cursor, a job status column — on any long-running operation. Cross-reference the idempotency check in `functional.md`.
46
+ - [ ] Anything that can be left in a bad state has a way out: `search_code` docs and the codebase for a repair command, an admin endpoint, or a documented manual procedure ("repair", "runbook", "manual fix"). Its absence means the only way out is direct data surgery.
47
+
48
+ ## Out of static reach
49
+
50
+ - Whether a given external dependency actually fails in production, and how often.
51
+ - Real recovery time after a crash — nothing here is executed.
52
+ - Whether an "actionable" error message actually reads as clear to a real user.
53
+ - Whether a reconciliation job for a two-system write actually catches drift, versus merely existing in the codebase.
54
+ - Behaviour of a documented manual repair procedure when someone runs it under pressure.
45
55
 
46
56
  ## Severity guidance
47
57
 
@@ -55,4 +65,6 @@ The test suite proves the happy path. This module walks the other paths — and
55
65
  | Optional dependency failure taking down the request | Medium |
56
66
  | Error type distinguished by message string | Medium |
57
67
  | Silent degradation with no signal | Medium |
68
+ | No circuit breaker on a call into a repeatedly-failing dependency | Medium |
69
+ | No retry budget — per-call bounded retries still amplify multiplicatively across a call chain | Medium |
58
70
  | Batch reporting only an aggregate result | Low |
@@ -0,0 +1,87 @@
1
+ # Feature Flags
2
+
3
+ Does every flag still do something, and does everything that should be flagged actually check one? Gate: a feature-flag SDK or flag registry was detected.
4
+
5
+ Flags are meant to be temporary — a way to ship dark, roll out gradually, or kill something fast. In practice they accumulate, and a stale flag is worse than dead code: it looks like a decision point when it's actually settled, and nobody can tell which without checking every environment. This module inventories the flag surface and finds the two failure modes that matter most: a flag nobody reads, and code that reads a flag nobody declared.
6
+
7
+ ## Build the inventory
8
+
9
+ - [ ] `search_code` the flag SDK's accessor call (`isEnabled(`, `useFlag(`, `flags.get(`, or the project's own wrapper) and the flag registry/config file if one exists. Enumerate every flag key referenced anywhere in the codebase — this list is the yardstick for every check below.
10
+ - [ ] For each flag key, `find_callers` on the accessor call site (or `search_code` the literal key string) to get every read location.
11
+ - [ ] Record, per flag: where it's read, what environments set it, and — if the registry stores it — its declared owner and any recorded creation/expiry date.
12
+
13
+ ## Classify by type
14
+
15
+ - [ ] Classify each flag into Pete Hodgson's four categories — Release, Experiment, Ops, Permissioning; the canonical taxonomy (martinfowler.com/articles/feature-toggles.html) — using its name, any comment at the declaration, and where it's read: a flag gating a UI variant or an unfinished code path reads as **Release**; a flag driving cohort or variant routing reads as **Experiment**; a flag read in an error-handling, degraded-mode, or resource-limiting path reads as **Ops**; a flag read alongside a subscription, role, or entitlement check reads as **Permissioning**. This classification is the yardstick for every check below: the four categories differ deliberately in expected lifespan — Release days to weeks, Experiment until statistical significance, Ops sometimes permanent by design (a kill switch), Permissioning legitimately years — so "this flag is old" is only a finding for the categories where old is not the design.
16
+
17
+ ## Flags with no reader
18
+
19
+ - [ ] A key declared in the flag registry, config, or provider dashboard export (if checked into the repo) with zero read call sites anywhere in the code. `search_code` the exact key string, including string-interpolated forms — dead configuration, harmless but noise that makes the live flags harder to find among it.
20
+
21
+ ## Reads with no declaration — the most damaging defect here
22
+
23
+ - [ ] The inverse gap, and the one most worth finding: a flag key read in code (`isEnabled('checkout-v2')`) that appears in no registry, no environment file, no provider config anywhere in the repo. Most flag SDKs return a hardcoded default when a key is unrecognized rather than erroring — which means a **typo'd key silently and permanently returns the default forever**, and nothing in the type system or the test suite catches it, because the call succeeds. `search_code` every literal string argument to the flag accessor and cross-check each one against the registry list built above; any string with no exact match is a candidate, but first rule out: the key is computed at runtime (`` `flag-${variant}` ``) rather than a literal, in which case check the possible expansions instead of dismissing it.
24
+ - [ ] The same conceptual flag under two different keys on two surfaces — a client key and a server key that were meant to name the same rollout but were typed independently at each call site. `search_code` both and compare intent, not just spelling; these don't diff cleanly the way a typo does, so this one relies on reading the surrounding logic.
25
+ - [ ] A key present in the registry that once had readers and no longer does, cross-referenced against `repo-history.md` if run — distinguish this from "never had a reader" above only when the history check is available; otherwise report both under the same no-reader finding.
26
+
27
+ ## Permanently on or off in every environment
28
+
29
+ - [ ] For each flag, read its value across every environment config file found (`.env.*`, environment-specific YAML/JSON, a provider's exported config). A flag set to the same value in every environment is no longer a decision point — the branch it doesn't select is dead code that nobody will ever exercise again. **Cross-reference `reachability.md`** for the mechanics of confirming the other branch is truly unreachable; report the flag-specific instance here since the flag is the artefact worth naming.
30
+ - [ ] Distinguish "permanently on, old branch still present" (report the dead old-branch code) from "permanently off, new branch never shipped" (report the flag as the thing blocking a feature that otherwise looks complete) — the recommendation differs even though the static signature looks similar.
31
+
32
+ ## No recorded owner or removal date
33
+
34
+ - [ ] Flags with no owner, ticket reference, or expiry recorded anywhere — not in the registry, not in a comment at the call site, not in the PR that introduced it (out of static reach to check history depth beyond what `repo-history.md` already covers). A flag with no removal criterion is a flag that will never be removed — flag removal belongs in the definition of done, the same way the feature it gates does. Report the count, not each one individually, unless a specific flag is unusually old or risky per the checks below.
35
+ - [ ] Weigh the missing owner/expiry by the type classified above: on a **Release** or **Experiment** toggle, no expiry after weeks of history (cross-reference `repo-history.md`) is the real finding — those categories are supposed to be short-lived by design. On an **Ops** kill switch or a **Permissioning** toggle, a long lifespan with no expiry is expected, not a defect on its own; missing an *owner* is still worth flagging there, missing an *expiry* usually isn't.
36
+
37
+ ## Untested or impossible combinations
38
+
39
+ - [ ] Where two or more flags gate the same code path or adjacent paths, enumerate the combinations actually possible (`search_code` both accessor calls in the same function/module) and check whether any combination is structurally impossible to reach — e.g. flag B's check is nested inside a branch that flag A's default value never enters. This is a `traced`-tier finding only when you can show the nesting; otherwise it's `inferred` and capped at Medium.
40
+ - [ ] No test file exercises more than the all-on/all-off combination when 3+ flags interact — `search_code` for the flags near test setup/mocking; an absence here is worth naming even though it caps at Medium as an absence-only finding.
41
+
42
+ ## Partially-shipped features
43
+
44
+ - [ ] A flag gating only one half of a feature — e.g. the new UI is behind the flag but the backend change it depends on shipped unconditionally (or vice versa). If the flag is ever flipped off after being on, the half that shipped unconditionally is now orphaned with no way back. Cross-reference `flow-integrity.md`'s half-wired-feature table — the pairing check there is the same shape, this module just adds "…and is one of the halves actually reachable only via a flag."
45
+
46
+ ## Evaluated at load time instead of call time
47
+
48
+ - [ ] `search_code` the accessor call site's context: if it's assigned to a module-level constant or read once during initialization/startup rather than inside the function that uses it, the value is frozen for the process lifetime. This defeats runtime flag flips (kill switches, gradual rollouts) — the deployment has to restart before the new value takes effect, and nobody watching the dashboard toggle would know that.
49
+ - [ ] Where the SDK call itself takes an inline default (`isEnabled('x', { default: true })`), diff that inline default against the value declared in the registry's own default. Two different fallback values mean the flag has two different "off" states depending on whether the call reaches the provider or falls back locally — and the local one only fires exactly when the provider is unreachable, the least-tested path.
50
+ - [ ] Percentage-rollout or user-targeting logic computed by hand in application code (a modulo on a user ID, a locally seeded random) instead of deferred to the flag provider. Hand-rolled bucketing commonly re-randomizes on each evaluation rather than being stable per user, producing a flag that flips on and off for the same person across page loads — read the bucketing function for whether its input is stable.
51
+
52
+ ## Kill switches that don't actually kill anything
53
+
54
+ - [ ] For any flag named or documented as a kill switch / circuit breaker, `trace_path` from the flag read to the work it's meant to stop. A kill switch that only suppresses a UI element while the backend job it was meant to halt keeps running (or vice versa) fails exactly when someone needs it most — during an incident, under pressure, trusting that flipping it worked.
55
+
56
+ ## Vendor lock-in via a split evaluation surface
57
+
58
+ - [ ] If an OpenFeature SDK is present — `search_code` for `@openfeature/`, `openfeature-sdk`, or a `getProvider`/`OpenFeatureClient` call (the spec is at v0.9.0, CNCF Incubating, with provider support from LaunchDarkly, Flagsmith, Unleash, Split, and others) — confirm application code evaluates flags through it consistently, rather than mixing it with direct calls to the underlying vendor SDK. `search_code` for a vendor-specific import (a LaunchDarkly or Unleash client package, say) used for flag reads alongside `@openfeature/*` in the same codebase. A split surface means half the flags can't move to another provider without an application-code rewrite, which defeats the reason to adopt the standard. Absence of OpenFeature entirely is not itself a finding — the spec is still pre-1.0 and plenty of mature flag setups predate or bypass it.
59
+
60
+ ## Security- and billing-relevant flags — stricter bar
61
+
62
+ - [ ] Any flag gating an authorisation decision, a paywall, a rate limit, or a pricing/billing calculation gets every check above applied without the usual benefit of the doubt: no owner/expiry is a **High** here, not the usual Low-severity noise finding, because a forgotten flag on this class of code is either a security hole (auth bypass left on) or a revenue leak (paywall left off) rather than a housekeeping annoyance.
63
+
64
+ ## Out of static reach
65
+
66
+ - The actual value a flag holds in a live environment dashboard not checked into the repo.
67
+ - Rollout percentages and targeting rules configured only in a third-party provider's UI.
68
+ - Whether a flag's owner, if recorded, is still at the organisation or the ticket still open.
69
+ - Runtime evaluation order when multiple flag providers or a fallback chain is involved.
70
+ - Whether an OpenFeature provider abstraction is actually load-bearing — this module can confirm the call sites are consistent, not that a provider swap has ever been exercised.
71
+
72
+ ## Severity guidance
73
+
74
+ | Situation | Severity |
75
+ |---|---|
76
+ | Flag read with no matching declaration (typo'd key, silent default) | High (Critical if security/billing) |
77
+ | Kill switch that doesn't stop the work it claims to | Critical |
78
+ | Client-only or server-only half of a security/billing flag | High |
79
+ | Flag evaluated at load time, defeating a runtime kill switch | High |
80
+ | No owner/expiry on a security- or billing-relevant flag | High |
81
+ | No expiry on a Release or Experiment toggle past its expected short lifespan | Medium |
82
+ | Permanently off flag blocking an otherwise-complete feature | Medium |
83
+ | Permanently on flag with the old branch still present (dead code) | Medium |
84
+ | Untested flag combination, structurally reachable | Medium |
85
+ | No owner/expiry on an Ops or Permissioning flag (owner still expected, expiry may not be) | Low |
86
+ | Flag evaluation split between OpenFeature and a direct vendor SDK call | Low |
87
+ | Declared flag with zero readers | Low |
@@ -6,56 +6,81 @@ Trace each flow end to end with `trace_path` from the entry point (button, comma
6
6
 
7
7
  ## Orphan UI
8
8
 
9
- - [ ] Handlers wired to nothing: `onClick={() => {}}`, `onSubmit` with an empty body, `href="#"`, `TODO` / `FIXME` inside a handler.
10
- - [ ] Buttons and menu items whose handler navigates to a route that does not exist, or opens a modal never rendered.
11
- - [ ] Forms whose submit handler validates and then returns without calling anything.
12
- - [ ] Controls disabled unconditionally, or rendered behind a condition that is never true.
13
- - [ ] Keyboard shortcuts and context-menu entries registered but bound to no action.
9
+ - [ ] Handlers wired to nothing — `search_code` for the literal patterns `onClick={() => {}}`, `onSubmit={() => {}}`, `href="#"`, and `TODO`/`FIXME` co-located with a handler name. Read the surrounding component before reporting, to rule out a deliberately no-op control (a disabled preview, a placeholder in an unreleased section).
10
+ - [ ] Buttons and menu items whose handler navigates to a route that does not exist, or opens a modal never rendered — `search_code` the route or path string passed to the navigation call, then `find_symbol` for a matching route definition; for a modal, `find_callers` on its render to confirm something actually mounts it.
11
+ - [ ] Forms whose submit handler validates and then returns without calling anything — `find_callees` on the submit handler. A call list that ends at the validator with no request or dispatch call after it is the finding.
12
+ - [ ] Controls disabled unconditionally, or rendered behind a condition that is never true — `search_code` for `disabled={true}` or `disabled` as a bare boolean literal, and read the guarding condition for a constant that can never evaluate true.
13
+ - [ ] Keyboard shortcuts and context-menu entries registered but bound to no action — `search_code` the shortcut-registration call (`useHotkeys`, `addEventListener('keydown'`, a context-menu config array), then `find_callees` on the bound callback.
14
14
 
15
15
  ## Flows with no terminal state
16
16
 
17
17
  For every flow the user can start, confirm it can end:
18
18
 
19
- - [ ] **Submit into the void** — the request fires and nothing consumes the response.
20
- - [ ] **Success with no feedback** — the operation succeeds and the UI never says so. The user retries; now you have a duplicate-write bug.
21
- - [ ] **Unhandled error path** — `catch` that swallows, `.catch(() => {})`, an error state the UI cannot render.
22
- - [ ] **No cancel / no back** — a multi-step flow the user cannot exit without losing everything.
23
- - [ ] **No timeout** — an in-flight operation that can hang forever with the UI stuck in loading.
24
- - [ ] **Missing confirmation on destructive actions** — delete/overwrite/reset with no interstitial.
19
+ - [ ] **Submit into the void** — `trace_path` from the request-firing call to any consumer of its response or promise. No path found is the finding.
20
+ - [ ] **Success with no feedback** — `find_callees` on the success branch (`.then`, `onSuccess`); no call to a toast, notification, or state-update function after the write means success is silent. The user retries; now you have a duplicate-write bug.
21
+ - [ ] **Unhandled error path** — `search_code` for `catch {}`, `.catch(() => {})`, and a `catch` block that only logs — an error state the UI cannot render.
22
+ - [ ] **No cancel / no back** — read the multi-step flow's component tree for a cancel or back handler; its absence alongside a wizard/stepper component is the finding.
23
+ - [ ] **No timeout** — `search_code` the request call (`fetch(`, the HTTP client instance) and confirm a timeout or abort-controller is attached. None found means the UI can hang in loading indefinitely.
24
+ - [ ] **Missing confirmation on destructive actions** — `search_code` the delete/reset/overwrite handler, then `find_callees` to confirm a confirmation-dialog component is invoked *before* the mutating call, not merely rendered somewhere else in the tree.
25
25
 
26
26
  ## Half-wired features
27
27
 
28
- Each of these is a pair where only one half exists. Prove the counterpart with `find_callers` / `trace_path`, not by eyeballing directory names.
29
-
30
- | One half exists | Missing counterpart | Typical severity |
31
- |---|---|---|
32
- | Backend endpoint | No UI or client calls it | Medium |
33
- | UI component | No backend to serve it | High |
34
- | Migration creates a column | No code ever reads or writes it | Low → Medium |
35
- | Code reads a column | No migration creates it | Critical |
36
- | Event emitted | No listener subscribed | Medium |
37
- | Listener subscribed | No emitter | Low |
38
- | Job enqueued | No worker consumes that queue | High |
39
- | Worker consuming a queue | Nothing ever enqueues to it | Medium |
40
- | Config option accepted | No code branches on it | Low |
41
- | Webhook receiver | Never registered with the provider | High |
28
+ Each of these is a pair where only one half exists. Prove the counterpart with the paired calls below, not by eyeballing directory names.
29
+
30
+ | One half exists | Missing counterpart | Probe | Typical severity |
31
+ |---|---|---|---|
32
+ | Backend endpoint | No UI or client calls it | `search_code` the route path in client code; `find_callers` on the handler | Medium |
33
+ | UI component | No backend to serve it | `find_callees` on the component's submit/fetch call; `search_code` the target path server-side | High |
34
+ | Migration creates a column | No code ever reads or writes it | `search_code` the column name across query and model code | Low → Medium |
35
+ | Code reads a column | No migration creates it | `search_code` the column name across every migration file | Critical |
36
+ | Event emitted | No listener subscribed | `find_callers` on the emit call; `search_code` the event name in subscription code | Medium |
37
+ | Listener subscribed | No emitter | `search_code` the event name for any `.emit(`/`dispatch(` call site | Low |
38
+ | Job enqueued | No worker consumes that queue | `search_code` the queue name in worker registration | High |
39
+ | Worker consuming a queue | Nothing ever enqueues to it | `search_code` the queue name at every enqueue call site | Medium |
40
+ | Config option accepted | No code branches on it | `find_callers` on the config field access | Low |
41
+ | Webhook receiver | Never registered with the provider | `search_code` the webhook URL/path in provider setup, deploy config, or admin notes | High |
42
42
 
43
43
  ## The loading / empty / error triad
44
44
 
45
45
  Every view that fetches data needs three states beyond the happy path. Missing any one is a real defect, not polish.
46
46
 
47
- - [ ] **Loading** — is there an indicator, or does the screen sit blank while the request is in flight?
48
- - [ ] **Empty** — zero results renders as deliberate empty state, not as a broken-looking blank list or a crash on `data[0]`.
49
- - [ ] **Error** — the failure renders something actionable, with a retry where retrying is meaningful.
50
- - [ ] The three states are mutually exclusive and reachable — no combination that renders both a spinner and an empty state.
47
+ - [ ] **Loading** — `search_code` the fetch/query hook usage (`useQuery`, `isLoading`) in the view and read the render for a loading branch; its absence means the screen sits blank while the request is in flight.
48
+ - [ ] **Empty** — `search_code` the render of the list/collection and confirm a zero-length branch exists before the item map; a bare `.map()` with no guard renders a broken-looking blank list or crashes on `data[0]`.
49
+ - [ ] **Error** — `search_code` the same hook's error state (`isError`, `error`) and confirm it renders an actionable message with a retry where retrying is meaningful, not just a console log.
50
+ - [ ] The three states are mutually exclusive and reachable — read the conditional rendering order; overlapping conditions (an `isLoading` check that doesn't exclude `isEmpty`) let two states render at once.
51
51
 
52
52
  ## Cross-cutting
53
53
 
54
- - [ ] Optimistic updates have a rollback path when the request fails.
55
- - [ ] Multi-step flows survive a page reload, or explicitly warn before losing progress.
56
- - [ ] Every flow that writes has a corresponding way to read the result back.
57
- - [ ] Authenticated flows handle session expiry mid-flow rather than failing at the final step.
54
+ - [ ] Optimistic updates have a rollback path when the request fails — `find_callees` on the optimistic-update function; the error branch needs a rollback/revert call, not just a log.
55
+ - [ ] Multi-step flows survive a page reload, or explicitly warn before losing progress — `search_code` for persisted step state (`sessionStorage`, `localStorage`, a URL param) or a `beforeunload` handler. Absence of both is the finding.
56
+ - [ ] Every flow that writes has a corresponding way to read the result back — `search_code` a GET/query counterpart to each mutating endpoint or dispatch.
57
+ - [ ] Authenticated flows handle session expiry mid-flow rather than failing at the final step — `search_code` for a 401/expired-session interceptor and confirm it is wired into the same client used by long-running flows, not only the initial page load.
58
+
59
+ ## Out of static reach
60
+
61
+ - Whether the loading/error UI actually renders correctly at runtime — this module proves the branch exists, not that it looks right or fires in time.
62
+ - Timing-dependent races between an optimistic update and the server's real response under real network latency.
63
+ - Whether a confirmation dialog is easy to dismiss accidentally, or whether users read it before clicking through.
64
+ - Session-expiry handling that depends on server-side token lifetimes not visible from source.
65
+ - Whether an event with no in-repo listener is consumed by a downstream service, browser extension, or webhook subscriber outside this repo.
58
66
 
59
67
  ## Reporting
60
68
 
61
69
  Report each broken flow as a path, not a symptom: `entry point (file:line) → … → dead end (file:line)`. State which step is missing and what the user experiences when they hit it. That is the difference between "this looks unfinished" and a finding someone can fix.
70
+
71
+ ## Severity guidance
72
+
73
+ | Situation | Severity |
74
+ |---|---|
75
+ | Client calls an endpoint that does not exist, or code reads a column no migration creates | Critical |
76
+ | UI component with no backend to serve it | High |
77
+ | Webhook receiver never registered with the provider | High |
78
+ | Job enqueued with no worker consuming the queue | High |
79
+ | Unhandled error path swallowed silently | High |
80
+ | Success with no feedback, risking a duplicate-write retry | Medium |
81
+ | Missing loading, empty, or error state on a data view | Medium |
82
+ | Handler wired to nothing (orphan UI) | Medium |
83
+ | Backend endpoint with no caller | Medium |
84
+ | Optimistic update with no rollback path | Medium |
85
+ | Config option accepted but nothing branches on it | Low |
86
+ | Listener subscribed with no emitter | Low |