Skip to content

Wire GazeCRAP end-to-end in CLI commands #7

Closed

Description

@jflowers

Problem

The ContractCoverageFunc callback is implemented in crap.Options and works correctly in unit tests, but no CLI command (gaze crap, gaze self-check) populates it. Users running these commands always see:

note: GazeCRAP unavailable -- run gaze quality to compute contract coverage

GazeCRAP, ContractCoverage, and Quadrant fields remain nil in all CRAP report output.

Required Work

Wire quality.Assess() results into crap.Analyze() by building a ContractCoverageFunc lookup from quality reports. This involves:

  1. In runCrap() (cmd/gaze/main.go): before calling crap.Analyze(), optionally run the quality pipeline (load test package, analyze, classify, assess) for each pattern and build a func(string) *float64 that returns contract coverage percentage by qualified function name
  2. In runSelfCheck(): same wiring for Gaze own source
  3. Consider a --with-quality flag to opt into the heavier pipeline, since running quality assessment adds significant time

Dependencies

  • Blocked by Bridge AST-to-SSA name gap to reach 90% mapping accuracy (SC-003) #6 (AST-to-SSA bridging) for meaningful contract coverage values -- without it, GazeCRAP scores would use 0% contract coverage, making GazeCRAP identical to classic CRAP
  • crap.Options.ContractCoverageFunc field already exists (internal/crap/analyze.go:45)
  • crap.Analyze() already calls the func when non-nil (internal/crap/analyze.go:140-152)

References

  • Spec 004, tasks.md T050/T054 -- document the deferral
  • cmd/gaze/main.go:364-370 -- FR-015 warning message
  • internal/crap/analyze.go:45 -- ContractCoverageFunc field

Activity

  1. added
    enhancement
    on Feb 23, 2026
  2. jflowers commented on Mar 19, 2026

    @jflowers
    CollaboratorAuthor

    Closed — GazeCRAP is now wired end-to-end across all CLI commands:

    All originally requested functionality is implemented.

  3. added a commit that references this issue on Sep 1, 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

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions