Skip to main content

Module redos

Module redos 

Source
Expand description

The pattern-safety chain: the full port of the reference’s ReDoS defenses (guard_core/detection_engine/_redos_*).

Module map (reference -> port):

Reference modulePort
_redos_structural_prefilters.pyprefilters
_redos_structure_primitives.py / _redos_structure_rules.py / _redos_structure.pystructure
_redos_unreachable_terminator.pyunreachable_terminator
_redos_literal_in_wildcard.pyliteral_in_wildcard
_redos_ambiguous_tail.pyambiguous_tail
_redos_intervals.pyintervals
_redos_ignorecase_fold.pyfold
re._parser (op tree)ast
_redos_parse_slots.pyparse_slots
category predicate scancategories
_redos_exact_state.pyexact_state
_redos_class_intersection.pyclass_intersection
_redos_repeat_alphabet.pyrepeat_alphabet
_redos_repeat_prefix_state.pyrepeat_prefix_state
_redos_prefix_history.pyprefix_history
_redos_repeat_lookbehind.pyrepeat_lookbehind
_redos_repeat_prefix.pyrepeat_prefix
_redos_repeat_units.pyrepeat_units
_redos_stray_chooser.pystray_chooser
_redos_reach_probe.pyreach_probe
_redos_probe_batches.pyprobe_batches
_redos_probe_fill.pyprobe_fill
_redos_cost_arbiter.pycost_arbiter
the python -c child scriptschild
compiler.validate_pattern_safetysafety

Re-exports§

pub use safety::SafetyMode;
pub use safety::SafetyReason;
pub use safety::SafetyVerdict;
pub use safety::StructuralRule;
pub use safety::default_flags;
pub use safety::validate_pattern_safety;
pub use safety::validate_pattern_safety_compat;
pub use safety::validate_pattern_safety_with_flags;

Modules§

ambiguous_tail
Ambiguous optional tail detection and atom character semantics.
ast
Python re-flavor pattern parser.
categories
Unicode category intervals for the ReDoS pattern-safety chain.
child
Killable probe subprocesses.
class_intersection
Cross-atom class-intersection probe units.
cost_arbiter
The empirical cost arbiter: budget ladder, host-load normalization, stride sampling, and retry-once verdicts over killable timing children.
exact_state
Exact-state narrowing for group crossings.
fold
Case-fold expansion for IGNORECASE interval computation.
intervals
Dense interval sets over the Unicode code-point range.
literal_in_wildcard
Quantified-class literal absorption detection.
literal_runs
Adversarial literal run extraction.
parse_slots
Slot decomposition of a parsed pattern.
prefilters
Pattern-safety dispatcher: dangerous constructs and the five structural detectors, in the reference decision order.
prefix_history
History-observability and repeat containment over the op tree.
probe_batches
Probe-set digests, timing validation, and batch measurement.
probe_fill
Reach-probe candidate builders: every repeatable adversarial trigger family the chain can extract from a pattern.
reach_probe
Reaching probe synthesis: build a concrete string that reaches every quantified region of the pattern.
repeat_alphabet
Repeated-alphabet fills and large bounded repeat detection.
repeat_lookbehind
Negative-lookbehind handling for the prefix walk.
repeat_prefix
The prefix walk: consumes parsed ops from the empty state and yields the reachable prefix states, recording reaching prefixes for repeated bodies.
repeat_prefix_state
Prefix-walk state machine shared by the repeat-prefix machinery.
repeat_units
Repeat-site (prefix, unit) extraction for group probes.
safety
The pattern-safety verdict API.
stray_chooser
Stray character selection with child-verified forcing points.
structure
String-level structural analysis primitives and the nested/adjacent unbounded-quantifier rules.
timeout
The BuilderTimeout error: the port of the reference’s TimeoutError raised by every deadline and budget guard in the probe builders.
unreachable_terminator
Broad-scan unreachable-terminator detection.
validation_cache
The disk-backed cache for the pattern-safety validator’s expensive layer: the reference _validation_cache.py (the PHP lane’s Detection/Redos/ValidationCache.php and the TS PatternValidationCache port the same module).