Skip to content

Add typed trace destinations for session imports - #5

Merged
Stephen Belanger (Qard) merged 2 commits into
mainfrom
agent/trace-import-destinations
Aug 4, 2026
Merged

Add typed trace destinations for session imports#5
Stephen Belanger (Qard) merged 2 commits into
mainfrom
agent/trace-import-destinations

Conversation

@Qard

@Qard Stephen Belanger (Qard) commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add typed project-log, experiment, and exported-parent destinations to the daemon wire contract
  • accept project_logs:<project-id>, experiment:<experiment-id>, or --parent <SpanComponents> on imports
  • preserve parent object routing, external trace roots, and propagated events in the Braintrust sink
  • retain legacy project, experiment metadata, and parent/root fields as fallback

Covers SDK-130.

Validation

  • cargo test --manifest-path bt-daemon/Cargo.toml --all-features --locked
  • cargo clippy --manifest-path bt-daemon/Cargo.toml --all-targets --all-features --locked -- -D warnings
  • standalone import help smoke test

@Qard
Stephen Belanger (Qard) force-pushed the agent/trace-import-destinations branch from 85816df to 26aa3b8 Compare August 4, 2026 15:40
@Qard
Stephen Belanger (Qard) changed the base branch from agent/git-metadata-all-spans to main August 4, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a typed destination field to the bt-daemon wire SessionConfig so session imports (and other front-ends) can route traces explicitly to project logs, an experiment, or under an exported parent span, while keeping legacy routing fields as a fallback.

Changes:

  • Introduce TraceDestination in the wire contract and plumb it through redaction/journaling.
  • Update translators + Braintrust sink routing so exported-parent destinations preserve object routing, external roots, and propagated events.
  • Extend tests/docs to validate typed destinations and precedence over legacy metadata.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bt-daemon/tests/pipeline.rs Updates SessionConfig literals for the new destination field.
bt-daemon/tests/codex_translator.rs Updates configured test context to include destination.
bt-daemon/tests/braintrust_sink.rs Adds coverage for exported-parent propagation and typed experiment routing precedence.
bt-daemon/src/wire/mod.rs Re-exports TraceDestination from the wire module.
bt-daemon/src/wire/envelope.rs Adds SessionConfig.destination, defines TraceDestination, implements parsing + attached-span helpers, includes in redaction.
bt-daemon/src/translate/codex.rs Shapes emitted root rows to attach under an external parent span when provided.
bt-daemon/src/translate/claude.rs Uses typed destination-derived parent/root ids via attached_span_ids().
bt-daemon/src/sink/braintrust.rs Implements typed destination routing (project logs / experiment / parent span), including propagated event handling.
bt-daemon/src/main.rs Updates standalone CLI config construction to include destination: None.
bt-daemon/src/lib.rs Extends import CLI args with typed destination / --parent and applies them to session config.
bt-daemon/src/journal.rs Restores destination when reconstructing config from redacted journal entries.
bt-daemon/docs/protocol.md Documents the new destination field and import CLI syntax.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread bt-daemon/src/lib.rs Outdated
@Qard
Stephen Belanger (Qard) merged commit 4d9a931 into main Aug 4, 2026
9 checks passed
@Qard
Stephen Belanger (Qard) deleted the agent/trace-import-destinations branch August 4, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants