Expand description
Tiered request escalation port — decide when to escalate from plain HTTP to browser Tiered request escalation port.
Defines the EscalationPolicy trait for deciding when and how to
escalate a failed request from a lightweight tier (plain HTTP) to a
heavier one (TLS-profiled HTTP, basic browser, advanced browser).
This is a pure domain concept — no I/O, no adapter imports. Concrete policies are implemented in adapter modules (see T19).
§Tiers
| Tier | Description |
|---|---|
HttpPlain | Standard HTTP client, no stealth |
HttpTlsProfiled | HTTP with TLS fingerprint matching |
BrowserBasic | Headless browser with basic stealth |
BrowserAdvanced | Full stealth browser (CDP fixes, JS patches) |
§Example
use stygian_graph::ports::escalation::{
EscalationPolicy, EscalationTier, ResponseContext,
};
struct AlwaysEscalate;
impl EscalationPolicy for AlwaysEscalate {
fn initial_tier(&self) -> EscalationTier {
EscalationTier::HttpPlain
}
fn should_escalate(
&self,
ctx: &ResponseContext,
current: EscalationTier,
) -> Option<EscalationTier> {
current.next()
}
fn max_tier(&self) -> EscalationTier {
EscalationTier::BrowserAdvanced
}
}
let policy = AlwaysEscalate;
assert_eq!(policy.initial_tier(), EscalationTier::HttpPlain);Structs§
- Escalation
Result - The outcome of a tiered escalation run.
- Response
Context - Contextual information about an HTTP response used by
EscalationPolicy::should_escalateto decide whether to move to a higher tier.
Enums§
- Escalation
Tier - A request-handling tier, ordered from cheapest to most expensive.
Traits§
- Escalation
Policy - Port trait for tiered request escalation.