Commit ddd82c0
authored
fix(diagnostics): make the trace answer the question it exists for (#122)
Three defects, all found by reading a customer's capture of a failing
ChatGPT connection rather than by reading the code.
The panel recorded its own polling. targets_mcp() was a bare strpos()
prefix test and the admin API shares the saddle/v1 namespace, so
/saddle/v1/mcp-diagnostics matched — and the panel polls it every five
seconds while recording. At 25 entries the ring buffer therefore turned
over every ~125 seconds. The capture that arrived spanned 114 seconds and
held two real rows among twenty-three of the panel watching itself. The
instrument was evicting the evidence it exists to collect. Matched
exactly now, and the buffer raised to 100 for margin.
The credential scheme was recorded and rendered nowhere. Every row has
carried Saddle_Connection::credential_scheme() since the recorder
shipped; neither report() nor the table printed it. So the one field that
distinguishes "the key was rejected" from "no key arrived" — a 401 either
way, and opposite fixes — was written to the option and shown to no one,
and a customer had to ask us what his own trace already knew. Now first
on the row, ahead of session and protocol, which are trivia by
comparison. Paired with an explicit auth present/absent/unknown, because
'' and 'unknown' are different answers and neither is "present".
And the HTTP method is recorded, so a row carrying no MCP method is no
longer ambiguous between a GET, a POST with the wrong content type, and
an empty body.
The credential-leak test was passing for the wrong reason: it set an
Authorization header on a synthetic WP_REST_Request, which populates no
$_SERVER, so the recorder never saw a credential to leak. The helper now
sets both, which is what made the two new scheme assertions meaningful —
and what proves the existing assertion was load-bearing rather than
vacuous.
Closes #1201 parent bdb7ff9 commit ddd82c0
6 files changed
Lines changed: 176 additions & 14 deletions
File tree
- admin
- build
- src/components
- includes
- languages
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
190 | 191 | | |
191 | 192 | | |
192 | 193 | | |
| |||
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
205 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
206 | 225 | | |
207 | 226 | | |
208 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
76 | 83 | | |
77 | | - | |
| 84 | + | |
78 | 85 | | |
79 | 86 | | |
80 | 87 | | |
| |||
283 | 290 | | |
284 | 291 | | |
285 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
286 | 317 | | |
287 | 318 | | |
| 319 | + | |
288 | 320 | | |
289 | 321 | | |
290 | 322 | | |
291 | | - | |
| 323 | + | |
| 324 | + | |
292 | 325 | | |
293 | 326 | | |
294 | 327 | | |
| |||
430 | 463 | | |
431 | 464 | | |
432 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
433 | 470 | | |
434 | 471 | | |
435 | | - | |
| 472 | + | |
436 | 473 | | |
| 474 | + | |
437 | 475 | | |
| 476 | + | |
| 477 | + | |
438 | 478 | | |
439 | 479 | | |
440 | 480 | | |
| |||
483 | 523 | | |
484 | 524 | | |
485 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
486 | 534 | | |
487 | 535 | | |
488 | 536 | | |
489 | 537 | | |
490 | | - | |
| 538 | + | |
| 539 | + | |
491 | 540 | | |
492 | | - | |
| 541 | + | |
493 | 542 | | |
494 | 543 | | |
495 | 544 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
5331 | 5331 | | |
5332 | 5332 | | |
5333 | 5333 | | |
5334 | | - | |
| 5334 | + | |
5335 | 5335 | | |
5336 | 5336 | | |
5337 | 5337 | | |
| 5338 | + | |
| 5339 | + | |
| 5340 | + | |
| 5341 | + | |
5338 | 5342 | | |
5339 | 5343 | | |
5340 | 5344 | | |
| 5345 | + | |
| 5346 | + | |
| 5347 | + | |
| 5348 | + | |
5341 | 5349 | | |
5342 | | - | |
| 5350 | + | |
5343 | 5351 | | |
5344 | 5352 | | |
5345 | 5353 | | |
5346 | 5354 | | |
5347 | | - | |
| 5355 | + | |
5348 | 5356 | | |
5349 | 5357 | | |
5350 | 5358 | | |
5351 | 5359 | | |
5352 | | - | |
| 5360 | + | |
5353 | 5361 | | |
5354 | 5362 | | |
5355 | 5363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
63 | 73 | | |
64 | 74 | | |
65 | 75 | | |
| |||
171 | 181 | | |
172 | 182 | | |
173 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
174 | 260 | | |
175 | 261 | | |
176 | 262 | | |
| |||
0 commit comments