project-brain 0.24.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +1 -1
  2. package/package.json +6 -6
  3. package/templates/project.claude.md +1 -1
  4. package/templates/skills/brain-audit/SKILL.md +17 -7
  5. package/templates/skills/brain-audit/references/abuse.md +36 -11
  6. package/templates/skills/brain-audit/references/accessibility.md +50 -22
  7. package/templates/skills/brain-audit/references/ai.md +39 -15
  8. package/templates/skills/brain-audit/references/analytics.md +34 -11
  9. package/templates/skills/brain-audit/references/api.md +38 -13
  10. package/templates/skills/brain-audit/references/backend.md +41 -9
  11. package/templates/skills/brain-audit/references/browser.md +146 -0
  12. package/templates/skills/brain-audit/references/complexity.md +22 -12
  13. package/templates/skills/brain-audit/references/concurrency.md +36 -18
  14. package/templates/skills/brain-audit/references/consistency.md +32 -9
  15. package/templates/skills/brain-audit/references/contract-drift.md +34 -16
  16. package/templates/skills/brain-audit/references/cost.md +45 -23
  17. package/templates/skills/brain-audit/references/cross-surface-parity.md +38 -11
  18. package/templates/skills/brain-audit/references/database.md +43 -17
  19. package/templates/skills/brain-audit/references/dependencies-licensing.md +27 -12
  20. package/templates/skills/brain-audit/references/design-system.md +40 -17
  21. package/templates/skills/brain-audit/references/devops.md +32 -17
  22. package/templates/skills/brain-audit/references/documentation.md +38 -16
  23. package/templates/skills/brain-audit/references/failure.md +40 -18
  24. package/templates/skills/brain-audit/references/feature-flags.md +31 -15
  25. package/templates/skills/brain-audit/references/flow-integrity.md +42 -10
  26. package/templates/skills/brain-audit/references/frontend.md +40 -12
  27. package/templates/skills/brain-audit/references/functional.md +31 -11
  28. package/templates/skills/brain-audit/references/future.md +28 -7
  29. package/templates/skills/brain-audit/references/goal.md +15 -6
  30. package/templates/skills/brain-audit/references/i18n.md +30 -8
  31. package/templates/skills/brain-audit/references/idempotency.md +46 -24
  32. package/templates/skills/brain-audit/references/infrastructure.md +43 -13
  33. package/templates/skills/brain-audit/references/mobile.md +37 -15
  34. package/templates/skills/brain-audit/references/multi-tenancy.md +41 -12
  35. package/templates/skills/brain-audit/references/numeric.md +33 -16
  36. package/templates/skills/brain-audit/references/observability.md +43 -19
  37. package/templates/skills/brain-audit/references/packaging.md +39 -13
  38. package/templates/skills/brain-audit/references/performance.md +43 -13
  39. package/templates/skills/brain-audit/references/privacy.md +38 -15
  40. package/templates/skills/brain-audit/references/product.md +29 -10
  41. package/templates/skills/brain-audit/references/prompt-spec-gap.md +34 -10
  42. package/templates/skills/brain-audit/references/reachability.md +38 -18
  43. package/templates/skills/brain-audit/references/repo-history.md +23 -16
  44. package/templates/skills/brain-audit/references/runtime.md +48 -10
  45. package/templates/skills/brain-audit/references/scalability.md +37 -10
  46. package/templates/skills/brain-audit/references/security.md +46 -22
  47. package/templates/skills/brain-audit/references/state-model.md +44 -15
  48. package/templates/skills/brain-audit/references/supply-chain.md +42 -13
  49. package/templates/skills/brain-audit/references/temporal.md +37 -14
  50. package/templates/skills/brain-audit/references/testing.md +38 -14
  51. package/templates/skills/brain-audit/references/tooling-baseline.md +34 -18
  52. package/templates/skills/brain-audit/references/type-safety.md +38 -19
  53. package/templates/skills/brain-audit/references/usability.md +78 -0
  54. package/templates/skills/brain-audit/references/versioning-compatibility.md +34 -12
  55. package/templates/skills/brain-audit/references/visual-design.md +38 -12
  56. package/templates/skills/brain-audit/references/web-metadata.md +47 -19
  57. package/templates/skills/brain-record/SKILL.md +297 -0
  58. package/templates/skills/brain-record/assets/build-video.sh +142 -0
  59. package/templates/skills/brain-record/assets/record.mjs +283 -0
  60. package/templates/skills/brain-record/references/pitfalls.md +233 -0
  61. package/templates/skills/brain-worktree/SKILL.md +103 -0
package/README.md CHANGED
@@ -197,7 +197,7 @@ Unlike the `/brain-*` commands above, these have no CLI equivalent. They are **h
197
197
 
198
198
  `project-brain setup` installs them into each registered tool's global skills directory (`~/.claude/skills/`, `~/.codex/skills/`, or the shared `~/.agents/skills/`). Opt out with `project-brain setup --no-skills` (`--no-brain-audit` still works as an alias).
199
199
 
200
- **Both are offered, not scheduled.** Nothing invokes them for you and nothing fires on commit — you decide when. `brain-audit` runs discovery, proposes an audit module set, and waits for you to confirm before loading anything: 50 modules exist, and loading all of them every time is what makes an audit expensive. `brain-okf` proposes the type, title, and anchor and waits before creating a file, because whether an insight deserves a permanent home is your call, not the assistant's.
200
+ **Both are offered, not scheduled.** Nothing invokes them for you and nothing fires on commit — you decide when. `brain-audit` runs discovery, proposes an audit module set, and waits for you to confirm before loading anything: 51 modules exist, and loading all of them every time is what makes an audit expensive. `brain-okf` proposes the type, title, and anchor and waits before creating a file, because whether an insight deserves a permanent home is your call, not the assistant's.
201
201
 
202
202
  Setup never overwrites a skill directory it did not create. Ownership is proven per directory, so your own hand-written `brain-okf/` is left untouched — and reported — while `brain-audit/` upgrades beside it.
203
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "project-brain",
3
- "version": "0.24.0",
3
+ "version": "0.26.1",
4
4
  "type": "module",
5
5
  "description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
6
6
  "author": "jcsoftdev",
@@ -49,11 +49,11 @@
49
49
  "zod": "^4.4.3"
50
50
  },
51
51
  "optionalDependencies": {
52
- "project-brain-darwin-arm64": "0.24.0",
53
- "project-brain-linux-x64": "0.24.0",
54
- "project-brain-linux-arm64": "0.24.0",
55
- "project-brain-windows-x64": "0.24.0",
56
- "project-brain-windows-arm64": "0.24.0"
52
+ "project-brain-darwin-arm64": "0.26.1",
53
+ "project-brain-linux-x64": "0.26.1",
54
+ "project-brain-linux-arm64": "0.26.1",
55
+ "project-brain-windows-x64": "0.26.1",
56
+ "project-brain-windows-arm64": "0.26.1"
57
57
  },
