Skip to content

Collect server subprocess coverage and report production-focused coverage gaps #534

Description

Tracking plan: #528
Priority: P1 for coverage integrity. Evidence: exact-audit-revision LCOV artifacts, with profile-loss cause to verify.

Problem and evidence

The coverage baseline at 4e523ba reports 80.81% Linux / 78.23% Windows line coverage and 84.81% / 81.57% function coverage. Nevertheless, both artifacts record zero execution for the transport loop, reply writers, and RPC entry handlers, despite black-box server tests exercising some of those paths.

The test client kills the server on Drop, which likely prevents normal LLVM profile flushing. Verify that cause rather than equating zero recorded coverage with absence of tests.

Aggregate coverage also includes inline test code. Restricting JSONRPC orchestration LCOV to executable lines before its test module gives 415/900 covered lines (46.1%) on both measured platforms. Conda/Poetry subprocess and diagnostic paths contain substantial unrecorded coverage. There is no macOS coverage job, although macOS functional tests exist.

Scope

  • Collect instrumented server-subprocess profiles via normal bounded shutdown, unique profile output names, and inclusion in the final report.
  • Add production-focused and changed-code coverage reporting; retain existing whole-workspace metrics for continuity rather than silently changing their meaning.
  • Add focused failure-path/branch tests for transport and handler behavior and measure macOS-specific runtime paths with a macOS coverage job.
  • Keep exact-base comparisons and fail-closed behavior. Do not optimize for a headline percentage by adding trivial tests or excluding difficult production paths.

Acceptance criteria

  • A known black-box request visibly increases coverage in the corresponding handler, transport loop, and response writer on supported platforms.
  • A normal server shutdown flushes/collects the expected profile; missing subprocess profiles are diagnosed rather than treated as success.
  • Reports distinguish production code from inline tests and expose uncovered changed production paths.
  • Targeted branch/error-path reporting is introduced where supported, with documented tool/platform limits.
  • macOS coverage is measured, or a concrete toolchain blocker is recorded and split into a linked follow-up before this item is closed.
  • Comparator changes and any baseline/schema transition have tests; exact-base line/function regression protection is preserved.

Dependencies and prior work

Depends on #529 for clean shutdown. Coordinate transport fixtures with #532. #522 / #524 is the existing fork-quality-workflow prerequisite. This extends the completed coverage expansion in #389 and gate enforcement in #503; it does not reopen those completed tasks or assert that the current gate is absent.

Activity

  1. karthiknadig commented on Sep 23, 2026

    @karthiknadig
    MemberAuthor

    Parallel read-only preparation found a second profile-loss source beyond forced shutdown: PetJsonRpcClient::spawn clears LLVM_PROFILE_FILE with env_clear. Once #529 supplies safe normal exit, preserve that variable, require a PID-unique profile pattern, and add an opt-in known-info-request test that waits for successful child exit and asserts a nonempty raw profile for that exact PID in the cargo-llvm-cov collection directory. Enable the same assertion in PR and baseline coverage jobs, not a percentage-only proxy. No coverage code or thresholds were changed; graceful active-work shutdown is still a prerequisite.

  2. karthiknadig commented on Sep 28, 2026

    @karthiknadig
    MemberAuthor

    The shutdown/profile-inheritance prerequisites have now landed in #559/#560. On the current merged main, an isolated instrumented idle server versus a known info request demonstrates actual execution counters changing from 0 to 1 in the real info handler, transport dispatch, and response writer; both exact child PIDs flush nonempty raw profiles through normal bounded exit. I am completing the fail-closed proof in both coverage pipelines, supplemental production/changed-line reports that leave existing whole-workspace gates unchanged, and native macOS coverage with a same-runner exact-base comparison. Local Python/reporting and Windows native/profile tests pass; independent review and hosted macOS validation are still required.

  3. added a commit that references this issue on Oct 7, 2026
    8320c0f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    debtCode quality issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions