capability_full_annotated_leaf_holders/grower_full_annotated_leaf_holders.rs
1// ---------------- [ File: capability-full-annotated-leaf-holders/src/grower_full_annotated_leaf_holders.rs ]
2crate::ix!();
3
4/// To create this structure, we consider the topology of our model and create for each
5/// LeafHolder *leaf* a textual descriptor which reads like a handwritten observation taken by
6/// a practitioner in the domain.
7///
8/// For example, a note-taking observer may be recording notes while studying the model out in
9/// the field.
10///
11#[derive(Hash,SaveLoad,AiJsonTemplate,Debug, Clone, PartialEq, Eq, Builder, Getters, Setters, Serialize, Deserialize)]
12#[builder(setter(into))]
13#[getset(get = "pub", set = "pub")]
14pub struct AnnotatedLeafHolderExpansions {
15
16 /// This field holds *verbatim* the lower-kebab-case target-name belonging to the tree grow process.
17 #[builder(default = "\"target\".to_string()")]
18 #[serde(default)]
19 target_name: String,
20
21 /// Each key in this map is the name of a LeafHolder.
22 /// Each value in this map is a vector of AnnotatedLeaves belonging to this LeafHolder
23 annotated_leaf_holders: Vec<AnnotatedLeafHolderNode>,
24}
25
26#[derive(Hash,PartialEq,Eq,SaveLoad,AiJsonTemplate,Serialize,Deserialize,Getters,Setters,Builder,Debug,Clone)]
27#[getset(get = "pub", set = "pub")]
28pub struct AnnotatedLeafHolderNode {
29
30 /// This name comes directly from the `StringSkeleton` model.
31 ///
32 /// It should always be specified as an UpperCamelCase identifier.
33 ///
34 leaf_holder_name: LeafHolderName,
35
36 annotated_leaves: Vec<AnnotatedLeaf>,
37}
38
39/// Each AnnotatedLeaf specifies clearly a leaf in our domain model tree.
40///
41#[derive(Hash,SaveLoad,AiJsonTemplate,Debug,Clone,PartialEq,Eq,Builder,Getters,Setters,Serialize,Deserialize)]
42#[builder(setter(into))]
43#[getset(get = "pub", set = "pub")]
44pub struct AnnotatedLeaf {
45
46 /// Each LeafName must be UpperCamelCase containing no punctuation and no spaces.
47 ///
48 leaf_name: LeafName,
49
50 /// To generate each descriptor, follow the pattern specified above. Keep it terse but be
51 /// descriptive. Write from the perspective of an apex observer studying the target domain.
52 ///
53 /// Each generated descriptor should be terse and useful.
54 ///
55 /// Do not generate any flowery language whatsoever.
56 ///
57 /// Remember that there also should not be any meta-language here such as "A handwritten notebook
58 /// observation:" or "A practitioner's note:".
59 leaf_descriptor: LeafDescriptor,
60}