fix: sync assessor default_weight values with default-weights.yaml#409
fix: sync assessor default_weight values with default-weights.yaml#409
Conversation
The yaml is the authoritative weight source. Several assessors had stale default_weight values that no longer matched, causing misleading fallback weights if the yaml were ever bypassed. - DependencyPinningAssessor: 0.10 -> 0.05 - DependencySecurityAssessor: 0.04 -> 0.05 - CyclomaticComplexityAssessor: 0.03 -> 0.02 (anticipates PR #407) - StructuredLoggingAssessor: 0.015 -> 0.02 (anticipates PR #407) Also updates stale "1.5% weight" docstrings in StructuredLoggingAssessor, ArchitectureDecisionsAssessor, and OpenAPISpecsAssessor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Warning
|
| Layer / File(s) | Summary |
|---|---|
Code Quality Weights src/agentready/assessors/code_quality.py |
CyclomaticComplexityAssessor.default_weight reduced from 0.03 to 0.02; StructuredLoggingAssessor.default_weight increased from 0.015 to 0.02 with docstring updated. |
Documentation Weights src/agentready/assessors/documentation.py |
ArchitectureDecisionsAssessor and OpenAPISpecsAssessor docstrings updated from "1.5% weight" to "3% weight". |
Security Weights src/agentready/assessors/security.py |
DependencySecurityAssessor.default_weight increased from 0.04 to 0.05. |
Stub Assessor Weights src/agentready/assessors/stub_assessors.py |
DependencyPinningAssessor.default_weight reduced from 0.10 to 0.05. |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | ✅ Passed | The title clearly and concisely summarizes the main change: syncing stale assessor default_weight values with the authoritative YAML configuration file. |
| Description check | ✅ Passed | The description is directly related to the changeset, providing a detailed summary table of weight changes, affected assessors, docstring fixes, and test verification. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
fix/assessor-default-weight-sync
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
📈 Test Coverage Report
Coverage calculated from unit tests only |
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/code_quality.py (1)
668-678:⚠️ Potential issue | 🟠 Major | ⚡ Quick winFix silent failure in workflow actionlint detection—
Path.glob()returns a generator, not a list, so concatenating with+raisesTypeError.
workflows_dir.glob("*.yml") + workflows_dir.glob("*.yaml")fails at runtime because generators cannot be concatenated with+. The bareexcept Exception: passsilently catches the error, so actionlint configured only in workflow files is never detected.Fix
- for workflow_file in workflows_dir.glob("*.yml") + workflows_dir.glob( - "*.yaml" - ): + for workflow_file in list(workflows_dir.glob("*.yml")) + list( + workflows_dir.glob("*.yaml") + ):🤖 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/code_quality.py` around lines 668 - 678, The code is concatenating two Path.glob() generators with + which raises TypeError and is swallowed by the bare except; replace the concatenation with a proper iterator (e.g., import itertools and iterate itertools.chain(workflows_dir.glob("*.yml"), workflows_dir.glob("*.yaml")) or convert both to lists and concatenate) and remove or narrow the bare except so failures aren't silently ignored — preserve the logic that for each workflow_file read_text() is inspected for "actionlint" and ensure any caught Exception is at least logged (referencing workflows_dir, workflow_file, .glob(), and the "actionlint" check).
🤖 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/code_quality.py`:
- Around line 668-678: The code is concatenating two Path.glob() generators with
+ which raises TypeError and is swallowed by the bare except; replace the
concatenation with a proper iterator (e.g., import itertools and iterate
itertools.chain(workflows_dir.glob("*.yml"), workflows_dir.glob("*.yaml")) or
convert both to lists and concatenate) and remove or narrow the bare except so
failures aren't silently ignored — preserve the logic that for each
workflow_file read_text() is inspected for "actionlint" and ensure any caught
Exception is at least logged (referencing workflows_dir, workflow_file, .glob(),
and the "actionlint" check).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 40171439-7d8d-47c6-92f9-26332030e5b2
📒 Files selected for processing (4)
src/agentready/assessors/code_quality.pysrc/agentready/assessors/documentation.pysrc/agentready/assessors/security.pysrc/agentready/assessors/stub_assessors.py
`Path.glob()` returns a generator, not a list. Concatenating two generators with `+` raises TypeError, silently swallowed by the bare except, causing actionlint detection via workflow files to never work. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
The yaml (
src/agentready/data/default-weights.yaml) is the authoritative weight source. Several assessors had staledefault_weightfallback values that no longer matched.DependencyPinningAssessorstub_assessors.pyDependencySecurityAssessorsecurity.pyCyclomaticComplexityAssessorcode_quality.pyStructuredLoggingAssessorcode_quality.pyAlso fixes stale
"1.5% weight"docstrings inStructuredLoggingAssessor,ArchitectureDecisionsAssessor, andOpenAPISpecsAssessor.Test plan
black . && isort . && ruff check .clean🤖 Generated with Claude Code under the supervision of Bill Murdock