7) Final Bundle
This section assembles the main SchemaFlow output object.
The final bundle contains:
summaryragchange_jsonimpact_jsonplansqlvalidation
This object is the reviewable handoff artifact for the notebook run. It collects the model-generated outputs, deterministic validation results, and optional retrieval metadata in one place, so a reviewer does not have to reconstruct the flow from separate cells.
The printed summary gives a compact view of the most important run-level information:
- parsed title
- parsed target
- number of RAG hits
- number of plan steps
- validation status
- validation issues
python
with trace("SchemaFlow Final Bundle", group_id=SCHEMAFLOW_TRACE_GROUP_ID, metadata={"stage": "final_bundle"}):
bundle = {
"summary": {"matched_tables": [], "impact_risks": impact_json.get("risks", []), "rag_hits": len(rag_file_search_results)},
"rag": {"vector_store_id": rag_vector_store_id, "file_search_results": rag_file_search_results},
"change_json": change_json,
"impact_json": impact_json,
"plan": plan_json,
"sql": sql_text,
"validation": validation,
}
trace_function_result("Final bundle assembled", output_obj=bundle)
flush_traces()
pretty({"title": change_json.get("title"), "target": ".".join([x for x in [change_json.get("target_schema"), change_json.get("target_table")] if x]), "rag_hits": len(rag_file_search_results), "plan_steps": len(plan_json.get("plan_steps", [])), "valid": validation.get("valid"), "issues": validation.get("issues", [])})