Skip to content

Report should surface contract coverage classification breakdown #42

Closed

Description

@jflowers

Problem

The /gaze report shows GazeCRAPload and contract coverage percentages but doesn't explain why contract coverage is low. During a real remediation effort (CRAPload 59→10 on a Go project), I spent significant effort adding contract assertions (if got != expected) to ~50 tests, only to discover the bottleneck wasn't missing assertions — it was that gaze classified 73% of side effects as "ambiguous" (confidence 78-79, just below the default threshold of 80).

With total_contractual=0 for most functions, no amount of assertion fixes could improve contract coverage.

What would help

The report should explicitly include:

  1. Classification distribution — How many side effects are contractual vs ambiguous vs incidental, and the confidence histogram (e.g., "23 effects at confidence 78-79 are borderline — AI reclassification would promote them")
  2. Whether --ai was used and how results would differ with/without it
  3. Actionable guidance — When contract coverage is low because of classification rather than missing assertions, the report should say so: "Contract coverage is 0% because all side effects are classified as ambiguous. Adding assertions won't help — use --ai or lower --contractual-threshold."

Impact

Without this information, developers waste time on the wrong remediation. In my case, 55 assertion fixes moved CI contract coverage from 10% to 11% — because the classification was the bottleneck, not the assertions.

Activity

  1. added
    enhancement
    on Mar 15, 2026
  2. jflowers commented on Mar 15, 2026

    @jflowers
    CollaboratorAuthor

    Triage

    Priority: Medium
    Label: enhancement
    Overlaps: #48 (agent-facing version of the same problem — agents also can't distinguish classification bottleneck from assertion gap)

    Analysis: This is a real usability gap. The current report shows contract coverage percentages but gives no indication of why they're low. The three root causes (missing tests, missing assertions, classification bottleneck) require completely different fixes, and the user has to discover which one applies through trial and error.

    Suggested scope: Add a "Classification Impact" section to the text report and a classification_breakdown field to the JSON output showing contractual/ambiguous/incidental counts per package. When ambiguous count is high and contract coverage is low, emit an actionable hint: "Contract coverage is limited by classification — N effects scored 78-79 (just below the contractual threshold of 80). Consider using --ai or lowering the threshold."

  3. jflowers commented on Mar 15, 2026

    @jflowers
    CollaboratorAuthor

    PR #49 added fix_strategy and remediation breakdown, but this issue's core asks are not yet addressed:

    1. Classification distribution (contractual/ambiguous/incidental counts per package) — not implemented
    2. Whether --ai was used — not surfaced in the report
    3. Actionable guidance when classification is the bottleneck ("contract coverage is 0% because all effects are ambiguous") — not implemented

    The fix_strategy field helps when the bottleneck is tests/decomposition but does not help when the bottleneck is the classification engine itself (the scenario described in this issue).

    This issue remains open — it requires changes to the classification pipeline output, not the CRAP scoring pipeline.

  4. added this to the v1.3.0 milestone on Mar 15, 2026
  5. moved this from Todo to In Progress in Gaze Roadmapon Mar 15, 2026
  6. moved this from In Progress to Done in Gaze Roadmapon Mar 15, 2026
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

    enhancement

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions