fix: add additional directory paths to ADR assessor#416
Conversation
Projects using specs/, docs/specs/, docs/architecture/, or docs/design/ for architectural decisions were getting false failures. Add these common conventions to the checked paths. Closes ambient-code#414 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Warning
|
| Layer / File(s) | Summary |
|---|---|
README remediation example formatting src/agentready/assessors/documentation.py (lines 482–507) |
READMEAssessor._create_remediation() reformats the first example in the examples list from inline to a properly separated multiline triple-quoted string for improved readability. |
ADR directory path expansion src/agentready/assessors/documentation.py (lines 560–580) |
ArchitectureDecisionsAssessor adds four candidate ADR directory paths (specs/, docs/specs/, docs/architecture/, docs/design/) to the search. The "No ADR directory found" error message is updated to reflect the expanded set of checked locations. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly summarizes the main change: adding additional directory paths to the ADR assessor. |
| Description check | ✅ Passed | The description directly addresses the changeset by explaining what paths were added, why they were needed, and references the related issue. |
| Linked Issues check | ✅ Passed | The changes fully address issue #414 requirements: adds the four proposed directory paths (specs/, docs/specs/, docs/architecture/, docs/design/) and updates the failure message to list all checked directories. |
| Out of Scope Changes check | ✅ Passed | All changes are directly related to expanding ADR directory paths and updating the corresponding error message, with no unrelated modifications present. |
| Docstring Coverage | ✅ Passed | Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Tip
💬 Introducing Slack Agent: The best way for teams to turn conversations into code.
Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
- Generate code and open pull requests
- Plan features and break down work
- Investigate incidents and troubleshoot customer tickets together
- Automate recurring tasks and respond to alerts with triggers
- Summarize progress and report instantly
Built for teams:
- Shared memory across your entire org—no repeating context
- Per-thread sandboxes to safely plan and execute work
- Governance built-in—scoped access, auditability, and budget controls
One agent for your entire SDLC. Right inside Slack.
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/agentready/assessors/documentation.py (1)
555-563:⚠️ Potential issue | 🟠 Major | ⚡ Quick winGeneric ADR paths can cause false-positive passes.
At Line 560-563, broad directories like
specs/anddocs/specs/may contain non-ADR markdown docs; with current scoring, directory existence + file count can pass even when ADR quality is absent.Suggested guard to reduce false positives in generic directories
- adr_paths = [ - repository.path / "docs" / "adr", - repository.path / ".adr", - repository.path / "adr", - repository.path / "docs" / "decisions", - repository.path / "specs", - repository.path / "docs" / "specs", - repository.path / "docs" / "architecture", - repository.path / "docs" / "design", - ] + adr_candidates = [ + (repository.path / "docs" / "adr", False), + (repository.path / ".adr", False), + (repository.path / "adr", False), + (repository.path / "docs" / "decisions", False), + (repository.path / "specs", True), + (repository.path / "docs" / "specs", True), + (repository.path / "docs" / "architecture", True), + (repository.path / "docs" / "design", True), + ] adr_dir = None - for path in adr_paths: + selected_is_generic = False + for path, is_generic in adr_candidates: if path.exists() and path.is_dir(): adr_dir = path + selected_is_generic = is_generic break- adr_files = list(adr_dir.glob("*.md")) + adr_files = list(adr_dir.glob("*.md")) + if selected_is_generic: + adr_files = [ + f for f in adr_files + if re.match(r"^(\d{4}-|ADR-\d{3}-|adr-\d{3}-)", f.name) + ]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/agentready/assessors/documentation.py` around lines 555 - 563, The ADR path list (adr_paths) is too generic and causes false positives by counting non-ADR files under directories like "specs" or "docs/specs"; update the ADR detection logic (where adr_paths is used in the ADR assessor function) to not just check directory existence/file count but to inspect candidate files for ADR-specific signals—e.g., filename patterns (contains "adr" or "decision" or matches "*-adr*.md"), ADR frontmatter keys (e.g., "status", "deciders"), or a top-level heading like "Architectural Decision"—and only count files that match those heuristics when computing ADR score. Ensure the code references the adr_paths list and the function/class that calculates ADR score so the new filtering is applied before incrementing counts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@src/agentready/assessors/documentation.py`:
- Around line 555-563: The ADR path list (adr_paths) is too generic and causes
false positives by counting non-ADR files under directories like "specs" or
"docs/specs"; update the ADR detection logic (where adr_paths is used in the ADR
assessor function) to not just check directory existence/file count but to
inspect candidate files for ADR-specific signals—e.g., filename patterns
(contains "adr" or "decision" or matches "*-adr*.md"), ADR frontmatter keys
(e.g., "status", "deciders"), or a top-level heading like "Architectural
Decision"—and only count files that match those heuristics when computing ADR
score. Ensure the code references the adr_paths list and the function/class that
calculates ADR score so the new filtering is applied before incrementing counts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: c2042a18-b9b1-4a86-8a73-363204fbe118
📒 Files selected for processing (1)
src/agentready/assessors/documentation.py
fixed in pr417 |
|
🎉 This PR is included in version 2.35.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Fixes formatting introduced by #416 that did not pass black. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…from-416 style: fix black formatting left unformatted by #416
Summary
specs/,docs/specs/,docs/architecture/, anddocs/design/to the ADR assessor's checked pathsProjects using these common conventions for architectural decision documentation were getting false failures on the
architecture_decisionscheck.Closes #414
Test plan
🤖 Generated with Claude Code