circle-ir-ai 4.37.0 → 4.40.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 (246) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/dist/agents/mastra/workflow.d.ts +16 -0
  3. package/dist/agents/mastra/workflow.d.ts.map +1 -1
  4. package/dist/agents/mastra/workflow.js +118 -22
  5. package/dist/agents/mastra/workflow.js.map +1 -1
  6. package/dist/blast-radius/import-map.d.ts +121 -0
  7. package/dist/blast-radius/import-map.d.ts.map +1 -0
  8. package/dist/blast-radius/import-map.js +735 -0
  9. package/dist/blast-radius/import-map.js.map +1 -0
  10. package/dist/blast-radius/index.d.ts +36 -4
  11. package/dist/blast-radius/index.d.ts.map +1 -1
  12. package/dist/blast-radius/index.js +397 -45
  13. package/dist/blast-radius/index.js.map +1 -1
  14. package/dist/blast-radius/radius.d.ts +304 -6
  15. package/dist/blast-radius/radius.d.ts.map +1 -1
  16. package/dist/blast-radius/radius.js +1547 -6
  17. package/dist/blast-radius/radius.js.map +1 -1
  18. package/dist/blast-radius/types.d.ts +79 -2
  19. package/dist/blast-radius/types.d.ts.map +1 -1
  20. package/dist/blast-radius/types.js +2 -2
  21. package/dist/cache/tree-cache.d.ts +10 -0
  22. package/dist/cache/tree-cache.d.ts.map +1 -1
  23. package/dist/cache/tree-cache.js +3 -1
  24. package/dist/cache/tree-cache.js.map +1 -1
  25. package/dist/cache/verify-cache.d.ts +7 -0
  26. package/dist/cache/verify-cache.d.ts.map +1 -1
  27. package/dist/cache/verify-cache.js +19 -2
  28. package/dist/cache/verify-cache.js.map +1 -1
  29. package/dist/dead-code/detector.d.ts +29 -2
  30. package/dist/dead-code/detector.d.ts.map +1 -1
  31. package/dist/dead-code/detector.js +6 -2
  32. package/dist/dead-code/detector.js.map +1 -1
  33. package/dist/dead-code/engine.d.ts +35 -1
  34. package/dist/dead-code/engine.d.ts.map +1 -1
  35. package/dist/dead-code/engine.js +247 -3
  36. package/dist/dead-code/engine.js.map +1 -1
  37. package/dist/dead-code/illata-client.d.ts +160 -0
  38. package/dist/dead-code/illata-client.d.ts.map +1 -0
  39. package/dist/dead-code/illata-client.js +291 -0
  40. package/dist/dead-code/illata-client.js.map +1 -0
  41. package/dist/dead-code/index.d.ts +1 -0
  42. package/dist/dead-code/index.d.ts.map +1 -1
  43. package/dist/dead-code/index.js +1 -0
  44. package/dist/dead-code/index.js.map +1 -1
  45. package/dist/dead-code/rules/dead-code-java.dl +132 -0
  46. package/dist/health-score/calculator.d.ts.map +1 -1
  47. package/dist/health-score/calculator.js +13 -5
  48. package/dist/health-score/calculator.js.map +1 -1
  49. package/dist/index.d.ts +3 -3
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +3 -3
  52. package/dist/index.js.map +1 -1
  53. package/dist/llm/config.d.ts +21 -0
  54. package/dist/llm/config.d.ts.map +1 -1
  55. package/dist/llm/config.js +36 -0
  56. package/dist/llm/config.js.map +1 -1
  57. package/dist/llm/cwe-rubrics.d.ts +17 -0
  58. package/dist/llm/cwe-rubrics.d.ts.map +1 -0
  59. package/dist/llm/cwe-rubrics.js +51 -0
  60. package/dist/llm/cwe-rubrics.js.map +1 -0
  61. package/dist/llm/model-route-dispatcher.d.ts +17 -0
  62. package/dist/llm/model-route-dispatcher.d.ts.map +1 -1
  63. package/dist/llm/model-route-dispatcher.js +53 -3
  64. package/dist/llm/model-route-dispatcher.js.map +1 -1
  65. package/dist/llm/model-route.d.ts.map +1 -1
  66. package/dist/llm/model-route.js +4 -1
  67. package/dist/llm/model-route.js.map +1 -1
  68. package/dist/llm/verification.d.ts +1 -0
  69. package/dist/llm/verification.d.ts.map +1 -1
  70. package/dist/llm/verification.js +14 -6
  71. package/dist/llm/verification.js.map +1 -1
  72. package/dist/mcp/tools/blast-radius.d.ts +6 -4
  73. package/dist/mcp/tools/blast-radius.d.ts.map +1 -1
  74. package/dist/mcp/tools/blast-radius.js +53 -12
  75. package/dist/mcp/tools/blast-radius.js.map +1 -1
  76. package/dist/quality/calculator.d.ts.map +1 -1
  77. package/dist/quality/calculator.js +11 -2
  78. package/dist/quality/calculator.js.map +1 -1
  79. package/dist/scope/product-paths.d.ts +117 -12
  80. package/dist/scope/product-paths.d.ts.map +1 -1
  81. package/dist/scope/product-paths.js +422 -38
  82. package/dist/scope/product-paths.js.map +1 -1
  83. package/dist/secret-scan/scanner.d.ts +5 -0
  84. package/dist/secret-scan/scanner.d.ts.map +1 -1
  85. package/dist/secret-scan/scanner.js +74 -3
  86. package/dist/secret-scan/scanner.js.map +1 -1
  87. package/dist/security-scan/finding-labels.d.ts +3 -0
  88. package/dist/security-scan/finding-labels.d.ts.map +1 -0
  89. package/dist/security-scan/finding-labels.js +18 -0
  90. package/dist/security-scan/finding-labels.js.map +1 -0
  91. package/dist/security-scan/scanner.d.ts +32 -4
  92. package/dist/security-scan/scanner.d.ts.map +1 -1
  93. package/dist/security-scan/scanner.js +81 -13
  94. package/dist/security-scan/scanner.js.map +1 -1
  95. package/dist/selectors/exclude.d.ts +5 -1
  96. package/dist/selectors/exclude.d.ts.map +1 -1
  97. package/dist/selectors/exclude.js +15 -2
  98. package/dist/selectors/exclude.js.map +1 -1
  99. package/dist/skills/bundle-loader.d.ts.map +1 -1
  100. package/dist/skills/bundle-loader.js +6 -3
  101. package/dist/skills/bundle-loader.js.map +1 -1
  102. package/dist/spec-gap/analyzer.d.ts +8 -0
  103. package/dist/spec-gap/analyzer.d.ts.map +1 -1
  104. package/dist/spec-gap/analyzer.js +6 -3
  105. package/dist/spec-gap/analyzer.js.map +1 -1
  106. package/dist/specifica/binary-entries.d.ts +96 -0
  107. package/dist/specifica/binary-entries.d.ts.map +1 -0
  108. package/dist/specifica/binary-entries.js +318 -0
  109. package/dist/specifica/binary-entries.js.map +1 -0
  110. package/dist/specifica/environment/index.d.ts.map +1 -1
  111. package/dist/specifica/environment/index.js +5 -3
  112. package/dist/specifica/environment/index.js.map +1 -1
  113. package/dist/specifica/environment/read-code.d.ts +9 -2
  114. package/dist/specifica/environment/read-code.d.ts.map +1 -1
  115. package/dist/specifica/environment/read-code.js +12 -5
  116. package/dist/specifica/environment/read-code.js.map +1 -1
  117. package/dist/specifica/evidence-extractor.d.ts.map +1 -1
  118. package/dist/specifica/evidence-extractor.js +12 -1
  119. package/dist/specifica/evidence-extractor.js.map +1 -1
  120. package/dist/specifica/file-routes.d.ts.map +1 -1
  121. package/dist/specifica/file-routes.js +2 -1
  122. package/dist/specifica/file-routes.js.map +1 -1
  123. package/dist/specifica/generator.js +1 -0
  124. package/dist/specifica/generator.js.map +1 -1
  125. package/dist/specifica/learned-diff.d.ts.map +1 -1
  126. package/dist/specifica/learned-diff.js +3 -2
  127. package/dist/specifica/learned-diff.js.map +1 -1
  128. package/dist/specifica/level-design.d.ts +7 -0
  129. package/dist/specifica/level-design.d.ts.map +1 -1
  130. package/dist/specifica/level-design.js +10 -7
  131. package/dist/specifica/level-design.js.map +1 -1
  132. package/dist/specifica/library-surface-python-rust.d.ts +56 -0
  133. package/dist/specifica/library-surface-python-rust.d.ts.map +1 -0
  134. package/dist/specifica/library-surface-python-rust.js +466 -0
  135. package/dist/specifica/library-surface-python-rust.js.map +1 -0
  136. package/dist/specifica/library-surface.d.ts +13 -1
  137. package/dist/specifica/library-surface.d.ts.map +1 -1
  138. package/dist/specifica/library-surface.js +41 -1
  139. package/dist/specifica/library-surface.js.map +1 -1
  140. package/dist/specifica/modules.d.ts +28 -1
  141. package/dist/specifica/modules.d.ts.map +1 -1
  142. package/dist/specifica/modules.js +141 -10
  143. package/dist/specifica/modules.js.map +1 -1
  144. package/dist/specifica/spec-tree.d.ts +34 -1
  145. package/dist/specifica/spec-tree.d.ts.map +1 -1
  146. package/dist/specifica/spec-tree.js +242 -54
  147. package/dist/specifica/spec-tree.js.map +1 -1
  148. package/dist/specifica/toml-lines.d.ts +33 -0
  149. package/dist/specifica/toml-lines.d.ts.map +1 -0
  150. package/dist/specifica/toml-lines.js +77 -0
  151. package/dist/specifica/toml-lines.js.map +1 -0
  152. package/dist/specifica/tree-types.d.ts +2 -2
  153. package/dist/specifica/tree-types.d.ts.map +1 -1
  154. package/dist/specifica/tree-writer.d.ts +1 -0
  155. package/dist/specifica/tree-writer.d.ts.map +1 -1
  156. package/dist/specifica/tree-writer.js +4 -1
  157. package/dist/specifica/tree-writer.js.map +1 -1
  158. package/dist/specifica/ts-rule-sources.d.ts +10 -1
  159. package/dist/specifica/ts-rule-sources.d.ts.map +1 -1
  160. package/dist/specifica/ts-rule-sources.js +98 -1
  161. package/dist/specifica/ts-rule-sources.js.map +1 -1
  162. package/dist/specifica/types.d.ts +13 -0
  163. package/dist/specifica/types.d.ts.map +1 -1
  164. package/dist/specifica/use-cases.d.ts +78 -3
  165. package/dist/specifica/use-cases.d.ts.map +1 -1
  166. package/dist/specifica/use-cases.js +236 -12
  167. package/dist/specifica/use-cases.js.map +1 -1
  168. package/dist/trust/compare.d.ts.map +1 -1
  169. package/dist/trust/compare.js +11 -1
  170. package/dist/trust/compare.js.map +1 -1
  171. package/dist/trust/passes/ai-config-detect.d.ts +4 -0
  172. package/dist/trust/passes/ai-config-detect.d.ts.map +1 -1
  173. package/dist/trust/passes/ai-config-detect.js +23 -2
  174. package/dist/trust/passes/ai-config-detect.js.map +1 -1
  175. package/dist/trust/passes/ai-generated-fingerprint.d.ts.map +1 -1
  176. package/dist/trust/passes/ai-generated-fingerprint.js +2 -1
  177. package/dist/trust/passes/ai-generated-fingerprint.js.map +1 -1
  178. package/dist/trust/passes/code-complexity.d.ts.map +1 -1
  179. package/dist/trust/passes/code-complexity.js +2 -1
  180. package/dist/trust/passes/code-complexity.js.map +1 -1
  181. package/dist/trust/passes/conformance-attestation.d.ts.map +1 -1
  182. package/dist/trust/passes/conformance-attestation.js +2 -1
  183. package/dist/trust/passes/conformance-attestation.js.map +1 -1
  184. package/dist/trust/passes/cross-skill-interaction.d.ts.map +1 -1
  185. package/dist/trust/passes/cross-skill-interaction.js +3 -2
  186. package/dist/trust/passes/cross-skill-interaction.js.map +1 -1
  187. package/dist/trust/passes/data-exfiltration.d.ts.map +1 -1
  188. package/dist/trust/passes/data-exfiltration.js +2 -1
  189. package/dist/trust/passes/data-exfiltration.js.map +1 -1
  190. package/dist/trust/passes/dep-manifests.d.ts.map +1 -1
  191. package/dist/trust/passes/dep-manifests.js +2 -1
  192. package/dist/trust/passes/dep-manifests.js.map +1 -1
  193. package/dist/trust/passes/deprecated-usage.d.ts.map +1 -1
  194. package/dist/trust/passes/deprecated-usage.js +2 -1
  195. package/dist/trust/passes/deprecated-usage.js.map +1 -1
  196. package/dist/trust/passes/deprecation-no-replacement.d.ts.map +1 -1
  197. package/dist/trust/passes/deprecation-no-replacement.js +2 -1
  198. package/dist/trust/passes/deprecation-no-replacement.js.map +1 -1
  199. package/dist/trust/passes/doc-coverage.d.ts.map +1 -1
  200. package/dist/trust/passes/doc-coverage.js +2 -1
  201. package/dist/trust/passes/doc-coverage.js.map +1 -1
  202. package/dist/trust/passes/eu-ai-act-flags.d.ts.map +1 -1
  203. package/dist/trust/passes/eu-ai-act-flags.js +3 -2
  204. package/dist/trust/passes/eu-ai-act-flags.js.map +1 -1
  205. package/dist/trust/passes/excessive-permissions.d.ts.map +1 -1
  206. package/dist/trust/passes/excessive-permissions.js +2 -1
  207. package/dist/trust/passes/excessive-permissions.js.map +1 -1
  208. package/dist/trust/passes/inconsistent-error-handling.d.ts.map +1 -1
  209. package/dist/trust/passes/inconsistent-error-handling.js +2 -1
  210. package/dist/trust/passes/inconsistent-error-handling.js.map +1 -1
  211. package/dist/trust/passes/inconsistent-naming.d.ts.map +1 -1
  212. package/dist/trust/passes/inconsistent-naming.js +51 -12
  213. package/dist/trust/passes/inconsistent-naming.js.map +1 -1
  214. package/dist/trust/passes/inconsistent-param-order.d.ts.map +1 -1
  215. package/dist/trust/passes/inconsistent-param-order.js +2 -1
  216. package/dist/trust/passes/inconsistent-param-order.js.map +1 -1
  217. package/dist/trust/passes/missing-guard-dom.d.ts.map +1 -1
  218. package/dist/trust/passes/missing-guard-dom.js +2 -1
  219. package/dist/trust/passes/missing-guard-dom.js.map +1 -1
  220. package/dist/trust/passes/performance-passes.d.ts.map +1 -1
  221. package/dist/trust/passes/performance-passes.js +2 -1
  222. package/dist/trust/passes/performance-passes.js.map +1 -1
  223. package/dist/trust/passes/prompt-injection.d.ts.map +1 -1
  224. package/dist/trust/passes/prompt-injection.js +36 -4
  225. package/dist/trust/passes/prompt-injection.js.map +1 -1
  226. package/dist/trust/passes/throws-mismatch.d.ts.map +1 -1
  227. package/dist/trust/passes/throws-mismatch.js +2 -1
  228. package/dist/trust/passes/throws-mismatch.js.map +1 -1
  229. package/dist/trust/passes/tool-poisoning.d.ts.map +1 -1
  230. package/dist/trust/passes/tool-poisoning.js +3 -2
  231. package/dist/trust/passes/tool-poisoning.js.map +1 -1
  232. package/dist/trust/passes/unnecessary-object-hotspot.d.ts.map +1 -1
  233. package/dist/trust/passes/unnecessary-object-hotspot.js +2 -1
  234. package/dist/trust/passes/unnecessary-object-hotspot.js.map +1 -1
  235. package/dist/trust/scoring.d.ts.map +1 -1
  236. package/dist/trust/scoring.js +6 -2
  237. package/dist/trust/scoring.js.map +1 -1
  238. package/dist/utils/dirent-order.d.ts +21 -0
  239. package/dist/utils/dirent-order.d.ts.map +1 -0
  240. package/dist/utils/dirent-order.js +21 -0
  241. package/dist/utils/dirent-order.js.map +1 -0
  242. package/dist/utils/file-skip.d.ts +11 -0
  243. package/dist/utils/file-skip.d.ts.map +1 -1
  244. package/dist/utils/file-skip.js +29 -0
  245. package/dist/utils/file-skip.js.map +1 -1
  246. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -7,6 +7,132 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [4.40.0] - 2026-11-28
