Commit 76a0217
committed
feat(panicbot): teach translator about panic-attack v2.5.5 test_context
panic-attack v2.5.5 (#102 + #110, merged 2026-06-02) added a
test_context field to AssailReport.weak_points. Possible values:
"production" / "test_only" / "doc" / null (pre-v2.5.5 reports).
This PR wires panicbot to consume the field:
scanner.rs:
- WeakPoint gains `test_context: Option<String>` with
`#[serde(default)]`. JSON without the field deserialises with
None — fully backward compatible with pre-v2.5.5 panic-attack.
translator.rs translate_all:
- After the existing suppressed-drop, also drop findings whose
test_context is "test_only" or "doc". This is DEFENSIVE:
panic-attack's apply_v255_context_suppression typically sets
suppressed=true for these already, but a future scanner version
that preserves suppressed=false while classifying TestOnly should
still not have those findings reach the fleet. Test code is not
fleet-actionable.
- Production / None pass through normally.
5 new translator unit tests:
* test_only drops even when suppressed=false
* doc drops even when suppressed=false
* production keeps
* None (pre-v2.5.5) keeps (treated as production)
* suppressed=true drops regardless of test_context
All 11 existing WeakPoint construction sites in panicbot updated
with `test_context: None` defaults for the new field.
Backward compat: panic-attack reports lacking test_context (older
panic-attack versions) deserialise cleanly via #[serde(default)] and
route through the production path.
Forward compat: when panic-attack adds the other v2.5.5 sidecars
(ffi_kind / jit_context) to AssailReport JSON, follow the same
pattern — Option<String> field with serde(default), then translator
decisions keyed on the value.
42 lib tests pass (37 baseline + 5 new test_context tests).1 parent b2fbe4c commit 76a0217
4 files changed
Lines changed: 113 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
74 | 85 | | |
75 | 86 | | |
76 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
403 | 413 | | |
404 | 414 | | |
405 | 415 | | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
406 | 422 | | |
407 | 423 | | |
408 | 424 | | |
| |||
498 | 514 | | |
499 | 515 | | |
500 | 516 | | |
| 517 | + | |
501 | 518 | | |
502 | 519 | | |
503 | 520 | | |
| |||
522 | 539 | | |
523 | 540 | | |
524 | 541 | | |
| 542 | + | |
525 | 543 | | |
526 | 544 | | |
527 | 545 | | |
| |||
541 | 559 | | |
542 | 560 | | |
543 | 561 | | |
| 562 | + | |
544 | 563 | | |
545 | 564 | | |
546 | 565 | | |
| |||
563 | 582 | | |
564 | 583 | | |
565 | 584 | | |
| 585 | + | |
566 | 586 | | |
567 | 587 | | |
568 | 588 | | |
| |||
571 | 591 | | |
572 | 592 | | |
573 | 593 | | |
| 594 | + | |
574 | 595 | | |
575 | 596 | | |
576 | 597 | | |
| |||
596 | 617 | | |
597 | 618 | | |
598 | 619 | | |
| 620 | + | |
599 | 621 | | |
600 | 622 | | |
601 | 623 | | |
| |||
607 | 629 | | |
608 | 630 | | |
609 | 631 | | |
| 632 | + | |
610 | 633 | | |
611 | 634 | | |
612 | 635 | | |
| |||
643 | 666 | | |
644 | 667 | | |
645 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
646 | 740 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| 68 | + | |
64 | 69 | | |
65 | 70 | | |
66 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
310 | 312 | | |
311 | 313 | | |
312 | 314 | | |
| 315 | + | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
| |||
0 commit comments