project-brain 0.23.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.
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 +38 -11
  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 +121 -0
  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 +39 -15
  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
@@ -13,8 +13,9 @@ Everything here is verifiable from source. Design-system audits are usually desc
13
13
  Nothing below means anything until you know what the project declared. Find it before you judge anything.
14
14
 
15
15
  - [ ] Locate the token source. `search_code` for `tailwind.config`, `@theme`, `:root {`, `--color-`, `theme.ts`, `tokens.json`, `styled-components` theme, `ThemeData`, `MaterialTheme`, or the platform equivalent.
16
- - [ ] Record the declared scales — spacing steps, type sizes, radii, shadow levels, breakpoints, colour roles — by reading the token source located above and enumerating its declared values verbatim. This list is the yardstick for every later check.
16
+ - [ ] `Read` the token source located above and record the declared scales — spacing steps, type sizes, radii, shadow levels, breakpoints, colour roles — enumerating its declared values verbatim. This list is the yardstick for every later check.
17
17
  - [ ] **If no token source exists at all, that is the finding — `High` — and the rest of the module becomes "every value is ad hoc", not thirty separate deviations.** Report it once, with the count of distinct raw values `search_code` turns up for a single representative category (colour is usually the fastest to count) as evidence of the scale that never existed.
18
+ - [ ] Only when the token source or its build tooling (a Style Dictionary config, a Tokens Studio/Figma-plugin export, a file named `tokens.json` with `$value`/`$type` keys) declares or implies DTCG-format compliance, `Read` the file and check every token carries `$value` and that its type is *determinable* — declared via its own `$type`, inherited from the closest parent group's `$type`, or resolved through an alias to a token whose type is determinable — that every alias uses `{group.token}` syntax rather than a duplicated raw literal, and that no group name begins with `$` or contains `{`, `}`, `.`. A project that never claimed this format (a plain Tailwind config, a styled-components theme object, a CSS custom-property sheet) is out of scope for this check entirely (Design Tokens Community Group, W3C Community Group, 2026, https://www.designtokens.org/TR/drafts/format/ — a token requires `$value`; `$type` is optional on a token and MUST be determined from the referenced token's resolved type or inherited from the closest parent group when omitted; an alias resolves via `{group.token}` syntax).
18
19
 
19
20
  ## Token adoption
20
21
 
@@ -24,24 +25,26 @@ Score it; do not eyeball it. Per category — colour, spacing, radius, typograph
24
25
  adoption = token_references / (token_references + hardcoded_literals)
