Skip to content

feat: surface classification breakdown in report pipeline - #55

Merged
jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:report-classification-breakdown
Mar 15, 2026
Merged

jflowers merged 1 commit into
unbound-force:mainfrom
jflowers:report-classification-breakdown

Conversation

@jflowers

Copy link
Copy Markdown
Collaborator

Summary

  • Add classify.CountLabels helper to count side effects by classification label
  • Classification counts (contractual/ambiguous/incidental) now flow through the report pipeline
  • Users and AI consumers can see why contract coverage is low
  • Part of Phase 2: Report Transparency in the Gaze Roadmap

Motivation

Issue #42: When gaze classifies most side effects as "ambiguous" (confidence just below the contractual threshold), contract coverage is structurally zero regardless of test assertions. Users discover this only after wasting effort on assertions that can't improve the metric.

With classification counts visible, the report can now convey: "Contract coverage is 0% because all effects are ambiguous. Use --ai reclassification or lower the threshold."

Changes

Component What
classify.CountLabels New helper: counts contractual/ambiguous/incidental from []AnalysisResult
classifyStepResult New struct (follows crapStepResult pattern) with JSON + label counts
pipelineStepFuncs.classifyStep Type changed to return *classifyStepResult
ReportSummary Added Contractual, Ambiguous, Incidental int fields
runProductionPipeline Propagates counts from classify step to payload summary

Tests

  • 3 new tests for CountLabels (mixed labels, no classification, empty input)
  • Updated fakeSteps() and classify failure test for new type
  • Updated TestRunProductionPipeline_AllStepsSucceed with count assertions

Closes #42

…und-force#42)

Add classify.CountLabels helper to count side effects by classification
label (contractual/ambiguous/incidental). Classification counts now flow
through the report pipeline via classifyStepResult and are visible at
the ReportSummary level.

This lets users and AI consumers see why contract coverage is low —
when most effects are 'ambiguous' (confidence just below threshold),
adding assertions can't improve the metric. The fix is to use --ai
reclassification or adjust thresholds.

- Add CountLabels to classify package (pure function, 3 tests)
- Add classifyStepResult struct (follows crapStepResult pattern)
- Update pipelineStepFuncs.classifyStep type signature
- Add Contractual/Ambiguous/Incidental to ReportSummary

Closes unbound-force#42
@jflowers jflowers added this to the v1.3.0 milestone Mar 15, 2026
@jflowers
jflowers merged commit 8b555e4 into unbound-force:main Mar 15, 2026
5 checks passed
@jflowers
jflowers deleted the report-classification-breakdown branch November 15, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Report should surface contract coverage classification breakdown

1 participant