docs(examples): lineage tutorial — data-source refs + agent version on traces - #503
Open
max-parke-scale wants to merge 2 commits into
Open
docs(examples): lineage tutorial — data-source refs + agent version on traces#503max-parke-scale wants to merge 2 commits into
max-parke-scale wants to merge 2 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
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
Greptile Summary
This PR adds a synchronous lineage tutorial demonstrating static, resolver-derived, and registered data-source references together with agent-version trace metadata. The attempted agent-version fallback correction still does not distinguish ordinary unlabeled builds.
Confidence Score: 4/5
The PR is not yet safe to merge because unlabeled builds still collapse distinct agent versions into the same trace identity.
The default build and deployment path does not inject an image tag or Git SHA, so the constant
unversionedfallback continues to prevent traces from being attributed to the build that produced them.Files Needing Attention: examples/tutorials/00_sync/080_lineage/Dockerfile
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Build[Docker image build] --> Arg{AGENT_VERSION supplied?} Arg -->|Yes| Version[Image tag or Git SHA] Arg -->|No| Fallback[Shared unversioned fallback] Version --> Env[AGENT_VERSION environment] Fallback --> Env Env --> Processor[SGP tracing processor] Processor --> Spans[__agent_version__ on spans]Prompt To Fix All With AI
Reviews (2): Last reviewed commit: "docs(examples): honest unversioned fallb..." | Re-trigger Greptile