Problem
codebase_rag/constants.py is 2876 lines, far exceeding the project's 700-line soft limit. It contains unrelated concerns: file extensions, tree-sitter AST node types, CLI messages, language metadata, C++ operator maps, stdlib type maps, color enums, and more.
Suggested Structure
Split into a constants/ submodule:
constants/__init__.py - re-exports for backwards compatibility
constants/ast_nodes.py - tree-sitter node type constants (TS_IDENTIFIER, TS_ATTRIBUTE, etc.)
constants/languages.py - SupportedLanguage, language metadata, file extensions
constants/operators.py - C++ operator maps, stdlib type maps
constants/graph.py - NodeLabel, RelationshipType, key names
constants/cli.py - Color, StyleModifier, CLI messages, UI formatting
Affected Files
codebase_rag/constants.py (source of split)
- All files importing from
codebase_rag.constants or using the cs alias (widespread)
Problem
codebase_rag/constants.pyis 2876 lines, far exceeding the project's 700-line soft limit. It contains unrelated concerns: file extensions, tree-sitter AST node types, CLI messages, language metadata, C++ operator maps, stdlib type maps, color enums, and more.Suggested Structure
Split into a
constants/submodule:constants/__init__.py- re-exports for backwards compatibilityconstants/ast_nodes.py- tree-sitter node type constants (TS_IDENTIFIER, TS_ATTRIBUTE, etc.)constants/languages.py- SupportedLanguage, language metadata, file extensionsconstants/operators.py- C++ operator maps, stdlib type mapsconstants/graph.py- NodeLabel, RelationshipType, key namesconstants/cli.py- Color, StyleModifier, CLI messages, UI formattingAffected Files
codebase_rag/constants.py(source of split)codebase_rag.constantsor using thecsalias (widespread)