Commit 18e08b2
authored
feat(frameworks): wire stage-3 config-AST evidence into detection (#264)
## Summary
Wires framework-detection **stage 3 (config-AST)** into the production
path. This was the documented-deferred near-miss flagged by the
latent-bug sweep: `inspectConfigAst` (handles `next.config.*`,
`astro.config.*`, `vite.config.*`, `META-INF/spring.factories`) shipped
as a tested standalone module but had **zero production callers** — the
dispatcher input couldn't carry config text, so its evidence never
reached `frameworksDetected`.
## What changed
- `FrameworkDetectorInput` gains optional `configText`. The dispatcher
runs `inspectConfigAst` once, groups findings by framework name, and
merges them as **stage-3 evidence** into a detection that already hit on
a manifest/layout signal.
- **Corroborates, never creates:** config text alone does not conjure a
detection (a repo can vendor a config without using the framework). A
stage-3 finding only attaches when stages 1/4 already fired for that
framework.
- `frameworks.ts` pre-reads `CONFIG_AST_FILES` alongside
manifests/lockfiles and threads `configText` through both entrypoints,
so the profile phase picks it up with **no phase-ordering change**.
Legacy callers that omit `configText` are unaffected (verified by a
no-op test).
## Verification
- End-to-end: `analyze` on a Next.js repo now records the nextjs
detection with evidence stages **[1, 3, 4]** — stage 3 contributing
`next.config present` + `nextjs router: app-router` (previously only [1,
4]).
- New tests: stage-3 evidence merges into nextjs; config-text-alone does
**not** create a detection (using `spring.factories`, which is not a
catalog file-marker); omitting `configText` is a no-op.
- frameworks 92 + ingestion 638 tests green; full workspace 0 failures;
`biome ci` clean.
## Deferred: stage 5 (imports / SCIP)
Stage 5 consumes resolved `IMPORTS` edges, but the profile phase runs
(`deps: [scan]`) **before** `crossFile` resolves them. Wiring it needs a
phase-ordering change (run framework detection after `crossFile`, or add
a later detection pass). Documented in the package header as the
remaining step — out of scope here to avoid a DAG change in this PR.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent dde590e commit 18e08b2
4 files changed
Lines changed: 158 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| 38 | + | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| |||
799 | 801 | | |
800 | 802 | | |
801 | 803 | | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| |||
85 | 95 | | |
86 | 96 | | |
87 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
88 | 103 | | |
89 | 104 | | |
90 | 105 | | |
91 | 106 | | |
92 | | - | |
| 107 | + | |
93 | 108 | | |
94 | 109 | | |
95 | 110 | | |
| |||
104 | 119 | | |
105 | 120 | | |
106 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
107 | 142 | | |
108 | 143 | | |
109 | 144 | | |
| |||
128 | 163 | | |
129 | 164 | | |
130 | 165 | | |
| 166 | + | |
131 | 167 | | |
132 | 168 | | |
133 | 169 | | |
| |||
173 | 209 | | |
174 | 210 | | |
175 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
176 | 222 | | |
177 | 223 | | |
178 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
112 | 136 | | |
113 | 137 | | |
114 | 138 | | |
| |||
128 | 152 | | |
129 | 153 | | |
130 | 154 | | |
131 | | - | |
| 155 | + | |
132 | 156 | | |
133 | 157 | | |
| 158 | + | |
134 | 159 | | |
135 | 160 | | |
136 | 161 | | |
137 | 162 | | |
138 | 163 | | |
| 164 | + | |
139 | 165 | | |
140 | 166 | | |
141 | 167 | | |
| |||
151 | 177 | | |
152 | 178 | | |
153 | 179 | | |
154 | | - | |
| 180 | + | |
155 | 181 | | |
156 | 182 | | |
| 183 | + | |
157 | 184 | | |
158 | 185 | | |
159 | 186 | | |
160 | 187 | | |
161 | 188 | | |
| 189 | + | |
162 | 190 | | |
163 | 191 | | |
164 | 192 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
0 commit comments