diff --git a/.agents/rules/code-review/activation-and-metadata.md b/.agents/rules/code-review/activation-and-metadata.md index bec7e14d122..8105f940a30 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: Match each declared version to the tested behavior. +- Severity: P0 +- Flag: A manifest version must start at the first release that has the tested behavior. If a method needs a later release than its class, give that method its own version. If a later SDK release replaces the tested behavior, end the old range before that release. If one change ships on several release lines, declare a range for each line. +- Detect: A class declaration activates a method that needs a later release. A legacy range stays open after the SDK replaced the behavior. A range covers one release line, but the change also shipped on another line. diff --git a/.agents/rules/code-review/infrastructure-and-conventions.md b/.agents/rules/code-review/infrastructure-and-conventions.md index fc5566eb00e..7a01ed8b114 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: A build that passes the `github_token` secret must mount it in every Dockerfile step that calls the GitHub API. The script must use the shared `get_latest_release` helper, not its own `curl` or `wget` call. Without the secret, the calls are unauthenticated and hit rate limits. +- Detect: The workflow passes `--secret id=github_token`, and a Dockerfile of another language or weblog does not mount it. An install script calls the GitHub releases API with `curl -s` or `wget` and no `--fail`. An authenticated call runs under `set -x`, so the token can leak into logs. + +### INFRA-014: Stop the session when the infrastructure fails to provision. +- Severity: P1 +- Flag: An unknown VM provisioning error must stop the session with one clear failure. The handler must not store the error and run every test. A diagnostic step, such as an event or a log download, must not hide that failure. If the diagnostic step fails, print a warning and keep the original error. +- Detect: A provisioning error handler stores an unknown error on the VM object and continues the session. A diagnostic step can raise or write to stdout before the main failure is reported. diff --git a/.agents/rules/code-review/test-effectiveness.md b/.agents/rules/code-review/test-effectiveness.md index 4a68ef64fef..b76779d79ca 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. The app reports a config value that the SDK does not expose, instead of None. An endpoint catches every exception and always returns 200. - ✅ 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 as well as the value. +- Severity: P0 +- Flag: A contract can fix the type of a value. Then the test must assert that type in both directions. In Python, `1 == True` and `1.0 == 1` are true. Equality alone then accepts the wrong type. +- Detect: The assertion checks the bool type only when the expected value is a bool. A float such as `1.0` passes where the contract requires a bool or an int. + +### TEST-009: Assert every expectation that the test data defines. +- Severity: P0 +- Flag: A fixture or a shared helper can define an expected result. Then the test must assert it. A test must not skip the shared assertion helper that its sibling tests use. +- Detect: Imported fixtures contain expectations, such as `result.features`, that no assertion reads. A test checks part of the result while its siblings call the shared helper, such as `_assert_context_evaluation`.