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