Commit 1491ffe
feat: implement Phase R Wave 3 — R.7 hot-path column usage analysis and R.8 unhandled DB call detection
- ColumnUsageAnalyzer (R.7): TypeScript AST analyzer that tracks SELECT * hot paths
per source line, identifies which fields are actually accessed (map/forEach/filter
callbacks, rows[0].field access, destructuring), and emits hot-path-select-star
anomalies with specific column lists instead of generic suggestions. Supports
rows[n].field element access chains. Auto-wired in db profile for dev/test via
profile-factory.
- SourceAnalyzer.scanForUnhandledDbCall (R.8): Walks TypeScript source files to find
DB calls without try/catch or .catch() chains. Default severity info; escalates to
critical when the source line appears in a crashed-lines set from CrashGuard.
Integrated into StaticScanner.scan() via runUnhandledDbCallScan().
- 601 tests, 0 TS errors, 0 ESLint errors, Prettier clean.
- Demo app: added /debug/hot-select-star (R.7) and /debug/r8-info (R.8) routes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 52b32e6 commit 1491ffe
17 files changed
Lines changed: 1224 additions & 83 deletions
File tree
- packages/agent
- src
- analysis
- internal
- tests
- analysis
- fixtures
- column-usage
- src
- unhandled-db-call
- src
- unhandled-db-clean
- src
- quotes-demo-app/routes
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
13 | 36 | | |
14 | 37 | | |
15 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
729 | 729 | | |
730 | 730 | | |
731 | 731 | | |
732 | | - | |
| 732 | + | |
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
| 736 | + | |
736 | 737 | | |
737 | 738 | | |
738 | 739 | | |
| |||
0 commit comments