Repository navigation
fix(cli): enforce Test gap new-file Budget - #769
Merged
Merged
Conversation
avidianity
force-pushed
the
fix/issue-758
branch
from
December 2, 2026 16:15
31ca04a to
b592306
Compare
avidianity
force-pushed
the
fix/issue-758
branch
from
December 2, 2026 16:40
b592306 to
126e53c
Compare
avidianity
force-pushed
the
fix/issue-758
branch
from
December 2, 2026 17:10
126e53c to
0764029
Compare
5 tasks done
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
Enforce
new_file_budgets.production.test_gapon newly added Production files incodeint diff.For an explicit
--head, read Coverage reports from that ref and report any missing configured path.Closes #758
Tier
Tier 2 from
cargo xtask risk-tier --base origin/main. The CLI and report changes match the default tier.Task
Enforce the Test gap new-file Budget specified in #513.
--head.Fail-first test
test_gap::diff_enforces_test_gap_budget_on_new_production_files.2910ef78withleft: Some(0)andright: Some(1)for the exit code fromcodeint diff main.The mixed-language regression also ran and failed before its fix with
left: Some(0)andright: Some(2).It passed after the fix.
Checks
cargo test --locked -p codeint --test integration test_gappassed all 19 tests.cargo xtask merged-resultpassed.07640295. Three diff tests ran and passed. The reference example test passed locally. The rebase preserved all four patches.Safety proof
The Coverage report belongs to the snapshot measured by the new-file Budget.
The regression runs the same diff twice with different report contents on disk and in the selected ref.
The working-tree diff passes with full coverage, and the explicit ref fails with
production test_gapratio1.0from its committed report.The test also removes the local report and confirms a diff with only an existing file edit passes.
A mixed-language fixture verifies that coverage on a functionless new file cannot yield a passing Budget for an uncovered new Function.
The committed-report path checks the Git blob size before reading the contents and preserves the unmatched-source-path diagnostic.
Runtime evidence
PASS on the reviewed patch and its final rebase
07640295using a temporary Python Git repository and LCOV report.The diff feature map defines the exit 1 contract for new-file Budget violations.
In the reproduction,
codeint check --format textreportsworker.py:1 run untested=100%.After the fix,
codeint diff HEAD --format textexits 1 and printsthe new-file production test_gap ratio 1 is over its new-file Budget 0.The integration test asserts the JSON result, successful recovery with updated coverage, and exit 2 when the explicit ref lacks coverage.
Temporary repositories and caches contain synthetic fixtures only.
Metric versions
No Metric changes its Finding IDs or values on unchanged code.
The fix applies the existing Test gap calculation to the new-file Budget.
Gaps