25
26
  ```
26
27
 
27
- - [ ] Report the number **per category with raw counts**, using the probes below for each category. A project can sit at 95% on colour and 20% on spacing, and a single average hides exactly the category that needs work.
28
- - [ ] Hardcoded colour outside the token file: `search_code` for `#[0-9a-fA-F]{3,8}`, `rgba?(`, `hsla?(`. Each hit outside the declared source is a missing token.
29
- - [ ] Hardcoded dimension: `search_code` for a raw `[0-9]+px` inside `margin`, `padding`, `gap`, `width`, `height`, or `font-size` declarations. Each hit outside the token scale is a missing token.
30
- - [ ] Escape-hatch syntax in utility-class stacks: `search_code` for the pattern `-[` inside class strings (`w-[137px]`, `text-[#3b82f6]`, `mt-[13px]`) and count hits against total class-string occurrences project-wide. A handful is pragmatism. A third of the class strings means there is no system left, only a colour-coordinated accident.
31
- - [ ] A literal repeated in more than one file is a token that was never created. `search_code` a suspect hex or pixel value found above across the repo — two or more files sharing the exact same raw value is the finding; report it once with every site, not once per site.
28
+ - [ ] Report the number **per category with raw counts**, tallying the `search_code` hits from each category probe below against the token count recorded above. A project can sit at 95% on colour and 20% on spacing, and a single average hides exactly the category that needs work.
29
+ - [ ] Hardcoded colour outside the token file: `search_code` for `#[0-9a-fA-F]{3,8}`, `rgba?(`, `hsla?(`. Each hit outside the declared source is a missing token (Design Tokens Community Group, W3C Community Group, 2026, https://www.designtokens.org/TR/drafts/format/ — colour is a defined `$type`; a literal outside the token source has no name or alias, defeating the format's own premise).
30
+ - [ ] Hardcoded dimension: `search_code` for a raw `[0-9]+px` inside `margin`, `padding`, `gap`, `width`, `height`, or `font-size` declarations. Each hit outside the token scale is a missing token (Design Tokens Community Group, W3C Community Group, 2026, https://www.designtokens.org/TR/drafts/format/ — dimension is a defined `$type`, same reasoning as colour).
31
+ - [ ] Escape-hatch syntax in utility-class stacks: `search_code` for the pattern `-[` inside class strings (`w-[137px]`, `text-[#3b82f6]`, `mt-[13px]`) and count hits against total class-string occurrences project-wide. A handful is pragmatism. A third of the class strings means there is no system left, only a colour-coordinated accident (Tailwind Labs, tailwindcss.com, current, https://tailwindcss.com/docs/adding-custom-styles — arbitrary-value bracket syntax is framed by the framework's own authors as an occasional escape hatch, not a parallel styling system).
32
+ - [ ] A literal repeated in more than one file is a token that was never created. `search_code` a suspect hex or pixel value found above across the repo — two or more files sharing the exact same raw value is the finding; report it once with every site, not once per site (Style Dictionary maintainers, styledictionary.com, current, https://styledictionary.com/ — a token-build tool's entire premise is one authored source transformed into many outputs; a repeated raw value violates that single-source-of-truth premise).
32
33
 
33
34
  ## Scale discipline
34
35
 
35
- - [ ] Spacing values come from a constrained scale (4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 …). Cross-reference the raw `px` hits from Token adoption above and list every value that is not on the declared scale, or — absent a declared scale — not a multiple of a consistent base unit, and where each occurs.
36
+ - [ ] Spacing values come from a constrained scale (4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 …). `search_code` for the raw `px` hits already found under Token adoption above and list every value that is not on the declared scale, or — absent a declared scale — not a multiple of a consistent base unit, and where each occurs.
36
37
  - [ ] Type sizes come from one scale — a modular ratio or an explicit named ramp. `search_code` for `font-size` declarations outside the token file and list each resolved value; a size that appears exactly once across the codebase is drift, not a considered addition.
37
- - [ ] Radii, border widths, shadow levels and z-index each have a bounded set. `search_code` for `z-index:`/`z-` utility classes and list every distinct raw value found outside the token file — more than a handful means there is no stacking policy and overlays will fight. Repeat the sweep for `border-radius` and `box-shadow`.
38
+ - [ ] Radii, border widths and shadow levels each have a bounded set. `search_code` for `border-radius` and `box-shadow` declarations outside the token file and list every distinct raw value found — more than a handful means there is no scale.
39
+ - [ ] Z-index values come from a bounded set, and a bounded set is necessary but not sufficient for correct overlay ordering. `search_code` for `z-index:`/`z-` utility classes and list every distinct raw value found outside the token file — more than a handful means there is no stacking policy and overlays will fight; report this as before. Separately, for an overlay/portal-rendered component (modal, dropdown, toast, tooltip), `find_callers` to confirm whether it renders through a portal (React `createPortal`, Vue `<Teleport>`, or the framework equivalent) that escapes to a document-root-level node, and `search_code` its rendering ancestors for `transform`, `opacity` (a static value below 1), `filter`, `perspective`, or `will-change` — any of which creates a new stacking context. An overlay with a "correctly bounded" token-scale z-index that is *not* portaled, sitting inside an ancestor that creates a stacking context, can still render behind a sibling with a numerically lower z-index, because z-index only compares within one stacking context (MDN Web Docs, Mozilla, current, https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_positioned_layout/Understanding_z-index/Stacking_context — "the z-index values of its child stacking contexts only have meaning within its parent's stacking context") — the bounded scale alone does not prevent this. Refuted when the overlay is portaled to the document root and no ancestor between it and the root creates a stacking context — in that case the bounded numeric scale is sufficient and this check finds nothing.
38
40
  - [ ] Breakpoints are declared once and referenced, not retyped per component. `search_code` for `@media` queries or breakpoint utility prefixes (`sm:`, `md:`, `lg:`) carrying a raw pixel value instead of the declared token — each is a breakpoint retyped locally. Device-named breakpoints (iPhone, iPad widths) are a further smell — breakpoints belong where the layout breaks.
39
41
 
40
42
  ## Token architecture
41
43
 
42
44
  Where a three-tier structure exists — primitive → semantic → component — the tiering is only real if it is respected:
43
45
 
44
- - [ ] A token references **exactly one tier below**. `find_symbol` each component-tier token and read what it resolves to — a value pointing straight at a hex or raw px (skipping the semantic tier), or reaching sideways into an unrelated branch, defeats the indirection the tiers exist to provide.
46
+ - [ ] A token references **exactly one tier below**. `find_symbol` each component-tier token and read what it resolves to — a value pointing straight at a hex or raw px (skipping the semantic tier), or reaching sideways into an unrelated branch, defeats the indirection the tiers exist to provide (Design Tokens Community Group, W3C Community Group, 2026, https://www.designtokens.org/TR/drafts/format/ — an alias resolves to the target's `$value`, which presumes the target is another token, not a raw literal). For each token whose value is an alias (`{group.token}` syntax, or the project's non-DTCG equivalent — a CSS `var(--x)` pointing at another custom property, a JS object spreading another theme key), `Read` and manually follow the chain to its terminal literal value. A reference to a name that does not exist in the token source, or a chain that returns to a token already visited, is a broken token: it either fails at build time or silently falls back to an unstyled default, and neither failure mode announces itself in the source the way a missing import does. Refuted when the build tool used (Style Dictionary, a CSS preprocessor) has its own reference-validation step that already runs in CI — check the CI workflow for that step before treating an unresolved reference as unaudited; if the build already fails loudly on it, this is a duplicate of a check `tooling-baseline.md` already covers, not a design-system-specific gap.
47
+ - [ ] Where the token source declares shadow, border, or typography tokens, `Read` their values: a raw CSS-syntax string (`"0 4px 8px rgba(0,0,0,.2)"`) baked into one token is a composite collapsed to a primitive — offset, blur, spread and colour cannot vary independently or be referenced individually by a component that only needs the colour. This applies only where the project has already adopted a structured multi-tier token model; a project using plain CSS or Tailwind's own shadow scale is not in scope. Rule out: the flattened string is a deliberate escape hatch for a one-off value already caught by the Token adoption checks above, not a systemic composite-token gap — check whether every shadow/border/typography token in the file follows the same flattened pattern (systemic) or only one outlier does (already reported elsewhere) (Design Tokens Community Group, W3C Community Group, 2026, https://www.designtokens.org/TR/drafts/format/ — composite types (shadow, border, transition, typography) hold multiple named sub-values in a defined structure, not a flattened string).
45
48
  - [ ] Semantic and component tokens are named for their **role**, never their value. `search_code` semantic/component token names for a colour or size word baked in (`red`, `blue`, `large`) — `color.brand.red` is a primitive name wearing semantic clothes: harmless at tier 1, a trap at tier 2, where the whole point of the name is that the value can change.
46
49
  - [ ] No two tokens hold near-identical values. Read the token file's colour values sorted — `#3b82f6` and `#3b82f7` sitting as separate named entries is drift, not intent.
47
50
  - [ ] Deprecated tokens are marked and have a stated replacement, not silently kept alive by their remaining call sites. `search_code` for a `deprecated`/`@deprecated` marker in the token file, then `find_callers` each marked token — live call sites with no stated replacement is a trap for the next person who reaches for it.
@@ -50,13 +53,13 @@ Where a three-tier structure exists — primitive → semantic → component —
50
53
 
51
54
  The most expensive defect in this module, and the easiest to miss by reading one file:
52
55
 
53
- - [ ] Only one place defines each foundation. `search_code` for a second file matching the same token-source patterns as the one located earlier — a `variables.scss` **and** a `tailwind.config`/`@theme` block both declaring brand colours will drift, and by the time anyone notices, both are load-bearing. Diff them literally, value by value.
54
- - [ ] Design-tool exports (Figma tokens, Style Dictionary output) are generated into the codebase, not hand-maintained alongside it. `search_code` for a Style Dictionary config or a generated-file header comment in the token file — its absence alongside evidence of a Figma-variables integration means the file is hand-edited and will drift from the design tool silently.
55
- - [ ] Theme values are not duplicated between web and native targets in a shared-code project. `search_code` the same colour-role name across the web token file and the native theme file (`Colors.ts`, platform theme) — a role holding different values on each platform is cross-surface drift; cross-reference `contract-drift.md`.
56
+ - [ ] Only one place defines each foundation. `search_code` for a second file matching the same token-source patterns as the one located earlier — a `variables.scss` **and** a `tailwind.config`/`@theme` block both declaring brand colours will drift, and by the time anyone notices, both are load-bearing. Diff them literally, value by value (Style Dictionary maintainers, styledictionary.com, current, https://styledictionary.com/ — the entire reason a token-build tool exists is one source, many outputs; two authored sources is the exact failure mode that model is designed to prevent).
57
+ - [ ] Design-tool exports (Figma tokens, Style Dictionary output) are generated into the codebase, not hand-maintained alongside it. `search_code` for a Style Dictionary config or a generated-file header comment in the token file — its absence alongside evidence of a Figma-variables integration means the file is hand-edited and will drift from the design tool silently (Style Dictionary maintainers, styledictionary.com, current, https://styledictionary.com/ — the tool's stated purpose is generating platform outputs from one source; a hand-edited generated file silently diverges from the next build).
58
+ - [ ] Theme values are not duplicated between web and native targets in a shared-code project. `search_code` the same colour-role name across the web token file and the native theme file (`Colors.ts`, platform theme) — a role holding different values on each platform is cross-surface drift; cross-reference `contract-drift.md` (Style Dictionary maintainers, styledictionary.com, current, https://styledictionary.com/ — cross-platform export, iOS, Android, CSS, JS from one source, is the tool's explicit purpose; per-platform duplication defeats it).
56
59
 
57
60
  ## Component vocabulary
58
61
 
59
- - [ ] One implementation per concept. `search_code` a distinctive class string or markup shape from a button, card, input, modal — duplicates are the finding. Cross-reference the copy-paste check in `frontend.md`; report the *divergence in values* here and the *structural duplication* there.
62
+ - [ ] One implementation per concept. `search_code` a distinctive class string or markup shape from a button, card, input, modal — duplicates are the finding. Cross-reference the copy-paste check in `frontend.md`; report the *divergence in values* here and the *structural duplication* there (Brad Frost, *Atomic Design*, Chapter 2, current, https://atomicdesign.bradfrost.com/chapter-2/ — one reusable component per defined concept, reused wherever the concept recurs, not rebuilt per screen).
60
63
  - [ ] Variants live in one place — a variant helper (`cva`, `tv`, or the project's own), not inline ternaries on `className`. `search_code` for a variant-helper import versus a ternary chain building `className` inside a component — inline variant logic means the variant set is defined N times and will diverge.
61
64
  - [ ] Conditional classes go through a merge helper (`cn()` / `clsx` + `twMerge` or equivalent). `search_code` for `cn(`, `clsx(`, `twMerge(` versus a template-literal or `+` concatenation building a class string — without a merge helper, a conditional class silently loses to source order and the bug looks like "sometimes the style does not apply".
62
65
  - [ ] Component APIs for the same role have the same shape. `find_symbol` each component sharing a role (button, input, badge) and diff their prop names for the same concept — a `size` prop that takes `sm|md|lg` in one component and `small|medium|large` in another is two vocabularies for one idea.
@@ -64,14 +67,15 @@ The most expensive defect in this module, and the easiest to miss by reading one
64
67
  ## Theming
65
68
 
66
69
  - [ ] Every colour role has a counterpart in every declared theme. `search_code` for `dark:` / `[data-theme]` / `prefers-color-scheme` and check the coverage is total, not partial — a half-themed surface is worse than an unthemed one, because it only breaks on some screens.
67
- - [ ] Theme switching goes through tokens, not through per-component conditionals. `search_code` for `theme ===`/`isDarkMode ?` branching inline in component style logic, as opposed to a CSS variable or token swap driven by a theme class/attribute — a per-component conditional is a theme implemented N times instead of once.
68
- - [ ] Contrast holds **in every theme**, not just the default one. Extract the colour pairs from each theme found via the token source above and compute the ratio per pair — do not eyeball it. Cross-reference `accessibility.md`.
70
+ - [ ] Theme switching goes through tokens, not through per-component conditionals. `search_code` for `theme ===`/`isDarkMode ?` branching inline in component style logic, as opposed to a CSS variable or token swap driven by a theme class/attribute — a per-component conditional is a theme implemented N times instead of once (Design Tokens Community Group, W3C Community Group, 2026, https://www.designtokens.org/TR/drafts/format/ — alias/reference indirection is exactly the mechanism that lets a theme swap happen at the token layer without touching component logic).
71
+ - [ ] Contrast is reported under `accessibility.md` (`Read` each theme's token file and compute the ratio per pair); this module's job is only to supply the colour pairs it needs — `search_code` the token source located above for each theme's foreground/background role pairs and hand the list to that check, rather than computing and reporting the ratio here too. Label each pair by role: a foreground/background text pair is WCAG SC 1.4.3 (4.5:1, 3:1 for large text); a border, focus-ring, icon, or form-control-outline pair against its adjacent colour is SC 1.4.11 Non-text Contrast (3:1, excluding inactive components) — an unlabelled pair forces the consuming module to guess which threshold applies (W3C, WCAG 2.2, current, https://www.w3.org/TR/WCAG22/#non-text-contrast — SC 1.4.11 requires 3:1 for UI components and graphical objects, a distinct criterion and threshold from SC 1.4.3's 4.5:1 text-contrast requirement). This labelling raises no finding of its own — the contrast finding and its severity belong to `accessibility.md`.
69
72
 
70
73
  ## Enforcement
71
74
 
72
- - [ ] A lint rule enforces what the token system declares. `search_code` for a stylelint rule (a `declaration-property-value-disallowed-list` on hex/`color`) or an eslint rule on Tailwind arbitrary values (`eslint-plugin-tailwindcss`) — its absence means the discipline above is a convention nobody enforces at commit time.
75
+ - [ ] A lint rule enforces what the token system declares. `search_code` for a stylelint rule (a `declaration-property-value-disallowed-list` on hex/`color`) or an eslint rule on Tailwind arbitrary values (`eslint-plugin-tailwindcss`) — its absence means the discipline above is a convention nobody enforces at commit time (François Massart, `eslint-plugin-tailwindcss` README, current, https://github.com/francoismassart/eslint-plugin-tailwindcss — the plugin ships a `no-custom-classname` rule and a rule forbidding arbitrary values, confirming this is a real, searchable enforcement mechanism).
73
76
  - [ ] CI actually runs that rule. `search_code` the CI workflow files for the lint command found above — a rule declared in config but absent from the CI script list runs only on a developer's machine, if at all. A declared standard nothing enforces is optional, and optional standards decay. Cross-reference the tooling check in `consistency.md`.
74
- - [ ] Visual-regression or theme coverage exists in the test suite. `search_code` for a visual-regression tool import (Chromatic, Percy, Playwright's `toHaveScreenshot`) or a theme-toggle test — its absence is reported under `testing.md`, not silently skipped here.
77
+ - [ ] Visual-regression or theme coverage exists in the test suite. `search_code` for a visual-regression tool import (Chromatic, Percy, Playwright's `toHaveScreenshot`) or a theme-toggle test — its absence is reported under `testing.md`, not silently skipped here (Storybook/Chromatic maintainers, storybook.js.org, current, https://storybook.js.org/docs/writing-tests/visual-testing — visual tests compare the rendered pixels of every story against known baselines, automatically, per story).
78
+ - [ ] Where Storybook is present (`search_code` for `.storybook/` config or `@storybook/` in the manifest), `search_code` for component files under the design-system/component directory and separately for `*.stories.*` files; a component with no matching story is absent from the index the team itself uses to find and reuse existing patterns, and any variant that exists only in that component's internal logic (not in a story) is invisible to whoever reaches for it next. Refuted when the component is a private/internal-only implementation detail never exposed as a reusable design-system piece (no exported public API, single call site) — check with `find_callers` before flagging a genuinely internal component (Storybook maintainers, storybook.js.org, current, https://storybook.js.org/docs/get-started/why-storybook — the story index is framed as "a single source of truth for your UI" for discovery and reuse).
75
79
 
76
80
  ## Out of static reach
77
81
 
@@ -80,6 +84,20 @@ The most expensive defect in this module, and the easiest to miss by reading one
80
84
  - Perceived hierarchy and visual balance.
81
85
  - Whether the dominant pattern is the *intended* one, when no token source exists to declare it.
82
86
  - Whether a value flagged as off-scale is a deliberate, argued exception or an unnoticed accident — source shows the deviation, not the intent behind it.
87
+ - Whether the design-tool source of truth (Figma variables, a Tokens Studio file) currently matches what is generated into this repository — this module can see the generated output, not the live design file it was generated from.
88
+ - How often each component variant actually appears in production traffic — this module counts call sites in source, not render frequency in the field.
89
+ - Token values for a brand/tenant not requested during this audit's `browser.md` run, when brands are resolved at runtime rather than declared in source — only the brand actually loaded is observed.
90
+
91
+ ## What browser observation closes
92
+
93
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number. Contrast findings are reported under `accessibility.md`, at that module's severity, per the ownership split above.
94
+
95
+ | Artefact | Gap it closes | Observed instance earns |
96
+ |---|---|---|
97
+ | computed styles via evaluate | Rendered contrast where colours composite — overlays, opacity, gradients — read from the applied colour, not a screenshot pixel | Medium |
98
+ | `steps.md` | Reflow at 320px and at 200% zoom, screenshotted per viewport | Medium |
99
+ | `evaluate`/`browser_evaluate` reading `getComputedStyle()` for padding/margin/border-radius/font-size on the rendered component | Runtime computed spacing/radius/type-size values diverging from the declared token scale — a CSS specificity war overriding the intended value, invisible to `search_code`. Refuted if the divergent computed value comes from a state the token scale does not cover (a third-party widget, an intentional one-off already flagged and accepted upstream) | Medium |
100
+ | `screenshots/` at the step where the overlay opens, plus `evaluate`/`browser_evaluate` reading `getBoundingClientRect()`/computed `z-index` and stacking ancestry | An overlay actually rendering behind/above its intended sibling in the live DOM, confirming the stacking-context finding above rather than inferring it from source. Refuted if the visual order is correct despite the source-level ancestor risk — the browser's actual paint order proves the finding was a false positive | Medium |
83
101
 
84
102
  ## Severity guidance
85
103
 
@@ -97,3 +115,8 @@ The most expensive defect in this module, and the easiest to miss by reading one
97
115
  | Redundant near-identical tokens | Low |
98
116
  | Semantic token named after its value | Low |
99
117
  | Token lint rule declared but not run in CI | Low |
118
+ | DTCG-format token file claims compliance but does not conform | Low |
119
+ | Composite token (shadow/border/typography) flattened into a raw string | Low |
120
+ | Component present in code with no matching Storybook story | Medium |
121
+ | Token alias chain that does not resolve (broken or circular reference) | High |
122
+ | Overlay/portal component's z-index defeated by an ancestor's stacking context | Medium |
@@ -9,38 +9,41 @@ Read the pipeline as code, because it is. The same standards apply: no secrets i
9
9
  - [ ] The pipeline actually fails the build on test failure, type error, and lint error. `search_code` for `continue-on-error`, `|| true`, and `--passWithNoTests` — each one can turn a red build green. Rule-out: a `continue-on-error` on a genuinely advisory step (a nightly benchmark, an experimental linter) is not a defect; read what the step does before flagging it.
10
10
  - [ ] Every check that matters locally also runs in CI. Read the scripts declared in `package.json`/`Makefile` and the setup steps in README or CONTRIBUTING, then read the CI workflow's actual step list — a script documented or runnable locally but never invoked by a workflow step is decoration, not a check.
11
11
  - [ ] The pipeline triggers on the branches and events that matter. Read the workflow's `on:` block and confirm the merge-target branch and the PR event are both present — a workflow that only runs on `push` to `main` never gates the PR that lands there.
12
- - [ ] Required checks are enforced by branch protection — **this is a platform setting, not a file in the repository.** (OpenSSF Scorecard's own `Branch-Protection` check hits the same wall and queries the GitHub API for it rather than reading source.) A ruleset file or `CODEOWNERS` checked into the repo is the only in-repo signal, and even that only proves a rule was declared, not that GitHub enforces it as required. State explicitly that enforcement itself is `undetermined` from source and belongs in `Out of static reach`; this module can confirm only that the check exists and runs.
12
+ - [ ] The workflow's `on:` block does not enumerate a persistent multi-branch topology (`develop`, `release/*`, `hotfix/*`, `staging` alongside `main`) as the normal path to production. `Read` the trigger block already read for the check above; a pipeline built around several long-lived branches is not itself a defect, but it is the opposite of the trunk-based model most CI/CD tooling assumes — trunk-based development means developers "collaborate on code in a single branch called 'trunk' and resist any pressure to create other long-lived development branches" (trunkbaseddevelopment.com, canonical practice reference site, current, https://trunkbaseddevelopment.com/) — and it is worth naming as context for any deployment-frequency or lead-time finding elsewhere in this module. Refuted if the additional branches are short-lived environments recreated per release and deleted immediately after (e.g. an ephemeral `release/x.y.z` branch), not standing long-lived branches — check whether the pattern is a literal name (`develop`) versus a templated one (`release/*`) before concluding a standing branch exists.
13
+ - [ ] Required checks are enforced by branch protection — **this is a platform setting, not a file in the repository.** (OpenSSF Scorecard's own `Branch-Protection` check hits the same wall and queries the GitHub API for it rather than reading source — several of the settings it queries, like `EnforceAdmins` and `RequiresStatusChecks`, "require an admin token" to the platform API (OpenSSF, official project documentation, current, https://github.com/ossf/scorecard/blob/main/docs/checks.md).) `search_code` for a ruleset file or `CODEOWNERS` checked into the repo — the only in-repo signal, and even that only proves a rule was declared, not that GitHub enforces it as required. State explicitly that enforcement itself is `undetermined` from source and belongs in `Out of static reach`; this module can confirm only that the check exists and runs.
14
+ - [ ] The pipeline records what a delivery-performance metric would need later: a deploy event tagged with the commit SHA and timestamp (a git tag, a GitHub Deployments API call, or an equivalent log line), and a way to tell a rollback/hotfix deploy apart from a forward one. `search_code` for deployment-tagging or Deployments API usage in the deploy job. DORA's 2025 reframing names five delivery metrics — change lead time, deployment frequency, failed-deployment recovery time, change fail rate, deployment rework rate — each computed from exactly this kind of tagged deploy-event data (DORA/Google Cloud, official project site, current, https://dora.dev/guides/dora-metrics-four-keys/). This check does not compute any of the five numbers — it only confirms the pipeline is instrumented so they could be computed from data outside source. Refuted if the signal exists in a system this probe cannot read (the deploy platform's own dashboard, an external release-tracking tool) rather than in the repository — name the tool if one is documented, otherwise report the gap as unconfirmed, not absent.
13
15
 
14
16
  ## Reproducibility
15
17
 
16
- - [ ] Lockfile committed and CI installs from it exactly. `search_code` the CI workflow for the install command — `npm ci`, `yarn install --frozen-lockfile`, `pnpm install --frozen-lockfile` are frozen installs; a bare `npm install`/`yarn install` resolves and can silently drift the lockfile on every run.
17
- - [ ] Action, image, and tool versions are pinned. `search_code` workflow files for `uses: <action>@v` — a version tag floats, a 40-character commit SHA does not. Read the Dockerfile's `FROM` line for the same distinction: a tag can be repointed by its publisher, a digest cannot.
18
+ - [ ] Lockfile committed and CI installs from it exactly. `search_code` the CI workflow for the install command — `npm ci`, `yarn install --frozen-lockfile`, `pnpm install --frozen-lockfile` are frozen installs; a bare `npm install`/`yarn install` resolves and can silently drift the lockfile on every run. `npm ci` is built for exactly this: it "will exit with an error, instead of updating the package lock" on any mismatch, and never writes to `package.json` or the lockfile (npm, official CLI documentation, current, https://docs.npmjs.com/cli/v10/commands/npm-ci).
19
+ - [ ] Action, image, and tool versions are pinned — owned by `supply-chain.md` (`search_code` workflow files for `uses: <action>@v` without a SHA, and the Dockerfile `FROM` tag vs. digest); reuse its finding, do not re-report. Pinning to a full commit SHA is "currently the only way to use an action as an immutable release" — a tag can be moved or deleted if an attacker gains repository access (GitHub, official platform documentation, current, https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions).
18
20
  - [ ] Build does not depend on ambient state. Read the workflow for steps referencing paths or tools outside the checked-out repository, and for a self-hosted runner whose pre-installed toolchain the workflow never declares — a hosted-runner workflow that suddenly needs a self-hosted label is the tell.
19
21
  - [ ] The same artefact that was tested is the one that deploys. Read whether the deploy job downloads the build artefact the test job produced (`actions/upload-artifact` / `download-artifact` or equivalent) or invokes its own separate build step — two independent build invocations across jobs means the tested bits and the shipped bits are not provably identical.
20
22
 
21
23
  ## Secrets in CI
22
24
 
23
- - [ ] No secret in pipeline YAML, build args, or image layers. `search_code` for `secret`, `password`, `token`, `api_key` in workflow files and `Dockerfile`/`docker-compose` build-arg blocks. Rule-out: a hit that is `${{ secrets.X }}` or `${{ env.X }}` interpolation is the secrets manager working correctly; the finding is a literal string assigned where one of those references belongs — read each hit before reporting, do not flag the pattern name alone.
24
- - [ ] Secrets are not echoed. `search_code` for `set -x` or `ACTIONS_STEP_DEBUG`/`ACTIONS_RUNNER_DEBUG` in steps that also reference `secrets.` — verbose mode prints the resolved command line, secret included.
25
- - [ ] Pull requests from forks cannot access secrets. Read the workflow trigger: plain `pull_request` never exposes repository secrets to a fork's code, so do not flag it — that is the safe default and a common false alarm. `pull_request_target` combined with checking out the fork's ref (`ref: ${{ github.event.pull_request.head.sha }}`) is the dangerous "pwn request" pattern, because it runs with base-repo secrets against fork-controlled code.
25
+ - [ ] No secret in pipeline YAML, build args, or image layers. `search_code` for `secret`, `password`, `token`, `api_key` in workflow files and `Dockerfile`/`docker-compose` build-arg blocks. Rule-out: a hit that is `${{ secrets.X }}` or `${{ env.X }}` interpolation is the secrets manager working correctly; the finding is a literal string assigned where one of those references belongs — read each hit before reporting, do not flag the pattern name alone. This is not a hypothetical: CircleCI's 2023 incident (malware on an engineer's laptop escalating to a stolen SSO session) forced every customer to rotate "customer environment variables, tokens, and keys" (CircleCI, official incident report, 2023, https://circleci.com/blog/jan-4-2023-incident-report/), and Codecov's compromised Bash Uploader script ran `curl -sm 0.5 -d "$(git remote -v)<<<<<< ENV $(env)"` inside every CI job that fetched it, exfiltrating environment variables for two months before discovery (Codecov, official security-incident disclosure, 2021, https://about.codecov.io/security-update/).
26
+ - [ ] Secrets are not echoed. `search_code` for `set -x` or `ACTIONS_STEP_DEBUG`/`ACTIONS_RUNNER_DEBUG` in steps that also reference `secrets.` — verbose mode prints the resolved command line, secret included. GitHub's own hardening docs warn that "automatic redaction is not guaranteed" for secrets printed to a log, and any secret that leaks into a run log must be treated as compromised and rotated (GitHub, official platform documentation, current, https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions).
27
+ - [ ] Pull requests from forks cannot access secrets. Read the workflow trigger: plain `pull_request` never exposes repository secrets to a fork's code, so do not flag it — that is the safe default and a common false alarm. `pull_request_target` combined with checking out the fork's ref (`ref: ${{ github.event.pull_request.head.sha }}`) is the dangerous "pwn request" pattern, because it runs with base-repo secrets against fork-controlled code. GitHub's own docs name `pull_request_target`/`workflow_run` workflows as privileged — they "may have repository write access and access to referenced secrets" and are the documented mechanism repo takeovers exploit (GitHub, official platform documentation, current, https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions).
26
28
  - [ ] Two distinct platform mitigations narrow this, and neither is a substitute for reading the workflow. **Workflow-source pinning** (effective 2025-12-08): `pull_request_target` now always takes its workflow file and ref from the repository's default branch, regardless of the PR's base branch — this closes the older exploit of smuggling a malicious workflow version onto a stale non-default branch and waiting for it to trigger. **`actions/checkout` v7** (shipped 2026-06-18): blocks and fails a workflow that tries to check out unreviewed fork-PR code under `pull_request_target` or `workflow_run` — this is enforcement at the checkout step itself, not a change to which workflow file runs. Read the workflow's checkout step and its `actions/checkout` version against both dates before deciding which mitigation, if either, applies.
27
- - [ ] The `actions/checkout` v7 enforcement was backported to the other supported majors on 2026-07-16 — v4, v5, and v6 all inherit the fork-checkout block automatically because they're floating tags GitHub repoints. **`v1` was not backported and does not block it.** `search_code` workflow files for `uses: actions/checkout@v1` under a `pull_request_target`/`workflow_run` trigger — that combination is now a concrete, readable finding, not an inference. The block also does not reach a workflow pinned to a fixed commit SHA predating the backport, or one that clones the fork's ref by hand instead of via `actions/checkout` — name which case applies before concluding the repo is covered.
28
- - [ ] Third-party actions and images have pinned digests. `search_code` workflow files for `uses:` lines lacking a 40-character SHA — the convention is `uses: owner/action@<sha> # v4.2.2`, SHA resolved, tag kept only as a human-readable comment. A floating tag on a third-party action is a supply-chain dependency that can change underneath the pipeline without review; GitHub can enforce this org-wide via its actions-policy SHA-pinning setting (GA since August 2025), but that setting lives outside the repo and is not confirmable from source.
29
+ - [ ] The `actions/checkout` v7 enforcement was backported to all other supported majors on 2026-07-20 — v2 through v6 all inherit the fork-checkout block automatically because they're floating tags GitHub repoints. **`v1` was not backported and does not block it.** `search_code` workflow files for `uses: actions/checkout@v1` under a `pull_request_target`/`workflow_run` trigger — that combination is now a concrete, readable finding, not an inference. The block also does not reach a workflow pinned to a fixed commit SHA predating the backport, or one that clones the fork's ref by hand instead of via `actions/checkout` — name which case applies before concluding the repo is covered.
30
+ - [ ] `GITHUB_TOKEN`'s default permission is scoped down. `search_code` workflow files for a top-level `permissions:` block; its absence means every job runs with the repository's default token permission (often broad read/write) instead of the minimum each job actually needs. GitHub's own hardening guidance recommends setting the default to read-only content access and escalating per job (GitHub, official platform documentation, current, https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions). Rule-out: a workflow that only reads (checks out code, runs tests with no deploy/comment/label step) is lower risk even without the block, but the block should still exist to make that intent explicit. Refuted if the repository/organization default workflow permission is already set to read-only at the platform level — not visible from source, so a missing `permissions:` block still reports as `Medium` rather than being dropped, since this module cannot confirm which case applies.
31
+ - [ ] No CI step or Dockerfile `RUN` pipes a remotely-fetched script straight into a shell with no integrity check. `search_code` for `curl ... | sh`, `curl ... | bash`, `wget -O- ... | sh` in workflow files and Dockerfiles. This is the exact shape of two real incidents: Codecov's Bash Uploader, fetched via `curl | bash` by CI pipelines across GitHub Actions, CircleCI, and other providers, was silently modified for two months in 2021 to exfiltrate every environment variable from any job that ran it (Codecov, official security-incident disclosure, 2021, https://about.codecov.io/security-update/), and CircleCI's own 2023 compromise reached "customer environment variables, tokens, and keys" at scale (CircleCI, official incident report, 2023, https://circleci.com/blog/jan-4-2023-incident-report/). Rule-out: the fetch is over a URL pinned to an immutable release artefact or commit, and its output is checksummed against a value stored in this repository before execution — an install script from a package manager's own documented onboarding flow with no checksum step is still the finding, not an exception. Refuted if the script is vendored into the repository (read from a local path, not fetched at run time) — then there is no remote-tampering window and this is not the same defect class.
29
32
 
30
33
  ## Container hygiene
31
34
 
32
35
  - [ ] Multi-stage build so build tooling is not in the final image. Read the Dockerfile, count `FROM` stages, and confirm the final stage `COPY --from=` only the build output, never the compiler, package manager cache, or dev dependencies.
33
- - [ ] Runs as a non-root user. `search_code` the Dockerfile for a `USER` directive — its absence means the container runs as root by default, and that is the finding, not an assumption to double-check.
36
+ - [ ] Runs as a non-root user. `search_code` the Dockerfile for a `USER` directive — its absence means the container runs as root by default, and that is the finding, not an assumption to double-check. Rule out a base image that already declares non-root in an earlier stage or in the `FROM` image itself (a distroless `*-nonroot` variant, e.g. `gcr.io/distroless/static-debian12:nonroot`) — read the base image name/tag before concluding root.
34
37
  - [ ] Base image is minimal, specific, and updatable. Read the `FROM` line: a distroless, Alpine, or `-slim` variant carries a materially smaller attack surface than a full `ubuntu`/`debian` image with the same tooling available to an attacker post-compromise — name which family is in use. A pinned tag or digest is checkable; `latest` or an untagged reference is not, and "something updates it" needs a Renovate/Dependabot config or equivalent — `search_code` for one.
35
38
  - [ ] Build context excludes what should not ship. Read the `.dockerignore` file's actual contents — its mere existence proves nothing — and confirm `.git`, `node_modules`, `.env`, and test fixtures are each covered, not assumed covered by a wildcard that does not match them.
36
- - [ ] Healthcheck defined, and it reflects readiness rather than only liveness. `search_code` for `HEALTHCHECK`, then read what it curls or invokes — a check that only confirms the process is running (e.g. hitting `/` with no dependency check) reports healthy while the database connection is down.
39
+ - [ ] Healthcheck readiness-vs-liveness is owned by `observability.md` (`search_code` for the health-check handler and `find_symbol` its readiness logic); reuse its finding, do not re-report. This module's own concern is only that a `HEALTHCHECK` directive exists in the Dockerfile at all — `search_code` for its presence.
37
40
  - [ ] Capabilities are dropped and the root filesystem is read-only wherever the application allows it. `search_code` the Dockerfile, compose file, or Kubernetes manifest for `cap_drop: [ALL]` / `--cap-drop=ALL` and `readOnlyRootFilesystem: true` / `read_only: true`. Their absence means the container keeps the full default Linux capability set and a writable root even after the non-root and multi-stage fixes above — a step past "not root," and the next thing 2026 hardening baselines check for.
38
41
 
39
42
  ## Deploy and rollback
40
43
 
41
44
  - [ ] A documented rollback path exists. `search_code` docs and runbooks for "rollback" and read the steps. This module can confirm only that a documented path exists, not that it has ever been exercised — whether it actually works under a real failure is `undetermined` from source and belongs in `Out of static reach`.
42
- - [ ] Migrations and code deploys are ordered so a running old version does not break. Cross-reference the destructive-migration check in `database.md`: read migration files for additive-vs-destructive shape (a dropped or renamed column breaks the old version still running against it) and compare against the deploy workflow's ordering of migrate-then-deploy vs deploy-then-migrate.
43
- - [ ] Deploys are atomic or gradual, not partial-and-visible. Read the deployment platform's config — a Kubernetes rolling-update strategy, a blue-green or canary configuration — for the actual cutover mechanism rather than assuming one.
45
+ - [ ] Migrations and code deploys are ordered so a running old version does not break. Cross-reference the destructive-migration check in `database.md`: `Read` migration files for additive-vs-destructive shape (a dropped or renamed column breaks the old version still running against it) and compare against the deploy workflow's ordering of migrate-then-deploy vs deploy-then-migrate.
46
+ - [ ] Deploys are atomic or gradual, not partial-and-visible. Read the deployment platform's config — a Kubernetes rolling-update strategy, a blue-green or canary configuration — for the actual cutover mechanism rather than assuming one. A `Recreate` strategy, or a rolling-update with no readiness probe gating traffic, is the finding: it exposes half-updated instances to live traffic instead of cutting over cleanly.
44
47
  - [ ] Configuration differs from code, so a config change does not require a rebuild. `search_code` for values that should be environment-driven but are hardcoded into source, and cross-reference the declared environment-variable list in `infrastructure.md`.
45
48
 
46
49
  ## Local parity
@@ -49,27 +52,39 @@ Read the pipeline as code, because it is. The same standards apply: no secrets i
49
52
  - [ ] Local and CI use the same tool versions. `search_code` for `.nvmrc`, `.tool-versions`, or an `engines` field, then compare the version it names against the version pinned in the CI workflow — a mismatch means "works on my machine" is provably possible.
50
53
  - [ ] Nothing required for development is available only to existing team members. `search_code` setup docs for internal URLs or private registries and check whether an access-request process is documented alongside them; an undocumented internal dependency blocks every new contributor identically.
51
54
 
55
+ ## What browser observation closes
56
+
57
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number. `devops.md`'s checks are almost entirely about files a browser session never renders — workflow YAML, Dockerfiles, lockfiles, `.dockerignore` — so the bundle is close to useless for this module; the one row below is the only place a running-app observation touches a devops concern, and even it is a weak, opportunistic signal.
58
+
59
+ | Artefact | Gap it closes | Observed instance earns |
60
+ |---|---|---|
61
+ | `network.jsonl` (response headers on the root request), `read_page`/`final-state.md` (rendered footer/about text) | The running app exposes a build/version identifier (response header, `/version` endpoint, or visible footer string) that ties the live deployment back to a specific commit — feeding the "same artefact that was tested is the one that deploys" check in Deploy and rollback. Absence of a visible identifier does not itself prove the wrong artefact is deployed — it only means this module cannot confirm which build is live without one; report as "not observable," not as a mismatch. | Info |
62
+
52
63
  ## Out of static reach
53
64
 
54
65
  - Whether required checks are actually enforced by branch protection — a platform setting invisible to source, not a file.
55
- - Whether a documented rollback procedure has ever been executed successfully.
66
+ - Whether a documented rollback procedure has ever been executed successfully — closed by `runtime.md` when execution is enabled and the user explicitly names the rollback script as one of its declared mutation commands.
56
67
  - True build reproducibility across machines and over time, beyond what pinned versions and lockfiles imply.
57
68
  - Whether CI secrets are scoped correctly at the provider (environment restrictions, least-privilege service accounts) rather than merely referenced correctly in YAML.
69
+ - The `GITHUB_TOKEN`'s real effective scope with no `permissions:` block declared — that depends on an org/repo default this module cannot read from source.
70
+ - Whether a remotely-fetched script referenced in CI is unchanged at every future run — this module confirms the pattern exists at audit time, not that the fetched content stays trustworthy after.
58
71
  - Real autoscaling and deploy-strategy behaviour under production load.
59
- - Whether the pipeline's actual delivery performance meets any DORA benchmark — DORA's 2025 report reframed the classic four metrics into five (deployment frequency, lead time for changes, failed-deployment recovery time, change fail rate, deployment rework rate). This module can confirm a pipeline exists and how it's gated, not how often it fires or how long a change takes once merged — that needs CI run history and incident data outside source.
72
+ - Whether the pipeline's actual delivery performance meets any DORA benchmark — DORA's 2025 report reframed the classic four metrics into five (deployment frequency, lead time for changes, failed-deployment recovery time, change fail rate, deployment rework rate). This module can confirm the pipeline emits the raw signal those metrics would need (see the deploy-tagging check in Pipeline integrity), not the resulting rate — that needs CI run history and incident data outside source.
60
73
 
61
74
  ## Severity guidance
62
75
 
63
76
  | Situation | Severity |
64
77
  |---|---|
65
- | Secret in pipeline config, build arg, or image layer | Critical |
66
- | `pull_request_target` checks out and runs fork-PR head, with no checkout-level block in effect (`actions/checkout@v1`, a pre-2026-07-16 pinned SHA, or a hand-rolled clone) | Critical |
78
+ | Secret in pipeline config, build arg, or image layer | High |
79
+ | CI step or Dockerfile `RUN` pipes a remotely-fetched script into a shell with no integrity check | High |
80
+ | `pull_request_target` checks out and runs fork-PR head, with no checkout-level block in effect (`actions/checkout@v1`, a pre-2026-07-20 pinned SHA, or a hand-rolled clone) | High |
67
81
  | Pipeline cannot fail the build (`\|\| true`, `continue-on-error`) | High |
68
82
  | Artefact rebuilt between test and deploy | High |
69
83
  | Container runs as root | High |
70
84
  | Untested or absent rollback path | High |
71
- | Unpinned action, image, or tool version | Medium |
72
85
  | Build depends on ambient developer state | Medium |
73
86
  | Build context ships `.git` or secrets | Medium |
74
87
  | Documented local setup that does not work | Medium |
75
88
  | No capability drop or read-only root filesystem configured | Medium |
89
+ | `GITHUB_TOKEN` default permission not scoped down, no top-level `permissions:` block declared | Medium |
90
+ | CI trigger config built around long-lived branches instead of a single trunk | Low |
@@ -5,49 +5,65 @@ Can someone else use and change this? Documentation findings are verifiable: fol
5
5
  ## Correctness
6
6
 
7
7
  - [ ] Every documented command, path, flag, and signature exists. `search_code` each one against the parser/dispatcher. A documented flag the parser does not accept is `Medium`; readers trust docs over code.
8
- - [ ] Follow the install and first-run instructions exactly as written, on a clean-checkout assumption. `find_symbol` each command or script the doc names, in the order the doc gives them, and confirm each exists and accepts the arguments shown. Report every missing prerequisite, wrong path, and undocumented step.
8
+ - [ ] Follow the install and first-run instructions exactly as written, on a clean-checkout assumption. `find_symbol` each command or script the doc names, in the order the doc gives them, and confirm each exists and accepts the arguments shown. Report every missing prerequisite, wrong path, and undocumented step. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
9
9
  - [ ] Code examples match current signatures. `find_symbol` the real signature and diff it literally against the example — parameter names, order, and return shape.
10
10
  - [ ] No documentation of features that no longer exist. `search_code` the documented feature's name/symbol in the source; zero hits confirms removal. Rule out a rename before calling it stale — search under a plausible new name too. Cross-reference `Reachability` for the inverse.
11
- - [ ] Claims about behaviour are true. `find_symbol` the function the claim describes and read it directly — do not accept the doc's wording as evidence of its own accuracy. This repo's own README once claimed skills were "installed globally" when nothing installed them; a false claim is worse than a gap, because nobody investigates what they believe is handled.
11
+ - [ ] Claims about behaviour are true. `find_symbol` the function the claim describes and read it directly — do not accept the doc's wording as evidence of its own accuracy. This repo's own README once claimed skills were "installed globally" when nothing installed them; a false claim is worse than a gap, because nobody investigates what they believe is handled. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
12
12
 
13
13
  ## Coverage
14
14
 
15
- - [ ] Purpose stated up front — what this is and who it is for. `search_code`/`search_context` the README's opening section for an audience/purpose statement. Cross-reference `goal.md`.
16
- - [ ] Every public entry point documented: commands, endpoints, exported functions, config keys, environment variables. `get_architecture`/`repo_map` for the full entry-point list, then `search_code` each name against the docs — an entry point with zero doc hits is the gap.
15
+ - [ ] Purpose stated up front — what this is and who it is for. `search_code`/`search_context` the README's opening section for an audience/purpose statement. Cross-reference `goal.md`. Where the README exists, its opening should state all five of GitHub's named elements: what the project does, why it's useful, how to get started, where to get help, and who maintains it — `search_code`/`Read` the README's first section against this five-part list; missing any one is the gap, unless it is genuinely not applicable (e.g., a solo hobby project with no "where to get help" channel) — name which is inapplicable and why, rather than treating its absence as a gap. (GitHub, Inc., "About READMEs" — https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-readmes)
16
+ - [ ] Every public entry point documented: commands, endpoints, exported functions, config keys, environment variables. `get_architecture`/`repo_map` for the full entry-point list, then `search_code` each name against the docs — an entry point with zero doc hits is the gap. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
17
17
  - [ ] Every configuration option documented with its type, default, and effect. `search_code` the config schema/parser for every key, then check each appears in docs with all three of type, default, and effect — name-only documentation is still a gap.
18
- - [ ] Prerequisites and supported platforms stated, and matching what the code requires. `search_code` the manifest's engine/platform constraints (`engines`, `python_requires`, a Dockerfile base image) and diff against what the docs claim.
18
+ - [ ] Prerequisites and supported platforms stated, and matching what the code requires. `search_code` the manifest's engine/platform constraints (`engines`, `python_requires`, a Dockerfile base image) and diff against what the docs claim. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
19
19
  - [ ] Failure modes documented: what common errors mean and what to do about them. `search_code` the entry point's thrown/returned error messages and check each has a corresponding doc entry — an error string with no doc mention is the gap.
20
- - [ ] A path from install to first useful result, in order. Read the doc top to bottom and confirm no step depends on a later one. Cross-reference `product.md`'s onboarding path check; reuse its finding rather than re-deriving it here.
20
+ - [ ] A path from install to first useful result, in order. Read the doc top to bottom and confirm no step depends on a later one. Cross-reference `product.md`'s onboarding path check; reuse its finding rather than re-deriving it here. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
21
+ - [ ] A CHANGELOG (or release notes) exists, and each entry states what changed, when, and under which category (Added/Changed/Deprecated/Removed/Fixed/Security), newest first. `search_code` for CHANGELOG.md/HISTORY.md; if found, `Read` it and confirm entries are dated and grouped by type rather than a raw commit-log dump. Rule out a project with no tagged, externally-consumed releases (an internal service redeployed continuously, no version field in the manifest) — confirm via the manifest's version field before flagging, and report this Out of static reach instead. (Lacan et al., "Keep a Changelog" v1.1.0 — https://keepachangelog.com/en/1.1.0/)
22
+ - [ ] A security policy (SECURITY.md, in the repo root, `.github/`, or `docs/`) states supported versions and how to report a vulnerability. `search_code` for SECURITY.md in the three recognized locations; a project accepting external contributions or exposing a network entry point with none is the gap. Rule out a private project with no path for an external party to discover or report a vulnerability through this channel — confirm via a checkable signal that the project is not externally facing (no LICENSE file, no CONTRIBUTING file, no public issue-template directory under `.github/ISSUE_TEMPLATE/`) before flagging; a manifest's `private` field does not establish this, since it is routinely set on public repositories to block registry publication and says nothing about visibility. (GitHub, Inc., "Adding a security policy to your repository" — https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository)
23
+ - [ ] A CONTRIBUTING file exists in one of GitHub's three recognized locations (`.github/`, root, `docs/`, in that priority order) and its described process (branch naming, required checks, review) matches the actual CI config. `search_code` for CONTRIBUTING.md in these locations; when found, diff its stated steps against `.github/workflows/` or equivalent CI configuration. Rule out a single-maintainer project with no open external-contribution path — confirm no contribution-adjacent language exists in the README either before flagging as a gap rather than a deliberate choice. (GitHub, Inc., "Setting guidelines for repository contributors" — https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors)
21
24
 
22
25
  ## Structure
23
26
 
24
27
  - [ ] A reader can find what they need without reading everything. Documentation is organised by the reader's intent, not merely by feature area — the Diátaxis framework's four modes (tutorial: a hands-on lesson; how-to: steps toward one task; reference: facts, consulted rather than read; explanation: the background and the why) are the vocabulary practitioners actually use to name this split. `list_modules`, or read the docs directory tree directly — a single flat file mixing tutorial prose, task steps, and reference tables is the finding; note which of the four modes exist at all for this project and which are entirely absent, since a project with no explanation/why documentation has a different gap than one with no reference.
25
- - [ ] Reference material reads cleanly as an isolated fragment. Read one reference page or section with no surrounding tutorial context and confirm it still makes sense on its own — a reference entry that depends on narrative set up earlier in a different document fails a reader who jumped straight to it mid-task, and fails identically for any retrieval-based system (a search index, or this skill's own project-brain) that surfaces the section as a standalone chunk.
26
- - [ ] No step assumes knowledge the doc never states. Read each instruction in the install/first-run path and confirm every input it requires — an account, a config value, a secret, a prior step performed elsewhere — is documented as a prerequisite before it is used, not assumed already known to the reader.
28
+ - [ ] Reference material reads cleanly as an isolated fragment. Read one reference page or section with no surrounding tutorial context and confirm it still makes sense on its own — a reference entry that depends on narrative set up earlier in a different document fails a reader who jumped straight to it mid-task, and fails identically for any retrieval-based system (a search index, or this skill's own project-brain) that surfaces the section as a standalone chunk. (Diátaxis maintainers, "Reference," official framework site — https://diataxis.fr/reference/)
29
+ - [ ] No step assumes knowledge the doc never states. Read each instruction in the install/first-run path and confirm every input it requires — an account, a config value, a secret, a prior step performed elsewhere — is documented as a prerequisite before it is used, not assumed already known to the reader. (Google Developers, "Technical Writing One" — https://developers.google.com/tech-writing/one)
27
30
  - [ ] Nothing important lives only in a comment, a commit message, or an issue. `search_code` for a comment stating a constraint or contract with no counterpart in any doc file — that constraint is invisible to anyone who doesn't read that exact line.
28
- - [ ] Docs live near what they describe, so a change is likely to update both. Compare the doc file's path to the code path it documents — a doc for `src/auth/` living only in a top-level `/docs` with no cross-link is more likely to rot.
29
- - [ ] No duplicated documentation of the same thing in two places. `search_code` a distinctive phrase or heading from one doc file against the rest of the docs tree — a hit in a second file is the duplicate; they will diverge, and the reader cannot tell which is current. This is the single most commonly reported documentation defect in practice, ahead of any individual accuracy gap.
31
+ - [ ] Docs live near what they describe, so a change is likely to update both. `Read` the doc file's path against the code path it documents — a doc for `src/auth/` living only in a top-level `/docs` with no cross-link is more likely to rot.
32
+ - [ ] No duplicated documentation of the same thing in two places. `search_code` a distinctive phrase or heading from one doc file against the rest of the docs tree — a hit in a second file is the duplicate; they will diverge, and the reader cannot tell which is current. Rule out a short warning or prerequisite kept verbatim on purpose across two entry points for reader safety (the same security caveat in both a quickstart and a security doc) — the finding is near-duplicate *prose* likely to diverge, not an intentionally mirrored short notice. This is the single most commonly reported documentation defect in practice, ahead of any individual accuracy gap.
30
33
 
31
34
  ## In-code documentation
32
35
 
33
- - [ ] Non-obvious code explains **why**, not what. Read a sample of comments near `repo_map`'s highest-PageRank symbols — a comment restating the line (`// increment i` above `i++`) is noise; a missing rationale on a surprising line (a magic number, an early return, a suppressed lint) is a real gap.
36
+ - [ ] Non-obvious code explains **why**, not what. Read a sample of comments near `repo_map`'s highest-PageRank symbols — a comment restating the line (`// increment i` above `i++`) is noise; a missing rationale on a surprising line (a magic number, an early return, a suppressed lint) is a real gap. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
34
37
  - [ ] Public APIs document their contract: what they accept, what they return, what they throw, what they mutate. `find_symbol` each exported function and check its docstring/JSDoc covers all four; a signature with none is the gap.
35
38
  - [ ] Comments are current. `find_symbol` the commented code and read both together — a comment contradicting its code is `Medium`; cross-reference `consistency.md`.
36
39
  - [ ] Workarounds record why they exist and what would let them be removed. `search_code` for `workaround`/`hack`/`XXX` and check each has an adjacent explanation — an unexplained workaround is permanent by default.
37
- - [ ] Deliberate deviations from an obvious approach say so, and say what was traded. `search_code` a non-obvious implementation choice (a manual loop where a library call would be idiomatic) and check for a comment explaining the tradeoff.
40
+ - [ ] Deliberate deviations from an obvious approach say so, and say what was traded. `search_code` a non-obvious implementation choice (a manual loop where a library call would be idiomatic) and check for a comment explaining the tradeoff. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
38
41
 
39
42
  ## Maintenance
40
43
 
41
- - [ ] Something keeps docs honest — a test asserting required sections, a link check, or executable examples. `search_code` the CI config and test directory for a docs-lint, link-check, or doctest step; its absence means docs decay silently.
42
- - [ ] Onboarding docs name an owner, or are recent enough to trust. Read the doc's header/footer for an owner or last-updated marker; if absent and `Repo History` is in the confirmed module set, use the file's last-commit date as a proxy for trust.
43
- - [ ] Where specs, plans, or ADRs exist, they reflect what shipped. `find_symbol` the component the spec describes and diff its real shape against the spec's. Cross-reference `prompt-spec-gap.md`; a plan describing a design the code abandoned actively misleads.
44
+ - [ ] Something keeps docs honest — a test asserting required sections, a link check, or executable examples. `search_code` the CI config and test directory for a docs-lint, link-check, or doctest step; its absence means docs decay silently. Documentation paths (README, `docs/`) should be gated by the same review path as code — a CODEOWNERS entry or branch-protection rule names a reviewer for them; `search_code` for CODEOWNERS and branch-protection/CI config referencing doc paths, and treat code paths with an owner but doc paths without one as the gap. Rule out a project below the size where CODEOWNERS/branch protection is used for code at all — confirm code paths themselves have no reviewer gate either before treating the doc paths' lack of one as a gap rather than a baseline. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html; Write the Docs community, official guide — https://www.writethedocs.org/guide/)
45
+ - [ ] Onboarding docs name an owner, or are recent enough to trust. Read the doc's header/footer for an owner or last-updated marker; if absent and `Repo History` is in the confirmed module set, use the file's last-commit date as a proxy for trust. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
46
+ - [ ] Where specs, plans, or ADRs exist, they reflect what shipped. `find_symbol` the component the spec describes and diff its real shape against the spec's. Cross-reference `prompt-spec-gap.md`; a plan describing a design the code abandoned actively misleads. (Winters, Manshreck & Wright, eds., *Software Engineering at Google*, ch. 10 — https://abseil.io/resources/swe-book/html/ch10.html)
44
47
 
45
48
  ## Out of static reach
46
49
 
47
- - Whether a reader actually succeeds following the docs, versus the steps being present and in the right order.
50
+ - Whether a reader actually succeeds following the docs, versus the steps being present and in the right order — closed by `runtime.md`'s install/typecheck/lint/build/test exit codes when execution is enabled and the declared commands match the documented ones; cite the exit code rather than re-deriving. With browser observation enabled and a documented UI flow among the confirmed flows, the UI-described half of this gap is closed by `browser.md`'s bundle instead — CLI/install steps stay closed by `runtime.md`; steps described as clicks, menus, or screens are closed by a walked flow (see "What browser observation closes" below).
48
51
  - Whether an in-code comment's rationale is still true today, when nothing pins it to the constraint it described.
49
52
  - Perceived clarity of an error message or doc passage to someone unfamiliar with the codebase.
50
53
  - Whether the docs owner named in a header is still the right person to ask.
54
+ - Whether this project's own issue tracker, mailing list, or Stack Overflow already contains a documentation complaint matching a finding here — this module has no probe that reads those sources.
55
+ - Whether the process a CONTRIBUTING or SECURITY file describes is the process actually followed — this module reads the promise, not the track record.
56
+ - Whether readers are actually better served by the four-mode split versus how the docs were organized before — this module confirms the modes exist, not that the split helped.
57
+ - A GitHub/GitLab Releases page — it is not in the indexed repository and no probe in this module's catalogue reaches it; a CHANGELOG/HISTORY file in-repo is what `search_code` can confirm.
58
+
59
+ ## What browser observation closes
60
+
61
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number.
62
+
63
+ | Artefact | Gap it closes | Observed instance earns |
64
+ |---|---|---|
65
+ | `steps.md` / `screenshots/` / `a11y-snapshot.md` | A documented UI flow's steps (menu names, button labels, page order) confirmed against a walked flow covering the same path — refuted if the walked URL/step sequence took a different path to a similar end state, not the same documented path | High |
66
+ | `console.jsonl` / `screenshots/` / `steps.md` | Documented failure-mode text matches what actually renders on the walked flow's invalid-input step — refuted if the difference is only in a dynamic value (a filename, a count), not the message template itself | Medium |
51
67
 
52
68
  ## Severity guidance
53
69
 
@@ -61,8 +77,14 @@ Can someone else use and change this? Documentation findings are verifiable: fol
61
77
  | Public entry point with no documentation | Medium |
62
78
  | Spec or plan describing an abandoned design | Medium |
63
79
  | Instruction step assumes an undocumented prerequisite | Medium |
80
+ | README opening missing one of the five stated elements (what/why/how to start/where to help/who maintains), no reason given | Medium |
81
+ | Security policy absent for a project accepting external contributions or exposing a network entry point | Medium |
82
+ | CONTRIBUTING file absent or its described process does not match actual CI config | Medium |
83
+ | Documented UI flow step not reproduced, or a rendered control's label mismatched, in a walked flow | High |
64
84
  | One of the four Diátaxis modes entirely absent where the project needs it | Low |
65
85
  | Reference material that only makes sense with tutorial context read first | Low |
66
86
  | Unexplained workaround | Low |
67
87
  | Same thing documented in two places | Low |
68
88
  | No enforcement keeping docs honest | Low |
89
+ | No CHANGELOG/release notes, or entries not dated and grouped by type | Low |
90
+ | Doc paths (README, `docs/`) excluded from the reviewer/CODEOWNERS gate that covers code paths | Low |
@@ -6,42 +6,46 @@ The test suite proves the happy path. This module walks the other paths — and
6
6
 
7
7
  ## Error propagation
8
8
 
9
- - [ ] No swallowed errors: `search_code` for empty catch blocks, `.catch(() => {})`, and `catch` bodies that only log at debug level. Each one converts a failure into wrong behaviour.
10
- - [ ] Caught errors either handle or rethrow: read the catch bodies found above — one that logs and then falls through to the next statement, with no `return`/`throw`, continues execution on invalid state. That is worse than either handling or propagating.
9
+ - [ ] No swallowed errors: `search_code` for empty catch blocks, `.catch(() => {})`, and `catch` bodies that only log at debug level. Each one converts a failure into wrong behaviour — this is `High` at `read`; `find_callees` on the function containing the catch, or `trace_path` from it to the write operation whose result is lost, promotes it to `traced`, and `Critical`. Rule out a catch guarding a call whose result is provably never consumed anywhere (dead-end telemetry, a best-effort cache warm) before flagging. "Almost all catastrophic failures (48 in total – 92%) are the result of incorrect handling of non-fatal errors explicitly signalled in software," and roughly a third of those studied were trivially wrong handlers — an empty or log-only catch body (Ding Yuan et al., OSDI '14, USENIX, 2014, https://blog.acolyer.org/2016/10/06/simple-testing-can-prevent-most-critical-failures/).
10
+ - [ ] The catch/error branch identified above is exercised by a test that forces the failure (a mocked rejection, `.rejects.`, a forced-throw helper), not only by tests of the happy path: `find_callers` on the function containing the catch for a caller under a `test`/`spec`/`__tests__` path; absent that, `search_code` in the test tree for the function name paired with a fault-injection call. An untested catch is exactly the gap Yuan et al.'s analysis targets — error-handling code a test suite exercised the *presence* of but never the *behavior* of under an actual failure (Ding Yuan et al., OSDI '14, USENIX, 2014, https://blog.acolyer.org/2016/10/06/simple-testing-can-prevent-most-critical-failures/). Refuted if the branch guards a fault that cannot practically be simulated (e.g. genuine disk-full, a specific OS signal) — name the specific untestable fault before dropping the finding, since most catches in application code guard mockable I/O (network client, ORM call, filesystem call) that a fault-injection test can force.
11
+ - [ ] Caught errors either handle or rethrow: `Read` the catch bodies found above — one that logs and then falls through to the next statement, with no `return`/`throw`, continues execution on invalid state. That is worse than either handling or propagating. Yuan et al. note a related trivially-wrong shape: catching an abstract `Exception`/`Throwable` type followed by a drastic action, the same "handler present but wrong" family (Ding Yuan et al., OSDI '14, USENIX, 2014, https://blog.acolyer.org/2016/10/06/simple-testing-can-prevent-most-critical-failures/).
11
12
  - [ ] Error context survives the chain: `search_code` for `throw new Error(` inside a `catch` block, then read whether it wraps the original (`{ cause: err }`) or discards it. A rethrow that loses the original cause makes the real failure unfindable.
12
- - [ ] Errors are distinguishable by type or code, not by matching message strings: `search_code` for `.message ===`/`.message.includes(` used to branch on an error. Message matching breaks on the next wording change.
13
+ - [ ] Errors are distinguishable by type or code, not by matching message strings: `search_code` for `.message ===`/`.message.includes(` used to branch on an error. Message matching breaks on the next wording change. Stripe's own API includes a structured `code` field specifically "to help an integration react appropriately" rather than branch on message text — the same design principle, documented for API consumers rather than in-process catch branching (Stripe, official API documentation, "Advanced error handling," current, https://docs.stripe.com/error-low-level).
13
14
 
14
15
  ## Boundaries
15
16
 
16
- - [ ] Every external call is wrapped: `search_code` for the network/filesystem/subprocess/database client calls (`fetch(`, an HTTP client, `fs.`, `spawn(`, ORM query calls) and confirm each sits inside a try/catch or has a `.catch(`.
17
- - [ ] Every external call has a timeout: read each client construction or call site found above for a `timeout` option or an `AbortSignal.timeout`. Missing timeout is `High` — it turns a slow dependency into an outage. Rule out a framework-level default timeout that applies even without an explicit one, and name it.
18
- - [ ] Retries exist where the failure is transient, are bounded, and back off: `search_code` for a retry wrapper or library around each external call found above; read its config for a max-attempts and a backoff strategy — specifically jittered exponential backoff. Full Jitter (`random(0, min(cap, base*2^attempt))`) is the primary-source recommendation over a fixed interval or un-jittered exponential backoff, since it does the least total work against a recovering backend for comparable completion time (AWS Architecture Blog, "Exponential Backoff and Jitter").
19
- - [ ] Non-transient failures are not retried: read the retry predicate (`shouldRetry`/`retryIf`) at each site found above — retrying unconditionally on any thrown error, including a 4xx, wastes time and hides the bug.
20
- - [ ] Retries are capped by a budget shared across the process, not just a per-call max-attempts count: `search_code` for a retry-budget/limiter (a rolling ratio of retries to total requests, an explicit cap such as "no more than N retries per minute"). Per-call bounding still lets every concurrent caller retry independently, and across a chain of N layers each retrying k times, that multiplies to as many as k^N attempts at the bottom during an incident — the retry-storm mechanism (Google SRE book, "Addressing Cascading Failures").
21
- - [ ] Repeated failures against the same dependency trip a circuit breaker rather than retrying every request into it indefinitely: `search_code` for a circuit-breaker library (resilience4j, Polly's `CircuitBreakerStrategy`, an in-house failure-counter-with-open-state) wrapping the client found above. The pattern is still current guidance — Microsoft's Azure Architecture Center revised its circuit-breaker page as recently as 2026-07-02 — even though Netflix's own Hystrix has been in maintenance mode since 2018 and its README now points to resilience4j; look for the pattern by behaviour, not for a specific library name.
17
+ - [ ] Every external call is wrapped: `search_code` for the network/filesystem/subprocess/database client calls (`fetch(`, an HTTP client, `fs.`, `spawn(`, ORM query calls) and confirm each sits inside a try/catch or has a `.catch(`. Rule out a call site covered by a project-wide error-boundary or middleware wrapper (an async-route wrapper, a global `unhandledRejection` handler) — `find_symbol` the wrapper and confirm this call site is inside its scope before flagging the absence of a local try/catch.
18
+ - [ ] Every external call has a timeout: `Read` each client construction or call site found above for a `timeout` option or an `AbortSignal.timeout`. Missing timeout is `High` — it turns a slow dependency into an outage (AWS Well-Architected Framework, Reliability Pillar, REL05-BP05 "Set client timeouts," official vendor documentation, current, https://docs.aws.amazon.com/wellarchitected/latest/framework/rel_mitigate_interaction_failure_client_timeouts.html). Rule out a framework-level default timeout that applies even without an explicit one, and name it.
19
+ - [ ] Retries exist where the failure is transient, are bounded, and back off: `search_code` for a retry wrapper or library around each external call found above; read its config for a max-attempts and a backoff strategy — specifically jittered exponential backoff. Full Jitter (`random(0, min(cap, base*2^attempt))`) is one of the AWS-documented jittered-backoff strategies, and — like Equal Jitter — cuts total call volume against a recovering backend substantially relative to a fixed interval or un-jittered exponential backoff; against Equal Jitter specifically it does slightly less total work at the cost of slightly more completion time (Marc Brooker, AWS Architecture Blog, 2015/2023, https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/). The source recommends jittered backoff generally over no jitter, not Full Jitter specifically over every other jitter variant — treat the exact algorithm choice as a legitimate implementation detail, not the finding. Retrying without exponential backoff, jitter, and a maximum retry value is itself a named AWS anti-pattern, risk level High (AWS Well-Architected Framework, Reliability Pillar, official vendor documentation, current, https://docs.aws.amazon.com/wellarchitected/latest/framework/rel_mitigate_interaction_failure_limit_retries.html).
20
+ - [ ] Non-transient failures are not retried: `Read` the retry predicate (`shouldRetry`/`retryIf`) at each site found above — retrying unconditionally on any thrown error, including a 4xx, wastes time and hides the bug. AWS names retrying errors whose cause "predictably will not resolve without manual intervention" as an anti-pattern (AWS Well-Architected Framework, Reliability Pillar, official vendor documentation, current, https://docs.aws.amazon.com/wellarchitected/latest/framework/rel_mitigate_interaction_failure_limit_retries.html); Stripe's own guidance draws the same line by error class — content (4xx) errors should have the request corrected and retried by the caller, not blindly retried, while server (5xx) results are "treated as indeterminate" (Stripe, official API documentation, "Advanced error handling," current, https://docs.stripe.com/error-low-level).
21
+ - [ ] Retries are capped by a budget shared across the process, not just a per-call max-attempts count: `search_code` for a retry-budget/limiter (a rolling ratio of retries to total requests, an explicit cap such as "no more than N retries per minute"). Per-call bounding still lets every concurrent caller retry independently, and across a chain of N layers each retrying k times, that multiplies to as many as k^N attempts at the bottom during an incident — the retry-storm mechanism: "a single user action may create 64 attempts (4^3) on the database" from three layers each retrying three times, and the book's recommended fix is a process-wide budget, e.g. "only allow 60 retries per minute in a process" (Mike Ulrich, *Site Reliability Engineering*, Google, ch. 22 "Addressing Cascading Failures," https://sre.google/sre-book/addressing-cascading-failures/).
22
+ - [ ] Retries are not stacked across layers calling the same failure: `find_callees` on a function identified above as retrying — if the callee it wraps also independently retries around the same external call, the two multiply into as many as (attempts at the outer layer × attempts at the inner layer) requests against the dependency per user action, the same shape the SRE book's worked example proves structurally rather than merely infers (Mike Ulrich, *Site Reliability Engineering*, Google, ch. 22 "Addressing Cascading Failures," https://sre.google/sre-book/addressing-cascading-failures/). Refuted if the caller's retry count was deliberately set to 1 specifically because the callee already retries (e.g. an SDK's own built-in retry is the only retry layer, and the surrounding code intentionally does not add another) — confirm by reading both retry configs together before flagging.
23
+ - [ ] Repeated failures against the same dependency trip a circuit breaker rather than retrying every request into it indefinitely: `search_code` for a circuit-breaker library (resilience4j, Polly's `CircuitBreakerStrategy`, an in-house failure-counter-with-open-state) wrapping the client found above (a Closed/Open/Half-Open state machine — Microsoft, Azure Architecture Center, official vendor documentation, last updated 2026-07-02, https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker; the pattern is catalogued among Michael T. Nygard's canonical stability patterns, Michael T. Nygard, *Release It!*, 2nd ed., Pragmatic Bookshelf, 2018, https://pragprog.com/titles/mnee2/release-it-second-edition/). The pattern is still current guidance — Microsoft's Azure Architecture Center revised its circuit-breaker page as recently as 2026-07-02 — even though Netflix's own Hystrix has been in maintenance mode since 2018 and its README now points to resilience4j (Netflix, official GitHub repository README, Netflix/Hystrix, current, https://github.com/Netflix/Hystrix); look for the pattern by behaviour, not for a specific library name.
24
+ - [ ] Where a circuit breaker exists (found above), its half-open/recovery transition limits trial traffic rather than immediately reopening to full volume: `Read` the breaker's state-transition logic for a trial-request cap or gradual ramp when leaving the open state. A breaker that flips straight from open to fully-closed on one successful probe recreates the flood it exists to prevent — the Half-Open state exists specifically to allow "a limited number of requests... to pass through," which "helps prevent a recovering service from suddenly being flooded with requests" (Microsoft, Azure Architecture Center, official vendor documentation, last updated 2026-07-02, https://learn.microsoft.com/en-us/azure/architecture/patterns/circuit-breaker). Refuted if the protected dependency's real capacity comfortably exceeds the expected concurrent-caller count even at full reopen, so an unbounded transition cannot reproduce the original overload — state the capacity comparison before ruling this out.
22
25
 
23
26
  ## Partial failure
24
27
 
25
- - [ ] Multi-step operations state what happens when step 3 of 5 fails: `find_symbol` the multi-step function and read it for a transaction wrapper (`BEGIN`/`db.transaction(`) or explicit compensating-action calls after each step. Transaction, compensating action, or documented tolerance — pick one explicitly.
26
- - [ ] Nothing is left half-written: in the same function, check whether later steps commit independently with no rollback path if an earlier one already succeeded — that is how partial config, orphaned rows, and half-copied directories happen.
27
- - [ ] Operations that touch two systems (a database write paired with a message-broker publish, or a payment-provider call) are not done as two independent calls in the same handler — that shape fails two ways: the DB commits and the publish fails (the event is silently lost, with nothing recording that it should have happened), or the publish succeeds and the DB rolls back (a phantom event fires for a state change that never happened). `search_code` for an `outbox` table written in the same transaction as the business write, with a separate relay or CDC process doing the actual publish — that is the standard fix (the transactional outbox pattern; microservices.io/patterns/data/transactional-outbox.html). Its absence on a DB-write-then-publish handler is the finding regardless of whether a reconciliation job exists elsewhere — reconciliation is a mitigation for drift, not a substitute for atomicity. Cross-reference `Backend`.
28
- - [ ] Batch operations report which items succeeded and which failed: `find_symbol` the batch handler's return shape — a single boolean or `void` return, rather than a per-item results array, is the finding.
28
+ - [ ] Multi-step operations state what happens when step 3 of 5 fails: `find_symbol` the multi-step function and read it for a transaction wrapper (`BEGIN`/`db.transaction(`) or explicit compensating-action calls after each step. Transaction, compensating action, or documented tolerance — pick one explicitly. AWS's own guidance for multi-step consistency: "the saga pattern can be used to roll back previous operations in case a later operation of the same transaction fails" (AWS Well-Architected Framework, Reliability Pillar, official vendor documentation, current, https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_mitigate_interaction_failure_graceful_degradation.html).
29
+ - [ ] Nothing is left half-written: `Read` the same function for later steps that commit independently with no rollback path if an earlier one already succeeded — that is how partial config, orphaned rows, and half-copied directories happen. AWS names "creating an inconsistent state when a transaction partially fails" as a named anti-pattern (AWS Well-Architected Framework, Reliability Pillar, official vendor documentation, current, https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_mitigate_interaction_failure_graceful_degradation.html).
30
+ - [ ] Operations that touch two systems (a database write paired with a message-broker publish, or a payment-provider call) are not done as two independent calls in the same handler — that shape fails two ways: the DB commits and the publish fails (the event is silently lost, with nothing recording that it should have happened), or the publish succeeds and the DB rolls back (a phantom event fires for a state change that never happened). `search_code` for an `outbox` table written in the same transaction as the business write, with a separate relay or CDC process doing the actual publish — that is the standard fix (the transactional outbox pattern: "the service that sends the message [inserts it] in the database as part of the transaction that updates the business entities," then "a separate process... sends the messages to the message broker," guaranteeing "messages are guaranteed to be sent if and only if the database transaction commits" — Chris Richardson, microservices.io, "Pattern: Transactional outbox," current, https://microservices.io/patterns/data/transactional-outbox.html). Its absence on a DB-write-then-publish handler is the finding regardless of whether a reconciliation job exists elsewhere — reconciliation is a mitigation for drift, not a substitute for atomicity. Cross-reference `Backend`.
31
+ - [ ] Batch operations report which items succeeded and which failed: `find_symbol` the batch handler's return shape — a single boolean or `void` return, rather than a per-item results array, is the finding. AWS's own recommendation for batch partial failure: "returning information on which operations succeeded, which failed, and why they failed... or putting failed requests into a dead letter queue" (AWS Well-Architected Framework, Reliability Pillar, official vendor documentation, current, https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_mitigate_interaction_failure_graceful_degradation.html).
29
32
 
30
33
  ## Degradation
31
34
 
32
35
  - [ ] Optional dependencies failing does not fail the whole operation: `search_code` for an analytics/telemetry/non-critical SDK call inside a critical request handler and confirm it has its own try/catch, separate from the main operation's error path. An analytics outage must not take down a request.
33
36
  - [ ] There is a defined degraded mode where one exists: `search_code` for a fallback branch on an optional dependency's failure — cached data, a default value, reduced functionality.
34
- - [ ] Degradation is visible: read the fallback branch found above for a log line, metric, or response header signalling degraded mode. Silently serving stale data with no signal is how small outages become long ones.
37
+ - [ ] Degradation is visible: `Read` the fallback branch found above for a log line, metric, or response header signalling degraded mode. Silently serving stale data with no signal is how small outages become long ones.
38
+ - [ ] The degraded-mode branch identified above is exercised by a test that forces the dependency's failure, not just present in the source: `find_callers` on the fallback function for a test-file caller. An untested fallback path is itself a latent failure mode — it will fail the first time it actually runs, which is during an incident. AWS names "not testing that components are functional even during dependency failures" as an anti-pattern, and states that "the pathways taken in case of component failure need to be tested," while also cautioning that fallback logic in general should be minimized because it is rarely exercised (AWS Well-Architected Framework, Reliability Pillar, official vendor documentation, current, https://docs.aws.amazon.com/wellarchitected/latest/reliability-pillar/rel_mitigate_interaction_failure_graceful_degradation.html). Refuted if the fallback is trivial enough (a static constant, no branching) that the primary code path's own type/contract tests already cover its shape — state why before dropping the finding.
35
39
 
36
40
  ## User-facing failure
37
41
 
38
42
  - [ ] Every error the user can hit produces something actionable: `search_code` the error-response construction (a global error handler, an API error formatter) and read its output for specific guidance versus a generic "something went wrong".
39
- - [ ] No stack trace, internal path, SQL, or provider error reaches the user: read the error handler found above for direct serialisation of `err.stack`/`err.message` into the response body, and check whether it is gated by an environment check. That is also an information-disclosure finding — cross-reference `Security`.
40
- - [ ] Failures the user caused are distinguishable from failures the system caused: read the error-class hierarchy or the status-code mapping in the handler above for a distinction (e.g. a validation error mapped to 4xx versus an internal error mapped to 5xx).
43
+ - [ ] No stack trace, internal path, SQL, or provider error reaches the user: `Read` the error handler found above for direct serialisation of `err.stack`/`err.message` into the response body, and check whether it is gated by an environment check. That is also an information-disclosure finding — cross-reference `Security`. CWE-209 documents this exact weakness class with real instances: file-path disclosure enabling path-traversal reconnaissance, SQL queries leaked in error messages exposing table/column structure, and unhandled exceptions leaking stack traces that reveal internal architecture (MITRE, CWE-209, official CWE database, current, https://cwe.mitre.org/data/definitions/209.html).
44
+ - [ ] Failures the user caused are distinguishable from failures the system caused: `Read` the error-class hierarchy or the status-code mapping in the handler above for a distinction (e.g. a validation error mapped to 4xx versus an internal error mapped to 5xx). Stripe's own error model draws exactly this line — content (4xx) errors are the caller's to correct, server (5xx) errors are "treated as indeterminate," and a `Stripe-Should-Retry` header is the machine-readable signal for which is which (Stripe, official API documentation, "Advanced error handling," current, https://docs.stripe.com/error-low-level).
41
45
 
42
46
  ## Recovery
43
47
 
44
- - [ ] Restart-safety: the process can be killed at any point and restarted without corruption. Reuse the multi-step write path read under Partial failure — a write path with no atomic commit is not restart-safe, whether or not the process actually restarts mid-write.
48
+ - [ ] Restart-safety: the process can be killed at any point and restarted without corruption. `Read` the multi-step write path examined under Partial failure — a write path with no atomic commit is not restart-safe, whether or not the process actually restarts mid-write. "Let It Crash" and "Fail Fast" are catalogued among the canonical stability patterns this check draws on (Michael T. Nygard, *Release It!*, 2nd ed., Pragmatic Bookshelf, 2018, https://pragprog.com/titles/mnee2/release-it-second-edition/).
45
49
  - [ ] Interrupted operations are resumable, or safely re-runnable from the start: `search_code` for a checkpoint mechanism — a stored progress cursor, a job status column — on any long-running operation. Cross-reference the idempotency check in `functional.md`.
46
50
  - [ ] Anything that can be left in a bad state has a way out: `search_code` docs and the codebase for a repair command, an admin endpoint, or a documented manual procedure ("repair", "runbook", "manual fix"). Its absence means the only way out is direct data surgery.
47
51
 
@@ -52,19 +56,37 @@ The test suite proves the happy path. This module walks the other paths — and
52
56
  - Whether an "actionable" error message actually reads as clear to a real user.
53
57
  - Whether a reconciliation job for a two-system write actually catches drift, versus merely existing in the codebase.
54
58
  - Behaviour of a documented manual repair procedure when someone runs it under pressure.
59
+ - Whether a proven retry-storm shape (stacked-layer retries) actually cascades in production — this module proves the shape exists, not that it fires.
60
+ - Whether a backoff/jitter configuration's constants are well-tuned for the real dependency they protect — this module confirms the mechanism exists, not that its parameters are correct.
61
+ - Whether a circuit breaker's thresholds are calibrated to the dependency it protects, versus copy-pasted defaults — this module confirms the pattern exists, not that its numbers are right.
62
+
63
+ ## What browser observation closes
64
+
65
+ Applies only when `browser.md` ran; findings here are `observed` and cite the bundle path with a line or step number. `browser.md` cannot simulate a 5xx — this closes only what happens when a real one occurs on a walked flow.
66
+
67
+ | Artefact | Gap it closes | Observed instance earns |
68
+ |---|---|---|
69
+ | `network.jsonl` + `steps.md` | Error state rendered when a request on a walked flow actually returned 5xx | High |
70
+ | `console.jsonl` (uncaught exception / unhandledrejection entries), cross-referenced against `steps.md` and `screenshots/` for the same step | An uncaught exception / unhandled promise rejection fires during a walked flow with no corresponding user-visible error state in that step's screenshot — a swallowed error, caught live. Refuted if the exception originates from a non-essential third-party script (analytics, ad tag) unrelated to the flow's own logic — confirm by the stack's source file/line before flagging. | High |
71
+ | `network.jsonl` (a request with no completion timestamp inside the step's window), cross-referenced against `steps.md` elapsed time | A request on a walked flow never completes within a generous ceiling before the step times out or the flow gives up — observed absence of a client-side timeout, capped below the `observed` tier's Critical ceiling because a single lab run's absence of a fast timeout is not proof of production behavior — the module's own "single run is lab data" caveat applies. Refuted if the request is a legitimate long-poll/SSE/WebSocket connection meant to stay open — confirm by the request's declared type/headers before flagging. | Medium |
55
72
 
56
73
  ## Severity guidance
57
74
 
58
75
  | Situation | Severity |
59
76
  |---|---|
60
- | Swallowed error leading to silent data loss | Critical |
77
+ | Swallowed error leading to silent data loss, traced from the catch to the lost write via `find_callees`/`trace_path` (traced) | Critical |
61
78
  | Missing timeout on an external call | High |
62
79
  | Multi-step write with no rollback or reconciliation | High |
63
80
  | Retrying a non-idempotent operation | High |
81
+ | Retries stacked across two layers wrapping the same call, traced via `find_callees` | High |
64
82
  | Internal error detail leaked to the user | Medium |
65
83
  | Optional dependency failure taking down the request | Medium |
66
84
  | Error type distinguished by message string | Medium |
67
85
  | Silent degradation with no signal | Medium |
68
86
  | No circuit breaker on a call into a repeatedly-failing dependency | Medium |
87
+ | Circuit breaker reopens to full volume with no trial-traffic ramp | Medium |
69
88
  | No retry budget — per-call bounded retries still amplify multiplicatively across a call chain | Medium |
89
+ | Retry loop with no attempt cap or no backoff/jitter | High |
90
+ | Error-handling branch untested by a forced-failure test | Medium |
91
+ | Degraded-mode/fallback branch untested by a forced-failure test | Medium |
70
92
  | Batch reporting only an aggregate result | Low |