1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Rulepack-driven sanitizer-tag-to-sink-tag credit.
//!
//! Pure data: given a sanitizer's `tag` and a sink's `tag`, decide
//! whether the sanitizer's filtering applies to that sink. The answer
//! does NOT mean the value is safe — it means the developer attempted
//! to filter for the right context. Findings whose chain has a
//! credited sanitizer are surfaced as `status: sanitized` (review for
//! bypass), per `security-spec.mdx`.
//!
use crateRulepackMetadata;
/// True when a sanitizer with `san_tag` clears a sink with `sink_tag`.
///
/// Decision order:
/// 1. If either tag is absent, return `false` (no claim either way).
/// 2. If they match exactly, return `true` — same-class credit.
/// 3. If rulepack metadata maps `san_tag` to `sink_tag`, return
/// `true` — cross-tag credit.
/// 4. Otherwise `false` — wrong-context case.
pub
/// True when `san_tag` is a vocabulary entry the engine recognises but
/// whose credit list is intentionally empty. Status assembly uses this to
/// avoid mis-classifying rulepack-declared passthrough or inventory markers
/// as `WrongContext`: they made no claim of clearing taint to begin with, so
/// a chain that only contains them stays `Unsanitized`.
pub