58
58
  "devDependencies": {
59
59
  "@types/bun": "latest",
@@ -14,4 +14,4 @@ When answering questions about this codebase, run `search_context` first to find
14
14
 
15
15
  - **Project ID**: {{projectId}}
16
16
  - **Stack**: {{stack}}
17
- {{modules}}{{okf}}
17
+ {{modules}}{{okf}}{{worktree}}
@@ -4,7 +4,7 @@ description: "Trigger: audit this project, comprehensive audit, full codebase au
4
4
  license: Apache-2.0
5
5
  metadata:
6
6
  author: jcsoftdev
7
- version: "2.3"
7
+ version: "2.5"
8
8
  generator: project-brain
9
9
  ---
10
10
 
@@ -54,12 +54,14 @@ The single most likely failure of this audit is not missing a defect — it is r
54
54
  | Tier | Established by | Severity ceiling |
55
55
  |---|---|---|
56
56
  | `executed` | A command was run and its output read. Only `runtime.md` reaches this tier, only when the user enabled execution, and only with the command and its exit code recorded. | Critical |
57
+ | `observed` | Established by a browser tool against a named URL. Only `browser.md` and the modules consuming its bundle reach this tier, only when the user enabled browser observation, and only with the URL, the tool that filled each role, and the artefact path with a line or timestamp recorded. A single run is lab data, never evidence about real users. | Critical |
57
58
  | `traced` | A structural proof from project-brain: `trace_path`, `find_callers`, `find_callees`, or `impact` showing the path exists, or provably does not. | Critical |
58
59
  | `read` | A cited `file:line` whose content was actually read, quoted or paraphrased faithfully. | High |
59
60
  | `inferred` | A pattern, a naming smell, or an absence with no probe run against it. | Medium |
60
61
 
61
62
  - **An `inferred` finding can never exceed `Medium`**, no matter how severe it would be if true. Its severity is a function of what you proved, not of what you fear. If it deserves `Critical`, go and prove it — then it is `traced` and it earns the severity.
62
63
  - A finding with no tier is not a finding. Drop it or promote it.
64
+ - **A `Severity guidance` row above the ceiling of the check that feeds it must name the probe that reaches that ceiling.** A row awarding `Critical` to a situation whose only probe is `search_code` plus reading the hit is a contradiction: the check can reach `read`, and `read` stops at `High`. Either the check names the structural probe (`find_callers`, `trace_path`, `impact`) that proves the reach, or the row caps at `High`.
63
65
  - Confidence is separate from tier: tier says *what kind* of evidence, confidence says *how strong*. A `read` finding with one ambiguous line is `read` at 40%.
64
66
 
65
67
  **Falsification is part of the finding.** For every check that can produce a false positive, state what would refute it and confirm you ruled that out. `reachability.md` and `concurrency.md` already do this; the pattern is the standard, not their local quirk.
@@ -72,15 +74,17 @@ This matters more than it looks. Measured precision for frontier models on secur
72
74
 
73
75
  ## Execution
74
76
 
75
- **This audit reads. It does not run anything unless the user says so, in this session, for this run.**
77
+ **This audit reads. It does not run anything and does not open a browser unless the user says so, in this session, for this run.**
76
78
 
77
- Every other module in this skill is static, and that is a promise the user relies on: pointing an audit at a repository must not be a way to execute its code. The `Runtime` module is the single exception, and it is off unless three conditions all hold.
79
+ Every other module in this skill is static, and that is a promise the user relies on: pointing an audit at a repository must not be a way to execute its code or to drive a browser against it. The `Runtime` and `Browser` modules are the two exceptions, each behind its own consent. `Runtime` is off unless three conditions all hold.
78
80
 
79
81
  1. **The user enabled it explicitly.** Not a default, not inferred from a project type, not carried over from a previous run, and not implied by confirming the module set. `Runtime` is offered separately from every other module, after the rest are chosen, and the offer states plainly what running it means: the project's code will execute on this machine.
80
82
  2. **The project declares the command.** `Runtime` runs what the repository already tells its own contributors to run — a script in the manifest, a step in a CI workflow, a documented command. **It never invents one.** This is the constraint that makes execution defensible: the audit runs what the authors already run, and the audit's own judgement is not what decides that a command is safe.
81
83
  3. **The command is not destructive.** A declared script whose name or body deploys, publishes, migrates, seeds, resets, or deletes is never run on inference. If a finding genuinely needs one, name it, say why, and let the user run it themselves.
82
84
 
83
- Refusing execution is always a valid answer and costs the audit only the `executed` tier. Every module already declares what it cannot see from source in its `Out of static reach` section; with execution off, those items are reported as Coverage Gaps exactly as they were before. **The static audit is complete without this module** — `Runtime` closes gaps, it does not fill holes.
85
+ `Browser` is offered after `Runtime`, separately again, and is off unless three conditions of its own hold: a UI or HTML-serving entry point was detected, the user enabled browser observation explicitly for this run, and a target URL exists — supplied by the user, or a declared `dev`/`start`/`preview` script the user has also allowed `Runtime` to start. The offer names the tool filling each role, states whether any role runs inside the user's real signed-in browser (never by default — see `browser.md`), lists the flows it will walk, and prints the total number of passes, so the user consents to a count, not to "a run". Flows are read-only unless the user names a side-effecting one, exactly as `Runtime` treats `deploy`/`migrate`/`seed`.
86
+
87
+ Refusing execution or observation is always a valid answer and costs the audit only the `executed` or `observed` tier. Every module already declares what it cannot see from source in its `Out of static reach` section; with execution off, those items are reported as Coverage Gaps exactly as they were before. **The static audit is complete without these modules** — `Runtime` and `Browser` close gaps, they do not fill holes.
84
88
 
85
89
  A finding at `executed` tier records the exact command, its exit code, and the output line that supports it. Without those three it is not `executed`; it is an `inferred` finding wearing a tier that lets it reach Critical, which is worse than an honest `inferred`. And a green run proves only that the project's own checks pass, which is as strong as those checks are — `tooling-baseline.md` is what measures that, and the two modules are read together or neither is worth much.
86
90
 
@@ -112,7 +116,7 @@ The refuter is told to destroy the finding, and told that destruction is expensi
112
116
 
113
117
  A kill requires evidence at the tier the finding claims, or higher. **Failing to find support for a finding is not refuting it** — that is `unrefuted`, and it is a correct and complete answer. Every verdict, kills and survivals alike, lists the probes that were run; a verdict with no probe list is void and the finding survives. This is the clean-module rule from the Evidence Contract applied one level up: not looking and looking-and-finding-nothing produce the same verdict, and only the probe list separates them.
114
118
 
115
- The refuter cannot execute anything. If a claim can only be settled by running the code, the verdict is `undetermined`.
119
+ The refuter cannot execute anything and does not open a browser, for the same reason. If a claim can only be settled by running the code or by re-observing it, the verdict is `undetermined`. An `observed` finding is killed by `MISQUOTE` against the cited artefact line or by `INTENDED`; nothing else reaches it.
116
120
 
117
121
  ### Context asymmetry
118
122
 
@@ -195,6 +199,7 @@ The `Reference` column is the exact filename under `references/` — load that f
195
199
  | | Prompt/Spec Gap | `prompt-spec-gap.md` |
196
200
  | Linter, formatter, type-checker, test-runner, or scanner config present **or conspicuously absent** | Tooling Baseline | `tooling-baseline.md` |
197
201
  | **User enabled execution** — never proposed by detection alone, see `## Execution` | Runtime | `runtime.md` |
202
+ | **User enabled browser observation, a browser tool is present in the session, and a target URL exists** — never proposed by detection alone, see `## Execution` | Browser | `browser.md` |
198
203
  | Project is a git repository | Repo History | `repo-history.md` |
199
204
  | Statically or gradually typed language | Type Safety | `type-safety.md` |
200
205
  | Server framework or API routes present | Backend | `backend.md` |
@@ -212,6 +217,7 @@ The `Reference` column is the exact filename under `references/` — load that f
212
217
  | | Design System | `design-system.md` |
213
218
  | | Visual Design | `visual-design.md` |
214
219
  | | Accessibility | `accessibility.md` |
220
+ | **Browser observation ran, and a UI framework or HTML entry point was detected** — never proposed by detection alone, see `## Execution` | Usability | `usability.md` |
215
221
  | Native mobile project | Mobile | `mobile.md` |
216
222
  | Schema, migrations, or ORM present | Database | `database.md` |
217
223
  | LLM / AI SDK calls present | AI | `ai.md` |
@@ -260,6 +266,7 @@ The absence gates (`Observability`, `Testing`, `Design System`, `Type Safety`, `
260
266
  | Locale files / translation keys | `search_code` for a locales directory or the translation function |
261
267
  | OpenAPI / GraphQL / protobuf / shared types | `search_code` for `openapi`, `.graphql`, `.proto`, or a shared-types package |
262
268
  | Hot path or measurable workload | `repo_map`'s top-ranked symbols, plus any loop over unbounded input |
269
+ | Browser tool present in the session | probe the session's tool names for `chrome-devtools`, `playwright`, or `claude-in-chrome` tools — nothing is installed; absence renders `Browser` as `not applicable (no browser tool in session)`. This is recorded even when observation stays off, so the offer can name the tool it would use |
263
270
  | Runnable commands the project declares | manifest scripts, CI workflow steps, and documented commands in the README. This establishes what `Runtime` *could* run and is worth recording even when execution stays off — a project that declares none cannot be verified by running it, which is itself worth saying |
264
271
  | Tooling configuration | `search_code` for the tool config filenames of the detected stack — linter, formatter, type checker, test runner, pre-commit framework, scanner. **Absence fires the gate**: a project whose tooling checks nothing is one where every defect this audit finds was invisible to automation, and that changes which other modules are worth running |
265
272
  | Git repository | a `.git` directory — the module reads history, so a shallow clone is `undetermined`, not `not applicable` |
@@ -282,6 +289,7 @@ The absence gates (`Observability`, `Testing`, `Design System`, `Type Safety`, `
282
289
  2. Apply gates → proposed module set with per-module rationale.
283
290
  3. **Present the proposal and wait for confirmation.** Report the token implication of the chosen set.
284
291
  4. **Offer `Runtime` separately, after the module set is settled, and wait.** State that enabling it executes the project's code on this machine, list the declared commands it would run, and name the ones it will not touch. Declining is normal and costs only the `executed` tier. Never fold this into step 3 — a user confirming twenty static modules has not consented to run anything.
292
+ - **4b. Offer `Browser` separately, after `Runtime`, and wait.** Only when a UI or HTML entry point was detected and a browser tool is present. Name the target URL and where it came from, the tool filling the walker and measurer roles, whether any role runs in the user's real browser session, the candidate flows (up to five, ranked by product centrality), and the total pass count. Wait for the flow list to be confirmed before any browser opens. Declining costs only the `observed` tier.
285
293
  5. For each confirmed module, read only its `references/<module>.md`, then verify against real code — project-brain first, `Read` only to confirm lines it points at. **Run the probe each check names.** A check whose probe was not run produces no finding, not an `inferred` one.
286
294
  6. Collect findings using the schema above, each with its evidence tier and its ruled-out alternative. Leave `Refutation` empty; step 8 fills it.
287
295
  7. **Present the Refutation Manifest and wait** — findings collected, how many are eligible at Medium or above, how many are left raw below threshold, how many refuters that means, and the resolved mode with model ids where they are known. Answers are `all`, `critical+high only`, or `none`. A user who replied `refute all` at step 3 has pre-authorised it; print the manifest as a notice and continue. `none` stamps every finding `declined by user` — it does not silently skip the stage.
@@ -291,12 +299,14 @@ The absence gates (`Observability`, `Testing`, `Design System`, `Type Safety`, `
291
299
 
292
300
  ## Output Contract
293
301
 
294
- In this order: Executive Summary, Project Discovery, Architecture Summary, Feature Map, Modules Run (and why each was skipped), Findings by Severity, Wiring & Reachability Report, Design System Health (only when `Design System` ran), Coverage Gaps, Refutation Ledger, Technical Debt, Security Risks, Missing Features, Architectural Risks, Recommendations, Quick Wins, Long-term Improvements.
302
+ In this order: Executive Summary, Project Discovery, Architecture Summary, Feature Map, Modules Run (and why each was skipped), Findings by Severity, Wiring & Reachability Report, Browser Observation Report (only when `Browser` ran), Design System Health (only when `Design System` ran), Coverage Gaps, Refutation Ledger, Technical Debt, Security Risks, Missing Features, Architectural Risks, Recommendations, Quick Wins, Long-term Improvements.
295
303
 
296
- Findings are grouped by severity, and within a severity, ordered by evidence tier — `traced` before `read` before `inferred`, with `undetermined` last inside each tier. A reader who stops after the first three findings should have stopped at the three best-proven ones, and the three that survived the hardest attempt to destroy them.
304
+ Findings are grouped by severity, and within a severity, ordered by evidence tier — `executed`, `observed`, and `traced` first, then `read`, then `inferred`, with `undetermined` last inside each tier. A reader who stops after the first three findings should have stopped at the three best-proven ones, and the three that survived the hardest attempt to destroy them.
297
305
 
298
306
  The Executive Summary carries one line naming the refutation mode, both model ids where they are known, how many findings were refuted, and how many were left raw below threshold. It qualifies every number underneath it, so it goes at the top and not in a footnote. In `self-review` mode it says plainly that no adversarial stage ran.
299
307
 
308
+ **Browser Observation Report** is one table per flow: the steps walked, the artefacts produced with their paths, the vitals with median and range and the `cold, n=3` or degraded label, the tool that filled each role with its version where exposed, and the steps the measurer could not replay. It says which flows ran in an isolated context and which, if any, ran in the user's real session.
309
+
300
310
  **Refutation Ledger** is the findings that were killed — one line each, and the header states they are not findings. It exists so the user can audit the refuter: a ledger of thin grounds means the kill stage is over-killing, and they can override it. Coverage Gaps is what the audit could not reach; the Ledger is what it reached and dismissed. Adjacent for a reason.
301
311
 
302
312
  **Design System Health** is a table, not prose: one row per category — colour, spacing, radius, typography, shadow, z-index — with token references, hardcoded literals, and the adoption percentage. It is a tracked number the user can re-measure next quarter; a paragraph of impressions is not. Categories the project does not use are `n/a`, never 100%.
@@ -7,25 +7,30 @@ Gate: auth, external input, or a network boundary was detected.
7
7
  ## Resource abuse
8
8
 
9
9
  - [ ] Every endpoint that costs money or time has a rate limit. `search_code` for a rate-limit middleware (`express-rate-limit`, `slowapi`, `RateLimiter`, `@Throttle`, or the project's own), then list the routes it actually wraps against every expensive or billed route from `get_architecture`'s route table. The gap between the two lists is the finding — the mere absence of the word "rate limit" is not; a project can rate-limit at the gateway and never mention it in application code, so check for an upstream gateway config too before concluding there is none. CWE-770 Allocation of Resources Without Limits or Throttling, #25 in the 2025 CWE Top 25 — the CWE anchoring this whole section. Absent limits on a billed operation is `High` — cross-reference `cost.md`.
10
- - [ ] Rate limits are keyed on something the user cannot trivially rotate. Read the limiter's key function: per-IP alone is weak (rotates behind CGNAT or a VPN); per-account or per-API-key is better.
11
- - [ ] Request and payload size are bounded before parsing, not after. `search_code` the body-parser configuration (`bodyParser.json({limit:`, `express.json({limit:`, `client_max_body_size`, framework equivalent) and confirm the limit is wired into the middleware chain ahead of the route, not merely declared and unused.
10
+ - [ ] Rate limits are keyed on something the user cannot trivially rotate. Read the limiter's key function: per-IP alone is weak (rotates behind CGNAT or a VPN); per-account or per-API-key is better. OWASP Credential Stuffing Prevention Cheat Sheet: "blocking IP addresses may be sufficient to stop less sophisticated attacks, but should not be used as the sole or primary defense due to the ease in circumvention."
11
+ - [ ] Request and payload size are bounded before parsing, not after. `search_code` the body-parser configuration (`bodyParser.json({limit:`, `express.json({limit:`, `client_max_body_size`, framework equivalent) and confirm the limit is wired into the middleware chain ahead of the route, not merely declared and unused. CWE-770 Allocation of Resources Without Limits or Throttling.
12
12
  - [ ] Uploads are bounded in size, count, and total per account, and the type is verified from file content rather than filename or declared MIME type. `find_symbol` the upload handler and read the validator: an extension or `Content-Type` header check alone is the finding; a check against magic bytes (file-type sniffing) rules it out — read which one is actually implemented before flagging. CWE-434 Unrestricted Upload of File with Dangerous Type, #12 in the 2025 CWE Top 25.
13
- - [ ] Anything that fans out — a single request causing N downstream calls — has a bound on N. `find_callees` or `trace_path` from the handler: a loop over a user-supplied array (batch IDs, recipient lists, webhook targets) calling a downstream service once per item, with no cap on array length, is the finding.
14
- - [ ] Expensive queries reachable by an unauthenticated caller. Cross-list unauthenticated routes (from the route table) against `repo_map`'s top-ranked symbols or any join-heavy/aggregate query `find_symbol` turns up on those routes.
13
+ - [ ] Anything that fans out — a single request causing N downstream calls — has a bound on N. `find_callees` or `trace_path` from the handler: a loop over a user-supplied array (batch IDs, recipient lists, webhook targets) calling a downstream service once per item, with no cap on array length, is the finding. Rule out: a cap enforced by the request schema before the handler runs — confirm the schema, not just the loop, before flagging. CWE-770 Allocation of Resources Without Limits or Throttling, #25 in the 2025 CWE Top 25; toll fraud (Twilio) is a real-world instance where an attacker fans out calls/messages to many attacker-rented premium-rate destinations, with the victim absorbing telecom costs.
14
+ - [ ] Where a single account can trigger a message, call, or notification to an arbitrary destination the account does not own (SMS/OTP send, voice call, webhook, email-to-external-address), the limit is keyed on the destination as well as the account — one attacker-controlled account requesting OTPs or calls to many different attacker-chosen premium-rate numbers is the same fan-out shape as the check above, but a per-account limit alone does not catch it because the account itself never exceeds its own quota. `find_callees`/`trace_path` from the send handler to the messaging/telephony provider call and read whether the rate-limit key includes the destination. Twilio's own account of International Revenue Sharing Fraud / toll fraud — a real, named abuse pattern where the attacker's leverage is exactly "many premium destinations, one or few source accounts."
15
+ - [ ] Signup, trial-activation, and any other identity-minting endpoint has a control that a generic per-account rate limit cannot provide — a CAPTCHA/proof-of-work challenge, disposable-email or VOIP-number rejection, or a velocity check across a device/browser fingerprint — because the attacker's unit of abuse here is the account itself. `search_code` the registration/trial handler for a captcha/verification-provider call (`recaptcha`, `hcaptcha`, `turnstile`, `verify-email`) alongside the account-creation write; its total absence on a route that mints a billable trial or a resource-granting account is the finding. Rule out first: a CAPTCHA/bot challenge enforced at the CDN/WAF edge or by a managed auth provider (Auth0, Clerk, Supabase) never appears in the registration handler itself — check the gateway/CDN config and the auth provider's own configuration before treating total absence in the handler as the finding. OWASP OAT-019 "Account Creation" (Automated Threats to Web Applications) — a distinct threat class from generic resource exhaustion.
16
+ - [ ] A request rejected for rate-limiting returns HTTP 429 (not a bare 403/500) so a well-behaved client can distinguish "back off" from "you are banned" or "the server errored," and, where the codebase already returns structured error bodies elsewhere, includes a `Retry-After` value or equivalent backoff hint on the 429 response. `search_code` the rate-limit middleware's response construction for the literal status code and header. RFC 6585 §4 defines 429 and permits (MAY) `Retry-After`, defined in RFC 9110 §10.2.3; Stripe's layered rate-limit design keys a `Stripe-Rate-Limited-Reason` header specifically so callers can self-correct instead of retrying blindly into the same wall.
17
+ - [ ] Expensive queries reachable by an unauthenticated caller — expensive means a join count, an unindexed/full-table scan, or an unbounded aggregate `find_symbol` shows in the query. Cross-list unauthenticated routes (from the route table) against `repo_map`'s top-ranked symbols or any such query `find_symbol` turns up on those routes. Rule out: a query that is already paginated, cached, or covered by a rate limit elsewhere in the pipeline is not the finding — confirm none of the three apply before flagging.
15
18
 
16
19
  ## Input as a weapon
17
20
 
18
- - [ ] Regexes applied to user input cannot backtrack catastrophically. `search_code` regex literals for nested-quantifier shapes (`(.*)+`, `(.+)+`, `(\w+)+`, or a group with a `+`/`*` quantifier itself quantified). Rule-out: trace the regex's input with `find_callers` — a pattern applied only to a trusted, internal, or fixed-length string is not user-reachable and is not the finding; confirm the input source before flagging.
21
+ - [ ] Regexes applied to user input cannot backtrack catastrophically. `search_code` regex literals for nested-quantifier shapes (`(.*)+`, `(.+)+`, `(\w+)+`, or a group with a `+`/`*` quantifier itself quantified). Rule-out: trace the regex's input with `find_callers` — a pattern applied only to a trusted, internal, or fixed-length string is not user-reachable and is not the finding; confirm the input source before flagging. CWE-1333 Inefficient Regular Expression Complexity — worked vulnerable pattern is exactly this nested-quantifier shape.
19
22
  - [ ] Recursive processing of user input (nested JSON, deeply nested structures, zip, XML) has a depth limit. `search_code` the parser's configuration for a `maxDepth`/`depthLimit` option; its absence in a JSON parser that accepts arbitrary client bodies is the finding.
20
23
  - [ ] Decompression has an output-size limit, not only an input-size limit. `search_code` calls into `zlib`, `gunzip`, or archive-extraction libraries for a cap on decompressed output size — a zip bomb passes any input-size check trivially.
21
- - [ ] Pagination and limit parameters are clamped server-side. `find_symbol` the list/pagination handler and read whether the `limit` value is clamped (`Math.min(limit, MAX)` or equivalent) before being used in the query — a limit merely validated as "is a number" still lets `?limit=1000000` through.
24
+ - [ ] Pagination and limit parameters are clamped server-side. `find_symbol` the list/pagination handler and read whether the `limit` value is clamped (`Math.min(limit, MAX)` or equivalent) before being used in the query — a limit merely validated as "is a number" still lets `?limit=1000000` through. CWE-770 Allocation of Resources Without Limits or Throttling.
22
25
  - [ ] Numeric input is range-checked; negative and zero are handled where they change behaviour. `search_code` the validation schema (`zod`, `joi`, `pydantic`, class-validator, or the project's own) for the field and check it declares a `min`/`max`, not just a type.
23
26
 
24
27
  ## Enumeration
25
28
 
26
29
  - [ ] Identifiers are not sequential where enumerating them leaks the corpus size or lets a user walk other records. `search_code` the schema for autoincrement primary keys, then trace whether that same ID is the one exposed in a URL or API response. Rule-out: an autoincrement PK used only internally, with a separate opaque public ID (UUID, slug) surfaced to clients, is not the finding — confirm which ID actually appears in the client-facing route before flagging. This is the enumeration half of BOLA (OWASP API Security Top 10:2023 API1, CWE-639) — `security.md`'s AuthZ section owns the missing-ownership-check half of the same defect; report the identifier choice here and the missing check there.
27
- - [ ] Existence is not disclosed by differential responses. `find_symbol` the handler and read the literal "not found" and "not permitted" branches side by side — same status code, same body shape, or the finding names the exact difference.
28
- - [ ] Bulk lookup endpoints are limited per call and per window. `find_symbol` the batch endpoint and check for a cap on the incoming ID array's length.
30
+ - [ ] Existence is not disclosed by differential responses. `find_symbol` the handler and read the literal "not found" and "not permitted" branches side by side — same status code, same body shape, or the finding names the exact difference. OWASP Authentication Cheat Sheet: an application "must respond (both HTTP and HTML) in a generic manner" regardless of whether the user, password, or account status is invalid.
31
+ - [ ] Where the "not found" and "not permitted" branches return the same status and body (the check above), also read whether they do comparable work before responding — a "not found" branch that returns immediately after a cheap existence check, next to a "not permitted" branch that first loads the record, hashes a password, or performs an authorization check, is a timing side-channel even when the two responses are byte-identical. `find_symbol` both branches and compare the operations each performs before the shared response is built. OWASP Authentication Cheat Sheet: differing processing time, not just differing response body/status, is itself an enumeration channel, and the fix is equal work on both paths.
32
+ - [ ] Bulk lookup endpoints are limited per call and per window. `find_symbol` the batch endpoint and check for a cap on the incoming ID array's length. CWE-770 Allocation of Resources Without Limits or Throttling.
33
+ - [ ] Where a listing or export endpoint's per-request `limit`/page size is already clamped (above), also check for a cap on cumulative volume per account or window — cursor-based pagination with no per-request cap violation still lets a caller walk the entire corpus by paging through it slowly, which a request-level clamp cannot see. `search_code` the pagination/export handler for a per-account daily/hourly export-volume counter distinct from the per-request `limit` clamp. OWASP OAT-011 "Scraping" (Automated Threats to Web Applications) — collecting application content at scale is a threat distinct from a single oversized request.
29
34
  - [ ] Public search cannot be used to enumerate private records by narrowing filters. Read the search handler's filter set for combinations (e.g. narrowing by email domain plus name prefix) that converge on a single private record through repeated queries.
30
35
 
31
36
  ## Business-logic abuse
@@ -38,11 +43,11 @@ Gate: auth, external input, or a network boundary was detected.
38
43
 
39
44
  ## Content abuse
40
45
 
41
- - [ ] User-generated content is escaped at render, and stored content cannot break out at any consumer — including emails, exports, and logs. `search_code` the template engine's autoescape setting and any explicit bypass (`{% autoescape false %}`, `dangerouslySetInnerHTML`, `| safe`) applied to a field that stores user input.
46
+ - [ ] Stored user-generated content cannot break out at any consumer beyond the render path — including emails, exports, and logs. `search_code` for the content reaching an email template, export generator, or log formatter with no escaping/sanitisation applied there specifically. Render-path escaping itself (autoescape setting, `dangerouslySetInnerHTML`, `| safe`) is owned by `security.md` (`search_code` for `innerHTML`/`dangerouslySetInnerHTML`/`v-html`) — reuse its finding for that sink, do not re-report it here.
42
47
  - [ ] CSV/spreadsheet exports neutralise formula-leading characters. `find_symbol` the export function and read whether it prefixes cells starting with `=`, `+`, `-`, or `@` before writing them.
43
- - [ ] Filenames from users are sanitised before being used on disk or in a header. `find_symbol` the upload handler and read whether the stored filename is the raw client-supplied string or a sanitised/generated one (hash, UUID, stripped path).
48
+ - [ ] Filenames from users are sanitised before being used on disk or in a header. `find_symbol` the upload handler and read whether the stored filename is the raw client-supplied string or a sanitised/generated one (hash, UUID, stripped path). CWE-434 Unrestricted Upload of File with Dangerous Type — recommends generating a new, unique filename for storage rather than trusting the client-supplied one.
44
49
  - [ ] User-supplied URLs fetched by the server are validated against internal and private addresses before the request is made. `search_code` for outbound HTTP calls (`fetch(`, `axios.get(`, `requests.get(`, `http.request(`) where the URL argument traces back to user input via `find_callers`, and check for an allowlist (preferred) or private-IP/link-local/loopback-range rejection ahead of the call — its absence on a server-side fetch of a user-supplied URL is the SSRF finding and is `Critical`. CWE-918, #22 in the 2025 CWE Top 25; SSRF is no longer its own OWASP Top 10 category — it was folded into A01:2025 Broken Access Control — cite CWE-918 or OWASP API Security Top 10:2023 API7 (SSRF) instead of "OWASP A10".
45
- - [ ] Where the private-address check exists, it runs against the *resolved* IP immediately before the connection, not only against the hostname string at input-validation time. Read the validation call site and the fetch call site together — if a DNS lookup can occur between the two (the check validates the hostname, then a separate resolve happens inside the HTTP client), an attacker-controlled DNS record can rebind a passing hostname to a private address after the check runs. A validator that resolves A/AAAA records itself and checks those IPs, immediately before the same connection is made, rules this out.
50
+ - [ ] Where the private-address check exists, it runs against the *resolved* IP immediately before the connection, not only against the hostname string at input-validation time. Read the validation call site and the fetch call site together — if a DNS lookup can occur between the two (the check validates the hostname, then a separate resolve happens inside the HTTP client), an attacker-controlled DNS record can rebind a passing hostname to a private address after the check runs. A validator that resolves A/AAAA records itself and checks those IPs, immediately before the same connection is made, rules this out. OWASP SSRF Prevention Cheat Sheet: an allowlisted domain must be re-checked after resolution, since it can later resolve to a local or internal IP; where an allowlist is infeasible, the deny-list of last resort is `127.0.0.0/8`, `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, plus cloud metadata endpoints such as `169.254.169.254`.
46
51
 
47
52
  ## Out of static reach
48
53
 
@@ -51,6 +56,21 @@ Gate: auth, external input, or a network boundary was detected.
51
56
  - Whether a third-party payment or coupon provider enforces idempotency independently of this codebase's own guard.
52
57
  - Real-world timing differences for enumeration — network jitter can mask a gap that is clearly visible when reading the two code paths side by side, and can also expose one too small to see in source.
53
58
  - Whether the business rules encoded here match the product's actual legal or ToS constraints (refund windows, promotional limits) — that is a policy document this module cannot read.
59
+ - Whether a CAPTCHA or bot-challenge actually stops automated traffic in production — this module can confirm the control exists, not that it works.
60
+ - Multi-account or multi-identity coordinated abuse rings — no single code path this module reads spans account boundaries.
61
+ - The tuning of any third-party bot-mitigation or fraud-scoring threshold — that configuration lives outside this codebase.
62
+ - The dollar cost of an unbounded per-destination fan-out if exploited — that number lives in a carrier rate card, not the codebase.
63
+
64
+ ## What browser observation closes
65
+
66
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
67
+
68
+ | Artefact | Gap it closes | Observed instance earns |
69
+ |---|---|---|
70
+ | `network.jsonl` | Real-world timing difference between the "not found" and "not permitted" paths, driven through a live session | High |
71
+ | `a11y-snapshot.md` / `read_page` | Whether a signup/trial-abuse control (CAPTCHA/challenge widget) is actually rendered to a real, non-authenticated visitor | Info |
72
+ | `routes.md` | A route missed by the static route inventory but found by the live crawl, added to the denominator before "expensive queries reachable by an unauthenticated caller" is scored clean | Info |
73
+ | `network.jsonl` (or `resource-perf.md`) | Response payload size compared against the declared page-size clamp read from source, for the per-request pagination/limit clamp check | Medium |
54
74
 
55
75
  ## Severity guidance
56
76
 
@@ -67,3 +87,8 @@ Gate: auth, external input, or a network boundary was detected.
67
87
  | Existence disclosed by differential response | Medium |
68
88
  | Unclamped pagination limit | Medium |
69
89
  | Export not neutralising formula characters | Low |
90
+ | Fan-out limit keyed by account only, not by destination, on a caller-chosen destination (toll fraud shape) | High |
91
+ | "Not found"/"not permitted" branches do unequal work before an identical response (timing side-channel) | Medium |
92
+ | Cumulative export/listing volume uncapped across requests, only per-request page size clamped | Low |
93
+ | Identity-minting endpoint (signup/trial) with no signup-specific abuse control | Medium |
94
+ | Rate-limited response not machine-distinguishable (no 429/`Retry-After`) | Low |
@@ -8,47 +8,53 @@ This module owns the compliance line — the attribute, the ratio, the target si
8
8
 
9
9
  ## Semantics
10
10
 
11
- - [ ] Interactive things are interactive elements. `search_code` for `onClick` on `div` and `span` — each is a control keyboard and screen-reader users cannot reach. Rule out: a `div` that also carries `role="button"`, `tabIndex="0"`, and a keydown handler is compensating correctly; the finding is the ones missing all three.
11
+ - [ ] Interactive things are interactive elements. `search_code` for `onClick` on `div` and `span` — each is a control keyboard and screen-reader users cannot reach. Rule out: a `div` that also carries `role="button"`, `tabIndex="0"`, and a keydown handler is compensating correctly; the finding is the ones missing all three (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 2.1.1 Keyboard requires all functionality operable via keyboard; SC 4.1.2 Name, Role, Value requires the element's role be programmatically determinable).
12
12
  - [ ] Headings form a real outline. `search_code` for `<h1` across page/route entry components — more than one per page, or a jump from `<h2` to `<h4` with no `<h3`, is the defect. Rule out a decorative element that is *styled* like a heading but uses no heading tag at all — that is a different, lesser issue than a skipped level.
13
- - [ ] Landmarks exist. `search_code` for `<main`, `<nav`, `<header`, `<footer`, or `role="main"`/`role="navigation"` — a layout with none of these forces screen-reader users to tab through the entire page instead of jumping to content.
14
- - [ ] Lists are lists, tables are tables with headers. `search_code` a `.map()` rendering repeated `<div>` siblings — if the surrounding markup has no `<ul>`/`<ol>`, that is a list read as an unstructured block by assistive tech. Run the same sweep for a grid-of-`<div>`s standing in for `<table>`.
13
+ - [ ] Landmarks exist. `search_code` for `<main`, `<nav`, `<header`, `<footer`, or `role="main"`/`role="navigation"` — a layout with none of these forces screen-reader users to tab through the entire page instead of jumping to content (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 1.3.1 Info and Relationships).
14
+ - [ ] Lists are lists, tables are tables with headers. `search_code` a `.map()` rendering repeated `<div>` siblings — if the surrounding markup has no `<ul>`/`<ol>`, that is a list read as an unstructured block by assistive tech. Run the same sweep for a grid-of-`<div>`s standing in for `<table>`. Rule out: a repeated block whose items are independent widgets, not a sequence of like items (a card grid, a dashboard of distinct panels), is not the finding — confirm the content is actually list-shaped before flagging (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 1.3.1 Info and Relationships).
15
15
 
16
16
  ## Keyboard
17
17
 
18
- - [ ] Every action reachable by mouse has a keyboard path. Cross-reference the `onClick`-on-non-interactive-element list from Semantics above — each is a candidate action with no keyboard path unless it also carries a keydown handler and `tabIndex`. Confirming the walk end-to-end needs a running app; list the candidates here and put the actual walk under Out of static reach.
19
- - [ ] Focus is visible. `search_code` for `outline: none` and `outline: 0` — each needs a replacement indicator. Rule out: check the same rule block for `box-shadow`, `outline-color`, or a `:focus-visible` override before reporting; a component that removes the default outline and defines its own ring is not a violation.
20
- - [ ] Focus order follows visual order. `search_code` for `tabindex="1"` and above — positive values are a red flag. Rule out: if DOM order already matches visual order, a stray positive `tabindex` may be inert legacy code rather than an active reorder; read the surrounding markup before reporting it as live.
21
- - [ ] Modals trap focus while open and restore it to the trigger on close. `find_symbol` the modal component and read its implementation — a focus-trap library import, or the native `<dialog>` element with `showModal()`, covers this; a hand-rolled modal with neither is a candidate. `search_code` for a `.focus()` call in its close handler to confirm restoration.
22
- - [ ] Nothing is a keyboard trap. A hand-rolled focus trap (found above) is the usual source — read its escape path: does Escape, or Tab past the last element, hand focus back out? Flag a trap with no exit path by inspection; confirming no trap exists anywhere still needs a keyboard pass, which belongs under Out of static reach.
18
+ - [ ] Every action reachable by mouse has a keyboard path. `search_code` for `onClick` on `div`/`span` (the same sweep as Semantics above) with no accompanying keydown handler and no `tabIndex` — each match is a candidate action with no keyboard path. Confirming the walk end-to-end needs a running app; list the candidates here and put the actual walk under Out of static reach (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 2.1.1 Keyboard).
19
+ - [ ] Focus is visible. `search_code` for `outline: none` and `outline: 0` — each needs a replacement indicator. Rule out: check the same rule block for `box-shadow`, `outline-color`, or a `:focus-visible` override before reporting; a component that removes the default outline and defines its own ring is not a violation (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 2.4.7 Focus Visible).
20
+ - [ ] Focus order follows visual order. `search_code` for `tabindex="1"` and above — positive values are a red flag. Rule out: if DOM order already matches visual order, a stray positive `tabindex` may be inert legacy code rather than an active reorder; read the surrounding markup before reporting it as live (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 2.4.3 Focus Order).
21
+ - [ ] Modals trap focus while open and restore it to the trigger on close. `find_symbol` the modal component and read its implementation — a focus-trap library import, or the native `<dialog>` element with `showModal()`, covers this; a hand-rolled modal with neither is a candidate. `search_code` for a `.focus()` call in its close handler to confirm restoration (W3C WAI, ARIA Authoring Practices Guide, current, https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/ — the Dialog Modal pattern: focus moves in on open, Tab/Shift+Tab cycle only inside it, Escape closes it, focus returns to the invoker on close).
22
+ - [ ] Nothing is a keyboard trap. `find_symbol` the hand-rolled focus trap found above and `Read` its escape path: does Escape, or Tab past the last element, hand focus back out? Flag a trap with no exit path by inspection; confirming no trap exists anywhere still needs a keyboard pass, which belongs under Out of static reach (W3C WAI, WCAG 2.2 Understanding, current, https://www.w3.org/WAI/WCAG22/Understanding/no-keyboard-trap.html — SC 2.1.2: focus moved to a component must be movable away using only the keyboard, and if more than unmodified arrow/tab keys are needed, the user must be told how).
23
+ - [ ] A sticky header, footer, or cookie banner does not fully hide a focused element behind it. `search_code` for `position: fixed`/`position: sticky` rules with a non-trivial `height`/`z-index` anchored to the viewport's top or bottom edge, and check whether the scrollable content beneath declares `scroll-margin-top`/`scroll-padding-top` (or an equivalent JS scroll-into-view offset) compensating for it. Rule out: the sticky element's own height is small enough that no plausible focus ring sits fully behind it, or the layout already reserves permanent space for it (no overlap possible by construction) (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 2.4.11 Focus Not Obscured (Minimum), new in 2.2: a focused component must not be *entirely* hidden by author-created content; partial overlap does not violate it).
24
+ - [ ] A hand-rolled `role="combobox"`/`role="listbox"`/`role="menu"` component implements the keyboard interactions APG documents for that pattern (at minimum: Arrow Up/Down to move selection, Home/End to jump to first/last, Escape to close). `find_symbol` the component and `Read` its keydown handler for these. Rule out: the component wraps a known accessible-widget library (Radix, react-aria, Headless UI, Reach UI) — check the import source before flagging; library-wrapped widgets already implement the pattern internally and a missing local keydown handler is expected, not a defect (W3C WAI, ARIA Authoring Practices Guide, current, https://www.w3.org/WAI/ARIA/apg/patterns/combobox/, https://www.w3.org/WAI/ARIA/apg/patterns/listbox/, and https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/ — the combobox, listbox, and menu pattern pages, none of which this module checked against a documented pattern before now).
23
25
 
24
26
  ## Pointer targets
25
27
 
26
- - [ ] Interactive targets meet **24×24 CSS px** — WCAG 2.2 SC 2.5.8, Level AA. `search_code` icon-button and control components and read their declared `width`/`height`/`padding` to compute the effective box. Five exceptions exist and each must be argued, not assumed: sufficient spacing around a smaller target, an equivalent control elsewhere on the page, an inline target within a sentence, a size fixed by the user agent, or a presentation that is essential.
27
- - [ ] Where the project claims AAA, or ships to touch as a primary input, the bar is **44×44 CSS px** — SC 2.5.5, which has no spacing escape hatch. Apple's guidance is 44×44pt and Material's is 48×48dp, both stricter than AA. Compute the same box as above against this bar.
28
- - [ ] Icon-only buttons and close affordances are the usual failures. `search_code` for icon-button components and read their padding — a 16px icon in a box with no padding is a 16px target.
28
+ - [ ] Interactive targets meet **24×24 CSS px** — WCAG 2.2 SC 2.5.8, Level AA. `search_code` icon-button and control components and read their declared `width`/`height`/`padding` to compute the effective box. Five exceptions exist and each must be argued, not assumed: sufficient spacing around a smaller target, an equivalent control elsewhere on the page, an inline target within a sentence, a size fixed by the user agent, or a presentation that is essential (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/, and W3C WAI, WCAG 2.2 Understanding, current, https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html — SC 2.5.8, exact five exceptions confirmed verbatim).
29
+ - [ ] Where the project claims AAA, or ships to touch as a primary input, the bar is **44×44 CSS px** — SC 2.5.5, which has no spacing escape hatch (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — 2.5.5 Target Size Enhanced: 44×44 CSS px except inline/user-agent-controlled/essential/equivalent, with no spacing exception). Apple's guidance is 44×44pt and Material's is 48×48dp, both stricter than AA — practitioner heuristic, no source found. `search_code` the same icon-button and control components as above and compute the same box against this bar.
30
+ - [ ] Icon-only buttons and close affordances are the usual failures. `search_code` for icon-button components and read their padding — a 16px icon in a box with no padding is a 16px target (WebAIM, WebAIM Million 2026, https://webaim.org/projects/million/ — empty buttons on 30.6% of pages, missing form/image labels on 51-53.1% of pages, among the six most persistent WCAG failures for seven straight years).
29
31
  - [ ] The hit area is extended with padding rather than by enlarging the visual box. Read the icon-button CSS found above: padding around a small icon passes; a small box with the icon filling it edge-to-edge is the failure — and enlarging the box for compliance with no design pass is itself a regression worth calling out.
30
- - [ ] Adjacent small targets have spacing between them. `search_code` for the toolbar/action-group markup housing multiple icon buttons and read the `gap`/margin between siblings — targets under 24px sharing an edge with no gap is the failure; two 44px targets a few px apart is not, even though neither hits the exact spacing formula.
32
+ - [ ] Adjacent small targets have spacing between them. `search_code` for the toolbar/action-group markup housing multiple icon buttons and read the `gap`/margin between siblings — targets under 24px sharing an edge with no gap is the failure; two 44px targets a few px apart is not, even though neither hits the exact spacing formula (W3C WAI, WCAG 2.2 Understanding, current, https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html — SC 2.5.8's Spacing exception: 24px-diameter circles centered on adjacent targets must not intersect).
31
33
 
32
34
  ## Names and roles
33
35
 
34
- - [ ] Every image has `alt`, and decorative images have `alt=""` rather than a filename. `search_code` for `<img`/`<Image` tags missing an `alt` attribute entirely — that is the unambiguous defect. Where `alt` is present, read whether it is a filename (`alt="IMG_2043.png"`) or an auto-generated slug — both fail the check for a different reason.
35
- - [ ] Icon-only buttons have an accessible name — these are the single most common miss. `search_code` the icon-button components found under Pointer targets for `aria-label`, `aria-labelledby`, or visually-hidden text — a button whose only content is an SVG or icon component, with none of the three, is unnamed to every screen reader.
36
- - [ ] Form inputs have associated `label` elements, not just placeholders. `search_code` for `<input` and check each against a `<label htmlFor="...">` pointing at its `id`, or `aria-labelledby` — an input with only a `placeholder` and neither of those fails, because the placeholder disappears the moment the user types.
37
- - [ ] Required, invalid, and error states are conveyed programmatically. `search_code` the form's error-display logic and check whether the invalid input also sets `aria-invalid="true"` and `aria-describedby` pointing at the message — a red border and a paragraph with neither attribute is invisible to a screen reader.
38
- - [ ] `aria-*` attributes are valid for their element's role and are not contradicting native semantics. `search_code` for `aria-hidden="true"` and read what it wraps — a focusable element inside an `aria-hidden` subtree is reachable by keyboard but invisible to assistive tech, which is worse than not hiding it at all.
36
+ - [ ] Every image has `alt`, and decorative images have `alt=""` rather than a filename. `search_code` for `<img`/`<Image` tags missing an `alt` attribute entirely — that is the unambiguous defect. Where `alt` is present, read whether it is a filename (`alt="IMG_2043.png"`) or an auto-generated slug — both fail the check for a different reason (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 1.1.1 Non-text Content).
37
+ - [ ] Icon-only buttons have an accessible name — these are the single most common miss. `search_code` the icon-button components found under Pointer targets for `aria-label`, `aria-labelledby`, or visually-hidden text — a button whose only content is an SVG or icon component, with none of the three, is unnamed to every screen reader (W3C, Accessible Name and Description Computation 1.2, current, https://www.w3.org/TR/accname-1.2/ — accessible-name priority order: `aria-labelledby` > `aria-label` > native labeling > name from content > `title`; WebAIM, WebAIM Million 2026, https://webaim.org/projects/million/ — missing alt text on 53.1% of pages, missing form labels on 51%).
38
+ - [ ] An icon rendered via an icon-font ligature or a CSS `::before`/`::after` `content:` glyph is not the element's only accessible-name source. `search_code` for icon-font class patterns (e.g. `fa-`, `icon-`, `content: "\e9` unicode escapes) on interactive elements, and confirm each also carries `aria-hidden="true"` on the glyph plus a separate text label, or an `aria-label` on the interactive parent. Rule out: an `aria-label` on the parent is present — per accessible-name computation, `aria-label` outranks name-from-content, so the glyph text is already overridden and cannot leak through (W3C, Accessible Name and Description Computation 1.2, current, https://www.w3.org/TR/accname-1.2/ — CSS `::before`/`::after` content is folded into "name from content" on equal footing with real text nodes; user agents "MUST" include it, which is the mechanism behind a screen reader announcing a raw ligature or private-use-area codepoint instead of a real word).
39
+ - [ ] Form inputs have associated `label` elements, not just placeholders. `search_code` for `<input` and check each against a `<label htmlFor="...">` pointing at its `id`, or `aria-labelledby` — an input with only a `placeholder` and neither of those fails, because the placeholder disappears the moment the user types (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 3.3.2 Labels or Instructions; WebAIM, WebAIM Million 2026, https://webaim.org/projects/million/ — missing form input labels on 51% of pages).
40
+ - [ ] A multi-step form/wizard does not silently re-ask for a value the user already provided earlier in the same process. `find_symbol` the wizard/step components and `Read` each step's field list for a name that also appears in an earlier step with no default value sourced from shared form state/context. Rule out: the field is re-entered for a security reason (password confirmation), the earlier value may have gone stale (shipping address re-confirmed after a long pause), or it is legally/functionally required to be typed twice (W3C WAI, WCAG 2.2 Understanding, current, https://www.w3.org/WAI/WCAG22/Understanding/redundant-entry.html — SC 3.3.7 Redundant Entry: information previously entered is either auto-populated or available for the user to select, except where re-entry is essential, security-required, or the prior value may no longer be valid).
41
+ - [ ] Required, invalid, and error states are conveyed programmatically. `search_code` the form's error-display logic and check whether the invalid input also sets `aria-invalid="true"` and `aria-describedby` pointing at the message — a red border and a paragraph with neither attribute is invisible to a screen reader (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 4.1.2 Name, Role, Value).
42
+ - [ ] `aria-*` attributes are valid for their element's role and are not contradicting native semantics. `search_code` for `aria-hidden="true"` and read what it wraps — a focusable element inside an `aria-hidden` subtree is reachable by keyboard but invisible to assistive tech, which is worse than not hiding it at all (W3C WAI, WAI-ARIA 1.2, current, https://www.w3.org/TR/wai-aria-1.2/ — ARIA is a supplement for native semantics, not a replacement).
39
43
 
40
44
  ## Perception
41
45
 
42
- - [ ] Colour is never the only carrier of meaning — error states, status badges, chart series. `search_code` the status-badge/error-text component and read whether an icon or text label ships alongside the colour class, or whether the colour class is the only differentiator between states.
43
- - [ ] Text contrast meets 4.5:1 (3:1 for large text) **in every declared theme**, not only the default one. Extract the foreground/background pairs from each theme's token file (found via `design-system.md`'s token source) and compute the ratio per pair; do not eyeball it. Where `design-system.md` found a partially covered theme, that gap is a contrast gap too.
44
- - [ ] Content reflows at narrow widths. `search_code` the page-level container styles for a fixed `width`/`min-width` in px with no responsive override — a hard floor above ~320px is a static signal reflow will fail. Confirming actual reflow at 320px and 200% zoom needs a browser and belongs under Out of static reach.
45
- - [ ] Motion respects `prefers-reduced-motion`. `search_code` for it — its absence alongside animation is a finding.
46
+ - [ ] Colour is never the only carrier of meaning — error states, status badges, chart series. `search_code` the status-badge/error-text component and read whether an icon or text label ships alongside the colour class, or whether the colour class is the only differentiator between states (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 1.4.1 Use of Color).
47
+ - [ ] Text contrast meets 4.5:1 (3:1 for large text) **in every declared theme**, not only the default one. `Read` each theme's token file (found via `design-system.md`'s token source) to extract the foreground/background pairs and compute the ratio per pair; do not eyeball it. Where `design-system.md` found a partially covered theme, that gap is a contrast gap too (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 1.4.3 Contrast Minimum, 4.5:1).
48
+ - [ ] Icon fills/strokes, input borders, and custom-control outlines meet 3:1 against their adjacent background **in every declared theme** — not just text. `Read` the same theme token files used for the text-contrast check and compute the ratio for border-color/icon-color tokens against their background token, the same way the existing text-contrast check does. Rule out: the element is purely decorative (`aria-hidden`, no functional meaning) — 1.4.11 only applies to UI components and graphical objects required to understand content (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 1.4.11 Non-text Contrast (AA), 3:1 for UI components and graphical objects, a distinct criterion from 1.4.3's 4.5:1 text threshold above).
49
+ - [ ] Content reflows at narrow widths. `search_code` the page-level container styles for a fixed `width`/`min-width` in px with no responsive override — a hard floor above ~320px is a static signal reflow will fail. Confirming actual reflow at 320px and 200% zoom needs a browser and belongs under Out of static reach (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 1.4.10 Reflow).
50
+ - [ ] Motion respects `prefers-reduced-motion`. `search_code` for it — its absence alongside animation is a finding (MDN Web Docs, Mozilla, current, https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion — such animations "can trigger discomfort for those with vestibular motion disorders"; the recommended pattern substitutes a safer effect, opacity/colour change, rather than deleting all motion).
46
51
 
47
52
  ## Dynamic content
48
53
 
49
- - [ ] Async status changes are announced. `search_code` for `aria-live` — if the loading/success/error states from `flow-integrity.md`'s triad render with no `aria-live` region anywhere in the tree, none of them are announced; they just silently change on screen.
54
+ - [ ] Async status changes are announced. `search_code` for `aria-live` — if the loading/success/error states from `flow-integrity.md`'s triad render with no `aria-live` region anywhere in the tree, none of them are announced; they just silently change on screen (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/ — SC 4.1.3 Status Messages).
50
55
  - [ ] Client-side route changes move focus and update the document title. `search_code` the router's top-level layout or navigation listener for a `document.title =` assignment and a `.focus()` call triggered on route change — a single-page app with neither leaves a screen-reader user oriented on the previous page after every navigation.
51
56
  - [ ] Auto-dismissing messages last long enough to be read, or are dismissible. `find_symbol` the toast/notification component and read its default duration and whether hover/focus pauses the timer — a fixed short timeout with no pause and no manual dismiss fails both ways.
57
+ - [ ] The document declares a non-empty, plausible `lang` attribute on `<html>`. `search_code` for the root layout/template (`_document`, `app/layout`, `index.html`, root Vue/Angular shell) and confirm `lang="..."` is present and not an empty string or an obviously wrong static value on a site with a working locale switcher. Rule out: the value is set programmatically at runtime from user locale (framework i18n) — confirm this by finding the assignment via `search_code`, don't flag it as missing just because it isn't a static string in the template (W3C WAI, WCAG 2.2 Understanding, current, https://www.w3.org/WAI/WCAG22/Understanding/language-of-page.html — SC 3.1.1 Language of Page: screen readers need the declared language to load correct pronunciation rules; WebAIM, WebAIM Million 2026, https://webaim.org/projects/million/ — missing document language present on 13.5% of the top million home pages, one of the six most persistent failures for seven consecutive years).
52
58
 
53
59
  ## Out of static reach
54
60
 
@@ -57,6 +63,22 @@ This module owns the compliance line — the attribute, the ratio, the target si
57
63
  - Rendered contrast where colours composite — overlays, opacity, gradients (cross-reference `design-system.md`).
58
64
  - Reflow behaviour at 320px and 200% zoom in an actual viewport.
59
65
  - Whether an auto-dismiss duration feels sufficient to a real reader, as opposed to merely exceeding a numeric threshold.
66
+ - Whether an existing `alt` value, `aria-label`, or reading order is actually meaningful for a sighted-equivalent understanding of the content — this module confirms the attribute exists, not that its content is right.
67
+ - A clean result here means the checked pattern is absent from the source the auditor read — it is not a claim that every rendered instance of every page, in every data state, was individually verified.
68
+
69
+ ## What browser observation closes
70
+
71
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
72
+
73
+ | Artefact | Gap it closes | Observed instance earns |
74
+ |---|---|---|
75
+ | `steps.md` | The keyboard walk end to end — whether every action candidate from the static sweep is actually reachable by keyboard, and whether tab order lands where the DOM/visual order implies | High |
76
+ | `a11y-snapshot.md` | An icon-only control's computed accessible name is empty (or wrong) as the browser's own accessibility tree resolves it, rather than inferred from source | High |
77
+ | computed styles via evaluate | Rendered contrast where colours composite — overlays, opacity, gradients — read from the applied colour, not a screenshot pixel | Medium |
78
+ | `steps.md` | Reflow behaviour at 320px and 200% zoom in an actual viewport | Medium |
79
+ | `screenshots/` + `a11y-snapshot.md` per Tab step | A Tab-order walk lands on an element whose bounding box is fully covered by a sticky header/footer/banner in the screenshot. Refuted if any part of the focused component's visible box remains uncovered — 2.4.11 requires the component not be *entirely* hidden, not zero overlap | High |
80
+ | `a11y-snapshot.md` | An interactive element's real computed accessible name, as the browser's own accessibility tree resolves it, is a raw ligature character or private-use-area codepoint instead of readable text. Refuted if the node is `aria-hidden` and correctly absent from the tree, or the parent's `aria-label` already overrides the leaked glyph | Medium |
81
+ | `steps.md` / an `evaluate` read of `document.documentElement.lang` after the app has hydrated | `document.documentElement.lang` resolves to empty or an unexpected value at runtime, including cases where a JS-set locale never actually ran. Refuted if the app deliberately defers `lang` assignment until after an async locale-detection step that has not yet completed in this specific step's timing — re-check on a later step before flagging | Medium |
60
82
 
61
83
  ## Severity guidance
62
84
 
@@ -73,3 +95,9 @@ This module owns the compliance line — the attribute, the ratio, the target si
73
95
  | Missing `alt` on a meaningful image | Medium |
74
96
  | Heading levels skipped | Low |
75
97
  | No `prefers-reduced-motion` handling | Low |
98
+ | Focused element fully hidden behind sticky header/footer/banner | High |
99
+ | Redundant re-entry required in a multi-step form | Medium |
100
+ | Non-text UI contrast (icon/border/outline) below 3:1 | Medium |
101
+ | Missing or empty `<html lang>` | Medium |
102
+ | Icon-font glyph leaking into an element's accessible name | Medium |
103
+ | Custom ARIA widget missing its APG keyboard interaction pattern | Medium |
@@ -9,43 +9,63 @@ Model IDs, token limits, and pricing drift faster than this file can be kept cur
9
9
  ## Prompt construction
10
10
 
11
11
  - [ ] Prompts live in one place, not scattered as inline string literals across call sites. `search_code` a distinctive prompt phrase to find the duplicates; more than one call site building the same prompt shape is the finding.
12
- - [ ] User input is clearly delimited from instructions. `find_callees` on the prompt-construction function for a raw string concatenation of a user-supplied variable directly into the instruction text, with no delimiter — a tag, a separate message role, a fenced block. Concatenation with no delimiter is prompt injection — cross-reference `Abuse`.
13
- - [ ] Input length is bounded before it reaches the model. `find_callees` on the prompt-construction function for a truncation/chunking call between the raw input and the model call; its absence is both an injection surface and an unbounded bill.
12
+ - [ ] User input is clearly delimited from instructions. `find_callees` on the prompt-construction function for a raw string concatenation of a user-supplied variable directly into the instruction text, with no delimiter — a tag, a separate message role, a fenced block. Concatenation with no delimiter is a prompt-injection vulnerability — the surface an attacker needs. Flag its absence as the finding; the attack itself still requires adversarial content in that input, which this check does not and cannot confirm — cross-reference `Abuse`. OWASP LLM01:2025 Prompt Injection and Greshake et al., "Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection" (arXiv:2302.12173) — content injected into concatenated data can "manipulate the application's functionality, and control how and if other APIs are called." Rule out: input drawn from a closed, validated set (an enum, a whitelist, a dropdown selection) is not the finding even when concatenated raw — confirm the input is free text before flagging.
13
+ - [ ] Input length is bounded before it reaches the model. `find_callees` on the prompt-construction function for a truncation/chunking call between the raw input and the model call; its absence is both a denial-of-wallet risk (OWASP LLM10:2025 Unbounded Consumption — "the cost-per-use model of cloud-based AI services") and, when the unbounded input is untrusted, a wider surface for the injection risk named above — these are two different OWASP LLM Top 10 categories, not one.
14
14
  - [ ] Prompts are versioned or at least dated. `search_code` for a version/date marker near the prompt constant or file; its absence means a behaviour change can never be correlated with which prompt produced it.
15
15
 
16
16
  ## Model contract
17
17
 
18
18
  - [ ] The model identifier is configurable, not hardcoded at each call site. `search_code` the model-name string literal and count the call sites — more than one occurrence means a future migration touches N places.
19
- - [ ] The code states which capabilities it depends on (tool use, structured output, context window). `find_symbol` the call site's request options and confirm the dependency is declared there or in an adjacent comment, not assumed silently.
20
- - [ ] Token limits are respected explicitly: input is truncated or chunked with a stated strategy. `find_callees` on the call site for a truncation/chunking step keyed to a declared limit, rather than a bare call left to fail at the API boundary.
19
+ - [ ] The code states which capabilities it depends on (tool use, structured output, context window). `find_symbol` the call site's request options and confirm the dependency is declared there or in an adjacent comment, not assumed silently. Tool use requires a declared `input_schema`, and `strict: true` on a tool definition guarantees the model's call matches that schema exactly (Anthropic tool-use documentation) — a declared dependency is what this check is confirming exists.
20
+ - [ ] Token limits are respected explicitly: input is truncated or chunked with a stated strategy. `find_callees` on the call site for a truncation/chunking step keyed to a declared limit, rather than a bare call left to fail at the API boundary. OWASP LLM10:2025 Unbounded Consumption names "Continuous Input Overflow" (inputs exceeding the context window) as a named exhaustion pattern this check closes.
21
+ - [ ] Where prompt caching is used, the `cache_control` breakpoint is `Read` at its call site to confirm it marks a block whose content is identical across requests, not one assembled from a timestamp, request id, or the latest user turn. A breakpoint on a per-request-unique block is a cache write on every call with no error surfaced — check the token-usage fields the client logs (`cache_read_input_tokens` vs `cache_creation_input_tokens`) for a hit rate of zero. Not the finding: the apparently-dynamic content actually sits after the marked block in assembly order, so the marked block genuinely is the stable prefix — read the block ordering, not just presence of dynamic-looking data nearby. Anthropic's prompt-caching documentation names exactly this as a common mistake: a breakpoint on a block that changes every request never finds a prior write, billing the write rate on every call with no error returned.
21
22
  - [ ] Temperature and sampling are set deliberately where determinism matters. `search_code` the call site's options object; an omitted temperature on a call whose output feeds a downstream parser is the finding — an unset value is provider-chosen, not a decision anyone made.
22
23
 
23
24
  ## Output handling
24
25
 
25
- - [ ] **Model output is untrusted input.** `find_callees` on the response-handling code for the output reaching `eval`, a shell command, a query, or a filesystem path with no validation in between. A model-generated path reaching `readFile` is `Critical`.
26
- - [ ] Structured output is parsed defensively — malformed JSON is an expected case, not an exception. `find_callees` on the parse call for a surrounding try/catch or a result type distinguishing malformed output from a valid one; a bare parse call with no catch is the finding.
27
- - [ ] There is a defined behaviour for a refusal, an empty response, and a truncated response. `find_symbol` the response handler and confirm each of the three cases has its own branch — a handler that only checks truthiness collapses all three into one path.
28
- - [ ] Hallucination-sensitive outputs (file paths, symbol names, citations) are verified against reality before being acted on or shown. `find_callees` on the code consuming such output for a verification step (a filesystem check, a symbol lookup) before the value is used.
26
+ - [ ] **Model output is untrusted input.** `find_callees` on the response-handling code for the output reaching `eval`, a shell command, a query, or a filesystem path with no validation in between. A model-generated path reaching `readFile` is `Critical`. OWASP LLM05:2025 Improper Output Handling: "treat the model as any other user, adopting a zero-trust approach" — the same risky-sink list this check enumerates (RCE, SQL injection, path traversal, XSS).
27
+ - [ ] Structured output is parsed defensively — malformed JSON is an expected case, not an exception. `find_callees` on the parse call for a surrounding try/catch or a result type distinguishing malformed output from a valid one; a bare parse call with no catch is the finding. Structured-output guarantees still leave a response that can be incomplete (max-token cutoff, safety interruption mid-generation) even when schema-conformant (OpenAI Structured Outputs documentation).
28
+ - [ ] There is a defined behaviour for a refusal, an empty response, and a truncated response. `find_symbol` the response handler and confirm each of the three cases has its own branch — a handler that only checks truthiness collapses all three into one path. A refusal surfaces via a dedicated field distinct from the schema (OpenAI's `refusal` field is the documented example) — a handler with no branch for it silently treats a refusal as valid parsed output.
29
+ - [ ] Hallucination-sensitive outputs (file paths, symbol names, citations) are verified against reality before being acted on or shown. `find_callees` on the code consuming such output for a verification step (a filesystem check, a symbol lookup) before the value is used. OWASP LLM05:2025's zero-trust framing applies here too: an unverified model-generated reference is treated as fact without the check this line requires.
29
30
 
30
31
  ## Failure and degradation
31
32
 
32
- - [ ] Every model call has a timeout and a bounded retry with backoff. `find_symbol` the client construction/call site for a timeout option and a retry wrapper; either missing is `High`.
33
- - [ ] Rate limits and quota errors are distinguished from real failures and handled differently. `find_callees` on the error handler for a status-code or error-type branch specific to rate-limit/quota, versus a single generic catch-all.
33
+ - [ ] Every model call has a timeout and a bounded, backed-off retry — owned by `failure.md` (`Read` the client construction/call site for a `timeout` option or `AbortSignal.timeout`, and a retry wrapper's backoff config); reuse its finding, do not re-report. A model call is an external call like any other for this angle.
34
+ - [ ] Rate limits and quota errors are distinguished from real failures and handled differently. `find_callees` on the error handler for a status-code or error-type branch specific to rate-limit/quota, versus a single generic catch-all. The retry/backoff wrapper, `Read` at its error-branch, must also distinguish a spend-cap-reached error from an ordinary rate limit before retrying — both return `error.type: "rate_limit_error"`, but only the rate limit carries a `retry-after` header and a transient cause (Anthropic's rate-limits documentation: a spend-cap error carries no `retry-after` and "retrying... fails until access resumes" at the start of the next calendar month). A wrapper that retries any `rate_limit_error` uniformly will keep retrying a spend-cap block that cannot succeed until next month; the wrapper's own max-retry count and backoff ceiling already bounding the wasted calls to a handful is not the finding — read those constants before treating the blind retry as a real cost concern.
34
35
  - [ ] There is a degraded path when the provider is unavailable — a cheaper model, a cached answer, or an honest error. `find_callees` on the call site's catch block for a fallback path; a bare rethrow with nothing downstream to handle it is silent failure, the worst option.
35
- - [ ] Streaming responses handle mid-stream disconnection without leaving partial state committed. `find_callees` on the stream consumer for a cleanup/rollback path on stream error, not only on stream completion.
36
+ - [ ] Streaming responses handle mid-stream disconnection without leaving partial state committed. `find_callees` on the stream consumer for a cleanup/rollback path on stream error, not only on stream completion. The stream-error/reconnect handler, `find_callees` from the error branch, must never route a partially-received `tool_use` block to the tool-execution path before the stream reaches a completed `stop_reason` — recovery re-sends or resumes text content only. A path where resume logic can trigger a second dispatch of a side-effecting tool is the finding; Anthropic's streaming documentation: "Tool use and extended thinking blocks cannot be partially recovered." Not the finding: the tool reached by the resumed dispatch is read-only or idempotent, so even a duplicate call has no observable side effect — confirm the tool's own idempotency before flagging.
37
+
38
+ ## Tool execution boundary
39
+
40
+ - [ ] A tool call whose name or effect is destructive (delete, deploy, migrate, send, pay, publish) reaches its downstream sink through an authorization or confirmation check the model's own output cannot satisfy. `find_callees` on the tool-dispatch function for a permission/allow-list/human-confirmation step between the model's `tool_use` block and the sink; a call path with none is the finding. Cross-reference `Abuse` and `security.md`. OWASP LLM06:2025 Excessive Agency: "fails to independently verify and approve high-impact actions"; mitigation is to "enforce authorization in the downstream system, not in the LLM's own decision." Not the finding: the action requires a separate human-originated UI event outside the model's own tool-calling turn (a person clicks "confirm" through a control the model cannot invoke) — rule this out by checking whether the call graph from `tool_use` to the sink can complete in one turn with no human-side entry point in between.
41
+ - [ ] A tool or MCP server's declared capability set is no broader than what the code's call sites actually invoke. `search_code` the tool/extension registration for its declared scope, then `find_callers` on each declared capability to confirm the code path that would use it exists; a declared write/delete/admin capability with no corresponding call site is the finding. OWASP LLM06:2025's excessive-functionality and excessive-permissions root causes are exactly this over-grant pattern. Not the finding: the unused capability is kept for a documented, currently-disabled flow (a feature flag, a beta path) — confirm no such flag exists before flagging as pure over-grant.
36
42
 
37
43
  ## Evaluation
38
44
 
39
- - [ ] Some check exists that the AI feature still works — golden tests, snapshot comparisons, or a manual procedure that is written down. `search_code` the test directory for a golden-file, snapshot, or fixture referencing the prompt/model call; its absence in a project with tests elsewhere is the finding.
40
- - [ ] Non-determinism is handled in tests: either a fake client (assert the request, not the response) or tolerance-based assertions. Read the test found above — an assertion on exact model prose, rather than on the request sent or a tolerance/schema check on the response, is a flake generator.
45
+ - [ ] Some check exists that the AI feature still works — golden tests, snapshot comparisons, or a manual procedure that is written down. `search_code` the test directory for a golden-file, snapshot, or fixture referencing the prompt/model call; its absence in a project with tests elsewhere is the finding. Anthropic's own eval-design guidance: task-specific, automated grading over hand-graded assertions.
46
+ - [ ] Non-determinism is handled in tests: either a fake client (assert the request, not the response) or tolerance-based assertions. Read the test found above — an assertion on exact model prose, rather than on the request sent or a tolerance/schema check on the response, is a flake generator. Anthropic's eval-design guidance: non-determinism is handled with large test sets and semantic grading (embedding cosine similarity, ROUGE-L, LLM-based rubric scoring), not exact-string assertions on model prose.
41
47
 
42
48
  ## Out of static reach
43
49
 
44
50
  - Actual model behaviour on adversarial input — whether a delimiter or guard genuinely resists injection can only be shown by running attacks against the live model.
45
51
  - Real token counts and cost per call — these depend on the provider's tokenizer and current pricing, neither visible from source.
46
52
  - Whether the declared timeout/retry values are well-tuned for the provider's real latency distribution.
47
- - Actual output quality or hallucination rate — this requires running the eval suite, not reading it.
53
+ - Actual output quality or hallucination rate — this requires running the eval suite, not reading it — closed by `runtime.md` when execution is enabled and the project's declared test command includes the golden/eval suite named under Evaluation above.
48
54
  - Provider-side rate limits and quota — these live in the provider account, not the repository.
55
+ - Whether prompt caching actually pays off at production traffic volume — this module can only confirm the breakpoint is placed on stable content, not that it is hit often enough to matter.
56
+ - Whether a connected tool server does only what its declared schema says — this module reads the client's side of the contract, not the server's implementation.
57
+ - Whether a required human confirmation step is meaningfully reviewed before being clicked through — this module can confirm the gate exists, not that it is used with judgement.
58
+ - Whether the declared token-limit handling is exercised often in practice, or is dead code for inputs that never get that large — this module cannot see production input sizes.
59
+
60
+ ## What browser observation closes
61
+
62
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
63
+
64
+ | Artefact | Gap it closes | Observed instance earns |
65
+ |---|---|---|
66
+ | `network.jsonl` | Provider API key reachable from the browser — a page-initiated JS request to a known provider API host (e.g. an `api.anthropic.com`/`api.openai.com`-class host) carrying an API-key-shaped header, not a same-origin proxy path. Refuted if the request's initiator is a same-origin path proxied server-side | Critical |
67
+ | `screenshots/` + `console.jsonl` | A refusal, empty, or truncated model response renders as raw JSON, a blank pane, or an uncaught client error, on a confirmed AI-feature flow. Refuted if the flow's own steps never actually produced a refusal/truncation — report as not observed, not as clean | High |
68
+ | `steps.md` + `screenshots/` | A streaming AI response hangs with no timeout surfaced to the user — elapsed-time capture plus a stuck loading/typing indicator past the flow's own step boundary. Refuted if the hang resolves within the flow's own recorded step time | Medium |
49
69
 
50
70
  ## Severity guidance
51
71
 
@@ -53,9 +73,13 @@ Model IDs, token limits, and pricing drift faster than this file can be kept cur
53
73
  |---|---|
54
74
  | Model output reaching `eval`, a shell, a query, or a path | Critical |
55
75
  | User input concatenated into an instruction block unbounded | High |
56
- | No timeout on a model call | High |
57
76
  | No validation of structured output before use | High |
58
77
  | No degraded path when the provider is down | Medium |
59
78
  | Model identifier hardcoded at multiple call sites | Medium |
60
79
  | No evaluation of the AI feature at all | Medium |
61
80
  | Prompts duplicated as inline literals | Low |
81
+ | Destructive tool call reaches its sink with no authorization/confirmation gate between `tool_use` and the sink (traced) | Critical |
82
+ | Partially-streamed `tool_use` block re-dispatched to a side-effecting tool on stream resume (traced) | High |
83
+ | Retry wrapper retries a spend-cap 429 the same way as a rate-limit 429 | Medium |
84
+ | Declared tool/MCP capability broader than any call site actually invokes | Medium |
85
+ | Prompt-cache breakpoint placed on per-request-unique content (zero hit rate) | Medium |