Repository navigation
fix: treat unset reusable AI-report thresholds as report-only - #459
Conversation
…nd-force#458) OpenSpec change ai-report-unset-thresholds: give the three threshold inputs a -1 sentinel default and skip negative values, so an unset input no longer arrives as a live threshold of 0. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d-force#458) An unset workflow_call input of type number with no default evaluates to 0, so the [ -n ... ] guards always fired and every caller that left the thresholds unset (every scaffolded workflow) ran with --max-crapload=0 --max-gaze-crapload=0 --min-contract-coverage=0. Give the three inputs default: -1 and skip negative or empty values in a case guard; an explicit 0 stays a live threshold. A new test runs the step's real script against a stub gaze and checks the flags it passes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
uf-divisor
left a comment
There was a problem hiding this comment.
Council Review: fix: treat unset reusable AI-report thresholds as report-only
Verdict: APPROVE WITH ADVISORIES — 7/7 reviewer runs succeeded (divisor-adversary, divisor-architect, divisor-curator, divisor-gaze-testing, divisor-guard: APPROVE; divisor-sre, divisor-testing: APPROVE WITH ADVISORIES). All findings are LOW advisories; none block merge. CI is fully green (CI OK, both Go matrices' unit+integration and e2e legs, MegaLinter, Gaze AI Report).
The change gives max-crapload, max-gaze-crapload and min-contract-coverage a default: -1 sentinel and replaces the [ -n ... ] guards with case statements that skip negative or empty values, keeping an explicit 0 live — matching the OpenSpec delta spec's three scenarios and issue #458's acceptance criteria. TestCIWorkflow_ReusableThresholdGuards executes the real step script against a stub gaze, the right remedy for the substring-pinning failure class the design note documents.
Advisories (all LOW)
- upgrade-path (
docs/guides/ci-integration.md:189, divisor-sre) — the consumer docs don't tell existing consumers the fix takes effect only after bumping their pinneduses:ref or re-runninggaze init --ci; the proposal's impact line reads as if the fix reaches pinned callers automatically. See inline comment. - assertion-depth (
cmd/gaze/ci_workflow_test.go:696, divisor-testing) — the new test filters the stub argv to the three threshold flags; the script's other conditional args remain substring-pinned only; extending the assertion is nearly free. See inline comment. - test-fidelity (
cmd/gaze/ci_workflow_test.go:675, divisor-testing) — the harness runsbash -cwhile Actions runsbash -e(fail-fast); nothing depends on it today, but a future appended command could diverge. See inline comment.
This review was generated by /uf.review-pr (AI-assisted).
Fixes #458.
Problem
GitHub passes an unset
type: numberinput that has nodefaultas0, not as an empty string. So the[ -n "$MAX_CRAPLOAD" ]guards inreusable_gaze_ai_report.ymlalways fired. A caller that left the thresholds unset (which everygaze init --ciscaffold does) ran with--max-crapload=0 --max-gaze-crapload=0 --min-contract-coverage=0, and failed on almost any real project. That showed up on reading-stone's first main run (46526758887). Gaze's own dogfood job sets all three thresholds, so it never hit this.Change
max-crapload,max-gaze-craploadandmin-contract-coveragekeeptype: numberand gaindefault: -1.caseguard). An explicit0is still enforced.TestCIWorkflow_ReusableThresholdGuardsruns the step's real script withbashagainst a stubgaze, checking the flags it passes for the defaults, empty, negative,0, positive and mixed values. It fails against the old guards on four of six rows.TestCIWorkflow_ReusableExternalAnalyzerInputspins the-1defaults.docs/guides/ci-integration.mddocuments the default and what a negative value means.openspec/changes/ai-report-unset-thresholds/(spec committed first, ina8c2575).Callers that set thresholds see no change. The scaffold templates and golden files don't change.
Verification
go build ./...,golangci-lint run(0 issues), and thevalidate-ai-report-default/validate-workflow-floorscript tests pass.go test -race -count=1 -short ./...: everything passes except two timing benchmarks ininternal/analysis(TestSC004,TestSC005). Those exceeded their 15s limit under full-suite load on my machine, and pass when re-run alone (28s). This PR doesn't touch that package.markdownlintis clean on the changed doc, andopenspec validate ai-report-unset-thresholds --strictpasses.Release plan: ship as v2.7.1. That needs the usual
gaze-versiondefault bump tov2.7.1before dispatchingrelease.yml.🤖 Generated with Claude Code