Skip to content

fix(scoring): score removed source files via tree-diff deletions - #1681

Open
bittensorrider wants to merge 1 commit into
entrius:testfrom
bittensorrider:fix/1680-removed-file-tree-diff-scoring
Open

fix(scoring): score removed source files via tree-diff deletions#1681
bittensorrider wants to merge 1 commit into
entrius:testfrom
bittensorrider:fix/1680-removed-file-tree-diff-scoring

Conversation

@bittensorrider

@bittensorrider bittensorrider commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • Remove the blanket status == 'removed' early skip for source files in calculate_token_score_from_file_changes.
  • Route removed files with old_content through score_tree_diff(old, None, …) so full-file deletions score consistently with in-file deletes.
  • Guard new_content is None in file-size and inline-test checks so removed files do not crash the scorer.

Related Issues

Fixes #1680

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Other (describe below)

Testing

  • Tests added/updated
    • test_removed_source_file_pipeline_scores_deletions
    • test_removed_source_file_pipeline_skips_missing_old_content
  • Manually tested
    • uv run pytest tests/validator/test_token_scoring_integration.py
    • uv run pre-commit run --all-files
    • uv run pre-commit run --all-files --hook-stage pre-push

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Changes are documented (if applicable)

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>
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(scoring): removed source files are hard-skipped instead of tree-diff scored

1 participant