Architecture Note · AI & Edge Infrastructure
Deterministic E2E Browser QA & Release Gate Architecture
Why LLM test-triage wrappers mask real regressions—and how rolling 30-run transition scoring, 1440x900/390x844 pixel-delta gates, and HTTP 409 lead sign-off keep broken builds out of production.
The Operational Problem: Release Gates Drowning in Flake Noise
Multi-region web platforms ship pull requests daily across desktop (1440x900) and mobile (390x844) viewports. A single stylesheet adjustment or backend DTO rename can push a checkout submit button below the fold, violate strict style-src 'self' Content Security Policy rules, or return an HTTP 502 on a critical settlement endpoint. Yet once Playwright and Cypress suites accumulate intermittent selector timing or cold-cache network races, engineers start ignoring red builds or clicking retry until CI turns green. Worse, generic CI logs report that a spec failed without correlating the failure to changed PR routes, API contracts, or WCAG 2.2 AA violations.
Why Naive AI Wrappers Fail Release Engineering
Dropping an unguarded LLM wrapper onto CI test logs introduces three predictable failure modes in release engineering:
- Silent regression masking in quarantine: Prompt-only log summarizers routinely confuse a persistent assertion failure or HTTP 502 contract break with a transient timeout. Auto-muting a failing spec without measuring run-over-run state transitions allows deterministic product bugs to reach production.
- Nondeterministic gate verdicts and severed blast radius: Asking a language model whether a release candidate is safe produces inconsistent thresholds across identical runs and fails to map a broken browser assertion back to the exact frontend route and backend endpoint modified in the pull request.
- Artifact egress and un-auditable overrides: Streaming raw Playwright traces, DOM snapshots, and staging payloads to external model APIs leaks internal endpoints and headers. Meanwhile, auto-approving warnings without a signed human decision leaves no tamper-evident record during an incident review.
The Deterministic Architecture That Fixes It
A production release gate treats browser verification as a deterministic state machine backed by local SQLite (WAL mode) storage, isolating optional model enrichment behind a provider-agnostic adapter (OfflineDeterministicAdapter by default, or an optional OpenAICompatibleAdapter).
- Scoped ingestion with 1-hour artifact wipe:
POST /api/runs/ingestaccepts Playwright JSON reports, JUnit XML suites, console/CSP telemetry, and desktop (1440x900) and mobile (390x844) visual-diff metadata. Raw uploaded artifacts are stored with0600permissions and automatically wiped after 1 hour (3600s). - Rolling 30-run transition classifier:
POST /api/tests/flake-scorecomputesfail_ratealongside pass/fail oscillation (transitions / total_pairs) over a 30-run window. IntermittentNetwork Race,Selector Timing, andHydration / Viewport Shiftflakes receive boundedquarantine.yamlrules with explicit retry caps and expiry dates, whereas consecutive failures, CSP blocks, and HTTP 5xx regressions score0.0%flake ratio and remain strictly non-quarantinable. - PR route mapping, pixel deltas, and WCAG 2.2 AA correlation: Changed frontend routes and backend endpoints in each PR link directly to blocked browser suites, visual bounding-box diffs against a
0.15%pixel threshold, and automated Playwright plusaxe-corechecks for contrast, target size, and focus order. - Fail-closed HTTP 409 gate and SHA-256 audit chain:
POST /api/releases/{id}/gateevaluates pass rates, visual deltas, and blocking CSP or 5xx counts. Any blocked release returnsHTTP 409 Conflict(signoff_required) until a QA or Engineering Lead recordsoverride_approved,lead_reviewer, andsignoff_reasoninto an immutable SHA-256 hash-chained log, exported viaGET /api/releases/metrics, OWASP formula-sanitized CSV (GET /api/releases/metrics.csv), or JUnit XML.
Operational Takeaway
Fast releases require engineers to trust every red gate. When flakiness is separated from deterministic regressions through rolling 30-run transition math, raw CI artifacts auto-expire in 3600 seconds, every failing suite links straight to its PR routes and 1440x900/390x844 pixel diffs, and gate overrides fail closed with HTTP 409 until a named lead signs the SHA-256 audit chain, teams eliminate retry fatigue without sacrificing release safety.