project-brain 0.24.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +6 -6
- package/templates/project.claude.md +1 -1
- package/templates/skills/brain-audit/SKILL.md +17 -7
- package/templates/skills/brain-audit/references/abuse.md +36 -11
- package/templates/skills/brain-audit/references/accessibility.md +50 -22
- package/templates/skills/brain-audit/references/ai.md +39 -15
- package/templates/skills/brain-audit/references/analytics.md +34 -11
- package/templates/skills/brain-audit/references/api.md +38 -13
- package/templates/skills/brain-audit/references/backend.md +41 -9
- package/templates/skills/brain-audit/references/browser.md +146 -0
- package/templates/skills/brain-audit/references/complexity.md +22 -12
- package/templates/skills/brain-audit/references/concurrency.md +36 -18
- package/templates/skills/brain-audit/references/consistency.md +32 -9
- package/templates/skills/brain-audit/references/contract-drift.md +34 -16
- package/templates/skills/brain-audit/references/cost.md +45 -23
- package/templates/skills/brain-audit/references/cross-surface-parity.md +38 -11
- package/templates/skills/brain-audit/references/database.md +43 -17
- package/templates/skills/brain-audit/references/dependencies-licensing.md +27 -12
- package/templates/skills/brain-audit/references/design-system.md +40 -17
- package/templates/skills/brain-audit/references/devops.md +32 -17
- package/templates/skills/brain-audit/references/documentation.md +38 -16
- package/templates/skills/brain-audit/references/failure.md +40 -18
- package/templates/skills/brain-audit/references/feature-flags.md +31 -15
- package/templates/skills/brain-audit/references/flow-integrity.md +42 -10
- package/templates/skills/brain-audit/references/frontend.md +40 -12
- package/templates/skills/brain-audit/references/functional.md +31 -11
- package/templates/skills/brain-audit/references/future.md +28 -7
- package/templates/skills/brain-audit/references/goal.md +15 -6
- package/templates/skills/brain-audit/references/i18n.md +30 -8
- package/templates/skills/brain-audit/references/idempotency.md +46 -24
- package/templates/skills/brain-audit/references/infrastructure.md +43 -13
- package/templates/skills/brain-audit/references/mobile.md +37 -15
- package/templates/skills/brain-audit/references/multi-tenancy.md +41 -12
- package/templates/skills/brain-audit/references/numeric.md +33 -16
- package/templates/skills/brain-audit/references/observability.md +43 -19
- package/templates/skills/brain-audit/references/packaging.md +39 -13
- package/templates/skills/brain-audit/references/performance.md +43 -13
- package/templates/skills/brain-audit/references/privacy.md +38 -15
- package/templates/skills/brain-audit/references/product.md +29 -10
- package/templates/skills/brain-audit/references/prompt-spec-gap.md +34 -10
- package/templates/skills/brain-audit/references/reachability.md +38 -18
- package/templates/skills/brain-audit/references/repo-history.md +23 -16
- package/templates/skills/brain-audit/references/runtime.md +48 -10
- package/templates/skills/brain-audit/references/scalability.md +37 -10
- package/templates/skills/brain-audit/references/security.md +46 -22
- package/templates/skills/brain-audit/references/state-model.md +44 -15
- package/templates/skills/brain-audit/references/supply-chain.md +42 -13
- package/templates/skills/brain-audit/references/temporal.md +37 -14
- package/templates/skills/brain-audit/references/testing.md +38 -14
- package/templates/skills/brain-audit/references/tooling-baseline.md +34 -18
- package/templates/skills/brain-audit/references/type-safety.md +38 -19
- package/templates/skills/brain-audit/references/usability.md +78 -0
- package/templates/skills/brain-audit/references/versioning-compatibility.md +34 -12
- package/templates/skills/brain-audit/references/visual-design.md +38 -12
- package/templates/skills/brain-audit/references/web-metadata.md +47 -19
- package/templates/skills/brain-record/SKILL.md +297 -0
- package/templates/skills/brain-record/assets/build-video.sh +142 -0
- package/templates/skills/brain-record/assets/record.mjs +283 -0
- package/templates/skills/brain-record/references/pitfalls.md +233 -0
- package/templates/skills/brain-worktree/SKILL.md +103 -0
|
@@ -6,16 +6,23 @@ Does what ships match what was built? Gate: a published package manifest or a re
|
|
|
6
6
|
|
|
7
7
|
## What is in the artefact
|
|
8
8
|
|
|
9
|
-
- [ ] Enumerate the include list (`files` in `package.json`, `include`/`MANIFEST.in`, build output config) and compare it against what the code loads at runtime. `search_code` for `readFile`/`require(`/`import(` targeting a relative path, then confirm each target sits inside the include list. **Anything read at runtime but absent from the include list ships to nobody.**
|
|
9
|
+
- [ ] Enumerate the include list (`files` in `package.json`, `include`/`MANIFEST.in`, build output config) and compare it against what the code loads at runtime. `search_code` for `readFile`/`require(`/`import(` targeting a relative path, then confirm each target sits inside the include list. **Anything read at runtime but absent from the include list ships to nobody.** Rule out a call site reached only from a build/dev script, not from the shipped entry point — confirm with `find_callers` back to a declared entry point. This is `High` at `read`; `trace_path`/`find_callers` from the declared entry point to the load call, confirming the load path is actually reachable at runtime, promotes this to `traced`, and `Critical`. `files` defaults to `["*"]`, and `package.json`/`README`/`LICENSE`/the `main` file/`bin` files are always included regardless of it (npm, Inc., official npm CLI documentation, current, https://docs.npmjs.com/cli/v10/configuring-npm/package-json); on the Python side, setuptools auto-includes module files, `tests/test*.py`, and declared `package-data`/`data-files` into the sdist without a `MANIFEST.in` (Python Packaging Authority / setuptools, official setuptools user guide, current, https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html).
|
|
10
10
|
- [ ] The inverse: files shipped that need not be — tests, fixtures, source maps in production, `.env` samples with real values, internal docs. Read the include list and `search_code` for `*.test.*`, `fixtures/`, `.map`, `.env.example` patterns it matches — each hit is bloat, and a `.env` sample with a real-looking value is a leak.
|
|
11
|
-
- [ ]
|
|
12
|
-
- [ ]
|
|
11
|
+
- [ ] For a Python project, `search_code` for `package-data`/`include_package_data`/`MANIFEST.in` entries referencing a non-`.py` asset (template, schema, migration file) loaded at runtime, then `Read` its declared path: a path outside the installed package's own directory tree is included in the sdist by setuptools' default rules but silently absent from the built wheel — the exact artefact most installs actually consume. Setuptools' own docs: "only files inside the package directory are included in the final wheel, by default" (Python Packaging Authority / setuptools, official setuptools user guide, current, https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html). Refuted if the asset is generated at build time into a location inside the package directory (confirm via the build backend's config) rather than shipped as a static file outside it — that path is fine even though the source-tree location looks external.
|
|
12
|
+
- [ ] Entry points declared in the manifest (`main`, `module`, `exports`, `bin`) exist in the built artefact at those exact paths. Read the manifest's entry fields, then confirm the build output config (`tsconfig`'s `outDir`, the bundler config) actually writes a file to each declared path. `main` defaults to `index.js` when unset, and `exports` — where present — prevents any entry point besides those it explicitly defines (npm, Inc., official npm CLI documentation, current, https://docs.npmjs.com/cli/v10/configuring-npm/package-json; Node.js project, official Node.js API documentation, current, https://nodejs.org/api/packages.html).
|
|
13
|
+
- [ ] Binaries and executables declared are present and executable. Read the manifest's `bin` field, then confirm the target file exists and the build step does not skip generating it. (npm, Inc., official npm CLI documentation, current, https://docs.npmjs.com/cli/v10/configuring-npm/package-json.)
|
|
14
|
+
- [ ] For each file the manifest's `bin` field points to, `Read` its first line: a missing or malformed shebang (not exactly `#!/usr/bin/env node` for a Node CLI) means the file "starts without the node executable" when npm's bin-symlink mechanism invokes it directly (npm, Inc., official npm CLI documentation, current, https://docs.npmjs.com/cli/v10/configuring-npm/package-json) — present and executable in the filesystem sense, but broken as an actual CLI entry point. Refuted if a `bin` target that is itself a thin wrapper invoked only via an npm script (`"scripts": {"cli": "node ./bin/cli.js"}`) rather than the `bin` field's own symlink mechanism does not need a shebang — confirm the file is actually reached through `bin`, not just co-located with it.
|
|
15
|
+
|
|
16
|
+
## Exports resolution
|
|
17
|
+
|
|
18
|
+
- [ ] Where `exports` declares both `import` and `require` conditions (or nested `types`/`node`/`default` conditions), `search_code` the target file each condition points to and read it: a `require` condition pointing at a file that is itself ESM syntax, or an `import` condition pointing at a `.cjs`/CommonJS file, resolves to the wrong module system for that consumer and throws or silently returns the wrong shape at runtime. Introducing `exports` on a package that previously had none is itself a breaking change for any consumer using a subpath Node no longer recognises — "all subpaths of the package are encapsulated" once `exports` is defined, and `import`/`require` conditions are "always mutually exclusive" (Node.js project, official Node.js API documentation, current, https://nodejs.org/api/packages.html). This is a recurring real-world defect class, not a hypothetical: arethetypeswrong names "Masquerading as CJS" and "Masquerading as ESM" as its own taxonomy entries for exactly this mismatch (arethetypeswrong project, open-source tool, current, https://raw.githubusercontent.com/arethetypeswrong/arethetypeswrong.github.io/main/README.md). Refuted if a `require` condition points at a file with a `.js` extension inside a `"type": "commonjs"` package — check the nearest `package.json`'s `type` field, not just the file extension, before flagging; a `.cjs`-extension file that contains ESM-only syntax by mistake is the real defect.
|
|
19
|
+
- [ ] For a TypeScript-authored package, confirm the `types` entry (top-level `types`/`typings` field, or the `types` condition inside each `exports` subpath) points to a declaration file that actually describes the module format that condition resolves to. `search_code` the `exports` map and `Read` the referenced `.d.ts`/`.d.cts`/`.d.mts` files; a `.d.ts` shared across both `import` and `require` conditions when the two resolve to differently-shaped modules (default export vs. `export =`) reports a type shape at compile time that does not match what the consumer actually receives at runtime. arethetypeswrong's own defect taxonomy names "No types", "Missing `export =`", and "Named exports" resolution mismatches as recurring, real published-package defects of exactly this shape (arethetypeswrong project, open-source tool, current, https://raw.githubusercontent.com/arethetypeswrong/arethetypeswrong.github.io/main/README.md). Refuted if a shared `.d.ts` is correct because both the ESM and CJS builds are genuinely interchangeable (e.g. both re-export the same named exports with no default-export divergence) — confirm by reading both built outputs, not just assuming divergence from the file count alone.
|
|
13
20
|
|
|
14
21
|
## Path assumptions
|
|
15
22
|
|
|
16
|
-
- [ ] No runtime code resolves a path relative to the source tree. `search_code` for `__dirname`, `import.meta.url`, or a relative `../` path adjacent to a `readFile`/asset-load call, then confirm the target stays inside the include list above rather than reaching into `src/` structure that packaging flattens or excludes.
|
|
17
|
-
- [ ] Assets needed at runtime are embedded at build time or explicitly shipped and located by a mechanism that survives packaging. `search_code` for a template/schema/WASM file loaded at runtime, then confirm the build config copies or embeds it — absence from both the include list and an embed step means it is missing the moment the source tree is gone.
|
|
18
|
-
- [ ] Where the project ships a compiled/bundled binary, verify the embedding actually happened rather than trusting it. Read the build script/bundler config for the embed step, then confirm the built output actually contains the asset — its declared size, or a reference to it in the bundle — rather than trusting the config exists. **This is the single highest-value check in the module.**
|
|
23
|
+
- [ ] No runtime code resolves a path relative to the source tree. `search_code` for `__dirname`, `import.meta.url`, or a relative `../` path adjacent to a `readFile`/asset-load call, then confirm the target stays inside the include list above rather than reaching into `src/` structure that packaging flattens or excludes. This is `High` at `read`; `trace_path`/`find_callers` from the declared entry point to this call site, confirming it is actually reachable at runtime, promotes this to `traced`, and `Critical`. A compiled/bundled binary makes this concrete: Bun's `--compile` "replaces the import with an internal path" under `/$bunfs/`, so a dev-time path hardcoded or logged will not find the asset post-compile (Bun (Oven), official Bun documentation, current, https://bun.sh/docs/bundler/executables).
|
|
24
|
+
- [ ] Assets needed at runtime are embedded at build time or explicitly shipped and located by a mechanism that survives packaging. `search_code` for a template/schema/WASM file loaded at runtime, then confirm the build config copies or embeds it — absence from both the include list and an embed step means it is missing the moment the source tree is gone. (Bun (Oven), official Bun documentation, current, https://bun.sh/docs/bundler/executables — `--asset` embeds whole directories but skips symlinks and empty subdirectories.)
|
|
25
|
+
- [ ] Where the project ships a compiled/bundled binary, verify the embedding actually happened rather than trusting it. Read the build script/bundler config for the embed step, then confirm the built output actually contains the asset — its declared size, or a reference to it in the bundle — rather than trusting the config exists. **This is the single highest-value check in the module.** (Bun (Oven), official Bun documentation, current, https://bun.sh/docs/bundler/executables — `Bun.embeddedFiles` deliberately excludes bundled source, and an embedded SQLite database's writes are lost on exit since it stays in-memory.)
|
|
19
26
|
|
|
20
27
|
## Install-time verification
|
|
21
28
|
|
|
@@ -25,36 +32,55 @@ Does what ships match what was built? Gate: a published package manifest or a re
|
|
|
25
32
|
|
|
26
33
|
## Metadata
|
|
27
34
|
|
|
28
|
-
- [ ] Version, license, repository, and description are present and accurate. Read the manifest's `version`, `license`, `repository`, `description` fields and confirm the license field matches the actual `LICENSE` file in the repository root.
|
|
29
|
-
- [ ] Declared runtime/engine requirements match what the code actually uses. Read the manifest's `engines`/`requires-python` field, then `search_code` for a language feature (optional chaining, a specific stdlib call) whose minimum version exceeds the declared floor.
|
|
30
|
-
- [ ]
|
|
35
|
+
- [ ] Version, license, repository, and description are present and accurate. Read the manifest's `version`, `license`, `repository`, `description` fields and confirm the license field matches the actual `LICENSE` file in the repository root. Under PEP 639, `license` is expected to be "a valid SPDX license expression" (Python Packaging Authority, official Python Packaging User Guide, current, https://packaging.python.org/en/latest/guides/writing-pyproject-toml/).
|
|
36
|
+
- [ ] Declared runtime/engine requirements match what the code actually uses. Read the manifest's `engines`/`requires-python` field, then `search_code` for a language feature (optional chaining, a specific stdlib call) whose minimum version exceeds the declared floor. Chalk 5.0.0 is a real, citable precedent for tying an `engines`/module-format floor raise to a major version rather than a silent minor/patch (Sindre Sorhus, GitHub release notes, 2022, https://github.com/chalk/chalk/releases/tag/v5.0.0).
|
|
37
|
+
- [ ] When the manifest's `type` field changes to `"module"`, or the `engines`/`requires-python` floor is raised, `Read` the CHANGELOG (or release notes) for that version and confirm the version bump is MAJOR, not minor/patch — a floor raise or a CJS→ESM-only switch breaks any consumer below the new floor, and SemVer reserves MAJOR for exactly this: "Major version X... MUST be incremented if any backward incompatible changes are introduced to the public API" (Tom Preston-Werner et al., official specification, 2013 (v2.0.0), https://semver.org/). Chalk 5.0.0 is a real, named precedent: pure ESM plus a raised Node.js/TypeScript floor shipped as a major version, with the maintainer explicitly telling users who cannot take the break to stay on the previous major (Sindre Sorhus, GitHub release notes, 2022, https://github.com/chalk/chalk/releases/tag/v5.0.0). Refuted if the project is on a documented `0.x` SemVer-exempt policy, or states pre-1.0 minor bumps may break compatibility — check the manifest's major version and any stated versioning policy before flagging.
|
|
38
|
+
- [ ] Dependencies are in the right section — nothing needed at runtime sits in dev dependencies. Read `dependencies` vs `devDependencies` in the manifest, then `search_code` each `devDependencies` entry's import inside runtime (non-test, non-build-script) source files. A hit there fails only for consumers, never in the repository, which is exactly why CI misses it. Rule out a type-only import that compiles away — read whether the import is `import type`/erased, not just whether the specifier appears. This is `packaging.md`'s manifest-shape angle; `dependencies-licensing.md` owns the general dependency-hygiene sweep — run once, cite in whichever module ran first.
|
|
31
39
|
- [ ] Peer dependencies and optional dependencies are declared deliberately. Read the manifest's `peerDependencies`/`optionalDependencies`, then `search_code` confirming each is imported conditionally rather than assumed always-present.
|
|
32
40
|
|
|
33
41
|
## Release process
|
|
34
42
|
|
|
35
|
-
- [ ] Publishing is automated from a tagged commit, not run from a laptop. `search_code` the CI workflow for a `publish`/`release` job triggered on a tag push, and confirm no local publish script exists that a developer would run with real credentials. This is also the precondition for `npm publish --provenance` or GitHub Attestations to mean anything — cross-reference `supply-chain.md`'s provenance check
|
|
43
|
+
- [ ] Publishing is automated from a tagged commit, not run from a laptop. `search_code` the CI workflow for a `publish`/`release` job triggered on a tag push, and confirm no local publish script exists that a developer would run with real credentials. This is also the precondition for `npm publish --provenance` or GitHub Attestations to mean anything — cross-reference `supply-chain.md`'s provenance check. `npm publish --provenance` invoked outside a supported CI/CD provider does not degrade to a laptop-rooted attestation — Sigstore's keyless signing needs an OIDC token only a recognized cloud CI provider issues, so a laptop run fails to produce a valid attestation at all (npm, Inc., official npm documentation, current, https://docs.npmjs.com/generating-provenance-statements). The actual risk this check should look for is a *compromised or misconfigured CI environment* producing a technically-valid attestation nobody should trust, not a developer quietly self-signing from a laptop.
|
|
44
|
+
- [ ] Where the release workflow passes `npm publish --provenance` (or relies on trusted publishing), `search_code` the CI workflow file for the specific provider Sigstore requires (GitHub Actions with `id-token: write` permission on a GitHub-hosted runner, or GitLab CI/CD) rather than treating the presence of the flag alone as sufficient — a self-hosted runner or an unsupported CI provider cannot produce a valid Sigstore identity even if the publish command includes the flag (npm, Inc., official npm documentation, current, https://docs.npmjs.com/generating-provenance-statements). Refuted if the project deliberately does not use `--provenance` at all (it is optional, not mandated by npm) — this check applies only when the flag or trusted publishing is already declared.
|
|
36
45
|
- [ ] The published version corresponds to a commit that exists and is tagged. Read the release workflow for a step that tags the commit before or as part of publish, rather than publishing from an arbitrary branch head.
|
|
37
46
|
- [ ] Nothing can publish from a dirty tree. Read the release workflow/publish script for a `git status --porcelain`/clean-tree check gating the publish step.
|
|
38
47
|
- [ ] Multi-platform artefacts are built for every platform claimed as supported, not only the maintainer's. Read the manifest's `os`/`cpu`/platform-support fields, then confirm the release workflow's build matrix covers each one.
|
|
39
48
|
|
|
49
|
+
## What browser observation closes
|
|
50
|
+
|
|
51
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number. This module gains almost nothing from the browser bundle: packaging is a question about a manifest, a tarball, and a release pipeline, none of which a browser tool ever touches — `browser.md` drives a running page, it never packs, installs, or inspects a registry artefact. The one row below applies only in the narrow, caveated case where the audited project is itself the web app `browser.md` drove.
|
|
52
|
+
|
|
53
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `resource-perf.md` (network transfer sizes) — only when the audited project is the web app `browser.md` drove, not a library published for other consumers to install | Bytes actually served to a real browser vs. the package's declared bundle output. Not applicable when packaging.md is auditing a library/CLI package: `browser.md` never runs `npm install <tarball>`/`pip install <wheel>` against a registry artefact, so it cannot corroborate a published package's install size — only a locally-served dev/prod build's transfer size, which is a different artefact entirely. | Info |
|
|
56
|
+
|
|
40
57
|
## Out of static reach
|
|
41
58
|
|
|
42
|
-
- Whether the packed tarball actually installs cleanly on every supported platform and language/runtime version — this module confirms CI runs the check, not that it passes on hardware nobody tested.
|
|
59
|
+
- Whether the packed tarball actually installs cleanly on every supported platform and language/runtime version — this module confirms CI runs the check, not that it passes on hardware nobody tested — closed by `runtime.md` running the declared pack-and-install step when execution is enabled, for the current platform only; cross-platform and cross-package-manager coverage stays open.
|
|
43
60
|
- Real download/install size as experienced by a consumer, versus the include list's apparent scope.
|
|
44
61
|
- Registry-side behaviour (npm, PyPI) — deprecation warnings, dist-tag correctness, unpublish windows.
|
|
45
62
|
- Whether a credential used for publishing is scoped correctly — that lives in the registry/CI secret store, not in source.
|
|
46
63
|
- Actual first-run behaviour of the installed artefact on a machine with none of the developer's global tooling present.
|
|
64
|
+
- Whether the Sigstore/OIDC infrastructure a provenance attestation depends on is itself trustworthy at the moment of verification — this module confirms the workflow is configured to request one, not that the signing infrastructure behind it held.
|
|
65
|
+
- What the publisher's own local registry/auth configuration does at the moment of a manual or CI publish — this module reads the repository's declared configuration, not the publishing machine's actual environment.
|
|
66
|
+
- Whether a `workspace:*` (or similar monorepo-protocol) dependency specifier was correctly rewritten to a real version range in the published artefact — this module reads the source manifest, which never shows the rewritten value.
|
|
47
67
|
|
|
48
68
|
## Severity guidance
|
|
49
69
|
|
|
50
70
|
| Situation | Severity |
|
|
51
71
|
|---|---|
|
|
52
|
-
| Runtime-loaded file absent from the include list | Critical |
|
|
53
|
-
| Runtime path resolved relative to the source tree | Critical |
|
|
72
|
+
| Runtime-loaded file absent from the include list (traced) | Critical |
|
|
73
|
+
| Runtime path resolved relative to the source tree (traced) | Critical |
|
|
54
74
|
| Runtime dependency declared as a dev dependency | High |
|
|
55
75
|
| Secret or real credential shipped in the artefact | High |
|
|
56
76
|
| No verification of the artefact as a consumer would use it | High |
|
|
57
77
|
| Declared entry point missing from the artefact | High |
|
|
78
|
+
| `exports` condition points to a file whose actual module format (ESM/CJS) mismatches what that condition promises | High |
|
|
79
|
+
| Shared `.d.ts` type declaration describes a module shape that diverges from what the `import`/`require` condition actually serves | High |
|
|
80
|
+
| Python package-data asset lives outside the installed package directory, present in the sdist but absent from the wheel | High |
|
|
81
|
+
| Declared `bin` target missing or malformed shebang, unusable through npm's bin-symlink mechanism | High |
|
|
58
82
|
| Verification exists but does not run in CI | Medium |
|
|
83
|
+
| Module-format (`type: module`) or engine/runtime floor raised without a corresponding SemVer MAJOR bump | Medium |
|
|
84
|
+
| `--provenance`/trusted publishing declared but the CI provider running it is not one Sigstore recognizes | Medium |
|
|
59
85
|
| Tests and fixtures shipped to consumers | Low |
|
|
60
86
|
| Inaccurate engine or license metadata | Low |
|
|
@@ -20,11 +20,17 @@ A performance finding with no measurement behind it is `inferred` — a hypothes
|
|
|
20
20
|
|
|
21
21
|
## I/O
|
|
22
22
|
|
|
23
|
-
- [ ] Sequential awaits over independent operations:
|
|
23
|
+
- [ ] Sequential awaits over independent operations: `Read` the function body for consecutive `await` calls not wrapped in `Promise.all`/`allSettled`. Rule out a genuine data dependency — the second call needs the first's result — before flagging; if it does, this is correct code, not a defect.
|
|
24
24
|
- [ ] A query, file read, or network call inside a loop: `find_callees` on the loop body for a query/fetch/`readFile` call. Cross-reference `Database`'s N+1 check.
|
|
25
25
|
- [ ] Whole files or whole tables loaded to use part of them: `search_code` for `SELECT *` with no `LIMIT`/`WHERE` narrowing the row count, or a full-file read immediately followed by an in-memory filter.
|
|
26
26
|
- [ ] Missing pagination, streaming, or batching wherever the input can grow: `search_code` a route handler's query call for the absence of `LIMIT`/`OFFSET`/a cursor parameter.
|
|
27
|
-
- [ ]
|
|
27
|
+
- [ ] `JSON.stringify`/`JSON.parse` called on a payload with no declared size bound (no upstream `LIMIT`/pagination narrowing it) inside a request handler: `search_code` for the call, cross-referenced with the pagination check above. Earns no severity above `Low` on its own, per this module's own hot-path rule — anchor to a `repo_map` rank or a `find_callers` count showing high request volume before raising it. Refuted if the payload size is bounded by construction (a fixed-shape config object, not a query result) — state the bound. `JSON.stringify` on a 50MB object took 0.7 seconds and `JSON.parse` took 1.3 seconds in Node's own benchmark — the concrete number behind "large payload" (Node.js (OpenJS Foundation), "Don't Block the Event Loop" guide, current, https://nodejs.org/en/learn/asynchronous-work/dont-block-the-event-loop).
|
|
28
|
+
- [ ] Synchronous filesystem or crypto calls on a request path: `search_code` for `readFileSync`, `writeFileSync`, `execSync`, `*Sync(` inside a handler, then `find_callers` to confirm the handler is reached from a route rather than a CLI or build script — the same call is a non-issue in a one-shot script. Sync crypto (`randomBytes`, `pbkdf2Sync`), sync zlib, and sync fs all block the event loop the same way (Node.js (OpenJS Foundation), "Don't Block the Event Loop" guide, current, https://nodejs.org/en/learn/asynchronous-work/dont-block-the-event-loop).
|
|
29
|
+
- [ ] Extend the check above to `zlib`'s sync API (`inflateSync`/`deflateSync`/`gzipSync`/`gunzipSync`) and to nested-quantifier regex literals (patterns like `(.+)+`, `(.*)*`, `([a-zA-Z]+)*`) reachable from a request handler: `search_code` for the pattern, then `find_callers` to confirm the handler is reached from an HTTP route rather than a CLI or build script. Refuted if the regex only ever runs against a fixed, developer-authored string (never user input), or input length is bounded upstream (a max-length validator before the match) — either rules out the exponential-time case. Node's own docs name catastrophic-backtracking regex and sync zlib as event-loop-blocking hazards and explicitly frame the regex case as a Denial-of-Service vector, not just a slowness one ("a malicious client could submit this 'evil input', make your threads block" — Node.js (OpenJS Foundation), "Don't Block the Event Loop" guide, current, https://nodejs.org/en/learn/asynchronous-work/dont-block-the-event-loop).
|
|
30
|
+
|
|
31
|
+
## CPU-bound work
|
|
32
|
+
|
|
33
|
+
- [ ] CPU-intensive synchronous work (image/PDF processing, hashing loops, matrix or crypto computation) inside a request handler with no `worker_threads` import anywhere in the same module: `search_code` for the heavy computation call, then `find_callers` to confirm the handler is reached from a route, not a CLI/build script — the same code is a non-issue off the request path. Refuted if the computation is bounded to a size trivial enough that it never approaches the 50ms Long Task threshold — state the bound and why it holds; or the work already runs in a queue/worker process outside this codebase (a job runner, a separate service) that `find_callees` shows the handler only enqueues into. Workers "are useful for performing CPU-intensive JavaScript operations. They do not help much with I/O-intensive work" (Node.js (OpenJS Foundation), official API documentation, current, https://nodejs.org/api/worker_threads.html); a Long Task is main-thread work exceeding 50ms, and that is the number "expensive" means here (web.dev (Google), official vendor documentation, current, https://web.dev/articles/long-tasks-devtools).
|
|
28
34
|
|
|
29
35
|
## Memory
|
|
30
36
|
|
|
@@ -35,9 +41,11 @@ A performance finding with no measurement behind it is `inferred` — a hypothes
|
|
|
35
41
|
|
|
36
42
|
## Caching
|
|
37
43
|
|
|
38
|
-
- [ ] Every cache has a stated key, a stated lifetime, and an invalidation path: `search_code` the cache import (`lru-cache`, `node-cache`, a hand-rolled `Map`), then read the set/get sites for a TTL and an explicit invalidation call. A cache with no invalidation is a correctness bug wearing a performance costume.
|
|
44
|
+
- [ ] Every cache has a stated key, a stated lifetime, and an invalidation path: `search_code` the cache import (`lru-cache`, `node-cache`, a hand-rolled `Map`), then read the set/get sites for a TTL and an explicit invalidation call. A cache with no invalidation is a correctness bug wearing a performance costume. Rule out a content-addressed key (a hash of the cached value or an immutable source) — invalidation is meaningless when the key already changes whenever the value would. A cache "MUST invalidate the target URI when it receives a non-error status code in response to an unsafe request method" (IETF, RFC 9111 §4.4, 2022, https://www.rfc-editor.org/rfc/rfc9111.html).
|
|
45
|
+
- [ ] A PUT/PATCH/DELETE handler that mutates a resource with no invalidation call touching the same cache key(s) the matching GET handler populates: `search_code` the cache import (same search as the check above) for its `set`/`get` sites, then `find_callers` on the invalidation function to confirm no unsafe-method handler calls it. Refuted if the cache key is content-addressed (a hash of the value itself) so the old entry is simply never read again once the value changes — same refutation as the check above. This is the mutation-triggered half RFC 9111 §4.4 names explicitly: "a cache MUST invalidate the target URI when it receives a non-error status code in response to an unsafe request method" (IETF, RFC 9111, 2022, https://www.rfc-editor.org/rfc/rfc9111.html).
|
|
46
|
+
- [ ] A GET endpoint serving content that does not vary per request (a public listing, a computed report, a static asset route) with no `Cache-Control`, `Expires`, or equivalent freshness directive in the response: `search_code` for the route's response-header calls. Refuted if the endpoint's response legitimately varies per caller (personalised, includes a CSRF token, or reflects request-specific state) and must not be cached — state which. RFC 9111 §3's storable-response list ends with "or a status code that is defined as heuristically cacheable," so a 200 GET with no directive is not left uncached by default — a downstream cache is free to assign it a heuristic freshness lifetime under §4.2.2, one the origin never chose and cannot predict or invalidate on demand. The finding is that freshness is left to each cache's own heuristic instead of an explicit, origin-controlled directive, not that the response goes uncached (IETF, RFC 9111 §3/§4.2.2, 2022, https://www.rfc-editor.org/rfc/rfc9111.html).
|
|
39
47
|
- [ ] Cache keys include everything the value depends on: `find_symbol` the cached function's signature, then read the key expression — a parameter missing from the key means two distinct inputs collide on one cache entry and one of them gets served the wrong answer.
|
|
40
|
-
- [ ] Cached values that are cheap to compute:
|
|
48
|
+
- [ ] Cached values that are cheap to compute: `Read` the wrapped function — a single arithmetic expression or constant lookup means the cache costs more in complexity than it saves.
|
|
41
49
|
- [ ] Nothing caches a mutable object by reference and lets a caller mutate it: `find_callers` on the cache getter, then check whether any caller mutates the returned object in place.
|
|
42
50
|
|
|
43
51
|
## Startup
|
|
@@ -47,15 +55,15 @@ A performance finding with no measurement behind it is `inferred` — a hypothes
|
|
|
47
55
|
|
|
48
56
|
## Frontend rendering (Core Web Vitals)
|
|
49
57
|
|
|
50
|
-
Applies only when the project serves HTML to a browser — cross-reference the `Web Metadata` gate. Skip this section entirely, and say so, for a pure API/backend/CLI project. The current Core Web Vitals (Google, stable since March 2024) are LCP, INP, and CLS, each scored at the 75th percentile of real-user field data: LCP good ≤2.5s/poor >4.0s, INP good ≤200ms/poor >500ms, CLS good ≤0.1/poor >0.25. None of these are measurable statically — every check below is code shape, not a score.
|
|
58
|
+
Applies only when the project serves HTML to a browser — cross-reference the `Web Metadata` gate. Skip this section entirely, and say so, for a pure API/backend/CLI project. The current Core Web Vitals (Google, stable since March 2024) are LCP, INP, and CLS, each scored at the 75th percentile of real-user field data: LCP good ≤2.5s/poor >4.0s, INP good ≤200ms/poor >500ms, CLS good ≤0.1/poor >0.25. None of these are measurable statically — every check below is code shape, not a score. With `browser.md` enabled, `vitals.md` supplies a lab score per flow; see What browser observation closes.
|
|
51
59
|
|
|
52
|
-
- [ ] The LCP candidate is not blocked behind avoidable work: `search_code` for the hero image, video poster, or headline text that only renders after a client-side data fetch, with no SSR/prerender/static fallback ahead of it.
|
|
53
|
-
- [ ] The LCP candidate is sized and prioritised: `search_code` for that same element missing explicit `width`/`height` (or `aspect-ratio`), carrying `loading="lazy"` (which deprioritises exactly the element that must not be lazy), or lacking `fetchpriority="high"`/a preload hint.
|
|
54
|
-
- [ ] CLS-causing elements reserve their space: `search_code` for `<img>`/`<iframe>`/ad or embed slots with no `width`/`height`/`aspect-ratio`, and for content injected above existing content (a banner, a cookie notice, an async-loaded block) with no reserved slot.
|
|
55
|
-
- [ ] Web fonts do not cause layout shift on load:
|
|
56
|
-
- [ ] INP-risking work runs inside interaction handlers: reuse this module's own hot-path technique — `search_code` a click/input/keydown/submit handler for synchronous work that belongs off the main thread (a large synchronous loop, parsing a large payload, unbatched layout reads/writes).
|
|
57
|
-
- [ ] The project actually measures these in the field, not only assumes them from code shape: `search_code` for the `web-vitals` library import (or an equivalent RUM SDK reporting `LCP`/`INP`/`CLS`) wired to somewhere the numbers leave the browser (an analytics event, a beacon endpoint). Its absence means every check above is `inferred` against code shape only, with no field measurement anywhere — say so under Coverage Gaps rather than treating the absence itself as a performance defect.
|
|
58
|
-
- [ ] The codebase is not still optimising for a retired metric: `search_code` for `FID`/`first-input` tracked or referenced with no accompanying `INP`. FID (First Input Delay) was retired as a Core Web Vital on 12 March 2024, replaced by INP — code or a dashboard still keyed on FID alone is measuring a metric Google no longer scores.
|
|
60
|
+
- [ ] The LCP candidate is not blocked behind avoidable work: `search_code` for the hero image, video poster, or headline text that only renders after a client-side data fetch, with no SSR/prerender/static fallback ahead of it. Client-side-rendered content delays LCP because the LCP resource must be discoverable directly from HTML source, not from JS/CSS parsing (web.dev (Google), official vendor documentation, current, https://web.dev/articles/optimize-lcp).
|
|
61
|
+
- [ ] The LCP candidate is sized and prioritised: `search_code` for that same element missing explicit `width`/`height` (or `aspect-ratio`), carrying `loading="lazy"` (which deprioritises exactly the element that must not be lazy), or lacking `fetchpriority="high"`/a preload hint. "Never lazy-load your LCP image, as that will always lead to unnecessary resource load delay" (web.dev (Google), official vendor documentation, current, https://web.dev/articles/optimize-lcp).
|
|
62
|
+
- [ ] CLS-causing elements reserve their space: `search_code` for `<img>`/`<iframe>`/ad or embed slots with no `width`/`height`/`aspect-ratio`, and for content injected above existing content (a banner, a cookie notice, an async-loaded block) with no reserved slot. "The cause of layout shifts might be images or videos with unknown dimensions, fonts that render larger or smaller than its initial fallback, or third-party ads or widgets that dynamically resize themselves" (web.dev (Google), official vendor documentation, current, https://web.dev/articles/cls).
|
|
63
|
+
- [ ] Web fonts do not cause layout shift on load: `Read` the `@font-face`/font-loading config for `font-display` — its absence, or `font-display: block`, causes an invisible-text or swap-triggered reflow; `swap`/`optional` paired with a size-matched fallback is the fix already in place if present (MDN Web Docs (Mozilla), official reference documentation, current, https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display).
|
|
64
|
+
- [ ] INP-risking work runs inside interaction handlers: reuse this module's own hot-path technique — `search_code` a click/input/keydown/submit handler for synchronous work that belongs off the main thread (a large synchronous loop, parsing a large payload, unbatched layout reads/writes). "An input delay occurs until event handlers start running, possibly caused by factors such as long tasks on the main thread" (web.dev (Google), official vendor documentation, current, https://web.dev/articles/inp); a Long Task is main-thread work exceeding 50ms (web.dev (Google), official vendor documentation, current, https://web.dev/articles/long-tasks-devtools).
|
|
65
|
+
- [ ] The project actually measures these in the field, not only assumes them from code shape: `search_code` for the `web-vitals` library import (or an equivalent RUM SDK reporting `LCP`/`INP`/`CLS`) wired to somewhere the numbers leave the browser (an analytics event, a beacon endpoint). Its absence means every check above is `inferred` against code shape only, with no field measurement anywhere — say so under Coverage Gaps rather than treating the absence itself as a performance defect. Field measurement is "the primary way to evaluate these metrics" because performance "can substantially vary based on a user's device capabilities, their network conditions... and how they're interacting with the page" (web.dev (Google), official vendor documentation, current, https://web.dev/articles/vitals).
|
|
66
|
+
- [ ] The codebase is not still optimising for a retired metric: `search_code` for `FID`/`first-input` tracked or referenced with no accompanying `INP`. FID (First Input Delay) was retired as a Core Web Vital on 12 March 2024, replaced by INP — code or a dashboard still keyed on FID alone is measuring a metric Google no longer scores ("INP will officially become a Core Web Vital and replace FID on March 12" — web.dev (Google), official vendor blog, 2024, https://web.dev/blog/inp-cwv-march-12).
|
|
59
67
|
|
|
60
68
|
## Out of static reach
|
|
61
69
|
|
|
@@ -64,7 +72,24 @@ Applies only when the project serves HTML to a browser — cross-reference the `
|
|
|
64
72
|
- The crossover input size at which an O(n²) block becomes user-visible, on the actual hardware and dataset.
|
|
65
73
|
- GC pause behaviour and allocator churn under sustained load.
|
|
66
74
|
- Whether a cache actually reduces latency in production, versus merely existing in the code.
|
|
67
|
-
- Cold-start time for serverless or lambda-style deployments.
|
|
75
|
+
- Cold-start time for serverless or lambda-style deployments — `browser.md`'s `vitals.md` TTFB on the first of its three cold-context runs *may* include a serverless cold start, but the reported median does not isolate it from ordinary first-request variance. The gap stays open; only that single-sample hint is available, and it is cited at `inferred`, not `traced`.
|
|
76
|
+
- Utilization, saturation and error rate per resource, per the USE method — this audit has no profiler or OS monitor, so it cannot check whether a resource is actually saturated in production, only whether the code shape could let one become so.
|
|
77
|
+
- Whether a flagged query is actually slow — that requires reading its execution plan, which is `Database`'s check, not this module's.
|
|
78
|
+
- Whether a hot function stays JIT-optimized or gets deoptimized under real load — that is runtime engine behaviour this audit cannot see from source.
|
|
79
|
+
|
|
80
|
+
## What browser observation closes
|
|
81
|
+
|
|
82
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number. Every vitals-based row below is lab data, one machine; never a claim about real-user p75. `vitals.md`'s three recorded cold runs gate reportability, not severity: a metric that only crosses a threshold on one of the three runs is noise, and a finding built from any row below is reportable only once it holds across the full recorded set.
|
|
83
|
+
|
|
84
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
85
|
+
|---|---|---|
|
|
86
|
+
| `vitals.md` | Lab LCP/CLS/INP score per flow against Google's thresholds. A score just over threshold on one of three cold runs is noise, not a finding, unless it holds across all three. | High |
|
|
87
|
+
| `trace.json`/`insights.md` | Long task (>50ms) actually present and overlapping a real interaction during a flow. Refuted if the long task does not overlap an input event's timestamp — check interaction timing in `insights.md` before citing it against INP. | High |
|
|
88
|
+
| `insights.md` (RenderBlocking / LCP breakdown insight) | Render-blocking resource actually delaying the LCP candidate's paint. Refuted if the resource finishes loading before the LCP candidate would have painted anyway — read the LCP phase breakdown, not just the resource's presence, before flagging. | High |
|
|
89
|
+
| `trace.json` (layout-shift entries) corroborated by `screenshots/` diff | CLS-causing element (missing width/height, injected content, font swap) actually shifts layout in this run, earning `High` only when an actual shift is recorded. A code-shape risk that never actually shifts in this run — because it loads before layout, or never enters the viewport walked — stays `inferred`/`read` at code level; it is not upgraded to `observed` just because the code pattern exists, and stays at the module's existing `read`/`inferred` ceiling instead. | High |
|
|
90
|
+
| `network.jsonl` | Real request waterfall: TTFB and slow API calls actually blocking a flow's render or interaction. Refuted if the slow request starts after the paint/interaction it would have blocked — confirm ordering against `steps.md` timestamps before citing it. | Medium |
|
|
91
|
+
| `resource-perf.md` | Unused JS bytes / oversized JS payload against the HTTP Archive 2024 median (613KB desktop / 558KB mobile — HTTP Archive, Web Almanac 2024, JavaScript chapter, 2024, https://almanac.httparchive.org/en/2024/javascript). Refuted if heavy or unused code is lazy-loaded off the critical path, per `insights.md` — it did not cost this flow anything even if the byte count is high. | Low |
|
|
92
|
+
| `network.jsonl` (response headers) | `Cache-Control`/freshness header actually present or absent on a request seen live — extends the static Caching check from `read` toward `observed`. Refuted if the route serves a personalised or CSRF-bearing response that must not be cached — same refutation as the static check. | Low |
|
|
68
93
|
|
|
69
94
|
## Severity guidance
|
|
70
95
|
|
|
@@ -73,6 +98,8 @@ Applies only when the project serves HTML to a browser — cross-reference the `
|
|
|
73
98
|
| Unbounded memory growth reachable from user input | High |
|
|
74
99
|
| Missing pagination on an endpoint over a growing table | High |
|
|
75
100
|
| Cache with no invalidation serving stale correctness-sensitive data | High |
|
|
101
|
+
| Mutating handler with no invalidation call on the matching cached read's key | High |
|
|
102
|
+
| Catastrophic-backtracking regex or synchronous zlib call reachable from a request handler | High |
|
|
76
103
|
| Sequential awaits over independent I/O on a hot path | Medium |
|
|
77
104
|
| O(n²) reachable at realistic input sizes | Medium |
|
|
78
105
|
| Synchronous I/O on a request path | Medium |
|
|
@@ -80,6 +107,9 @@ Applies only when the project serves HTML to a browser — cross-reference the `
|
|
|
80
107
|
| LCP candidate blocked behind a client-only fetch, no SSR/prerender fallback | Medium |
|
|
81
108
|
| CLS-causing element with no reserved space | Medium |
|
|
82
109
|
| Expensive synchronous work inside an interaction handler on a ranked hot path | Medium |
|
|
110
|
+
| CPU-intensive synchronous work on a request path with no worker-thread offload | Medium |
|
|
83
111
|
| Repeated work hoistable out of a loop | Low |
|
|
84
112
|
| No field measurement (web-vitals/RUM) of Core Web Vitals at all | Low |
|
|
85
113
|
| Stale FID tracking with no INP replacement | Low |
|
|
114
|
+
| Large `JSON.stringify`/`JSON.parse` on an unbounded payload, not anchored to a confirmed hot path | Low |
|
|
115
|
+
| Cacheable GET endpoint with no `Cache-Control`/`Expires`/freshness directive | Low |
|
|
@@ -8,40 +8,44 @@ Distinct from `Security`, which asks whether data can be stolen. This module ask
|
|
|
8
8
|
|
|
9
9
|
You cannot audit what you have not enumerated, and unlike most modules in this skill, the inventory here is not inference — **the schema's field names are the probe, and they are already sitting in plain text.** Read them literally before doing anything else; every later section reuses this list rather than rediscovering fields case by case.
|
|
10
10
|
|
|
11
|
-
- [ ] `search_code` schema, model, and migration files (or `get_module` on the data-layer module) and read every column and field name against a checklist: name, email, phone, address, IP, device id, precise location / lat / lng, government id, payment or card details, biometrics, health, date of birth — and anything a foreign key derives from these. This single pass is the inventory; do not skip it and guess later. The two-tier split — ordinary identifiers versus the higher-sensitivity group (government id, payment details, biometrics, health) — follows NIST SP 800-122's PII
|
|
11
|
+
- [ ] `search_code` schema, model, and migration files (or `get_module` on the data-layer module) and read every column and field name against a checklist: name, email, phone, address, IP, device id, precise location / lat / lng, government id, payment or card details, biometrics, health, date of birth — and anything a foreign key derives from these. This single pass is the inventory; do not skip it and guess later. The two-tier split — ordinary identifiers versus the higher-sensitivity group (government id, payment details, biometrics, health) — follows NIST SP 800-122's PII confidentiality-impact-level framework (echoed in DHS's separate sensitive-PII terminology); treat a hit in the sensitive group as the stronger finding when the same gap (no stated purpose, no retention limit) applies to both.
|
|
12
12
|
- [ ] Free-text columns count and cannot be enumerated by name alone — `search_code` for columns named `notes`, `comment`, `bio`, `description`, `message`, `feedback`. Flag each as "unbounded content, requires manual read of sample call sites" rather than pretending the column name tells you what is inside it.
|
|
13
13
|
- [ ] For each inventoried field, trace its lifecycle: `find_callers` on its accessor to see where it is read, `trace_path` from the API input that sets it to the write that persists it. Where it enters, where it lands, and what touches it in between is the row this checklist is actually building.
|
|
14
|
-
- [ ] Collected-but-never-read fields are the cheapest finding in this module. `find_callers` on the read path for the column — empty, with `Reachability`'s exclusions in `reachability.md` ruled out, means it is a candidate. Stop collecting it rather than justifying it.
|
|
14
|
+
- [ ] Collected-but-never-read fields are the cheapest finding in this module. `find_callers` on the read path for the column — empty, with `Reachability`'s exclusions in `reachability.md` ruled out, means it is a candidate. Stop collecting it rather than justifying it. This reuses `database.md`'s general dead-column sweep, filtered to the PII inventory — don't re-run the search, cross-check the inventory against `database.md`'s findings.
|
|
15
15
|
|
|
16
16
|
## Egress — where does it go
|
|
17
17
|
|
|
18
18
|
- [ ] Enumerate third parties first: `get_architecture` dependencies plus `search_code` for known SDK imports — analytics, error reporting, logging platforms, LLM providers, support-tool SDKs, CDNs. A third party you have not named cannot be checked.
|
|
19
|
-
- [ ] **Error reports and logs are the most common accidental egress.** `search_code` the error-reporting SDK's capture call (`Sentry.captureException`, `.captureMessage`, or equivalent) and read literally what is passed — a scrubbed error object, or the full request with headers and body attached.
|
|
20
|
-
- [ ] **Prompts are egress.** `search_code` the LLM SDK call site and read what is interpolated into the messages/prompt argument against the field inventory above — if an inventoried field lands there, that data left the system. Cross-reference `ai.md`.
|
|
19
|
+
- [ ] **Error reports and logs are the most common accidental egress.** `search_code` the error-reporting SDK's capture call (`Sentry.captureException`, `.captureMessage`, or equivalent) and read literally what is passed — a scrubbed error object, or the full request with headers and body attached. OWASP Logging Cheat Sheet: sensitive PII "should not be recorded directly in the logs, but instead should be removed, masked, sanitized, hashed, or encrypted."
|
|
20
|
+
- [ ] **Prompts are egress.** `search_code` the LLM SDK call site and read what is interpolated into the messages/prompt argument against the field inventory above — if an inventoried field lands there, that data left the system. Cross-reference `ai.md`. OWASP Top 10 for LLM Applications, LLM02:2025 Sensitive Information Disclosure.
|
|
21
|
+
- [ ] `search_code` the LLM SDK call site's system/developer-role prompt template specifically (not the per-request user message) for a hardcoded credential, connection string, or literal inventoried PII value baked into the template itself — distinct from the check above, this is data placed in the prompt once, by the developer, not per-request by user input. A placeholder token (e.g. `{{api_key}}`) resolved at runtime from a secrets manager is not the finding; a literal secret in source is. OWASP Top 10 for LLM Applications, LLM07:2025 System Prompt Leakage — "sensitive data such as credentials, connection strings, etc. should not be contained within the system prompt language."
|
|
22
|
+
- [ ] Wherever the "Prompts are egress" check above confirms an inventoried field reaches an LLM call, `search_code` that same call site's request options for a documented no-training / zero-data-retention parameter (a provider-specific opt-out flag, e.g. a `store` or `retention` option) — its absence is reported once per provider integration, not once per call site. `undetermined`, not a violation, where the repo's own docs reference a DPA or enterprise zero-retention agreement covering that provider. OWASP LLM02:2025 — sanitisation "to prevent user data from entering the training model," with the explicit caveat that opt-out restrictions "may not always be honored."
|
|
21
23
|
- [ ] Client-side scripts that read personal data from the page or from storage: `search_code` `localStorage`/`sessionStorage`/cookie reads adjacent to an analytics `track()`/`identify()` call — the adjacency is what makes it egress rather than a UI convenience.
|
|
22
24
|
- [ ] Backups, exports, and fixtures — `search_code` test fixtures and seed files for realistic-looking emails and names. **Rule out first:** `example.com`, `test@test.com`, and obviously synthetic names (`Jane Doe`, `Test User`) are not the finding. A fixture using a real corporate domain, or a name that resolves to an actual person, is — confirm which one you are looking at before reporting it.
|
|
23
25
|
|
|
24
26
|
## Minimisation
|
|
25
27
|
|
|
26
|
-
- [ ] "Each field has a stated purpose" is not checked field-by-field on suspicion — walk the inventory list and, for each entry,
|
|
27
|
-
- [ ] Precision:
|
|
28
|
-
- [ ] Pseudonymous where possible: `search_code` whether downstream tables and services key on the real PII field (email, phone) directly, or on an internal id that only resolves to PII at one boundary.
|
|
29
|
-
- [ ]
|
|
28
|
+
- [ ] "Each field has a stated purpose" is not checked field-by-field on suspicion — walk the inventory list and, for each entry, `Read` the schema/model file and any data-dictionary doc (or `get_module` on the data layer, which the inventory check above already uses) for a comment, schema doc, or data dictionary entry stating why it is collected. Report the absence once, across the whole inventory, with the count of fields with no stated purpose — not as N separate findings. GDPR Art. 5(1)(b): personal data must be "collected for specified, explicit and legitimate purposes."
|
|
29
|
+
- [ ] Precision: `Read` the field's declared type against what the feature needs — a `timestamp` where a year would do, a `lat`/`lng` pair where a region would do. The schema states the precision directly; no inference needed. Rule out precision required for audit/fraud/legal retention even where the user-facing feature only needs a coarser value — the finding is precision beyond every purpose, not beyond the one feature read first. GDPR Art. 5(1)(c): data minimisation — "adequate, relevant and limited to what is necessary."
|
|
30
|
+
- [ ] Pseudonymous where possible: `search_code` whether downstream tables and services key on the real PII field (email, phone) directly, or on an internal id that only resolves to PII at one boundary. GDPR Art. 25 and recital 78 name "pseudonymising personal data as soon as possible" as an example data-protection-by-design measure.
|
|
31
|
+
- [ ] For each inventoried field found at a log call site (the check below), first `Read` the logger's own construction/config for a central redaction mechanism — a pino `redact` path list, a Sentry/Bugsnag `beforeSend` hook, a Winston formatter — since the dominant real-world pattern registers this once and it protects every call site with no call edge from any of them, which `find_callers` on a per-call-site helper cannot see. Only where no central mechanism is found, `find_callers` the logging platform's redact/scrub/mask helper to confirm the specific call site is wrapped by it — rather than assuming a redaction utility's mere existence protects every call site that logs an inventoried field. A call site logging a field outside the sensitive inventory (e.g. a status code sitting next to the flagged variable in the same statement) is not the finding — re-confirm the specific argument logged before flagging. Refuted if the logger's central config covers the field, whether or not any local call site shows a call edge to a helper.
|
|
32
|
+
- [ ] PII in a URL or in logs: `search_code` route definitions for path parameters shaped like `:email`, `:phone`, `/user/:name`, and logger call sites that would capture a query string carrying one of the inventoried fields. `observability.md` owns the log-quality/structure angle; `privacy.md` owns the compliance/inventory angle — report a given hit once. A hit that is both takes `observability.md`'s `High`, not this module's lower severity for the same file:line. OWASP Logging Cheat Sheet: sensitive PII "should not be recorded directly in the logs, but instead should be removed, masked, sanitized, hashed, or encrypted."
|
|
30
33
|
|
|
31
34
|
## Retention and deletion
|
|
32
35
|
|
|
33
|
-
- [ ] Retention enforced, not just declared: for each store the inventory names, `search_code` for a scheduled job, cron entry, or TTL index tied to it. A store with no matching job is a policy with no enforcement — report it as such, don't assume one exists off-repo.
|
|
34
|
-
- [ ] Deletion completeness is a diff, not a guess: `find_callers` on the account/data-deletion handler, then `find_callees` to enumerate every store it actually touches. The gap between that set and the full inventory from the first section is the finding — name the stores deletion misses.
|
|
36
|
+
- [ ] Retention enforced, not just declared: for each store the inventory names, `search_code` for a scheduled job, cron entry, or TTL index tied to it. A store with no matching job is a policy with no enforcement — report it as such, don't assume one exists off-repo. Cross-reference `scalability.md`'s bounded-storage sweep — reuse its findings for the PII-tagged stores rather than re-running the search. GDPR Art. 5(1)(e): storage limitation — personal data "kept... for no longer than necessary."
|
|
37
|
+
- [ ] Deletion completeness is a diff, not a guess: `find_callers` on the account/data-deletion handler, then `find_callees` to enumerate every store it actually touches. The gap between that set and the full inventory from the first section is the finding — name the stores deletion misses. GDPR Art. 17: erasure grounds ("no longer necessary," consent withdrawn), subject to lawful-retention exceptions (legal obligation, archiving/research/statistics, freedom of expression).
|
|
35
38
|
- [ ] Soft delete: `find_symbol` the delete function and read its body — does it set a flag/mark a row, or actually remove or anonymise it? Then check whether user-facing copy (`search_code` the confirmation string) calls this "delete" when it is really a flag flip.
|
|
36
|
-
- [ ] Log retention: `search_code` the logging platform's retention or TTL configuration and compare it against how long the inventoried fields persist elsewhere — a log line living longer than the record it was copied from is the finding.
|
|
39
|
+
- [ ] Log retention: `search_code` the logging platform's retention or TTL configuration and compare it against how long the inventoried fields persist elsewhere — a log line living longer than the record it was copied from is the finding. OWASP Logging Cheat Sheet: logs "must not be destroyed before the duration of the required data retention period, and must not be kept beyond this time."
|
|
37
40
|
|
|
38
41
|
## User rights
|
|
39
42
|
|
|
40
43
|
- [ ] Export completeness: `find_symbol` the export/data-download handler, `find_callees` from it, and compare the fields it actually serialises against the full inventory — a data export returning the profile table only, while the inventory lists five other stores, is the finding, named field by field.
|
|
41
44
|
- [ ] Deletion requestable: `search_code` for a deletion-request endpoint, or its documented process if the flow is manual (support ticket, admin action) — either counts, but one of them must exist and be discoverable from the code.
|
|
42
|
-
- [ ] Consent recorded: `search_code` the schema for a `consent`/`consented_at`-shaped column, then `find_callers` on it to confirm it is actually checked before the gated use, not merely written and ignored.
|
|
43
|
-
- [ ]
|
|
44
|
-
- [ ]
|
|
45
|
+
- [ ] Consent recorded: `search_code` the schema for a `consent`/`consented_at`-shaped column, then `find_callers` on it to confirm it is actually checked before the gated use, not merely written and ignored. ePrivacy Directive 2002/58/EC Art. 5(3): storing or accessing information on a user's terminal equipment (cookies, local storage) requires the user be given clear information and "offered the right to refuse" beforehand, with narrow exceptions for technically necessary transmission or an explicitly requested service.
|
|
46
|
+
- [ ] `trace_path` from the page-load or app-initialisation entry point to the analytics/tracking SDK's init or cookie-set call — a path that reaches it with no consent-check conditional in between is a pre-consent storage/access violation, not merely a missing banner; a path reaching it only through a consent-granted branch is a pass. A reached call that sets a strictly-necessary cookie (session id, CSRF token, load-balancer routing), exempted under ePrivacy's narrow exceptions, is not the finding — name which exception applies before ruling this a violation rather than a pass.
|
|
47
|
+
- [ ] Defaults: `Read` the signup or settings handler for a data-sharing/marketing flag and its default value in the schema or the handler's initial-state literal — defaulting to opted-in is the finding. Also read the front end: `search_code`/`Read` the signup or settings component for the same flag's rendered checkbox — a `checked`, `defaultChecked`, or equivalent pre-selected prop is still an opt-in default violated in the browser, even when the backend default is `false`. Rule out a checkbox gating a strictly-necessary confirmation (age attestation, terms-of-service acknowledgement) rather than a marketing/data-sharing purpose. GDPR Art. 25 and recital 78: data-protection-by-design/-default.
|
|
48
|
+
- [ ] Opt-out signal handling: `search_code` for `Sec-GPC` or Global Privacy Control handling and, where present, trace whether it drives a visible confirmation state (an "opt-out honoured" indicator) rather than only a silent internal flag flip — CCPA/CPRA (11 CCR §7022) requires the confirmation be visible to the user. Its total absence in a project that otherwise implements a cookie/tracking consent banner is the finding, not merely a missing UI polish item.
|
|
45
49
|
- [ ] Deletion refusal names the reason: `find_symbol` the deletion handler's refusal branch (a legal-hold, active-subscription, or fraud-prevention exception) and read whether it records or returns which exception applied, versus silently no-op'ing the request with no trace of why. CCPA/CPRA requires a business to state which statutory exception it is relying on when it declines a deletion request.
|
|
46
50
|
|
|
47
51
|
## Boundaries
|
|
@@ -53,12 +57,26 @@ You cannot audit what you have not enumerated, and unlike most modules in this s
|
|
|
53
57
|
## Out of static reach
|
|
54
58
|
|
|
55
59
|
- Whether a third party actually honours a deletion or consent-withdrawal request once data has left this codebase — the contract may say so; the repo cannot prove compliance.
|
|
56
|
-
- Whether a DSAR/export response is actually transmitted through a secure channel (encrypted email, secure transfer, a dedicated portal) versus plaintext — the handler's code shows what it constructs, not how it was delivered at runtime.
|
|
60
|
+
- Whether a DSAR/export response is actually transmitted through a secure channel (encrypted email, secure transfer, a dedicated portal) versus plaintext — the handler's code shows what it constructs, not how it was delivered at runtime; email and out-of-band delivery channels stay out of reach regardless.
|
|
57
61
|
- Statutory response-time compliance (GDPR's one-month/extendable-to-three window, CCPA's 15-business-day opt-out window) — these are process SLAs, not code properties; a handler existing says nothing about whether it runs in time.
|
|
58
62
|
- Real backup-restore behaviour: whether restoring an old backup resurrects data a user had deleted. This needs a live restore, not a reading of the backup job's code.
|
|
59
63
|
- Infrastructure-level logs outside this repo — load balancer access logs, CDN logs, cloud provider audit trails — that may carry PII in URLs or headers the application code never sees.
|
|
60
64
|
- Whether staging or test data is *actually* real personal data, versus merely shaped like it. The fixture and seed-script probes above find the shape; confirming the content needs a live database read.
|
|
61
65
|
- User-perceived clarity of consent language and UI — whether a real user would understand what they agreed to. That is a comprehension question, not a static one.
|
|
66
|
+
- Whether an LLM provider actually honours a stated no-train/no-retention setting — this module can show the flag was set, not that the provider complied.
|
|
67
|
+
- Whether a field's legal sensitivity classification is complete for every jurisdiction a real user could be in — this module checks against the frameworks the repo itself references, not every possible statute.
|
|
68
|
+
- Whether consent language, once confirmed to exist and be enforced, is legally valid consent under the applicable regime — this module confirms consent is recorded and checked, not that its wording clears the bar.
|
|
69
|
+
|
|
70
|
+
## What browser observation closes
|
|
71
|
+
|
|
72
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
73
|
+
|
|
74
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
75
|
+
|---|---|---|
|
|
76
|
+
| `network.jsonl` | Transport scheme (`https` vs `http`) of an API- or download-triggered DSAR/export response | High |
|
|
77
|
+
| `network.jsonl` + `steps.md` | A third-party tracking/analytics request fires before the consent banner is interacted with | High |
|
|
78
|
+
| `network.jsonl` | A cookie with a lifetime beyond the session is set before consent is granted | High |
|
|
79
|
+
| `screenshots/` + `final-state.md` | Opt-out/GPC signal toggled produces no visible confirmation state in the UI | Medium |
|
|
62
80
|
|
|
63
81
|
## Severity guidance
|
|
64
82
|
|
|
@@ -75,3 +93,8 @@ You cannot audit what you have not enumerated, and unlike most modules in this s
|
|
|
75
93
|
| Opt-out/GPC signal received with no visible confirmation | Medium |
|
|
76
94
|
| Consent withdrawal not propagated downstream | Medium |
|
|
77
95
|
| Precision higher than the purpose requires | Low |
|
|
96
|
+
| Tracking/consent-gated SDK reachable with no consent-check conditional in the path (`trace_path`) | High |
|
|
97
|
+
| Logged inventoried field traced (`find_callers`) to not actually be wrapped by the redaction helper | High |
|
|
98
|
+
| Front-end control pre-selects a marketing/data-sharing opt-in, regardless of the backend default | Medium |
|
|
99
|
+
| LLM call site missing a documented no-training/zero-retention flag for an inventoried field | Medium |
|
|
100
|
+
| Secret or literal inventoried PII hardcoded into an LLM system/developer prompt template | High |
|
|
@@ -6,28 +6,31 @@ Start with `get_architecture` and `repo_map`. The highest-PageRank symbols are t
|
|
|
6
6
|
|
|
7
7
|
## Users and jobs
|
|
8
8
|
|
|
9
|
-
- [ ] The repo states who the user is. `search_code`/`search_context` the README opening and package description for an audience statement. If no doc says it, infer it from `repo_map`'s top entry points and say you inferred it — that ambiguity is itself worth reporting.
|
|
10
|
-
- [ ] Each primary user job maps to a real, reachable code path. Trace one with `trace_path` from entry point to effect.
|
|
9
|
+
- [ ] The repo states who the user is. `search_code`/`search_context` the README opening and package description for an audience statement. If no doc says it, infer it from `repo_map`'s top entry points and say you inferred it — that ambiguity is itself worth reporting. (Cagan, "Product Discovery," Silicon Valley Product Group — https://www.svpg.com/product-discovery/)
|
|
10
|
+
- [ ] Each primary user job maps to a real, reachable code path. Trace one with `trace_path` from entry point to effect. (Nielsen Norman Group, "Task Analysis" — https://www.nngroup.com/articles/task-analysis/)
|
|
11
11
|
- [ ] Nothing in the codebase serves a user the docs never mention. Cross-check `repo_map`'s highest-PageRank symbols against the stated audience, then `find_callers` on any that don't match. Rule out an internal/admin/ops surface never meant for the documented user before calling it unexplained. Unexplained surface is either an undocumented feature or abandoned work.
|
|
12
|
+
- [ ] Compare the job the README/marketing copy states (the words used to describe *why* someone would use this) against what `get_architecture`'s and `repo_map`'s highest-PageRank symbols actually optimize for. A stated job in social/emotional terms ("collaborate effortlessly") backed by a code center of gravity that is entirely about one narrow mechanical operation is a mismatch worth naming — this runs the comparison in the opposite direction from the "nothing in the codebase serves an undocumented user" check above. Rule out the stated job legitimately spanning functional, social, and emotional dimensions with the code's center of gravity as the functional core enabling the rest — name which dimension the code serves before calling it a mismatch. (Christensen Institute, "Jobs to Be Done" — https://www.christenseninstitute.org/theory/jobs-to-be-done/; Cagan, "Product vs. Project Teams," Silicon Valley Product Group — https://www.svpg.com/product-vs-project-teams/)
|
|
12
13
|
|
|
13
14
|
## Surface coherence
|
|
14
15
|
|
|
15
|
-
- [ ] One way to do each thing, or a stated reason for more than one. `search_code` for near-duplicate command/route names sharing a verb or noun — three overlapping commands that half-solve the same job is a product defect before it is a code defect.
|
|
16
|
-
- [ ] Naming is consistent with the user's vocabulary, not the implementation's. `find_symbol` the CLI flag or API field; a name matching an internal class or table rather than a user concept leaks the model.
|
|
17
|
-
- [ ] Defaults serve the common case. `find_symbol` the entry point's signature and count required parameters with no default for the single most common invocation — more than zero is the finding.
|
|
18
|
-
- [ ]
|
|
16
|
+
- [ ] One way to do each thing, or a stated reason for more than one. `search_code` for near-duplicate command/route names sharing a verb or noun — three overlapping commands that half-solve the same job is a product defect before it is a code defect. Before flagging, check docs/comments for a stated reason (a deliberate alias, an in-progress `v1`/`v2` migration) — the finding is duplication with no stated reason, not duplication alone. Where two or more such commands share no stated reason, run `find_callees` on each for a one-hop comparison of their immediate downstream calls, then `trace_path` (or `impact`) between the two entry points to prove whether they actually reach the same mutating/read effect through different call paths — `find_callees` alone only enumerates each command's direct calls, it cannot prove a transitive shared reach. If `trace_path`/`impact` confirms the shared effect, report it as `traced`, not `inferred`, and name the shared effect; if they diverge in effect (one mutates, one is read-only), they are not half-solving the same job — do not report as duplication. (Nielsen, "10 Usability Heuristics for User Interface Design," Nielsen Norman Group — https://www.nngroup.com/articles/ten-usability-heuristics/; Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 15, 2020 — https://abseil.io/resources/swe-book/html/ch15.html)
|
|
17
|
+
- [ ] Naming is consistent with the user's vocabulary, not the implementation's. `find_symbol` the CLI flag or API field; a name matching an internal class or table rather than a user concept leaks the model. (Nielsen, "10 Usability Heuristics for User Interface Design," Nielsen Norman Group — https://www.nngroup.com/articles/ten-usability-heuristics/)
|
|
18
|
+
- [ ] Defaults serve the common case. `find_symbol` the entry point's signature and count required parameters with no default for the single most common invocation — more than zero is the finding. Rule out parameters that are inherently required by the operation's own semantics, with no legitimate default value — the finding is a missing default where one plausibly exists.
|
|
19
|
+
- [ ] If the primary user job is one a user plausibly repeats (not a one-shot setup step), check whether the entry point offers any faster path for repeat use — a batch mode, a non-interactive flag, a saved-config shortcut. `find_symbol` the entry point's signature and `search_code` for batch/script/non-interactive/`--yes`-style flag names; their absence on a repeatable job is the finding. Rule out a job that is inherently single-shot (e.g., a one-time install step) where repetition is not a realistic usage pattern — confirm the job is one a user plausibly repeats before flagging. (Nielsen, "10 Usability Heuristics for User Interface Design" — Heuristic #7, Flexibility and efficiency of use, Nielsen Norman Group — https://www.nngroup.com/articles/ten-usability-heuristics/)
|
|
20
|
+
- [ ] Error messages tell the user what to do next, not what went wrong internally. `search_code` the error-message strings raised at trust boundaries; a message that names an internal type, class, or file path as the primary text is the finding — the same detail surfaced in a secondary/collapsed technical-details region is not. Where such a message is found, `Read` the surrounding handler for whether it discards or preserves the user's already-entered input on failure — discarding non-trivial input (a multi-field form, a multi-step wizard) forces a full retype and is a distinct finding from a jargon-leaking message; rule out a single trivial field (e.g., a one-word CLI flag) where retyping costs nothing. (Nielsen Norman Group, "Error Message Guidelines" — https://www.nngroup.com/articles/error-message-guidelines/)
|
|
19
21
|
|
|
20
22
|
## Onboarding path
|
|
21
23
|
|
|
22
|
-
- [ ] There is a shortest path from install to first value, and it is documented. Follow it literally against the repo — `find_symbol` each command it names — and note every step that is missing, wrong, or assumed.
|
|
24
|
+
- [ ] There is a shortest path from install to first value, and it is documented. Follow it literally against the repo — `find_symbol` each command it names — and note every step that is missing, wrong, or assumed. Cross-reference `documentation.md`'s onboarding-path check — run once, report the product-fit angle here and the doc-accuracy angle there. (Nielsen Norman Group, "Onboarding Tutorials: Definition and Best Practices" — https://www.nngroup.com/articles/onboarding-tutorials/)
|
|
23
25
|
- [ ] Prerequisites are stated before they are needed, not discovered by failure. Read the doc's install section top to bottom; a prerequisite mentioned only in a later troubleshooting section is the finding.
|
|
24
26
|
- [ ] The first-run experience handles the empty state — no data, no config, no index. `find_symbol` the entry point invoked on a fresh checkout and read its behaviour when the expected file/config is absent.
|
|
27
|
+
- [ ] `trace_path` from the documented install entry point to the first invocation of the user's stated primary job. Any intermediate mandatory step (`find_symbol` a "setup"/"wizard"/"init" routine on that path) that the user cannot skip, and that does not itself supply a credential or config with no sane default, is a push-onboarding obstacle between install and first value — distinct from the "shortest path is undocumented" check above, which is about documentation, not a structurally forced detour. Cross-reference the "Defaults serve the common case" check before flagging; a step that is the only way to supply a required credential/config with no legitimate default is not an obstacle. (Nielsen Norman Group, "Onboarding Tutorials: Definition and Best Practices" — https://www.nngroup.com/articles/onboarding-tutorials/)
|
|
25
28
|
|
|
26
29
|
## Feature economics
|
|
27
30
|
|
|
28
|
-
- [ ] For each feature, is there evidence anyone uses it? `find_callers` the feature's entry point — zero in-repo callers plus no doc mention is a maintenance cost with no return. Cross-check with `Reachability`.
|
|
31
|
+
- [ ] For each feature, is there evidence anyone uses it? `find_callers` the feature's entry point — zero in-repo callers plus no doc mention is a maintenance cost with no return. Cross-check with `Reachability`. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 15, 2020 — https://abseil.io/resources/swe-book/html/ch15.html)
|
|
29
32
|
- [ ] Features that exist only for one caller. `find_callers` each exported feature entry point; exactly one caller is a candidate for inlining. Rule out a deliberately public API awaiting external consumers — check the manifest for a declared `exports`/public-package marker before reporting it as unused.
|
|
30
|
-
- [ ] Configuration options that no code branches on. `search_code` the option name in the parser, then `find_callers` on the parsed value. Rule out a string-keyed/reflective read (see `reachability.md`'s exclusion list) before calling it decorative.
|
|
33
|
+
- [ ] Configuration options that no code branches on. `search_code` the option name in the parser, then `find_callers` on the parsed value. Rule out a string-keyed/reflective read (see `reachability.md`'s exclusion list) before calling it decorative. This is `reachability.md`'s dead-config-option check, filtered to product-facing options — reuse its result rather than re-running the search.
|
|
31
34
|
|
|
32
35
|
## Reporting
|
|
33
36
|
|
|
@@ -36,9 +39,22 @@ Product findings are the easiest to state as opinion and the hardest to defend.
|
|
|
36
39
|
## Out of static reach
|
|
37
40
|
|
|
38
41
|
- Whether the stated user actually matches who uses the product in practice — usage data is not in source.
|
|
39
|
-
- Whether the onboarding path *feels* short to a newcomer, versus its literal step count.
|
|
42
|
+
- Whether the onboarding path *feels* short to a newcomer, versus its literal step count — the subjective "feels short" judgement stays out of reach regardless.
|
|
40
43
|
- Whether an error message is genuinely clear to the user it addresses, beyond "does it name an internal detail".
|
|
41
44
|
- Product-market judgements — whether the job being served is worth serving at all.
|
|
45
|
+
- Whether the job this product actually gets hired for matches the job the code optimizes for — that requires user interviews this audit cannot conduct.
|
|
46
|
+
- A commitment made outside this repository (a support contract, an external changelog entry) that this audit cannot see from source.
|
|
47
|
+
- Whether a forced detour before first value is a UX defect or a legal/compliance requirement — the structural probe cannot tell the two apart.
|
|
48
|
+
|
|
49
|
+
## What browser observation closes
|
|
50
|
+
|
|
51
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
52
|
+
|
|
53
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| `steps.md` | Whether the documented onboarding path actually completes end-to-end, and its real step count | High |
|
|
56
|
+
| `steps.md` / `console.jsonl` | Error message shown on a deliberate invalid submission does not leak internal detail | Low |
|
|
57
|
+
| `routes.md` | Route reachable in the browser walk but never named in `repo_map`'s traced entry points, or vice versa — rule out a redirect-only alias or a legacy path kept for compatibility with a stated reason | Medium |
|
|
42
58
|
|
|
43
59
|
## Severity guidance
|
|
44
60
|
|
|
@@ -51,3 +67,6 @@ Product findings are the easiest to state as opinion and the hardest to defend.
|
|
|
51
67
|
| Error message exposing internal detail instead of next action | Low |
|
|
52
68
|
| Config option no code branches on, exclusions ruled out | Low |
|
|
53
69
|
| Feature with exactly one in-repo caller and no public-API marker | Low |
|
|
70
|
+
| Mandatory step forces a detour to the user's primary job with no credential/config justification | Medium |
|
|
71
|
+
| Stated job's social/emotional framing has no functional code behind it, dimension named | Medium |
|
|
72
|
+
| Primary job is repeatable but offers no faster path for repeat use | Low |
|
|
@@ -7,23 +7,27 @@ Run it last. It needs the findings from the other modules as raw material. It is
|
|
|
7
7
|
## Reconstruct the implied ask
|
|
8
8
|
|
|
9
9
|
- [ ] For each significant subsystem — pick them from `repo_map`'s top-ranked symbols or `get_architecture`'s module list, not intuition — write the one-sentence request that would plausibly have produced it, e.g. "add project scoping to the structural tools".
|
|
10
|
-
|
|
10
|
+
List what that sentence does **not** say but the implementation needed anyway: error handling, empty states, concurrency, cleanup, migration, observability, docs — the fixed dimension list below, walked against the sentence reconstructed above; do not improvise new dimensions per subsystem, or the coverage becomes unrepeatable across audits.
|
|
11
|
+
|
|
11
12
|
- [ ] For each dimension, `find_symbol` the subsystem's entry point and read its handling directly — do not infer from the interface alone. A gap the code also missed is a finding in its proper module, cross-referenced here. A gap the code handled anyway is worth naming as a strength — it tells you where the team's instincts are good.
|
|
12
13
|
|
|
13
14
|
## Dimensions a prompt routinely omits
|
|
14
15
|
|
|
15
16
|
Walk this list against the subsystem under audit. Each dimension names its probe; a dimension with no probe run against it produces no finding, not an `inferred` one.
|
|
16
17
|
|
|
17
|
-
- [ ] **Failure** — what happens when the dependency is down, the disk is full, the token expired mid-operation. `search_code` the dependency's call site for a surrounding try/catch or error branch. Rule out a global error-handler/middleware catching it upstream before calling the local absence a gap.
|
|
18
|
-
- [ ] **Empty and boundary** — zero items, one item, maximum items, first run, nothing configured. `find_symbol` the subsystem's entry point and read for a guard on empty/undefined input before the main logic runs.
|
|
19
|
-
- [ ]
|
|
18
|
+
- [ ] **Failure** — what happens when the dependency is down, the disk is full, the token expired mid-operation. `search_code` the dependency's call site for a surrounding try/catch or error branch. Rule out a global error-handler/middleware catching it upstream before calling the local absence a gap. Cross-reference `failure.md`'s swallowed-error and wrapped-call checks; reuse its finding rather than re-deriving it here.
|
|
19
|
+
- [ ] **Empty and boundary** — zero items, one item, maximum items, first run, nothing configured. `find_symbol` the subsystem's entry point and read for a guard on empty/undefined input before the main logic runs. Rule out schema-level validation upstream of the entry point already rejecting the boundary case before it gets here.
|
|
20
|
+
- [ ] Where a call site requests structured/constrained output from an LLM (`search_code` for a `schema`/`output_format`/`strict` argument name near the call, then `Read`/`expand_context` the call site to confirm one is actually passed), confirm the implied ask ("return JSON matching this schema") was not silently read as "return correct values matching this schema." `find_callees` on the consumer of the structured response for a plausibility or reality check on a field the schema marks required (reuse `ai.md`'s "hallucination-sensitive outputs... verified against reality" finding, do not re-derive) before that field drives a write, a user-facing claim, or a downstream decision. Rule out a low-stakes display-only field with no downstream write, decision, or claim of fact (e.g. a suggested chat title) — schema validity is sufficient when nothing consumes the value as ground truth. (Anthropic, "Structured outputs," official documentation — https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
|
|
21
|
+
- [ ] **Empty and boundary, adversarial instance** — where an AI/LLM call site's prompt is built in part from externally-sourced content (a fetched URL, an uploaded file, a tool/function result, a retrieval result — `find_callees` on the prompt-construction function for the origin of each concatenated input), and `ai.md`'s own delimiter check already found the input properly delimited from instructions, still `search_code` the test directory for a fixture where that external content itself contains an instruction-shaped string, asserting the model did not comply with it. A structurally-sound delimiter with no test proving it holds under a hostile input is an unverified assumption standing in for a spec, not a spec. Rule out externally-sourced content that is never used to authorize an action, only displayed or summarized back to the same user who supplied it, with no privileged operation reading the model's output (`find_callers` on the response-handling function to check) — that narrows the blast radius enough to drop this to Medium rather than High. (OWASP GenAI Security Project, "LLM01:2025 Prompt Injection" — https://genai.owasp.org/llmrisk/llm01-prompt-injection/)
|
|
22
|
+
- [ ] **Concurrency** — two of these at once, the same operation twice, a partial run resumed. `search_code` for a lock, mutex, transaction wrapper, or advisory-lock pattern around the operation. Rule out a single-writer guarantee provided by the runtime itself (a single-threaded worker, a queue with concurrency 1) before flagging its absence. Cross-reference `concurrency.md`'s module-level mutable-state checks; reuse its finding rather than re-deriving it here.
|
|
20
23
|
- [ ] **Cleanup** — what removes what this created. `search_code` the resource name alongside a `delete`/`remove`/`teardown` verb. Rule out a TTL/auto-expiry mechanism that makes explicit deletion unnecessary. Most requests say "add", none say "and remove" — an unmatched create with neither is the gap.
|
|
21
|
-
- [ ] **Idempotency** — running it twice. Cross-reference
|
|
24
|
+
- [ ] **Idempotency** — running it twice. Cross-reference `functional.md`'s State and idempotency section (`find_symbol` the operation and read for an upsert/check-before-write/idempotency key); reuse its finding rather than re-deriving it here.
|
|
22
25
|
- [ ] **Migration** — what happens to state written by the previous version. `search_code` a migrations directory or a version-check branch reading old-shape data; its absence next to a changed persisted shape is the gap.
|
|
23
|
-
- [ ] **Observability** — how anyone would know this broke in production. `search_code` a logger/metrics/tracing call inside the subsystem's error branch; a silent catch block is the gap.
|
|
24
|
-
- [ ] **Test isolation** — whether running the tests touches anything outside the temp directory. `search_code` the test file for a hardcoded path, a shared fixture directory, or missing setup/teardown around external state.
|
|
26
|
+
- [ ] **Observability** — how anyone would know this broke in production. `search_code` a logger/metrics/tracing call inside the subsystem's error branch; a silent catch block is the gap. Rule out a global error-handler/middleware logging it upstream before calling the local absence a gap.
|
|
27
|
+
- [ ] **Test isolation** — whether running the tests touches anything outside the temp directory. `search_code` the test file for a hardcoded path, a shared fixture directory, or missing setup/teardown around external state. Cross-reference `testing.md`'s isolation checks; reuse its finding rather than re-deriving it here.
|
|
28
|
+
- [ ] **Observability and Test isolation, instantiated for an AI call site** — when the entry point identified is an AI/LLM call (`ai.md`'s gate fired) and the implied ask's spec lives in a prompt template rather than typed code, treat "no version marker + no regression test" as its own severity band, not the generic "any other dimension" row: `search_code` the prompt constant/file for a version or date marker (reuse `ai.md`'s own "prompts are versioned" finding rather than re-deriving it) AND `search_code` the test directory for a golden-output or regression fixture referencing that prompt (reuse `ai.md`'s Evaluation finding). Both absent on a prompt whose output is acted on downstream without human review is the finding. Rule out a human reviewing every output of this prompt before it is acted on (cross-reference `ai.md`'s Output-handling checks for that review gate) — an unversioned, untested prompt whose every output is human-checked is a process risk, not a silent-drift risk, and drops to the "any other dimension" Medium row. (Anthropic, "Prompt engineering overview," official documentation — https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/overview; Sclar, Choi, Tsvetkov & Suhr, "Quantifying Language Models' Sensitivity to Spurious Features in Prompt Design," arXiv, 2023 — https://arxiv.org/abs/2310.11324)
|
|
25
29
|
- [ ] **Ownership** — whether this writes to a path someone else owns. `search_code` the write target's path construction. Rule out a path shared by documented convention or contract before calling it a boundary violation.
|
|
26
|
-
- [ ] **Docs** — whether the thing that ships is discoverable by the person who needs it. Cross-reference `documentation.md`'s coverage checks; reuse its finding rather than re-deriving it here.
|
|
30
|
+
- [ ] **Docs** — whether the thing that ships is discoverable by the person who needs it. Cross-reference `documentation.md`'s coverage checks (`get_architecture`/`repo_map` the entry-point list, then `search_code` each name against the docs); reuse its finding rather than re-deriving it here.
|
|
27
31
|
|
|
28
32
|
## Spec vs. implementation drift
|
|
29
33
|
|
|
@@ -37,12 +41,32 @@ Walk this list against the subsystem under audit. Each dimension names its probe
|
|
|
37
41
|
- Whether a gap the code "handled anyway" was deliberate foresight or an accidental side effect of a stricter library default.
|
|
38
42
|
- Whether the reconstructed one-sentence ask matches the real request, when no ticket, issue, or commit message records it.
|
|
39
43
|
- Dimensions genuinely outside this fixed list — one this list itself omits stays invisible to the audit.
|
|
44
|
+
- Whether this prompt's behavior is sensitive to its own formatting — this module can find that no regression test exists to catch it, not whether a specific edit would in fact change the output.
|
|
45
|
+
- Whether the LLM-as-judge grader this codebase uses is actually reliable for its task — this module can confirm a grader exists and is a different model than the one graded, not that its judgments are correct.
|
|
46
|
+
- Whether a tested injection guard actually holds against real attacks — this module confirms a test exists and asserts the expected behavior, not that the assertion would survive an attacker who iterates against it.
|
|
47
|
+
|
|
48
|
+
## What browser observation closes
|
|
49
|
+
|
|
50
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
51
|
+
|
|
52
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
53
|
+
|---|---|---|
|
|
54
|
+
| `network.jsonl` cross-referenced with `steps.md` (the promise's copy text, captured verbatim near the step) and `final-state.md`/`screenshots/` | UI-promised AI behavior (e.g. "cites sources," "your data stays private," "instant answers") vs. the actual prompt/response payload observed for the same interaction — refuted if the app's frontend calls its own backend rather than the model provider directly, so `network.jsonl` shows the app's API response, not the literal prompt sent to the LLM; check `final-state.md`/screenshots for the rendered claim before concluding the promise was broken | High |
|
|
55
|
+
|
|
56
|
+
## Severity guidance
|
|
57
|
+
|
|
58
|
+
| Situation | Severity |
|
|
59
|
+
|---|---|
|
|
60
|
+
| Gap the implementation also missed, in a security-, money-, or data-loss-bearing dimension | High |
|
|
61
|
+
| AI-call prompt spec with no version marker and no regression test, output consumed downstream without human review | High |
|
|
62
|
+
| Gap the implementation also missed, any other dimension | Medium |
|
|
63
|
+
| Gap the implementation covered anyway | Info |
|
|
40
64
|
|
|
41
65
|
## Output
|
|
42
66
|
|
|
43
|
-
Report this module as two lists
|
|
67
|
+
Report this module as two lists:
|
|
44
68
|
|
|
45
|
-
1. **Gaps the implementation also missed** —
|
|
69
|
+
1. **Gaps the implementation also missed** — a gap with a named owning module (`failure.md`, `concurrency.md`, `functional.md`, `testing.md`, `documentation.md` above) is re-filed there and takes that module's severity, not the table below; that module ran, or didn't, independently of this one. The table above applies only to a gap whose owning module did not run this audit, or that no other module owns.
|
|
46
70
|
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.
|
|
47
71
|
|
|
48
72
|
Then name the single dimension most likely to be omitted from the *next* request on this codebase, with the evidence that led you there.
|