Description
scan_closed_issues in gittensor/validator/issue_discovery/repo_scan.py:76 builds lookback_date as an ISO string, then _scan_repo:134 parses it back to a datetime via datetime.fromisoformat(lookback_date.replace('Z', '+00:00')). The string is only used by _fetch_closed_issues (REST since param), but the same datetime is required for the per-issue closed_at cutoff. Round-tripping introduces a class of bugs (wrong timezone parse, format drift if the strftime template ever changes).
Steps to Reproduce
- Inspect
gittensor/validator/issue_discovery/repo_scan.py:76, 134.
- Note the
strftime('%Y-%m-%dT%H:%M:%SZ') followed by fromisoformat(... .replace('Z', '+00:00')).
Expected Behavior
Compute lookback_dt once as a datetime, pass that into _scan_repo, and stringify only at the API boundary in _fetch_closed_issues.
Actual Behavior
A two-step datetime → string → datetime roundtrip with hand-rolled 'Z' handling.
Description
scan_closed_issuesingittensor/validator/issue_discovery/repo_scan.py:76buildslookback_dateas an ISO string, then_scan_repo:134parses it back to adatetimeviadatetime.fromisoformat(lookback_date.replace('Z', '+00:00')). The string is only used by_fetch_closed_issues(RESTsinceparam), but the same datetime is required for the per-issueclosed_atcutoff. Round-tripping introduces a class of bugs (wrong timezone parse, format drift if the strftime template ever changes).Steps to Reproduce
gittensor/validator/issue_discovery/repo_scan.py:76, 134.strftime('%Y-%m-%dT%H:%M:%SZ')followed byfromisoformat(... .replace('Z', '+00:00')).Expected Behavior
Compute
lookback_dtonce as adatetime, pass that into_scan_repo, and stringify only at the API boundary in_fetch_closed_issues.Actual Behavior
A two-step datetime → string → datetime roundtrip with hand-rolled
'Z'handling.