@@ -7,8 +7,76 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
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+
1039### Added
1140
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+
1280- ** Migration v5 periodic materialization playbook** in
1381 [ ` examples/migration_v5/periodic_materialization/README.md ` ] ( examples/migration_v5/periodic_materialization/README.md )
1482 (PR [ #168 ] ( https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/pull/168 ) ).
@@ -20,6 +88,34 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2088 troubleshooting. Complements the migration v5 four-guarantee
2189 notebook by covering the production cron path.
2290
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+
23119## [ 0.3.0] - 2026-05-15
24120
25121### Release highlights
0 commit comments