Skip to content

chore(agents): add dd-trace-java overrides for dd-apm-sdk-review - #12460

Open
robertomonteromiguel wants to merge 9 commits into
robertomonteromiguel/dd-apm-sdk-review-core-copyfrom
robertomonteromiguel/dd-apm-sdk-review-java-overrides
Open

chore(agents): add dd-trace-java overrides for dd-apm-sdk-review#12460
robertomonteromiguel wants to merge 9 commits into
robertomonteromiguel/dd-apm-sdk-review-core-copyfrom
robertomonteromiguel/dd-apm-sdk-review-java-overrides

Conversation

@robertomonteromiguel

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds the dd-trace-java layer on top of the shared skill copy.

  • .agents/dd-apm-sdk-review-overrides/ — Java reviewer facts (performance, conventions, design, security, maintainability, repo context)
  • AGENTS.md — short hook: local agents run the skill; Codex reads review-without-harness.md
  • .llm-validation/ — cases that exercise those rules, plus the GitLab "llm validation" include
  • Replaces the retired /perf-review skill (deleted here; its Java-specific rubric lives in the performance override)

Stacked on the core-copy PR. Shared skill source: dd-apm-sdk-review-core#1.

Motivation

This is the half of #12364 that Java reviewers should actually read.

Additional Notes

How to review

  • Start here: .agents/dd-apm-sdk-review-overrides/
  • Then: the AGENTS.md Review Guidelines block
  • Then: .llm-validation/ if you care about the gate
  • Skip .agents/skills/dd-apm-sdk-review/ — that is the parent PR / core repo

Merge with the parent skill-copy PR, not as a standalone.

Made with Cursor

Repo-specific reviewer facts, AGENTS.md hook, llm-validation suite,
and replace the retired perf-review skill. Stacked on the verbatim
skill copy.
The previous commit copied .gitlab-ci.yml from the old combined
branch and dropped unrelated master changes.
@robertomonteromiguel

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 2ab24b4dc9

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 59.13% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8cbdbb0 | Docs | View more details | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.79 s 14.64 s [-0.0%; +2.1%] (no difference)
startup:insecure-bank:tracing:Agent 13.61 s 13.68 s [-1.6%; +0.6%] (no difference)
startup:petclinic:appsec:Agent 17.52 s 17.42 s [-0.2%; +1.5%] (no difference)
startup:petclinic:iast:Agent 16.78 s 17.53 s [-8.4%; -0.2%] (maybe better)
startup:petclinic:profiling:Agent 17.09 s 17.37 s [-2.8%; -0.4%] (maybe better)
startup:petclinic:sca:Agent 17.56 s 17.36 s [+0.3%; +1.9%] (maybe worse)
startup:petclinic:tracing:Agent 16.12 s 16.71 s [-7.6%; +0.6%] (no difference)

Commit: 8cbdbb07 · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Keep the stacked overrides branch on the latest verbatim skill copy.
Use the current platform SHA for the GitLab include and the job clone.
@robertomonteromiguel

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f8f15a0d73

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .llm-validation/suites/dd-apm-sdk-review.yaml
Comment thread .llm-validation/suites/dd-apm-sdk-review.yaml Outdated
Comment thread .llm-validation/config.yaml
Keep the stacked overrides branch on the latest verbatim skill copy.
Evaluate crash-handler ordering as a security-lens report, not the
orchestrator's redacted output. Require firstSpanWritten to reset on
the payload-flush hook, not at every map().
@robertomonteromiguel

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7a96d17e1f

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .agents/dd-apm-sdk-review-overrides/reviewers/design.md Outdated
Comment thread .llm-validation/suites/dd-apm-sdk-review.yaml
Comment thread .agents/dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
Don't flag feature-flagging modules against an aspirational -lib split;
point J1 at EscapeShapeBenchmark; make the HashMap fixture lookup-only.
Also merge the skill-copy secret-scan sync.
…robertomonteromiguel/dd-apm-sdk-review-java-overrides
@robertomonteromiguel

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84bb97ad43

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread .agents/dd-apm-sdk-review-overrides/reviewers/design.md Outdated
Comment thread .llm-validation/suites/dd-apm-sdk-review.yaml
@pr-commenter

pr-commenter Bot commented Sep 11, 2026

Copy link
Copy Markdown

LLM Validation

LLM Validation Gate — dd-apm-sdk-review

