← Back to Pull requests

feat(browser): derive API surfaces from retained SAZ captures #2884

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 13, 2026 15:37 UTC
Author

What Problem This Solves

api-surface accepts HAR but rejects native SAZ captures already retained by REA, forcing archive conversion or manual request grouping.

Approach and conflict resolution

Reuse the bounded capture readers and grouping for SAZ request lines, textual statuses, and a single unambiguous Content-Type header. HTTP unfolding stays owned by the SAZ parser; original fields, archive identity, and credential/sensitive-value exclusions remain preserved. HAR continues using main's canonical response declaration and media-type readers, including MIME parameters with producer-reported newlines.

Merged main 72d5e72e6d7b7997c4ecb11972fc405be8ec67d2, preserving the PR history. Moved the MCP documentation edit to docs/reference/mcp-contracts.md; retained main's schema ownership, consumer-specific error paths/remediation, source-hash partial observations, and Cutter synchronization. Only the API-surface projection opts into SAZ. The new static/observed endpoint comparison and environment manifest/state workflows remain HAR-only; comparison tests cover accepted HAR and rejected SAZ. Existing accumulator consumers retain the HAR default.

User Impact

Compiled CLI inspect-analysis-view and MCP inspect_analysis_view group retained or portable SAZ requests by method, recorded origin, and inferred path template, including after archive deletion. Query names remain opt-in. Query values, bodies, and guessed origins for relative targets are excluded. No new command, dependency, or network activity.

Validation

Current head: c78763a19754797fcbba4e1f400b1fd4d8d07588. Linux x64, pinned Node.js 24.22.1/npm 11.16.0. Native compilation/static checks ran in offline Debian bookworm containers because the host's older glibc cannot load the pinned GNU compiler.

  • Focused source regressions passed across SAZ parsing, API grouping, HAR manifest/state projections, and memory accounting. The final integration selection passed 47/47, including the new comparison format gate and existing comparison semantics.

  • Compiled SAZ/CLI/MCP/Cutter boundary selection: 93 passed, 2 timed out, 1 conditional skip initially. The SAZ archive-deletion/API-surface test then passed in an isolated serial run with unchanged code and the original 30-second threshold. Credential exclusions, exported Evidence, raw bytes, parser-owned continuations, and the new source-hash error observations passed. The MCP and Cutter files passed completely.

  • The remaining timeout is projects portable artifact inventory after the original ZIP is removed in tests/boundary/cli/analysisViewCli.test.ts. It also times out at 30 seconds in a separate checkout whose production source/package/lockfile match main exactly. The test is unchanged by this PR. A complete local boundary-suite pass is not claimed.

  • npm run check:fast, npm run build:cached, npm run docs:check (including 9 README consistency tests), and npm run verify:test-discovery (3,194 files exactly once): passed.

  • Typed lint of all 17 changed TypeScript files: passed, 0 errors / 8 advisory warnings. Full-repository typed lint was not rerun; the prior repository-wide attempt exceeded the local container memory bound.

  • Final formatting, unused-code and architecture checks: passed.

  • Current-head CI run 42467280107: running. PR title and author readiness checks passed; GitHub reports no merge conflicts and Ready for review status is preserved.
  • Prior-head built CLI/stdio MCP before/after evidence for the HAR MIME correction remains recorded on e687da208b3efd6f6005b66633b6b9000c3e4a84; those observations are historical. Current synthetic HAR/SAZ fixtures do not qualify a particular Fiddler release or local macOS/Windows behavior. Bodies and Session XML remain outside the SAZ API-surface view.

    CI follow-up (2026-11-08)

    CI at this head completed with 36,152 passed, 209 skipped, 1 failed in the portable report. The sole failure was kunaVerifier.test.ts / “accepts requested functions distributed across caller targets”: its Node subprocess hit the existing 10,000 ms deadline (spawnSync ... ETIMEDOUT). The report merger and required gate correctly remained red.

    The complete Kuna verifier test file passes independently against both this PR and production sources from main 72d5e72e6: 11 passed, 1 conditional real-provider skip each, using the original deadlines. These passes do not establish the cause of the remote timeout. No test budget, retry policy, or code was changed for this follow-up. A failed-jobs rerun was requested once and rejected by GitHub: “Must have admin rights to Repository.” No rerun started and no complete CI pass is claimed.

    Author readiness

    Human owner: @zhangguiping-xydt

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.

  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.

  • I declare this PR ready for initial maintainer review.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: zhangguiping-xydt Review duration: 69516m
    All Vouch review confidence checks passed
    Residual risk 0.33 = Change Risk (0.59) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.59 · 650 lines diff across 8 files
    0.59
    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%
    44%
    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.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #2884"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.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: 59% (MEDIUM) · Higher = larger blast radius
    59%
    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: 44.7% · Lower = rushed or shallow review
    44.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: 32.6% · Safe to merge
    32.6%
    Repository