-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem Statement
The StandardLayoutAssessor in structure.py contains Python-specific logic (pyproject.toml parsing, __init__.py detection, PEP 621/Poetry support) mixed with generic assessor code. As we add support for more languages (JavaScript, Java, Go, Rust), this file will become increasingly difficult to maintain.
This was identified in PR #322 review comment.
Proposed Solution
Extract language-specific detection logic into dedicated modules:
src/agentready/assessors/ ├── langs/ │ ├── init.py │ ├── python.py # pyproject.toml parsing,
init.py detection │ ├── javascript.py # package.json parsing,
node_modules detection │ └── java.py # Maven/Gradle detection,
src/main/java structure ├── structure.py # Generic StandardLayoutAssessor (delegates to langs/) └── ...
The StandardLayoutAssessor would become an orchestrator that:
- Detects primary language from
repository.languages - Delegates to appropriate language module
- Falls back to generic heuristics if no language module exists
Alternatives Considered
- Keep everything in structure.py — Simpler but doesn't scale
- Use strategy pattern with language classes — More OOP but similar outcome
- Configuration-driven detection — Too complex for initial implementation
Use Cases
- Adding JavaScript/TypeScript project detection (package.json, index.js)
- Adding Java/Kotlin detection (pom.xml, build.gradle, src/main/java)
- Adding Go detection (go.mod, main.go)
- Adding Rust detection (Cargo.toml, src/lib.rs)
Additional Context
Related to the .arsrc configuration file work in PR #322, which externalizes the blocklist. This refactoring would pair well with that change by making language-specific blocklists possible (e.g., Python.arsrc, JavaScript.arsrc).
Acceptance Criteria
- Create
src/agentready/assessors/langs/directory structure - Extract Python-specific logic to
langs/python.py -
StandardLayoutAssessordelegates to language modules - Existing tests continue to pass
- Add tests for language module selection
- Document pattern for adding new language support
Priority
- Medium (nice to have)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request