Skip to content

stock-watchlist-agent: add inline experiments (capture/replay regression testing) - #71

Open
mehulsonowal wants to merge 1 commit into
mainfrom
stock-watchlist-agent-inline-experiments
Open

stock-watchlist-agent: add inline experiments (capture/replay regression testing)#71
mehulsonowal wants to merge 1 commit into
mainfrom
stock-watchlist-agent-inline-experiments

Conversation

@mehulsonowal

@mehulsonowal mehulsonowal commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Layers the ddtrace inline experiments workflow onto the stock-watchlist-agent — "a unit test for LLM apps": mark an input→output boundary, capture a baseline of current behavior, edit code, replay the current code against it, and get per-case match/changed verdicts (plus optional evaluators and a --publish path to the Experiments UI).

What it adds:

  • @experiment_start on the analyze_portfolio boundary + attached evaluators (completeness + sentiment/grounding LLM judges)
  • capture_watchlists.py / capture_quotes.py baseline harnesses
  • INLINE_EXPERIMENTS_GUIDE.md — a concise capture → replay → --evaluate--publish quickstart
  • .env auto-loading (sitecustomize.py) + an observability init helper

Loop:

cd test-apps/stock-watchlist-agent && python -m venv .venv && .venv/bin/pip install -e .
export OPENAI_API_KEY=sk-...
exp() { PYTHONPATH=. .venv/bin/ddtrace-experiment "$@"; }
exp capture capture_watchlists:generate_traffic
exp replay  src.agents.orchestrator --evaluate

Requires a ddtrace version that includes inline experiments (the ddtrace-experiment CLI and ddtrace.llmobs.experimental). Currently pre-release — do not merge ahead of that ddtrace release.

🤖 Generated with Claude Code

@mehulsonowal
mehulsonowal requested a review from a team as a code owner July 1, 2026 19:59
Base automatically changed from add-stock-watchlist-agent to main July 1, 2026 20:45
…atchlist-agent

Layer the ddtrace inline-experiments workflow onto the demo:
- mark the analyze_portfolio boundary with @experiment_start and attach evaluators
  (completeness + sentiment/grounding LLM judges)
- capture_watchlists.py / capture_quotes.py harnesses to record baselines
- INLINE_EXPERIMENTS_GUIDE.md quickstart (capture -> replay -> --evaluate -> --publish)
- .env auto-loading + an observability init helper

Requires a ddtrace version that includes inline experiments (the ddtrace-experiment CLI
and ddtrace.llmobs.experimental).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mehulsonowal
mehulsonowal force-pushed the stock-watchlist-agent-inline-experiments branch from e9a7575 to d63955c Compare July 1, 2026 20:47
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.

2 participants