Aller au contenu

Image quality normalization

25-image-quality.php is a compatibility facade. The active image-quality implementation lives under includes/pipeline/norm/media-quality/image/.

Module ownership

  • 10-color.php owns token normalization, filename extraction, the canonical color dictionary, and color detection.
  • 20-gallery.php owns normalized gallery URL extraction.
  • 30-policy-stats.php owns reason-code merging, counters, mutation policy lookup, evidence-source counters, and table identifier validation.
  • 40-apply.php owns the public ccx_image_quality_apply() stage and its database mutation/audit loop.
  • 90-compose.php loads the modules in historical dependency order and keeps the existing media-quality/evidence/color-evidence.php dependency explicit.

Compatibility contract

The public function names and the runtime call surface are unchanged. ccx_image_quality_apply() remains the public entrypoint. The refactor does not change mutation opt-in behavior, confidence thresholds, reason codes, SQL selection criteria, evidence decisions, or sync-log keys.

Change policy

Structural moves should remain behavior-neutral. Any future change to color aliases, evidence scoring, mutation confidence, replacement policy, or database write semantics must be reviewed as a behavioral change and covered by dedicated tests.