From 833e27952e7057b4a5e1556b3886107fc1a8d8fa Mon Sep 17 00:00:00 2001 From: "dd-apm-ecosystems[bot]" <183529005+dd-apm-ecosystems[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 10:15:59 +0000 Subject: [PATCH 1/5] Review learning: rule changes from 2026-10-01 to 2026-10-31 --- .agents/rules/code-review/activation-and-metadata.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.agents/rules/code-review/activation-and-metadata.md b/.agents/rules/code-review/activation-and-metadata.md index bec7e14d122..ba835f55d0f 100644 --- a/.agents/rules/code-review/activation-and-metadata.md +++ b/.agents/rules/code-review/activation-and-metadata.md @@ -74,3 +74,8 @@ - ✅ Add, remove, or rename the workflow step in the same PR as the scenario. - ❌ Add a named scenario without its workflow step, even when its scenario groups are otherwise valid. - Ref: [End-to-end testing rules](../end-to-end-testing.md) + +### META-010: Gate each test at the first release that has its behavior. +- Severity: P0 +- Flag: A version declaration must match the first release that contains the behavior each test asserts. If a method asserts behavior newer than its class, declare that method separately. If the SDK changes the behavior in a later release, bound the old test with a range. If a change ships on several release lines or as a backport, cover each line. +- Detect: A new test method asserts behavior newer than its class declaration and has no method entry. A class for legacy behavior has only a minimum version and stays active after the SDK changed. A gate targets the next dev version, but a patch release or another release line already ships the change. Version ranges in `tests/parametric/capabilities.yml` follow the same rule. From 4e35ad660605f0c1a4cc7b15c3f9cb96a5f6af2e Mon Sep 17 00:00:00 2001 From: "dd-apm-ecosystems[bot]" <183529005+dd-apm-ecosystems[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 10:16:00 +0000 Subject: [PATCH 2/5] Review learning: rule changes from 2026-10-01 to 2026-10-31 --- .../code-review/infrastructure-and-conventions.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.agents/rules/code-review/infrastructure-and-conventions.md b/.agents/rules/code-review/infrastructure-and-conventions.md index fc5566eb00e..f658b79471a 100644 --- a/.agents/rules/code-review/infrastructure-and-conventions.md +++ b/.agents/rules/code-review/infrastructure-and-conventions.md @@ -82,3 +82,13 @@ - ✅ Look up files with a bash glob (`shopt -s nullglob`), or let `set -euo pipefail` stop the script. If a fallback is intended, print why it runs. - ❌ `count=$(find /binaries/ -name "dd-java-agent*.jar" 2>/dev/null | wc -l)`, then download the latest release when `count` is 0. - Ref: [Code format standards](../code-format-standards.md) + +### INFRA-013: Mount the GitHub token in every build that calls the GitHub API. +- Severity: P1 +- Flag: Every Dockerfile that runs a GitHub API call must mount the `github_token` secret that the build passes. Install scripts must use the shared `get_latest_release` helper, not a raw `curl` or `wget` call. A secret that is passed but not mounted is silently absent. Then rate limits break the build. +- Detect: A Dockerfile runs an install script that calls the GitHub API, and its `RUN` step has no `--mount=type=secret,id=github_token`. A script calls the GitHub releases API without a token or without `--fail`. + +### INFRA-014: Stop the run when provisioning fails. +- Severity: P1 +- Flag: A failed VM or environment provisioning step must stop the run with that error. It must not record the error and then run every test. A provisioning step must check that the installed tool works before it reports success. +- Detect: A provisioning error handler stores an unknown error and continues the session. A provisioning step installs a tool and exits 0 without a check such as `docker info`. From 7d77b36e71ca9e956ab0d54413ac3a186dd26611 Mon Sep 17 00:00:00 2001 From: "dd-apm-ecosystems[bot]" <183529005+dd-apm-ecosystems[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 10:16:02 +0000 Subject: [PATCH 3/5] Review learning: rule changes from 2026-10-01 to 2026-10-31 --- .agents/rules/code-review/test-effectiveness.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.agents/rules/code-review/test-effectiveness.md b/.agents/rules/code-review/test-effectiveness.md index 4a68ef64fef..aebd14f32d2 100644 --- a/.agents/rules/code-review/test-effectiveness.md +++ b/.agents/rules/code-review/test-effectiveness.md @@ -47,7 +47,7 @@ - Old_id: codex-11 - Severity: P1 - Flag: Do not write the expected tag, code, or exporter result in the test app. The SDK must produce it. The assertion may name the value it expects. It must read that value from SDK output.. -- Detect: The app adds `runtime-id` or another tag the SDK must produce. It copies SDK result codes into its own map. It forces an exporter that the configuration already selects. +- Detect: The app adds `runtime-id` or another tag the SDK must produce. It copies SDK result codes into its own map. It forces an exporter that the configuration already selects. It reports a default value for a setting the SDK does not support, instead of None. It catches every exception and returns OK, so a status-code check always passes. It drives the SDK differently from a real app, so the path under test never runs. - ✅ The tracer sets `runtime-id`, and the test asserts it on the captured span. - ❌ The app sets `runtime-id` on the span, and the test asserts that tag. @@ -59,3 +59,13 @@ - Not when: The test intentionally validates a deliberately broken response. - ✅ Return the real backend envelope under `data.attributes`, and derive the check from the real contract. - ❌ Return the flag config as the whole body and make the self-test expect that same body. + +### TEST-008: Check the type when the contract defines it. +- Severity: P0 +- Flag: Check the type as well as the value. This applies to a boolean or a number in the contract. In Python, `1 == True` and `1.0 == True` are both true. The contract can accept `True`, `1`, and `"true"` as one value. Then use `is_same_boolean()`. +- Detect: An assertion compares a boolean or a number with `==` and has no type check. A coerced value then passes. + +### TEST-009: Assert every expectation on its own. +- Severity: P0 +- Flag: Check each subject and each fixture expectation on its own. Do not merge expected counts, and do not drop the shared checks that sibling tests run. +- Detect: A test sums the expected counts of two subjects into one total. A test skips the shared assertion helper that its siblings call. A runner loads fixture expectations, such as `result.features`, and never asserts them. From 9a33fcdc41503a6e8d99cd698a58f09315e0650b Mon Sep 17 00:00:00 2001 From: "dd-apm-ecosystems[bot]" <183529005+dd-apm-ecosystems[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 10:41:19 +0000 Subject: [PATCH 4/5] Apply the review comments --- .agents/rules/code-review/test-effectiveness.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.agents/rules/code-review/test-effectiveness.md b/.agents/rules/code-review/test-effectiveness.md index aebd14f32d2..e057a8656f8 100644 --- a/.agents/rules/code-review/test-effectiveness.md +++ b/.agents/rules/code-review/test-effectiveness.md @@ -28,7 +28,7 @@ - Old_id: claude-13 - Severity: P0 - Flag: A test of behavior that does not depend on the trace encoding must give the same result for v0.4, v0.5, and v1.0 payloads. Compare trace IDs with `trace_id_equals()`, read the sampling priority with `get_sampling_priority()`, and filter intake requests with `interfaces.library.trace_paths`. Use `is_same_boolean()` only when the contract accepts `True`, `1`, and `"true"` as the same value. A test of the wire format itself must check the exact fields and types of its encoding. -- Detect: A test that is not about the encoding compares raw fields, as in `span["trace_id"] == expected` or `meta[key] == "true"`. A test reads a sampling priority field directly. A path filter lists only `/v0.4/traces` or `/v0.5/traces`. +- Detect: A test that is not about the encoding compares raw fields, as in `span["trace_id"] == expected` or `meta[key] == "true"`. A test reads a sampling priority field directly. A path filter or a mocked response lists only `/v0.4/traces` or `/v0.5/traces` and omits `/v1.0/traces`. - Not when: The test is explicitly validating the wire format itself. - ✅ `assert span.trace_id_equals(int(expected_id))`. - ❌ `assert span["trace_id"] == int(expected_id)`. @@ -64,8 +64,3 @@ - Severity: P0 - Flag: Check the type as well as the value. This applies to a boolean or a number in the contract. In Python, `1 == True` and `1.0 == True` are both true. The contract can accept `True`, `1`, and `"true"` as one value. Then use `is_same_boolean()`. - Detect: An assertion compares a boolean or a number with `==` and has no type check. A coerced value then passes. - -### TEST-009: Assert every expectation on its own. -- Severity: P0 -- Flag: Check each subject and each fixture expectation on its own. Do not merge expected counts, and do not drop the shared checks that sibling tests run. -- Detect: A test sums the expected counts of two subjects into one total. A test skips the shared assertion helper that its siblings call. A runner loads fixture expectations, such as `result.features`, and never asserts them. From bc3bb05773a0a8c18e1bc726d6d3cd73355279ab Mon Sep 17 00:00:00 2001 From: "dd-apm-ecosystems[bot]" <183529005+dd-apm-ecosystems[bot]@users.noreply.github.com> Date: Thu, 19 Nov 2026 10:41:21 +0000 Subject: [PATCH 5/5] Apply the review comments --- .agents/rules/code-review/infrastructure-and-conventions.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.agents/rules/code-review/infrastructure-and-conventions.md b/.agents/rules/code-review/infrastructure-and-conventions.md index f658b79471a..d8972d9a09a 100644 --- a/.agents/rules/code-review/infrastructure-and-conventions.md +++ b/.agents/rules/code-review/infrastructure-and-conventions.md @@ -87,8 +87,3 @@ - Severity: P1 - Flag: Every Dockerfile that runs a GitHub API call must mount the `github_token` secret that the build passes. Install scripts must use the shared `get_latest_release` helper, not a raw `curl` or `wget` call. A secret that is passed but not mounted is silently absent. Then rate limits break the build. - Detect: A Dockerfile runs an install script that calls the GitHub API, and its `RUN` step has no `--mount=type=secret,id=github_token`. A script calls the GitHub releases API without a token or without `--fail`. - -### INFRA-014: Stop the run when provisioning fails. -- Severity: P1 -- Flag: A failed VM or environment provisioning step must stop the run with that error. It must not record the error and then run every test. A provisioning step must check that the installed tool works before it reports success. -- Detect: A provisioning error handler stores an unknown error and continues the session. A provisioning step installs a tool and exits 0 without a check such as `docker info`.