# Copyright (C) 2026 Wilhelmus Dingenus de Pooter
# SPDX-License-Identifier: GPL-3.0-or-later
"""
sourceval/ — ENC ⟷ external-source reconciliation (the Source Validation tab).
================================================================================

A second, complementary validator. Where the Auditor checks *conformance to the
S-58 standard*, the Source Validator checks *correspondence to an external source
of truth* — the authority's own AtoN / wreck / mark registers.

Architecture mirrors the rest of the plugin: a pure-Python, GDAL-free, GUI-free
**core** (this package) that is fully headless-testable, with thin QGIS adapters
on top.

    recipe.py       the user-defined mapping (ENC layer ⟷ source), JSON on disk
    sources.py      SourceFeature + providers (in-memory for tests; QGIS layer)
    enc_features.py extract ENC point features natively, attrs resolved to labels
    checks.py       the four reconciliation checks (as report CheckMeta)
    reconcile.py    the engine — runs the four checks, emits a Report

Scope: POINT recipes (v1 behaviour — a per-recipe buffer is the proximity
tolerance) and LINE recipes (v2 — geometry conflation with a generalization
dead-band, see geomatch; buffer_m is the geometry tolerance). Enumerated
attributes bind on human-readable labels ("red ⟷ rood"), not raw codes.
Areas are the next extension (boundary-as-line + symmetric-difference).
"""

from .recipe import Recipe, AttributeMapping, RECIPE_VERSION
from .sources import SourceFeature, MemorySource
from .enc_features import (ChartFeature, extract_points, extract_lines,
                           extract_lines_multi, extract_areas)
from .reconcile import (reconcile, reconcile_lines, reconcile_areas,
                        distance_m, point_in_coverage, prepare_coverage)
from .report_html import validator_html
from . import checks
from . import geomatch
from . import areamatch

__all__ = [
    "Recipe", "AttributeMapping", "RECIPE_VERSION",
    "SourceFeature", "MemorySource",
    "ChartFeature", "extract_points", "extract_lines", "extract_lines_multi",
    "extract_areas",
    "reconcile", "reconcile_lines", "reconcile_areas", "distance_m",
    "point_in_coverage", "prepare_coverage", "validator_html", "checks",
    "geomatch", "areamatch",
]
