aristo-core 0.5.1

Aristo SDK core: shared types, .aristo/index.toml schema, B5b verification, language registry.
Documentation
//! §13 canon-and-matching: client trait, wire types, and impls.
//!
//! See `../aretta-sdk/docs/launch/canon-strategy.md` and
//! `../aretta-sdk/docs/mockups/13-canon-and-matching/` for the
//! design archive (the contract; this module implements it).
//!
//! Module layout:
//!
//! - [`types`]: request/response shapes for the three Phase 1
//!   endpoints (`/canon/match`, `/canon/entry/<id>`,
//!   `/canon/request-verify`). Serialize to JSON (wire) and TOML
//!   (fixtures + on-disk cache).
//! - [`client`]: the [`CanonClient`] trait + [`CanonError`] +
//!   [`AuthError`].
//! - [`noop_client`]: [`NoopCanonClient`] — free-tier / opt-out
//!   path; every method returns [`CanonError::NotEnabled`].
//! - [`mock_client`]: [`MockCanonClient`] — fixture-driven for
//!   tests; reads canned TOML from `ARISTO_CANON_FIXTURE` or an
//!   explicit path.
//! - [`auth`]: token resolution and persistence — env var
//!   (`ARETTA_TOKEN`) → `~/.config/aristo/credentials` →
//!   [`AuthError::NoToken`]. The [`Token`] newtype
//!   redacts itself in `Debug` output to prevent accidental
//!   logging of credentials.
//! - [`http_client`]: [`HttpCanonClient`] — `ureq`-backed
//!   blocking impl. Pure response-mapping helpers (`map_response`
//!   in [`http_client`]) are split from the transport so every
//!   status-code branch is unit-testable without a real network call.
//! - [`cache`]: [`CanonMatchesFile`] — schema + atomic I/O for
//!   `.aristo/canon-matches.toml`. Three buckets per annotation:
//!   `pending_matches` (surfaced, not reviewed), `accepted_matches`
//!   (bound), `rejected_matches` (suppressed until text changes).
//!   Cache-hit semantics per L5's invalidation rules.
//! - [`instrumentation`]: P-008 bundle helpers — union across
//!   accepted matches (records deduped by `accessor_id`, companions
//!   by `(symbol, file)`, per-`payload_ref` groups on provenance
//!   mismatch) + TOML-persistence null sanitizing.
//! - [`mod@reconcile`]: source-authoritative reconciliation of the cache
//!   against a raw (pre-validation, unexcluded) source walk — prune
//!   rows for deleted annotations, demote rows whose source id lost
//!   its canon prefix.
//!
//! **Phase 1 scope**: no verification execution. The `verification`
//! block on [`CanonMatch`] is informational
//! metadata about what Phase 2 will eventually run; the SDK ignores
//! it. See
//! `../aretta-sdk/docs/mockups/13-canon-and-matching/_deferred/verification-execution.md`.

pub mod auth;
pub mod cache;
pub mod client;
pub mod http_client;
pub mod instrumentation;
pub mod mock_client;
pub mod noop_client;
pub mod reconcile;
pub mod rewrite;
pub mod types;

pub use auth::Token;
pub use cache::{
    AcceptedMatch, CacheEntry, CacheMeta, CanonMatchesFile, Disposition, PendingMatch,
    RejectedMatch,
};
pub use client::{AuthError, CanonClient, CanonError};
pub use http_client::{HttpCanonClient, DEFAULT_BASE_URL};
pub use instrumentation::{
    sanitize_bundle_for_persistence, union_accepted_bundles, union_bundles, BundleUnion,
};
pub use mock_client::MockCanonClient;
pub use noop_client::NoopCanonClient;
pub use reconcile::{raw_live_ids, reconcile, RawLiveIds, ReconcileReport};
pub use rewrite::{compute_rewrite, AcceptRewriteRequest, AttributeRewrite, RewriteError};
pub use types::{
    synthesize_phase1_linked, AnnotationMatchInput, BundleCompanion, BundleCompileCheck,
    BundleProvenance, CanonCatalogue, CanonCatalogueEntry, CanonEntry, CanonMatch,
    CanonMatchRequest, CanonMatchResponse, ClusterSuggestion, InstrumentationBundle,
    InstrumentationRecord, PrefixTier, RecordLanding, RecordPresence, References, Relationship,
    RequestVerifyBody, RequestVerifyResponse, SuggestedEntry, VerificationMetadata,
};