[package]
name = "m1nd-core"
version = "1.0.0"
edition = "2021"
description = "Core graph engine and reasoning primitives for m1nd."
license = "MIT"
repository = "https://github.com/maxkle1nz/m1nd"

[dependencies]
thiserror = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
smallvec = { workspace = true }
parking_lot = { workspace = true }
rayon = { workspace = true }
static_assertions = { workspace = true }
bincode = "1.3"

# OPTIONAL: pure-Rust static embeddings (model2vec). OFF by default.
# `fancy-regex` avoids the oniguruma C dependency; `hf-hub` lets from_pretrained
# accept a local dir path (and optionally fetch). The dep is NOT compiled unless
# the `embed` feature is enabled.
model2vec-rs = { version = "0.2.1", default-features = false, features = ["fancy-regex", "hf-hub"], optional = true }

[features]
default = []
# Optional real local semantic embedding for `seek` using FAST STATIC embeddings
# (model2vec / potion-retrieval-32M). A real upgrade over label-only trigrams but
# NOT transformer-grade; the ONNX/bge tier is the path for maximal quality.
embed = ["dep:model2vec-rs"]

[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
m1nd-ingest = { path = "../m1nd-ingest" }
cargo_metadata = { workspace = true }

[[bench]]
name = "core_benchmarks"
harness = false

# ═══════════════════════════════════════════════════════════════════
# @m1nd — Agent-readable methodology metadata. Cargo ignores this.
# Any LLM agent or tool calling `cargo metadata` receives this.
# ═══════════════════════════════════════════════════════════════════
[package.metadata.m1nd]
methodology = "TEMPONIZER + RUN Technology (EMCA)"
boot_file = ".m1nd/boot/temponizer.json"

[package.metadata.m1nd.modules.git_history]
classification = "IGNITION"
primitives = ["temporal::CoChangeMatrix", "git log"]
pattern = "Parse → Feed existing matrix → Detect ghost edges"

[package.metadata.m1nd.modules.taint]
classification = "WIRING"
primitives = ["flow::FlowEngine", "epidemic::EpidemicEngine"]
pattern = "Compose flow + epidemic → Cross-ref vs security boundaries"

[package.metadata.m1nd.modules.twins]
classification = "WIRING"
primitives = ["topology (degree distribution)", "cosine_similarity"]
pattern = "Compute signature vectors → Pairwise cosine → Threshold filter"

[package.metadata.m1nd.modules.refactor]
classification = "HARDENING"
primitives = ["topology::CommunityDetector", "topology::BridgeDetector", "counterfactual::CounterfactualEngine"]
pattern = "Detect communities → Find bridges → Simulate extraction → Score risk"

[package.metadata.m1nd.modules.runtime_overlay]
classification = "HARDENING"
primitives = ["graph::Graph (activation arrays)", "temporal::TemporalDecayScorer"]
pattern = "Ingest OTel spans → Map to nodes → Accumulate heat → Boost activation"
