refactor(bottle): demonstrate subscriber-owned request blocking #22078
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 287 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.339
Real PR Conversation Timeline
1 comments
"Review active on #22078"
general
weight: 0.35
dubloom
Description
Demonstrates how an independent subscriber can skip a Bottle route callback and supply an HTTP response while reusing the existing shared request tracing subscriber.
Bottle dispatches a typed inspection event inside its request context. The integration adapts a supplied status, headers, and byte body to
HTTPResponse; the existing completion path handles HTTP tags and span finishing. A test-only subscriber supplies a 403 response, with coverage for allowed requests and exception cleanup. Contributor documentation explains the boundary.This is a smaller demonstration related to #21006; it adds no production AppSec subscriber or WAF policy.
Customer impact
None with the existing production subscribers. The blocking policy exists only in tests. No release note is needed for this internal demonstration.
Testing
scripts/lint checks, targeted typing/formatting/spelling, and type-comment checks passed.456bf4e843on Python 3.12.10 / Bottle 0.13.4. No measured regressions in this run; the normal request case was 149.21 ± 6.42 µs on main and 143.76 ± 2.36 µs on the candidate. Baseline ran first and had higher variability in several cases, so this does not establish a speedup. This measures the path without an inspection subscriber.Risks
Adds an inspection dispatch to traced Bottle callbacks. Tracing-disabled requests keep their existing bypass. Request bodies, unmatched routes, later hooks, response/SDK blocking, and streaming are outside this example. Production security support requires separate implementation and validation.
Additional Notes
Draft demonstration for reviewing the subscriber extension point.