🔴 FAIL

  • 1 blocking case(s) confidently regressed (win-rate below 45% with the CI upper bound below 55%, or the CI entirely below 50%) — these must not regress.
  • Advisory: the candidate introduced a bad signal on 1 case(s) that the baseline did not — surfaced for review (see Cases); it does not block on its own.
  • Confirmation pass: re-ran 1 case(s) flagged as a confident regression (+8 runs each); 1 reproduced after pooling and still block.

Analysis

Changed instruction file(s): .agents/skills/dd-apm-sdk-review/SKILL.md, .agents/skills/dd-apm-sdk-review/reviewers/_common.md, .agents/skills/dd-apm-sdk-review/reviewers/correctness.md, .agents/skills/dd-apm-sdk-review/reviewers/performance.md, .agents/skills/dd-apm-sdk-review/reviewers/report-template.md, .agents/skills/dd-apm-sdk-review/review-without-harness.md, .agents/skills/dd-apm-sdk-review/reviewers/coherence.md, .agents/skills/dd-apm-sdk-review/reviewers/security.md, .agents/skills/dd-apm-sdk-review/reviewers/design.md, .agents/skills/dd-apm-sdk-review/reviewers/maintainability.md, .agents/skills/dd-apm-sdk-review/reviewers/conventions.md, .agents/skills/dd-apm-sdk-review/reviewers/cross-sdk.md, .agents/dd-apm-sdk-review-overrides/repo-context.md, .agents/dd-apm-sdk-review-overrides/reviewers/security.md, .agents/dd-apm-sdk-review-overrides/reviewers/performance.md, .agents/dd-apm-sdk-review-overrides/reviewers/design.md, .agents/dd-apm-sdk-review-overrides/reviewers/conventions.md, .agents/dd-apm-sdk-review-overrides/reviewers/maintainability.md.

