docs(examples): lineage tutorial — data-source refs + agent version on traces - #503
Open
max-parke-scale wants to merge 4 commits into
Open
max-parke-scale wants to merge 4 commits into
max-parke-scale wants to merge 4 commits into
Conversation
…on on traces New sync tutorial 00_sync/080_lineage exercising the SGP-6513 capture surface shipped in 0.25.0: @data_sources static refs, an argument resolver, register_tool_sources for unowned (MCP-style) tools, and the AGENT_VERSION env stamp. Verified live against sgp-dev: tool spans carry sgp.lineage.refs and every span carries __agent_version__, both filterable via the spans-search extra_metadata DSL. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s AGENT_VERSION Greptile P1: a fixed 0.1.0 default would stamp every unlabeled build with a real-looking version, misattributing traces across commits. The fallback is now the explicit sentinel 'unversioned'. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
max-parke-scale
force-pushed
the
mparke/lineage-example-agent
branch
from
August 28, 2026 17:37
920260e to
90980ec
Compare
stainless-app
Bot
force-pushed
the
next
branch
from
September 15, 2026 00:35
55a0178 to
a71fa67
Compare
Takes next's .stats.yml (Stainless codegen metadata from release #506); no source conflicts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
New sync tutorial
00_sync/080_lineage: the first agent that exercises the lineage capture surface shipped in 0.25.0 (#469), so the provenance is visible in real traces instead of only in SDK unit tests.What it demonstrates
sgp.lineage.refscapture forms:@data_sourceswith static refs (search_filings), an argument resolver (read_kpi— ref derived from thetableargument, nothing recorded when it's absent), andregister_tool_sourcesfor an unowned MCP-style tool (company_profile).__agent_version__on every span, from theAGENT_VERSIONenv var. Nothing wires that var today (deploy-chart wiring is still open), so the tutorial sets it via a Dockerfile build arg and documents.envfor local runs.050_openai_agents(OpenAITurn→UnifiedEmitter), so refs resolve through the harness tracer path.Verified live on sgp-dev
Ran the agent against sgp-dev (trace
lineage-demo-8fe657d30fa3, account68754be7ac3f41b875f912a1). Every tool span carries its declared refs, e.g.read_kpi:POST /v5/spans/searchwith{"extra_metadata": {"__agent_version__": "0.1.0-demo"}}returns exactly the run's 4 spans — first live confirmation of the filterability #469's description asserted.The offline test verifies the three capture forms resolve under the tool names the harness sees; CI runs it in-image like the other tutorials.
🧑💻🤖 — posted via Claude Code
The PR appears safe to merge.
Summary
Adds a sync lineage tutorial that shows data-source references and agent versions on real traces. It uses the existing streaming harness so the metadata follows normal tool calls.
Diagram
sequenceDiagram actor User participant ACP as FastACP participant Agent as OpenAI Agent participant Tool as Tutorial tool participant Harness as UnifiedEmitter participant Trace as SGP tracing User->>ACP: Send company research message ACP->>Trace: Start message span ACP->>Agent: Run streamed turn Agent->>Tool: Call search_filings, read_kpi, company_profile Tool-->>Agent: Return canned result Agent-->>Harness: Stream text and tool events Harness->>Trace: Create tool spans with sgp.lineage.refs Trace->>Trace: Add AGENT_VERSION as __agent_version__ Harness-->>ACP: Yield task message updates ACP-->>User: Stream responseReviews (3) · Last reviewed commit: "Merge origin/next into mparke/lineage-ex..."