← Back to Pull requests

test(frontend): time chunk encryption and wasm load in real browsers #232

Closed
unknown closed this pull request without merging on Nov 20, 2026 01:37 UTC
View on GitHub
unknown unknown commented on Nov 13, 2026 11:04 UTC
Author

What and why

Part of #185 (P73). Times chunk encryption (encryptPayload, 4 KiB and 4 MiB) and the wasm envelope module's cold start (load plus first seal) in real browsers, as a Vitest bench: npm run bench:browser.

  • Each sample is a batch of calls lasting at least 50 ms, reported as its per-call mean. The bench reports p50 and p99 over those batch means (tinybench has no p95). The cold start is one sample per page.

  • The timings run on the page's main thread; the app does this work in the crypto worker.

  • The browser workflow runs it after the tests and writes a table, the runner's CPU, the browser version and the wasm module's size to the job summary. Report only, not a required check; the step fails, without failing the run, if the bench fails or prints no results.

  • npm test and npm run test:browser never run it: bench files have their own glob, read only by vitest bench.
  • The browser section of docs/BENCHMARKS.md is filled from one manually started browser run (run 44010807289: Chromium, Firefox, WebKit). #185 closes only once browser numbers have a target, a threshold and a regression run.

    How it was tested

    The bench ran in Chromium, Firefox and WebKit. npm test, npm run test:browser and scripts/check.sh pass. No speed is asserted; the numbers come from CI.

    Checklist

  • scripts/check.sh passes locally

  • Every new refusal has a negative test: n/a

  • Every new security decision emits a SECURITY_AUDIT_EVENT covered by audit_coverage.rs: n/a

  • Fails closed on missing configuration, key material, or attestation: n/a

  • No new cryptographic primitives; suites stay behind their type aliases: n/a

  • Synthetic or public data only (docs/DATA_POLICY.md)

  • Docs and CHANGELOG.md updated for user-visible changes

  • Architectural decision recorded in docs/adr/ if one was made: n/a
  • Diff: 235 lines (+176 / -59) across 2 files Reviewer: abendrothj Review duration: 9513m
    All Vouch review confidence checks passed
    Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 235 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Diff Size diff_size
    0.327
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #232"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 60.3% (MEDIUM) · Higher = larger blast radius
    60.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 23.8% · Safe to merge
    23.8%