{ "batch": "Governance & Contracts", "batch_index": 3, "assessments": { "cross_module_architecture": 81.0, "test_strategy": 69.0 }, "dimension_notes": { "cross_module_architecture": { "evidence": [ "README.md defines the quality model publicly as 5 mechanical + 7 subjective dimensions, implying a stable external contract for score interpretation.", "internal/quality/enhanced_types.go defines additional dimensions (e.g., DimensionElegance, DimensionContracts) that are not reflected in README governance docs.", "internal/quality/types.go exposes status/state enums (including StatusIgnored) that are absent from README user-facing resolution policy examples, creating docs-vs-runtime boundary drift." ], "impact_scope": "codebase", "fix_scope": "architectural_change", "confidence": "medium" }, "test_strategy": { "evidence": [ "internal/quality/scoring_test.go is heavily unit-focused and validates scorer internals, but does not validate public contract stability between quality types and README-documented behavior.", "README.md publishes CLI and JSON-RPC command contracts, but assigned tests do not exercise those published interfaces as compatibility gates.", "pkg/rustdocs/parser_test.go and internal/quality/scoring_test.go include brittle assertions (fixed positional result indexing and strict output text matching) that couple tests to implementation/presentation details." ], "impact_scope": "subsystem", "fix_scope": "multi_file_refactor", "confidence": "high" } }, "findings": [ { "dimension": "cross_module_architecture", "identifier": "docs_runtime_quality_contract_drift", "summary": "Quality dimensions/statuses drift between public docs and runtime model contracts.", "related_files": [ "README.md", "internal/quality/enhanced_types.go", "internal/quality/types.go" ], "evidence": [ "README.md frames score interpretation around a specific dimension set and user workflow.", "internal/quality/enhanced_types.go includes extra dimension constants not represented in README contract text.", "internal/quality/types.go includes StatusIgnored while README resolution examples only expose fixed/wontfix/false_positive paths." ], "suggestion": "Define a single versioned public quality contract (dimensions + statuses) as source-of-truth, generate README contract tables from it, and add a CI check that fails when exported enums and published docs diverge.", "confidence": "medium", "impact_scope": "codebase", "fix_scope": "architectural_change" }, { "dimension": "test_strategy", "identifier": "missing_public_contract_compat_tests", "summary": "Published CLI/RPC governance contracts are not protected by compatibility tests.", "related_files": [ "README.md", "internal/quality/scoring_test.go", "internal/quality/types.go" ], "evidence": [ "README.md documents stable command and RPC method surfaces for users.", "internal/quality/scoring_test.go covers scoring behavior but not end-to-end contract assertions tied to documented surfaces.", "No assigned test verifies that externally documented score/status semantics remain compatible with exported model types." ], "suggestion": "Add contract tests that parse/validate documented command and RPC surface claims against runtime registration/types, and add schema-level golden tests for serialized quality/status payloads.", "confidence": "high", "impact_scope": "codebase", "fix_scope": "multi_file_refactor" }, { "dimension": "test_strategy", "identifier": "brittle_assertions_on_order_and_formatting", "summary": "Tests are fragile due to strict ordering and presentation-string coupling.", "related_files": [ "internal/quality/scoring_test.go", "pkg/rustdocs/parser_test.go" ], "evidence": [ "pkg/rustdocs/parser_test.go asserts semantic expectations through fixed indexes (results[0], results[1], results[2]) rather than identity-based matching.", "internal/quality/scoring_test.go asserts many exact output substrings in FormatScorecard, coupling tests to formatting text that can change without behavioral regressions." ], "suggestion": "Refactor tests to assert semantic invariants (presence by key/kind, normalized structured fields) and reserve strict golden-output checks for explicitly versioned presentation contracts.", "confidence": "high", "impact_scope": "module", "fix_scope": "multi_file_refactor" } ] }