← Back to Pull requests

feat(browser): real OS/browser versions, GPU, permissions and hints in the environment #242

Closed
unknown closed this pull request without merging on Nov 29, 2026 18:13 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 10:37 UTC
Author

Why


A navigator sweep against the appserver's EnvironmentSchema (Mongoose strict mode silently drops undeclared keys) found:
  • Bug: the browser sent hardware.screen_width / screen_height / pixel_ratio. No schema declares them, so all three were dropped. Now hardware.screen {width, height, width_px, height_px, scale}, the shape the appserver declares and the viewer reads.

  • Frozen user agent: platform.version stayed 10.15.7 on every Mac, Windows 11 read as 10, and browser.version ended in .0.0.0.
  • What


    New packages/browser/src/environment-extras.ts:
  • UA-CH high-entropy values: precise OS version (Windows 11 from a platformVersion major ≥ 13), full browser version, hardware.arch (arm64/x86_64), Android hardware.model, hardware.form_factors.

  • Permissions API snapshot → app.permissions (granted → true; read-only, never prompts). Opt-in: capturePermissions: true.

  • WebGPU adapter info → hardware.gpu (vendor, renderer, architecture). Opt-in: captureGpu: true (an adapter request can start the GPU process).

  • navigator.languages → platform.locale_extended_info.

  • Sync hints: browser.user_agent / automated / cookies_enabled / secure_context / standalone, hardware.max_touch_points.
  • UA-CH is always read; async values are collected once, deferred to idle (3 s cap per source, each guarded) and merged into reports built afterwards; a report built earlier simply lacks them. Skipped when the host passes its own systemProbe. An unidentifiable browser is now {type: 'unknown', user_agent} instead of an absent block.

    Deliberately not collected: geolocation, device labels/ids, plugins/mimeTypes, ad-tech APIs, DNT/GPC (privacy decision pending).

    Pairs with (merge order matters)


    1. Appserver schema: bugsee/bugsee-appserver#290. Must be deployed first, or the new keys are dropped.
    2. Viewer rendering: bugsee/bugsee-web-viewer#224
    3. Spec docs: bugsee/specs#88

    Verification


  • 1458 browser tests, 100% line coverage, typecheck (101 packages), check:cycles, biome clean.

  • Mutator loop: 10 mutations on the new logic; one survived (renderer precedence), test strengthened, then killed. All rolled back.

  • Ran the collector in real Chromium 156 and WebKit (Playwright): returned platformVersion 26.6.2, full version 156.0.8078.4, arm64, GPU vendor, permission states.

  • Not run: Firefox (cached build mismatch), the browser e2e suite (Playwright browsers missing in this sandbox), the multi-agent convergent review CLAUDE.md requires.
  • 🤖 Generated with Claude Code

    https://claude.ai/code/session_01WeiJxRnbk1iC7HPhhoC2Cr

    Diff: 333 lines (+249 / -84) across 4 files Reviewer: krassx Review duration: 456m
    All Vouch review confidence checks passed
    Residual risk 0.30 = Change Risk (0.70) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.70 · 333 lines diff across 4 files
    0.70
    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%
    57%
    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.348
    Shallow Review Depth shallow_review_depth
    0.289
    Sensitive Paths sensitive_paths
    0.070
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #242"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 58.0% 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: 70.3% (HIGH) · Higher = larger blast radius
    70.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: 58.0% · Lower = rushed or shallow review
    58.0%
    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: 29.5% · Safe to merge
    29.5%