{
  "batch": "Architecture & Coupling",
  "batch_index": 1,
  "assessments": {
    "cross_module_architecture": 82.0
  },
  "dimension_notes": {
    "cross_module_architecture": {
      "evidence": [
        "`internal/quality/enhanced_types.go` centralizes many unrelated boundary contracts (scoring metrics, detector transparency, narrative strategy/tools, debt tracking, config) in one package-level type hub.",
        "`internal/quality/types.go` also acts as a second broad contract hub (findings, scan result, scorecard, language/config, extraction structs), overlapping the same ownership area as `enhanced_types.go` instead of separating by subdomain.",
        "`internal/quality/scoring_test.go` consumes these shared package-level contracts directly, which reinforces coupling to a wide internal surface rather than narrower scorer-specific interfaces/types."
      ],
      "impact_scope": "module",
      "fix_scope": "multi_file_refactor",
      "confidence": "high"
    }
  },
  "findings": [
    {
      "dimension": "cross_module_architecture",
      "identifier": "quality_package_contract_hub_coupling",
      "summary": "Quality contracts are concentrated in broad type hubs, creating a coupling hotspot.",
      "related_files": [
        "internal/quality/enhanced_types.go",
        "internal/quality/types.go",
        "internal/quality/scoring_test.go"
      ],
      "evidence": [
        "`enhanced_types.go` and `types.go` both define large cross-cutting models for multiple concerns (analysis narrative, scoring, detector stats, config, extraction metadata) under one package boundary.",
        "The two files blur subdomain ownership, so edits to one concern can force unrelated consumers in the same package to track evolving shared structs.",
        "Scoring tests rely on shared package contracts rather than a tighter scorer-local contract, indicating broad internal API exposure."
      ],
      "suggestion": "Split `internal/quality` contracts by bounded concern (for example: `qualitycore` findings/scan types, `qualityscore` scorecard/metrics, `qualitynarrative` narrative/report DTOs) and keep scorer-facing types in a narrow subpackage/API. Migrate tests to import only scorer-relevant types to reduce transitive coupling.",
      "confidence": "high",
      "impact_scope": "module",
      "fix_scope": "multi_file_refactor"
    }
  ]
}