// ---------------- [ File: capability-skeleton-string/src/fuzzy_from_json_value.rs ]
crate::ix!();
#[cfg(test)]
mod test_sanskrit_yoga_full {
use super::*;
use serde_json::{from_str, Value};
// This is your **entire** JSON string literal, verbatim:
static SANSKRIT_YOGA_FULL_JSON: &str = r#"
{
"fields": {
"map": {
"SanskritYoga": {
"enum_docs": " Select this object to configure a single node in the string skeleton, tagged by its role.\n\n Note that we do not want the names of our nodes to be trivial or vague categories like \"foundations\", or to use arbitrary separations like \"beginner\", \"intermediate\", \"advanced\". \n\n It is always better for us to slice the chosen topic into *concrete subcomponents* that bear physical meaning. In the case of lockpicking, for example, we could write categories for types of locks, types of equipment, and techniques for entry. \n\n Categorizing into these three would be better than categorizing into \"beginner skills\", \"intermediate skills\", and \"advanced skills\". This same concept applies everywhere. \n\n The essential idea is that the chosen names should refer to *concrete subcomponents* bearing *physical meaning*.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Dispatch",
"variant_type": "struct_variant",
"variant_docs": " Select this variant at this position in the model to emit a `Dispatch` node in which each dispatch branch wraps a whole rooted subtree",
"variant_confidence": 0.9,
"variant_justification": "We choose a Dispatch node for the root to structure multiple top-level branches of Sanskrit yoga concepts.",
"fields": {
"name": "SanskritYoga",
"name_confidence": 0.95,
"name_justification": "We designate the entire domain root as SanskritYoga.",
"children": {
"PronunciationAndPhonetics": {
"branch_selection_likelihood": 16,
"branch_selection_likelihood_confidence": 0.9,
"branch_selection_likelihood_justification": "We allocate a slightly higher likelihood to foundational phonetic coverage."
},
"HistoricalTextsAndScripts": {
"branch_selection_likelihood": 14,
"branch_selection_likelihood_confidence": 0.9,
"branch_selection_likelihood_justification": "We include historical texts at a moderately high frequency."
},
"AsanaLineages": {
"branch_selection_likelihood": 15,
"branch_selection_likelihood_confidence": 0.9,
"branch_selection_likelihood_justification": "Physical posture lineages are central; we set a moderately high chance."
},
"BreathworkIntegration": {
"branch_selection_likelihood": 14,
"branch_selection_likelihood_confidence": 0.9,
"branch_selection_likelihood_justification": "Pranayama and related breathwork remain crucial, so we assign a solid selection likelihood."
},
"MeditativeApproaches": {
"branch_selection_likelihood": 13,
"branch_selection_likelihood_confidence": 0.9,
"branch_selection_likelihood_justification": "We incorporate meditative practices at a moderate likelihood."
},
"YogaChants": {
"branch_selection_likelihood": 14,
"branch_selection_likelihood_confidence": 0.9,
"branch_selection_likelihood_justification": "Chanting forms an important aspect; we keep it fairly likely."
},
"SupplementaryPractices": {
"branch_selection_likelihood": 14,
"branch_selection_likelihood_confidence": 0.9,
"branch_selection_likelihood_justification": "Additional combined practices are also quite relevant; we give a moderate-high chance."
}
},
"children_confidence": 0.9,
"children_justification": "These seven branches comprehensively span the domain’s core subdivisions.",
"ordering": {
"variant_name": "DifficultyAscending",
"variant_type": "unit_variant",
"variant_docs": " This variant starts with simpler branches first, advanced last."
}
}
}
]
},
"PronunciationAndPhonetics": {
"enum_docs": " Set this object to configure a single node in the string skeleton, tagged by its role.\n\n Note that we do not want the names of our nodes to be trivial or vague categories like \"foundations\", or to use arbitrary separations like \"beginner\", \"intermediate\", \"advanced\". \n\n The essential idea is that the chosen names should refer to *concrete subcomponents* bearing *physical meaning*.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Select the `Aggregate` variant to emit a structure aggregating several downstream branches. \n\n An Aggregate node should have at least 3 children. 3-7 is typical. More than 7 is possible where useful.\n\n We use `Aggregate` nodes to model components having children that always activate together (ie *branches that are always taken simultaneously within the domain model path flow*) \n\n `Aggregate` nodes are analogous to *struct data*.\n",
"variant_confidence": 0.92,
"variant_justification": "We use an Aggregate node to incorporate core phonetic subdivisions together.",
"fields": {
"name": "PronunciationAndPhonetics",
"name_confidence": 0.93,
"name_justification": "We define the official name capturing Sanskrit phonetic foundations.",
"children": {
"PhonemeClusters": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Clustering is always included for phonetics.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always include these phoneme clusters."
},
"VowelConjugations": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Vowels are critical; we keep them mandatory.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always include a focus on vowel usage."
},
"ConsonantArticulations": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Consonant articulation forms a major subset, so we include it.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always include these articulation details."
}
},
"children_confidence": 0.9,
"children_justification": "These three subdivisions capture critical aspects of Sanskrit phonetic structure.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"PhonemeClusters": {
"enum_docs": " Set this object to configure a single node in the string skeleton, tagged by its role.\n\n The essential idea is that the chosen names should refer to *concrete subcomponents* bearing *physical meaning*.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " Select this variant to emit a `LeafHolder` node at this tree location. \n\n A LeafHolder node is like the shell of an enum with unit variants only. \n\n `LeafHolder` nodes are typically used as the \"end-effectors\" within the context of a domain model. \n\n `LeafHolder` nodes each have an associated number of \"leaves\" representing the number of ways this end effector can manifest in practice.\n",
"variant_confidence": 0.85,
"variant_justification": "We end this branch early with a leaf node describing cluster variations.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "PhonemeClusters",
"name_confidence": 0.9,
"name_justification": "We designate these final leaves for details on Sanskrit phoneme clusters.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"VowelConjugations": {
"enum_docs": " Set this object to configure a single node in the string skeleton, tagged by its role.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Select the `Aggregate` variant to emit a structure aggregating several downstream branches. \n\n `Aggregate` nodes are analogous to *struct data*.\n",
"variant_confidence": 0.9,
"variant_justification": "We aggregate vowel-related subsets together here.",
"fields": {
"name": "VowelConjugations",
"name_confidence": 0.9,
"name_justification": "Core node for Sanskrit vowel groups.",
"children": {
"BasicVowels": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Essential for vowel study.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Always included."
},
"Diphthongs": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Critical for combined vowel sounds.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Always included."
}
},
"children_confidence": 0.9,
"children_justification": "These child branches cover standard and combined vowel forms.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"BasicVowels": {
"enum_docs": " Set this object to configure a single node in the string skeleton.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " Select this variant to emit a `LeafHolder` node at this tree location.\n",
"variant_confidence": 0.88,
"variant_justification": "We finalize basic vowel forms with direct leaf expansions.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "BasicVowels",
"name_confidence": 0.88,
"name_justification": "Identifies the fundamental Sanskrit vowels for leaf detail.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"Diphthongs": {
"enum_docs": " Set this object to configure a single node in the string skeleton.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " Select this variant to emit a `LeafHolder` node.\n",
"variant_confidence": 0.87,
"variant_justification": "Sanskrit diphthongs also terminate with direct expansions.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "Diphthongs",
"name_confidence": 0.87,
"name_justification": "Represents combined vowel forms as final leaves.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"ConsonantArticulations": {
"enum_docs": " Set this object to configure a single node in the string skeleton.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Select the `Aggregate` variant to emit a structure aggregating several downstream branches.\n",
"variant_confidence": 0.9,
"variant_justification": "We group consonant articulation subsets together.",
"fields": {
"name": "ConsonantArticulations",
"name_confidence": 0.9,
"name_justification": "We define articulation breakdown for consonants.",
"children": {
"GutturalSeries": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Guttural articulation is essential for Sanskrit consonants.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Always included."
}
},
"children_confidence": 0.9,
"children_justification": "We keep only one core child here for demonstration.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"GutturalSeries": {
"enum_docs": " Set this object to configure a single node in the string skeleton.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Select the `Aggregate` variant to model a grouping.\n",
"variant_confidence": 0.88,
"variant_justification": "We cluster deeper aspects of the guttural region in an Aggregate node.",
"fields": {
"name": "GutturalSeries",
"name_confidence": 0.88,
"name_justification": "Specifies guttural consonant clusters for deeper analysis.",
"children": {
"VelarStops": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Velar stops are a main subset of guttural consonants.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Included for completeness."
}
},
"children_confidence": 0.9,
"children_justification": "We highlight velar stops as the primary child.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"VelarStops": {
"enum_docs": " Set this object to configure a node in the skeleton.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Select the `Aggregate` variant to cluster multiple sub-branches.\n",
"variant_confidence": 0.88,
"variant_justification": "We gather all velar stop variants in one aggregate category.",
"fields": {
"name": "VelarStops",
"name_confidence": 0.88,
"name_justification": "Denotes the velar stop family of consonants.",
"children": {
"VelarStopVariants": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Specific variants are always included.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We incorporate all for completeness."
}
},
"children_confidence": 0.9,
"children_justification": "One direct sub-branch for these specialized stops.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"VelarStopVariants": {
"enum_docs": " Configure a leaf node.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " Select this variant to finalize as leaf expansions.\n",
"variant_confidence": 0.88,
"variant_justification": "We finalize granular velar stop details here.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "VelarStopVariants",
"name_confidence": 0.88,
"name_justification": "Identification of varied velar stop articulations.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"HistoricalTextsAndScripts": {
"enum_docs": " Set this object to configure a single node.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Select the `Aggregate` variant.\n",
"variant_confidence": 0.9,
"variant_justification": "We collect major textual references as an Aggregate structure.",
"fields": {
"name": "HistoricalTextsAndScripts",
"name_confidence": 0.9,
"name_justification": "Reflects key Sanskrit textual resources.",
"children": {
"VedicScriptures": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Vedic traditions are central references.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "They are always included."
}
},
"children_confidence": 0.9,
"children_justification": "This node focuses on the key scripts and texts.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"VedicScriptures": {
"enum_docs": " Single node config.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Aggregating specific subsets.\n",
"variant_confidence": 0.88,
"variant_justification": "We cluster major Vedic references here.",
"fields": {
"name": "VedicScriptures",
"name_confidence": 0.88,
"name_justification": "Represents the prime textual basis within Sanskrit tradition.",
"children": {
"RigVedaFocus": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Rig Veda is always included as a fundamental text.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always incorporate it."
}
},
"children_confidence": 0.9,
"children_justification": "We keep one child for brevity.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"RigVedaFocus": {
"enum_docs": " Leaf node for Vedic emphasis.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " A LeafHolder node for enumerating textual expansions.\n",
"variant_confidence": 0.85,
"variant_justification": "We finalize early with leaf expansions of Rig Veda study.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "RigVedaFocus",
"name_confidence": 0.85,
"name_justification": "Leaf expansions reference specific Rig Veda aspects.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"AsanaLineages": {
"enum_docs": " Node capturing posture traditions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We gather multiple posture-based subdivisions.\n",
"variant_confidence": 0.9,
"variant_justification": "Physical aspects of Sanskrit yoga are frequently aggregated.",
"fields": {
"name": "AsanaLineages",
"name_confidence": 0.9,
"name_justification": "Official aggregator for recognized yoga posture branches.",
"children": {
"PrimaryAsanas": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Core postures are mandatory.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always include them."
},
"LineageCommentaries": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Commentaries for lineage context are important.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We consistently include them."
}
},
"children_confidence": 0.9,
"children_justification": "Two key subdivisions for posture details and historical lineages.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"PrimaryAsanas": {
"enum_docs": " Leaf node.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " We finalize with direct posture expansions.\n",
"variant_confidence": 0.85,
"variant_justification": "Basic asanas concluded here as leaves.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "PrimaryAsanas",
"name_confidence": 0.85,
"name_justification": "Core posture listing as final leaves.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"LineageCommentaries": {
"enum_docs": " Node capturing commentaries across guru traditions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We gather distinct commentary threads.\n",
"variant_confidence": 0.85,
"variant_justification": "We need a deeper aggregator for lineage commentaries.",
"fields": {
"name": "LineageCommentaries",
"name_confidence": 0.85,
"name_justification": "Represents lineage-based interpretive materials.",
"children": {
"GuruLineageNotes": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "We always include some direct lineage documentation.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Essential to historical analysis."
}
},
"children_confidence": 0.85,
"children_justification": "We maintain a single main child aggregator for commentary specifics.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"GuruLineageNotes": {
"enum_docs": " Final expansions for lineage commentary.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " Summarize commentary as final leaves.\n",
"variant_confidence": 0.85,
"variant_justification": "We complete these notes at leaf level.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "GuruLineageNotes",
"name_confidence": 0.85,
"name_justification": "Provides enumerated expansions of lineage-based commentary.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"BreathworkIntegration": {
"enum_docs": " Node capturing breath-based expansions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Aggregates advanced breath techniques.\n",
"variant_confidence": 0.9,
"variant_justification": "We unify sub-branches of breath-related practices.",
"fields": {
"name": "BreathworkIntegration",
"name_confidence": 0.9,
"name_justification": "Represents combined breathwork domains in Sanskrit yoga.",
"children": {
"DynamicPranayama": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Dynamic approaches included consistently.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always adopt dynamic expansions."
},
"StillnessBreathing": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Quiet breath states are also crucial.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Always included."
}
},
"children_confidence": 0.9,
"children_justification": "Both dynamic and stillness modes are essential.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"DynamicPranayama": {
"enum_docs": " Node describing active breath expansions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Aggregates sub-threads of dynamic breathing.\n",
"variant_confidence": 0.85,
"variant_justification": "We gather advanced dynamic breath flows here.",
"fields": {
"name": "DynamicPranayama",
"name_confidence": 0.85,
"name_justification": "Denotes the active branch of pranayama techniques.",
"children": {
"EnergyExchangeFlows": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Core subtopic for dynamic breath transitions.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We consistently include them."
}
},
"children_confidence": 0.85,
"children_justification": "One main child for dynamic expansions.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"EnergyExchangeFlows": {
"enum_docs": " Final expansions for dynamic breath.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " We finalize dynamic flows as leaves.\n",
"variant_confidence": 0.85,
"variant_justification": "Leaf expansions describe subtle transitional flows.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "EnergyExchangeFlows",
"name_confidence": 0.85,
"name_justification": "Denotes enumerated dynamic flow specifics.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"StillnessBreathing": {
"enum_docs": " Early leaf node.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " We end here with leaves for calm breath states.\n",
"variant_confidence": 0.85,
"variant_justification": "We finalize quiet breath expansions directly.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "StillnessBreathing",
"name_confidence": 0.85,
"name_justification": "Represents gentle breath states enumerated as final leaves.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"MeditativeApproaches": {
"enum_docs": " Node representing concentration branches.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We gather meditative subdivisions.\n",
"variant_confidence": 0.9,
"variant_justification": "We unify sub-branches of meditation and concentration.",
"fields": {
"name": "MeditativeApproaches",
"name_confidence": 0.9,
"name_justification": "Central aggregator for introspective practices.",
"children": {
"MindfulnessCenters": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Mindfulness processes remain a core aspect.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Always included."
},
"MantraConvergence": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Chant-based meditative approach is included too.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always keep it."
}
},
"children_confidence": 0.9,
"children_justification": "These two branches cover essential meditative forms.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"MindfulnessCenters": {
"enum_docs": " Node describing focus points.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We gather key sub-threads of mindfulness.\n",
"variant_confidence": 0.85,
"variant_justification": "We want a small aggregator for distinct concentration types.",
"fields": {
"name": "MindfulnessCenters",
"name_confidence": 0.85,
"name_justification": "Points of internal meditative focus for aggregator usage.",
"children": {
"SinglePointedConcentration": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "One main approach used consistently.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We include it for completeness."
}
},
"children_confidence": 0.85,
"children_justification": "One child focusing on unitary attention.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"SinglePointedConcentration": {
"enum_docs": " Final leaf expansions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " We finalize unitive focus forms as leaves.\n",
"variant_confidence": 0.85,
"variant_justification": "Leaf expansions detail unique concentration techniques.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "SinglePointedConcentration",
"name_confidence": 0.85,
"name_justification": "Straight-to-leaf expansions for singular focus methods.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"MantraConvergence": {
"enum_docs": " Leaf node for chanting-based focus.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " We finalize these leaves for mantra-based concentration.\n",
"variant_confidence": 0.85,
"variant_justification": "A direct leaf set covers specialized chanting approaches.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "MantraConvergence",
"name_confidence": 0.85,
"name_justification": "Represents enumerated mantra-based meditations.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"YogaChants": {
"enum_docs": " Node capturing chanting expansions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We gather sub-branches for chanting.\n",
"variant_confidence": 0.9,
"variant_justification": "We unify melodic and rhythmic chanting in one aggregator.",
"fields": {
"name": "YogaChants",
"name_confidence": 0.9,
"name_justification": "Umbrella aggregator for chanting methods.",
"children": {
"MelodicChanting": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Melodic dimension is always considered.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We include it consistently."
},
"RhythmicChanting": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Rhythmic patterns are key as well.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always incorporate them."
}
},
"children_confidence": 0.9,
"children_justification": "Both melodic and rhythmic aspects are essential for chanting.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"MelodicChanting": {
"enum_docs": " Node capturing melody-based forms.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " Aggregates deeper melodic patterns.\n",
"variant_confidence": 0.85,
"variant_justification": "We detail melodic lines in a sub-aggregate.",
"fields": {
"name": "MelodicChanting",
"name_confidence": 0.85,
"name_justification": "Denotes melodic lines for Sanskrit chanting.",
"children": {
"RagaPatterns": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Raga-style patterns are always included for melodic chanting.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We keep them mandatory."
}
},
"children_confidence": 0.85,
"children_justification": "We highlight raga-based expansions as the single child.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"RagaPatterns": {
"enum_docs": " Final leaf expansions for melodic chanting.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " We conclude melodic expansions with direct leaves.\n",
"variant_confidence": 0.85,
"variant_justification": "The raga-based expansions are enumerated at leaf level.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "RagaPatterns",
"name_confidence": 0.85,
"name_justification": "Enumerates core melodic modes and structures.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"RhythmicChanting": {
"enum_docs": " Leaf node for rhythmic expansions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " We finalize direct enumerations for rhythmic chanting.\n",
"variant_confidence": 0.85,
"variant_justification": "We complete with final leaves for rhythmic patterns.",
"fields": {
"capstone": false,
"n_leaves": 10,
"name": "RhythmicChanting",
"name_confidence": 0.85,
"name_justification": "Represents enumerated rhythmic chanting techniques.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"SupplementaryPractices": {
"enum_docs": " Node aggregating advanced or combined practices.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We gather various integrated practices as an aggregator.\n",
"variant_confidence": 0.9,
"variant_justification": "We use an aggregator for advanced or auxiliary expansions.",
"fields": {
"name": "SupplementaryPractices",
"name_confidence": 0.9,
"name_justification": "Broad aggregator for additional specialized branches.",
"children": {
"AdvancedSanskritFusion": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "This advanced integrative path is included here.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "We always include it in deeper expansions."
}
},
"children_confidence": 0.9,
"children_justification": "One major advanced path is represented for further branching.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"AdvancedSanskritFusion": {
"enum_docs": " Node capturing integrative advanced threads.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We combine sub-branches of advanced Sanskrit synergy.\n",
"variant_confidence": 0.9,
"variant_justification": "We require a deeper aggregator to proceed into integrated expansions.",
"fields": {
"name": "AdvancedSanskritFusion",
"name_confidence": 0.9,
"name_justification": "Designates advanced integrative Sanskrit yoga aspects.",
"children": {
"NadiIntegration": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Nadi-based synergy is always included.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Included for advanced path coverage."
}
},
"children_confidence": 0.9,
"children_justification": "One child path leading deeper into synergy methods.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"NadiIntegration": {
"enum_docs": " Node focusing on subtle channel integration.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We gather advanced channel-based synergy.\n",
"variant_confidence": 0.88,
"variant_justification": "We keep aggregator to embed further expansions.",
"fields": {
"name": "NadiIntegration",
"name_confidence": 0.88,
"name_justification": "Emphasizes the channel-based expansions in advanced practice.",
"children": {
"CosmicUnionThreads": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "This node always included for culminating synergy steps.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Kept mandatory for deeper coverage."
}
},
"children_confidence": 0.88,
"children_justification": "Focus on a single advanced synergy path for clarity.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"CosmicUnionThreads": {
"enum_docs": " Node leading to culminating leaf expansions.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "Aggregate",
"variant_type": "struct_variant",
"variant_docs": " We unify final advanced expansions.\n",
"variant_confidence": 0.88,
"variant_justification": "We cluster the ultimate synergy step here.",
"fields": {
"name": "CosmicUnionThreads",
"name_confidence": 0.88,
"name_justification": "Represents the final aggregator before the ultimate leaf node.",
"children": {
"PinnacleSanskritRealization": {
"optional": false,
"optional_confidence": 0.8,
"optional_justification": "Designated as the culminating node, always included.",
"psome_likelihood": 100,
"psome_likelihood_confidence": 0.8,
"psome_likelihood_justification": "Mandatory for advanced synergy completion."
}
},
"children_confidence": 0.88,
"children_justification": "Single final child aggregator bridging to the capstone leaf.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
},
"PinnacleSanskritRealization": {
"enum_docs": " The ultimate leaf node.\n",
"enum_name": "StringSkeletonNode",
"has_justification": true,
"type": "complex_enum",
"variants": [
{
"variant_name": "LeafHolder",
"variant_type": "struct_variant",
"variant_docs": " Select this variant to emit a `LeafHolder` node.\n",
"variant_confidence": 0.95,
"variant_justification": "We designate this culminating node as the capstone leaf.",
"fields": {
"capstone": true,
"n_leaves": 10,
"name": "PinnacleSanskritRealization",
"name_confidence": 0.95,
"name_justification": "Marks the single apex node for advanced Sanskrit yoga synergy.",
"ordering": {
"variant_name": "None",
"variant_type": "unit_variant",
"variant_docs": " This variant let's the model pick"
}
}
}
]
}
},
"map_confidence": 0.9,
"map_justification": "We have constructed a six-level tree with consistent aggregator and dispatch branching, culminating in one capstone leaf."
},
"has_justification": true,
"struct_docs": "Use this object to specify our whole tree of generated data.",
"struct_name": "StringSkeleton",
"type": "struct"
}
"#;
#[traced_test]
fn test_parse_big_sanskrit_yoga_skeleton_verbatim() {
// 1) Parse the raw JSON string into a serde_json::Value
let val: serde_json::Value = from_str(SANSKRIT_YOGA_FULL_JSON)
.expect("Parsing JSON must succeed");
// 2) Attempt to parse into our JustifiedStringSkeleton with fuzzy logic
let result = JustifiedStringSkeleton::fuzzy_from_json_value(&val);
// 3) Check for success
match result {
Ok(skel) => {
// Basic check: we expect at least the "SanskritYoga" node in the map
assert!(skel.map().contains_key("SanskritYoga"),
"Should contain the SanskritYoga root node");
// Optionally, you can dig deeper to verify the Dispatch node
let root_node = skel.map().get("SanskritYoga").unwrap();
match root_node {
StringSkeletonNode::Dispatch { name, children, .. } => {
// Confirm the name
assert_eq!(name, "SanskritYoga");
// Confirm children includes e.g. "PronunciationAndPhonetics"
assert!(children.contains_key("PronunciationAndPhonetics"),
"Child 'PronunciationAndPhonetics' must exist");
// etc. as needed...
}
_ => panic!("Expected Dispatch variant for root 'SanskritYoga' node"),
}
// And so on. If all is well, it means the entire JSON
// was properly fuzzy-deserialized.
}
Err(e) => panic!("Fuzzy parse failed for big SanskritYoga JSON: {:#?}", e),
}
}
}