capability-core-string-skeleton 0.1.0

A Rust crate providing a framework to generate and manipulate skill tree skeletons using string-based node representations. It aggregates dispatch and leaf holder nodes into scalable domain models.
Documentation
// ---------------- [ File: capability-core-string-skeleton/src/core_skeletal_leaf_holder_node.rs ]
crate::ix!();

/// We generate this data structure by expanding and mapping each LeafHolder node in the
/// input set into a well-chosen set of unit variants. 
///
/// We perform this step based on our knowledge of the domain model and using
/// the input `n_leaves` parameter to determine how many leaves to grow for each key.
///
/// Typically, we like `n_leaves` parameter values around 10.
/// 
/// Each leaf should be well-decided and well-named. 
///
/// The leaf names should *not* be generic. 
///
/// The leaf names should *not* be meta-aware of their status as a "leaf". 
///
/// In other words: do not call a leaf `ModelLeaf4`, or `PotionLeaf`, for example.
/// 
/// The generation of this structure is where we actually build the domain model. 
/// 
/// Use your knowledge of the specific target domain to populate the leaves. 
/// 
/// For example, if we are designing potions, a LeafHolder name might be:
/// PotionEffectType
/// 
/// The leaves themselves for this key might be:
/// 
///     Amalgamation,
///     Antimagic,
///     Binding,
///     Chaos,
///     Communication,
///     Conservation,
///     Corruptive,
///     Defensive,
///     Divination,
///     Enhancement,
///     Enlightenment,
///     Environmental,
///     Euphoric,
///     Exploratory,
///     Fortune,
///     Gravity,
///     Healing,
///     HiveMind,
///     Illumination,
///     Illusionary,
///     Inversion,
///     Magnetism,
///     Metamagic,
///     Mimicry,
///     Offensive,
///     Oneiro,
///     Phase,
///     Polarity,
///     Portal,
///     Psychological,
///     Purification,
///     Replicative,
///     Resonance,
///     Restorative,
///     Revenant,
///     Revival,
///     Seismic,
///     Sensory,
///     Spiritual,
///     Summoning,
///     Sustenance,
///     Temporal,
///     Transformative,
///     Traversal,
///     Utility,
///     Wishing,
/// 
/// Please apply this pattern and same (or greater) level of leaf-choice quality to the input data. 
/// 
/// The result should be a lightweight json object mapping each LeafHolder to its leaf set. 
/// 
/// Each leaf identifier should be UpperCamelCase containing no whitespace and no punctuation.
///
#[derive(Hash,SaveLoad,PartialEq,Eq,AiJsonTemplate,Serialize,Deserialize,Getters, Setters, Builder, Debug, Clone)]
#[getset(get = "pub", set = "pub")]
pub struct CoreSkeletalLeafHolderNode {

    /// The LeafHolderName comes directly from the `StringSkeleton` model.
    /// It should always be specified as an UpperCamelCase identifier.
    ///
    #[builder(default)]
    name: LeafHolderName,

    /// The descriptor is a concise textual note describing this LeafHolder node’s role within the domain.
    ///
    /// ### Descriptor Guidance
    /// 
    /// Each **descriptor** should be:
    /// - Concise (1–2 short sentences).
    /// - Domain-relevant and self-contained—no meta-references like “This is a node about…” or “In the data structure…”.
    /// - Written so that when descriptors are read in a random top-down path from root to leaf, they form a coherent structured description of a possible scenario or state. 
    /// - Each node’s descriptor stands alone yet supports a descriptive flow when combined with its ancestors/descendants.
    ///
    #[builder(default)]
    descriptor: LeafHolderDescriptor,

    /// We use this field to map each LeafHolder node into its list of expanded variants.
    ///
    /// We generate leaf names by understanding and critically evaluating each characteristic of
    /// the input domain.
    ///
    #[builder(default)]
    leaves: Vec<LeafName>,
}

pub type LeafDescriptor       = String;
pub type LeafHolderDescriptor = String;
pub type LeafHolderName       = String;
pub type LeafName             = String;