Validation¶
Structural validation and the deterministic confidence heuristic.
Confidence is not a probability and it is not a model score. It is a fixed function of the type, the validation result, and noise tags. The same indicator always receives the same score.
Functions:
-
ipv4_class–Classify an IPv4 address the way the sieve tags noise.
-
ipv6_tags–Return a single noise tag for an IPv6 address, or an empty tuple.
-
validation_notes–Return reason codes for a normalized value. Empty means structurally valid.
-
domain_notes–Validate a host name against label rules and the bundled TLD list.
-
confidence_for–Score an indicator from its validation result and noise tags.
ipv4_class
¶
ipv6_tags
¶
ipv6_tags(address: IPv6Address) -> tuple[str, ...]
Return a single noise tag for an IPv6 address, or an empty tuple.
Tags come from :mod:ipaddress: loopback, link-local, multicast, private
(unique-local), then reserved or unspecified.
validation_notes
¶
domain_notes
¶
confidence_for
¶
Score an indicator from its validation result and noise tags.
The result is rounded to two decimals and clamped to 0.01-0.99.
- Invalid:
0.25 - Validation skipped:
0.55 - Valid:
0.80 - Tagged IP, IPv6, or CIDR: subtract
0.15 - Valid untagged IP or IPv6: add
0.10 - Valid hash, JA3, JA3S, or JARM: add
0.10
Parameters:
-
kind(str) –Type key.
-
valid(bool | None) –Validation result, or
Nonewhen validation did not run. -
tags(tuple[str, ...]) –Noise tags.
Returns:
-
float–A heuristic score. It is not a probability.