bigquery-agent-analytics 0.2.2__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. bigquery_agent_analytics-0.3.0/CHANGELOG.md +857 -0
  2. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/PKG-INFO +3 -1
  3. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/SDK.md +66 -6
  4. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/remote_function/dispatch.py +18 -0
  5. bigquery_agent_analytics-0.3.0/docs/README.md +67 -0
  6. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/context_graph_v2_design.md +15 -2
  7. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/context_graph_v3_design.md +18 -2
  8. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/design.md +15 -0
  9. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_bka_measurement.md +153 -0
  10. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_bq_bundle_mirror.md +177 -0
  11. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_bundle_loader.md +140 -0
  12. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_diagnostics.md +141 -0
  13. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_orchestrator_swap.md +106 -0
  14. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_plan_parser.md +121 -0
  15. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_plan_resolver.md +92 -0
  16. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_retry_loop.md +180 -0
  17. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_revalidate_cli.md +202 -0
  18. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_revalidation.md +200 -0
  19. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_rollout_guide.md +443 -0
  20. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_runtime_fallback.md +122 -0
  21. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_runtime_registry.md +111 -0
  22. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_runtime_target.md +218 -0
  23. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_scaffolding.md +209 -0
  24. bigquery_agent_analytics-0.3.0/docs/extractor_compilation_template_renderer.md +106 -0
  25. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/implementation_plan_remote_function.md +34 -5
  26. bigquery_agent_analytics-0.3.0/docs/ontology/binding-validation.md +154 -0
  27. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology/cli.md +27 -0
  28. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology/compilation.md +27 -0
  29. bigquery_agent_analytics-0.3.0/docs/ontology/concept-index.md +277 -0
  30. bigquery_agent_analytics-0.3.0/docs/ontology/ontology-build.md +114 -0
  31. bigquery_agent_analytics-0.3.0/docs/ontology/validation.md +157 -0
  32. bigquery_agent_analytics-0.3.0/docs/ontology_runtime_reader.md +190 -0
  33. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/README.md +7 -0
  34. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/.gitignore +9 -0
  35. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/A2A_JOINT_LINEAGE.md +188 -0
  36. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/BQ_STUDIO_WALKTHROUGH.md +178 -0
  37. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/DATA_LINEAGE.md +97 -0
  38. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/DEMO_NARRATION.md +238 -0
  39. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/README.md +152 -0
  40. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/analyst_agent/__init__.py +21 -0
  41. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/analyst_agent/agent.py +97 -0
  42. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/analyst_agent/prompts.py +84 -0
  43. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/analyst_agent/tools.py +383 -0
  44. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/bq_studio_queries.gql.tpl +133 -0
  45. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/build_joint_graph.py +561 -0
  46. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/build_org_graphs.py +370 -0
  47. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/caller_agent/__init__.py +21 -0
  48. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/caller_agent/agent.py +125 -0
  49. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/caller_agent/prompts.py +64 -0
  50. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/caller_agent/tools.py +135 -0
  51. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/campaigns.py +75 -0
  52. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/joint_property_graph.gql.tpl +133 -0
  53. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/receiver_agent/__init__.py +21 -0
  54. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/receiver_agent/agent.py +110 -0
  55. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/receiver_agent/prompts.py +49 -0
  56. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/render_queries.sh +59 -0
  57. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/reset.sh +53 -0
  58. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/run_analyst_agent.py +236 -0
  59. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/run_caller_agent.py +626 -0
  60. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/run_e2e_demo.sh +128 -0
  61. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/run_receiver_server.py +111 -0
  62. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/setup.sh +240 -0
  63. bigquery_agent_analytics-0.3.0/examples/a2a_joint_lineage_demo/smoke_receiver.py +230 -0
  64. bigquery_agent_analytics-0.3.0/examples/agent_improvement_cycle/DEMO_NARRATION.md +221 -0
  65. bigquery_agent_analytics-0.3.0/examples/agent_improvement_cycle/README.md +734 -0
  66. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent/agent.py +12 -1
  67. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/__init__.py +37 -0
  68. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/config.py +6 -4
  69. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/config_loader.py +30 -1
  70. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/eval_runner.py +19 -4
  71. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/improver_agent.py +207 -203
  72. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/config.json +4 -2
  73. bigquery_agent_analytics-0.3.0/examples/agent_improvement_cycle/demo.png +0 -0
  74. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/eval/eval_cases.json +3 -6
  75. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/eval/generate_traffic.py +24 -13
  76. bigquery_agent_analytics-0.3.0/examples/agent_improvement_cycle/eval/operational_metrics.py +350 -0
  77. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/eval/run_eval.py +74 -36
  78. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/reset.sh +0 -4
  79. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/run_cycle.sh +166 -49
  80. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/run_improvement.py +7 -3
  81. bigquery_agent_analytics-0.3.0/examples/ci/README.md +42 -0
  82. bigquery_agent_analytics-0.3.0/examples/ci/evaluate_thresholds.yml +78 -0
  83. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/.gitignore +6 -0
  84. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/BQ_STUDIO_WALKTHROUGH.md +190 -0
  85. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/DATA_LINEAGE.md +284 -0
  86. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/DEMO_NARRATION.md +245 -0
  87. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/DEMO_QUESTIONS.md +310 -0
  88. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/README.md +234 -0
  89. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/SETUP_NEW_PROJECT.md +262 -0
  90. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/SLIDES.html +23607 -0
  91. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/SLIDES.md +1423 -0
  92. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/SLIDES.pptx +0 -0
  93. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/agent/__init__.py +21 -0
  94. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/agent/agent.py +102 -0
  95. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/agent/prompts.py +65 -0
  96. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/agent/tools.py +169 -0
  97. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/bq_studio_queries.gql.tpl +214 -0
  98. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/build_graph.py +220 -0
  99. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/build_rich_graph.py +330 -0
  100. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/campaigns.py +100 -0
  101. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/property_graph.gql.tpl +122 -0
  102. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/render_queries.sh +70 -0
  103. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/reset.sh +50 -0
  104. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/rich_property_graph.gql.tpl +158 -0
  105. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/run_agent.py +257 -0
  106. bigquery_agent_analytics-0.3.0/examples/decision_lineage_demo/setup.sh +200 -0
  107. bigquery_agent_analytics-0.3.0/examples/migration_v5/.gitignore +2 -0
  108. bigquery_agent_analytics-0.3.0/examples/migration_v5/README.md +182 -0
  109. bigquery_agent_analytics-0.3.0/examples/migration_v5/binding.yaml +103 -0
  110. bigquery_agent_analytics-0.3.0/examples/migration_v5/export_events_jsonl.py +194 -0
  111. bigquery_agent_analytics-0.3.0/examples/migration_v5/mako_artifacts.py +751 -0
  112. bigquery_agent_analytics-0.3.0/examples/migration_v5/mako_core.ttl +419 -0
  113. bigquery_agent_analytics-0.3.0/examples/migration_v5/mako_demo_agent.py +314 -0
  114. bigquery_agent_analytics-0.3.0/examples/migration_v5/ontology.yaml +408 -0
  115. bigquery_agent_analytics-0.3.0/examples/migration_v5/property_graph.sql +58 -0
  116. bigquery_agent_analytics-0.3.0/examples/migration_v5/reference_extractor.py +542 -0
  117. bigquery_agent_analytics-0.3.0/examples/migration_v5/revalidation_thresholds.json +7 -0
  118. bigquery_agent_analytics-0.3.0/examples/migration_v5/run_agent.py +151 -0
  119. bigquery_agent_analytics-0.3.0/examples/migration_v5/table_ddl.sql +13 -0
  120. bigquery_agent_analytics-0.3.0/examples/migration_v5_demo_notebook.ipynb +3337 -0
  121. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/pyproject.toml +3 -1
  122. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/scripts/README.md +19 -0
  123. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/scripts/quality_report.py +84 -24
  124. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/scripts/quality_report.sh +29 -2
  125. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/__init__.py +179 -0
  126. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/_ontology_routing.py +211 -0
  127. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/binding_validation.py +868 -0
  128. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/cli.py +344 -10
  129. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/client.py +45 -15
  130. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/context_graph.py +172 -82
  131. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/evaluators.py +378 -17
  132. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/__init__.py +166 -0
  133. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/ast_validator.py +758 -0
  134. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/bq_bundle_mirror.py +1177 -0
  135. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/bundle_loader.py +725 -0
  136. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/cli_revalidate.py +925 -0
  137. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/compiler.py +689 -0
  138. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/diagnostics.py +376 -0
  139. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/fingerprint.py +102 -0
  140. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/manifest.py +87 -0
  141. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/measurement.py +647 -0
  142. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/plan_parser.py +531 -0
  143. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/plan_resolver.py +289 -0
  144. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/retry_loop.py +449 -0
  145. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/revalidation.py +859 -0
  146. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/runtime_fallback.py +418 -0
  147. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/runtime_registry.py +333 -0
  148. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/smoke_test.py +602 -0
  149. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/subprocess_runner.py +114 -0
  150. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/extractor_compilation/template_renderer.py +537 -0
  151. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/graph_validation.py +852 -0
  152. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ontology_graph.py +116 -0
  153. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ontology_materializer.py +49 -29
  154. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ontology_orchestrator.py +39 -13
  155. bigquery_agent_analytics-0.3.0/src/bigquery_agent_analytics/ontology_runtime.py +1203 -0
  156. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ontology_schema_compiler.py +12 -4
  157. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/views.py +47 -0
  158. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/__init__.py +2 -0
  159. bigquery_agent_analytics-0.3.0/src/bigquery_ontology/_fingerprint.py +180 -0
  160. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/cli.py +116 -0
  161. bigquery_agent_analytics-0.3.0/src/bigquery_ontology/concept_index.py +336 -0
  162. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/graph_ddl_compiler.py +301 -0
  163. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_cli.py +182 -0
  164. bigquery_agent_analytics-0.3.0/tests/bigquery_ontology/test_compile_concept_index.py +473 -0
  165. bigquery_agent_analytics-0.3.0/tests/bigquery_ontology/test_concept_index.py +550 -0
  166. bigquery_agent_analytics-0.3.0/tests/bigquery_ontology/test_fingerprint.py +388 -0
  167. bigquery_agent_analytics-0.3.0/tests/fixtures_extractor_compilation/__init__.py +23 -0
  168. bigquery_agent_analytics-0.3.0/tests/fixtures_extractor_compilation/bka_decision_inputs.py +281 -0
  169. bigquery_agent_analytics-0.3.0/tests/fixtures_extractor_compilation/bka_decision_measurement_report.json +18 -0
  170. bigquery_agent_analytics-0.3.0/tests/fixtures_extractor_compilation/bka_decision_template.py +97 -0
  171. bigquery_agent_analytics-0.3.0/tests/fixtures_extractor_compilation/plan_bka_decision.json +28 -0
  172. bigquery_agent_analytics-0.3.0/tests/test_ai_generate_judge_live.py +203 -0
  173. bigquery_agent_analytics-0.3.0/tests/test_binding_validation.py +1224 -0
  174. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_cli.py +1031 -1
  175. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_context_graph.py +303 -51
  176. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation.py +2054 -0
  177. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_bka_compile_live.py +345 -0
  178. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_bq_bundle_mirror.py +1064 -0
  179. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_bq_bundle_mirror_live.py +142 -0
  180. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_bundle_loader.py +1083 -0
  181. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_cli_revalidate.py +1652 -0
  182. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_cli_revalidate_bq_live.py +213 -0
  183. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_diagnostics.py +789 -0
  184. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_measurement.py +820 -0
  185. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_plan_parser.py +718 -0
  186. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_plan_resolver.py +470 -0
  187. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_retry_loop.py +810 -0
  188. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_revalidation.py +988 -0
  189. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_runtime_fallback.py +1178 -0
  190. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_runtime_registry.py +753 -0
  191. bigquery_agent_analytics-0.3.0/tests/test_extractor_compilation_template.py +848 -0
  192. bigquery_agent_analytics-0.3.0/tests/test_graph_validation.py +1687 -0
  193. bigquery_agent_analytics-0.3.0/tests/test_integration_ontology_binding.py +841 -0
  194. bigquery_agent_analytics-0.3.0/tests/test_migration_v5_reference_extractor.py +488 -0
  195. bigquery_agent_analytics-0.3.0/tests/test_ontology_graph_from_bundles_root.py +609 -0
  196. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ontology_orchestrator.py +104 -0
  197. bigquery_agent_analytics-0.3.0/tests/test_ontology_runtime.py +1483 -0
  198. bigquery_agent_analytics-0.3.0/tests/test_ontology_runtime_live.py +223 -0
  199. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_remote_function.py +28 -0
  200. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_sdk_client.py +292 -0
  201. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_sdk_evaluators.py +206 -0
  202. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_views.py +114 -0
  203. bigquery_agent_analytics-0.2.2/CHANGELOG.md +0 -50
  204. bigquery_agent_analytics-0.2.2/docs/README.md +0 -47
  205. bigquery_agent_analytics-0.2.2/examples/agent_improvement_cycle/DEMO_SCRIPT.md +0 -255
  206. bigquery_agent_analytics-0.2.2/examples/agent_improvement_cycle/README.md +0 -506
  207. bigquery_agent_analytics-0.2.2/examples/migration_v5_demo_notebook.ipynb +0 -1263
  208. bigquery_agent_analytics-0.2.2/tests/test_integration_ontology_binding.py +0 -443
  209. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/.github/workflows/ci.yml +0 -0
  210. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/.github/workflows/release.yml +0 -0
  211. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/.gitignore +0 -0
  212. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/CODE_OF_CONDUCT.md +0 -0
  213. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/CONTRIBUTING.md +0 -0
  214. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/LICENSE +0 -0
  215. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/README.md +0 -0
  216. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/SECURITY.md +0 -0
  217. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/autoformat.sh +0 -0
  218. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/dashboard/README.md +0 -0
  219. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/dashboard/agent_analytics_dashboard.ipynb +0 -0
  220. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/dashboard/app.py +0 -0
  221. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/dashboard/requirements.txt +0 -0
  222. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/README.md +0 -0
  223. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/continuous_queries/README.md +0 -0
  224. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/continuous_queries/bigtable_dashboard.sql +0 -0
  225. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/continuous_queries/pubsub_alerting.sql +0 -0
  226. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/continuous_queries/realtime_error_analysis.sql +0 -0
  227. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/continuous_queries/session_scoring.sql +0 -0
  228. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/continuous_queries/setup_reservation.md +0 -0
  229. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/python_udf/README.md +0 -0
  230. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/python_udf/register.sql +0 -0
  231. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/remote_function/README.md +0 -0
  232. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/remote_function/deploy.sh +0 -0
  233. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/remote_function/main.py +0 -0
  234. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/remote_function/register.sql +0 -0
  235. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/streaming_evaluation/README.md +0 -0
  236. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/streaming_evaluation/main.py +0 -0
  237. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/streaming_evaluation/requirements.txt +0 -0
  238. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/streaming_evaluation/setup.sh +0 -0
  239. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/streaming_evaluation/trigger_query.sql +0 -0
  240. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/deploy/streaming_evaluation/worker.py +0 -0
  241. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/entity_resolution_primitives.md +0 -0
  242. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/hatteras_evaluation.md +0 -0
  243. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/implementation_plan_concept_index_runtime.md +0 -0
  244. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/learning_ontology_and_context_graph.md +0 -0
  245. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology/binding.md +0 -0
  246. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology/ontology.md +0 -0
  247. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology/owl-import.md +0 -0
  248. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology/scaffold.md +0 -0
  249. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology_graph_v4_design.md +0 -0
  250. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/ontology_graph_v5_design.md +0 -0
  251. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/prd_unified_analytics_interface.md +0 -0
  252. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/proposal_bigquery_agent_cli.md +0 -0
  253. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/python_udf_support_design.md +0 -0
  254. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/remote_function_rationale.md +0 -0
  255. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/docs/sdk_usage_tracking.md +0 -0
  256. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent/__init__.py +0 -0
  257. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent/prompts.py +0 -0
  258. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent/tools.py +0 -0
  259. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/prompt_adapter.py +0 -0
  260. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/prompts.py +0 -0
  261. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/agent_improvement/tool_introspection.py +0 -0
  262. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/overview.png +0 -0
  263. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/setup.sh +0 -0
  264. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/setup_vertex.py +0 -0
  265. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/agent_improvement_cycle/show_prompt.sh +0 -0
  266. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ai_classify_side_by_side.sql +0 -0
  267. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ai_forecast_side_by_side.sql +0 -0
  268. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ai_ml_integration_demo.ipynb +0 -0
  269. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ai_similarity_validation.sql +0 -0
  270. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/categorical_dashboard.sql +0 -0
  271. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/categorical_evaluation_demo.ipynb +0 -0
  272. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ci_eval_pipeline.sh +0 -0
  273. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/cli_agent_tool.py +0 -0
  274. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/context_graph_adcp_demo.ipynb +0 -0
  275. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/continuous_query_alerting.sql +0 -0
  276. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/dashboard_v2.ipynb +0 -0
  277. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/dashboard_v2_bigframes.ipynb +0 -0
  278. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/e2e_demo.py +0 -0
  279. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/e2e_demo_output.txt +0 -0
  280. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/e2e_notebook_demo.ipynb +0 -0
  281. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/event_semantics_views_bigframes_demo.ipynb +0 -0
  282. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/memory_service_demo.ipynb +0 -0
  283. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/nba_agent_trace_analysis_notebook.ipynb +0 -0
  284. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ontology_graph_v4_demo.ipynb +0 -0
  285. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ontology_graph_v5_demo.ipynb +0 -0
  286. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/python_udf_eval_summary.sql +0 -0
  287. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/python_udf_evaluation.sql +0 -0
  288. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/python_udf_event_semantics.sql +0 -0
  289. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/remote_function_dashboard.sql +0 -0
  290. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/examples/ymgo_graph_spec.yaml +0 -0
  291. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/scripts/sample_report.md +0 -0
  292. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/_deploy_runtime.py +0 -0
  293. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/_streaming_evaluation.py +0 -0
  294. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/_telemetry.py +0 -0
  295. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ai_ml_integration.py +0 -0
  296. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/bigframes_evaluator.py +0 -0
  297. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/categorical_evaluator.py +0 -0
  298. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/categorical_views.py +0 -0
  299. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/eval_suite.py +0 -0
  300. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/eval_validator.py +0 -0
  301. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/event_semantics.py +0 -0
  302. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/extracted_models.py +0 -0
  303. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/feedback.py +0 -0
  304. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/formatter.py +0 -0
  305. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/grader_pipeline.py +0 -0
  306. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/insights.py +0 -0
  307. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/memory_service.py +0 -0
  308. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/multi_trial.py +0 -0
  309. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ontology_models.py +0 -0
  310. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ontology_property_graph.py +0 -0
  311. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/resolved_spec.py +0 -0
  312. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/runtime_spec.py +0 -0
  313. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/serialization.py +0 -0
  314. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/structured_extraction.py +0 -0
  315. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/trace.py +0 -0
  316. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/trace_evaluator.py +0 -0
  317. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/ttl_importer.py +0 -0
  318. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/udf_kernels.py +0 -0
  319. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_agent_analytics/udf_sql_templates.py +0 -0
  320. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/binding_loader.py +0 -0
  321. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/binding_models.py +0 -0
  322. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/docs/user_manual.md +0 -0
  323. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/graph_ddl_models.py +0 -0
  324. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/ontology_loader.py +0 -0
  325. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/ontology_models.py +0 -0
  326. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/owl_importer.py +0 -0
  327. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/src/bigquery_ontology/scaffold.py +0 -0
  328. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/__init__.py +0 -0
  329. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/__init__.py +0 -0
  330. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_binding_loader.py +0 -0
  331. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_binding_models.py +0 -0
  332. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_graph_ddl_compiler.py +0 -0
  333. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_ontology_models.py +0 -0
  334. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_owl_importer.py +0 -0
  335. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_scaffold.py +0 -0
  336. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/bigquery_ontology/test_scaffold_cli.py +0 -0
  337. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/lineage_sessions.json +0 -0
  338. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/mixed_events.json +0 -0
  339. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/mixed_owl_skos.ttl +0 -0
  340. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/skos_taxonomy.ttl +0 -0
  341. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/test_binding.yaml +0 -0
  342. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/test_combined_spec.yaml +0 -0
  343. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/test_ontology.yaml +0 -0
  344. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/fixtures/yamo_sample.ttl +0 -0
  345. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_abstract_adapter_filter.py +0 -0
  346. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ai_ml_integration.py +0 -0
  347. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ai_ml_integration_labels.py +0 -0
  348. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_bigframes_evaluator.py +0 -0
  349. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_bridge_hardening.py +0 -0
  350. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_categorical_evaluator.py +0 -0
  351. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_categorical_views.py +0 -0
  352. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_client_labels.py +0 -0
  353. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_context_graph_labels.py +0 -0
  354. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_dual_loader.py +0 -0
  355. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_eval_suite.py +0 -0
  356. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_eval_validator.py +0 -0
  357. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_event_semantics.py +0 -0
  358. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_extracted_models.py +0 -0
  359. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_feedback_labels.py +0 -0
  360. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_formatter.py +0 -0
  361. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_grader_pipeline.py +0 -0
  362. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_memory_service.py +0 -0
  363. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_memory_service_labels.py +0 -0
  364. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_multi_trial.py +0 -0
  365. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ontology_graph.py +0 -0
  366. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ontology_labels.py +0 -0
  367. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ontology_materializer.py +0 -0
  368. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ontology_models.py +0 -0
  369. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ontology_property_graph.py +0 -0
  370. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_ontology_schema_compiler.py +0 -0
  371. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_owl_import_bridge.py +0 -0
  372. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_pr16_fixes.py +0 -0
  373. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_pr17_fixes.py +0 -0
  374. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_pr19_fixes.py +0 -0
  375. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_quality_report_helpers.py +0 -0
  376. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_resolved_spec.py +0 -0
  377. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_runtime_factory.py +0 -0
  378. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_runtime_spec.py +0 -0
  379. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_sdk_feedback.py +0 -0
  380. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_sdk_insights.py +0 -0
  381. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_sdk_trace.py +0 -0
  382. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_serialization.py +0 -0
  383. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_streaming_evaluation.py +0 -0
  384. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_surface_tags.py +0 -0
  385. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_telemetry.py +0 -0
  386. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_trace_evaluator.py +0 -0
  387. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_trace_filter_factory.py +0 -0
  388. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_udf_kernels.py +0 -0
  389. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_udf_sql_generation.py +0 -0
  390. {bigquery_agent_analytics-0.2.2 → bigquery_agent_analytics-0.3.0}/tests/test_v5_golden.py +0 -0
