Repository navigation
feat: wire GazeCRAP data into gaze report pipeline - #66
Merged
jflowers merged 3 commits intoMar 17, 2026
Merged
Conversation
When an AI adapter subprocess exits with code 0 but produces empty stdout, the error message now includes truncated stderr content. This surfaces the actual cause (e.g., 'Error: Invalid API key') instead of the generic 'returned empty output' message. Changes: - runSubprocess returns (stdout, stderr, error) instead of (stdout, error) - Added formatStderrSuffix helper for consistent stderr truncation - All three subprocess adapters (OpenCode, Claude, Gemini) include stderr in their empty-output error messages - 5 new tests for runSubprocess stderr and formatStderrSuffix
Ensures the AI-formatted report uses the same thresholds and metrics as the CLI's deterministic output: - CRAPload threshold read from summary.crap_threshold (not hardcoded) - Contract coverage uses module-wide average (not subset) - Quadrant descriptions use 'contract coverage' terminology - GazeCRAPload and quadrant counts read from canonical JSON fields
Extracted BuildContractCoverageFunc from cmd/gaze/main.go to internal/crap/contract.go. Wired it into runProductionPipeline before the CRAP step so that gaze report produces GazeCRAP scores, quadrant distribution (quadrant_counts), and gaze_crapload in its JSON output. Key changes: - runCRAPStep and pipelineStepFuncs accept ContractCoverageFunc param - --max-gaze-crapload threshold now evaluates actual GazeCRAPload - SSA degradation from pre-CRAP quality pass merges (not overwrites) with quality step degradation data - Added TestSC002 (exact-match gaze crap vs gaze report), TestSC004 (FakeAdapter payload assertion), and pipeline data flow test Closes spec 022-report-gazecrap-pipeline.
jflowers
force-pushed
the
022-report-gazecrap-pipeline
branch
from
March 17, 2026 15:42
d4e2828 to
103608b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
BuildContractCoverageFuncfromcmd/gaze/main.gotointernal/crap/contract.goso the report pipeline can import itrunProductionPipelinebefore the CRAP step, producing GazeCRAP scores,quadrant_counts, andgaze_craploadingaze reportJSON output--max-gaze-craploadthreshold to evaluate against actual computed GazeCRAPload (previously always passed with value 0)Additional Changes
runSubprocessnow returns stderr alongside stdout, surfacing actual error causes (e.g., "Invalid API key") in empty-output error messagesTesting
TestSC002_GazeCRAPloadMatchBetweenCrapAndReport— exact-match test betweengaze crapandgaze reportGazeCRAPloadTestSC004_PayloadContainsQuadrantCounts— FakeAdapter payload assertion forquadrant_countsandgaze_craploadTestRunProductionPipeline_GazeCRAPloadFlowsThroughPipeline— pipeline data flow testContractCoverageFuncparametercmd/gaze/main_test.gotointernal/crap/contract_test.goSpec
specs/022-report-gazecrap-pipeline/— full spec pipeline (specify → clarify → plan → tasks → implement → review council)