Repository navigation
Conversation
Create a fresh plugin-local segment for each runner call and emit the first path-bearing source event without claiming a node lifecycle boundary.
Drain source-event spans, sticky interrupt evidence, and factual node-error counts from both runner terminal callbacks without inferring completion or failure.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ensure you have read the contribution guide before creating a pull request.
Caution
Draft implementation; do not merge yet. RFC google#98 requires one named
production query that cannot be answered by a canonical aggregate view over
real Stage 1 data. The high-cardinality drain residual under Additional
context must also be resolved before this PR becomes ready for review.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
Stage 1 made workflow-node outputs and errors visible, but it cannot separate
resumed runner calls that reuse
invocation_id, retain interrupt evidence, ordescribe source-event windows consistently. Calling these inferred facts node
start, completion, failure, or latency would overstate what the plugin observes.
Solution:
This PR adds an additive, plugin-only observation contract:
WORKFLOW_NODE_FIRST_OBSERVEDrecords the first path-bearing event seen inone runner call.
WORKFLOW_NODE_OBSERVATION_SUMMARYrecords first/last source-eventprovenance, signed event span, event count, direct/descendant interrupt
evidence, node-error count, and the terminal callback that drained the
segment.
workflow_segment_idseparates resume calls even wheninvocation_idand node paths are reused.physical table schema.
The producer records observations before event-row filtering. Both terminal
callbacks clear task-local state in
finally. A failed synthetic observationrow cannot suppress the existing invocation or node telemetry.
Testing Plan
Unit Tests:
Passed result:
Command:
The tests cover segmentation, partial and empty-path events, signed and
zero-length spans, direct and ancestor interrupt evidence, node-error counts,
normal and error drains, concurrent task isolation, disabled/shutdown paths,
failure isolation, exact Stage 1 row ordering, event filtering, and typed-view
projections.
Repository hooks pass for both changed files. A focused
mypyrun stillreports the plugin file's existing strict-mode errors; it reports no error on
the new observation code. Repository-wide
toxwas not run because the lockedoptional environment cannot be installed on this Intel macOS host:
google-antigravityandcryptography==50.0.0do not provide compatiblewheels in this environment.
Manual End-to-End (E2E) Tests:
Not run. The RFC's implementation gate intentionally requires evaluation
against real Stage 1 BigQuery data before producer rows are enabled for merge.
Checklist
toxremains outstanding.)04b8b727.)Additional context
Contract limits are deliberate:
time. A one-event FunctionNode has a zero source-event span.
to persisted session or
NODE_*rows.an in-progress call can produce the same shape.
Known merge-blocking residual:
If one runner call observes more distinct node paths than the bounded writer
queue can accept without yielding, the trailing
INVOCATION_COMPLETEDorINVOCATION_ERRORrow can be dropped. Before this draft becomes ready, chooseand test a bounded drain or terminal-row capacity policy that preserves the
RFC's required ordering.
This PR targets
rfc98/upstream-main-3f21e891, which is pinned to currentupstream
mainat3f21e891. That keeps the fork's stalemainand thecontract-stale PR #8 untouched.
Post-Deploy Monitoring & Validation
Could not emit workflow-nodeandBigQuery log queue full.get_drop_stats()["queue_full"], per-invocation row growth, and theratio of summary rows to distinct
(workflow_segment_id, node_path)pairs.in an opt-in canary using the named production query.
material write-volume regression. Mitigate by denylisting both new event
types and return the draft to design review.
maintainer running the RFC How to deploy the agent as self-managed google/adk-python#98 gate evaluation.
New concepts
Observation windows are not lifecycle boundaries
An observation window summarizes the events a plugin actually received for a
node path during one runner call. It does not claim when the node started or
stopped executing.
This distinction matters here because ADK has no public node-lifecycle callback
that covers retries, replay, pause/resume, cancellation, and silent nodes. The
plugin can publish factual source-event provenance now without consuming exact
names such as
WORKFLOW_NODE_STARTINGorWORKFLOW_NODE_COMPLETED.For example, a FunctionNode that works for one minute and emits one result has
a zero observation span. Use this contract for event-span and interrupt
analytics. Do not use it for wall-time latency, completion status, or failure
attribution.