fix(scoring): score removed source files via tree-diff deletions - #1681
Open
bittensorrider wants to merge 1 commit into
Open
fix(scoring): score removed source files via tree-diff deletions#1681bittensorrider wants to merge 1 commit into
bittensorrider wants to merge 1 commit into
Conversation
Removed files with available base content were hard-skipped at score=0 before tree-diff could run. Route them through score_tree_diff(old, None) and guard None new_content in size/inline-test checks. Fixes entrius#1680 Co-authored-by: Cursor <cursoragent@cursor.com>
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
status == 'removed'early skip for source files incalculate_token_score_from_file_changes.old_contentthroughscore_tree_diff(old, None, …)so full-file deletions score consistently with in-file deletes.new_content is Nonein file-size and inline-test checks so removed files do not crash the scorer.Related Issues
Fixes #1680
Type of Change
Testing
test_removed_source_file_pipeline_scores_deletionstest_removed_source_file_pipeline_skips_missing_old_contentuv run pytest tests/validator/test_token_scoring_integration.pyuv run pre-commit run --all-filesuv run pre-commit run --all-files --hook-stage pre-pushChecklist