Description
File paths from PR changes are interpolated directly into GraphQL query strings without escaping double-quote characters. A file path containing " (valid on most filesystems) breaks the GraphQL query syntax, causing the file content fetch to fail silently and the PR to receive a score of 0.
Affected code
gittensor/utils/github_api_tools.py line 1264: expression = f'{head_sha}:{path}' interpolated into a quoted GraphQL field
gittensor/utils/github_api_tools.py lines 1374, 1381: Same pattern in _fetch_file_contents_with_base_batch
Expected behavior
File paths with special characters should be properly escaped before interpolation into GraphQL queries.
Actual behavior
The GraphQL query becomes malformed, causing a silent failure that results in missing file contents and a 0 score for affected files.
Description
File paths from PR changes are interpolated directly into GraphQL query strings without escaping double-quote characters. A file path containing
"(valid on most filesystems) breaks the GraphQL query syntax, causing the file content fetch to fail silently and the PR to receive a score of 0.Affected code
gittensor/utils/github_api_tools.pyline 1264:expression = f'{head_sha}:{path}'interpolated into a quoted GraphQL fieldgittensor/utils/github_api_tools.pylines 1374, 1381: Same pattern in_fetch_file_contents_with_base_batchExpected behavior
File paths with special characters should be properly escaped before interpolation into GraphQL queries.
Actual behavior
The GraphQL query becomes malformed, causing a silent failure that results in missing file contents and a 0 score for affected files.