Skip to content

fix: remove dead null-language scoring config#1275

Merged
anderdc merged 8 commits into
entrius:testfrom
MkDev11:fix/issue-1274-null-language-line-count-scoring
May 23, 2026
Merged

fix: remove dead null-language scoring config#1275
anderdc merged 8 commits into
entrius:testfrom
MkDev11:fix/issue-1274-null-language-line-count-scoring

Conversation

@MkDev11
Copy link
Copy Markdown
Contributor

@MkDev11 MkDev11 commented May 14, 2026

Summary

  • Remove dead programming_languages.json entries that intentionally route to skipped-unsupported: env, gitattributes, gitignore, gql, graphql, ipynb, move, nim, pde, puml.
  • Add tex to NON_CODE_EXTENSIONS so LaTeX keeps its configured weight and scores through the existing line-count path.
  • Drop the prior null-language routing helper and tests per maintainer review; unsupported real languages and plumbing files should remain zero-scored by default.

Related Issues

Closes #1274

Type of Change

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

Testing

  • Tests added/updated
  • Manually tested

Automated checks run:

  • uv run ruff check gittensor/constants.py gittensor/validator/utils/load_weights.py gittensor/validator/utils/tree_sitter_scoring.py tests/validator/test_token_scoring_integration.py -> PASS
  • uv run pytest tests/validator/test_token_scoring_integration.py tests/validator/test_load_weights.py -q -> PASS, 108 passed
  • git diff --check -> PASS

Checklist

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

No docs update needed; this keeps the existing unsupported-extension scoring contract and removes dead config.

…skipping them

Extensions in programming_languages.json with no language field (no
tree-sitter parser) were silently scored as skipped-unsupported because
the routing gate in calculate_token_score_from_file_changes only checked
the NON_CODE_EXTENSIONS constant, not the JSON config.

Affected extensions: env, gitattributes, gitignore, gql, graphql, ipynb,
move, nim, pde, puml, tex.

Fix:
- Add TokenConfig.is_line_count_extension() that returns True when an
  extension is in NON_CODE_EXTENSIONS OR is configured in
  programming_languages.json with language=None.
- Replace the ext in NON_CODE_EXTENSIONS gate with
  weights.is_line_count_extension(ext).
- Remove the now-unused NON_CODE_EXTENSIONS import from tree_sitter_scoring.

Tests:
- Add TestNullLanguageLineCountScoring with regressions for graphql and
  gitignore (positive), unknown extension (negative control), graphql
  weight-accuracy pin, and a config-coverage guard that iterates every
  null-language entry in programming_languages.json and asserts it reaches
  line-count — catching future config/code drift before it zeroes miner scores.
@MkDev11 MkDev11 force-pushed the fix/issue-1274-null-language-line-count-scoring branch from 58c64ce to 845a2a7 Compare May 15, 2026 16:53
Copy link
Copy Markdown
Collaborator

@anderdc anderdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entries this routes to line-count score skipped-unsupported (0) by design — any extension not on the NON_CODE_EXTENSIONS allowlist scores 0; that's the default, not a bug. Line-count rewards raw line volume with no structural check, which is wrong for real languages (nim, move, pde) and undeserved for plumbing files (gitignore, env). The inconsistency #1274 describes is fixed by deleting the dead config, not by honoring it.

Drop the is_line_count_extension helper, the routing and import changes, and TestNullLanguageLineCountScoring. The PR should be two changes:

  • Remove these 10 entries from programming_languages.json: env, gitattributes, gitignore, gql, graphql, ipynb, move, nim, pde, puml.
  • Add tex to NON_CODE_EXTENSIONS in gittensor/constants.py — LaTeX is document markup; keep its tex entry in programming_languages.json for the weight.

@MkDev11 MkDev11 changed the title fix: line-count score configured null-language extensions instead of skipping them fix: remove dead null-language scoring config May 22, 2026
@anderdc anderdc merged commit a0d3596 into entrius:test May 23, 2026
3 checks passed
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.

[Bug] configured null-language extensions score 0 (skipped-unsupported) instead of line-count

2 participants