GoogleCloudPlatform / GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK

adk-2.0 producer: stamp identity fields (schema_version, app_name, source_event_id) on enriched rows

Open
#195 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
47
Forks
21
Avg merge
2d 13h
Merged PRs (30d)
33

Description

Parent tracker: #190 (v15 contract).
Wave: 1 — Producer plumbing foundation.
Blocked by: https://github.com/GoogleCloudPlatform/BigQuery-Agent-Analytics-SDK/issues/194 (source-event plumbing — `source_event_id` can't be stamped reliably until that lands).

## Contract

Stamp three identity fields under `attributes.adk` on the appropriate rows. The schema strategy in #190 is **no new top-level columns** — all of these live under `attributes.adk`.

| Field | Scope | Source |
|---|---|---|
| `attributes.adk.schema_version` | **Every** ADK-enriched row | Plugin constant |
| `attributes.adk.app_name` | **Every** ADK-enriched row | `InvocationContext.app_name` |
| `attributes.adk.source_event_id` | **Only** rows with an originating ADK `Event` | `Event.id` |

`source_event_id` is the gate that the consumer-side `scope_cardinality` and other Event-anchored views key off (#190 v13+).

## Acceptance

- [ ] Every row produced by the plugin (including non-Event-originating callback rows) carries `attributes.adk.schema_version`.
- [ ] Every row carries `attributes.adk.app_name` (read from `InvocationContext.app_name`).
- [ ] Rows that originate from an ADK `Event` carry `attributes.adk.source_event_id` = `Event.id`.
- [ ] Rows without an originating `Event` leave `source_event_id` null (no synthetic IDs).
- [ ] A test asserts the per-field coverage on at least: `USER_MESSAGE_RECEIVED`, `LLM_REQUEST`, `AGENT_RESPONSE`, `TOOL_STARTING`.

## References

- #190 (v15 producer §3, §4; v8 `app_name` decision).
- `src/google/adk/plugins/bigquery_agent_analytics_plugin.py:2815` (`_log_event`).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.