Skip to content

Replace perf-review skill with multi-perspective dd-apm-sdk-review - #12349

Closed
robertomonteromiguel wants to merge 15 commits into
masterfrom
phase1/agentic-review-rollout
Closed

Replace perf-review skill with multi-perspective dd-apm-sdk-review#12349
robertomonteromiguel wants to merge 15 commits into
masterfrom
phase1/agentic-review-rollout

Conversation

@robertomonteromiguel

@robertomonteromiguel robertomonteromiguel commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What Does This Do

Adds the dd-apm-sdk-review skill: a multi-perspective review (coherence, security,
design, performance, maintainability, conventions, cross-SDK) that runs over a pending
change set and consolidates findings into a single report with an explicit verdict
(BLOCK / APPROVE_WITH_COMMENTS / APPROVE).

Includes:

  • the skill's core (.agents/skills/dd-apm-sdk-review/), this repo's
    context/overrides (dd-apm-sdk-review-overrides/)
  • a runnable promptfoo eval suite
    (.promptfoo/dd-apm-sdk-review/), an equivalent eval suite in a custom format
    (.llm-validation/)
  • an updated AGENTS.md review-guidelines section making the skill
    a mandatory push gate
  • and CODEOWNERS/.gitignore updates for the new directories.

Note: Unlike the equivalent rollout in dd-trace-js, this PR also removes the standalone
perf-review skill (.agents/skills/perf-review/, .claude/skills/perf-review), since
its checks are now folded in as the performance reviewer perspective inside
dd-apm-sdk-review-overrides/reviewers/performance.md.

Motivation

