"""
Assay: AI evidence that's harder to fake and easier to verify.

- Scan codebases for uninstrumented LLM call sites
- Instrument SDKs (OpenAI, Anthropic, LangChain) with 2-line patches
- Produce signed proof packs (receipts, manifest, Ed25519 signature)
- Verify evidence integrity (exit 0/1/2/3: pass / honest failure / tampered / bad input)
- Passport lifecycle: mint, sign, verify, status, challenge, supersede, diff
"""

from importlib.metadata import version, PackageNotFoundError

try:
    __version__ = version("assay-ai")
except PackageNotFoundError:
    __version__ = "0.0.0-dev"

from .guardian import GuardianVerdict, no_coherence_by_dignity_debt
from .health import GraceConfig, is_grace_window
from .store import AssayStore, get_default_store, emit_receipt
from .checkpoints import (
    CheckpointEvaluationArtifact,
    CheckpointRequestArtifact,
    CheckpointResolutionArtifact,
    CheckpointValidationError,
    KernelBundleVerificationResult,
    LifecycleVerificationResult,
    OutboundEmailCheckpointFlow,
    verify_outbound_email_kernel_bundle,
    verify_outbound_email_lifecycle,
)
from .checkpoint_views import (
    CheckpointAttemptArtifactSet,
    CheckpointAttemptView,
    build_outbound_email_checkpoint_attempt_view,
    build_outbound_email_checkpoint_attempt_view_from_trace,
    load_outbound_email_checkpoint_attempt_artifacts,
    load_outbound_email_checkpoint_attempt_view,
)
from .epistemic_kernel import (
    ArtifactVerificationResult,
    BeliefUpdateArtifact,
    ClaimAssertionArtifact,
    ClaimChainVerificationResult,
    ClaimSupportChangeArtifact,
    CONTRADICTION_REGISTRATION_RECEIPT_TYPE,
    CONTRADICTION_RESOLUTION_RECEIPT_TYPE,
    DENIAL_RECORD_RECEIPT_TYPE,
    BELIEF_UPDATE_RECEIPT_TYPE,
    ContradictionRegistrationArtifact,
    ContradictionResolutionArtifact,
    DenialRecordArtifact,
    PROOF_BUDGET_SNAPSHOT_RECEIPT_TYPE,
    ProofBudgetSnapshotArtifact,
    adapt_bridge_denial_to_denial_record,
    adapt_contradiction_receipt_to_registration,
    adapt_checkpoint_decision_to_claim_assertion,
    adapt_checkpoint_decision_to_proof_budget_snapshot,
    adapt_checkpoint_evaluation_to_contradiction_grounded_claims,
    adapt_checkpoint_evaluation_to_contradiction_registrations,
    adapt_guardian_refusal_to_denial_record,
    adapt_ccio_refusalstone_to_denial_record,
    adapt_checkpoint_resolution_to_contradiction_resolutions,
    adapt_checkpoint_resolution_to_denial_record,
    emit_belief_update,
    emit_claim_assertion,
    emit_claim_support_change,
    emit_contradiction_registration,
    emit_contradiction_resolution,
    emit_denial_record_to_episode,
    emit_denial_record_to_trace,
    emit_proof_budget_snapshot,
    verify_belief_update,
    verify_claim_artifact_set,
    verify_claim_support_chain,
    verify_contradiction_registration_artifact,
    verify_contradiction_resolution_artifact,
    verify_denial_record,
    verify_proof_budget_snapshot,
)
from .episode import (
    Checkpoint,
    Episode,
    EpisodeClosedError,
    EpisodePersistenceError,
    EpisodeState,
    EpisodeStateError,
    MEMORY_GRAPH,
    MemoryRecord,
    Obligation,
    ProofPackArtifact,
    Receipt,
    SettlementOutcome,
    SettlementRecord,
    Verdict,
    evaluate_completeness,
    emit_proof_pack,
    get_memory_record,
    open_episode,
    mark_execution_complete,
    persist_episode,
    start_execution,
    settle_episode,
    verify_checkpoint,
    verify_pack,
)

__all__ = [
    "__version__",
    "GuardianVerdict",
    "no_coherence_by_dignity_debt",
    "GraceConfig",
    "is_grace_window",
    "AssayStore",
    "get_default_store",
    "emit_receipt",
    "CheckpointRequestArtifact",
    "CheckpointEvaluationArtifact",
    "CheckpointResolutionArtifact",
    "CheckpointValidationError",
    "KernelBundleVerificationResult",
    "LifecycleVerificationResult",
    "OutboundEmailCheckpointFlow",
    "verify_outbound_email_kernel_bundle",
    "verify_outbound_email_lifecycle",
    "CheckpointAttemptArtifactSet",
    "CheckpointAttemptView",
    "build_outbound_email_checkpoint_attempt_view",
    "build_outbound_email_checkpoint_attempt_view_from_trace",
    "load_outbound_email_checkpoint_attempt_artifacts",
    "load_outbound_email_checkpoint_attempt_view",
    "ArtifactVerificationResult",
    "BeliefUpdateArtifact",
    "ClaimAssertionArtifact",
    "ClaimChainVerificationResult",
    "ClaimSupportChangeArtifact",
    "ContradictionRegistrationArtifact",
    "ContradictionResolutionArtifact",
    "DenialRecordArtifact",
    "DENIAL_RECORD_RECEIPT_TYPE",
    "BELIEF_UPDATE_RECEIPT_TYPE",
    "CONTRADICTION_REGISTRATION_RECEIPT_TYPE",
    "CONTRADICTION_RESOLUTION_RECEIPT_TYPE",
    "ProofBudgetSnapshotArtifact",
    "PROOF_BUDGET_SNAPSHOT_RECEIPT_TYPE",
    "emit_belief_update",
    "emit_claim_assertion",
    "emit_claim_support_change",
    "emit_contradiction_registration",
    "emit_contradiction_resolution",
    "emit_denial_record_to_episode",
    "emit_denial_record_to_trace",
    "emit_proof_budget_snapshot",
    "verify_belief_update",
    "verify_claim_artifact_set",
    "verify_claim_support_chain",
    "verify_contradiction_registration_artifact",
    "verify_contradiction_resolution_artifact",
    "verify_denial_record",
    "verify_proof_budget_snapshot",
    "adapt_bridge_denial_to_denial_record",
    "adapt_contradiction_receipt_to_registration",
    "adapt_checkpoint_decision_to_claim_assertion",
    "adapt_checkpoint_decision_to_proof_budget_snapshot",
    "adapt_checkpoint_evaluation_to_contradiction_grounded_claims",
    "adapt_checkpoint_evaluation_to_contradiction_registrations",
    "adapt_checkpoint_resolution_to_contradiction_resolutions",
    "adapt_checkpoint_resolution_to_denial_record",
    "adapt_guardian_refusal_to_denial_record",
    "adapt_ccio_refusalstone_to_denial_record",
    # Episode SDK (Mode 2: Runtime, Mode 3: Settlement)
    "Checkpoint",
    "Episode",
    "EpisodeClosedError",
    "EpisodePersistenceError",
    "EpisodeState",
    "EpisodeStateError",
    "MEMORY_GRAPH",
    "MemoryRecord",
    "Obligation",
    "ProofPackArtifact",
    "Receipt",
    "SettlementOutcome",
    "SettlementRecord",
    "Verdict",
    "evaluate_completeness",
    "emit_proof_pack",
    "get_memory_record",
    "open_episode",
    "mark_execution_complete",
    "persist_episode",
    "start_execution",
    "settle_episode",
    "verify_checkpoint",
    "verify_pack",
]