@@ -0,0 +1,857 @@
1
+ # Changelog
2
+
3
+ All notable changes to `bigquery-agent-analytics` are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.3.0] - 2026-05-15
11
+
12
+ ### Release highlights
13
+
14
+ Substantial feature release covering three major workstreams that landed
15
+ between 0.2.3 and 0.3.0:
16
+
17
+ - **Compiled structured extractors — full Phase C pipeline**
18
+ ([#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75))
19
+ — deterministic source generation, JSON-to-plan parsing, LLM-driven plan
20
+ resolution, retry-on-gate-failure orchestration, runtime fallback wiring,
21
+ runtime extractor-registry adapter, orchestrator call-site swap,
22
+ compile-and-measure utility, revalidation harness, BigQuery-table bundle
23
+ mirror, ``bqaa-revalidate-extractors`` CLI with ``--events-bq-query-file``,
24
+ and an operational rollout guide. Replaces per-event LLM extraction with
25
+ deterministic code on the hot path while preserving the LLM fallback for
26
+ unrecognized event shapes.
27
+ - **Ontology runtime reader**
28
+ ([#58](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/58)
29
+ reader follow-on to PR #92's concept-index emission) —
30
+ ``OntologyRuntime`` façade, ``EntityResolver`` Protocol with two reference
31
+ implementations (``ExactEntityResolver``, ``LabelSynonymResolver``), and
32
+ ``ConceptIndexLookup`` with fingerprint-strict verification across three
33
+ trust points (eager ``verify()`` at construction, explicit re-checks,
34
+ per-query ``WHERE compile_fingerprint`` defense in depth). Stable failure
35
+ codes (``FingerprintMismatchError``, ``MetaTableMissingError``,
36
+ ``MetaTableEmptyError``, ``MetaTableMultipleRowsError``).
37
+ - **Binding + extraction validation toolkit**
38
+ ([#76](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/76),
39
+ [#105](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/105))
40
+ — ``validate_extracted_graph(...)``,
41
+ ``validate_extracted_graph_from_ontology(...)``,
42
+ ``validate_binding_against_bigquery(...)`` Python APIs;
43
+ ``bq-agent-sdk binding-validate`` CLI for pre-flight validation;
44
+ ``ontology-build --validate-binding`` and ``--location`` flags.
45
+
46
+ Examples shipped alongside the SDK release: the MAKO four-guarantee notebook
47
+ demonstrating the compiled-extractor pipeline end-to-end
48
+ ([#107](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/107)),
49
+ and the A2A joint-lineage demo with auditor projections, the receiver
50
+ ``A2A_INTERACTION`` typed view, and an audit-analyst agent that closes the
51
+ BQAA loop
52
+ ([#129](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/129)).
53
+
54
+ ### Added
55
+
56
+ - **``A2A_INTERACTION`` typed view (``adk_a2a_interactions``)** in
57
+ ``src/bigquery_agent_analytics/views.py`` (PR
58
+ [#136](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/pull/136)).
59
+ Surfaces the BQ AA Plugin's caller-side A2A delegation rows
60
+ with JSON-extracted lineage columns —
61
+ ``a2a_task_id``, ``a2a_context_id``, ``a2a_request``,
62
+ ``a2a_response``, plus a ``receiver_session_id_from_response``
63
+ COALESCE — so downstream consumers can join caller and receiver
64
+ traces without writing the JSON-extraction SQL by hand. Used by
65
+ the A2A joint-lineage demo's auditor projection.
66
+ - **``CodeEvaluator.context_cache_hit_rate(...)`` + CLI support**
67
+ (PR [#114](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/pull/114)).
68
+ New pre-built evaluator in
69
+ ``src/bigquery_agent_analytics/evaluators.py`` that measures
70
+ Gemini context-cache prefix-hit rate
71
+ (``cached_tokens / input_tokens``) per session, with
72
+ cold-start / warm rate thresholds and an explicit
73
+ ``fail_on_missing_telemetry`` switch. Wired through the
74
+ ``bqaa evaluate --evaluator context_cache_hit_rate`` CLI path
75
+ (``src/bigquery_agent_analytics/cli.py``).
76
+ - **``gm compile --emit-concept-index`` / ``--concept-index-table``**
77
+ CLI flags in ``src/bigquery_ontology/cli.py`` (PR
78
+ [#92](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/pull/92),
79
+ issue
80
+ [#58](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/58)
81
+ Phase 1). Emits a fingerprint-stamped concept-index table
82
+ (``label`` / ``synonym`` / ``notation`` rows + ``__meta``)
83
+ that the ontology runtime reader (above) verifies against.
84
+ ``--concept-index-table`` is required when ``--emit-concept-index``
85
+ is set — no silent global default.
86
+ - **``ontology-build --skip-property-graph``** flag in
87
+ ``src/bigquery_agent_analytics/cli.py`` (PR
88
+ [#108](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/pull/108),
89
+ issue
90
+ [#104](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/104)).
91
+ Materializes node and edge tables without issuing the
92
+ ``CREATE OR REPLACE PROPERTY GRAPH`` statement, letting users
93
+ own their property-graph DDL while still letting the SDK
94
+ populate the backing tables.
95
+ - **Ontology runtime reader** in
96
+ ``bigquery_agent_analytics.ontology_runtime`` and
97
+ [`docs/ontology_runtime_reader.md`](docs/ontology_runtime_reader.md).
98
+ Issue [#58](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/58)
99
+ reader follow-on to PR #92's concept-index emission.
100
+ Public surface:
101
+ * ``OntologyRuntime`` — façade that loads
102
+ ``Ontology + Binding`` (from YAML files or in-memory
103
+ models) plus an optional :class:`ConceptIndexLookup`
104
+ wired to the emitted BigQuery table. Read-only
105
+ accessors over entities / relationships / synonyms /
106
+ annotations / SKOS schemes / notations / labels;
107
+ provenance properties (``compile_fingerprint`` /
108
+ ``compile_id``) computed locally.
109
+ * ``EntityResolver`` Protocol + two reference
110
+ implementations: ``ExactEntityResolver`` (in-memory
111
+ match on ``entity_name``, no BQ roundtrip) and
112
+ ``LabelSynonymResolver`` (BQ-backed match against the
113
+ concept-index ``label`` / ``synonym`` / ``notation``
114
+ rows, re-ranked by label-kind priority
115
+ ``name > pref > alt > hidden > synonym > notation``).
116
+ **No embedding / LLM / fuzzy in this slice** — explicit
117
+ non-goals; future PRs can implement the Protocol
118
+ without touching the runtime surface.
119
+ * ``ConceptIndexLookup`` — BigQuery-backed accessor that
120
+ is **fingerprint-strict**. Three trust points: eager
121
+ ``verify()`` at construction (compares the table's
122
+ ``__meta`` row against the locally-computed
123
+ ``compile_fingerprint(ontology_fp, binding_fp,
124
+ compiler_version)``); explicit ``verify()`` method for
125
+ re-checks before long batches; per-query
126
+ ``WHERE compile_fingerprint = @expected_fp`` as defense
127
+ in depth so stale rows can't surface even mid-flight.
128
+ Three lookup methods: ``lookup_by_label`` (with
129
+ label-kind / language / case-insensitive filters),
130
+ ``lookup_by_entity_name``, ``lookup_by_notation``.
131
+ Stable failure codes: ``FingerprintMismatchError``,
132
+ ``MetaTableMissingError``, ``MetaTableEmptyError``,
133
+ ``MetaTableMultipleRowsError`` — all subclass
134
+ ``ConceptIndexError``.
135
+ CI suite (55 cases) uses in-memory fake BQ clients;
136
+ live test (gated behind ``BQAA_RUN_LIVE_ONTOLOGY_RUNTIME_TESTS=1``)
137
+ emits a real concept-index via PR #92's path, attaches
138
+ the runtime, runs resolver queries against the live
139
+ table, asserts provenance, drops the tables on the way
140
+ out. Closes the last feature dependency for #107's
141
+ four-guarantee notebook (the resolve beat).
142
+ - **Compiled-extractor rollout guide** at
143
+ [`docs/extractor_compilation_rollout_guide.md`](docs/extractor_compilation_rollout_guide.md).
144
+ Operational playbook for the Phase C pipeline (issue
145
+ [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75))
146
+ stitching the five stages — Compile, Publish, Sync, Wire,
147
+ Revalidate — into one flow. Treats Publish/Sync as the
148
+ remote-runtime path; local / co-located deployments can
149
+ shortcut to Compile → Wire → Revalidate. Worked BKA
150
+ example uses Python snippets for the non-CLI stages
151
+ (``measure_compile``, ``publish_bundles_to_bq``,
152
+ ``sync_bundles_from_bq``,
153
+ ``OntologyGraphManager.from_bundles_root``) and the real
154
+ ``bqaa-revalidate-extractors`` shell invocation only
155
+ where a CLI actually exists. Documents the **four trust
156
+ gates** across the pipeline — the compile-time smoke gate
157
+ inside ``compile_extractor`` (``load_callable_from_source``
158
+ + ``run_smoke_test``, not ``load_bundle`` itself: there's
159
+ no manifest at compile time) plus three real
160
+ ``load_bundle`` runs at pre-publish, post-sync, and
161
+ runtime-startup discovery — so the trust model is one
162
+ mental model across the pipeline.
163
+ Includes a failure-recovery playbook keyed on the stable
164
+ failure codes each stage emits.
165
+ - **``--events-bq-query-file`` for ``bqaa-revalidate-extractors``**
166
+ (issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
167
+ CLI follow-up). The CLI now accepts a BigQuery event
168
+ source in addition to ``--events-jsonl``; the two are
169
+ mutually exclusive and exactly one must be supplied.
170
+ Contract: the SQL must produce exactly one column named
171
+ ``event_json`` (STRING) per row, containing a JSON-encoded
172
+ event dict — same shape ``--events-jsonl`` consumes
173
+ line-by-line. The CLI does NOT auto-shape
174
+ ``bigquery.Row`` objects; the query writer controls
175
+ projection via ``TO_JSON_STRING(STRUCT(...))``. Row-level
176
+ errors (missing column, non-string value, malformed JSON,
177
+ non-dict decode) surface as exit 2 with the 0-based row
178
+ index named so an operator can find the offender with
179
+ ``LIMIT N OFFSET row_index``. BigQuery-side exceptions
180
+ (auth, syntax, table-not-found, permission) are caught and
181
+ surfaced with type + message — no traceback escapes.
182
+ ``--bq-project`` is optional: the BigQuery client falls
183
+ back to Application Default Credentials / environment for
184
+ project inference; if both are absent the CLI exits 2 with
185
+ ``Set --bq-project explicitly`` rather than confusing the
186
+ operator with a downstream API error. ``--bq-location``
187
+ defaults to ``US``. Client construction is centralized
188
+ behind ``_make_bq_client(project, location)`` so unit
189
+ tests inject in-memory fakes via ``monkeypatch.setattr``
190
+ rather than wiring through every call site. CI tests
191
+ (11 new cases) cover the happy path, ADC inference,
192
+ no-project-anywhere, query exceptions, every row-shape
193
+ failure mode, the mutex on event sources (both / neither),
194
+ and the empty-SQL-file edge. Live BQ test
195
+ (``tests/test_extractor_compilation_cli_revalidate_bq_live.py``)
196
+ is gated behind ``BQAA_RUN_LIVE_BQ_REVALIDATE_TESTS=1``;
197
+ it creates a temp table, inserts two ``event_json`` rows,
198
+ runs the CLI, asserts the report is written with both
199
+ events as compiled_unchanged + parity_matches, deletes
200
+ the table on the way out.
201
+ - **``bqaa-revalidate-extractors`` CLI** in
202
+ `bigquery_agent_analytics.extractor_compilation.cli_revalidate`
203
+ and
204
+ [`docs/extractor_compilation_revalidate_cli.md`](docs/extractor_compilation_revalidate_cli.md).
205
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
206
+ follow-up to Milestone C2.d — operationalizes
207
+ ``revalidate_compiled_extractors`` so ops can run periodic
208
+ revalidation without writing Python. **Local inputs
209
+ only** this round; ``--events-bq-query`` lands in a
210
+ follow-up so the auth/location/pagination surface gets
211
+ isolated from the operational-loop contract.
212
+ Flags: ``--bundles-root`` (auto-detects the fingerprint
213
+ from the first bundle's manifest; mixed fingerprints
214
+ fail-closed), ``--events-jsonl`` (one event per line,
215
+ malformed lines abort with line number), ``--reference-
216
+ extractors-module`` (dotted path; module exposes
217
+ ``EXTRACTORS: dict[str, callable]``, ``RESOLVED_GRAPH``
218
+ from ``resolve(ontology, binding)``, and optionally
219
+ ``SPEC`` — the CLI carries no ontology/binding flags
220
+ because the reference module owns the validator-input
221
+ contract), ``--thresholds-json`` (optional; JSON object
222
+ with any subset of ``RevalidationThresholds`` fields,
223
+ bounds-checked via the existing ``__post_init__``),
224
+ ``--report-out`` (combined JSON of the raw
225
+ ``RevalidationReport`` plus the ``ThresholdCheckResult``).
226
+ Exit codes are deliberately narrow: ``0`` pass / ``1``
227
+ threshold violation (report still written) / ``2``
228
+ usage-or-input error (report not written). Wired through
229
+ ``pyproject.toml [project.scripts]`` so
230
+ ``pip install`` exposes the binary.
231
+ - **BigQuery-table bundle mirror** in
232
+ `bigquery_agent_analytics.extractor_compilation.bq_bundle_mirror`
233
+ and
234
+ [`docs/extractor_compilation_bq_bundle_mirror.md`](docs/extractor_compilation_bq_bundle_mirror.md).
235
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
236
+ PR C2.c.3 — publishes compiled bundles to a BigQuery
237
+ table and syncs them back into a local directory for
238
+ C2.a's existing loader. Runtime path stays
239
+ ``sync_bundles_from_bq → discover_bundles →
240
+ from_bundles_root``; the mirror is a utility, not a
241
+ runtime loader. Public surface:
242
+ ``publish_bundles_to_bq(bundle_root, store,
243
+ bundle_fingerprint_allowlist=None)`` and
244
+ ``sync_bundles_from_bq(store, dest_dir,
245
+ bundle_fingerprint_allowlist=None)``. Both call
246
+ :func:`load_bundle` as a gate — publish refuses bundles
247
+ that wouldn't load at the runtime; sync refuses bundles
248
+ whose reconstruction the loader rejects, scrubbing any
249
+ partial directory it wrote. Sync writes each
250
+ fingerprint to a side-by-side **staging directory** and
251
+ runs ``load_bundle`` on the staged copy before performing
252
+ a **staged replace** of the target (the rmtree+move pair
253
+ is not strictly atomic — a crash between the two leaves
254
+ the bundle absent on disk, recoverable by re-sync — but
255
+ the load-bundle-failure direction *is* atomic, so a bad
256
+ mirror row never destroys a previously-good local
257
+ bundle).
258
+ Strict bundle-shape check: the table stores exactly two
259
+ rows per fingerprint (``manifest.json`` + the manifest's
260
+ ``module_filename``); ``unexpected_file`` codes reject
261
+ anything else. The manifest's own ``module_filename`` is
262
+ shape-checked at sync (bare filename — no separators, no
263
+ ``..``, no NUL); a path-separator value surfaces as
264
+ ``manifest_row_unreadable`` instead of raising
265
+ ``FileNotFoundError`` at the write step.
266
+ ``invalid_bundle_path`` rejects traversal / absolute /
267
+ backslash / NUL paths before writing to disk.
268
+ ``duplicate_row`` rejects two rows sharing the same
269
+ ``(fingerprint, bundle_path)`` (BigQuery has no unique
270
+ constraint; the mirror enforces uniqueness at sync).
271
+ ``duplicate_fingerprint`` rejects publish-side cases
272
+ where two subdirs of ``bundle_root`` claim the same
273
+ manifest fingerprint — neither is published, so the
274
+ table can't end up with logical duplicates.
275
+ ``malformed_row`` rejects rows with wrong field types.
276
+ Idempotent republish via DELETE+INSERT in
277
+ ``BigQueryBundleStore.publish_rows`` —
278
+ re-publishing the same fingerprint replaces the prior
279
+ rows rather than accumulating duplicates. The DELETE +
280
+ ``insert_rows_json`` are NOT a single atomic
281
+ transaction; a transient INSERT failure leaves rows
282
+ missing until the caller re-runs publish (recoverable;
283
+ documented in the class docstring).
284
+ ``publish_rows`` also raises ``ValueError`` on duplicate
285
+ ``(fingerprint, bundle_path)`` input pairs as defense in
286
+ depth.
287
+ ``BundleStore`` is a Protocol so tests can pass in-memory
288
+ fakes; ``BigQueryBundleStore`` is the concrete
289
+ implementation wrapping ``google.cloud.bigquery``.
290
+ ``BUNDLE_MIRROR_TABLE_SCHEMA`` is exported for callers
291
+ who need to create the table themselves (or
292
+ ``BigQueryBundleStore.ensure_table()`` does it
293
+ idempotently). Failure codes are stable strings;
294
+ per-bundle problems land in ``failures`` instead of
295
+ raising. Store exceptions (BQ-side: network, auth, table
296
+ missing) propagate. Out of scope: GCS-backed signed-URL
297
+ fetch, caching / TTL, garbage collection, multi-region
298
+ replication.
299
+ - **Revalidation harness for compiled structured extractors**
300
+ in
301
+ `bigquery_agent_analytics.extractor_compilation.revalidation`
302
+ and
303
+ [`docs/extractor_compilation_revalidation.md`](docs/extractor_compilation_revalidation.md).
304
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
305
+ PR C2.d — turns the compiled path from "works in tests" into
306
+ "keeps proving itself after rollout." Public surface:
307
+ ``revalidate_compiled_extractors(events,
308
+ compiled_extractors, reference_extractors, resolved_graph,
309
+ ...)`` drives ``run_with_fallback`` (with a no-op fallback)
310
+ over a batch of events AND calls the reference extractor
311
+ directly, aggregating the per-event outcomes into a
312
+ ``RevalidationReport`` with **two orthogonal dimensions**:
313
+ (1) runtime decision — per-event-type ``EventTypeCounts``
314
+ plus totals for ``compiled_unchanged`` /
315
+ ``compiled_filtered`` / ``fallback_for_event``, with
316
+ ``compiled_path_faults`` split out so bundle bugs (the
317
+ wrapper's ``compiled_exception`` audit field covers
318
+ exceptions, wrong return type, and malformed result
319
+ internals) are distinguishable from ontology drift; (2)
320
+ agreement against reference — ``parity_matches`` /
321
+ ``parity_divergences`` / ``parity_not_checked`` using a
322
+ three-comparator parity check: ``_compare_nodes`` and
323
+ ``_compare_span_handling`` from ``measurement.py`` plus
324
+ ``_compare_edges`` in ``revalidation.py`` (same edge_id
325
+ set with matching relationship_name / endpoints / property-
326
+ set per shared edge; duplicate edge_ids on either side
327
+ reported as a divergence rather than silently collapsed by
328
+ dict keying, since #76 doesn't enforce edge-id
329
+ uniqueness). The parity dimension catches **schema-valid
330
+ but semantically wrong** outputs the validator would
331
+ silently accept. **Every failure mode on the reference
332
+ side becomes a parity divergence, never a batch abort**:
333
+ exceptions, non-``StructuredExtractionResult`` returns
334
+ (including ``None``), and comparator crashes all funnel
335
+ into the divergence channel with a descriptive string. Headline KPIs:
336
+ ``compiled_unchanged_rate`` (schema safety) and
337
+ ``parity_match_rate`` (semantic agreement; denominator
338
+ excludes ``parity_not_checked`` so wrapper-filtered events
339
+ don't conflate with wrong-output events). Sample
340
+ divergences are capped (per-dimension, independently) at 10
341
+ by default. Skipped events (event_types without a compiled
342
+ or reference extractor, malformed events) are counted
343
+ separately from the rate denominators.
344
+ ``check_thresholds(report, RevalidationThresholds(...))``
345
+ evaluates the same report against policy gates;
346
+ ``RevalidationThresholds`` validates rates are in
347
+ ``[0, 1]`` (and rejects NaN / bool) at construction so a
348
+ typo like ``max_fallback_for_event_rate=5`` fails loud
349
+ instead of silently disabling the gate. Multiple
350
+ thresholds all evaluated (no short-circuit), violations as
351
+ human-readable strings naming the failed rate and bound.
352
+ ``RevalidationReport.to_json()`` is deterministic for
353
+ persistence + cross-run diffing. Out of scope (deferred):
354
+ scheduled / cron orchestration, BigQuery / disk
355
+ persistence, CLI binary, sampling strategy, auto-fix
356
+ workflows.
357
+ - **Orchestrator call-site swap for compiled structured
358
+ extractors** in
359
+ `bigquery_agent_analytics.ontology_graph.OntologyGraphManager`
360
+ and
361
+ [`docs/extractor_compilation_orchestrator_swap.md`](docs/extractor_compilation_orchestrator_swap.md).
362
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
363
+ PR C2.c.2 — the actual call-site swap that puts compiled
364
+ extractors on the runtime path. New classmethod
365
+ ``OntologyGraphManager.from_bundles_root(*, project_id,
366
+ dataset_id, ontology, binding, bundles_root,
367
+ expected_fingerprint, fallback_extractors, ...)`` builds the
368
+ C2.c.1 registry adapter internally and constructs a manager
369
+ whose ``extractors`` dict is the wrapped registry — so the
370
+ existing ``run_structured_extractors`` call inside
371
+ ``extract_graph`` picks up compiled-with-fallback behavior
372
+ automatically. Manager exposes ``manager.runtime_registry:
373
+ WrappedRegistry | None`` as the audit handle (non-``None``
374
+ when bundle-wired; cross-reference
375
+ ``runtime_registry.bundles_without_fallback`` /
376
+ ``fallbacks_without_bundle`` / ``discovery.failures`` for
377
+ rollout-coverage telemetry). The existing ``__init__`` and
378
+ ``from_ontology_binding`` paths are unchanged — direct-
379
+ constructor callers leave ``runtime_registry = None`` and
380
+ back-compat holds by construction. Compiled-only event_types
381
+ without a matching fallback are NOT registered (fail-closed
382
+ per C2.b's safety contract). Out of scope (deferred): BQ-
383
+ table mirror (C2.c.3), revalidation harness (C2.d),
384
+ ``AI.GENERATE`` fallback adapter.
385
+ - **Runtime extractor-registry adapter for compiled structured
386
+ extractors** in
387
+ `bigquery_agent_analytics.extractor_compilation.runtime_registry`
388
+ and
389
+ [`docs/extractor_compilation_runtime_registry.md`](docs/extractor_compilation_runtime_registry.md).
390
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
391
+ PR C2.c.1 — the adapter that glues C2.a's
392
+ ``discover_bundles`` and C2.b's ``run_with_fallback`` into one
393
+ call. Public surface:
394
+ ``build_runtime_extractor_registry(*, bundles_root,
395
+ expected_fingerprint, fallback_extractors, resolved_graph,
396
+ event_type_allowlist, on_outcome)`` returning
397
+ ``WrappedRegistry(extractors, discovery,
398
+ bundles_without_fallback, fallbacks_without_bundle)``. The
399
+ ``extractors`` dict is ready to pass straight into the
400
+ existing ``run_structured_extractors`` hook. Wiring matrix:
401
+ compiled+fallback → wrapped closure that calls
402
+ ``run_with_fallback``; fallback-only → original callable
403
+ registered unchanged; **compiled-only → skipped and recorded
404
+ in ``bundles_without_fallback``** (C2's safety contract
405
+ requires a fallback; fail-closed default). The inverse
406
+ ``fallbacks_without_bundle`` audit surface records every
407
+ event_type whose fallback has *no usable compiled registry
408
+ entry* — that includes "bundle never built" and "bundle
409
+ exists but discovery rejected it" (fingerprint mismatch,
410
+ collision, ``manifest_unreadable``); rollout telemetry that
411
+ wants to distinguish those cases should cross-reference
412
+ ``discovery.failures``. ``fallback_extractors`` values are
413
+ validated to be callable at build time (rejects ``None`` /
414
+ non-callable with a ``TypeError`` naming the offending
415
+ event_type) so misconfiguration surfaces immediately rather
416
+ than silently in ``run_structured_extractors``.
417
+ ``event_type_allowlist`` filters both candidate pools. The
418
+ ``on_outcome`` callback fires on every wrapped invocation
419
+ including ``compiled_unchanged`` (denominator metric for
420
+ compiled-vs-fallback rate analysis); callback exceptions
421
+ propagate. **This PR ships the adapter, not the orchestrator
422
+ call-site swap** — that's C2.c.2. Out of scope (deferred):
423
+ BQ mirror (C2.c.3), revalidation harness (C2.d),
424
+ ``AI.GENERATE`` fallback adapter.
425
+ - **Runtime fallback wiring for compiled structured extractors**
426
+ in
427
+ `bigquery_agent_analytics.extractor_compilation.runtime_fallback`
428
+ and
429
+ [`docs/extractor_compilation_runtime_fallback.md`](docs/extractor_compilation_runtime_fallback.md).
430
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
431
+ PR C2.b — the runtime safety net for compiled extractors.
432
+ Public surface: ``run_with_fallback(*, event, spec,
433
+ resolved_graph, compiled_extractor, fallback_extractor)``
434
+ returning ``FallbackOutcome`` with ``decision`` ∈
435
+ ``{\"compiled_unchanged\", \"compiled_filtered\",
436
+ \"fallback_for_event\"}``. Validates the compiled extractor's
437
+ output via #76's ``validate_extracted_graph`` and routes by
438
+ failure scope: per-element failures (NODE / EDGE / FIELD with
439
+ pinpointable ``node_id`` / ``edge_id``) drop the offending
440
+ elements with orphan cleanup AND downgrade the event's
441
+ ``span_id`` from ``fully_handled_span_ids`` to
442
+ ``partially_handled_span_ids`` so the AI transcript still sees
443
+ the source span and can recover the dropped facts. EVENT-
444
+ scope failures, compiled-extractor exceptions, wrong return
445
+ types, and unpinpointable failures all trigger
446
+ ``fallback_for_event``. The wrapper does not validate the
447
+ fallback output and does not catch fallback exceptions —
448
+ fallback is the trusted runtime baseline (handwritten
449
+ extractor or ``AI.GENERATE``). Out of scope (deferred to
450
+ C2.c/d): orchestrator call-site swap, BQ-table mirror,
451
+ revalidation harness.
452
+ - **Bundle loader + minimal runtime discovery for compiled
453
+ structured extractors** in
454
+ `bigquery_agent_analytics.extractor_compilation.bundle_loader`
455
+ and
456
+ [`docs/extractor_compilation_bundle_loader.md`](docs/extractor_compilation_bundle_loader.md).
457
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
458
+ PR C2.a — the trust boundary between on-disk compiled bundles
459
+ and the runtime that's about to import + execute them. Public
460
+ surface: ``load_bundle(bundle_dir, *, expected_fingerprint,
461
+ expected_event_types)`` and ``discover_bundles(parent_dir, *,
462
+ expected_fingerprint, event_type_allowlist)`` returning
463
+ ``LoadedBundle`` / ``LoadFailure`` / ``DiscoveryResult``.
464
+ Stable ``LoadFailure`` codes — ``manifest_missing`` /
465
+ ``manifest_unreadable`` / ``fingerprint_mismatch`` /
466
+ ``event_types_mismatch`` / ``module_not_found`` /
467
+ ``import_failed`` (catches both ``Exception`` and
468
+ ``BaseException`` so a malicious or buggy bundle can't tear
469
+ down the loading process) / ``function_not_found`` /
470
+ ``function_signature_mismatch`` / ``event_type_collision``.
471
+ The loader never raises; every failure surfaces as a
472
+ structured record. The fingerprint check runs *before* module
473
+ import, so a bundle with a wrong fingerprint can't side-effect
474
+ via a broken module. Multi-event bundles register the same
475
+ callable under each declared event_type. Discovery fails
476
+ closed on event-type collisions: dropped from the registry,
477
+ one ``LoadFailure`` per claimant, other event_types from the
478
+ same bundles still register if unique. Out of scope (deferred
479
+ to C2.b/c/d): per-field/node/edge fallback through #76's
480
+ validator, BQ-table mirror, ontology-graph call-site swap,
481
+ revalidation harness.
482
+ - **Compile-and-measure utility + BKA-decision end-to-end proof**
483
+ in `bigquery_agent_analytics.extractor_compilation.measurement`
484
+ and
485
+ [`docs/extractor_compilation_bka_measurement.md`](docs/extractor_compilation_bka_measurement.md).
486
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
487
+ PR 4c — wraps ``compile_with_llm`` with a parity check against
488
+ a known-good *reference* extractor. Public surface:
489
+ ``measure_compile(...)`` returning ``CompileMeasurement`` (a
490
+ JSON-serializable record covering loop outcome, bundle
491
+ fingerprint, per-attempt failure codes, per-axis parity counts,
492
+ and audit fields like model_name / source / sample_session_ids
493
+ / captured_at). Loop failure is captured in the record rather
494
+ than raised — callers route on ``ok`` / ``parity_ok``. The
495
+ first concrete consumer is ``extract_bka_decision_event``;
496
+ ``measure_compile`` itself is generic so future extractor
497
+ baselines can reuse the parity logic. CI path (deterministic
498
+ fake LLM client) is merge-blocking and runs without an API key;
499
+ gated live path
500
+ (``BQAA_RUN_LIVE_TESTS=1`` + ``BQAA_RUN_LIVE_LLM_COMPILE_TESTS=1``)
501
+ exercises the same pipeline against real ``agent_events`` rows
502
+ and a real Gemini model, regenerating the checked-in
503
+ measurement artifact at
504
+ ``tests/fixtures_extractor_compilation/bka_decision_measurement_report.json``.
505
+ - **Retry-on-gate-failure orchestrator for compiled structured
506
+ extractors** in
507
+ `bigquery_agent_analytics.extractor_compilation.retry_loop` and
508
+ [`docs/extractor_compilation_retry_loop.md`](docs/extractor_compilation_retry_loop.md).
509
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
510
+ PR 4b.2.2.c.2 — wires the resolver prompt + parser + renderer
511
+ + ``compile_extractor`` + diagnostic builders into a single
512
+ loop that retries the LLM with structured feedback on every
513
+ gate failure. Public surface:
514
+ ``compile_with_llm(extraction_rule, event_schema, llm_client,
515
+ compile_source, max_attempts)`` returning
516
+ ``RetryCompileResult`` (``ok`` / ``manifest`` / ``bundle_dir``
517
+ / ``attempts`` / ``reason``); ``AttemptRecord`` with one
518
+ failure channel populated per failed iteration
519
+ (``plan_parse_error`` / ``render_error`` / ``compile_result``)
520
+ so telemetry can route on field name; ``build_retry_prompt(*,
521
+ original_prompt, prior_response, diagnostic)`` as the pure
522
+ prompt-stitching function. ``max_attempts=1`` runs once with
523
+ no retry; values below 1 raise ``ValueError``. LLM-client
524
+ exceptions (auth / quota / network) propagate unchanged so the
525
+ loop never silently retries non-gate failures.
526
+ ``compile_source`` is a caller-supplied closure
527
+ ``(plan, source) -> CompileResult`` that wraps
528
+ ``compile_extractor`` with the per-call inputs (sample events,
529
+ spec, parent bundle dir, fingerprint inputs, etc.) — keeps the
530
+ loop signature narrow and makes the loop trivially testable
531
+ with stubs. End-to-end test in
532
+ ``tests/test_extractor_compilation_retry_loop.py`` wires the
533
+ real ``compile_extractor`` through the loop to prove the
534
+ parser/renderer/compiler stack lines up.
535
+ - **Diagnostic builders for compiled-extractor retry feedback** in
536
+ `bigquery_agent_analytics.extractor_compilation.diagnostics` and
537
+ [`docs/extractor_compilation_diagnostics.md`](docs/extractor_compilation_diagnostics.md).
538
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
539
+ PR 4b.2.2.c.1 — turns each compile-gate failure into a string
540
+ the LLM can act on, ready for embedding in retry prompts.
541
+ Public surface: ``build_plan_parse_diagnostic(error)`` /
542
+ ``build_ast_diagnostic(report)`` / ``build_smoke_diagnostic(
543
+ report)`` /
544
+ ``build_compile_result_diagnostic(result)`` plus a
545
+ ``build_gate_diagnostic(kind, payload)`` dispatcher
546
+ (``kind ∈ {"parse", "ast", "smoke", "compile"}``).
547
+ ``build_compile_result_diagnostic`` covers the top-level
548
+ ``CompileResult`` envelope, including the
549
+ ``invalid_identifier`` / ``invalid_event_types`` /
550
+ ``load_error`` failure modes that don't surface through any
551
+ single gate's report (e.g., the LLM emits a structurally-valid
552
+ plan with the wrong ``event_type`` — parser and AST pass, but
553
+ ``compile_extractor`` rejects it for missing sample coverage).
554
+ Output is **actionable** (each per-failure entry carries the
555
+ stable failure ``code`` plus a dotted ``path`` or source line
556
+ so the LLM can grep its own response), **bounded** (each
557
+ section capped at the first ten entries with a truncation
558
+ summary; multi-line tracebacks reduced to their last
559
+ informative line), and **deterministic** (same input report →
560
+ byte-identical output). PR 4b.2.2.c.2 uses these to build
561
+ retry prompts; this PR ships the diagnostic format on its own
562
+ so the wording can be locked down before the retry loop
563
+ depends on it.
564
+ - **LLM-driven plan resolver for compiled structured extractors**
565
+ in
566
+ `bigquery_agent_analytics.extractor_compilation.plan_resolver`
567
+ and
568
+ [`docs/extractor_compilation_plan_resolver.md`](docs/extractor_compilation_plan_resolver.md).
569
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
570
+ PR 4b.2.2.b — wraps an injectable LLM client to map a raw
571
+ ``(extraction_rule, event_schema)`` pair into a
572
+ ``ResolvedExtractorPlan``. Public surface:
573
+ ``LLMClient`` ``Protocol`` with one method
574
+ (``generate_json(prompt, schema) -> dict``);
575
+ ``build_resolution_prompt(rule, schema)`` producing the
576
+ deterministic prompt (sort-keyed JSON throughout, embeds the
577
+ exported JSON Schema, instructs the LLM to use only paths that
578
+ exist in the schema, use Python-identifier-shaped names, omit
579
+ uncertain optional fields rather than invent them);
580
+ ``PlanResolver(llm_client).resolve(rule, schema)`` doing
581
+ prompt → LLM call → ``parse_resolved_extractor_plan_json``.
582
+ ``PlanParseError`` and any exception the LLM client raises
583
+ propagate unchanged so PR 4b.2.2.c can layer typed retry on
584
+ top. **Adapter-free** — no ``google-genai`` import; concrete
585
+ provider adapters and retry orchestration land in PR 4b.2.2.c
586
+ / PR 4c. Tests use fake ``LLMClient`` implementations with
587
+ pre-canned responses; no real LLM calls.
588
+ - **JSON-to-plan parser for compiled structured extractors** in
589
+ `bigquery_agent_analytics.extractor_compilation.plan_parser` and
590
+ [`docs/extractor_compilation_plan_parser.md`](docs/extractor_compilation_plan_parser.md).
591
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
592
+ PR 4b.2.2.a — turns a JSON payload (string or already-parsed
593
+ dict) into a ``ResolvedExtractorPlan`` ready for 4b.2.1's
594
+ ``render_extractor_source``. Public surface:
595
+ ``parse_resolved_extractor_plan_json(payload)`` returning a
596
+ validated plan, plus ``PlanParseError`` carrying a stable
597
+ ``code``, dotted ``path``, and human-readable ``message``.
598
+ Stable failure codes: ``invalid_json``, ``wrong_root_type``,
599
+ ``missing_required_field``, ``unknown_field``, ``wrong_type``,
600
+ ``empty_string``, ``empty_path``, ``invalid_identifier``,
601
+ ``duplicate_property_name``, ``invalid_plan``. Also exports
602
+ ``RESOLVED_EXTRACTOR_PLAN_JSON_SCHEMA`` — a Draft-2020-12 JSON
603
+ Schema dict with ``additionalProperties: false`` that PR
604
+ 4b.2.2.b will hand directly to the LLM client's structured-
605
+ output mode (Gemini's ``response_schema``, etc.) so the LLM is
606
+ constrained to emit *structurally valid* JSON. (Schema-passing
607
+ payloads can still fail parser semantic checks — Python-
608
+ identifier shape, function-name keyword exclusion, duplicate
609
+ property names — which aren't expressible in plain JSON Schema
610
+ and stay parser-only.)
611
+ **No LLM call lives here** — the parser is the deterministic
612
+ boundary every LLM-emitted plan must cross. PR 4b.2.2.b owns
613
+ the prompt and the LLM step that produces this JSON. Locked
614
+ down by a golden BKA fixture
615
+ (``tests/fixtures_extractor_compilation/plan_bka_decision.json``)
616
+ whose parsed plan renders + compiles end-to-end through 4b.2.1
617
+ + 4b.1, plus 38 schema and semantic rejection cases and 8
618
+ schema-conformance cases (55 total).
619
+ - **Deterministic source generator for compiled structured
620
+ extractors** in
621
+ `bigquery_agent_analytics.extractor_compilation.template_renderer`
622
+ and
623
+ [`docs/extractor_compilation_template_renderer.md`](docs/extractor_compilation_template_renderer.md).
624
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
625
+ PR 4b.2.1 — turns a pre-resolved
626
+ ``ResolvedExtractorPlan`` into a Python source string that 4b.1's
627
+ ``compile_extractor`` runs through every gate (AST allowlist,
628
+ smoke runner, #76 validator). Public surface:
629
+ ``FieldMapping`` / ``SpanHandlingRule`` /
630
+ ``ResolvedExtractorPlan`` dataclasses + ``render_extractor_source(plan)
631
+ -> str``. The renderer is the deterministic boundary the LLM
632
+ step in PR 4b.2.2 will plug into; **no LLM call lives here**.
633
+ Generated source carries a top-of-function ``event_type``
634
+ guard that returns an empty result when the incoming event
635
+ doesn't match the plan's declared type, layered with the
636
+ orchestrator's manifest-driven dispatch so a plan/manifest
637
+ mismatch can't silently attach an extractor to the wrong
638
+ event type. Output otherwise matches
639
+ ``extract_bka_decision_event``'s runtime behavior on the BKA
640
+ fixture's sample events. Exercised end-to-end by 39 unit
641
+ tests covering plan validation, the AST gate, the subprocess
642
+ smoke runner, plan-shape variations (no property fields, no
643
+ span handling, single-step paths, deep traversal paths,
644
+ non-dict intermediates at every depth-3 traversal site), and
645
+ wrong-event-type rejection.
646
+ - **`bq-agent-sdk binding-validate` CLI** — pre-flight validator that
647
+ checks whether a binding YAML's referenced BigQuery tables
648
+ physically exist with the columns and types the binding requires,
649
+ before extraction wastes ``AI.GENERATE`` tokens. Emits a structured
650
+ JSON report (failures + warnings) and exits 0 / 1 / 2. Supports
651
+ `--strict` to escalate `KEY_COLUMN_NULLABLE` warnings to hard
652
+ failures. See [issue #105](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/105)
653
+ and `docs/ontology/binding-validation.md`.
654
+ - **`bq-agent-sdk ontology-build --validate-binding` and
655
+ `--validate-binding-strict`** opt-in flags. Run the binding
656
+ pre-flight before phase 2 (extraction). On any failure, the build
657
+ short-circuits before any `AI.GENERATE` call fires; default-mode
658
+ warnings print to stderr but don't block. The two flags are
659
+ mutually exclusive; both incompatible with the deprecated
660
+ `--spec-path` form because the validator needs the unresolved
661
+ `Ontology` + `Binding` pair.
662
+ - **`bq-agent-sdk ontology-build --location`** — BigQuery location
663
+ (e.g. `US`, `EU`) threaded through to `build_ontology_graph()`.
664
+ The Python API has supported `location` since 0.2.3; this adds
665
+ the matching CLI flag.
666
+ - **`validate_binding_against_bigquery(...)` Python API** in
667
+ `bigquery_agent_analytics.binding_validation`. Same surface the
668
+ CLI calls: takes `Ontology` + `Binding` + `bq_client`, returns a
669
+ `BindingValidationReport` with `failures` + `warnings` lists and
670
+ an `ok` property. Issue [#105](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/105).
671
+ - **`validate_extracted_graph(spec, graph)` Python API** in
672
+ `bigquery_agent_analytics.graph_validation` — ontology-aware
673
+ post-extraction validator that checks an `ExtractedGraph` against
674
+ a `ResolvedGraph`. Returns a `ValidationReport` with typed
675
+ failures classified by `FallbackScope` (`FIELD` / `NODE` /
676
+ `EDGE`) so downstream consumers (notably the compiled-extractor
677
+ runtime in #75) know the smallest safe unit of replacement.
678
+ Twelve failure codes ship: `unknown_entity`, `missing_node_id`,
679
+ `duplicate_node_id`, `missing_key`, `key_mismatch`,
680
+ `unknown_property`, `type_mismatch`, `unsupported_type`,
681
+ `unknown_relationship`, `unresolved_endpoint`,
682
+ `wrong_endpoint_entity`, `missing_endpoint_key`. `EVENT` scope is
683
+ reserved for #75 C2.
684
+ See [issue #76](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/76)
685
+ and `docs/ontology/validation.md`.
686
+ - **`validate_extracted_graph_from_ontology(ontology, binding,
687
+ graph)`** — adapter for callers holding upstream
688
+ `Ontology` + `Binding` instead of a `ResolvedGraph`. Resolves
689
+ internally then delegates.
690
+ - **Compile-time scaffolding for structured-extractor compilation**
691
+ in `bigquery_agent_analytics.extractor_compilation` and
692
+ [`docs/extractor_compilation_scaffolding.md`](docs/extractor_compilation_scaffolding.md).
693
+ Issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
694
+ PR 4b.1 — the deterministic contract layer the LLM-driven
695
+ template fill (PR 4b.2) plugs into. Public surface:
696
+ `compute_fingerprint(...)` over the #75 input tuple,
697
+ `Manifest` with JSON round-trip, `validate_source(...)` returning
698
+ an `AstReport` with stable failure codes (`syntax_error`,
699
+ `disallowed_import`, `disallowed_name`, `disallowed_attribute`,
700
+ `disallowed_async`, `disallowed_generator`, `disallowed_class`,
701
+ `disallowed_scope`, `disallowed_decorator`, `disallowed_default`,
702
+ `disallowed_while`, `disallowed_for_iter`, `disallowed_raise`,
703
+ `disallowed_try`, `disallowed_with`, `disallowed_match`,
704
+ `disallowed_call`, `disallowed_method`, `disallowed_lambda`,
705
+ `disallowed_shadowing`, `top_level_side_effect`) — per-module symbol
706
+ allowlist, no `import x`, no wildcards, no dunder aliases, no
707
+ decorators, no non-constant defaults, no halt/escape constructs.
708
+ `run_smoke_test(...)` returning a `SmokeTestReport` gated on the
709
+ #76 `validate_extracted_graph` validator plus return-shape
710
+ checks (catches `BaseException`, rejects wrong return types,
711
+ requires at least one non-empty result by default).
712
+ `compile_extractor(...) -> CompileResult` runs the end-to-end
713
+ pipeline through a sibling staging directory and atomically
714
+ replaces the target on success — failed re-compiles leave any
715
+ pre-existing valid bundle untouched, and a second compile on
716
+ identical inputs is a cache hit (`result.cache_hit is True`,
717
+ no rewrite). `module_name` / `function_name` are validated as
718
+ Python identifiers up front, so path-traversal-shaped names
719
+ fail before the harness touches the filesystem. **No LLM call
720
+ lives here** — that's PR 4b.2. Runtime loader / orchestrator
721
+ integration is deferred to C2 per the runtime-target RFC.
722
+ - **Runtime-target decision recorded for compiled structured
723
+ extractors** in
724
+ [`docs/extractor_compilation_runtime_target.md`](docs/extractor_compilation_runtime_target.md).
725
+ Settles issue [#75](https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/75)
726
+ P0.2: Phase 1 emits plain Python and runs client-side via the
727
+ existing `run_structured_extractors()` hook in
728
+ `structured_extraction.py:198`. No SQL/UDF translation layer or
729
+ Remote Function deploy surface is taken on for Phase 1; Phase 2
730
+ re-opens the choice for the session-aggregated `AI.GENERATE`
731
+ tier with Option C (SQL / Python UDF) as the primary candidate.
732
+ Unblocks the compile-harness PR.
733
+
734
+ ## [0.2.3] - 2026-04-27
735
+
736
+ ### Fixed
737
+
738
+ - **LLM-as-Judge AI.GENERATE path now executes against current
739
+ BigQuery.** Earlier versions emitted a table-valued
740
+ ``FROM session_traces, AI.GENERATE(...) AS result`` shape with
741
+ ``output_schema`` and a flat ``model_params`` dict. Current
742
+ ``AI.GENERATE`` is a scalar function that returns a STRUCT;
743
+ the table-valued form raises ``Table-valued function not found``
744
+ and the flat ``model_params`` raises ``does not conform to the
745
+ GenerateContent request body``. Mocked unit tests passed because
746
+ they bypassed real query execution. The SDK now renders a
747
+ ``SELECT AI.GENERATE(...).score, ...`` query with a
748
+ ``generationConfig``-wrapped ``model_params`` and ``output_schema``
749
+ on the scalar form, runs against live BigQuery, and unwraps the
750
+ returned struct's ``score`` / ``justification`` / ``status``
751
+ fields.
752
+ - **LLM-as-Judge AI.GENERATE / ML.GENERATE_TEXT now uses the full
753
+ Python prompt template.** Previously both BQ-native paths sent
754
+ only ``prompt_template.split('{trace_text}')[0]`` to BigQuery,
755
+ silently dropping every instruction that followed the
756
+ placeholders — including the per-criterion output-format spec
757
+ the judge model needs to score consistently with the
758
+ API-fallback path. The two BQ paths and the Python API path now
759
+ produce comparable scores against the same prompt.
760
+
761
+ ### Added
762
+
763
+ - ``evaluators.render_ai_generate_judge_query(...)`` is the new
764
+ entry point that builds the AI.GENERATE batch SQL.
765
+ ``connection_id`` is optional — when omitted the call uses
766
+ end-user credentials; when supplied it inlines the
767
+ ``connection_id =>`` argument so callers can route through a
768
+ service-account-owned connection when their environment
769
+ requires it.
770
+ - ``Client.connection_id`` already existed; it is now plumbed
771
+ through to ``_ai_generate_judge`` so a connection set at client
772
+ construction propagates to the judge SQL automatically.
773
+ - Live BigQuery integration tests for the LLM-judge AI.GENERATE
774
+ path (``tests/test_ai_generate_judge_live.py``). Skipped by
775
+ default; opt in with ``BQAA_RUN_LIVE_TESTS=1`` plus
776
+ ``PROJECT_ID`` / ``DATASET_ID``. Three tests cover SQL parse
777
+ acceptance, expected result-schema column names, and the
778
+ ``connection_id`` escape hatch when
779
+ ``BQAA_AI_GENERATE_CONNECTION_ID`` is set. Catches the class of
780
+ mock-divergence bug that let the prior broken template ship.
781
+ - ``EvaluationReport.details["execution_mode"]`` is now populated
782
+ for LLM-as-Judge runs with one of ``ai_generate``,
783
+ ``ml_generate_text``, ``api_fallback``, or ``no_op`` — matching
784
+ the value space the categorical evaluator already exposes. When
785
+ an earlier tier raised before a later tier succeeded,
786
+ ``details["fallback_reason"]`` carries the chained exception
787
+ messages in attempt order, so CI and dashboards can audit which
788
+ path actually ran.
789
+ - ``evaluators.split_judge_prompt_template(prompt_template)`` is
790
+ the helper the SQL paths use to safely substitute the template
791
+ into ``CONCAT()``; exposed publicly for downstream code that
792
+ needs the same shape.
793
+ - ``bq-agent-sdk evaluate --exit-code`` FAIL lines now carry a
794
+ bounded ``feedback="…"`` snippet drawn from
795
+ ``SessionScore.llm_feedback`` for LLM-judge failures. The
796
+ snippet collapses internal whitespace to a single space,
797
+ truncates to 120 characters with an ellipsis, and is omitted
798
+ entirely for code-based metrics (which leave ``llm_feedback``
799
+ empty). CI logs now explain *why* the judge said the session
800
+ failed without forcing the reader to chase the JSON output.
801
+
802
+ ### Changed
803
+
804
+ - ``--strict`` help text and ``SDK.md §4`` clarified to match shipped
805
+ behavior. ``--strict`` is a *visibility* knob — it stamps
806
+ ``details['parse_error']=True`` on AI.GENERATE/ML.GENERATE_TEXT
807
+ judge rows whose ``scores`` dict is empty, and adds a report-level
808
+ ``parse_errors`` counter. It does **not** flip any session's
809
+ pass/fail outcome: both BQ-native judge methods compute ``passed``
810
+ as ``bool(scores) and all(...)``, so empty-scores rows already
811
+ fail without the flag. API-fallback parse errors coerce to
812
+ ``score=0.0``, so they fail as low-score failures rather than
813
+ parse errors. For pass/fail-only CI consumers ``--strict`` is a
814
+ no-op; reach for it when a dashboard needs to tell "no parseable
815
+ score" apart from "low score."
816
+
817
+ ## [0.2.2] - 2026-04-24
818
+
819
+ ### Changed (breaking)
820
+
821
+ - **Prebuilt `CodeEvaluator` gates now compare raw observed values
822
+ directly against the user-supplied budget.** `CodeEvaluator.latency`,
823
+ `.turn_count`, `.error_rate`, `.token_efficiency`, `.ttft`, and
824
+ `.cost_per_session` return `1.0` when the observed metric is within
825
+ budget and `0.0` otherwise. The previous implementation scored sessions
826
+ on a normalized `1.0 - (observed / budget)` scale against a `0.5` pass
827
+ cutoff, which effectively fired every gate at roughly half the budget
828
+ the user typed (e.g. `latency(threshold_ms=5000)` failed sessions at
829
+ `avg_latency_ms > 2500`). Users relying on the old sub-budget fail
830
+ behavior should lower their budgets to match their intent.
831
+ - The scheduled streaming evaluator (`streaming_observability_v1`) uses
832
+ the same raw-budget gate semantics for consistency with the prebuilt
833
+ `CodeEvaluator` factories.
834
+
835
+ ### Added
836
+
837
+ - `CodeEvaluator.add_metric` accepts `observed_key`, `observed_fn`, and
838
+ `budget` arguments that flow into `SessionScore.details[f"metric_{name}"]`
839
+ for downstream reporting. The CLI uses these to emit readable failure
840
+ lines without re-running the scorer.
841
+ - `bq-agent-sdk evaluate --exit-code` now prints a per-session failure
842
+ summary on stderr before exiting non-zero. Each line names the
843
+ session_id, failing metric, observed value, and the budget it blew
844
+ through. Output is capped at the first 10 failing sessions to keep
845
+ CI logs scannable.
846
+ - `bq-agent-sdk categorical-eval` gains `--exit-code`,
847
+ `--min-pass-rate`, and `--pass-category METRIC=CATEGORY`
848
+ (repeatable) flags. Declare which classification counts as passing
849
+ per metric, set a minimum pass rate across the run, and fail CI when
850
+ any metric falls below it. Multiple pass categories per metric are
851
+ OR'd together (e.g. `--pass-category tone=positive --pass-category
852
+ tone=neutral`). Missing metric names warn on stderr without failing
853
+ the run so configuration mistakes are visible in CI logs.
854
+
855
+ ## [0.2.1]
856
+
857
+ - See `git log` for prior changes.