Blocking — 1 case(s) regressed; the gate failed on the worst below.

  • java-correctness-mapper-state-leak: won 20% of blind comparisons, quality -21.3. ⚠️ Introduced a new bad signal (advisory).
    • Asked: Run dd-apm-sdk-review on the following change. There is no git repository to inspect — this diff is the entire change set; do not attempt any git commands, go
    • Baseline answer: # dd-apm-sdk-review: dd-trace-java Verdict: BLOCK Target: (pasted diff — no branch/base resolved) Files: 1 Mode: pasted diff, no git; single-context sequential passes ## P0 - [correctness / coherence] dd-trace-core/.../ddagent/TraceMapperV0_4.javamap(), the span.processTagsAndBaggage(...) call — the
    • Candidate answer: I now have everything needed. Let me trace the two independent mechanisms to be precise, then consolidate. Verified facts: - DDSpanContext:1254-1263 (single-arg path, reached by the pasted diff's processTagsAndBaggage(consumer)) passes the instance field propagationTags unconditionally. -

Results

  • Pairwise win-rate: 46% [37%–54%] — candidate's share of blind comparisons (90% CI; spanning 50% = no clear difference)
  • Overall quality: 76.4 → 70.9 (/100, -5.6)
  • Bad signals introduced (advisory): 1
  • Candidate criteria coverage (advisory): 29/32 (91%) — expected_criteria the candidate met; does not affect the gate
  • Candidate bad signals (all, advisory): 1 case(s) — trips on the candidate, including ones the baseline also hit
  • Blocking-case regressions: 1

Cases

Case Mode Quality Δ Win-rate (90% CI) Safety
java-perf-lens-wrong-collection-001 block +1.7 62% [42%–83%] ok
java-perf-pipeline-full-review-002 block +15.0 75% [51%–99%] ok
java-security-crash-handler-before-trust block -0.8 50% [50%–50%] ok
java-correctness-capture-before-send block +6.7 75% [51%–99%] ok
java-correctness-sqs-queue-name-incomplete block +8.8 75% [51%–99%] ok
java-maintainability-resource-leak-streams block -1.3 38% [17%–58%] ok
java-correctness-span-events-list-only block +9.6 75% [51%–99%] ok
java-correctness-mapper-state-leak 🔴 block -21.3 20% [9%–31%] ⚠️ bad signal

Per-dimension scores, token usage, latency, and estimated cost are in the CI job logs.

Auto-instrumentations still require InstrumenterModule; product
transformers do not. The full-review fixture now states the J10/J12
preconditions the performance override already requires.
@robertomonteromiguel

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 8cbdbb070e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@robertomonteromiguel
robertomonteromiguel marked this pull request as ready for review September 11, 2026 14:44
@robertomonteromiguel
robertomonteromiguel requested review from bric3 and erikayasuda and removed request for a team September 11, 2026 14:44

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8cbdbb070e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread AGENTS.md
- **Technical debt**: run `/techdebt` over branch changes before marking a PR ready to catch code duplication, unnecessary complexity, and dead code (refactor-only, never changes behavior) — see [.agents/skills/techdebt/SKILL.md](.agents/skills/techdebt/SKILL.md).
- **Performance**: run `/perf-review` over branch changes before marking a PR ready (advisory, not a merge gate) — see [.agents/skills/perf-review/SKILL.md](.agents/skills/perf-review/SKILL.md).
- **Local agent with a skill harness (pilot):** before pushing, run [dd-apm-sdk-review](.agents/skills/dd-apm-sdk-review/SKILL.md) on your unpushed changes unless the user says not to. If any `P0` finding is reported, fix it or get explicit authorization and record the unresolved finding verbatim in the PR description. `P1`/`P2` findings should be fixed before pushing but can be dismissed by the human. Security findings are never pasted into the PR description — route them privately. (Performance review, previously the standalone `/perf-review` skill, is now one of this skill's perspectives — see `.agents/dd-apm-sdk-review-overrides/reviewers/performance.md`.)
- **Reviewer without a skill harness** (for example, GitHub Codex): read and follow `.agents/skills/dd-apm-sdk-review/review-without-harness.md`. Do not load `SKILL.md` or `reviewers/report-template.md`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add private routing for no-harness security findings

Unlike the corrected validation fixture, the newly enabled no-harness path has no private orchestrator: review-without-harness.md loads the security lens and directs the bot to post its findings as review comments, while reviewers/security.md requires those findings to be handled privately. When GitHub Codex discovers a vulnerability, it will therefore publish the location and failure mode instead of routing them privately; add an explicit security exception and private-reporting behavior to the no-harness contract.

AGENTS.md reference: AGENTS.md:L79-L80

Useful? React with 👍 / 👎.

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Datadog Autotest: FAIL

The gate does not test the review contract without a skill harness. The security case also accepts P1 although the new rule requires P0.

Open Bits AI session

🤖 Datadog Autotest · Commit 8cbdbb0 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

- .agents/skills/dd-apm-sdk-review/reviewers/correctness.md
- .agents/skills/dd-apm-sdk-review/reviewers/performance.md
- .agents/skills/dd-apm-sdk-review/reviewers/report-template.md
- .agents/skills/dd-apm-sdk-review/review-without-harness.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Add a case for review without a harness

A change can break review without a skill harness, and the gate can still pass.

Assertion details
  • Input: Change only .agents/skills/dd-apm-sdk-review/review-without-harness.md.
  • Expected: A selected case must load this file and check its review rules.
  • Actual: The job monitors this file, but no validation case loads it. The baseline and candidate prompts stay the same.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

```
expected_criteria:
- "Flags that the JVM handler flag (`OnError`) is set to the target script/path BEFORE `CrashUploaderScriptInitializer.initialize(...)` — the ownership/trust validation — has run and returned a result. It is not enough to note that a validation step exists; the report must call out the ordering problem — if `initialize(...)` later rejects the path, the flag has already been committed to the untrusted path and the JVM crash handler will still execute it on a crash."
- "Classifies this as a security finding (P0 or P1, not merely a style/maintainability nit) — a security control that can be silently bypassed."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Require P0 for the security bypass

The gate can accept a review that gives the security bypass the wrong priority.

Assertion details
  • Input: The reviewer reports the untrusted script-path bypass as P1.
  • Expected: The criterion must require P0, as the security rule states.
  • Actual: The criterion accepts P0 or P1.
Suggested change
- "Classifies this as a security finding (P0 or P1, not merely a style/maintainability nit) — a security control that can be silently bypassed."
- "Classifies this as a security finding (P0, not merely a style/maintainability nit) — a security control that can be silently bypassed."

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest · Open Bits AI session

@dougqh

dougqh commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

The dd-gitlab/llm validation and dd-gitlab/default-pipeline checks are currently failing. Since this PR introduces the .llm-validation/ suite itself, worth confirming whether that's a real eval regression or first-run CI wiring before merging.

Also no labels yet — per this repo's conventions, please add:

  • a type: label
  • a comp:/inst: label
  • tag: ai generated

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