validate
Validate the entire context configuration. Called automatically during SWML rendering, but can be called manually to catch errors early.
Checks performed:
- At least one context exists.
- A single context is named
"default". - Every context has at least one step.
- Each context’s
initial_step(if set) references a real step in that context. - All context-level
valid_contextsreferences point to contexts that exist in the builder. - All step-level
valid_stepsreferences point to real step names (or the literal"next") in the same context. - All step-level
valid_contextsreferences point to contexts that exist in the builder. - All
gather_infoquestion keys are unique within a single step. - All
gather_infocompletion_actiontargets point to"next_step"or a real step in the same context. - No user-defined SWAIG tool collides with the reserved native tool names (
next_step,change_context,gather_submit).
Returns
void — Throws Error with a descriptive message if validation fails.