Commit 7c99cf8
chore: apply audit batch (lint repair + SEO/map + evaluator + docs) (#5818)
## Summary
Five quick-win items from `agentic/audits/latest.md` (2026-05-05):
1. **Frontend lint CI repair** — 32 errors → 0 (audit Critical #1).
2. **`/seo-proxy/map`** — bot prerender for the network map (audit
Critical #5 partial).
3. **evaluate-plot.py** — switch to canonical 6-category rubric + bump
model default (audit High #2).
4. **plausible.md** — document FCP/TTFB Web-Vitals events (audit High
#3).
5. **CodeQL #101** — already user-dismissed 2026-05-05; called out in PR
body, no code change.
## Detail
### 1. Lint repair (`yarn lint` 32→0 errors)
- `app/eslint.config.js`: added `IdleRequestCallback`, `IdleDeadline`,
`IdleCallbackHandle`, `IdleRequestOptions`, `requestIdleCallback`,
`cancelIdleCallback`, `FrameRequestCallback`,
`IntersectionObserverCallback`, `IntersectionObserverInit`,
`IntersectionObserverEntry` to production globals; added Node `global`
to test-entry globals.
- 5× `react-hooks/set-state-in-effect`: refactored to React 19's "adjust
state on prop change" pattern (`if (prev !== current) {
setPrev(current); ... }` during render — no cascading re-render):
- `RelatedSpecs.tsx` — combined `setExpanded(false)` +
`setLoading(true)` resets into a single `prevDeps` guard.
- `SpecDetailView.tsx` — interactive size reset on `selectedLibrary`
change.
- `DebugPage.tsx` — `setLoading(true)/setError(null)` reset on
`[adminToken, reloadCounter]` change.
- `SpecsListPage.tsx` — random rotation init driven by
`Object.keys(rotationIndex).length === 0` guard (reference-compare on
`specList` was attempted first but trips an infinite re-render in the
test mock, which returns a fresh `specsData` array each call).
- 1× `react-hooks/purity`: `Math.random` in `useFeaturedSpecs.ts`
extracted into a module-level `pickRandom<T>(items)` helper.
- 3× `no-empty`: sessionStorage swallows in `DebugPage.tsx` annotated
with a comment.
- 1× unused var `implNoPreview` (`SpecOverview.test.tsx`): now used in
the test (was a copy-paste oversight).
- 1× unused eslint-disable (`MapPage.test.tsx:413`) removed.
### 2. SEO `/map` handler
Mirrors the about/palette pattern in `api/routers/seo.py`. Bots now get
a real `<title>` (`Network Map | anyplot.ai`) and a meta description.
### 3. evaluate-plot.py modernization
- Replace inline 5-category JSON template (Visual Quality 40 / Spec
Compliance 25 / Data Quality 20 / Code Quality 10 / Library Features 5)
with the canonical 6-category rubric driven by
`prompts/quality-evaluator.md` + `prompts/quality-criteria.md` (Visual
Quality 30 / Design Excellence 20 / Spec Compliance 15 / Data Quality 15
/ Code Quality 10 / Library Mastery 10 = 100).
- `print_quality_result` and the `--verbose` loop updated to the new
keys + denominators (was reading `library_features` / `vq…/40` etc., now
reads `library_mastery` / `vq…/30`).
- `core/config.py`: `claude_model` default bumped from
`claude-3-5-sonnet-20240620` (18 months old) to `claude-sonnet-4-6`.
### 4. Plausible docs (FCP/TTFB)
`docs/reference/plausible.md`: added FCP and TTFB rows to Custom Events
table + Implementation Checklist; bumped total client-side events from
28 → 30.
> 1 parent b2fb3fc commit 7c99cf8
13 files changed
Lines changed: 127 additions & 111 deletions
File tree
- api/routers
- app
- src
- components
- hooks
- pages
- core
- docs/reference
- scripts
- tests/unit/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
263 | 279 | | |
264 | 280 | | |
265 | 281 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
72 | 84 | | |
73 | 85 | | |
74 | 86 | | |
| |||
102 | 114 | | |
103 | 115 | | |
104 | 116 | | |
| 117 | + | |
105 | 118 | | |
106 | 119 | | |
107 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
58 | | - | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
136 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
140 | | - | |
| 142 | + | |
141 | 143 | | |
142 | 144 | | |
143 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 151 | + | |
155 | 152 | | |
156 | 153 | | |
157 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
60 | 65 | | |
61 | 66 | | |
62 | 67 | | |
63 | | - | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
210 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
211 | 217 | | |
212 | 218 | | |
213 | 219 | | |
214 | 220 | | |
215 | 221 | | |
216 | 222 | | |
217 | | - | |
| 223 | + | |
218 | 224 | | |
219 | 225 | | |
220 | 226 | | |
| |||
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
245 | | - | |
| 251 | + | |
246 | 252 | | |
247 | | - | |
| 253 | + | |
248 | 254 | | |
249 | 255 | | |
250 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
413 | | - | |
414 | 413 | | |
415 | 414 | | |
416 | 415 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | 36 | | |
| |||
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
0 commit comments