-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
While reviewing the validator scoring logic in talisman_ai/analyzer/scoring.py, I identified several opportunities to improve maintainability and code quality through refactoring and cleanup.
Changes:
- Deduplicate Post Age Logic: Both
compute_post_scoreandscore_post_entrycontain identical blocks of code for calculating post age and enforcing the 10-day cutoff rule. I propose extracting this into a helper functionis_post_too_old(created_at). - Remove Dead Code: The function
_build_canonical_from_dictappears to be unused within the repository and contains a docstring inconsistency (claims to take adictbut treats it as aPostClassificationobject). - Improve Type Safety: Add missing type hints for the
analyzerarguments inscore_post_entryandtop_k_relevance_from_analyzerto ensure they are correctly identified asSubnetRelevanceAnalyzerinstances. - Cleanup Component Calculation: Refactor
score_post_entryto use the unified scoring components to ensure consistent behavior across different entry points.
I would like to submit a PR to address these items.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels