From 82b08c3377edfb60681fe6b63e5b0d8be6d6c03b Mon Sep 17 00:00:00 2001 From: Bill Murdock Date: Fri, 8 May 2026 14:01:49 -0400 Subject: [PATCH 1/2] fix: sync assessor default_weight values with default-weights.yaml 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 --- src/agentready/assessors/code_quality.py | 6 +++--- src/agentready/assessors/documentation.py | 4 ++-- src/agentready/assessors/security.py | 2 +- src/agentready/assessors/stub_assessors.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/agentready/assessors/code_quality.py b/src/agentready/assessors/code_quality.py index c0b5ff69..79f339a0 100644 --- a/src/agentready/assessors/code_quality.py +++ b/src/agentready/assessors/code_quality.py @@ -279,7 +279,7 @@ def attribute(self) -> Attribute: tier=self.tier, description="Cyclomatic complexity thresholds enforced", criteria="Average complexity <10, no functions >15", - default_weight=0.03, + default_weight=0.02, ) def is_applicable(self, repository: Repository) -> bool: @@ -423,7 +423,7 @@ def _create_remediation(self) -> Remediation: class StructuredLoggingAssessor(BaseAssessor): """Assesses use of structured logging libraries. - Tier 3 Important (1.5% weight) - Structured logs are machine-parseable + Tier 3 Important (2% weight) - Structured logs are machine-parseable and enable AI to analyze logs for debugging and optimization. """ @@ -444,7 +444,7 @@ def attribute(self) -> Attribute: tier=self.tier, description="Logging in structured format (JSON) with consistent fields", criteria="Structured logging library configured (structlog, winston, zap)", - default_weight=0.015, + default_weight=0.02, ) def is_applicable(self, repository: Repository) -> bool: diff --git a/src/agentready/assessors/documentation.py b/src/agentready/assessors/documentation.py index 71d7e36f..ac294e92 100644 --- a/src/agentready/assessors/documentation.py +++ b/src/agentready/assessors/documentation.py @@ -517,7 +517,7 @@ def _create_remediation(self) -> Remediation: class ArchitectureDecisionsAssessor(BaseAssessor): """Assesses presence and quality of Architecture Decision Records (ADRs). - Tier 3 Important (1.5% weight) - ADRs provide historical context for + Tier 3 Important (3% weight) - ADRs provide historical context for architectural decisions, helping AI understand "why" choices were made. """ @@ -1271,7 +1271,7 @@ def calculate_discount(price: float, discount_percent: float) -> float: class OpenAPISpecsAssessor(BaseAssessor): """Assesses presence and quality of OpenAPI specification. - Tier 3 Important (1.5% weight) - Machine-readable API documentation + Tier 3 Important (3% weight) - Machine-readable API documentation enables AI to generate client code, tests, and integration code. """ diff --git a/src/agentready/assessors/security.py b/src/agentready/assessors/security.py index 29f5f0f9..0c0564e9 100644 --- a/src/agentready/assessors/security.py +++ b/src/agentready/assessors/security.py @@ -34,7 +34,7 @@ def attribute(self) -> Attribute: tier=self.tier, description="Security scanning tools configured for dependencies and code", criteria="Dependabot, Renovate, CodeQL, or SAST tools configured; secret detection enabled", - default_weight=0.04, # Combined weight + default_weight=0.05, ) def assess(self, repository: Repository) -> Finding: diff --git a/src/agentready/assessors/stub_assessors.py b/src/agentready/assessors/stub_assessors.py index 9679b007..dbec8079 100644 --- a/src/agentready/assessors/stub_assessors.py +++ b/src/agentready/assessors/stub_assessors.py @@ -40,7 +40,7 @@ def attribute(self) -> Attribute: tier=self.tier, description="Dependencies pinned to exact versions in lock files", criteria="Lock file with pinned versions, updated within 6 months", - default_weight=0.10, + default_weight=0.05, ) def assess(self, repository: Repository) -> Finding: From 8c3b1cd6522ff6d1710ac89aff85a1e6fb621f3e Mon Sep 17 00:00:00 2001 From: Bill Murdock Date: Fri, 8 May 2026 14:46:13 -0400 Subject: [PATCH 2/2] fix: convert Path.glob() generators to lists before concatenation `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 --- src/agentready/assessors/code_quality.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agentready/assessors/code_quality.py b/src/agentready/assessors/code_quality.py index 79f339a0..2368cac0 100644 --- a/src/agentready/assessors/code_quality.py +++ b/src/agentready/assessors/code_quality.py @@ -668,8 +668,8 @@ def _has_actionlint(self, repository: Repository) -> bool: workflows_dir = repository.path / ".github" / "workflows" if workflows_dir.exists(): try: - 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") ): content = workflow_file.read_text() if "actionlint" in content: