Commit 7f2e05d
authored
feat(panicbot): teach translator about panic-attack v2.5.5 test_context (#252)
## Summary
panic-attack v2.5.5 (#102 + #110, merged earlier 2026-06-02) added a
`test_context` field to `AssailReport.weak_points`. This PR wires
panicbot's translator to consume it.
## Behaviour
| `suppressed` | `test_context` | Outcome |
|---|---|---|
| `true` | (any) | Drop (existing behaviour) |
| `false` | `"test_only"` | **Drop** (new — defensive) |
| `false` | `"doc"` | **Drop** (new — defensive) |
| `false` | `"production"` | Route to fleet (existing) |
| `false` | `null` (pre-v2.5.5 report) | Route to fleet (backward
compat) |
## Why defensive
panic-attack's `apply_v255_context_suppression` already sets
`suppressed: true` for TestOnly/Doc findings. The defensive double-check
ensures that:
1. If a future panic-attack release decides to preserve `suppressed:
false` while still classifying as TestOnly (e.g. to surface them in
audit-trail mode), the fleet doesn't inadvertently start chasing
test-code findings.
2. If a TestOnly finding slips through some other code path, this is the
safety net.
## Backward compatibility
`#[serde(default)]` on the new field — old panic-attack reports without
the field deserialise cleanly to `None` and route as production. **No
fleet ops disruption when scanning against older panic-attack
installs.**
## Verification
- `cargo build --release`: clean
- `cargo test --release --lib`: **42 pass / 0 fail** (37 baseline + 5
new tests covering all combinations)
## Forward compat
When panic-attack surfaces `ffi_kind` / `jit_context` in JSON (currently
only `test_context` is on `WeakPoint` itself; the other two are
classifier-only), follow the same pattern:
- Add `Option<String>` field on scanner's `WeakPoint`
- Add `#[serde(default)]`
- Translator decisions keyed on the value
## Refs
- panic-attack#102 (test_context foundation)
- panic-attack#110 (analyzer wire-up — sets the field)
- panic-attack#112 (docs closeout — documents the cross-repo wiring
need)1 parent b2fbe4c commit 7f2e05d
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