Skip to content

test(llm-validation): A/B experiment on AGENTS.md usefulness + new config-migration benchmark case#4988

Draft
anna-git wants to merge 7 commits into
mainfrom
anna.yafi/test-bad-agents-change
Draft

test(llm-validation): A/B experiment on AGENTS.md usefulness + new config-migration benchmark case#4988
anna-git wants to merge 7 commits into
mainfrom
anna.yafi/test-bad-agents-change

Conversation

@anna-git

@anna-git anna-git commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Demonstrates an A/B experiment using the LLM validation platform's gateway-backed comparative judge to measure whether AGENTS.md instruction files actually change agent behavior/quality in dd-trace-go, and adds a new, harder benchmark case that specifically targets the recent internal/config migration pattern.

Commit-by-commit:

  • 607249e98 — intentionally-bad contrib/AGENTS.md variant, used to confirm the gate can detect a real regression when instructions are actively sabotaged.
  • 4b96275df — full deletion of all monitored AGENTS.md files, used to A/B "real AGENTS.md" vs. "no AGENTS.md at all."
  • 973947f01 — adds a new suite case, dd-trace-go-config-new-env-var-005, which asks an agent to wire up a new env-var-backed config value and checks whether it follows the internal/config singleton/provider/precedence pattern (owning module, loadConfig(), getter/setter, checkProductConflict, configtelemetry.Report, key registration) instead of reading os.Getenv directly or copying legacy helpers like internal.BoolEnv.

Motivation

We wanted empirical evidence (not just intuition) on whether AGENTS.md files are pulling their weight in this repo. The first two existing cases showed no measurable difference between real and deleted AGENTS.md (50-62% win-rate, within the noise band). The new case was designed to stress-test a scenario where an agent's instinct to mirror nearby (partially legacy) code could lead it astray without explicit guidance — and it did produce a real signal: baseline (real AGENTS.md) failed safety criteria in 3/4 runs by mirroring a legacy env-var read pattern, while candidate scored +23.1 quality and 75% win-rate on that case.

This PR is exploratory/demonstrative — it's meant to open the little CI check square so the LLM validation gate result is visible on a real PR, not to merge sabotage/deletion commits into dd-trace-go.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running make lint locally.
  • New code doesn't break existing tests. You can check this by running make test locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • All generated files are up to date. You can check this by running make generate locally.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running make fix-modules locally.

Unsure? Have a question? Request a review!

anna-git and others added 7 commits June 30, 2026 16:40
Introduces the .llm-validation/ scaffold that wires dd-trace-go into the
Datadog LLM Validation Platform gate. PRs that modify the monitored
instruction files (AGENTS.md, contrib/AGENTS.md, ddtrace/tracer/AGENTS.md,
internal/AGENTS.md) will be automatically judged: the gate compares the
PR's instruction files against main through the Datadog AI Gateway and
posts a PASS/WARN/FAIL verdict, blocking the merge on a confident regression.

Cases in suites/dd-trace-go-agent-v0.1.yaml:
- dd-trace-go-contrib-structure-001 (blocking): Go workspace layout,
  per-contrib go.mod, go test must run from inside the contrib dir
- dd-trace-go-contrib-tags-002 (blocking): span.kind and component tags
- dd-trace-go-tracer-api-break-003 (warn-only): breaking-api-acknowledged
  label and make apidiff/incompatible
- dd-trace-go-control-general-go-004 (warn-only): control case (AGENTS.md
  must not bloat answers to unrelated Go questions)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add the cross-project include from llm-validation-platform so the gate
job runs automatically when a monitored instruction file changes in a PR.
The job self-skips when no monitored file changed; a FAIL blocks the merge.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Temporary: reference the generic platform branch until it merges to main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dd-trace-go uses main, not master. Platform default is master.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on gate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Deletes the root, contrib/, ddtrace/tracer/, and internal/ AGENTS.md
files as an llm-validation candidate variant to measure whether the
agent performs better, worse, or the same without them.
Tests whether the agent, when asked to add a new DD_* env var, routes
it through internal/config (loadConfig -> provider precedence ->
getter/setter with checkProductConflict + configtelemetry.Report)
instead of reading it directly via os.Getenv or a legacy helper, per
the internal/config migration Mikayla Toffler has been landing
(internal/config/README.md, internal/README.md).
@anna-git anna-git added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jul 6, 2026
@github-actions github-actions Bot added the apm:ecosystem contrib/* related feature requests or bugs label Jul 6, 2026
@github-actions

This comment was marked as off-topic.

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 6, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

Pull Request Tests | PR Unit and Integration Tests (1.25) / test-contrib-matrix (./contrib/azure/apim-callout/ ./contrib/cloud.google.com/go/pubsub.v2/ ./con...   View in Datadog   GitHub Actions

Check Pull Request CI Status | all-jobs-are-green   View in Datadog   GitHub Actions

Pull Request Tests | PR Unit and Integration Tests (1.25) / test-contrib   View in Datadog   GitHub Actions

View all 4 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 973947f | Docs | Datadog PR Page | Give us feedback!

@anna-git

anna-git commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

AGENTS.md present vs. deleted — scoring comparison

4 runs/case, blind pairwise comparison judged by claude-opus-4-8.

Case With AGENTS.md AGENTS.md deleted Win-rate (deleted) Verdict
Contrib directory structure 81.2/100 80.8/100 50% [50–50%] No difference
Contrib span tags 75.4/100 77.1/100 62% [49–76%] No difference (noise)
New config env var 50.8/100 ⚠️ 75.8/100 75% [48–100%] AGENTS.md hurt — safety failed on both
Overall (suite avg) 69.6/100 77.3/100 62% [52–73%] Deleting it helped

Why case 3 flips it: with the real internal/AGENTS.md present, the agent still mirrored a legacy env-var read pattern (internal.BoolEnv) instead of the current internal/config provider pattern — internal/AGENTS.md only says "read the README," which isn't specific enough to override copying nearby legacy code. Without it, the agent read more broadly and landed on the current pattern.

Bottom line: on the two original cases, AGENTS.md is inert (within noise). On the case designed to stress a real architectural migration, it's actively counterproductive as currently written.

@kakkoyun kakkoyun self-requested a review July 7, 2026 13:22
@genesor genesor self-requested a review July 8, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos apm:ecosystem contrib/* related feature requests or bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant