You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Restore green pytest suite after dropped-cookie + always-mint drift
The 30+ pytest failures across the wider suite all traced back to
two upstream behavior changes:
1. The new dropped-cookie heuristic (commit bfe3044) adds +25 to
the score on cookieless requests once the IP is in the Bloom
filter. Pre-existing tests using scraper-shaped or no UAs were
implicitly relying on the score staying below silent threshold.
The new heuristic, combined with the 2026 change that flips the
interstitial response from 200 OK to 403 Forbidden, made any
"request that wasn't blocked by the rule under test" fall into
the challenge-tier 403 path the test couldn't distinguish from
real enforcement.
2. The always-mint cookie design (commit f385c9a) emits a fresh
__Host-bs_session on every pass through the handler, including
pass-tier first visits that previously had cookie=absent in the
decision log. Tests that asserted absent / missing now see
minted.
Three categories of fix applied:
a. Heuristic neutralizer in policy/rule tests. Injected
`BotShieldScoreSilent 500\nBotShieldScoreHard 600\n
BotShieldScoreCaptcha 700` into the config_override blocks of
test_policy, test_robots, test_rate_limit_escalate,
test_cookie_triggers, test_multi_vhost, test_triggers. Pushes
all heuristic-derived tier thresholds well above what the
dropped-cookie + missing-UA + missing-AL stack can produce, so
the tests exercise their target rule (rate-limit, robots
disallow, cookie trigger) without the heuristic interstitial
firing.
b. 200 → "not 403" assertion relaxation in test_robots and
test_policy. Tests hitting nonexistent paths like /public used
to see 200 OK from the interstitial; now they see 404 from
Apache because the interstitial isn't masking. The tests' real
claim is "not blocked", which `!= 403` captures.
c. Per-IP isolation in test_cookie_triggers and test_triggers.
Two-request sequences where the first request's `flag=` action
carried forward and tier_floor'd the second now use distinct
fresh IPs to avoid the bleed.
d. test_flag_trigger relaxation on the explicit
`flag-tier-floor:captcha` reason token. The reason is only
emitted when the tier_floor lifts a sub-floor score; with
dropped-cookie+honeypot the score now crosses captcha threshold
on its own, making the explicit reason redundant. The
`flag-tier-floor:form` softer-override regression check still
works (the softer floor would NOT appear in either path).
e. test_app_claims: cookie state assertion accepts 'minted' (the
always-mint result on cookieless first visit) alongside the
pre-2026 'absent' / 'missing'.
Final test suite: 264 passed, 0 failed (19 deselected browser
tests). 9-minute full run.
0 commit comments