We want a consistent, automated review pass — covering correctness, security, and
repo-specific conventions — applied before every push, instead of relying solely on
ad hoc human review. This is phase 1 of rolling that out to dd-trace-java, mirroring
the rollout already done in dd-trace-js (DataDog/dd-trace-js#10070).

Additional Notes

  • Start by reviewing the shared rules introduced in the core repo:
    https://github.com/DataDog/dd-apm-sdk-review-core/pull/1
  • Do not edit the files under .agents/skills/dd-apm-sdk-review/ in this repository.
    They are exact copies of the files from DataDog/dd-apm-sdk-review-core. Any changes
    to them should be made in the upstream repository instead.
  • dd-apm-sdk-review-overrides/ contains the repository- and language-specific
    review rules. These are the ones that should be edited directly in this repo.
  • This PR retires perf-review in favor of the new skill's performance reviewer
    perspective — no standalone performance-review skill remains after this change.
  • Evaluator choice (promptfoo vs. llm-validation-platform vs. ddevals) is still under
    discussion upstream; both eval suites are kept for now, consistent with dd-trace-js.
  • The current validation coverage is limited to a few basic examples. We need additional evaluation cases to validate every review lens.

Contributor Checklist

Jira ticket: [PROJ-IDENT]

@datadog-datadog-us1-prod

This comment has been minimized.

@dd-octo-sts

dd-octo-sts Bot commented Aug 31, 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 13.97 s 14.05 s [-1.2%; +0.1%] (no difference)
startup:insecure-bank:tracing:Agent 12.99 s 13.03 s [-1.1%; +0.5%] (no difference)
startup:petclinic:appsec:Agent 17.54 s 17.38 s [+0.2%; +1.7%] (maybe worse)
startup:petclinic:iast:Agent 17.07 s 17.63 s [-7.3%; +1.0%] (no difference)
startup:petclinic:profiling:Agent 17.37 s 17.41 s [-1.4%; +1.0%] (no difference)
startup:petclinic:sca:Agent 17.40 s 17.45 s [-1.4%; +0.7%] (no difference)
startup:petclinic:tracing:Agent 16.57 s 16.78 s [-2.3%; -0.3%] (maybe better)

Commit: 090c3a8b · 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.

@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: 11aa8f1af7

ℹ️ 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 Outdated
Comment thread .agents/skills/dd-apm-sdk-review/SKILL.md Outdated
Comment thread .agents/skills/dd-apm-sdk-review/SKILL.md Outdated
Comment thread dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
Fixes 4 issues flagged in PR review:
- Quote/reword the "#3" criterion in the llm-validation suite so it
  doesn't start a YAML comment and break the parser.
- Sync the upstream core SKILL.md fix that grants the conventions and
  cross-sdk reviewers narrowly scoped read-only access instead of
  silently degrading to NOT VERIFIED under the read-only restriction.
- Sync the upstream core SKILL.md fix that stops the change-set target
  resolution from silently falling back to origin/master and instead
  asks for confirmation.
- Exempt cached Optional.empty()/OptionalInt.empty()/OptionalLong.empty()/
  OptionalDouble.empty() singletons from the J15 allocation rule in the
  performance override, avoiding guaranteed false positives.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@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: 00e16ba8be

ℹ️ 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 dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
Comment thread dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
Comment thread .agents/skills/dd-apm-sdk-review/SKILL.md Outdated
Comment thread dd-apm-sdk-review-overrides/reviewers/design.md Outdated
robertomonteromiguel and others added 3 commits August 31, 2026 21:28
…rides

- Stop flagging Config.get()/InstrumenterConfig.get() in the performance
  override: both just return a static INSTANCE, so the "walks a
  config-resolution chain" rationale was false and guaranteed a
  false-positive finding on every hot-path call site.
- Move StringIndex from "coming" to "available today" in the performance
  toolkit list — it already ships in internal-api with of/indexOf/
  EmbeddingSupport.
- Scope the design override's public-API-surface rule to public/protected
  members of externally-accessible types, so a package-private addition to
  a non-exported dd-trace-ot type (OTSpan, OTSpanContext, TypeConverter)
  doesn't require public-API justification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collect PR title/labels for reviewers that audit them, treat
git diff --no-index exit 1 (found a difference) as success instead of
failure in the untracked-file discovery loop, and add the promised
"Related skills" section to the report template.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@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: 8249ed4b94

ℹ️ 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/skills/dd-apm-sdk-review/SKILL.md Outdated
Comment thread dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
Comment thread dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
Comment thread dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
Sync SKILL.md from dd-apm-sdk-review-core with the fix for the
untracked-file diff error masking (a real access error was being
treated the same as an expected diff and silently swallowed).

Also relax three performance addenda (J6, J13, J14) in the
dd-trace-java overrides that were producing deterministic false
positives: weak-reference strengthening only when the referent is
retained past the probe, defensive copies allowed for stable
snapshots/ownership transfer, and the capturing-lambda-in-
computeIfAbsent case moved to flag-as-measure since escape analysis
can eliminate it on a cache hit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@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: fbb5b65637

ℹ️ 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/skills/dd-apm-sdk-review/SKILL.md Outdated
Comment thread .llm-validation/config.yaml Outdated
Comment thread .agents/skills/dd-apm-sdk-review/reviewers/report-template.md Outdated
Relocate dd-apm-sdk-review-overrides/ from the repo root to
.agents/dd-apm-sdk-review-overrides/ (sibling of .agents/skills/, not
nested inside the skill folder itself). Adding content under the
already-accepted .agents/ directory is lower friction to land than a
new top-level folder in this repo's root. Update SKILL.md's fixed
relative path (../../../ -> ../../), CODEOWNERS, AGENTS.md, and the
.llm-validation/.promptfoo fixtures accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@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: 88864c4ef0

ℹ️ 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/performance.md Outdated
Comment thread .agents/skills/dd-apm-sdk-review/SKILL.md
Comment thread .agents/skills/dd-apm-sdk-review/reviewers/_common.md
Comment thread .promptfoo/dd-apm-sdk-review/tests/dd-apm-sdk-review.yaml Outdated
Comment thread .agents/skills/dd-apm-sdk-review/reviewers/performance.md
robertomonteromiguel and others added 2 commits September 1, 2026 10:35
- performance.md override: J10 no longer points String.format fixes at
  datadog.trace.util.Strings, which has no formatting/interpolation
  helper; recommends concatenation/StringBuilder instead.
- .llm-validation: full-review case now includes repo-context.md and
  the security.md override, which the skill actually requires.
- promptfoo suite: replace text-based "not-icontains git diff" asserts
  (false positive on a report that merely mentions the command) with
  toolCalls-metadata checks, in both places the pattern occurred.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…core

Pulls in the remaining codex review fixes from core: a new Correctness
reviewer lens, retry-safe twice-in-a-row no-op, a revert exemption
narrowed to prose-only reverts, and human authorization required
before pushing when even a degraded review is impossible.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@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: 972011e4ed

ℹ️ 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/config.yaml
Comment thread .agents/skills/dd-apm-sdk-review/SKILL.md Outdated
Comment thread .agents/dd-apm-sdk-review-overrides/reviewers/design.md Outdated
Comment thread .agents/dd-apm-sdk-review-overrides/reviewers/performance.md Outdated
robertomonteromiguel and others added 2 commits September 1, 2026 11:17
Resolves the PR base via baseRefOid instead of "origin/<baseRefName>" (the
latter breaks on a cross-repo PR, since origin is the contributor's fork),
and moves secret scanning of untracked/committed content to the point it
is first read rather than only right before delegating to reviewers.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Add correctness.md to the llm-validation instruction/case file lists
  so the required roster lens is actually exercised.
- design.md override: components/ dependency rule now targets external
  dependencies only, not inter-component deps between bootstrap-safe modules.
- performance.md override: benchmark inventory now includes module-level
  src/jmh source sets, not just the two central benchmark suites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@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: ffa836b7d5

ℹ️ 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
… core

Sync from dd-apm-sdk-review-core: hardens the Step 1 untracked-file
scanning block (mktemp failure handling, benign-vs-real stderr
disambiguation, fail-closed secret pre-filter, expanded secret
patterns, stdout-visible SUSPECT marker, leading-dash filename
safety) and restores the explicit override-status signal in
report-template.md's rule-files section.

Addresses unresolved chatgpt-codex findings from dd-trace-js PR
#10070; verified via a full 8-lens dd-apm-sdk-review re-run on the
fixed diff in dd-trace-js (no P0 remains).
@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: 6f7dae6f81

ℹ️ 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".

BASE=$(git merge-base HEAD "$TARGET" 2>/dev/null)
if [ -n "$BASE" ]; then
git diff --stat "$BASE"...HEAD
git diff "$BASE"...HEAD

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 Scan tracked diffs before printing them

When a committed change contains a recognizable credential, this command emits the complete value into the tool transcript before the manual inspection at line 129 can redact it. The new pre-scan at lines 99–110 protects only untracked files, so committed, staged, and unstaged secrets remain exposed despite the claim that they receive the same treatment; capture and scan/redact each tracked diff before printing it.

AGENTS.md reference: AGENTS.md:L77-L77

Useful? React with 👍 / 👎.

- Confidence: flag-with-confidence.
- Severity: SEV-2/3.
- Fix: memoize (bounded — see `unbounded-memory`) or compile/compute once and hoist.
3. `unbounded-memory` — **Unbounded memory / collection** — a cache/map/collection with no size *and* byte bound, or keyed by a high-cardinality input (per-request data, raw strings, user-supplied dimensions).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude bounded caches from the unbounded-memory rule

When a cache has strict count and byte caps but uses request-derived or otherwise high-cardinality keys, the or keyed by a high-cardinality input clause still requires an SEV-1 unbounded-memory finding. This directly conflicts with line 99, which says not to flag a high-cardinality cache merely for existing and to require that it lack a bound, so reviewers can block the mandatory gate for bounded caches that cannot grow without limit; make high cardinality aggravate an actually unbounded structure rather than independently satisfying this check.

AGENTS.md reference: AGENTS.md:L77-L77

Useful? React with 👍 / 👎.


- **J1 — Escaping allocation defeats Escape Analysis** *(refines universal `per-call-allocation`, `escape-elision-defeated`)*. The JVM scalar-replaces only *non-escaping* short-lived objects. An object stored in the tag map / span / a collection, iterated at serialization, or passed to a virtual/megamorphic call **escapes** → EA can't elide it → real heap allocation. The trap: *"the JIT will scalar-replace it" is false for escaping objects.* **Verify in JFR — EA'd objects don't appear in alloc profiles, so a surviving object in the profile *proves* it escapes.** **Treat a zero-allocation microbenchmark as unverified when the object wraps I/O** (a scope or wrapper spanning a blocking/native call) — C2 cannot inline through a blocking I/O boundary, so a tight-loop benchmark with no real I/O will show scalar-replacement that production won't get; ask for a benchmark that includes realistic I/O before accepting an EA claim for such an object.
- **J2 — Megamorphic dispatch** *(refines universal `polymorphic-dispatch`)*. **PARKED for PR-review flagging (2026-07-08): do NOT raise megamorphism findings in review yet.** Kept as author-reference + a standing-audit target, not an active review idiom — it's too in-the-weeds to land with most devs, and the rubric needs to bank *legible* wins first (allocation, unbounded memory, regex) to earn trust. A hot call site seeing ≥3 receiver types with no dominant one goes megamorphic; ≤2 types stays bimorphic (inlinable); a dominant receiver (≥90%, `TypeProfileMajorReceiverPercent`) still gets guarded mono-inline. The worst sites accumulate silently across many PRs — a per-PR check only catches a PR that *widens* a site, so this wants a periodic `PrintInlining` census of known hot sites, independent of any single review.
- **J3 — JNI / native crossing: overhead + virtual-thread pinning** *(refines universal `native-boundary-crossing`)*. JNI call ≈ 100ns–1µs (state transition, arg pin/copy, no inlining across); string args via `GetStringUTFChars` = UTF-16→UTF-8 copy. **A JNI call from a virtual thread pins the carrier** → no other vthreads on that carrier run while pinned → concurrency collapse for vthread-reliant apps. Fix: batch at flush on the writer (platform) thread, keep the app-vthread path pure-Java, transport interned IDs not strings; `@CriticalNative` only for short primitive ops.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the unavailable CriticalNative recommendation

When the reviewer flags a short primitive JNI call, this rule can recommend @CriticalNative, but that annotation is an Android ART optimization rather than an API available on the HotSpot JDKs targeted by this override; it is absent from this repository and from the installed supported JDKs. The author therefore cannot apply the prescribed remediation in dd-trace-java without introducing an Android-only dependency that would not optimize HotSpot JNI calls, so retain the batching/pure-Java advice and remove or replace this recommendation.

AGENTS.md reference: AGENTS.md:L77-L77

Useful? React with 👍 / 👎.

robertomonteromiguel and others added 2 commits September 1, 2026 16:52
Copy reviewers/README.md mirror notice from dd-apm-sdk-review-core, missed in the previous sync.
@robertomonteromiguel

Copy link
Copy Markdown
Contributor Author

replaced by #12364

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.

1 participant