//! kei-atom-discovery — shared substrate-atom discovery primitives.
//!
//! Single authoritative implementation of:
//!   - `AtomMeta` / `AtomKind` / `SideEffect` — locked frontmatter schema
//!   - `parse_frontmatter` — YAML split with 64 KiB cap (billion-laughs guard)
//!   - `discover_atoms` — walks `<root>/*/atoms/*.md`, symlink-safe
//!   - `parse_wikilink` — strict `[[target]]` matcher
//!   - `safe_join` — path-traversal-safe base+rel join
//!
//! Both `kei-sage` and `kei-runtime` consume this crate — no parallel
//! frontmatter structs, no parallel YAML parsers.

pub mod error;
pub mod frontmatter;
pub mod walk;

pub use error::Error;
pub use frontmatter::{
    parse_frontmatter, AtomKind, AtomMeta, Frontmatter, Lineage, SideEffect, TaxonomyFacets,
    MAX_FRONTMATTER_BYTES,
};
pub use walk::{
    classify_wikilink, discover_atoms, is_atom_target, parse_wikilink, safe_join, split_atom_id,
    WikilinkTarget,
};
