# ============================================================
# src/accountable_record/stage_060_exports/base/constants.py
# ============================================================
"""Exports-stage constants and diagnostic codes (Layer 0).

WHY:
    Stage 060 validates a target repository's machine-readable EXPORT artifacts
    and reconciles the element exports against the normalized catalog from
    stage 050. This module is the stage's Layer 0 vocabulary: the AR.EX.*
    diagnostic codes plus the structural constants naming the export root, the
    export index, the element-export namespace, and the per-element export
    pair. Mirrors the constants modules of earlier stages.

OBS (consume the catalog; do not rebuild it):
    The set of elements that SHOULD have exports comes from state.catalog, not
    from re-walking data/elements/. Stage 060 reconciles element exports
    against that catalog.

OBS (reconciliation scope):

    Reconciliation is 1:1 ONLY within the element-export namespace
    (data/export/elements/). data/export/ also contains non-element exports
    (the export index counts ~299 artifacts vs ~142 catalog elements); those
    non-element exports are OUTSIDE this catalog-element reconciliation and are
    never treated as orphans against the element catalog.

OBS (boundary):
    s060 validates exports; it does NOT write generated files. write.py
    prepares/models write-intent only. s060 owns data/export/ (and beneath it
    data/export/elements/ and data/export/index.json); it does not own
    data/elements/ (s040), data/catalog/ (s050), or data/locks/ (later stage).

OBS (data-driven):
    No hardcoded element names, category list, or counts. The declared export
    path is read from the manifest; element exports are discovered structurally
    from the filesystem; the catalog set comes from state.

REQ:
    - No internal dependencies beyond the shared Layer 0 diagnostics module.
    - Concern is Concern.EXPORTS ("EX"), already defined in the shared
      diagnostics enum; 060 does not mint new concerns.
"""

STAGE_NAME = "stage_060_exports"

# Default export root, used when [exports].artifacts points at it (or when an
# explicit path is declared). A path anchor, not a hardcoded artifact list.
EXPORT_DIRNAME = "data/export"

# The element-export namespace beneath the export root. Reconciliation against
# the catalog is scoped to here.
EXPORT_ELEMENTS_SUBDIR = "elements"

# Per-element export PAIR (export side has no schema/examples, unlike the
# authored source quartet): element.json + checks.json.
EXPORT_ELEMENT_FILENAME = "element.json"
EXPORT_CHECKS_FILENAME = "checks.json"
EXPORT_PAIR_MEMBERS: tuple[str, ...] = (
    EXPORT_ELEMENT_FILENAME,
    EXPORT_CHECKS_FILENAME,
)

# Loci within an exported element.json for the structural cross-links, matching
# the authored side: identity.compact_id and classification.component_group.
EXPORT_ELEMENT_IDENTITY = "identity"
EXPORT_ELEMENT_CLASSIFICATION = "classification"
EXPORT_ELEMENT_COMPACT_ID_KEY = "compact_id"
EXPORT_ELEMENT_COMPONENT_GROUP_KEY = "component_group"