11
+
12
+ Minor, on circle-ir **4.24.0** (was 4.23.0, exact). 4.39.0 (release PR #1134, 2026-11-22) was never published; everything in it ships here, with what merged after it (#1121, #1141, #1142, #1143, #1144, #1146, #1150, #1156, #1163, #1179, #1186, #1198). From 4.39.0: the learned spec reads more entry points: a Python package's and a Rust library crate's public surface (#1128), binaries as a new use-case kind, `binary` (#1130), and Django and Django REST Framework routes (#1122), and Python and Rust levels give domain rules (#1129). The secret scan finds Azure connection strings and Twilio auth tokens in source files (#1126). The product-scope rule moves to `product-paths/4` (`product-paths/3`, #1124; test shell scripts are tests, #1133), so default scan, quality, trust and spec results can move. Static scan findings' `source.file`, `sink.file` and `alternateSources[].file` are now the absolute path instead of the basename, which stays in a new `fileName` (#1133); tooling that matched those fields on the basename should read `fileName`. No root export or output field is removed or renamed. Since 4.39.0: the batch verifier can refute (`COGNIUM_AI_VERIFY_MODE=explicit-all`) and a flow-backed finding is never removed by it (#1143); a verification that never answered never marks a finding exploitable (#1142); AI mode keeps `flow_backed` (#1141); a per-CWE rubric for CWE-78 behind `COGNIUM_AI_VERIFY_CWE_RUBRICS=1` (#1163); Java dead code through Illata behind `CIRCLE_IR_AI_DEAD_CODE_ENGINE=illata`, off by default (#1144); the learned spec reads Maven plugin goals and skips a library's readable copy beside its minified build (#1156, #1179); trust reads MCP and agent configs under `.cursor/`, `.vscode/` and `.claude/` (#1121); Django routes get their `include()` prefixes once on circle-ir 4.24.0 (#1198). Answers also move with circle-ir 4.24.0 (see Changed). No root export or output field is removed or renamed.
13
+
14
+ ### Changed
15
+ - **`circle-ir` 4.23.0 → 4.24.0 (exact).** `@cognium/mcp-server` 0.9.3 pins the same version, and its optional peer is `circle-ir-ai` `>=4.40.0`: the server refuses a module built on another `circle-ir` minor, so circle-ir-ai 4.39.0 and earlier drop out of `/api/mcp` beside it. What reaches circle-ir-ai's answers (circle-ir CHANGELOG [4.24.0]): `Class.forName(tainted)` is reported once, as `code_injection` (CWE-94), no longer also as `deserialization` (CWE-502) (cognium-dev#1384; the yamlbeans golden true positive is now CWE-94, #1198); dead code lifts a module or class to `may-be-live` when a member is not dead, and a module-level field follows its module (cognium-dev#1366, #1418); `buildPythonGraph()` routes compose Django `include()` prefixes and take DRF verbs (cognium-dev#1352); JS/TS navigation follows `.call` / `.apply` / `.bind` (cognium-dev#1337), so blast radius resolves a method run that way; a Maven `${property}` version declared in the same pom resolves (selectors and inventory show the version); Java enum members are in `types` by default, method references are call sites (`reference_form`), and calls in field initializers carry `in_method` `<clinit>` / `<init>`; `generateFindings` ids are a stable digest of `Finding.key`, no longer `vuln<N>`; `analyze()` on a C or C++ file returns an IR marked `unsupported` instead of throwing; `orphan-module` judges JS/TS files only.
16
+
17
+ ### Added
18
+ - **The learned spec reads a Python package's and a Rust library crate's public surface.** The library public-surface rule (#1063) read TS/JS only, so a Python library or a Rust lib crate got "0 use case(s) … No entry points found". Python: the entry is `<pkg>/__init__.py` (or `src/<pkg>/__init__.py`), the package `pyproject.toml` `[project] name` names, else every top-level package; public names are `__all__` when it lists string literals, else the `from .x import y as y` re-exports and the entry's own public classes and module functions (circle-ir's package visibility, no leading `_`), each followed to the module that declares it. Rust: the entry is `lib.rs` (`[lib] path`, else `src/lib.rs`); the surface is its `pub fn` / `pub struct` / `pub enum` / `pub trait` (visibility from circle-ir's annotations and modifiers; `pub(crate)` left out) and `pub use` re-exports followed into `crate::`/`self::`/`super::` module files; circle-ir has no visibility on imports, so the import line it gives is read to tell `pub use` from `use` (and for the path of a glob). A crate with only `main.rs` stays empty. pallets/click 08b803c: 0 → 8 surface areas, 64 exports; dtolnay/semver 280ebcb: 0 → 2 areas, 7 exports; BurntSushi/memchr bd6068c: 0 → 1 area, 15 exports. Not read yet: items reached only through `pub mod` (not re-exported by `pub use`).
19
+ - **Python and Rust levels give domain rules.** The throw facts behind spec rules (`extractTsRuleFacts`) read Python `raise X("…")` and Rust `return Err(…)`, `bail!("…")` and `anyhow!("…")`; before, only a line holding `throw` counted, so only Java and TS levels had a domain rule. A raise inside a use case is a use-case rule, and one elsewhere is a static rule that the level classifies like any other. A bare throw with a generic message ("invalid", "bad request", "something went wrong") and an internal error (`NotImplementedError`, `AssertionError`) give no Python or Rust rule. TS and Java rules are unchanged: `Error("invalid argument")` (TS) and `IllegalArgumentException("Invalid input")` (Java) keep their rules (cognium-ai#1129 review). circle-ir has no CFG for Python or Rust, so these rules are "may throw", without a condition.
20
+ - **The learned spec reads binaries as entry points: a new use-case kind, `binary`.** A Rust binary with no route and no CLI framework got an empty spec level ("No entry points found"; nine such binaries in axon-overlay). The tree now reads Rust `fn main` in `src/main.rs` (named by `Cargo.toml` `[package] name`), `src/bin/<name>.rs`, `src/bin/<name>/main.rs` and every `[[bin]]` (its `name` and `path`). When `main`, or a same-file function it calls, matches the command-line arguments on string literals (`match args[1].as_str() { "keygen" => …, "job" | "jobs" => … }`, also `Some("keygen")`), each literal arm is one use case (`run overlay keygen`, area = the binary's name), handled by the function the arm calls; flag arms (`"-h"`, `"--help"`) and the catch-all are skipped, and aliases are one use case. Otherwise the binary is one use case on `main`, area `Binaries`. Python `[project.scripts]` (and Poetry's `[tool.poetry.scripts]`) entries are one use case each, on the function the entry names (`pkg/mod.py`, `pkg/mod/__init__.py`, also under `src/`; a Typer or Click object on the line that binds it). New module `src/specifica/binary-entries.ts`; `extractUseCases` takes `binaries` and `scripts`, which the spec tree reads from the `Cargo.toml` / `pyproject.toml` nearest each level file. `EntryKind` gains `'binary'` and `UseCaseResult.counts` a `binary` count; rules.json `useCases[].kind` can now be `binary` (circle-pack's OpenAPI enum in `docs.ts` still lists the six earlier kinds). Hand-rolled HTTP routing inside a binary is not read. A tree with no Rust binary and no `[project.scripts]` is unchanged. A `src/main.rs` is a binary only when a `Cargo.toml` declares it (`[package] name`, or a `[[bin]]`); `src/bin/*` is one by layout alone, so a lone `main.rs` with no manifest stays empty. A binary or script beside a library does not hide it: a crate with `lib.rs` and a binary, or a Python package that declares a script, gets both its binary use cases and the public surface table in spec.md. Manifests are read line by line (new `src/specifica/toml-lines.ts`, also behind `tomlString` and `manifestDependencies`): the multi-line section regexes took 7.9 s on an 80 KB Cargo.toml; a 1 MB one now parses in well under a second. The spec tree reads its manifests (`package.json`, `Cargo.toml`, `pyproject.toml`, `wrangler.*`, `go.mod`) through one reader that refuses a symlink, a path whose real path leaves the repository root, and a file over 256 KiB (`MANIFEST_MAX_BYTES`); each is listed in the new `BuiltTree.skippedManifests` (`too-large` / `symlink` / `outside-root`).
21
+ - **Per-CWE rubric in the batch verify prompt, CWE-78 first, behind `COGNIUM_AI_VERIFY_CWE_RUBRICS=1` (cognium-ai#899).** With the option on, a batch whose sinks include CWE-78 (also spelled `CWE-078`) gets a short rubric after the SINKS list: what makes an OS command injection exploitable (a shell parses the command, or the attacker picks the program) and what makes it safe (a constant program with the value as its own argument and no shell, an allowlist or a strict pattern, not a blocklist). It sits in the request data, so the fixed prompt prefix and provider prefix caching (#244) are unchanged; the verify-cache key gains a `cwe-rubrics/<hash>` part only for those batches. Default off: with the option unset, or for a batch with no rubric CWE, the prompt and cache key are byte-identical to before. New module `src/llm/cwe-rubrics.ts` (`renderCweRubrics`, also exported from `llm/verification`). CWE-502 and CWE-94 rubrics and the taint chain (C.4) are not in this slice; the default flips only on the labelled verify-set measurement on #242.
22
+ - **The batch verifier can refute: `COGNIUM_AI_VERIFY_MODE=explicit-all` (#1143).** By default (`omit-non-tp`) a cost-efficient verifier model lists only TRUE_POSITIVE pairs, so every verdict it returns reads as an approval. With the switch on, every verifier model answers one verdict per submitted pair (TRUE_POSITIVE / FALSE_POSITIVE / UNCERTAIN), the contract thinking models already use, and a missing pair means "not assessed". Unset or `omit-non-tp` keeps the default; any other value is ignored with one warning. The verify-cache and in-process dedup keys carry the mode only when the switch is on, so default keys are unchanged. **Proof beats model:** on the verified branch, a static finding circle-ir backs with a taint flow (`flow_backed: true`) is never removed by the verifier; with no verified finding at its sink it is kept, labelled with what the verifier said (`FALSE_POSITIVE` with `refuted_by: 'verifier'` or `'omission'`, `UNCERTAIN`, or `UNVERIFIED`) and `kept_by: 'flow_backed'`. Findings without that proof can still be refuted away. New counters: `stats.findingsKeptByProof`; scan `meta.verification.findingsKeptByProof` and `promptMode: 'explicit-all'` (each only when set).
23
+ - **Java dead code through Illata, behind a flag (off by default).** `engine: 'illata'` (or `CIRCLE_IR_AI_DEAD_CODE_ENGINE=illata`) sends a Java project's dead-code question to the `illata-query` sidecar: the graph's facts (`facts@2`, Arrow) and the rule text `dead-code/rules/dead-code-java.dl` (shipped in `dist/` by `npm run build`) go to a temporary directory, and its rows map onto the same `DeadCodeResult`. The binary comes from the `illataQueryBin` option, `ILLATA_QUERY_BIN`, then `PATH`; any failure (missing binary, exit code, timeout, bad or short answer) logs one line and answers with circle-ir's `deadCode()`, with `engine.fallback` saying why. Additive types: `engine.name` `'illata'`, `engine.facts` / `program` / `queryMs` / `fallback`, `result.snapshot`, `result.store`, options `illataQueryBin` / `illataTimeoutMs`. With the flag off the binary is never resolved or run, and results are unchanged (#1144).
24
+
25
+ ### Fixed
26
+ - **Product scope `product-paths/4`: test shell scripts are tests (cognium-ai#1127 E7).** An SSRF was reported in a test shell script (`curl` to a hard-coded localhost). The rule now leaves out, with reason `test`, a shell script (`.sh`, `.bash`, `.zsh`, `.ksh`) named `test`, `tests`, `test-<name>`, `test_<name>`, `<name>-test(s)` or `<name>_test(s)` anywhere (`test-api.sh`, `src/scripts/test-ssrf.sh`, `services/api/run_tests.sh`), and every shell script in a `test/` or `tests/` directory at any depth (`services/api/test/smoke.sh`, rule `shell-in-test-dir`). `attest.sh`, `latest.sh`, `testing.sh` stay product code, and so does anything under `src/main/` (a test-named script there drops its glob from `patterns`, as the other file markers do). `classify`, `patterns`, `isTestPath`, `testPathPredicate`, `filterToProductScope` and the `excluded_reasons.test` count agree. Default scan, quality, trust and spec results can move; `productScope: false` / `SCOPE_ALL_PATHS=1` still reads every path. On a fixture with 10 such scripts beside 8 product scripts, `scan --no-llm` read 8 of the 10 before (only the two under nested `test/` / `tests/` were dropped, by the test-tree excludes) and 0 after; trust's walker kept all 10 before and 0 after. `rule_version` is now `product-paths/4`.
27
+ - **Static scan findings carry the absolute path in `source.file` and `sink.file` (cognium-ai#1127 note).** circle-ir's `generateFindings()` is given the file's basename, and the static path (and the static fallback after an LLM failure) spread its rows, so `findings[].source.file`, `sink.file` and `alternateSources[].file` held `user.js` while `filePath` was absolute. They are now the absolute path, as CLAUDE.md "Path emission" says; the basename stays as an additive `fileName` on each. SAST-pass rows and the LLM path already emitted absolute paths. The sink-shape filter and the per-sink grouping still read the engine's own value, so which findings are kept does not change. If your tooling matched these fields on the basename, read `fileName` instead.
28
+ - **Secret scan: Azure connection strings and Twilio auth tokens in source files, and Twilio SIDs.** For a file circle-ir parses (`.js`, `.py`, …) the working-tree scan kept only circle-ir's `hardcoded-credential` rows, so a provider shape that rule misses had no second chance: an Azure storage `AccountKey` inside a connection string (the variable is named for the string, not the key) and a Twilio auth token (32 hex) were missed (`benchmark:secrets` pattern-miss 2, box1 res-020). After the engine rows, the scanner now runs a short list of provider patterns over the source file (`azure-connection-string` and `azure-storage-key` from `HISTORY_SCAN_PATTERNS`, and a new `twilio-auth-token`): at most one row per line, never on a line the engine already flagged, shaped as a text-pass row (`patternId: 'hardcoded-credential'`, the provider id in `providerPatternId`). The Azurite emulator account (`devstoreaccount1`) and its published key are not flagged. A 32-hex value is also a hash, so the Twilio token counts only in a file that uses Twilio (`twilio`, or an `AC` account SID in the file); a token in a file that never names Twilio is still missed. An engine named-credential row is dropped when the variable name ends in `SID` and the value is an `AC`/`SK` + 32-hex SID, an identifier (`TWILIO_API_KEY_SID`). History scanning and the text pass are unchanged. The secrets corpus now labels the AWS access key ID on line 7 of `plist/case-01-xml-stripe-keys` (its description already named it). `benchmark:secrets`: TPR 96.4% → 100.0%, case-FPR 0/29 unchanged, extra detections on positives 2 → 0.
29
+ - **Quality test-coverage pass (cognium-ai#1090 item 9).** The `test-coverage` pass score now matches the measured coverage percentage in its findings instead of the whole quality-dimension score. The CLI no longer prints a `Complete` progress line before 100%.
30
+ - **The learned spec reads Django and Django REST Framework routes.** A Django route is registered in `urls.py` and handled in `views.py`, so no single file's `runtime_registrations` holds it, and the spec tree read only those: a Django or DRF app got "0 use case(s) … No entry points found" (HackSoftware/Django-Styleguide-Example a70ef43d on 4.38.0, box3 res-013). The tree now also reads the routes circle-ir's Python graph resolves across files (`buildPythonGraph` entries, framework `django`): `path()`, `re_path()` and `url()` patterns pointing at `APIView` / `GenericAPIView` subclasses (one use case per method the view defines, named after the view: "User list api (GET /api/users)") and at function views, `@api_view` included (method `ANY`). `include()` prefixes are composed from circle-ir's calls in each `urls.py` (`path("api/", include("pkg.urls"))`, the `("pkg.urls", "ns")` tuple, and `url(r'^api/', …)` with its anchors dropped); a URLconf reached through `include(<name of a list>)` keeps its registered paths rather than a guessed prefix. Flask and FastAPI routes still come from each file's registrations only. Django-Styleguide-Example: 0 → 10 use cases in 5 areas; gothinkster/django-realworld-example-app: 0 → 12 in 5. Trees with no Django route are byte-identical (spring-petclinic, cortex, controldeck). Not yet seen, and asked of circle-ir: DRF `router.register` ViewSets, routes inside an inline `include([...])` list, and the verbs of generic views whose handlers DRF defines (`ListCreateAPIView` reads `ANY`).
31
+ - **Scan text report jargon (cognium-ai#1090 item 8).** Default security scan text output humanizes `interprocedural_param` and similar internal finding types; the unbacked-flow note uses plain language instead of `flow_backed`.
32
+ - **Blast radius tests: a re-export search cut at its bound fails closed for its own import only (review of #1103, round 5).** `followImport` stopped at 10,000 (module, name) pairs, and a cut made every TypeScript function count as a plain decorator, so every `known` answer with an `unreached` in the repository became `unknown`, whatever the decorator. The narrowed graph, with fewer modules behind the import, could stay under the bound and answer `known`, so narrowed and whole disagreed. Now:
33
+ - the bound is the larger of 10,000 and 4 times the graph's files (`BLAST_FOLLOW_BUDGET`; `testsOf` option `followMaxStates`, and `followImport`'s new last argument, set it). A search visits each module once per name, so an `export *` closure of any size is followed to its end;
34
+ - a search that is still cut fails closed for that import alone: its decorator may be any declaration a search can reach (`followableNames`): the imported name, every name an `export { … }` list or an `export default` / `export =` exports from, the names those are imported under, and, when one of them may be a default export, every module's default export. Other functions stay as the graph has them.
35
+
36
+ With the bound lowered to 50 under a 60-module `export *` chain, the changed `helper` that nothing calls stays `known` / unreached (it was `unknown`), and the decorator's own change stays `unknown`. A 10,050-module chain is now followed to its end at the default bound.
37
+ - **Blast radius tests: `update` and `data` count in a file that makes Lit or Vue components, not in every file that imports Vue (review of #1103, round 5).** A file that imported anything from `vue` made a plain class's `update` / `data` framework-called, so in a Vue 3 composable (`import { ref } from 'vue'`) or a file with only `import type { Ref } from 'vue'`, an uncalled `Repo.update` answered `unknown` instead of `known` / unreached. The file now counts only when it imports, as a value (`import type` and `type` specifiers are left out), `LitElement`, `ReactiveElement`, `Vue` or `defineComponent` from any module, anything from a class-component package (`vue-class-component`, `vue-property-decorator`, `vue-facing-decorator`, `nuxt-property-decorator`), anything from a Lit package (`html` alone too, and a side-effect `import 'lit'`), `vue`'s default export or the whole of `vue` (`import * as`, `require()`, `import()`), or when its code writes a `@Component` or `@Options` decorator. Lit keeps main's breadth on purpose: a leaf element whose `LitElement` comes through a base class in its own file (`class X extends BaseElement`) usually imports only `html` from `lit`, and its `update` runs under test without a call the graph records; only imports that are all types leave a Lit file out (review of #1124). The last also covers a Vue class whose decorators come through a local wrapper (`import { Component } from './vue-wrap'`) over a `@Component({ template: … })` whose lines do not balance their brackets, which answered `known` / unreached because the header reading stopped inside the decorator's arguments. The class's own header still counts as before (`extends LitElement` anywhere in its heritage clause, `@Component` / `@Options` above it). Not covered: a Lit element whose `LitElement` comes through a base class in another file, in a file that imports nothing from Lit as a value. Telling a plain class from a Lit one there needs each class's heritage from the graph, asked of circle-ir in cogniumhq/cognium-dev#1343.
38
+ - **Product scope `product-paths/3`: Python test packages read the package's own files, singular and plural alike (review of #1109, round 2).** The walk that looks below a `test` directory for a test file also looked inside fixture data, so a Go package `internal/test/` (`helper.go`) with a fixture `testdata/test_input.py` was left out as a test. It now skips fixture, vendored and generated folders and hyphenated example and benchmark folders (`testdata/`, `fixtures/`, `vendor/`, `generated/`, `*-examples/` …). A plural `tests` without `__init__.py` counted only a test file in it, so `mypkg/tests/helpers.py` beside `mypkg/tests/unit/test_core.py` was product code while the same shape under a singular `test` was a test; plural `tests` now looks below it too. A `tests` holding `__init__.py` is still one on that alone, and a singular `test` still is not (Django's public `django/test/`). `rule_version` is now `product-paths/3`.
39
+ - **`testPathPredicate` reads the listing inside folders the rule leaves out for another reason (review of #1109, round 2).** For a path under `examples/`, `vendor/` and the like, it read `isTestPath` from the path alone, so a Maven or Gradle module's test source sets other than `src/test/` (`examples/app/src/androidTest/`, `src/testDebug/`, `vendor/lib/src/integrationTest/`, Kotlin Multiplatform's `samples/kmp/src/commonTest/`) were not tests there, and a Kotlin Multiplatform `src/commonMain/` did not protect what is in it. That matters when such a folder is read anyway (`productScope: false`, or an include that brings it back): those files gave use cases, rules and env reads. It now asks the disk what the walker would: a `src/` beside a build file holding `main` or a `<name>Main` makes its test source sets tests (`src/testFixtures/` stays fixture data) and its source sets product code, `test` / `tests` directories are read as Python test packages, and `test/`, `tests/`, `e2e/`, `cypress/` right under a nested package root are tests. `isTestPath` itself is unchanged. Still read from the path alone there: a `lib/` or `app/` below the first segment, and one that holds its own manifest.
40
+
41
+ Measured against main at 7b202d2f, both from source. The rule classifies every file of spring-petclinic 500158f, cortex c22f406, ControlDeck 69bf259, Django-Styleguide-Example a70ef43 and KaMPKit 4af0200 as before (summaries identical). `testPathPredicate` moves 5 files, all in ControlDeck: `controldeck-web/scripts/e2e/hello-world/` (the hello-world end-to-end test, its stack and its GitHub and gateway fakes) is a test, as `e2e/` right under the `@repo/scripts` package; the rule leaves `scripts/` out as tooling. Blast radius on ControlDeck 69bf259, the 4, 40 and 101-item sets: every item's and the batch's answer is the same as main's (batches 41, 665 and 1,460 tests reached), narrowed equals whole, and `tests: false` is byte-identical apart from the `rule` string.
42
+ - **The learned spec reads Maven plugin goals (controldeck#717).** A Maven plugin's entry points are its goals, `@Mojo(name = "…")` classes run by `execute()`; the spec read neither, so a plugin with no routes or commands showed no Java use case, and the event handlers of a script bundled under `src/main/resources` (OWASP BenchmarkUtils' `bootstrap.js`) were its only use cases. Each `@Mojo` class with a `name` is now a `cli` use case with method `GOAL` (`goal create-scorecard`; spec.md trigger `GOAL create-scorecard`), anchored on `execute()` (the class when it has none), with the same-file calls and domain rules a command gets. Once a goal is found, a bundled script is no longer read as the library surface either. The bundled script's own event-handler use cases (`on click.bs.modal.data-api`) are left out by the next entry.
43
+ - **A library's readable copy beside its minified build is skipped (controldeck#717, the other half).** `bootstrap.js` next to `bootstrap.min.js` was read as first-party code: on OWASP BenchmarkUtils it gave the plugin module 9 of its 14 use cases (`on click.bs.modal.data-api`) and both of its domain rules (Bootstrap's own throws). `preFlightSkip` now skips a `.js`/`.mjs`/`.cjs`/`.css` file when a `.min.`/`-min.` twin sits in the same directory **and** the file opens with the `/*!` licence banner minifiers keep, reason `vendored library copy (bootstrap.js beside bootstrap.min.js)`. A project's own `app.js` beside its own `app.min.js` (no banner), a bannered file with no twin, and a twin in another directory are still read. `SKIP_VENDORED=0` turns it off with the other vendored skips. Every walker that calls `preFlightSkip` follows (spec, scan, dead code, health). BenchmarkUtils, static spec: the plugin module 14 use cases and 2 rules → 5 use cases (its five Maven goals) and 0 rules. The trade-off: a library repository's own bannered `foo.js` beside its own committed `foo.min.js` looks the same and is skipped too; such a repo sets `SKIP_VENDORED=0`. The banner check is `/^\s*\/\*!/` (a byte-order mark is whitespace to `\s`).
44
+ - **Trust reads MCP and agent configs under `.cursor/`, `.vscode/` and `.claude/` (cognium-ai#1056).** `walkAiConfigFiles` skipped every directory whose name starts with a dot, so the configs editors and coding agents keep there (`.cursor/mcp.json`, `.vscode/mcp.json`, a `.claude/settings.json` with `mcpServers`) were never read. It now enters those three; other hidden directories and `WALK_SKIP_DIRS` are still skipped. The walk feeds the excessive-permissions and prompt-injection passes (prompt-injection re-attaches only those three dot trees after product-scope filtering, so default trust still skips other hidden dirs). A repository with such a config can get new AI-safety findings and a lower trust score, or a BLOCKED tier on a critical one.
45
+ - **AI mode keeps `flow_backed`; a finding the static detector never emitted is tagged `origin: 'ai'` (#1141).** With LLM enrichment and the verifier on, `verification.flow_backed` was dropped, so `--flow-backed-only` kept every AI-mode finding. The pattern-match step now forwards circle-ir's taint flows (the tree-cache envelope gains `flows`; its prompt version moves `tree-v2` → `tree-v3`, so cached trees are recomputed once) and the report stamps `flow_backed` on the verified branch and on the no-verdict, refuted and verify-off branches, by circle-ir's own rule (a flow of the same sink type reaches the sink line). A verified finding the static detector never emitted for its sink is kept and tagged `verification.origin: 'ai'`. Legacy callers that pass no flows are unchanged.
46
+ - **A verification that never answered never marks a finding exploitable (#1142).** When the verifier gave no verdict for a finding (timeout, breaker open, parse failure, or the LLM stage throwing into the static fallback), `exploitable` fell back to the static baseline, so a critical or high finding could ship as `exploitable: true` with no verdict. Such findings now get `exploitable: false`, `verification.status: 'skipped'` and a `skip_reason` (`llm-stage-error` for the fallback), keep their static severity and stay `mode: 'attempted'`, `verdict: 'UNVERIFIED'`. With verification off the static baseline is kept, as before. `cognium-ai`'s `exploitable: false` severity cap (#214) skips these findings, so "not asserted" is not demoted as if refuted.
47
+ - **Trust compare matches the doc-coverage summary across differently named roots (#1146, Refs #1145).** The coverage summary is now a project-wide finding key, so two identical trees compared under different directory names no longer report a new/fixed pair for it; root locations relative to the working directory are resolved against the compare root.
48
+ - **A whole-file route's span ends on the file's last line (#1186, Refs #1183).** A file `PAGE` use case cited `endLine` one past the last line on a file ending in a newline; the span now uses the line count with one trailing newline stripped.
49
+ - **Dead code: a field is not reported dead beside a dynamically reached sibling (#1150, Refs #952).** A product-layer guard on circle-ir's `deadCode()`: an instance field is not reported dead when a sibling method is `may-be-live` with unresolved sites (`(this as any)[name]()`); the hidden field is counted as `may-be-live`, so live + may-be-live + dead still equals what `deadCode()` answered. circle-ir 4.24.0 lifts these containers itself (cognium-dev#1366).
50
+ - **Django routes get their `include()` prefixes once on circle-ir 4.24.0 (#1198).** circle-ir 4.24.0 composes the prefixes into each graph route's `path` (`registeredPath` and `mounts` beside it, cognium-dev#1352), and the spec composed them again on top: `url(r'^api/', include('shop.urls'))` gave `/api/api/items`. The spec now puts its own prefixes on the registered path (`registeredPath`, or `path` on older circle-ir), so a route is prefixed once; where it cannot place a URLconf (below `include(<name of a list>)`) the registered path stays, as before, rather than circle-ir's partial prefix (`/shop/items` for a route Django serves at `/login/shop/items`); otherwise it takes circle-ir's composed path. Still works on circle-ir 4.23.0. A function view under DRF's `@api_view(["GET"])` now reads `GET` (circle-ir 4.24.0), not `ANY`; a plain function view stays `ANY`. `GraphRoute` gains `composedPath`.
51
+
52
+ ### Known issues
53
+ - Blast radius tests: a regular-expression literal longer than 1,000 characters (`REGEX_MAX_CHARS`) is read as code by both readings of `plainDecoratorNames`, so a backquote or `\/*` in it can hide the plain decorators written after it, and an uncalled function they name can answer `known` / unreached (review of #1103, round 5). The bound keeps the reading linear in the text; 4.38.0's "What it does not cover" did not list it.
54
+
55
+ ## [4.38.0] - 2026-11-21
56
+
57
+ Minor, still on circle-ir 4.23.0. Blast radius adds `tests`, the tests that reach a change (#1072); it is on by default and costs more, and `tests: false` restores the earlier cost, with the same answer apart from `tests`. The product-scope rule moves to `product-paths/2` and changes which files it keeps: a test-file marker counts only right before the extension (`r.$id.spec.index.tsx` is product code), and test source sets (Maven, Gradle, Android, Kotlin Multiplatform), .NET test projects and Python test packages are tests wherever they sit, as are test and fixture folders in a package's `lib/` and `cypress/`. So default scan, quality, trust and spec results can move. `productScope: false` / `SCOPE_ALL_PATHS=1` still reads every path, and with it scan now reaches `test/e2e` trees too. The learned spec tree keeps Java packages named `samples`, `spec` or `fixtures` and names the repository level after the repository, and the trust and quality walkers read directories in sorted order. No root export or output field is removed or renamed.
58
+
59
+ Blast radius tests (#1087) merged after 4.37.0 was staged from 3d2063d4, and its entry first landed under [4.37.0]. It is in this release; 4.37.0 does not contain it.
60
+
61
+ ### Added
62
+ - **Blast radius lists the tests that reach a change (#1072, architect map A3).** Every radius (each item's and the batch's) carries `tests: { reached, unreached, unresolved_sites, status, max_hops, rule }`. `reached` holds the declarations in test files (the product-scope rule, reason `test`: `*.test.*`, `*.spec.*`, `src/test/`, `__tests__/`, `*_test.go`, `test_*.py` and the rest of `product-paths/2`; always the rule itself, whatever the call's own product scope) that reach a changed declaration, followed backwards over the call graphs blast radius already builds (`ts-call-edges`, `java-graph`, `python-graph`, `go-graph`) up to `max_hops` steps (option `maxHops`, an integer from 1 to 8, default 4; anything else is refused). A step is a call, or a reference: a function or class used as a value (passed as an argument, stored in a table, rendered as `<Component/>`, returned), which may run and so counts as `inferred`. Each is a `BlastTest` `{ file, symbol, line, reaches, hops, tier }`: the test function or method (the file itself for top-level test code), every changed declaration it reaches within the bound, the steps on its shortest path, and that path's weakest edge (`inferred` reads "may reach"). Code nested in a function's body (a callback, a local function) is reached, at `inferred`, by whatever reaches the function, and the walk steps out the same way at every hop: a change called only from an inline callback (`cs.map((c) => parseConfig(c))` in `createTaintConfig`) is reached by the tests that call the enclosing function (stepping out adds no hop). Test files are not stepped out of: their nested callbacks are tests themselves. A class does not carry its uncalled methods. `unreached` lists the changed declarations no test reaches within the bound through resolved calls or references, and that no other way in may reach: a declaration is left out of it (with a note) when an unresolved call of any reason (an import from outside the tree included) names a declaration on a path to it (for `.call` / `.apply` / `.bind`, which the graph reports by those names, the name they are called on, read from the source at the site, at most 400 characters and across a line break: `k.b.call(k, 1)` names `b`, `k['i'].call` names `i`; when the receiver cannot be read (`pick(k).call(k)`), every declaration on a path its file spells counts; cognium-dev to emit the edge), when a route, listener, program main or other framework entry is on such a path (a test can reach it over HTTP or through a container), or when a test file that did not parse completely names such a declaration. `status` is `known` when every changed declaration is reached or unreached. Otherwise it is `unknown` and `unreached` is empty, so nothing is said to be untested: some declaration may be reached another way, or the answer cannot be backed at all (the repository walk was cut, a changed file had no call graph, a location named no declaration, the item changes none or also bumps a dependency (a bump's tests, through its import sites, are not followed), a test file of the language was too large to read, the test walk stopped at its budget or could not widen as far as it needed, or the call passed `tests: false`). `unresolved_sites` counts calls in test files the graph could not resolve, of any reason, by the name of a declaration on a path. This is which tests reach a change through resolved calls and references, not a selection of tests to run: a test not listed can still exercise the change. With the prefilter on, the graph is widened one hop at a time to the files that name a declaration reached so far (by name, or by importing its module, through re-exporting modules too; at the last hop, test files only; test code only from test files that import its module, for Go its package directory, or name it from the same directory) and rebuilt; over the fixtures and on ControlDeck the widened answer equals the whole repository's graph. For TypeScript the rebuilt graph resolves imports the call graph does not follow by itself: each file's non-relative import specifiers are rewritten to relative paths the way TypeScript resolves them (`src/blast-radius/import-map.ts`). A file is governed by the nearest `tsconfig.json` above it when its `files` / `include` / `exclude` take the file in, else by the first config its `references` lead to that does (a solution-style root with `files: []`), else by none (nothing rewritten). Each config's `extends` chain is followed (relative files and package specifiers under the repository's `node_modules`; arrays in order; one that cannot be read is let go only when the config sets `baseUrl` and `paths` itself) and `compilerOptions`, `files`, `include` and `exclude` merged; `baseUrl` is relative to the config that sets it, and `paths` resolve against the effective `baseUrl`, else the declaring config's directory, so each app keeps its own `@/`; an exact key tries only its own targets. Export conditions are tried in their own order, and a subpath an `exports` map does not list is not rewritten. Then workspace package names (`@repo/core/app-routes`, `@acme/core`, through `exports`, `module`, `main`, `types`), only for members of a declared workspace (`package.json` `workspaces` or `pnpm-workspace.yaml`) and for files inside it. The test graph is built with these rewrites whenever any file in it has one, with or without a widening round, so the prefilter does not change the answer. Nothing is rewritten when a config in the chain cannot be read, or for a name two members claim: those imports stay unresolved, so what they may reach is not known. Only files inside the repository are read, each at most 1 MB. Declaration ids do not change. `call_sites`, `reach`, `level`, `label` and `levels` still come from the first, unrewritten graph and are unchanged (a direct call from a test file stays a call site, as before). The batch joins its items' tests by file and symbol (fewest hops, strongest tier at those hops, the union of what each reaches), and says `unreached` only when every item's tests are known; `unionRadius` does the same over presented radii. Cost bound: option `tests: false` (MCP `tests`) turns the walk off, so the call costs exactly what the rest of the radius costs and every `tests` is not known; and the test walk has a file budget per language, `maxTestFiles`, by default the larger of 2,000 and 4 times the first graph's files (`BLAST_TEST_BUDGET`), never more than `walk.maxFiles`, past which the tests are not known, with a note. The walk often ends at nearly every TypeScript/JavaScript file of a repository (box2 measured 357 of 357, 1,259 of 1,261 and 1,320 of 1,322 on Cognium's repositories), so callers should send the items of one pass in one `blastRadius` call (with or without `batchId`): the items share the walk, about 1.6 s per item instead of about 18 s per call one at a time. The MCP tool `blast_radius` takes `max_hops` (1-8) and `tests`, and declares `tests` in its output schema; tests past the first 500 are cut like call sites. The CLI's `-f json` and circle-pack's `/api/blast-radius` pass the engine object through, so they carry `tests` (at the default bound) once they move to this release. Also exported from the package root: the `BlastTest`, `BlastTests` and `BlastTestStatus` types, `BLAST_TEST_HOPS`, `BLAST_TEST_RULE` and `BLAST_TEST_BUDGET`; from `src/blast-radius`, the pure parts as well (`walkBackwards`, `testsOf`, `carriersOf`, `joinTests`, `unknownTests`). `assembleRadius` takes an optional `tests` (without one, the tests are not known). Cost, on ControlDeck: 1,272 TypeScript files, one changed function, warm, median of 3, on a 2-vCPU box. Against the radius before #1087 (`e2605ff`): `isAppRoute` 0.13 → 0.23 s (5 tests), `CountsStrip` 0.2 → 12.9 s (18), `cweFor` 8.7 → 27.9 s (182), `openFindings` 1.8 → 28.9 s (18), `createAuth` 22.5 → 48.2 s (not known: a framework entry and an unresolved call by its name are on its path). References and resolved imports connect a TypeScript monorepo far more than calls alone, so within 4 steps the walk reaches most of the repository. With `tests: false` each is back at the earlier cost (8.0, 1.7, 0.2, 0.13, 23.6 s) and the answer is byte-identical to the earlier one apart from `tests`.
63
+
64
+ ### Changed
65
+ - **Scan text report newcomer hints (cognium-ai#1090 item 8).** When the default report truncates findings after 20 rows it now prints one next-step line: `-f json -o report.json` (or `-f sarif -o report.sarif`), `--severity high`, `-e`. The OWASP section labels the `Unknown` bucket as `Not mapped to OWASP Top 10` (internal keys unchanged). Review of #1097: the first version of the line named `-f markdown -o report.md`, which `cognium-ai scan` refuses (it takes `json`, `summary` and `sarif` only), and the label said "Not in OWASP Top 10", though the bucket also holds findings with no CWE and CWEs the mapping does not know. A test now reads `scan`'s format list from `cognium-ai/src/cli/program.ts` and fails if the hint names any other format.
66
+ - **Product scope `product-paths/2`: a file marker counts only right before the extension.** `*.test.*`, `*.spec.*`, `*.stories.*` and `*.bench.*` matched anywhere in a file name, so TanStack Router route files such as `r.$repoId.spec.index.tsx` (a `spec` path segment) were treated as tests. They were left out of scan, design.md, quality and trust (box1 res-014: a product zod schema missing from ControlDeck's design.md). A name now has to end `<marker>.<ext>` (`a.spec.ts`, `a.e2e.test.ts`); the globs are `**/*.<marker>.+([!.])`. The same shape replaces scan's own default test excludes, trust's BLOCKED-override paths and dead-code's test excludes. A route file that ends `.spec.tsx` (`r.$id.spec.tsx`) is still read as a test. `rule_version` is now `product-paths/2`.
67
+
68
+ ### Fixed
69
+ - **The walkers behind `trust` and `quality` read each directory in sorted order (cognium-ai#1086).** They walked in `readdir` order, the filesystem's (ext4 hashes names with a per-filesystem seed; APFS and tmpfs differ again), so the same checkout could give a different answer on another machine: a pass with a `maxFiles` cap kept a different set of files, eu-ai-act-flags kept whichever of two same-named Markdown files (`README.md`, `docs/README.md`) it read last, and every pass listed its findings in a different order. Each directory's entries are now sorted by name in UTF-16 code-unit order (not locale), the order the scanner's discovery uses since #1076: the trust passes ai-config-detect (`walkAiConfigFiles`, also read by prompt-injection and excessive-permissions), ai-generated-fingerprint, code-complexity, conformance-attestation (an attestations directory), cross-skill-interaction (both walks), data-exfiltration, dep-manifests (`parseAllManifests`, read by osv-dependency-audit and conformance-attestation), deprecated-usage, deprecation-no-replacement, doc-coverage, eu-ai-act-flags (both walks), excessive-permissions (the ungated shell-exec walk), inconsistent-error-handling, inconsistent-naming, inconsistent-param-order, missing-guard-dom, performance-passes, prompt-injection (root Markdown), throws-mismatch, tool-poisoning (both walks) and unnecessary-object-hotspot; the secret scanner's file list (hardcoded-secrets, and the health and quality secret check); the health-score metrics walk (`quality`, `health`); dead-code's legacy walk; and the product-scope rule's directory walk (so `excludedDirs` comes out in one order). One shared comparator, `src/utils/dirent-order.ts` (`compareNames`, `byName`). cognium-ai's own collector (`collectFiles`, trust's CircleIR file list) sorts the same way since cognium-ai#1089. The spec-gap analyzer (trust's spec-gap-report) and the learned-vs-intent diff (`diffLearnedIntent`, the MCP spec-drift and conformance tools) already sorted their spec files (and the analyzer its `environment/` folder), but with `localeCompare`, which depends on the machine's locale; `specFilesUnder`, the learned-tree module listing in `learned-diff.ts` and `readIntentEnvironment` now use the same code-unit order (so with mixed-case or `_`-prefixed names, files are read `Zeta` before `_notes` before `alpha`). Not changed, as they feed neither command: the LLM doc-pattern passes, the MCP tools' walk, BOM, selectors, Specifica generation and the caches.
70
+ - **Quality and the other walkers use the `product-paths/2` markers (review of #1093).** Quality's file walk sorted tests from source with its own `/\.test\./` and `/\.spec\./`, so a route file such as `app/routes/r.$id.spec.index.tsx` was still a test there: it counted in `testFiles` (a tree with that route, `src/a.ts` and `src/a.test.ts` reported `testFiles: 2, sourceFiles: 1`) and skipped the circle-ir metrics. `HealthScoreCalculator` now asks the rule's own test markers (`FILE_MARKERS`, reason `test`), plus the `_test.<ext>`, `*Test.java` and `test_*.py` shapes it always counted, so the same tree reports `testFiles: 1, sourceFiles: 2`, with product scope on (quality) or off (health). The same end-anchored test replaces the old shape in selector evidence (`DEFAULT_EVIDENCE_EXCLUDES`' `*.test.*` and `*.spec.*` are read as the rule's markers, since its hand-rolled glob matcher cannot say "one extension") and in the in-memory skill loader (`createSkillBundleFromFiles`). The skill test-path gate (`isTestOrFixturePath`) and the on-disk skill walker already ended the marker at the extension and are unchanged.
71
+ - **`a.spec.d.ts` stays a test.** Under #1093 a marker followed by a `.d.ts`, `.d.mts` or `.d.cts` ending became product code, because that ending holds a dot. It is one extension again, as under `product-paths/1`: each marker has a second glob, `**/*.<marker>.d.@(ts|mts|cts)` (the four marker entries of `FILE_MARKERS` become eight, each glob agreeing with its own test), also in scan's default test excludes, trust's BLOCKED-override paths and dead-code's test excludes. `r.$id.spec.index.d.ts` and `a.spec.d.tsx` are product code.
72
+ - The product-scope header and cognium-ai's README list the markers as `*.<marker>.<ext>`.
73
+ - **Blast radius tests: four ways to say `known` with a false `unreached` (review of #1095).** The rule is that `unreached` never lists a changed declaration a test may run; when that cannot be backed, the answer is `unknown` with an empty `unreached` and a note. Each case below answered `known` and listed the declaration as unreached.
74
+ - **The `.call` / `.apply` / `.bind` receiver is read from the text the graph was built from.** The test graph is built with tsconfig and workspace imports rewritten to relative paths, which changes the length of the line they are on, so its columns are columns in the rewritten text. The receiver was read from the original text, so a rewritten import on the same line as the site (`import { Calc } from '@/calc'; it(… k.b.call(k, 1) …)`, or `await import('@/calc')`) moved the read onto the wrong name. `testsOf` now gets each graph's own text (the original for the first graph, the rewritten text after a rebuild), for the receiver read and for partly parsed test files.
75
+ - **The receiver is read only when it is a plain member chain.** `callLikeReceiver` returns a name only for identifiers (`this` among them) joined by `.`, `?.` or `['literal']`, in wrapping parentheses or not, with spaces between its parts, on one line, right up to the `.call(`; a line break may come only between the whole receiver and its `.call`. Anything else returns nothing, so every declaration on a path the site's file spells counts, as for any receiver that cannot be read: a cast (`(k.b as Fn)`, `satisfies`, `k.b!`), `||` / `&&` / `??`, a ternary in either order, a comma, a call (`getK().b.call`), a comment (`k.b // bound for callbacks` with `.bind(k)` on the next line), a line break inside the receiver, a literal with an escape or `${`, a name that is not ASCII, a site in the middle of a name, `Reflect.apply(fn, …)` and `f.call.call(g)` (the function is not the receiver's last name). Two call-like sites that start at the same column are a chain with a call in it (`a.b.call(x).c.call(y)`), so neither is read; a site with no column is not read; and when the file's text cannot be had, every declaration on a path counts.
76
+ - **Code that runs without a call edge.** Some code runs with no call the graph records: on import, when a class is defined or built, on a property access, or by the runtime. When such code is on a path to a changed declaration within `max_hops`, or is the changed code itself, that declaration is not listed as unreached (new `NotKnownReasons.uncalled`, with a note), unless a test reaches it another way. The cases covered are:
77
+ - field initializers, module-level and class fields, static ones too (`export const CONFIG = parseConfig('abc')`);
78
+ - functions nested in a field's initializer. The walk now steps out of a function into the field that holds it, as it does into an enclosing function. That covers module-level wrappers (`export const GET = withAuth((req) => parseConfig(req))`, `memo(...)`), module-level `.map` callbacks and class field callbacks;
79
+ - inline functions directly under a module or a class that no call or reference enters. The walk steps out of them into the module or the class. An inline function is one the engine flags `unstable:anonymous`, that is, not a declaration a caller can name. That covers:
80
+ - `RAW.forEach((c) => …)` at module level, reached through a named import, a side-effect import or an index that imports it for effect;
81
+ - `setTimeout(…)` and `bus.on('x', …)` at module level;
82
+ - `Object.defineProperty(o, 'size', { get: … })`, with an arrow or a method getter;
83
+ - a callback in a class `static {}` block, which a test that uses the class reaches at `inferred`, because defining the class runs the block;
84
+ - a decorator argument;
85
+ - `module.exports = function () {}`.
86
+
87
+ A named function or method that nobody calls still stays unreached, and a default-exported function is a declaration: a test that calls it through a default import has an edge to it;
88
+ - plain decorators, written `@Name` with no call after it, on a class, a method, an accessor or a parameter (`plainDecoratorNames`). A plain decorator is neither a call nor a reference in the graph. A decorator factory call (`@Log()`) is an edge on the class and was already followed. The name is matched as written, through an `import { Log as L }` rename, and as a default import of the module whose default export it is (`import Logger from './log'`). Renames are followed through re-exports to every declaration they may name (`followImport`): `export { Log as Logger } from '../log'`, `export { default as Logger } from '../log'`, `export * from './inner'` for a name no list of the module exports, and a barrel's own `export { Inner as Logger }`, `export default Log` or `export = Log` whose name it imports (`import { Log as Inner } from '../log'`, `import Log from '../log'`). A cycle ends; a search past 10,000 (module, name) pairs stops and fails closed: every TypeScript function then counts as a plain decorator. CommonJS `module.exports = Log` / `exports.default = Log` and TypeScript's `export = Log` count as default exports, and `import Logger = require('./log')` as a default import. Comments, string and template contents and regular-expression literals are not read, so JSDoc `@param` / `@link`, `'@repo/email'` and `` /`([^`]+)`/ `` neither are nor hide decorators (`codeOnly`). Whether a `/` starts a regex is guessed from what comes before it, and a wrong guess (a JSX `</b>` or `<I />`, `el.w! / 2`, `i++ / 2`, a division that starts a line, or a regex after `)`) can hide the names after it, so the text is read twice, with regex literals and without, and a name either reading finds counts. A regex literal is read for at most 1,000 characters, so the reading stays linear in the text (a crafted 180 KB line took 15 s). When a reading ends inside a template literal or a block comment, its names are read from the raw text;
89
+ - code in a function's or method's definition header, which runs when the class or module defines it: its decorators' arguments (`@Reg(() => parseConfig('a'))` on a method, where the arrow's parent is the method, and Python `@deco(parse_config("a"))` / `@deco(lambda: …)`, where the engine puts the call on the function at its decorator line, however many decorator lines there are), and the arguments of a parameter decorator factory (`run(@Inject(parseConfig('a')) x)`). A TypeScript default parameter runs on call and is not part of the header, so a function no one calls with one stays unreached. When the header's end cannot be found (no Python `def` signature in the declaration's lines, or a scan that does not reach the body within 20,000 characters), all of the declaration counts as header: it fails closed;
90
+ - calls a class makes of its own: static blocks, decorator factory calls, Java instance initializers. Also Java static initializers (`<clinit>`);
91
+ - getters and setters: the engine's signature starts with `get ` / `set `, or for Python, a `@property`, `cached_property` or `.setter` / `.getter` / `.deleter` decorator;
92
+ - methods the runtime calls with no call site in the repository (`RUNTIME_CALLED`):
93
+ - TypeScript / JavaScript: `toString`, `toJSON`, `valueOf`, `then`, iterator `next` / `return` / `throw`, `[Symbol.iterator]` and the other well-known symbols, `[inspect.custom]` in any spelling (`[util.inspect.custom]`, `[Symbol.for('nodejs.util.inspect.custom')]`), `handleEvent`, Node stream methods (`_write`, `_writev`, `_read`, `_transform`, `_flush`, `_final`, `_destroy`, `_construct`), custom-element callbacks, and the lifecycle methods of React (`render`, `componentDidMount` …), Angular (`ngOnInit` …), NestJS (`onModuleInit`, `onApplicationBootstrap`, `onModuleDestroy`, `beforeApplicationShutdown`, `onApplicationShutdown`), Lit (`firstUpdated`, `updated`, `willUpdate`, `shouldUpdate`, `update`) and Vue class components (`data`, `created`, `mounted` …). `update` and `data` count only on a Lit or Vue class, because CRUD repositories and stores use both names: one whose header extends `LitElement`, `ReactiveElement` or `Vue` anywhere in its heritage clause (`extends SignalWatcher(LitElement)`, `extends` on the next line) or carries `@Component` / `@Options` (the decorators above the class are read whole, however many lines their arguments take, and the class's own text up to the `{` of its body), or one in a file that imports `lit`, `lit-element`, `@lit/…`, `vue`, `vue-class-component`, `vue-property-decorator`, `vue-facing-decorator` or `nuxt-property-decorator`. They match class methods only (a React function component is a function, and the Vue options API is already covered by the module and field rules);
94
+ - Python: every dunder but `__init__` (construction is an edge to it);
95
+ - Java: `toString`, `equals`, `hashCode`, `compareTo`, `compare`, `close`, `run`, `call`, iteration and serialization hooks;
96
+ - Go: `String`, `Error`, `Format`, the `encoding` and `json` marshalers, `ServeHTTP`, `sort.Interface`, `io` and `sql` interfaces.
97
+
98
+ The Java and Go lists trade precision for soundness: they hold common method names (Java `run`, `call`, `close`, `next`, `compare`; Go `Read`, `Write`, `Close`, `Scan`, `Value`, `Is`, `As`), and the graph does not say which classes implement the interface, so every such method on a path makes the changes it reaches `unknown`, whether or not the runtime calls it. Narrowing them to implementing classes needs facts from circle-ir;
99
+ - a module's top-level code that calls into the path, or references it other than as the whole operand of an export. `export default X;`, `export = X;`, `module.exports = X;` and `exports.x = X;` run nothing, so they still leave `X` unreached; `export default memo(X)` and `[a, b].forEach(run)` do not;
100
+ - Python default arguments and annotations, which run when the `def` runs: on import for a module's function, and when the class body runs for a method. With a function's decorator lines, as above.
101
+
102
+ It claims no `reached` the graph does not back. A test that imports a module or constructs a class is not said to reach the initializers that run, because neither an import nor a property read is an edge. The one new `reached` is the static-block callback above, which comes through the test's edge or reference to the class. A repository with no test file in the language still answers `known`, since no test can run that code. A constructor still runs on `new`, as before.
103
+
104
+ What it does not cover: a function run through a local alias (`const f = k.b; f()`), a plain decorator hidden from both readings of the text (a regex right after `)` or `export default`, JSX text holding a backquote or `/*`), a namespace re-export (`export * as d from`) or a CommonJS `require` binding other than `import X = require()`, a Python decorator argument that is a string holding `def name(`, a CommonJS module passing on its own export (`process.on('exit', exports.run)`: the graph records no reference for that read, asked of circle-ir in cogniumhq/cognium-dev#1340), reflection, `eval`, a runtime- or framework-called method not in the lists above, and dependency-injection containers that are not framework entries. These stay as the graph has them.
105
+ - **Two configs that take a file in and map a specifier differently.** A file was governed by the first referenced tsconfig that takes it in, so with `tsconfig.app.json` (`@/*` to `./src/*`) and `tsconfig.test.json` (`@/*` to `./test/mocks/*` first), both including `src`, the answer depended on the order of `references`. One order said the real `fmt` was reached and the mock unreached; the other said the opposite. Now every config the references lead to that takes the file in (and the nearest config itself when it does) is asked. A specifier is rewritten only when they all send it to the same file. Otherwise it stays unresolved, so what it may reach is not known, because which config applies depends on the tool that runs the tests: tsserver and vite-tsconfig-paths take the first, `tsc -b` builds the file in each, and jest maps paths from the one its `moduleNameMapper` names. Configs that agree still rewrite. On purpose, a config without `paths` next to one with `paths` (`tsconfig.app.json` with `@/*` and `tsconfig.spec.json` with only `include: ["src/**/*.test.ts"]`) is also a disagreement: under the spec config `@/lib/fmt` resolves nowhere, and a runner using it would fail the import, so the answer is not known where main reached the test. A referenced config that cannot be read stops all rewriting in the file, wherever it is in the list, when it may take the file in; before, it did so only when it came before the first config that took the file in. Whether it may take the file in is read from its own settings: when it sets `include` itself and extends only packages, its own `include`, `files` and `exclude` decide. One residual is accepted: a package base's inherited `files` could name the project's own files through `${configDir}`, which nothing can see while the package is not installed; a published base listing a project's test files is not expected. `${configDir}` (TypeScript 5.5) is now replaced by the leaf config's directory in `files`, `include`, `exclude`, `baseUrl` and `paths`, whichever config in the `extends` chain wrote it, for readable configs and for those read from their own settings. Before, it was joined on as a literal, so an `include` with it took nothing in, and two configs that map `@/` differently could again rewrite as if only one did (main has the same gap for readable configs). So the Vite-style `tsconfig.node.json` (`extends: "@tsconfig/node20/tsconfig.json"`, `include: ["vite.config.ts"]`, with the package not installed) leaves `src/` rewritten in either order of `references`, where main reached the test in one order only. A reference to a config file that is not there is skipped.
106
+
107
+ `tests: false` output is byte-identical to before. On ControlDeck `@69bf259`, tests on, the four items and the batch give the same bytes as before (`isAppRoute` 5 tests, `CountsStrip` 18, `openFindings` 18, `createAuth` not known, batch 41), and narrowed equals whole. On the review of #1103's sample of 40 more ControlDeck declarations, eight `known` answers listing the change as unreached become `unknown`. Seven are constants a test or a tested file reads, and one is called from tRPC procedure callbacks, so main's claim was false for all eight. The other 32 answers, the batch (664 tests reached) and narrowed against whole are unchanged, and no `reached` test is lost. The cost of a function with thousands of calls is upstream, in circle-ir's `buildTsCallGraph` (cogniumhq/cognium-dev#1338).
108
+ - **The learned spec tree keeps a Java package named `samples`, `spec` or `fixtures`, and drops tests by the product-scope rule, not by private regexes.** On cogniumhq/spring-petclinic (a fork of the Spring sample, Start on loop.cognium.dev) the spec was empty: `spec-tree.ts` had its own `TEST_FILE` regex with `examples?|samples?` (and `benchmarks?`, `fixtures?`, `tests?`, `spec`, `e2e`) anywhere in a path, so every file of the package `org/springframework/samples/petclinic/` was dropped from the level's use cases, rules and conventions. The level kept 12 HTML templates and spec.md said "No entry points found at this level." The product-scope rule already got this right (generic names count only directly under a package root, and nothing under `src/main/` is ever left out): it left out only the 20 test files. Now every such filter uses the rule. The spec tree's use cases, rules and conventions, design.md's code files and the learned environment's env reads in code leave out tests only, by the rule's reason `test` (`testPathPredicate(root)`, new in `src/scope/product-paths.ts`: the rule read from the repository, whatever the call's own scope, plus a test file inside a folder the rule leaves out for another reason, such as `examples/app/a.test.ts`). Everything else the caller read stays: the generator's file walk has already left out what product scope leaves out, so with `productScope: false` (or the all-paths fallback) examples, fixtures and benchmarks give use cases, and tests still do not. `extractUseCases` takes `isTestFile` (the spec tree passes the rule), and `languageForEnvReads` / `readEnvReads` take the same predicate. Without one, both use `isTestPath(rel)` (new, exported): the rule's test reason read from the path alone, which counts `test/`, `tests/` and `e2e/` only as the first segment, since a deeper package root cannot be known from a path. Removed: `use-cases.ts`'s second `TEST_FILE` (`tests?|spec|e2e|fixtures?` anywhere, so a Java package `spec` or `fixtures` vanished the same way), `level-design.ts`'s (`tests?|e2e|fixtures?` anywhere, and `-test` / `-spec` / `-stories` file names), and the env-read learner's (`test|tests|e2e` anywhere). What the rule does not call a test is no longer one here: `foo-spec.ts`, `*.e2e.ts`, `*.tp.ts`, `test.js`, a `*Test.java` outside a test folder, a `spec/` folder, and `test/` or `fixtures/` below a package root (the rule keeps `src/feature/test/`; what it reads as tests inside a `lib/` or `app/` folder, in Android and Gradle source sets, in Python test packages and under `cypress/` is in the product-scope entry below, review of #1104). spring-petclinic, same engine otherwise: 0 use cases, 0 rules → 17 use cases in 5 areas (Owners, Vets, Oups, System, Vets html) and 1 domain rule, with L5 and L7 layer lines and 4 conventions in principles.md. cognium-ai's own repository: every file of the learned tree byte-identical. ControlDeck: every spec.md and rules.json byte-identical. Three other lines differ: two design.md lines gain product code the old `-spec.ts` match had dropped (`db`: the `learned_spec` table in `db/schema/learned-spec.ts`; `api`: the `BLOB_CACHE_LIMIT` limit in `apps/api/lib/architect-spec.ts`), and `modules/app/principles.md`'s L5 line gained `UI` from `apps/app/lib/test/render-app.tsx`, a test helper the rule then kept as product code because it sat in the package's `lib/`. With the product-scope entry below, `lib/test/` is a test and that line is back as it was. The modules walk's own non-product folder list (`modules.ts`, only for folders that hold a module manifest) is unchanged.
109
+ - **The learned tree's repository level is named after the repository, not the folder it was read from.** A checkout in a temporary folder was named after that folder: circle-pack's clones gave "Spec — circle-secrets-MlGIlG" (generate-spec had reused the secrets job's clone from the source cache). `generateSpecificaForDirectory` and `buildSpecTree` take `repositoryName` (it names the repository level, its spec.md and principles.md titles and rules.json `module`; blank is ignored), and circle-pack passes the name from `repo_url` (circle-pack entry). Without the option, `repositoryName(root)` now reads more root manifests before the folder's name: `package.json` `name` (first, as before), `pom.xml` the project's own `artifactId` (not the `<parent>`'s), `settings.gradle(.kts)` `rootProject.name`, `go.mod` the module path's last segment (a `/v2` suffix skipped), `Cargo.toml` `[package]` `name`, `pyproject.toml` `[project]`, else `[tool.poetry]`, `name`. A `${…}` placeholder or an empty value falls through to the next. So spring-petclinic is `spring-petclinic` even without the option (its pom). The name feeds no rule key and no use-case id: a rule key is the rule's derivation, text and anchors, a use-case id the module name (empty at the repository level), kind and trigger. Checked on spring-petclinic and on a TypeScript fixture: with and without the option, only the titles and `module` differ. Blast radius places files with the same `repositoryName(root)`, so its repository level's `name` follows the manifest too (`path` is still `''`). A repository with none of these manifests is still named after its folder.
110
+ - **Product scope: real tests inside a `lib/` or `app/` folder, Android and Gradle test source sets, Python test packages below the root and `cypress/` are tests (review of #1104).** Under a `lib/` or `app/` directly under a package root, the rule left out only `__tests__`, `__mocks__` and `__fixtures__`, before it looked for `src/test`. So Gradle's own layout (`gradle init`: `app/src/test/java`, `lib/src/test/java`) and Android's test source sets were product code for scan, quality, trust and the learned spec tree, and so were `lib/test/`, `lib/fixtures/`, a Django app's `tests/` package helpers (`tests/factories.py`, `tests/base.py`) and `cypress/e2e/`. Since #1104 the spec tree follows the rule, so the tests started giving use cases, rules, conventions and env reads. Now, still `product-paths/2` (first released here):
111
+ - Test source sets, .NET test projects and Python test packages are tests wherever they sit, inside `lib/` and `app/` too. A test source set is `src/test/` in any `src/`, and in a Maven or Gradle module the sets beside `src/main/`: `src/it/`, any camelCase `src/<name>Test(s)/` (`androidTest`, `sharedTest`, `integrationTest`, `screenshotTest`) and `src/test<Variant>/` / `src/androidTest<Variant>/`. `src/testFixtures/` is a fixture. A Python test package is a `tests` directory that holds `__init__.py`, `conftest.py` or a `test_*.py` / `*_test.py`, or a `test` directory with such a test file in it or below it. A library can ship a package named `test`: Django's public `django/test/` (`client.py`, `testcases.py` ...) holds no test file and stays product code (review round 2).
112
+ - In a Gradle module, Kotlin Multiplatform's `src/<name>Main/` (`commonMain`, `jvmMain`, `iosMain`) marks `src/` as a source directory, as `src/main` does, so `commonTest`, `jvmTest`, `iosTest`, `androidUnitTest`, `androidInstrumentedTest` and `androidHostTest` are tests. Folders under a `<name>Main/` are protected as under `src/main/`: `commonMain/kotlin/com/x/fixtures/` is product code.
113
+ - A `lib/` or `app/` with a manifest of its own is a package (a Gradle or Android module), not a library folder or a router.
114
+ - In `app/` (Next.js's router, where `app/test/page.tsx` serves `/test`) nothing else is left out, as before.
115
+ - In `lib/`, test and fixture folders go as they do elsewhere (`lib/test/`, `lib/fixtures/`, `lib/*-test/`). Every other name stays the library's (`lib/scripts/`, `lib/examples/`).
116
+ - `cypress/` directly under a package root is a test.
117
+ - `isTestPath` reads the same from the path alone, except what needs the listing: the test source sets beside `src/main/` other than `src/test/` (camelCase `src/<name>Test(s)/`, `src/test<Variant>/`, `src/it/`) and Kotlin Multiplatform's, which count only in a Maven or Gradle module, so `isTestPath` reads neither (`src/abTest/` in a TypeScript package is product code to both); Python test packages; a `lib/` or `app/` holding its own manifest or below the first segment.
118
+
119
+ Measured against main at d165ce69, both engines built from source:
120
+ - **Reviewer's 46-file fixture:** 8 paths leave product scope. The use cases and env keys that leave the tree are exactly those from `app/src/test`, `app/src/androidTest`, `cypress/e2e`, `lib/test`, `lib/fixtures` (scope on; with `productScope: false` it is a fixture and stays, as designed), `packages/web/lib/test` and `mypkg/tests/helpers.py`. No product route or key moves.
121
+ - **`gradle init` layout:** `modules/app` drops the `AppTest.java` use case, and environment.md drops `TEST_ONLY_KEY`.
122
+ - **android/testing-samples:** 0 → 43 files left out, all tests, and no file outside `src/main` is still read. principles.md's conventions are counted over product code ("try/catch 5/181" goes).
123
+ - **HackSoftware/Django-Styleguide-Example:** 21 files → test. "Factory suffix 5/9; corroborated" is back to "2/2; verified".
124
+ - **ControlDeck:** 8 files leave scope: 4 under `apps/api/lib/fixtures/` (fixture), and `apps/api/lib/test-utils/` and `apps/app/lib/test/` (test). Every spec.md and design.md is identical. `rules.json` changes only `filesAnalyzed` (api 190 → 184, app 367 → 365). `modules/app/principles.md`'s L5 line loses the `UI` that #1104 added from `lib/test/render-app.tsx`. A static scan reads 750 files instead of 756 and gives 3148 findings instead of 3154: the 6 removed are 4 in `lib/fixtures/cortex-admin-fake.ts` (3 CWE-1109) and 2 in `lib/test-utils/gateway-principal.ts`.
125
+ - **No path moves:** cognium-ai's own tree (spec tree and a static scan byte-identical: 523 files, 3674 findings), cortex, pallets/click, spf13/cobra and spring-petclinic.
126
+
127
+ Not changed: `*.e2e.ts` without `.test`/`.spec`, a root `test.js`, a `spec/` folder (Jasmine, RSpec) and a `test/` folder below a package root that is no Python package (`src/feature/test/`) are still product code.
128
+ - **The `repositoryName` option is held to one plain line (review of #1104).** `buildSpecTree` only trimmed it, so `"evil\n\n## Injected heading\n\n- fake use case"` wrote a heading and a bullet into spec.md and principles.md. `plainRepositoryName` drops format characters (`\p{Cf}`: bidi controls including U+061C, zero-width characters, soft hyphen, BOM, tag characters, interlinear annotations), turns controls and line breaks (`\p{Cc}`, `\p{Zl}`, `\p{Zp}`) into spaces, collapses white space, trims, and cuts the result to 214 characters (`MAX_REPOSITORY_NAME_LENGTH`, code points). That example now gives one H1 line, `# Spec — evil ## Injected heading - fake use case`. A name with nothing left (`"\u200d\u200d"` included) falls back to the manifest. A manifest name holding any such character, or longer than 214 characters, is not a name and falls through to the next manifest. The folder-name fallback goes through the same function (`repository` when nothing is left), so a folder named `evil\n## Injected` gives `evil ## Injected`. circle-pack only ever sends `[A-Za-z0-9._-]{1,100}`.
129
+ - **`pom.xml`: the project's own `artifactId`, a direct child of `<project>` (review of #1104).** The reader took the first `<artifactId>` outside `<parent>`, so a pom that lists `<dependencies>` or `<build>` before its own `artifactId` (Maven allows any order) was named after a dependency or a plugin. It now tracks element depth: comments and processing instructions are skipped, and a CDATA name is read. Comments and CDATA are stripped in one pass, so a `<!--` inside a CDATA description swallows nothing. A pom with no `artifactId` of its own, an unclosed one or an empty one is not a name. The same reader names Maven modules (`declaredName`).
130
+ - **Trust inconsistent-naming (cognium-ai#1090 item 9).** In JS/TS files, camelCase is the expected function style; the pass no longer flags camelCase names as inconsistent when snake_case names appear in the same file (snake_case outliers are still reported).
131
+ - **Scan `--all-paths` reaches `test/e2e` trees (cognium-ai#1090 item 7).** `SecurityScanner`'s walk applied its test-tree excludes (`test/**`, nested `.../test/...`, …) even with `productScope: false`, so `--all-paths` still skipped them. They now apply only with product scope on, as the vendor and build default excludes already did; with `productScope: false` only infrastructure folders (`node_modules`, `.git` and the like) stay out.
132
+
133
+ ### Known issues
134
+ - `engines.node` still says `>=18.0.0`, but the model route's `undici` 8 needs Node 22.19 or later. On Node 18 or 20, routed model calls fail closed: they are refused, not sent unguarded. Static analysis is unaffected. Tracked in #1080.
135
+
10
136
  ## [4.37.0] - 2026-11-20
11
137
 
12
138
  Minor, still on circle-ir 4.23.0. It adds fields and options: blast radius `levels`, `useCases` on each learned tree level, and a per-call product-scope switch on trust passes. It also makes static scans deterministic and hardens the model route. No output field is removed or renamed.
@@ -68,6 +68,12 @@ export interface WorkflowOutput {
68
68
  * verifier and omitted from a successful answer. Optional; absent means 0.
69
69
  */
70
70
  findingsRefutedByOmission?: number;
71
+ /**
72
+ * Flow-backed findings the verifier did not confirm (FALSE_POSITIVE,
73
+ * UNCERTAIN or no verdict), kept with `verification.kept_by: 'flow_backed'`
74
+ * because the taint flow is proof. Optional; absent means 0.
75
+ */
76
+ findingsKeptByProof?: number;
71
77
  /** cognium-ai#564 — the failure reason(s), present only when a chunk failed. */
72
78
  verificationError?: string;
73
79
  totalTimeMs: number;
@@ -167,6 +173,16 @@ taintContext?: {
167
173
  * index only; the no-verification findings still come from `mergedSources`.
168
174
  */
169
175
  detectorSources?: any[];
176
+ /**
177
+ * circle-ir's `taint.flows` (from `runPatternMatch`). With it, every
178
+ * finding carries `verification.flow_backed` — true when a flow of the
179
+ * same sink type reaches the sink line, circle-ir's own rule — so the
180
+ * flow-backed tier works in AI mode. Absent (legacy callers): undefined.
181
+ */
182
+ flows?: Array<{
183
+ sink_type: string;
184
+ sink_line: number;
185
+ }>;
170
186
  }): WorkflowOutput;
171
187
  /**
172
188
  * Run security analysis on a single file
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../src/agents/mastra/workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAAoC,GAAG,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQxH,OAAO,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AAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B,yDAAyD;IACzD,cAAc,CAAC,EAAE,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;CACnE,GACA,cAAc,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAA;CAAE,CAAC,CA8F9D;AAGD,eAAO,MAAM,wBAAwB;IACnC,EAAE;IACF,GAAG;IACH,MAAM;CACP,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,MAAM,GAAG,SAAS,EAChC,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,aAAa,EAAE,OAAO,GACrB,MAAM,CAmBR"}
@@ -11,7 +11,7 @@ import { generateFindings, getRuleInfo } from 'circle-ir';
11
11
  import { isPhantomLineSink, isSuppressedSinkShape } from '../../security-scan/sink-filters.js';
12
12
  import { classifySource, classifySourceForVerifier, applyClassificationGate, } from '../../security-scan/source-classifier.js';
13
13
  import { shouldGateInterproceduralParam, classifyEntryPointTier, } from '../../analysis/entry-point-detection.js';
14
- import { getDefaultLLMConfig, isThinkingModel } from '../../llm/config.js';
14
+ import { getDefaultLLMConfig, resolveVerifyPromptMode } from '../../llm/config.js';
15
15
  import { withLLMContext } from '../../llm/debug-context.js';
16
16
  import { activeModelLabel } from '../../llm/model-route.js';
17
17
  import { fileNeedsEnrichment } from '../../llm/pre-filter.js';
@@ -155,6 +155,9 @@ coordinate, dependencyContext) {
155
155
  // cognium-ai#330 — forward calls so enrichment sinks can be anchored in
156
156
  // `runMerge` the same way discovery mode does in `DiscoveryEngine`.
157
157
  calls: (result.calls ?? []),
158
+ // `runReport` stamps `verification.flow_backed` from these, as the
159
+ // static scanner does; without them AI mode had no proven-flow tier.
160
+ flows: (result.taint.flows ?? []).map((f) => ({ sink_type: f.sink_type, sink_line: f.sink_line })),
158
161
  };
159
162
  // cognium-ai#153 — populate persistent tree cache. Disk-write errors
160
163
  // never fail the workflow. #158 Round 2 — coordinate is honored by
@@ -598,7 +601,10 @@ contextProfile) {
598
601
  }.phases.verification.model);
599
602
  // cognium-ai#777 — reasoning models often return `{"pairs":[]}` without assessing
600
603
  // pairs; treating omission as refutation over-labels real findings FALSE_POSITIVE.
601
- const treatOmissionAsRefutation = !isThinkingModel(verifierModel);
604
+ // Under the explicit-all contract (thinking models, or
605
+ // COGNIUM_AI_VERIFY_MODE=explicit-all) a missing pair means "not assessed",
606
+ // and refutation is an explicit FALSE_POSITIVE.
607
+ const treatOmissionAsRefutation = resolveVerifyPromptMode(verifierModel) === 'omit-non-tp';
602
608
  if (!enableVerification || mergedSources.length === 0 || mergedSinks.length === 0) {
603
609
  return {
604
610
  verificationResults: [],
@@ -844,6 +850,19 @@ taintContext) {
844
850
  // still reads C+H). Computed once and shared with the no-verification branch.
845
851
  const effectiveDfg = dfg ?? { defs: [], uses: [], chains: [] };
846
852
  const detectorFindings = generateFindings(mergedSources, mergedSinks, effectiveDfg, filePath, sourceCode, taintContext?.language, taintContext?.sanitizers ?? [], (types ?? []));
853
+ // Same rule as circle-ir's `generateFindings` (findings.ts): backed when a
854
+ // flow of the same sink type reaches the sink line; undefined when no flows
855
+ // were passed ("not asked"), false when they were and none reaches it.
856
+ const flowBackedSinks = new Set((taintContext?.flows ?? [])
857
+ .filter((f) => typeof f.sink_line === 'number')
858
+ .map((f) => `${f.sink_type}@${f.sink_line}`));
859
+ const flowBackedOf = (type, line) => taintContext?.flows === undefined ? undefined : flowBackedSinks.has(`${type}@${line}`);
860
+ const withFlowBacked = (v, type, line) => {
861
+ const fb = flowBackedOf(type, line);
862
+ if (fb === undefined)
863
+ return v;
864
+ return v === null ? { flow_backed: fb } : { ...v, flow_backed: fb };
865
+ };
847
866
  // Severity index: the detector over the merged sources plus the static
848
867
  // sources the #128 gate dropped (see `taintContext.detectorSources`), so a
849
868
  // sink the static scanner reports keeps that severity on the verify path.
@@ -1030,6 +1049,15 @@ taintContext) {
1030
1049
  reasoning_source: hasReasoning ? 'llm' : 'template',
1031
1050
  reasoning: hasReasoning ? reasoning : verification.reasoning,
1032
1051
  };
1052
+ verification = withFlowBacked(verification, sink.type, sink.line);
1053
+ // A finding the static detector never emitted for this sink exists
1054
+ // only because the AI (enrichment + verifier) produced it. Tag it so
1055
+ // scoring can count it apart from verified static findings; kept,
1056
+ // not dropped (see the #264 note above). `graph_path_exists: false`
1057
+ // is not enough on its own: static findings can carry it too.
1058
+ if (detectorSeverity === undefined) {
1059
+ verification = { ...verification, origin: 'ai' };
1060
+ }
1033
1061
  const vuln = {
1034
1062
  id: `vuln:${vr.sourceId}:${vr.sinkId}`,
1035
1063
  // cognium-ai#146 — surface the sink type at the vulnerability
@@ -1148,7 +1176,40 @@ taintContext) {
1148
1176
  };
1149
1177
  const verifiedBranch = verificationEnabled && verificationResults.length > 0;
1150
1178
  const verifiedLocs = new Set(vulnerabilities.map((v) => `${v.sink?.line}:${v.type}`));
1151
- if (!verifiedBranch || failedPairKeys.size > 0) {
1179
+ // Proof beats model. A static finding circle-ir backs with a taint flow
1180
+ // (`flow_backed: true`) is never removed by the verifier: when no verified
1181
+ // finding covers its sink, it is kept and labelled with what the verifier
1182
+ // said (FALSE_POSITIVE, explicit or by omission; UNCERTAIN; or no verdict),
1183
+ // plus `kept_by: 'flow_backed'`. Findings without that proof may still be
1184
+ // refuted away. A pair the verifier confirmed but a gate above dropped
1185
+ // (sink shape, FRAMEWORK_INTERNAL source) is a gate decision, not the
1186
+ // model's, and stays dropped.
1187
+ const verdictByPair = new Map();
1188
+ for (const vr of verificationResults) {
1189
+ const sourceLine = parseInt(String(vr.sourceId).split(':')[1], 10);
1190
+ const sinkLine = parseInt(String(vr.sinkId).split(':')[1], 10);
1191
+ verdictByPair.set(`${sourceLine}:${sinkLine}`, vr.result);
1192
+ }
1193
+ const verdictsOf = (finding) => {
1194
+ const srcs = finding.evidence?.sources ?? [{ line: finding.source.line }];
1195
+ return srcs
1196
+ .map((s) => verdictByPair.get(`${s.line}:${finding.sink.line}`))
1197
+ .filter((r) => r !== undefined);
1198
+ };
1199
+ const keptByProof = (finding) => verifiedBranch &&
1200
+ flowBackedOf(finding.type, finding.sink.line) === true &&
1201
+ !verdictsOf(finding).some((r) => r.verdict === 'TRUE_POSITIVE');
1202
+ const explicitVerdictOf = (finding, verdict) => verdictsOf(finding).find((r) => r.verdict === verdict);
1203
+ const verifierNarrative = (r) => {
1204
+ const reasoning = String(r?.reasoning ?? '').trim();
1205
+ return {
1206
+ reasoning_source: reasoning.length > 0 ? 'llm' : 'template',
1207
+ reasoning: reasoning.length > 0 ? reasoning : 'The LLM verifier gave no reasoning.',
1208
+ confidence: typeof r?.confidence === 'number' ? r.confidence : 0,
1209
+ };
1210
+ };
1211
+ const withProofKeep = (finding, v) => keptByProof(finding) ? { ...v, graph_path_exists: true, kept_by: 'flow_backed' } : v;
1212
+ if (!verifiedBranch || failedPairKeys.size > 0 || taintContext?.flows !== undefined) {
1152
1213
  // #26: No verification — delegate to circle-ir's `generateFindings()`
1153
1214
  // instead of the previous N×M source×sink cross-product.
1154
1215
  //
@@ -1182,10 +1243,10 @@ taintContext) {
1182
1243
  // the FP gap on cognium-ai #90–#94).
1183
1244
  // #264 — reuse the detector index computed once above (parity gate shares it).
1184
1245
  // cognium-ai#564 — on the verified branch only the failed-chunk pairs'
1185
- // findings are emitted here, and never one whose sink already carries a
1186
- // verified finding.
1246
+ // findings (and the flow-backed ones kept by proof, above) are emitted
1247
+ // here, and never one whose sink already carries a verified finding.
1187
1248
  const findings = verifiedBranch
1188
- ? detectorFindings.filter((f) => hitsFailedPair(f) && !verifiedLocs.has(`${f.sink.line}:${f.type}`))
1249
+ ? detectorFindings.filter((f) => (hitsFailedPair(f) || keptByProof(f)) && !verifiedLocs.has(`${f.sink.line}:${f.type}`))
1189
1250
  : detectorFindings;
1190
1251
  // Map circle-ir Finding[] back into the legacy workflow vulnerability
1191
1252
  // shape so existing consumers (cognium-ai CLI, circle-pack API) don't
@@ -1254,9 +1315,9 @@ taintContext) {
1254
1315
  // says the verifier never answered, so downstream keeps the static
1255
1316
  // exploitability and severity (fail open) instead of treating the
1256
1317
  // finding as refuted.
1257
- verification: !verificationEnabled
1318
+ verification: withFlowBacked(!verificationEnabled
1258
1319
  ? null // pure static path — no LLM verification attempted
1259
- : hitsFailedPair(finding)
1320
+ : withProofKeep(finding, hitsFailedPair(finding)
1260
1321
  ? {
1261
1322
  verdict: 'UNVERIFIED',
1262
1323
  attempted: true,
@@ -1264,25 +1325,47 @@ taintContext) {
1264
1325
  mode: 'attempted',
1265
1326
  verification_error: verificationError ?? 'verification_chunk_failed',
1266
1327
  }
1267
- : refutedByOmission(finding)
1328
+ : explicitVerdictOf(finding, 'FALSE_POSITIVE')
1268
1329
  ? {
1269
- // cognium-ai#471 — the verifier answered, and its answer
1270
- // (per the batch prompt's omit-non-TP contract) is "not a
1271
- // true positive". Kept, not dropped: dropping would change
1272
- // recall on every LLM scan, which is a product decision;
1273
- // labelling it lets consumers see the refutation.
1330
+ // The verifier refuted a pair behind this finding explicitly
1331
+ // (explicit-all contract). Only reached for a finding kept
1332
+ // by proof; without a flow the refutation drops it.
1274
1333
  verdict: 'FALSE_POSITIVE',
1275
1334
  attempted: true,
1276
1335
  llm_verified: false,
1277
1336
  mode: 'llm',
1278
- refuted_by: 'omission',
1279
- reasoning_source: 'template',
1280
- reasoning: 'Submitted to the LLM verifier, which did not confirm it: the batch verifier ' +
1281
- 'omits every pair it does not judge a TRUE_POSITIVE (cognium-ai#471).',
1282
- confidence: 0,
1337
+ refuted_by: 'verifier',
1338
+ ...verifierNarrative(explicitVerdictOf(finding, 'FALSE_POSITIVE')),
1283
1339
  exploitability: 'none',
1284
1340
  }
1285
- : { verdict: 'UNVERIFIED', attempted: true, llm_verified: false, mode: 'attempted' }, // #331 three-state
1341
+ : verdictsOf(finding).length === 0 && refutedByOmission(finding)
1342
+ ? {
1343
+ // cognium-ai#471 — the verifier answered, and its answer
1344
+ // (per the batch prompt's omit-non-TP contract) is "not a
1345
+ // true positive". Kept, not dropped: dropping would change
1346
+ // recall on every LLM scan, which is a product decision;
1347
+ // labelling it lets consumers see the refutation.
1348
+ verdict: 'FALSE_POSITIVE',
1349
+ attempted: true,
1350
+ llm_verified: false,
1351
+ mode: 'llm',
1352
+ refuted_by: 'omission',
1353
+ reasoning_source: 'template',
1354
+ reasoning: 'Submitted to the LLM verifier, which did not confirm it: the batch verifier ' +
1355
+ 'omits every pair it does not judge a TRUE_POSITIVE (cognium-ai#471).',
1356
+ confidence: 0,
1357
+ exploitability: 'none',
1358
+ }
1359
+ : explicitVerdictOf(finding, 'UNCERTAIN')
1360
+ ? {
1361
+ verdict: 'UNCERTAIN',
1362
+ attempted: true,
1363
+ llm_verified: false,
1364
+ mode: 'llm',
1365
+ ...verifierNarrative(explicitVerdictOf(finding, 'UNCERTAIN')),
1366
+ }
1367
+ : { verdict: 'UNVERIFIED', attempted: true, llm_verified: false, mode: 'attempted' }), // #331 three-state
1368
+ finding.type, finding.sink.line),
1286
1369
  // #26: surface the provenance label so downstream consumers
1287
1370
  // (cognium-ai CLI output, SARIF emitter) can distinguish
1288
1371
  // static-only / LLM-only / mixed findings without re-deriving.
@@ -1311,6 +1394,9 @@ taintContext) {
1311
1394
  // cognium-ai#471 — findings kept with `verdict: 'FALSE_POSITIVE'`
1312
1395
  // because the verifier omitted (refuted) every pair behind them.
1313
1396
  findingsRefutedByOmission: vulnerabilities.filter((v) => v.verification?.refuted_by === 'omission').length,
1397
+ // Flow-backed findings the verifier did not confirm, kept because the
1398
+ // taint flow is proof (`kept_by: 'flow_backed'`).
1399
+ findingsKeptByProof: vulnerabilities.filter((v) => v.verification?.kept_by === 'flow_backed').length,
1314
1400
  ...(verificationError !== undefined ? { verificationError } : {}),
1315
1401
  totalTimeMs: patternMatchTimeMs + enrichTimeMs + verifyTimeMs,
1316
1402
  },
@@ -1418,7 +1504,12 @@ export async function analyzeFile(filePath, sourceCode, options) {
1418
1504
  treatOmissionAsRefutation: verifyResult.treatOmissionAsRefutation,
1419
1505
  },
1420
1506
  // cognium-ai#460 — full generateFindings argument list.
1421
- { language, sanitizers: patternResult.sanitizers, detectorSources: patternResult.patternSources });
1507
+ {
1508
+ language,
1509
+ sanitizers: patternResult.sanitizers,
1510
+ detectorSources: patternResult.patternSources,
1511
+ flows: patternResult.flows,
1512
+ });
1422
1513
  // cognium-ai#154 (L5c) — surface the cluster vector extracted while the
1423
1514
  // IR was live in `runPatternMatch`. Keeps `runReport`'s signature
1424
1515
  // untouched (its job is source×sink → vuln synthesis; the vector is
@@ -1475,7 +1566,12 @@ export async function* analyzeFileStream(filePath, sourceCode, options) {
1475
1566
  treatOmissionAsRefutation: verifyResult.treatOmissionAsRefutation,
1476
1567
  },
1477
1568
  // cognium-ai#460 — full generateFindings argument list.
1478
- { language, sanitizers: patternResult.sanitizers, detectorSources: patternResult.patternSources });
1569
+ {
1570
+ language,
1571
+ sanitizers: patternResult.sanitizers,
1572
+ detectorSources: patternResult.patternSources,
1573
+ flows: patternResult.flows,
1574
+ });
1479
1575
  yield { step: 'report', status: 'completed', data: reportResult };
1480
1576
  }
1481
1577
  // Legacy export for compatibility