← Back to Pull requests

next 2/6: JS core (identity, lifecycle, channel, fail-closed filters, data requests) #11

Open
unknown opened this pull request with 237 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 30, 2026 10:39 UTC
Author

Part 2/6: JS core

Stacked series (6 PRs, one commit each). Review and merge in order: 1 workspace + contract, 2 JS core, 3 privacy core, 4 Android plugin, 5 iOS plugin, 6 runtime + integration. Each PR is based on the previous branch, so its diff shows only its own change; after the previous one merges, GitHub retargets this one to main. The legacy SDK at the repository root is untouched and no legacy code is reused. Nothing has been run with the real Bugsee SDK launched on a device or emulator (see PR 6 and next/docs/status.md).

Based on part 1. Adds next/packages/plugin/src/core/** and its tests: identity, lifecycle (status, page token, pageChanged), the wrapper channel (logs, network events, breadcrumbs), JS-side filters that fail closed, and data requests. It depends only on the typed bridge interface and on injected helpers (it never imports the privacy package).

Behaviour worth reviewing


  • Filters run in JS before submit; a filter that throws, hangs, returns a non-decision or is cleared mid-flight DROPS the event. Output held before the SDK accepts data is filtered at flush time with the filter current then, kept in production order, and never lost or duplicated across a stop/relaunch.

  • Network events are validated (field list, integer ranges, five body-absence reasons) before and after the filter; breadcrumbs always cross with the app's native filter still applying.

  • Nothing from a native error or a user value reaches a reject or a log (code-only errors).
  • Verified


    npx vitest run: 286 tests (includes part 1); npx tsc -b packages/plugin clean; the emitted .d.ts typechecks under TypeScript 5.0.4 (ES2020 lib only). Fail-open mutations (a throwing filter or a non-decision passing the original event) fail the suite.

    Not verified


    No native code or device: tested against an in-memory bridge only.

    Human guided, AI implemented

    Diff: 237 lines (+177 / -60) across 2 files Reviewer: krassx Review duration: 566m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 237 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.327
    Real PR Conversation Timeline
    1 comments
    "Review active on #11"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    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: 37.2% (MEDIUM) · Higher = larger blast radius
    37.2%
    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: 46.7% · Lower = rushed or shallow review
    46.7%
    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: 19.8% · Safe to merge
    19.8%