Skip to main content

aria_engine_core/
policy.rs

1use serde::{Deserialize, Serialize};
2
3/// Match policy for ED (graph edit distance) — ℙ3
4#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
5#[serde(rename_all = "snake_case")]
6pub enum MatchPolicy {
7    /// Leave G unchanged
8    #[default]
9    Identity,
10    /// Apply one elementary edit (add/delete/relabel node or edge)
11    OneEdit,
12    /// Rebuild G to match target G*
13    RebuildGStar,
14    /// Absorb z into the nearest node within τ instead of appending (𝕃3).
15    ///
16    /// The sub-linear-growth policy: a latent closer than `merge_tau` to an
17    /// existing node is merged into it (EMA embedding update, timestamp
18    /// refresh — spec §5.3), so `|V| = O(T^β)` with `β ≤ 1` instead of one
19    /// node per Match. Requires a metric index to stay `O(log |V|)` (ℙ5).
20    Merge,
21}
22
23/// Diffusion policy for Diff_G(z)
24#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
25#[serde(rename_all = "snake_case")]
26pub enum DiffPolicy {
27    /// Leave z unchanged
28    #[default]
29    Identity,
30    /// Flip/perturb latent
31    Flip,
32    /// Graph-conditioned diffusion step
33    GraphConditioned,
34}