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
|
@@ -8,64 +8,86 @@ The FinOps Foundation's Framework (2026 refresh, now scoped beyond cloud to AI/M
|
|
|
8
8
|
|
|
9
9
|
## Inventory the meters
|
|
10
10
|
|
|
11
|
-
- [ ] Every operation that bills: `get_architecture` for the dependency manifest, then `search_code` the provider SDK imports — model calls, cloud services, payment SDKs, email/SMS providers. Build the meter list from what actually imports, not from what the project claims to use.
|
|
11
|
+
- [ ] Every operation that bills: `get_architecture` for the dependency manifest, then `search_code` the provider SDK imports — model calls, cloud services, payment SDKs, email/SMS providers. Build the meter list from what actually imports, not from what the project claims to use. This is the Inform phase — visibility first — of the FinOps loop (FinOps Foundation, official framework page, 2026, https://www.finops.org/framework/).
|
|
12
12
|
- [ ] For each one, the unit it bills on: `find_symbol`/read the client construction and call site to identify the billed dimension — tokens, requests, gigabytes, seconds, rows scanned.
|
|
13
|
-
- [ ] For each one, **what bounds it**: `search_code` near each call site for a limit, quota check, or cap (`maxTokens`, `limit`, `maxRetries`). If nothing is there, that is the finding regardless of current volume.
|
|
14
|
-
- [ ] Metered calls reachable by an unauthenticated caller: `trace_path` (or `find_callers`) from an unauthenticated route to the metered call. A path that exists here is `traced`, not `inferred` — that is someone else spending your money. Cross-reference `abuse.md`.
|
|
13
|
+
- [ ] For each one, **what bounds it**: `search_code` near each call site for a limit, quota check, or cap (`maxTokens`, `limit`, `maxRetries`). If nothing is there, that is the finding regardless of current volume. This is the Operate phase — the ongoing bound that keeps waste from recurring (FinOps Foundation, official framework page, 2026, https://www.finops.org/framework/); it directly mitigates Unbounded Consumption, where "high-volume operations exploit pay-per-use cloud AI services, causing unsustainable financial burdens" (OWASP GenAI Security Project, LLM10:2025, 2025, https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/).
|
|
14
|
+
- [ ] Metered calls reachable by an unauthenticated caller: `trace_path` (or `find_callers`) from an unauthenticated route to the metered call. A path that exists here is `traced`, not `inferred` — that is someone else spending your money. Cross-reference `abuse.md`. This is Denial of Wallet by definition — "high-volume operations exploit pay-per-use cloud AI services, causing unsustainable financial burdens" (OWASP GenAI Security Project, LLM10:2025, 2025, https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/).
|
|
15
|
+
- [ ] `search_code` for a request/query parameter (`count`, `limit`, `pages`, `depth`, `n`, `batch_size`, or similar) at an authenticated or unauthenticated handler, then `Read` the handler and the metered call site to confirm whether that parameter reaches the number of metered calls issued, or the size/token ceiling of one call, unclamped by a server-side maximum. A client-controlled multiplier on paid work with no server-side cap is Denial of Wallet by design, not by bug, whether or not the caller is authenticated — this applies even to an authenticated caller, which the check above does not cover. Refuted if the parameter is clamped by a validation/schema layer upstream of the handler (a shared middleware, an API-gateway request-schema max) — confirmed by reading that layer, not assumed absent because it isn't in the handler itself. Named explicitly as "Denial of Wallet (DoW)" and "Variable-Length Input Flood" (OWASP GenAI Security Project, LLM10:2025, 2025, https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/).
|
|
15
16
|
|
|
16
17
|
## Bounds
|
|
17
18
|
|
|
18
|
-
- [ ] Metered calls inside loops: `find_callees` on the loop body — a per-item model call over an unbounded list is the classic runaway.
|
|
19
|
-
- [ ]
|
|
20
|
-
- [ ]
|
|
21
|
-
- [ ]
|
|
22
|
-
- [ ]
|
|
23
|
-
- [ ]
|
|
19
|
+
- [ ] Metered calls inside loops: `find_callees` on the loop body — a per-item model call over an unbounded list is the classic runaway. Rule out a loop whose input is already provably bounded (a small fixed-size array, an earlier `.slice(0, N)`) before flagging it as the runaway pattern. Named "Variable-Length Input Flood" — numerous inputs deplete resources (OWASP GenAI Security Project, LLM10:2025, 2025, https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/).
|
|
20
|
+
- [ ] For a metered call inside an event handler (queue consumer, storage-trigger function, pub/sub subscriber), `search_code` the same handler for a write back to the resource that invokes it (the same queue, topic, or bucket name on both the trigger binding and an outbound call) with no depth counter, dedup key, or max-invocation guard in between — a handler that re-triggers its own event source bills, and can throttle the whole account, once per cycle with no natural ceiling. Refuted if the outbound write target is provably distinct from the trigger source (a dead-letter queue, a different bucket/prefix, an output topic with no subscription back to this handler) — confirmed by reading both bindings, not by name similarity. Also refuted, but only down to Low/Info rather than dropped entirely, if the platform's own default protection is confirmed present and unmodified — its presence is a platform fact to state, not evidence the code itself bounds anything. "Unintentional recursive loops can result in unexpected charges being billed to your AWS account," which is why AWS ships recursive-loop detection on by default (AWS, official product documentation, current, https://docs.aws.amazon.com/lambda/latest/dg/invocation-recursion.html).
|
|
21
|
+
- [ ] Input size bounded before a token-billed call, not after: Read the call site's input construction for a truncation or size check before the payload is sent. Cross-reference `ai.md`. "Continuous Input Overflow: inputs exceeding the LLM's context window cause excessive computational resource consumption"; the mitigation is "strict input validation to ensure inputs do not exceed reasonable size limits" (OWASP GenAI Security Project, LLM10:2025, 2025, https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/).
|
|
22
|
+
- [ ] Output length capped: `search_code` for `max_tokens`/`maxOutputTokens` (or the SDK's equivalent) at each LLM call site. Missing, or set far above what the feature needs, bills for whatever the model decides to say. OTPM is billed on actual generated tokens — `max_tokens` caps the bill, not the rate limit (Anthropic, official API documentation, current, https://platform.claude.com/docs/en/api/rate-limits).
|
|
23
|
+
- [ ] Retries bounded and backed off — owned by `failure.md` (`search_code` for a retry wrapper near each call site; read its config for max attempts and backoff); reuse its finding, do not re-report. An unbounded retry against a paid endpoint bills for every attempt, which is this module's angle on the same defect. Unsuccessful requests still count against rate limits, "so continuously resending a request won't work" (OpenAI, official API documentation, current, https://developers.openai.com/api/docs/guides/rate-limits).
|
|
24
|
+
- [ ] Where a retry wrapper exists around a metered API call (reuse `failure.md`'s discovery of it), `Read` its retry predicate: does it distinguish a spend-cap/quota-exhausted response (no `retry-after` header, a distinct error code) from a transient rate-limit response (has `retry-after`)? A generic "retry on any 429" treats both the same, so a caller that has already hit its hard cap keeps burning retry budget and clock time until the wrapper's own attempt limit — and the operator sees "elevated 429 rate," not "we are out of budget." Refuted if the retry wrapper already inspects the error type/code and short-circuits (no retry, or a distinct alert) on a spend-cap-shaped response — confirmed by reading the branch, not assumed from a generic catch-all retry existing. A spend-cap 429 carries no `retry-after` header specifically because "retrying, including the SDKs' automatic retries, fails until access resumes" — the vendor itself distinguishes this case as unrecoverable-by-retry (Anthropic, official API documentation, current, https://platform.claude.com/docs/en/api/rate-limits).
|
|
25
|
+
- [ ] Fan-out bounded: `find_callers` on each metered call to check whether it sits behind a loop over user-supplied input or a per-webhook handler — one user action must not trigger an unbounded number of paid calls. This is Denial of Wallet's dynamic-resource-allocation-management mitigation in its inverse (OWASP GenAI Security Project, LLM10:2025, 2025, https://genai.owasp.org/llmrisk/llm102025-unbounded-consumption/), and the concrete mechanism named above — an event trigger fanning a function back into itself — is exactly what AWS's own recursive-loop detection targets (AWS, official product documentation, current, https://docs.aws.amazon.com/lambda/latest/dg/invocation-recursion.html).
|
|
26
|
+
- [ ] A hard ceiling exists somewhere, not only a notification: `search_code` for a rate limiter, spend cap, or circuit breaker that actually stops calls once a threshold is crossed, versus a budget alert that only notifies a human. A notify-only alert with nothing enforcing a stop is a weaker control than it looks — call that out distinctly from having neither, which is the stronger finding. A budget can trigger only a notification, or a "budget action" that enforces (e.g. an IAM policy denying further provisioning) — but even an enforcing budget action is only as fast as its evaluation cycle, which updates "up to three times a day" with an additional undocumented delay between incurred charge and detection (AWS, official product documentation, current, https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html); a request-time spend cap checked synchronously on every call, by contrast, blocks immediately (Anthropic, official API documentation, current, https://platform.claude.com/docs/en/api/rate-limits). State which of the three states applies — no ceiling, a batch-evaluated ceiling with real lag, or a synchronous per-request ceiling — rather than only "ceiling vs. notification."
|
|
24
27
|
|
|
25
28
|
## Waste
|
|
26
29
|
|
|
27
|
-
- [ ] Repeated identical paid calls with no cache: `search_code` near each metered call site for a cache check preceding it, the same technique as the caching checks in `performance.md`. Here the missing cache costs money rather than latency.
|
|
28
|
-
- [ ] Cache in place but the key omits a dimension: `find_symbol` the cached call's signature, then read the key expression against every parameter that affects cost or output — a missing parameter means it never hits for varying inputs.
|
|
29
|
-
- [ ] The most expensive tier used for work a cheaper one handles:
|
|
30
|
+
- [ ] Repeated identical paid calls with no cache: `search_code` near each metered call site for a cache check preceding it, the same technique as the caching checks in `performance.md`. Here the missing cache costs money rather than latency. A cache read runs roughly 0.1x the base input token price against a cache write of 1.25x-2x — the premise that caching is materially cheaper than a repeated call (Anthropic, official API documentation, current, https://platform.claude.com/docs/en/build-with-claude/prompt-caching).
|
|
31
|
+
- [ ] Cache in place but the key omits a dimension: `find_symbol` the cached call's signature, then read the key expression against every parameter that affects cost or output — a missing parameter means it never hits for varying inputs. "Cache hits require 100% identical prompt segments, including all text and images up to and including the block marked with cache control" — a changed parameter anywhere in that prefix invalidates the cache from that point forward, silently turning a should-be-cheap call into a full-price one (Anthropic, official API documentation, current, https://platform.claude.com/docs/en/build-with-claude/prompt-caching).
|
|
32
|
+
- [ ] The most expensive tier used for work a cheaper one handles: Read the model/instance parameter at each call site (a literal model name, an instance size) and compare it against the task — a large model doing pure classification, a premium instance running a cron job.
|
|
33
|
+
- [ ] For a metered LLM call inside a background job, cron, bulk-import, seed script, or eval harness (not a live user-facing request), `search_code`/`Read` the call site's client construction to confirm it does not use the provider's batch endpoint. A loop issuing N synchronous calls where a single batch submission would do is a documented, named optimization the code is leaving on the table. Refuted if the job has a real low-latency requirement despite running unattended, or is already batching by other means, or the workload's volume is small enough that batch's own minimum overhead isn't worth it — state which applies before flagging. The Message Batches API is "a cost-effective way to asynchronously process large volumes of Messages requests... reducing costs by 50%" for exactly this non-interactive, delay-tolerant profile (Anthropic, official API documentation, current, https://platform.claude.com/docs/en/build-with-claude/batch-processing).
|
|
30
34
|
- [ ] Paid calls whose results are discarded, made speculatively, or duplicated across code paths: `find_callers` on each metered call for a count greater than one with no shared cache between the call sites, or a returned value that is never assigned or used.
|
|
31
|
-
- [ ] Provisioned capacity far above observed use:
|
|
32
|
-
- [ ] Storage with no retention policy: `search_code` for a TTL/retention/cleanup job on the bucket or table backing metered storage — it only grows, and it bills monthly forever. Cross-reference `privacy.md`, where retention is also a compliance question.
|
|
33
|
-
- [ ] Egress from chatty cross-region or cross-zone traffic: `search_code` for multi-region client construction or replication config paired with per-request (rather than batched) calls across that boundary.
|
|
35
|
+
- [ ] Provisioned capacity far above observed use: Read the IaC/deploy config for instance size or plan tier alongside any usage figure surfaced in code, config, or comments. This is usually `inferred` without a real usage number — say so. Cross-reference `infrastructure.md`. Matching supply to demand is its own named goal area — "Manage demand and supply resources" — not a one-time pass (AWS, official whitepaper, Well-Architected Framework, 2024-06-27, https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html).
|
|
36
|
+
- [ ] Storage with no retention policy: `search_code` for a TTL/retention/cleanup job on the bucket or table backing metered storage — it only grows, and it bills monthly forever. Cross-reference `privacy.md`, where retention is also a compliance question. "By default, log data is stored in CloudWatch Logs indefinitely" — retention must be set explicitly (AWS, official product documentation, current, https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html).
|
|
37
|
+
- [ ] Egress from chatty cross-region or cross-zone traffic: `search_code` for multi-region client construction or replication config paired with per-request (rather than batched) calls across that boundary. Cloud egress pricing carries a documented markup over wholesale bandwidth cost — 357% in South Korea, the post's own lowest-markup market — and has not fallen since 2018 despite wholesale cost more than halving (Cloudflare, official engineering blog, current, https://blog.cloudflare.com/aws-egregious-egress/).
|
|
38
|
+
- [ ] `search_code` for a direct object-storage or origin URL used as an asset source (images, video, downloads, generated exports) with no CDN/edge-cache domain, reverse proxy, or `Cache-Control` header in front of it. Every repeat request to that URL re-incurs the origin's per-GB internet egress fee instead of a CDN's edge-cached bandwidth. Refuted if the asset is low-traffic or small, or a CDN/reverse proxy is present under a config file the initial search missed — confirmed by reading the actual deploy/routing config, not assumed from its absence at the obvious call site. Same documented egress markup as the check above — client-facing repeat reads rather than internal replication traffic (Cloudflare, official engineering blog, current, https://blog.cloudflare.com/aws-egregious-egress/).
|
|
34
39
|
|
|
35
40
|
## Development and test cost
|
|
36
41
|
|
|
37
|
-
- [ ] Tests
|
|
38
|
-
- [ ] Development and staging have their own, smaller budgets:
|
|
39
|
-
- [ ] Nothing left running by default in non-production: `search_code` the deploy/IaC config for an auto-shutdown or scale-to-zero setting on non-production environments — its absence means idle instances bill exactly like busy ones.
|
|
42
|
+
- [ ] Tests hitting paid endpoints — owned by `testing.md` (`search_code` for a live API base URL, an unmocked SDK client, or a real API key referenced in `*.test.*`); reuse its finding, do not re-report. A test suite that bills per run is the cost angle of that same finding, alongside the flakiness angle `testing.md` reports.
|
|
43
|
+
- [ ] Development and staging have their own, smaller budgets: Read the per-environment config (`.env.staging`, an environment-scoped IaC file) for instance size or quota values distinct from production. Per-Workspace spend/rate limits set below the org cap exist specifically "to protect Workspaces in your Organization from potential overuse" (Anthropic, official API documentation, current, https://platform.claude.com/docs/en/api/rate-limits).
|
|
44
|
+
- [ ] Nothing left running by default in non-production: `search_code` the deploy/IaC config for an auto-shutdown or scale-to-zero setting on non-production environments — its absence means idle instances bill exactly like busy ones. Matching supply to demand — scaling non-production to zero when idle — is its own named cost-optimization goal area (AWS, official whitepaper, Well-Architected Framework, 2024-06-27, https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html).
|
|
40
45
|
|
|
41
46
|
## Attribution
|
|
42
47
|
|
|
43
|
-
- [ ] Spend is attributable to a feature, tenant, or endpoint: `search_code` for a cost-allocation tag, a billing label, or a tenant/feature identifier passed alongside each metered call — the dimensions that cover most real chargeback needs are team, project, environment (dev/staging/prod), model-or-resource-name, and cost-centre. Without attribution across at least some of these you can see the total and change nothing.
|
|
48
|
+
- [ ] Spend is attributable to a feature, tenant, or endpoint: `search_code` for a cost-allocation tag, a billing label, or a tenant/feature identifier passed alongside each metered call — the dimensions that cover most real chargeback needs are team, project, environment (dev/staging/prod), model-or-resource-name, and cost-centre. Without attribution across at least some of these you can see the total and change nothing. Tags let a "cost allocation report include usage and costs aggregated by tags" (AWS, official product documentation, current, https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html).
|
|
44
49
|
- [ ] Usage is recorded per operation where it bills per unit: `search_code` for a usage metric emitted alongside each metered call, the same probe technique as the coverage check in `observability.md`. Without it, a spike is undiagnosable.
|
|
45
|
-
- [ ] Someone would notice a 10× increase within a day: `search_code` for a budget alert or spend-threshold config (an IaC alert resource, a billing webhook handler). If the only detection mechanism found is the monthly invoice, that is the finding.
|
|
50
|
+
- [ ] Someone would notice a 10× increase within a day: `search_code` for a budget alert or spend-threshold config (an IaC alert resource, a billing webhook handler). If the only detection mechanism found is the monthly invoice, that is the finding. Budget data itself is documented as updating only "up to three times a day," with an additional delay between an incurred charge and the notification (AWS, official product documentation, current, https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-managing-costs.html).
|
|
51
|
+
|
|
52
|
+
## What browser observation closes
|
|
53
|
+
|
|
54
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
55
|
+
|
|
56
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| `network.jsonl` — request host and count per flow step, cross-referenced against the step count in `steps.md` | One user-facing flow step issues more requests to a metered/paid third-party host than the visible UI action implies (e.g. one click producing 3 identical calls to the same LLM/API host). Refuted if the extra calls are distinct operations (fetch, then submit) rather than duplicates of the same operation, or if a documented retry-on-transient-failure fired once. | Medium |
|
|
59
|
+
| `resource-perf.md` — bytes transferred per request, cross-referenced with `network.jsonl` host | Egress size to a metered/billed host on a confirmed flow is large relative to the flow's visible content (e.g. an uncompressed or unpaginated response body). Refuted if the payload size is inherent to the feature itself (e.g. a generated image or document the user asked for), not evidence of a missing size bound. | Low |
|
|
60
|
+
| `network.jsonl` — payload size per request to the same host across steps | The same request body (by size/shape) to the same metered host repeats across steps of one flow with no smaller follow-up response size that would indicate a cache hit. Refuted if the requests carry materially different parameters that legitimately vary the cache key. | Medium |
|
|
46
61
|
|
|
47
62
|
## Out of static reach
|
|
48
63
|
|
|
49
64
|
- The actual dollar amount billed — nothing here is checked against a real invoice.
|
|
50
65
|
- Real traffic volume through a metered path, and whether it is trending upward.
|
|
51
66
|
- Whether a cache or fallback actually hits at a meaningful rate in production.
|
|
52
|
-
- Whether a configured budget alert or quota has ever fired, versus merely being present.
|
|
67
|
+
- Whether a configured budget alert or quota has ever fired, versus merely being present — and, separately, whether a present alert fires soon enough to matter: budget data updates only up to three times daily and notifications lag incurred charges by an unspecified delay, so an alert's presence in IaC does not establish its timeliness.
|
|
53
68
|
- True cross-region egress volume and its cost.
|
|
69
|
+
- The vendor account's actual spend cap and usage tier — this audit reads what the code assumes, not what the console enforces.
|
|
70
|
+
- Whether a hardcoded cost ceiling or per-call cap still reflects the vendor's current pricing — this audit reads the number in the code, not whether it is still the right number.
|
|
71
|
+
- The dollar cost of the calls seen in one browser run — this module counts and sizes the calls, it does not price them.
|
|
54
72
|
|
|
55
73
|
## Severity guidance
|
|
56
74
|
|
|
57
75
|
| Situation | Severity |
|
|
58
76
|
|---|---|
|
|
59
77
|
| Unauthenticated caller can trigger a metered operation | Critical |
|
|
60
|
-
| Unbounded retry against a paid endpoint | High |
|
|
61
78
|
| Metered call inside an unbounded loop | High |
|
|
62
79
|
| No ceiling, quota, or budget alert anywhere | High |
|
|
63
|
-
| Tests hitting paid endpoints | High |
|
|
64
80
|
| Unbounded input or output size on a per-token call | High |
|
|
81
|
+
| Client-supplied parameter unclamped, driving the volume or size of metered work | High |
|
|
82
|
+
| Event-triggered handler with no depth/dedup guard against re-triggering its own event source | High |
|
|
65
83
|
| Repeated identical paid calls with no cache | Medium |
|
|
66
84
|
| Cache key missing a dimension, so it never hits | Medium |
|
|
67
85
|
| Storage with no retention policy | Medium |
|
|
68
86
|
| Expensive tier used for work a cheaper one handles | Medium |
|
|
69
87
|
| No spend attribution per feature or tenant | Medium |
|
|
70
88
|
| Budget alert is notify-only, nothing enforces a stop | Medium |
|
|
89
|
+
| Budget action enforces but only on a batch-evaluated cycle with real lag, not synchronously per request | Medium |
|
|
90
|
+
| Retry logic does not distinguish an enforced spend-cap block from a transient rate limit | Medium |
|
|
91
|
+
| Non-interactive/bulk LLM workload issuing synchronous calls instead of the vendor's batch endpoint | Medium |
|
|
71
92
|
| Idle non-production resources left running | Low |
|
|
93
|
+
| Static/media assets served directly from origin with no CDN in front | Low |
|
|
@@ -8,17 +8,26 @@ Every check below has the same shape: find the rule on surface A, find its count
|
|
|
8
8
|
|
|
9
9
|
## Validation rules stated twice
|
|
10
10
|
|
|
11
|
-
- [ ] Max/min length constraints: `search_code` for the field name near a length check on both client and server (`maxLength`, `.max(`, `LENGTH(`, a schema `maxLength`). Diff the numbers literally — a client capping a bio at 500 characters while the server truncates or rejects at 280 is a rule that only ever fires on one side.
|
|
12
|
-
- [ ] Regex/format validation — email, phone, postal code, username character set — implemented independently on both sides. `search_code` for `RegExp(`, a bare `/.../ ` pattern literal, or the field name near `.test(`/`.match(` on each side; two regex literals for "valid email" are almost never identical, so diff them character by character, not by eye.
|
|
13
|
-
- [ ] Required-field sets: `search_code` the field name near `required`/`.notNull()`/a schema's `required: true` on the server, and near a form library's `required` prop or resolver rule on the client. A field optional client-side while the server 400s without it is bad UX, not a bug; the server accepting it as optional while the client always sends it masks a real gap — nothing ever exercises the server's optional path.
|
|
14
|
-
- [ ] Allowed value ranges — quantity minimums/maximums, rating scales, percentage bounds — `search_code` the field name near `min`/`max`/`.gte(`/`.lte(` on both sides and diff the literal numbers; duplicated magic numbers with no shared source are the finding even before they diverge.
|
|
15
|
-
- [ ] File upload limits: size cap and accepted MIME/extension list
|
|
11
|
+
- [ ] Max/min length constraints: `search_code` for the field name near a length check on both client and server (`maxLength`, `.max(`, `LENGTH(`, a schema `maxLength`). Diff the numbers literally — a client capping a bio at 500 characters while the server truncates or rejects at 280 is a rule that only ever fires on one side. Rule out a documented reason for the gap (a comment, a note about a second consumer) before flagging a client-stricter-than-server divergence as unintentional. "Input validation must be implemented on the server-side before any data is processed... any JavaScript-based input validation performed on the client-side can be circumvented" (OWASP Foundation, OWASP Cheat Sheet Series, current, https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html).
|
|
12
|
+
- [ ] Regex/format validation — email, phone, postal code, username character set — implemented independently on both sides. `search_code` for `RegExp(`, a bare `/.../ ` pattern literal, or the field name near `.test(`/`.match(` on each side; two regex literals for "valid email" are almost never identical, so diff them character by character, not by eye. For a validation rule reimplemented on both surfaces, `Read` the full conditional structure, not just the headline literal — a branch present on one side and absent on the other (an exemption, an early-return, an extra OR-condition) means the core rule matches but the edge-case coverage silently diverges. Report which side carries the extra branch and what input only that side accounts for; this is exactly a Type III "near-miss" clone — code matching a counterpart "except for added or removed statements" (Roy & Cordy, Technical Report TR 2007-541, Queen's University School of Computing, 2007, https://research.cs.queensu.ca/TechReports/Reports/2007-541.pdf). Refuted if the extra branch is a documented platform-specific exemption (a comment, an ADR reference, a legal requirement scoped to one storefront) rather than an accidental omission.
|
|
13
|
+
- [ ] Required-field sets: `search_code` the field name near `required`/`.notNull()`/a schema's `required: true` on the server, and near a form library's `required` prop or resolver rule on the client. A field optional client-side while the server 400s without it is bad UX, not a bug; the server accepting it as optional while the client always sends it masks a real gap — nothing ever exercises the server's optional path. Recommends both: client-side validation for UX, server-side validation as the actual security control (OWASP Foundation, OWASP Cheat Sheet Series, current, https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html).
|
|
14
|
+
- [ ] Allowed value ranges — quantity minimums/maximums, rating scales, percentage bounds — `search_code` the field name near `min`/`max`/`.gte(`/`.lte(` on both sides and diff the literal numbers; duplicated magic numbers with no shared source are the finding even before they diverge (OWASP Foundation, OWASP Cheat Sheet Series, current, https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html).
|
|
15
|
+
- [ ] File upload limits: `search_code` the size cap and accepted MIME/extension list near the upload handler on both client (for UX) and server (for safety), and diff them. The server-side check is the one that matters for security — cross-reference `security.md` if the client is the *only* place a limit is enforced. "The Content-Type for uploaded files is provided by the user, and as such cannot be trusted, as it is trivial to spoof"; the size check itself must be applied "after file decompression" — "no one technique is enough to secure the service" (OWASP Foundation, OWASP Cheat Sheet Series, current, https://cheatsheetseries.owasp.org/cheatsheets/File_Upload_Cheat_Sheet.html).
|
|
16
|
+
|
|
17
|
+
## Shared-type package drift
|
|
18
|
+
|
|
19
|
+
- [ ] When both surfaces sit in one workspace (npm/pnpm/yarn workspaces, Turborepo, Nx), `search_code` for a request/response interface or type independently declared on both client and server for the same endpoint payload, then `find_callers`/`search_code` to confirm neither imports it from a shared internal package (`workspace:*`, `@repo/*`, an Nx model/`libs/shared` project). Two independently declared types for the same payload — even currently identical — have no single source of truth; flag it before it diverges, not after. Internal Packages exist precisely so "application packages" don't each hold their own copy of shared code (Vercel / Turborepo docs team, official framework documentation, current, https://turborepo.dev/docs/core-concepts/internal-packages), and Nx documents a dedicated "Model" project type specifically for "sharing interfaces between backend and frontend" (Nx core team, Nx official blog, current, https://nx.dev/blog/virtuous-cycle-of-workspace-structure). Refuted if one of the two declarations is a deliberately narrower client-side view model (omitting server-only fields such as internal audit metadata) rather than a full duplicate — confirm the field sets aren't a legitimate subset/superset relationship before flagging.
|
|
16
20
|
|
|
17
21
|
## Enum and constant sets
|
|
18
22
|
|
|
19
|
-
- [ ] A set of allowed values — category names, role names, tier names — hardcoded independently in a client dropdown and a server validator. `search_code` the value literals (`'admin'`, `'editor'`, `'viewer'`) on both sides and diff the member lists. This is the same shape as `state-model.md`'s duplicated-state-set check; if the set in question is a status/state field, report it there instead and cross-reference from here.
|
|
23
|
+
- [ ] A set of allowed values — category names, role names, tier names — hardcoded independently in a client dropdown and a server validator. `search_code` the value literals (`'admin'`, `'editor'`, `'viewer'`) on both sides and diff the member lists. This is the same shape as `state-model.md`'s duplicated-state-set check; if the set in question is a status/state field, report it there instead and cross-reference from here. This is a Type I/II clone — matching "modulo whitespace/comments" or "modulo renamed identifiers/literals/types" (Roy & Cordy, Technical Report TR 2007-541, Queen's University School of Computing, 2007, https://research.cs.queensu.ca/TechReports/Reports/2007-541.pdf).
|
|
20
24
|
- [ ] Feature-gating constants (plan limits, quota thresholds): `search_code` the numeric literal or its named constant on both sides — a client-side display string ("up to 10 seats") copy-pasted rather than imported from the server's own limit means an updated limit changes enforcement but not what the UI tells the user.
|
|
21
25
|
- [ ] Rate-limit or quota numbers shown to the user (`"5 requests remaining"`): `search_code` the display string's source value and diff it against the server's actual configured limit — the UI promises a number the backend doesn't honour, in either direction.
|
|
26
|
+
- [ ] When the same business rule (a fee calculation, an eligibility check, a discount formula) is `search_code`-findable as independently implemented in three or more places across the surfaces — not just two — report it as an elevated parity-maintenance risk even while all copies currently agree. A rule with N independent implementations needs N synchronized edits every time it changes, and each additional copy raises the odds one is missed. Refuted if the N call sites are not independent implementations — they all delegate to one shared function or constant, just invoked from N places (which is fine). Only flag when the comparison logic or literal itself is copy-pasted N times, not merely called N times.
|
|
27
|
+
|
|
28
|
+
## API version pin
|
|
29
|
+
|
|
30
|
+
- [ ] When the server implements date-based or numbered API versioning, `search_code` the client's pinned version literal (a version header, a `/v2/` path segment, an SDK version constant) and `search_code`/`find_symbol` the server's registered version handlers or the version range it still serves. A client pinned to a version the server no longer routes falls back silently to the server's default version's behaviour, not the one the client's code assumes — the entire discipline of pinned API versioning exists because "fields that were present before should stay present, and fields should always preserve their same type and name" for a given pin (Stripe Engineering, official company engineering blog, current, https://stripe.com/blog/api-versioning). Refuted if the server's versioning layer documents the fallback as a safe no-op (a changelog or deprecation policy stating the removed version maps forward with identical behaviour) — check the migration docs before flagging.
|
|
22
31
|
|
|
23
32
|
## Error codes
|
|
24
33
|
|
|
@@ -32,13 +41,13 @@ Every check below has the same shape: find the rule on surface A, find its count
|
|
|
32
41
|
|
|
33
42
|
## Query parameter contracts
|
|
34
43
|
|
|
35
|
-
- [ ] Pagination: page-size
|
|
44
|
+
- [ ] Pagination: `search_code` the page-size default/maximum and cursor-vs-offset parameter on both client and server, and diff what the client sends against what the server actually reads and clamps to. A client requesting `pageSize=200` against a server capping at 50 works, silently, until someone assumes the requested size was honoured.
|
|
36
45
|
- [ ] Sorting and filtering parameter names and accepted values: `search_code` the query-param name the client builds (`sort=`, `filter[`) versus the param name the server's route handler actually reads — a client sending `sort=createdAt` against a server that only recognises `sortBy` fails silently to a default sort, not an error.
|
|
37
46
|
|
|
38
47
|
## Authorisation decided twice
|
|
39
48
|
|
|
40
|
-
- [ ] A permission or role check performed client-side to hide a UI element: `search_code` the role/permission constant on the client, then `find_callers`/`trace_path` from the corresponding write endpoint on the server to confirm the same check exists there too. An unenforced server-side check means the client-side check is the *only* thing stopping the action, which anyone can bypass by calling the API directly. **Escalates to `security.md`**; report the finding there with a pointer back here for the parity evidence.
|
|
41
|
-
- [ ] The inverse, less common but real: server-side authorisation stricter than what the client believes,
|
|
49
|
+
- [ ] A permission or role check performed client-side to hide a UI element: `search_code` the role/permission constant on the client, then `find_callers`/`trace_path` from the corresponding write endpoint on the server to confirm the same check exists there too. An unenforced server-side check means the client-side check is the *only* thing stopping the action, which anyone can bypass by calling the API directly. **Escalates to `security.md`**; report the finding there with a pointer back here for the parity evidence. This is CWE-602, Client-Side Enforcement of Server-Side Security: "the product is composed of a server that relies on the client to implement a mechanism that is intended to protect the server" (MITRE, CWE-602, official weakness catalogue, current, https://cwe.mitre.org/data/definitions/602.html); OWASP's own guidance is equally direct — "developers must never rely on client-side access control checks... client-side logic is often easy to bypass" (OWASP Foundation, OWASP Cheat Sheet Series, current, https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html). This is not hypothetical: CVE-2025-41402 is a dated, CVSS 5.5 instance of exactly this class in production software (GitHub Security Lab / GitHub Advisory Database, official advisory record, 2025, https://github.com/advisories/GHSA-hvh2-99r5-r38q).
|
|
50
|
+
- [ ] The inverse, less common but real: server-side authorisation stricter than what the client believes — `find_symbol` the server-side authorisation check and `Read` its condition, then `search_code` the client's render guard for the same role/permission constant and diff the two; a client renders an action it cannot actually complete, and the user hits an opaque 403 mid-flow. Checks must be server-side, at the gateway, or in a serverless function — never decided by what the client renders (OWASP Foundation, OWASP Cheat Sheet Series, current, https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html).
|
|
42
51
|
- [ ] Session/token expiry duration: `search_code` the client's refresh-timer literal (a hardcoded interval, "refresh every 55 minutes") against the server's actual configured TTL (a JWT expiry constant, a session config value) — a client refreshing too late gets a surprise 401 mid-action instead of a seamless renewal.
|
|
43
52
|
|
|
44
53
|
## Formatting rules
|
|
@@ -53,12 +62,27 @@ Every check below has the same shape: find the rule on surface A, find its count
|
|
|
53
62
|
- Runtime-only defaults supplied by infrastructure (a load balancer, an API gateway) that never appear in either codebase.
|
|
54
63
|
- Behaviour of third-party SDKs embedded in either surface that apply their own undocumented validation.
|
|
55
64
|
- Locale-dependent formatting differences that only manifest for locales not exercised by any test or by the auditor's reading.
|
|
65
|
+
- Whether the two surfaces observed are running the same deployed commit as the one this audit read — this module reads source, not deploy state.
|
|
66
|
+
- Whether identical source-level validation logic behaves identically across the runtime engines each surface actually executes in — this module diffs code, not engines.
|
|
67
|
+
- Validation performed inside a third-party SDK's own code on either surface — this module diffs the application's own logic, not vendored dependencies.
|
|
68
|
+
- Two differing implementations gated behind a feature flag — this module cannot tell from source alone which is the active variant for any given request.
|
|
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` | Runtime-only defaults supplied by infrastructure (a load balancer, an API gateway), visible in response headers during a walked flow, that never appear in either codebase | Medium |
|
|
77
|
+
| `network.jsonl` (actual emitted code), cross-referenced with `search_code` on the client | A server error code observed live on a walked flow has no matching branch in the client's error-handling switch. Refuted if the flow's own outcome shows a generic-but-adequate fallback message was still shown to the user, not a broken/blank state | High |
|
|
78
|
+
| `steps.md` (rendered client error text) + `network.jsonl` (server's actual 4xx body) | A client-side validation error message, rendered after one deliberately invalid, non-side-effecting submission, disagrees with the server's actual rejection text/constraint for the same input. Refuted if the two messages describe the same constraint in different words (a wording gap, not a rule gap) | Medium |
|
|
79
|
+
| `network.jsonl` request headers/URL | The API version header/path actually sent by the client differs from the version literal `search_code` finds hardcoded in the client's own source, or from what the server's routing table accepts. Refuted if a build-time env substitution legitimately overrides the source literal for this environment | Medium |
|
|
56
80
|
|
|
57
81
|
## Severity guidance
|
|
58
82
|
|
|
59
83
|
| Situation | Severity |
|
|
60
84
|
|---|---|
|
|
61
|
-
| Client-only authorisation check with no server-side enforcement
|
|
85
|
+
| Client-only authorisation check with no server-side enforcement (defer to `security.md`) | Critical |
|
|
62
86
|
| Error code the client branches on that the server never emits | High |
|
|
63
87
|
| Validation rule enforced client-side only, unenforced server-side | High |
|
|
64
88
|
| File upload limit enforced only on the client | High |
|
|
@@ -67,4 +91,7 @@ Every check below has the same shape: find the rule on surface A, find its count
|
|
|
67
91
|
| Diverged default value between client and server | Medium |
|
|
68
92
|
| Pagination/sort parameter mismatch silently falling back to a default | Medium |
|
|
69
93
|
| Formatting/rounding rule reimplemented per surface | Medium |
|
|
70
|
-
|
|
|
94
|
+
| Validation rule's edge-case branch present on one surface, absent on the other (core rule agrees) | Medium |
|
|
95
|
+
| Client pinned to an API version the server no longer routes | Medium |
|
|
96
|
+
| Duplicated enum/constant set, or the same business rule reimplemented 3+ times, not yet diverged | Low |
|
|
97
|
+
| Independently declared client/server type for the same payload with no shared internal-package source | Low |
|
|
@@ -9,23 +9,23 @@ The highest-value checks here are the declared-vs-used inverse pairs from `reach
|
|
|
9
9
|
The database is the only enforcement point every writer passes through — a second application, an ops script, or a migration backfill all bypass application-level validation but not a constraint. An invariant the business genuinely cannot tolerate being violated (uniqueness, a required relationship, a valid enum) belongs here even when the app also checks it for UX; app-only enforcement of a hard invariant is one bypass away from silent corruption, and that is the finding, not a style preference.
|
|
10
10
|
|
|
11
11
|
- [ ] Every table has a primary key. Read the migration files for a `CREATE TABLE` with no `PRIMARY KEY`/`id` column, or `find_symbol` each model and confirm a primary key field.
|
|
12
|
-
- [ ] Foreign keys are declared as constraints, not merely implied by a naming convention. `search_code` for a `_id`-suffixed column and confirm a matching `REFERENCES`/`FOREIGN KEY` in the same migration — a naming match with no constraint is the finding.
|
|
13
|
-
- [ ] Nullability is deliberate. `find_callers` on a nullable column's accessor and confirm at least one caller null-checks it; if none do, either the column should be `NOT NULL` or every caller is a latent crash.
|
|
14
|
-
- [ ] Enum-like columns are constrained (check constraint, enum type, or lookup table), not free-text. Read the column type in the migration, then `search_code` the value literals used against it — a `VARCHAR`/`TEXT` column code treats as a fixed set of values is unconstrained.
|
|
15
|
-
- [ ] Unique constraints exist wherever the code assumes uniqueness. `search_code` for a `.findOne`/`SELECT ... LIMIT 1` filtered on the column, then confirm a `UNIQUE` constraint exists on it in the migration.
|
|
12
|
+
- [ ] Foreign keys are declared as constraints, not merely implied by a naming convention. `search_code` for a `_id`-suffixed column and confirm a matching `REFERENCES`/`FOREIGN KEY` in the same migration — a naming match with no constraint is the finding: only a real constraint is enforced regardless of which application code path writes the row (PostgreSQL, Data Definition documentation, current, https://www.postgresql.org/docs/current/ddl-constraints.html).
|
|
13
|
+
- [ ] Nullability is deliberate. `find_callers` on a nullable column's accessor and confirm at least one caller null-checks it; if none do, either the column should be `NOT NULL` or every caller is a latent crash — a declared constraint, unlike an app-level check, is enforced "regardless" of which writer wrote the row (PostgreSQL, Data Definition documentation, current, https://www.postgresql.org/docs/current/ddl-constraints.html).
|
|
14
|
+
- [ ] Enum-like columns are constrained (check constraint, enum type, or lookup table), not free-text. Read the column type in the migration, then `search_code` the value literals used against it — a `VARCHAR`/`TEXT` column code treats as a fixed set of values is unconstrained, and only a `CHECK` constraint rejects an out-of-set value database-side no matter which writer supplied it (PostgreSQL, Data Definition documentation, current, https://www.postgresql.org/docs/current/ddl-constraints.html).
|
|
15
|
+
- [ ] Unique constraints exist wherever the code assumes uniqueness. `search_code` for a `.findOne`/`SELECT ... LIMIT 1` filtered on the column, then confirm a `UNIQUE` constraint exists on it in the migration. Rule out first: `find_callers` on the query and Read how each caller uses the result — treated as *the* record (assumes uniqueness) or *a* record (a deliberate "any one matching example" query, no uniqueness assumption) — before flagging the missing constraint.
|
|
16
16
|
- [ ] Timestamps record what they claim — created vs. updated vs. deleted — and are timezone-explicit. Read the migration's column type (`TIMESTAMP` vs `TIMESTAMPTZ`/`WITH TIME ZONE`), then `find_callers` on the model's update method to confirm `created_at`/`updated_at`/`deleted_at` are set where their names promise.
|
|
17
17
|
|
|
18
18
|
## Schema vs. code
|
|
19
19
|
|
|
20
|
-
- [ ] Every column read or written by code exists in a migration. `search_code` the field name across the codebase, then confirm a migration creates it. **A code reference with no creating migration is `
|
|
20
|
+
- [ ] Every column read or written by code exists in a migration. `search_code` the field name across the codebase, then confirm a migration creates it. **A code reference with no creating migration is `High`** — `search_code` is a text search, not one of the Evidence Contract's `traced`-tier tools, and no structural probe exists to prove a migration's absence, so this check cannot exceed `read`'s ceiling.
|
|
21
21
|
- [ ] Every column a migration creates is read or written somewhere. `search_code` the field name; zero hits outside the migration and model definition make it `Low`, but keep the candidate list — stale assumptions cluster around these columns.
|
|
22
22
|
- [ ] Model/entity definitions match the migrated schema — types, nullability, defaults. `find_symbol` the model and diff its field declarations against the migration that created the table.
|
|
23
|
-
- [ ] Indexes exist for the columns actual queries filter and sort on, and no index exists for columns nothing queries. `search_code` for `WHERE`/`.where(`/`ORDER BY` on a column, then confirm an index migration covers it; the inverse — an index `search_code` finds no matching query for — is the companion finding.
|
|
23
|
+
- [ ] Indexes exist for the columns actual queries filter and sort on, and no index exists for columns nothing queries. `search_code` for `WHERE`/`.where(`/`ORDER BY` on a column, then confirm an index migration covers it; the inverse — an index `search_code` finds no matching query for — is the companion finding. Indexing "is the most effective tuning method — yet it is often neglected during development," a development-time responsibility rather than a DBA afterthought (Markus Winand, Use The Index, Luke, current, https://use-the-index-luke.com/).
|
|
24
24
|
|
|
25
25
|
## Query quality
|
|
26
26
|
|
|
27
|
-
- [ ] No query is built by string concatenation with a value that came from outside. `search_code` for string concatenation or template-literal interpolation immediately adjacent to a query-execution call
|
|
28
|
-
- [ ] No N+1: a query inside a loop over a previous query's results. `find_callees` on the loop body for a second query call, and confirm the outer loop iterates over the first query's result set.
|
|
27
|
+
- [ ] No query is built by string concatenation with a value that came from outside. `search_code` for string concatenation or template-literal interpolation immediately adjacent to a query-execution call; this is `High` at `read`. `find_callers`/`trace_path` from an external entry point to the concatenation site, confirming the interpolated value actually originates outside the process, promotes it to `traced`, and `Critical`. Belongs in `Security` too — report it once, cross-reference. Parameterised queries "ensure the database will always distinguish between code and data, regardless of what user input is supplied"; string-escaping is the discouraged last resort (OWASP SQL Injection Prevention Cheat Sheet, current, https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html).
|
|
28
|
+
- [ ] No N+1: a query inside a loop over a previous query's results. `find_callees` on the loop body for a second query call, and confirm the outer loop iterates over the first query's result set. Measured on an 800-row/17-category dataset: the N+1 form ran 18 queries in >1s and read 13,889 rows to return 815, against 1 query in ~0.16s for the equivalent single JOIN — roughly a 10x gap (PlanetScale, engineering blog, current, https://planetscale.com/blog/what-is-n-1-query-problem-and-how-to-solve-it).
|
|
29
29
|
- [ ] `SELECT *` in code that only needs two columns. `search_code` for `SELECT *`/`.select()` with no column list, then `find_callers` to see how few fields the caller actually destructures.
|
|
30
30
|
- [ ] Queries that can scan the whole table have a bound, or a stated reason they cannot grow. `search_code` for a query against a large table with no `LIMIT`/indexed `WHERE` clause.
|
|
31
31
|
- [ ] Aggregations and counts on large tables are not on a request's hot path. `find_callers` on the handler wrapping a `COUNT`/`GROUP BY` query — a request-path caller with no cache in front of it is the finding.
|
|
@@ -36,20 +36,34 @@ The database is the only enforcement point every writer passes through — a sec
|
|
|
36
36
|
The safest sequencing for a schema change with more than one deploy in flight is expand → migrate → contract ("parallel change"): add the new shape without touching the old one, dual-run until every writer and reader has moved, then remove the old shape in its own later migration. In practice, the step teams skip is the last one — the contract migration — because the visible benefit already shipped once expand and migrate land, and cleanup has no deadline pulling it forward. An expand-phase artefact (dual-write code, a paired old/new column, a compatibility shim) with no tracked removal is therefore a specific, checkable finding, not a hypothetical one.
|
|
37
37
|
|
|
38
38
|
- [ ] Migrations are ordered, immutable once applied, and recorded. Read the migrations directory listing for a gap in the sequence, or a timestamp/hash that does not match the tool's recorded checksum, where the tool tracks one.
|
|
39
|
-
- [ ] An expand-phase artefact has a tracked contract-phase removal. `search_code` for a dual-write (the old column/field still being written alongside a newer one), a compatibility shim, or an `_old`/`_new`/`_v2`-style column pair, then check for a follow-up migration, ticket reference, or dated TODO that removes it. One with no removal plan anywhere in the repo is the finding this pattern is named for.
|
|
39
|
+
- [ ] An expand-phase artefact has a tracked contract-phase removal. `search_code` for a dual-write (the old column/field still being written alongside a newer one), a compatibility shim, or an `_old`/`_new`/`_v2`-style column pair, then check for a follow-up migration, ticket reference, or dated TODO that removes it. One with no removal plan anywhere in the repo is the finding this pattern is named for — GitLab's own migration guidance stages this across releases and explicitly warns that "ignoring and dropping columns should not occur simultaneously in the same release" (GitLab, engineering documentation, current, https://docs.gitlab.com/development/database/avoiding_downtime_in_migrations/).
|
|
40
40
|
- [ ] Every migration is reversible, or its irreversibility is stated — but a `down` that would silently discard the data the forward migration removed is not a real reversal. Read each migration file for a `down`/`Down`/rollback method on a destructive statement; current practice favours roll-forward (a new migration that fixes the mistake) over a `down` that pretends a lossy change is undoable. What matters is not the presence of a rollback method but whether the destructive step is isolated in its own migration — see the next check — so its blast radius is contained even without one.
|
|
41
|
-
- [ ] Destructive migrations (drop, rename, narrow a type) are separated from deploys that still read the old shape. Read the migration for `DROP`/`RENAME COLUMN`/type-narrowing statements, then `search_code` for the old column name still referenced elsewhere in the same change.
|
|
42
|
-
- [ ]
|
|
41
|
+
- [ ] Destructive migrations (drop, rename, narrow a type) are separated from deploys that still read the old shape. Read the migration for `DROP`/`RENAME COLUMN`/type-narrowing statements, then `search_code` for the old column name still referenced elsewhere in the same change. This is the same staged expand → migrate → contract discipline GitLab documents, with drop held to its own later release (GitLab, engineering documentation, current, https://docs.gitlab.com/development/database/avoiding_downtime_in_migrations/).
|
|
42
|
+
- [ ] A migration that drops or renames a column lands in the same release as the application code change that stops using it, with no earlier release that first stopped reading/writing the column while it still physically existed. `search_code` the old column name for zero references in the current code, then confirm (via the migrations directory and its ordering) that a prior, separately deployed migration/release already made the column unused before this one removes it — a `search_code` result of "zero references" alone does not rule this out, because a process still running the previous release can hold that column name in an in-memory schema cache regardless of what the current source says. Refuted if the ORM/framework in use does not cache column metadata per-process, or the deploy process guarantees no two releases' processes ever run concurrently. Active Record specifically "caches attributes, causing runtime errors" on a column removed out from under a still-running process (ankane, `strong_migrations` README, current, https://github.com/ankane/strong_migrations/blob/master/README.md); GitLab's own staged ignore → drop → remove-ignore sequence exists for the same reason (GitLab, engineering documentation, current, https://docs.gitlab.com/development/database/avoiding_downtime_in_migrations/).
|
|
43
|
+
- [ ] Data migrations are idempotent and bounded. Read the migration for an `UPDATE`/backfill statement with no `WHERE` scoping it and no batching — a single unbounded `UPDATE` over a large table locks it. Backfilling inside the same transaction as a schema alteration "keep[s] tables locked for the entire operation duration" (ankane, `strong_migrations` README, current, https://github.com/ankane/strong_migrations/blob/master/README.md).
|
|
44
|
+
- [ ] A migration that both alters a table's shape (`ADD COLUMN`/`ADD CONSTRAINT`/non-concurrent `CREATE INDEX`) and backfills data in the same file/transaction holds whatever lock the DDL takes for the backfill's full duration, not just the DDL's own duration. Read each migration for a schema-DDL statement and a data-modifying statement (`UPDATE`/backfill loop) in the same transactional migration; the two are separated when the backfill runs as its own non-transactional, batched migration after the DDL commits. Refuted if the DDL statement in question takes no meaningful lock on the table being backfilled (it targets a different, small table, or is itself metadata-only). Backfilling in the same transaction as a schema alteration "keep[s] tables locked for the entire operation duration" (ankane, `strong_migrations` README, current, https://github.com/ankane/strong_migrations/blob/master/README.md).
|
|
43
45
|
- [ ] Migrations run to completion or roll back; there is no half-applied resting state. Read the migration runner/tool config for transactional-DDL support; its absence on a multi-statement migration is the finding.
|
|
44
|
-
- [ ] A DDL statement that blocks writes for a full table scan is not run against a table expected to be large when a non-blocking form was available. This is version-dependent. **Postgres (11+):** `ADD COLUMN ... DEFAULT <const>` is safe (no rewrite, catalog-only)
|
|
46
|
+
- [ ] A DDL statement that blocks writes for a full table scan is not run against a table expected to be large when a non-blocking form was available. This is version-dependent. **Postgres (11+):** `ADD COLUMN ... DEFAULT <const>` is safe (no rewrite, catalog-only), and this now includes `NOT NULL DEFAULT <const>` — Postgres 11 added exactly this optimisation, "enabled when the default value is a constant" (PostgreSQL, release notes for 11.0, 2018, https://www.postgresql.org/docs/release/11.0/); a **volatile** default, `ALTER COLUMN TYPE`, a stored generated column, or an identity column still forces a full-table rewrite under `ACCESS EXCLUSIVE` (PostgreSQL, `ALTER TABLE` documentation, current, https://www.postgresql.org/docs/current/sql-altertable.html); `SET NOT NULL` skips its scan only (12+) if a validated `CHECK (col IS NOT NULL)` already exists — the safe path is `ADD CONSTRAINT ... NOT VALID` then `VALIDATE CONSTRAINT` (which only takes `SHARE UPDATE EXCLUSIVE`) then `SET NOT NULL`; a bare `CREATE INDEX` blocks writes where `CREATE INDEX CONCURRENTLY` does not. **MySQL:** a trailing `ADD COLUMN` qualifies for `ALGORITHM=INSTANT` (no rebuild) since 8.0.12; `DROP COLUMN` and a non-trailing `ADD COLUMN` only became instant-default at 8.0.29 — before that they use `ALGORITHM=INPLACE`, which rebuilds the table but still permits concurrent DML (Oracle, MySQL 8.0 Reference Manual, current, https://dev.mysql.com/doc/refman/8.0/en/innodb-online-ddl-operations.html). `ADD INDEX` supports `ALGORITHM=INPLACE, LOCK=NONE`; most other column type changes fall back to `ALGORITHM=COPY`, which blocks concurrent writes for the full rebuild. Read the migration for the blocking form where the non-blocking one applied, or for an explicit `ALGORITHM`/`LOCK` clause missing entirely — an unspecified algorithm can silently fall back to `COPY`.
|
|
47
|
+
- [ ] A migration whose statement takes a table-level lock (a non-concurrent index/constraint add, `SET NOT NULL` without a covering `CHECK`, a type change) runs under a migration tool or database role with no `lock_timeout` set. Read the migration tool's config (initializer, connection role settings, CI migration step) for an explicit lock timeout; its absence means a stuck migration queues every subsequent statement on that table behind it for as long as the migration itself waits. Refuted if the project's migration tool sets a lock timeout globally at the database-role or connection-pool level rather than per-migration — check role/connection defaults, not only the migration file, before flagging an absence. Recommended pairing is a short `lock_timeout` (~10s) with a long `statement_timeout` (~1h) on every migration (ankane, `strong_migrations` README, current, https://github.com/ankane/strong_migrations/blob/master/README.md); GitLab's `with_lock_retries` exists for the same reason — an unretried lock acquisition on a high-traffic table can time out and block deploys (GitLab, engineering documentation, current, https://docs.gitlab.com/development/database/avoiding_downtime_in_migrations/).
|
|
45
48
|
|
|
46
49
|
## Transactions and integrity
|
|
47
50
|
|
|
48
51
|
- [ ] Related writes share a transaction. `find_callees` on a function performing more than one write and confirm they sit inside one `BEGIN`/transaction call, not sequential independent calls.
|
|
49
|
-
- [ ]
|
|
50
|
-
- [ ]
|
|
52
|
+
- [ ] A function that opens a database transaction calls out to non-database I/O (an HTTP client, a queue publish, a sleep/wait, a file operation) before committing. `find_callees` on a transaction-wrapped function for a call to a networked client or a blocking wait; any row-level or table-level lock the transaction holds is held for the duration of that external call, not just the database work. Refuted if the external call happens before `BEGIN` or after `COMMIT` — `find_callees` shows the edge exists but not its position relative to the transaction boundary; `Read` the function body to confirm the call site is actually inside the open transaction before flagging. Row-level locks "are released at transaction end," so lock duration is a direct function of transaction duration, and explicit locking already "can increase the likelihood of deadlocks" before a longer hold time worsens it (PostgreSQL, explicit locking documentation, current, https://www.postgresql.org/docs/current/explicit-locking.html).
|
|
53
|
+
- [ ] Read-modify-write is protected against concurrent execution. `search_code` for a read followed by a write of the same row with no version-column check, row lock, or atomic single statement between them. This is the database-row-scoped read-modify-write check; `concurrency.md` owns the in-process/cache-scoped case of the same defect — cross-reference it, do not re-report a finding already covered there. Row-level locks are "released at transaction end," and explicit locking "can increase the likelihood of deadlocks" (PostgreSQL, explicit locking documentation, current, https://www.postgresql.org/docs/current/explicit-locking.html).
|
|
54
|
+
- [ ] A business invariant enforced by reading a set of rows (a count, a sum, an "at least/at most one" condition) and then conditionally writing a different row based on that read is not protected merely by locking the row being written. `search_code` for a read (often an aggregate or a filtered `SELECT`) whose result gates a subsequent `INSERT`/`UPDATE` on a *different* row or table, with no `SERIALIZABLE` transaction, no explicit lock covering the rows that were read, and no unique/check constraint that would catch the violation at the database level. Refuted if the invariant is also enforced by a database-level constraint (a partial unique index, an exclusion constraint, a trigger) that would reject the violating write regardless of the application race, or if the two writes can never be issued by two different processes. `READ COMMITTED` permits exactly this shape — "a serialization anomaly" that only `SERIALIZABLE` rejects, with two individually-valid transactions whose interleaving violates a cross-row invariant (PostgreSQL, transaction isolation documentation, current, https://www.postgresql.org/docs/current/transaction-iso.html).
|
|
55
|
+
- [ ] Cascade behaviour is declared deliberately, not inherited by default. Read the foreign key's `ON DELETE`/`ON UPDATE` clause in the migration; an unstated cascade is `High` at `read`. `find_callers`/`trace_path` from an entry point to the parent row's delete path, confirming the cascade is actually reachable and destructive, promotes it to `traced`, and `Critical`. `ON DELETE CASCADE` auto-deletes referencing rows; `RESTRICT`/the default `NO ACTION` block or error on the delete instead (PostgreSQL, Data Definition documentation, current, https://www.postgresql.org/docs/current/ddl-constraints.html).
|
|
51
56
|
- [ ] Soft deletes are respected by every read path. `find_callers` on the model's query method and confirm each includes the `deleted_at IS NULL`/equivalent filter — one caller missing it resurrects deleted data.
|
|
52
57
|
|
|
58
|
+
## What browser observation closes
|
|
59
|
+
|
|
60
|
+
Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
|
|
61
|
+
|
|
62
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `network.jsonl` (request timestamps, URL templates) cross-referenced with a source-level N+1 finding from `find_callees` | N+1-shaped request burst during one flow step: many near-identical requests to the same endpoint template, only a path/query parameter varying, fired within a short window — corroborating only, since it proves a client-side/API-layer pattern, not that the database itself executes N+1 queries per request. Refuted if the repeated requests are legitimate parallel independent resource loads rather than N calls to the same endpoint template. | Low |
|
|
65
|
+
| `network.jsonl` (response timing per request, correlated with request parameters/payload size) | Response latency for a listing/paginated endpoint grows materially as the requested page/result-set size grows, across two comparable steps of the same flow — a corroborating timing signal for an existing missing-index or N+1 suspicion already raised at `read`/`inferred` tier, since the bundle has no visibility into what the server did between receiving the request and responding. Refuted if the slowdown correlates with response payload size or serialization cost rather than row count. | Info |
|
|
66
|
+
|
|
53
67
|
## Out of static reach
|
|
54
68
|
|
|
55
69
|
- Actual query plans (`EXPLAIN`/`EXPLAIN ANALYZE`) — this module reads query and schema source, it cannot execute a query the way a live planner would.
|
|
@@ -57,21 +71,33 @@ The safest sequencing for a schema change with more than one deploy in flight is
|
|
|
57
71
|
- Actual lock contention and duration under concurrent write load.
|
|
58
72
|
- Whether an index is actually used by the planner versus merely present — an unused index looks identical to a used one from source.
|
|
59
73
|
- Replication lag and its effect on read-after-write consistency.
|
|
74
|
+
- Whether an unenforced invariant has ever actually been violated in production — this module can show the enforcement gap, not the historical outcome.
|
|
75
|
+
- Connection pool exhaustion and checkout contention under concurrent load — this module reads pool configuration if declared, not the pool's behavior under real traffic.
|
|
76
|
+
- Whether a schema-cache mismatch between two concurrently running releases actually crashed a request — this module can flag the missing staged-deprecation step, not the incident.
|
|
77
|
+
- How long other queries actually queued behind a lock-acquiring migration — this module can show the statement's lock class, not the live wait time it produced.
|
|
60
78
|
|
|
61
79
|
## Severity guidance
|
|
62
80
|
|
|
63
81
|
| Situation | Severity |
|
|
64
82
|
|---|---|
|
|
65
|
-
| Query built by string concatenation
|
|
66
|
-
|
|
|
67
|
-
|
|
|
83
|
+
| Query built by string concatenation, external origin traced (`find_callers`/`trace_path`) (traced) | Critical |
|
|
84
|
+
| Unintended cascade delete (traced) | Critical |
|
|
85
|
+
| Query built by string concatenation adjacent to external input, reach unconfirmed | High |
|
|
86
|
+
| Unstated cascade behaviour on a foreign key, reachability unconfirmed | High |
|
|
87
|
+
| Code reads a column no migration creates | High |
|
|
68
88
|
| Applied migration edited in place | High |
|
|
69
89
|
| Destructive migration deployed alongside code that reads the old shape | High |
|
|
70
90
|
| Read path missing the soft-delete filter | High |
|
|
91
|
+
| Read-modify-write on a database row with no atomicity | High |
|
|
92
|
+
| Cross-row invariant enforced only by an application-level read-then-conditionally-write, no database-level backstop (write skew) | High |
|
|
93
|
+
| Schema-DDL statement and a data backfill sharing one migration transaction | High |
|
|
94
|
+
| Column dropped or renamed with no earlier release that first stopped reading/writing it | High |
|
|
95
|
+
| Database transaction holding a lock across a non-database I/O call | High |
|
|
71
96
|
| Missing index on a filtered column of a growing table | Medium |
|
|
72
97
|
| N+1 query | Medium |
|
|
73
98
|
| Unconstrained enum-like column | Medium |
|
|
74
99
|
| Blocking DDL run against an unbounded table when a non-blocking form exists | Medium |
|
|
75
100
|
| Implicit type coercion on the column side of a filter, defeating an index | Medium |
|
|
101
|
+
| Lock-acquiring migration statement with no `lock_timeout` set on the migration tool or role | Medium |
|
|
76
102
|
| Column created by a migration that nothing reads | Low |
|
|
77
103
|
| Expand-phase artefact with no tracked contract-phase removal | Low |
|
|
@@ -16,7 +16,7 @@ Both directions, and both matter — this is the `reachability.md` inverse-gap c
|
|
|
16
16
|
## Weight
|
|
17
17
|
|
|
18
18
|
- [ ] Large dependencies used for a fraction of their surface. For each suspect dependency, `search_code` how many distinct exports are actually imported; name the specific function used and cite `file:line`, not just the dependency name.
|
|
19
|
-
- [ ] Dependencies that duplicate the standard library or the runtime.
|
|
19
|
+
- [ ] Dependencies that duplicate the standard library or the runtime. `search_code` the import list against the language's builtins — a padding or deep-clone library where the runtime already ships one is the concrete case.
|
|
20
20
|
- [ ] Multiple packages solving the same problem — two date libraries, two HTTP clients, two validation libraries. Cross-check the manifest for known-overlapping categories, name the specific packages found, then `search_code` each one's actual call sites — a decommissioned one still imported somewhere is the migration nobody finished. Pick one; the other is dead weight with a name.
|
|
21
21
|
- [ ] Duplicate versions of the same package in the lockfile. Read the lockfile for multiple resolved versions of one package name — bloat, and a source of "instanceof fails across copies" bugs.
|
|
22
22
|
|
|
@@ -26,45 +26,60 @@ Live CVE and exploitability status needs a registry query this module cannot mak
|
|
|
26
26
|
|
|
27
27
|
- [ ] Declared update process. `search_code` for `renovate.json`, `.github/dependabot.yml`, or a documented update cadence in `CONTRIBUTING` — the same signal OpenSSF Scorecard's `Dependency-Update-Tool` check looks for. Its absence means updates are ad hoc, and the first one will be a forced multi-major jump across the whole tree at once.
|
|
28
28
|
- [ ] Version gap as a staleness signal. Read the manifest's declared range against the lockfile's actually-resolved version for each critical-path dependency — a large gap between what's allowed and what's installed is a signal worth naming, but true maintenance status (last release, open-issue backlog, archival) needs the registry and belongs under Out of static reach.
|
|
29
|
-
- [ ] Audit step in CI. `search_code` the pipeline for `npm audit`, `pip-audit`, `osv-scanner`, or an equivalent step — cross-reference `devops.md`. Confirm the process exists; do not cite a specific advisory from here, that's a live lookup this module doesn't make.
|
|
30
|
-
- [ ] Single-maintainer packages on the critical path. Not a defect, but a risk worth naming when found —
|
|
29
|
+
- [ ] Audit step in CI. `search_code` the pipeline for `npm audit`, `pip-audit`, `osv-scanner`, or an equivalent step — cross-reference `devops.md`. Confirm the process exists; do not cite a specific advisory from here, that's a live lookup this module doesn't make. OWASP Top 10:2025 ranks A03 "Software Supply Chain Failures" #3 of ten categories — an audit step is the process this check closes the loop against.
|
|
30
|
+
- [ ] Single-maintainer packages on the critical path. Not a defect, but a risk worth naming when found — Read the manifest's declared critical dependencies for a known single-maintainer project. This approximates what OpenSSF Scorecard's `Maintained` and `Contributors` checks measure directly against live registry and commit data; without that data, name the package and let the reader verify.
|
|
31
31
|
|
|
32
32
|
## Version discipline
|
|
33
33
|
|
|
34
|
-
- [ ] Lockfile present and committed.
|
|
35
|
-
- [ ] Ranges are deliberate. Read each *runtime* dependency's version specifier — `^`, `*`, or no pin at all accepts breaking changes automatically and is the finding. Rule out inline: the same pattern on a devDependency carries materially lower risk since it never ships; note the distinction rather than flagging both at the same severity.
|
|
34
|
+
- [ ] Lockfile present and committed — owned by `supply-chain.md` (`get_architecture` packageManager, then confirm the lockfile file itself is tracked and `.gitignore` does not exclude it); reuse its finding, do not re-report.
|
|
35
|
+
- [ ] Ranges are deliberate. Read each *runtime* dependency's version specifier — `^`, `*`, or no pin at all accepts breaking changes automatically and is the finding. Rule out inline: the same pattern on a devDependency carries materially lower risk since it never ships; note the distinction rather than flagging both at the same severity. npm docs: `^1.0.4` allows any backward-compatible update past the leftmost non-zero digit, `*`/`x` accepts "changes that break backward compatibility" outright — a caret/wildcard range trusts the upstream author's semver discipline and has no mechanism to enforce it.
|
|
36
36
|
- [ ] Pins with a comment explaining a workaround. `search_code` for comments like "pinned because" or "TODO remove pin" near a version pin, then check whether the constraint they describe still holds. Cross-reference `future.md`.
|
|
37
|
-
- [ ] Something updates dependencies on a cadence
|
|
37
|
+
- [ ] Something updates dependencies on a cadence — the same `search_code` check for `renovate.json`/`.github/dependabot.yml`/a documented cadence made under Health above; cross-reference it rather than re-checking.
|
|
38
38
|
|
|
39
39
|
## Licensing
|
|
40
40
|
|
|
41
|
-
- [ ] Every dependency's license is known, including transitive ones. Read the manifest/lockfile license fields, or a generated license report if one exists in-repo — a checked-in SBOM (CycloneDX ≥1.
|
|
42
|
-
- [ ]
|
|
41
|
+
- [ ] Every dependency's license is known, including transitive ones. Read the manifest/lockfile license fields, or a generated license report if one exists in-repo — a checked-in SBOM (CycloneDX ≥1.0, whose per-component license field has existed since the spec's first release, or SPDX, whose Concluded/Declared License fields long predate the 2.3 baseline commonly cited today) counts as this report — and flag any `UNKNOWN` or missing entry. Unknown is not the same as permissive. SPDX gives each license a standardized short identifier (`MIT`, `GPL-2.0-only`, `Apache-2.0`) "to enable efficient and reliable identification of such licenses and exceptions."
|
|
42
|
+
- [ ] For every license identified in the inventory, `search_code` the manifest/lockfile license fields and `Read` the SPDX identifier or bundled license text to confirm whether it is on the OSI-approved list or is a known source-available term (BSL, SSPL, RSAL, Elastic License) — a dependency's own README or marketing copy calling itself "open source" is not evidence. Flag any source-available dependency the same as an unknown license until its specific field-of-use restriction is named. The OSI's own Open Source Definition states plainly: "Open source doesn't just mean access to the source code." Redis's own FAQ is the named, concrete instance of this exact gap: the vendor states its SSPL/RSAL dual license means Redis "is no longer open source under the OSI definition," while the source stays freely downloadable and is still widely assumed "open source" by consumers.
|
|
43
|
+
- [ ] No license incompatible with how this project ships. Read each declared license found above and name the specific obligation it carries — GPL requires derivative-works disclosure, for instance — checked against the project's own declared license and its shipping model (proprietary vs. open, distributed vs. SaaS). Flag the obligation; do not give a legal verdict. FSF's GPL FAQ: if you release a modified GPL program, "the GPL requires you to make the modified source code available to the program's users, under the GPL." For each critical-path dependency with a known relicense history (Elasticsearch/Kibana 2021, HashiCorp products 2023, Redis 2024 are the documented precedents — the list will grow), read the manifest-declared range and the lockfile-resolved version against the version the relicense took effect; a resolved version on or after that boundary means the project is bound by the new terms, not the reputation the dependency had when it was first added. Not the finding: the resolved version predates the relicense boundary, or the project's shipping model doesn't trigger the new license's restricted clause (e.g. not a competing managed service under HashiCorp's BSL, not embedding-as-a-service under Redis's RSAL/SSPL).
|
|
44
|
+
- [ ] Any dependency licensed AGPL or SSPL is checked for how the project actually uses it: `search_code` for whether it's invoked as an in-process library, a spawned local process, or a networked service the project's own users interact with remotely. AGPL §13 and SSPL's modified §13 both convert the licensed obligation from a distribution trigger to a network-interaction trigger — a modified version must "prominently offer all users interacting with it remotely through a computer network... an opportunity to receive the Corresponding Source" — so a SaaS deployment can owe source disclosure without shipping a single binary. Not the finding: the dependency is consumed only as a client against an externally-operated managed instance (e.g. a hosted Redis Cloud endpoint) that the project itself never modifies or redistributes — no modified version exists for §13 to attach to.
|
|
43
45
|
- [ ] The project's own declared license matches the file it ships and the headers in its source. Read the `LICENSE` file, compare it against the manifest's `license` field and any source header block.
|
|
44
46
|
- [ ] Attribution requirements are met where licenses require notices. `search_code` for a `NOTICE` or `THIRD_PARTY_LICENSES` file; confirm one exists when any dependency's license requires it.
|
|
45
|
-
- [ ] Vendored or copy-pasted third-party code retains its original license and attribution. `search_code` for `Copyright` strings inside `vendor/`, `third_party/`, or other copied directories.
|
|
47
|
+
- [ ] Vendored or copy-pasted third-party code retains its original license and attribution. `search_code` for `Copyright` strings inside `vendor/`, `third_party/`, or other copied directories. The GPL family specifically requires preserving such notices on redistribution (FSF GPL FAQ); this check is broader than GPL, but that is the concrete rule grounding the concern.
|
|
46
48
|
|
|
47
49
|
## Out of static reach
|
|
48
50
|
|
|
49
51
|
- Live vulnerability and exploitability status of any dependency — registry-dependent, and stale the moment it's recorded.
|
|
50
52
|
- Actual maintenance activity and community health of a dependency — last release date, issue-response time, contributor count — needs registry or GitHub API data.
|
|
51
53
|
- Whether a copyleft obligation has actually been triggered by how the code is combined and distributed — needs legal judgement, not a source read.
|
|
52
|
-
- Real bundle-size impact of a heavy dependency — needs a build to measure.
|
|
54
|
+
- Real bundle-size impact of a heavy dependency — needs a build to measure, closed by `runtime.md`'s declared build step when execution is enabled.
|
|
53
55
|
- Whether a vendored license notice is legally sufficient — the file existing is checkable; its adequacy is not.
|
|
56
|
+
- Whether the update bot's pull requests actually get merged, not just that its config file exists — this module has no probe over commit or PR history.
|
|
57
|
+
- Which exact upstream release crossed a relicense boundary — this module can compare the resolved version against a boundary the auditor already knows, but cannot look that boundary up itself.
|
|
58
|
+
- Whether a vendored `LICENSE` file's text has been silently altered from what its SPDX identifier implies — the identifier is read, the text integrity is not verified against it.
|
|
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. This module gains almost nothing from the browser bundle — its whole territory is manifests, lockfiles, and license/notice files, none of which a browser observes. The one narrow exception is a product that renders an in-app "open source licenses" / "third-party notices" page.
|
|
63
|
+
|
|
64
|
+
| Artefact | Gap it closes | Observed instance earns |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `final-state.md` / `read_page` output | An in-app third-party-notices page actually renders non-empty content, corroborating (not replacing) the source-level "Attribution requirements are met" check — only when such a page exists | Info |
|
|
54
67
|
|
|
55
68
|
## Severity guidance
|
|
56
69
|
|
|
57
70
|
| Situation | Severity |
|
|
58
71
|
|---|---|
|
|
59
|
-
| Dependency license incompatible with how the project ships | Critical |
|
|
60
72
|
| Imported package absent from the manifest | High |
|
|
61
73
|
| No declared process for staying current (no Renovate/Dependabot, no audit step in CI) | High |
|
|
62
|
-
| No lockfile committed | High |
|
|
63
74
|
| Runtime dependency in the dev section | High |
|
|
64
75
|
| Vendored third-party code with attribution stripped | High |
|
|
76
|
+
| Dependency carries an obligation the project's shipping model may not satisfy | Medium |
|
|
65
77
|
| Large version gap between allowed range and resolved version on a critical-path dependency | Medium |
|
|
66
78
|
| Single-maintainer package on the critical path | Medium |
|
|
67
79
|
| Unknown license on any dependency | Medium |
|
|
68
80
|
| Floating major version on a runtime dependency | Medium |
|
|
69
81
|
| Two packages solving the same problem | Low |
|
|
70
82
|
| Declared but never imported | Low |
|
|
83
|
+
| Critical dependency resolved on or after a known relicense boundary the shipping model actually triggers | High |
|
|
84
|
+
| AGPL/SSPL dependency reachable as a network service the project's own users interact with remotely | Medium |
|
|
85
|
+
| Source-available license (BSL/SSPL/RSAL/Elastic License) treated as OSI open source with no field-of-use restriction named | Medium |
|