"""SelfModel — frozen-at-checkpoint identity for an arborist agent.

Implements ticket #000014. A SelfModel binds *what the agent says it
is* to bytes a verifier can recompute. Distinct from ``providence_cache``
(per-cache_key answers) and ``audit_events`` (per-event chain) — a
SelfModel is the agent's identity at a point in time, with capability
claims that can be re-evaluated and falsified.

Public surface:

- :class:`SelfModel` — frozen dataclass; ``selfmodel_root`` derived from
  canonical body bytes.
- :class:`CapabilityClaim` — a bench-derived assertion the SelfModel
  ships with; falsifiable by re-running the cited eval_digest.
- :func:`snapshot` — build a SelfModel from current store state.
- :func:`store_snapshot` — write a SelfModel to ``selfmodel_records`` +
  emit a ``selfmodel_snapshot_landed`` audit event.
- :func:`falsify` — flip a SelfModel's state to ``falsified``;
  emits ``selfmodel_falsified`` audit event.
- :func:`mark_stale` — flip a SelfModel's state to ``stale``;
  emits ``selfmodel_marked_stale`` audit event.
- :func:`load` / :func:`latest` — read SelfModels back.

Hard rules (per ticket #000014):

- SelfModel is hard-hash committed (enters proof path).
- Soft self-impressions live in sidecars, never in the SelfModel
  preimage.
- Default ``governance_policy.selfmodel_binding=False`` keeps prior
  cache valid; opt-in flipping invalidates.
"""

from __future__ import annotations

from arborist.selfmodel.canonical import (
    SCHEMA_VERSION,
    CapabilityClaim,
    SelfModel,
    canonical_body,
    canonical_claim,
    claim_hash,
    selfmodel_root,
)
from arborist.selfmodel.falsify import falsify, mark_stale
from arborist.selfmodel.snapshot import snapshot
from arborist.selfmodel.store import latest, load, store_snapshot

__all__ = [
    "SCHEMA_VERSION",
    "SelfModel",
    "CapabilityClaim",
    "canonical_body",
    "canonical_claim",
    "claim_hash",
    "selfmodel_root",
    "snapshot",
    "store_snapshot",
    "load",
    "latest",
    "falsify",
    "mark_stale",
]
