1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
// ---------------- [ File: capability-stripped-string-skeleton/src/grower_stripped_string_skeleton.rs ]
crateix!;
/// We want to create a stripped version of our `StringSkeleton`, called a *StrippedStringSkeleton*.
///
/// The StrippedStringSkeleton should contain a flattened list of all nodes in the model tree.
///
/// Each entry in `items` corresponds to one `StrippedNodeData`, referencing children by name if
/// any exist.
///
/// The `StrippedStringSkeleton` differs from the `StringSkeleton` in the following way:
/// - `StringSkeleton` represents the full payload.
/// - In certain cases, we need something lighter. `StrippedStringSkeleton` fills this niche.
/// - In a typical system flow, we maintain the StringSkeleton elsewhere and, although it is more computationally intensive, we can refer to it when necessary.
///
/// Here we need simply the bare scaffold.
///
/// In this structure, we do not need parameter selection justification/confidence levels.
///
/// Here we want to track each node by name with its children and its kind
/// {Dispatch,Aggregate,LeafHolder}
///
/// - The role of this data structure is to immediately and directly indicate the shape of the
/// model scaffold. The shape of this tree should be *exactly* the same as the StringSkeleton.
///
/// Here we should keep intact the information about whether or not a branch is optional.
///
/// Here we track the selection-probability field associated with each branch.
/// We use this probability field to make decisions during randomization about which model paths to traverse and how frequently.
/// The probability field should be set based on domain knowledge about the concrete domain represented by the tree.
///
/// ### Example Output Format
///
/// Below is an **example** for illustration only (note how it avoids referencing a specific domain and uses placeholders instead):
///
/// ```json
/// [
/// {
/// "name": "CoreModule",
/// "kind": "Aggregate",
/// "descriptor": "Collects baseline components essential for broad functionality.",
/// "children": [
/// {
/// "name": "InitializationBlock",
/// "optional": false,
/// "probability": 1.0
/// },
/// {
/// "name": "LifecycleHooks",
/// "optional": false,
/// "probability": 1.0
/// }
/// ]
/// },
/// {
/// "name": "InitializationBlock",
/// "kind": "Dispatch",
/// "descriptor": "Switches among methods for setting initial parameters or states.",
/// "children": [
/// {
/// "name": "ParameterSetup",
/// "optional": false,
/// "probability": 1.0
/// },
/// {
/// "name": "ResourceProvision",
/// "optional": false,
/// "probability": 1.0
/// }
/// ]
/// },
/// {
/// "name": "ParameterSetup",
/// "kind": "LeafHolder",
/// "descriptor": "Defines various ways to assign base parameters before use.",
/// "n_leaves": 9
/// },
/// {
/// "name": "ResourceProvision",
/// "kind": "LeafHolder",
/// "descriptor": "Outlines techniques for supplying necessary resources or data.",
/// "n_leaves": 9,
/// "capstone": true
/// },
/// {
/// "name": "LifecycleHooks",
/// "kind": "LeafHolder",
/// "descriptor": "Houses event triggers or callback methods tied to major milestones.",
/// "n_leaves": 9
/// }
/// ]
/// ```
///
/// When generating this structure, please keep the following information in mind:
/// 1. Output your final stripped skeleton **as an array of JSON objects**, one per node.
/// 2. For each node:
/// - Provide its `name`, `kind`, `descriptor`, and if non-leaf, its `children`.
/// - For leaf nodes, provide `n_leaves` and `capstone` if applicable.
/// 3. Make sure **descriptors** are domain-focused and remain cohesive when read in a hierarchy from root to leaf.
/// 4. No fields other than the ones mentioned: **no** confidence, **no** justification, **no** extraneous data.
///
/// By following these guidelines, your descriptors will naturally form a coherent mini-narrative for any domain you apply them to.
///
/// To make this selection, categorize each type of node in our skill tree scaffold.
/// To generate this structure, describe a single child entry beneath a `Dispatch` or `Aggregate` node.
/// This description includes:
/// - `name`: A unique identifier (written in UpperCamelCase, no punctuation).
/// - `optional`: Indicates if this branch can be skipped.
/// - `probability`: The relative likelihood of including this child.