Skip to content

Make quality snapshots enforce performance and coverage regressions #503

Description

Summary

PET's quality snapshot workflows currently report regressions but do not reliably enforce them, and parts of the E2E client can distort measurements.

A longitudinal audit of 11 successful main-branch baselines (July 24-August 6, 2026) found stable/rising coverage, but also showed that the workflows can stay green while meaningful tail latency or coverage drift is present.

Concrete problems

  • .github/workflows/perf-tests.yml runs the benchmark with continue-on-error: true.
  • Missing benchmark output is replaced with a successful zero-valued metrics.json.
  • P95 is collected and displayed, but regression indicators and decisions compare only P50.
  • Environment/manager inventory changes are displayed but not validated, so unlike workloads can be compared.
  • Coverage decreases only change the PR comment; they do not fail the quality gate.
  • The E2E PetClient pipes child stderr without draining it and recreates a BufReader around stdout for every request. Pipe backpressure or discarded read-ahead can invalidate latency measurements.

This means issue #313's regression-detection acceptance criterion is only partially satisfied: snapshots are generated, but quality regressions are not consistently detected or gated.

Tasks

  • Make malformed/missing benchmark metrics fail instead of producing zero-shaped success.
  • Make the E2E client continuously drain stderr and preserve framed stdout buffering for the process lifetime.
  • Compare and gate P50, P95, and time-to-first-environment using explicit per-platform tolerances.
  • Reject or clearly invalidate comparisons when discovered environment/manager counts differ from baseline.
  • Enforce a documented coverage budget; new code must remain covered and unexplained decreases must fail.
  • Extract report/comparison logic into testable code rather than duplicating shell arithmetic across platforms.
  • Preserve full artifacts and summaries for longitudinal analysis.

Acceptance criteria

  • A benchmark process/test failure cannot produce a successful zero-valued snapshot.
  • P50, P95, and time-to-first-environment regressions are evaluated against baseline.
  • Workload inventory mismatches invalidate the comparison.
  • Coverage regressions fail unless an explicit reviewed exception is used.
  • E2E JSON-RPC stdout/stderr handling cannot block or discard buffered protocol data.
  • Comparison/gating logic has unit tests for improvement, noise, regression, missing data, and inventory mismatch.
  • Existing per-platform snapshot comments and artifacts remain available.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugdebtCode quality issuesimportantIssue identified as high-priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions