dd-trace 6.16.0 → 6.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (334) hide show
  1. package/ci/diagnose.js +0 -23
  2. package/ci/test-optimization-validation/approval-artifacts.js +0 -3
  3. package/ci/test-optimization-validation/approval.js +0 -6
  4. package/ci/test-optimization-validation/artifact-id.js +0 -1
  5. package/ci/test-optimization-validation/bounded-json.js +0 -1
  6. package/ci/test-optimization-validation/cli.js +0 -12
  7. package/ci/test-optimization-validation/command-output-policy.js +0 -1
  8. package/ci/test-optimization-validation/command-runner.js +0 -3
  9. package/ci/test-optimization-validation/environment.js +0 -4
  10. package/ci/test-optimization-validation/executable-approval.js +0 -1
  11. package/ci/test-optimization-validation/executable.js +0 -5
  12. package/ci/test-optimization-validation/framework-adapters/cucumber.js +0 -6
  13. package/ci/test-optimization-validation/framework-adapters/cypress.js +0 -3
  14. package/ci/test-optimization-validation/framework-adapters/playwright.js +0 -6
  15. package/ci/test-optimization-validation/framework-adapters/vitest.js +0 -4
  16. package/ci/test-optimization-validation/generated-test-contract.js +0 -5
  17. package/ci/test-optimization-validation/generated-verifier.js +0 -1
  18. package/ci/test-optimization-validation/literal-environment.js +0 -1
  19. package/ci/test-optimization-validation/manifest-scaffold.js +0 -17
  20. package/ci/test-optimization-validation/manifest-schema.js +0 -21
  21. package/ci/test-optimization-validation/offline-fixtures.js +0 -4
  22. package/ci/test-optimization-validation/plan-writer.js +0 -11
  23. package/ci/test-optimization-validation/preflight-runner.js +0 -1
  24. package/ci/test-optimization-validation/redaction.js +0 -4
  25. package/ci/test-optimization-validation/report-writer.js +0 -16
  26. package/ci/test-optimization-validation/runner-command.js +0 -3
  27. package/ci/test-optimization-validation/runner-contract.js +0 -4
  28. package/ci/test-optimization-validation/safe-files.js +0 -1
  29. package/ci/test-optimization-validation/scenarios/basic-reporting.js +0 -1
  30. package/ci/test-optimization-validation/scenarios/ci-wiring.js +0 -1
  31. package/ci/test-optimization-validation/source-text.js +0 -3
  32. package/ci/vitest-no-worker-init-setup.mjs +41 -16
  33. package/index.d.ts +165 -0
  34. package/package.json +17 -16
  35. package/packages/datadog-esbuild/src/utils.js +0 -2
  36. package/packages/datadog-instrumentations/src/aerospike.js +28 -6
  37. package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -2
  38. package/packages/datadog-instrumentations/src/aws-sdk.js +0 -2
  39. package/packages/datadog-instrumentations/src/claude-agent-sdk.js +0 -2
  40. package/packages/datadog-instrumentations/src/console.js +97 -0
  41. package/packages/datadog-instrumentations/src/cucumber.js +72 -12
  42. package/packages/datadog-instrumentations/src/cypress-config.js +0 -23
  43. package/packages/datadog-instrumentations/src/helpers/channel.js +0 -2
  44. package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +0 -5
  45. package/packages/datadog-instrumentations/src/helpers/hooks.js +8 -0
  46. package/packages/datadog-instrumentations/src/helpers/instrumentation-utils.js +0 -3
  47. package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +0 -6
  48. package/packages/datadog-instrumentations/src/helpers/register.js +4 -0
  49. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +72 -24
  50. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +39 -0
  51. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +3 -17
  52. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +12 -0
  53. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +36 -0
  54. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/supabase.js +128 -0
  55. package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +16 -0
  56. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +388 -0
  57. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +0 -5
  58. package/packages/datadog-instrumentations/src/helpers/router-helper.js +0 -1
  59. package/packages/datadog-instrumentations/src/jest.js +141 -51
  60. package/packages/datadog-instrumentations/src/knex.js +0 -1
  61. package/packages/datadog-instrumentations/src/mariadb-bundle.js +0 -24
  62. package/packages/datadog-instrumentations/src/mariadb.js +0 -2
  63. package/packages/datadog-instrumentations/src/mocha/common.js +0 -1
  64. package/packages/datadog-instrumentations/src/mocha/main.js +22 -25
  65. package/packages/datadog-instrumentations/src/mocha/utils.js +119 -49
  66. package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +0 -6
  67. package/packages/datadog-instrumentations/src/mocha/worker.js +14 -17
  68. package/packages/datadog-instrumentations/src/mysql2.js +0 -2
  69. package/packages/datadog-instrumentations/src/openai-realtime/audio-accumulator.js +241 -0
  70. package/packages/datadog-instrumentations/src/openai-realtime/events.js +76 -0
  71. package/packages/datadog-instrumentations/src/openai-realtime/index.js +301 -0
  72. package/packages/datadog-instrumentations/src/openai-realtime/session.js +998 -0
  73. package/packages/datadog-instrumentations/src/openai-realtime/turns.js +211 -0
  74. package/packages/datadog-instrumentations/src/openai.js +51 -12
  75. package/packages/datadog-instrumentations/src/oracledb.js +9 -3
  76. package/packages/datadog-instrumentations/src/playwright-reporter.js +3 -16
  77. package/packages/datadog-instrumentations/src/playwright.js +238 -55
  78. package/packages/datadog-instrumentations/src/postgres.js +7 -0
  79. package/packages/datadog-instrumentations/src/router.js +0 -2
  80. package/packages/datadog-instrumentations/src/rum-browser-scripts.js +0 -2
  81. package/packages/datadog-instrumentations/src/sequelize.js +0 -1
  82. package/packages/datadog-instrumentations/src/supabase.js +15 -0
  83. package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +18 -18
  84. package/packages/datadog-instrumentations/src/vitest-main.js +37 -17
  85. package/packages/datadog-instrumentations/src/vitest-util.js +7 -1
  86. package/packages/datadog-instrumentations/src/vitest-worker.js +49 -13
  87. package/packages/datadog-instrumentations/src/webdriverio.js +23 -42
  88. package/packages/datadog-instrumentations/src/ws.js +0 -1
  89. package/packages/datadog-plugin-ai/src/utils.js +0 -2
  90. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/trace-checkpoint.js +0 -1
  91. package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/util.js +0 -2
  92. package/packages/datadog-plugin-aws-sdk/src/base.js +0 -1
  93. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +0 -1
  94. package/packages/datadog-plugin-aws-sdk/src/services/eventbridge.js +0 -1
  95. package/packages/datadog-plugin-aws-sdk/src/util.js +0 -1
  96. package/packages/datadog-plugin-azure-durable-functions/src/index.js +0 -1
  97. package/packages/datadog-plugin-cucumber/src/index.js +10 -0
  98. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +171 -75
  99. package/packages/datadog-plugin-cypress/src/finalization.js +0 -3
  100. package/packages/datadog-plugin-cypress/src/source-map-utils.js +0 -4
  101. package/packages/datadog-plugin-cypress/src/support.js +52 -7
  102. package/packages/datadog-plugin-graphql/src/resolve-error.js +1 -2
  103. package/packages/datadog-plugin-graphql/src/utils.js +0 -5
  104. package/packages/datadog-plugin-jest/src/index.js +13 -0
  105. package/packages/datadog-plugin-kafkajs/src/producer.js +0 -1
  106. package/packages/datadog-plugin-mocha/src/index.js +39 -11
  107. package/packages/datadog-plugin-mongodb-core/src/query.js +0 -1
  108. package/packages/datadog-plugin-openai/src/index.js +16 -1
  109. package/packages/datadog-plugin-openai/src/realtime.js +144 -0
  110. package/packages/datadog-plugin-openai-agents/src/integration.js +0 -4
  111. package/packages/datadog-plugin-openai-agents/src/util.js +0 -1
  112. package/packages/datadog-plugin-playwright/src/index.js +76 -9
  113. package/packages/datadog-plugin-postgres/src/index.js +167 -0
  114. package/packages/datadog-plugin-prisma/src/datadog-tracing-helper.js +0 -1
  115. package/packages/datadog-plugin-redis/src/index.js +15 -1
  116. package/packages/datadog-plugin-supabase/src/error.js +18 -0
  117. package/packages/datadog-plugin-supabase/src/index.js +21 -0
  118. package/packages/datadog-plugin-supabase/src/supabase-auth-js-gotrueclient-getuser.js +69 -0
  119. package/packages/datadog-plugin-supabase/src/supabase-functions-js-functionsclient-invoke.js +70 -0
  120. package/packages/datadog-plugin-supabase/src/supabase-postgrest-js-postgrestbuilder-then.js +122 -0
  121. package/packages/datadog-plugin-supabase/src/supabase-realtime-js-realtimechannel-send.js +66 -0
  122. package/packages/datadog-plugin-supabase/src/supabase-storage-js-handle-request.js +93 -0
  123. package/packages/datadog-plugin-supabase/src/url.js +17 -0
  124. package/packages/datadog-plugin-vitest/src/index.js +10 -0
  125. package/packages/datadog-plugin-ws/src/util.js +0 -4
  126. package/packages/datadog-turbopack/index.js +0 -6
  127. package/packages/datadog-turbopack/src/loader.js +0 -16
  128. package/packages/datadog-webpack/src/loader.js +0 -1
  129. package/packages/dd-trace/src/aiguard/client.js +2 -3
  130. package/packages/dd-trace/src/aiguard/evaluation.js +6 -12
  131. package/packages/dd-trace/src/aiguard/index.js +2 -2
  132. package/packages/dd-trace/src/aiguard/integrations/index.js +1 -1
  133. package/packages/dd-trace/src/aiguard/integrations/openai.js +81 -7
  134. package/packages/dd-trace/src/aiguard/messages/anthropic.js +0 -2
  135. package/packages/dd-trace/src/aiguard/messages/openai.js +64 -1
  136. package/packages/dd-trace/src/aiguard/messages/utils.js +0 -1
  137. package/packages/dd-trace/src/aiguard/redaction.js +0 -1
  138. package/packages/dd-trace/src/aiguard/sdk.js +1 -1
  139. package/packages/dd-trace/src/appsec/activation.js +1 -1
  140. package/packages/dd-trace/src/appsec/api_security/normalized-route.js +0 -5
  141. package/packages/dd-trace/src/appsec/api_security/sampler.js +0 -4
  142. package/packages/dd-trace/src/appsec/blocking/index.js +3 -3
  143. package/packages/dd-trace/src/appsec/downstream_requests.js +1 -4
  144. package/packages/dd-trace/src/appsec/iast/index.js +1 -1
  145. package/packages/dd-trace/src/appsec/iast/overhead-controller.js +5 -5
  146. package/packages/dd-trace/src/appsec/iast/taint-tracking/index.js +1 -1
  147. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -1
  148. package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter.js +3 -3
  149. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +8 -10
  150. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-handler.js +2 -2
  151. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/utils.js +4 -1
  152. package/packages/dd-trace/src/appsec/iast/vulnerability-reporter.js +7 -7
  153. package/packages/dd-trace/src/appsec/index.js +2 -2
  154. package/packages/dd-trace/src/appsec/lambda.js +71 -2
  155. package/packages/dd-trace/src/appsec/rasp/utils.js +5 -1
  156. package/packages/dd-trace/src/appsec/remote_config.js +8 -6
  157. package/packages/dd-trace/src/appsec/reporter.js +10 -6
  158. package/packages/dd-trace/src/appsec/rule_manager.js +3 -3
  159. package/packages/dd-trace/src/appsec/sdk/track_event.js +0 -2
  160. package/packages/dd-trace/src/appsec/waf/index.js +2 -2
  161. package/packages/dd-trace/src/appsec/waf/waf_manager.js +8 -5
  162. package/packages/dd-trace/src/carrier.js +0 -5
  163. package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +104 -0
  164. package/packages/dd-trace/src/ci-visibility/dynamic-instrumentation/worker/index.js +0 -2
  165. package/packages/dd-trace/src/ci-visibility/efd-retry-policy.js +34 -3
  166. package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +0 -1
  167. package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +0 -1
  168. package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +0 -1
  169. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/index.js +0 -4
  170. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +0 -1
  171. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/sink.js +0 -2
  172. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +37 -15
  173. package/packages/dd-trace/src/ci-visibility/exporters/git/git_metadata.js +0 -3
  174. package/packages/dd-trace/src/ci-visibility/exporters/request.js +0 -11
  175. package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +0 -1
  176. package/packages/dd-trace/src/ci-visibility/intelligent-test-runner/get-skippable-suites.js +0 -1
  177. package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +0 -6
  178. package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +2 -2
  179. package/packages/dd-trace/src/ci-visibility/requests/rate-limit.js +0 -1
  180. package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +0 -5
  181. package/packages/dd-trace/src/ci-visibility/requests/video-request.js +0 -1
  182. package/packages/dd-trace/src/ci-visibility/telemetry.js +13 -0
  183. package/packages/dd-trace/src/ci-visibility/test-optimization-cache.js +0 -1
  184. package/packages/dd-trace/src/ci-visibility/test-screenshot.js +0 -2
  185. package/packages/dd-trace/src/ci-visibility/test-video.js +0 -1
  186. package/packages/dd-trace/src/config/defaults.js +3 -2
  187. package/packages/dd-trace/src/config/generated-config-types.d.ts +73 -67
  188. package/packages/dd-trace/src/config/helper.js +0 -1
  189. package/packages/dd-trace/src/config/index.js +24 -24
  190. package/packages/dd-trace/src/config/parsers.js +34 -6
  191. package/packages/dd-trace/src/config/remote_config.js +25 -109
  192. package/packages/dd-trace/src/config/supported-configurations.json +139 -10
  193. package/packages/dd-trace/src/datastreams/encoding.js +0 -1
  194. package/packages/dd-trace/src/datastreams/pathway.js +0 -1
  195. package/packages/dd-trace/src/debugger/constants.js +10 -0
  196. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +62 -10
  197. package/packages/dd-trace/src/debugger/devtools_client/config.js +2 -0
  198. package/packages/dd-trace/src/debugger/devtools_client/guardrail-metrics.js +15 -0
  199. package/packages/dd-trace/src/debugger/devtools_client/index.js +103 -27
  200. package/packages/dd-trace/src/debugger/devtools_client/json-buffer.js +50 -7
  201. package/packages/dd-trace/src/debugger/devtools_client/log.js +3 -1
  202. package/packages/dd-trace/src/debugger/devtools_client/probe_sampler.js +21 -8
  203. package/packages/dd-trace/src/debugger/devtools_client/send.js +40 -14
  204. package/packages/dd-trace/src/debugger/devtools_client/snapshot/index.js +53 -13
  205. package/packages/dd-trace/src/debugger/devtools_client/snapshot/processor.js +118 -71
  206. package/packages/dd-trace/src/debugger/devtools_client/snapshot-pruner.js +0 -3
  207. package/packages/dd-trace/src/debugger/devtools_client/status.js +20 -6
  208. package/packages/dd-trace/src/debugger/guardrail-metrics.js +167 -0
  209. package/packages/dd-trace/src/debugger/index.js +50 -2
  210. package/packages/dd-trace/src/debugger/inspect-segment.js +0 -3
  211. package/packages/dd-trace/src/debugger/probe_sampler.js +133 -9
  212. package/packages/dd-trace/src/debugger/probe_sampler_constants.js +31 -1
  213. package/packages/dd-trace/src/dogstatsd.js +0 -23
  214. package/packages/dd-trace/src/encode/0.4-cross-payload.js +0 -3
  215. package/packages/dd-trace/src/encode/0.4.js +0 -7
  216. package/packages/dd-trace/src/encode/0.5.js +0 -2
  217. package/packages/dd-trace/src/encode/tags-processors.js +0 -1
  218. package/packages/dd-trace/src/evp_proxy/discovery.js +0 -1
  219. package/packages/dd-trace/src/evp_proxy/path.js +0 -2
  220. package/packages/dd-trace/src/exporters/agent/writer.js +0 -1
  221. package/packages/dd-trace/src/exporters/agentless/index.js +0 -1
  222. package/packages/dd-trace/src/exporters/agentless/intake.js +0 -1
  223. package/packages/dd-trace/src/exporters/agentless/writer.js +0 -3
  224. package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +0 -6
  225. package/packages/dd-trace/src/exporters/common/request.js +1 -0
  226. package/packages/dd-trace/src/exporters/common/url.js +0 -2
  227. package/packages/dd-trace/src/exporters/common/writer.js +0 -2
  228. package/packages/dd-trace/src/id.js +0 -11
  229. package/packages/dd-trace/src/llmobs/audio-codec.js +192 -0
  230. package/packages/dd-trace/src/llmobs/audio-utils.js +121 -0
  231. package/packages/dd-trace/src/llmobs/constants/audio.js +35 -0
  232. package/packages/dd-trace/src/llmobs/constants/prompts.js +14 -0
  233. package/packages/dd-trace/src/llmobs/constants/tags.js +17 -0
  234. package/packages/dd-trace/src/llmobs/eval-metric.js +0 -6
  235. package/packages/dd-trace/src/llmobs/experiments/dataset.js +0 -4
  236. package/packages/dd-trace/src/llmobs/experiments/experiment.js +0 -3
  237. package/packages/dd-trace/src/llmobs/experiments/index.js +7 -6
  238. package/packages/dd-trace/src/llmobs/experiments/util.js +1 -11
  239. package/packages/dd-trace/src/llmobs/index.js +1 -3
  240. package/packages/dd-trace/src/llmobs/noop.js +10 -0
  241. package/packages/dd-trace/src/llmobs/plugins/ai/util.js +0 -4
  242. package/packages/dd-trace/src/llmobs/plugins/anthropic/util.js +0 -1
  243. package/packages/dd-trace/src/llmobs/plugins/genai/util.js +0 -4
  244. package/packages/dd-trace/src/llmobs/plugins/modelcontextprotocol-sdk/utils.js +0 -2
  245. package/packages/dd-trace/src/llmobs/plugins/openai/constants.js +0 -2
  246. package/packages/dd-trace/src/llmobs/plugins/openai/index.js +4 -6
  247. package/packages/dd-trace/src/llmobs/plugins/openai/realtime.js +285 -0
  248. package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +16 -3
  249. package/packages/dd-trace/src/llmobs/prompts/cache.js +272 -0
  250. package/packages/dd-trace/src/llmobs/prompts/manager.js +639 -0
  251. package/packages/dd-trace/src/llmobs/prompts/noop.js +29 -0
  252. package/packages/dd-trace/src/llmobs/prompts/prompt.js +92 -0
  253. package/packages/dd-trace/src/llmobs/sdk.js +21 -6
  254. package/packages/dd-trace/src/llmobs/span_processor.js +81 -2
  255. package/packages/dd-trace/src/llmobs/tagger.js +30 -7
  256. package/packages/dd-trace/src/llmobs/telemetry.js +36 -4
  257. package/packages/dd-trace/src/llmobs/util.js +0 -34
  258. package/packages/dd-trace/src/llmobs/writers/base.js +0 -1
  259. package/packages/dd-trace/src/llmobs/writers/util.js +1 -2
  260. package/packages/dd-trace/src/log/channels.js +3 -0
  261. package/packages/dd-trace/src/log/index.js +23 -5
  262. package/packages/dd-trace/src/log-submission/log-submission-plugin.js +74 -6
  263. package/packages/dd-trace/src/msgpack/chunk.js +0 -1
  264. package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +0 -12
  265. package/packages/dd-trace/src/openfeature/encoding.js +0 -2
  266. package/packages/dd-trace/src/openfeature/eval-metrics-hook.js +0 -1
  267. package/packages/dd-trace/src/openfeature/index.js +0 -4
  268. package/packages/dd-trace/src/openfeature/span-enrichment-hook.js +0 -1
  269. package/packages/dd-trace/src/openfeature/span-enrichment.js +0 -4
  270. package/packages/dd-trace/src/openfeature/writers/base.js +0 -6
  271. package/packages/dd-trace/src/openfeature/writers/exposures.js +0 -5
  272. package/packages/dd-trace/src/openfeature/writers/util.js +0 -4
  273. package/packages/dd-trace/src/opentelemetry/logs/logger.js +0 -1
  274. package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +0 -1
  275. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +0 -1
  276. package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +0 -2
  277. package/packages/dd-trace/src/opentelemetry/metrics/meter_provider.js +0 -1
  278. package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_transformer.js +0 -1
  279. package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +0 -1
  280. package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -14
  281. package/packages/dd-trace/src/opentelemetry/metrics/time.js +0 -1
  282. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +30 -13
  283. package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +0 -1
  284. package/packages/dd-trace/src/opentelemetry/span-helpers.js +0 -1
  285. package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +0 -1
  286. package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +0 -3
  287. package/packages/dd-trace/src/opentracing/propagation/text_map.js +0 -6
  288. package/packages/dd-trace/src/opentracing/span_context.js +0 -1
  289. package/packages/dd-trace/src/otel-thread-ctx.js +38 -11
  290. package/packages/dd-trace/src/payload-tagging/tagging.js +15 -3
  291. package/packages/dd-trace/src/plugins/ci_plugin.js +0 -1
  292. package/packages/dd-trace/src/plugins/database.js +2 -6
  293. package/packages/dd-trace/src/plugins/index.js +7 -0
  294. package/packages/dd-trace/src/plugins/plugin.js +0 -4
  295. package/packages/dd-trace/src/plugins/tracing.js +1 -1
  296. package/packages/dd-trace/src/plugins/util/git.js +1 -3
  297. package/packages/dd-trace/src/plugins/util/http-otel-semantics.js +0 -1
  298. package/packages/dd-trace/src/plugins/util/llm.js +0 -2
  299. package/packages/dd-trace/src/plugins/util/status-validator.js +0 -1
  300. package/packages/dd-trace/src/plugins/util/test.js +21 -20
  301. package/packages/dd-trace/src/plugins/util/url.js +0 -5
  302. package/packages/dd-trace/src/priority_sampler.js +0 -6
  303. package/packages/dd-trace/src/process-tags/index.js +0 -1
  304. package/packages/dd-trace/src/profiler.js +132 -35
  305. package/packages/dd-trace/src/profiling/exporters/event_serializer.js +0 -1
  306. package/packages/dd-trace/src/profiling/profiler.js +101 -41
  307. package/packages/dd-trace/src/profiling/ssi-heuristics.js +29 -15
  308. package/packages/dd-trace/src/propagation-hash/index.js +0 -1
  309. package/packages/dd-trace/src/proxy.js +21 -45
  310. package/packages/dd-trace/src/random_sampler.js +0 -4
  311. package/packages/dd-trace/src/rate_limiter.js +0 -4
  312. package/packages/dd-trace/src/remote_config/capabilities.js +1 -9
  313. package/packages/dd-trace/src/remote_config/index.js +0 -1
  314. package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +0 -3
  315. package/packages/dd-trace/src/sampler.js +0 -4
  316. package/packages/dd-trace/src/sampling_rule.js +0 -7
  317. package/packages/dd-trace/src/serverless/vercel.js +0 -1
  318. package/packages/dd-trace/src/serverless.js +0 -1
  319. package/packages/dd-trace/src/service-naming/index.js +0 -1
  320. package/packages/dd-trace/src/service-naming/schemas/util.js +0 -1
  321. package/packages/dd-trace/src/service-naming/schemas/v0/storage.js +7 -0
  322. package/packages/dd-trace/src/service-naming/schemas/v1/storage.js +5 -0
  323. package/packages/dd-trace/src/span_processor.js +2 -2
  324. package/packages/dd-trace/src/span_sampler.js +0 -1
  325. package/packages/dd-trace/src/standalone/product.js +2 -2
  326. package/packages/dd-trace/src/standalone/tracesource.js +0 -1
  327. package/packages/dd-trace/src/startup-log.js +1 -1
  328. package/packages/dd-trace/src/telemetry/endpoints.js +0 -8
  329. package/packages/dd-trace/src/telemetry/logs/index.js +16 -5
  330. package/packages/dd-trace/src/telemetry/logs/log-collector.js +16 -6
  331. package/packages/dd-trace/src/telemetry/metrics.js +0 -2
  332. package/packages/dd-trace/src/telemetry/telemetry.js +4 -1
  333. package/packages/dd-trace/src/util.js +13 -1
  334. package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
@@ -37,7 +37,6 @@ function parseLiteralEnvironmentPrefix (command) {
37
37
  * @param {string} command command text
38
38
  * @param {string} name environment variable
39
39
  * @param {string} [platform] target platform
40
- * @returns {string} command without empty assignments
41
40
  */
42
41
  function removeEmptyLiteralEnvironmentAssignments (command, name, platform = process.platform) {
43
42
  const source = String(command || '')
@@ -746,7 +746,6 @@ function hasCucumberBrowserSupport (files, retainedInputs, projectRoot) {
746
746
  * @param {string} framework framework name
747
747
  * @param {string} projectRoot project root
748
748
  * @param {boolean} allowDirectoryConvention whether a literal runner selector owns this root
749
- * @returns {boolean} whether the file is a candidate
750
749
  */
751
750
  function isTestFile (filename, source, framework, projectRoot, allowDirectoryConvention) {
752
751
  const basename = path.basename(filename)
@@ -775,7 +774,6 @@ function isTestFile (filename, source, framework, projectRoot, allowDirectoryCon
775
774
  *
776
775
  * @param {string} source candidate source
777
776
  * @param {string} framework framework name
778
- * @returns {boolean} whether ownership is explicit
779
777
  */
780
778
  function hasExplicitFrameworkImport (source, framework) {
781
779
  if (framework === 'vitest') {
@@ -797,7 +795,6 @@ function hasExplicitFrameworkImport (source, framework) {
797
795
  * @param {string} source file source
798
796
  * @param {string} framework framework name
799
797
  * @param {string} packageName project package name
800
- * @returns {boolean} whether ownership is plausible
801
798
  */
802
799
  function hasFrameworkOwnership (filename, source, framework, packageName) {
803
800
  const normalized = filename.replaceAll('\\', '/').toLowerCase()
@@ -821,7 +818,6 @@ function hasFrameworkOwnership (filename, source, framework, packageName) {
821
818
  *
822
819
  * @param {string} source candidate source
823
820
  * @param {string} framework selected framework
824
- * @returns {boolean} whether source ownership conflicts
825
821
  */
826
822
  function hasConflictingFramework (source, framework) {
827
823
  const markers = {
@@ -840,7 +836,6 @@ function hasConflictingFramework (source, framework) {
840
836
  * @param {string} filename candidate filename
841
837
  * @param {string} source candidate source
842
838
  * @param {string} projectRoot project root
843
- * @returns {number} lower-is-better rank
844
839
  */
845
840
  function getTestRank (filename, source, projectRoot) {
846
841
  const relative = path.relative(projectRoot, filename).replaceAll('\\', '/').toLowerCase()
@@ -857,7 +852,6 @@ function getTestRank (filename, source, projectRoot) {
857
852
  * Counts static test declarations for preferring small representative files.
858
853
  *
859
854
  * @param {string} source test source
860
- * @returns {number} approximate test declaration count
861
855
  */
862
856
  function getStaticTestCount (source) {
863
857
  const direct = [...source.matchAll(/\b(?:it|test)((?:\.[A-Za-z]+)*)\s*\(\s*(['"`])/g)]
@@ -873,7 +867,6 @@ function getStaticTestCount (source) {
873
867
  *
874
868
  * @param {string} projectRoot detected project root
875
869
  * @param {string} repositoryRoot repository root
876
- * @returns {string} preferred representative root
877
870
  */
878
871
  function findPreferredRepresentativeRoot (projectRoot, repositoryRoot) {
879
872
  if (path.resolve(projectRoot) !== path.resolve(repositoryRoot)) return projectRoot
@@ -895,7 +888,6 @@ function findPreferredRepresentativeRoot (projectRoot, repositoryRoot) {
895
888
  * Normalizes repository and package names for exact identity comparison.
896
889
  *
897
890
  * @param {string} value package identity
898
- * @returns {string} normalized identity
899
891
  */
900
892
  function normalizeProjectIdentity (value) {
901
893
  const unscoped = String(value || '').toLowerCase().replace(/^@[^/]+\//, '')
@@ -983,7 +975,6 @@ function findPackageRoot (packageName, projectRoot, repositoryRoot) {
983
975
  * Returns a runner package name.
984
976
  *
985
977
  * @param {string} framework framework name
986
- * @returns {string} package name
987
978
  */
988
979
  function getRunnerPackageName (framework) {
989
980
  return {
@@ -1024,7 +1015,6 @@ function getGeneratedTestConvention (framework, representative, projectRoot) {
1024
1015
  *
1025
1016
  * @param {string} framework framework name
1026
1017
  * @param {string} representative representative test
1027
- * @returns {string} generated test suffix
1028
1018
  */
1029
1019
  function getTestExtension (framework, representative) {
1030
1020
  if (framework === 'cucumber') return '.feature'
@@ -1102,7 +1092,6 @@ function rankCiReviewTargets (files) {
1102
1092
  * Returns a lower-is-better CI review rank.
1103
1093
  *
1104
1094
  * @param {string} filename CI path
1105
- * @returns {number} rank
1106
1095
  */
1107
1096
  function getCiRank (filename) {
1108
1097
  const value = filename.toLowerCase()
@@ -1219,7 +1208,6 @@ function readJson (filename) {
1219
1208
  *
1220
1209
  * @param {string} framework framework id
1221
1210
  * @param {Set<string>} selected selected ids
1222
- * @returns {boolean} selection result
1223
1211
  */
1224
1212
  function isSelected (framework, selected) {
1225
1213
  return selected.size === 0 || selected.has(framework)
@@ -1231,7 +1219,6 @@ function isSelected (framework, selected) {
1231
1219
  * @param {object} packageJson package metadata
1232
1220
  * @param {string} projectRoot project root
1233
1221
  * @param {string} repositoryRoot repository root
1234
- * @returns {string} project id
1235
1222
  */
1236
1223
  function getProjectId (packageJson, projectRoot, repositoryRoot) {
1237
1224
  const value = packageJson.name || path.relative(repositoryRoot, projectRoot) || 'root'
@@ -1242,7 +1229,6 @@ function getProjectId (packageJson, projectRoot, repositoryRoot) {
1242
1229
  * Detects package-manager metadata for reporting only.
1243
1230
  *
1244
1231
  * @param {string} root repository root
1245
- * @returns {string} package manager
1246
1232
  */
1247
1233
  function detectPackageManager (root) {
1248
1234
  if (fs.existsSync(path.join(root, 'pnpm-lock.yaml'))) return 'pnpm'
@@ -1255,7 +1241,6 @@ function detectPackageManager (root) {
1255
1241
  * Detects workspace metadata for reporting only.
1256
1242
  *
1257
1243
  * @param {string} root repository root
1258
- * @returns {string} workspace manager
1259
1244
  */
1260
1245
  function detectWorkspaceManager (root) {
1261
1246
  if (fs.existsSync(path.join(root, 'pnpm-workspace.yaml'))) return 'pnpm'
@@ -1267,7 +1252,6 @@ function detectWorkspaceManager (root) {
1267
1252
  * Returns a manifest operating-system name.
1268
1253
  *
1269
1254
  * @param {string} platform Node.js platform
1270
- * @returns {string} OS name
1271
1255
  */
1272
1256
  function getManifestOs (platform) {
1273
1257
  return platform === 'win32' ? 'windows' : platform
@@ -1278,7 +1262,6 @@ function getManifestOs (platform) {
1278
1262
  *
1279
1263
  * @param {string} root root path
1280
1264
  * @param {string} filename candidate path
1281
- * @returns {boolean} whether the candidate is contained
1282
1265
  */
1283
1266
  function isPathInside (root, filename) {
1284
1267
  const relative = path.relative(path.resolve(root), path.resolve(filename))
@@ -94,7 +94,6 @@ function validateManifest (manifest) {
94
94
  *
95
95
  * @param {object} manifest validation manifest
96
96
  * @param {{push: function(string): void, full: function(): boolean}} errors error collector
97
- * @returns {void}
98
97
  */
99
98
  function validateFrameworks (manifest, errors) {
100
99
  const ids = new Set()
@@ -164,7 +163,6 @@ function validateFrameworks (manifest, errors) {
164
163
  * @param {object} project project metadata
165
164
  * @param {string} prefix error prefix
166
165
  * @param {{push: function(string): void}} errors error collector
167
- * @returns {void}
168
166
  */
169
167
  function validateProject (repositoryRoot, project, prefix, errors) {
170
168
  if (!isObject(project)) return
@@ -192,7 +190,6 @@ function validateProject (repositoryRoot, project, prefix, errors) {
192
190
  * @param {string} prefix error prefix
193
191
  * @param {Map<string, string>} generatedPaths generated paths used by other frameworks
194
192
  * @param {{push: function(string): void}} errors error collector
195
- * @returns {void}
196
193
  */
197
194
  function validateRunnableFramework (repositoryRoot, framework, prefix, generatedPaths, errors) {
198
195
  if (!isObject(framework.validation)) {
@@ -276,7 +273,6 @@ function validateRunnableFramework (repositoryRoot, framework, prefix, generated
276
273
  * @param {object} validation direct-runner validation data
277
274
  * @param {string} prefix error prefix
278
275
  * @param {{push: function(string): void}} errors error collector
279
- * @returns {void}
280
276
  */
281
277
  function validateFallbackTests (repositoryRoot, validation, prefix, errors) {
282
278
  if (validation.fallbackTests === undefined) return
@@ -322,7 +318,6 @@ function validateFallbackTests (repositoryRoot, validation, prefix, errors) {
322
318
  * @param {string} prefix framework error prefix
323
319
  * @param {Map<string, string>} generatedPaths generated paths used by other frameworks
324
320
  * @param {{push: function(string): void}} errors error collector
325
- * @returns {void}
326
321
  */
327
322
  function validateGeneratedStrategy (repositoryRoot, framework, prefix, generatedPaths, errors) {
328
323
  const strategy = framework.generatedTestStrategy
@@ -406,7 +401,6 @@ function validateGeneratedStrategy (repositoryRoot, framework, prefix, generated
406
401
  * @param {object} scenario generated scenario
407
402
  * @param {string} prefix error prefix
408
403
  * @param {{push: function(string): void}} errors error collector
409
- * @returns {void}
410
404
  */
411
405
  function validateScenarioIdentity (repositoryRoot, scenario, prefix, errors) {
412
406
  if (!Array.isArray(scenario.testIdentities) || scenario.testIdentities.length !== 1) {
@@ -431,7 +425,6 @@ function validateScenarioIdentity (repositoryRoot, scenario, prefix, errors) {
431
425
  * @param {object|undefined} ciWiring CI evidence
432
426
  * @param {string} prefix error prefix
433
427
  * @param {{push: function(string): void}} errors error collector
434
- * @returns {void}
435
428
  */
436
429
  function validateCiWiring (repositoryRoot, ciWiring, prefix, errors) {
437
430
  if (ciWiring === undefined) return
@@ -468,7 +461,6 @@ function validateCiWiring (repositoryRoot, ciWiring, prefix, errors) {
468
461
  * @param {string} prefix error prefix
469
462
  * @param {{push: function(string): void}} errors error collector
470
463
  * @param {Set<string>} [allowed] explicitly inert keys
471
- * @returns {void}
472
464
  */
473
465
  function rejectExecutionFields (value, prefix, errors, allowed = new Set()) {
474
466
  if (!isObject(value)) return
@@ -487,7 +479,6 @@ function rejectExecutionFields (value, prefix, errors, allowed = new Set()) {
487
479
  * @param {string} prefix error prefix
488
480
  * @param {Map<string, string>} generatedPaths previously claimed paths
489
481
  * @param {{push: function(string): void}} errors error collector
490
- * @returns {void}
491
482
  */
492
483
  function claimGeneratedPath (filename, owner, prefix, generatedPaths, errors) {
493
484
  if (typeof filename !== 'string' || !path.isAbsolute(filename)) return
@@ -505,7 +496,6 @@ function claimGeneratedPath (filename, owner, prefix, generatedPaths, errors) {
505
496
  * @param {unknown} value current value
506
497
  * @param {string} prefix error prefix
507
498
  * @param {{push: function(string): void, full: function(): boolean}} errors error collector
508
- * @returns {void}
509
499
  */
510
500
  function validateAllStrings (value, prefix, errors) {
511
501
  if (errors.full()) return
@@ -534,7 +524,6 @@ function validateAllStrings (value, prefix, errors) {
534
524
  * @param {string} field field name
535
525
  * @param {string} prefix error prefix
536
526
  * @param {{push: function(string): void}} errors error collector
537
- * @returns {void}
538
527
  */
539
528
  function requiredObject (object, field, prefix, errors) {
540
529
  if (!isObject(object[field])) errors.push(`${prefix}.${field} must be an object.`)
@@ -547,7 +536,6 @@ function requiredObject (object, field, prefix, errors) {
547
536
  * @param {string} field field name
548
537
  * @param {string} prefix error prefix
549
538
  * @param {{push: function(string): void}} errors error collector
550
- * @returns {void}
551
539
  */
552
540
  function requiredArray (object, field, prefix, errors) {
553
541
  if (!Array.isArray(object[field])) errors.push(`${prefix}.${field} must be an array.`)
@@ -560,7 +548,6 @@ function requiredArray (object, field, prefix, errors) {
560
548
  * @param {string} field field name
561
549
  * @param {string} prefix error prefix
562
550
  * @param {{push: function(string): void}} errors error collector
563
- * @returns {void}
564
551
  */
565
552
  function requiredString (object, field, prefix, errors) {
566
553
  if (typeof object?.[field] !== 'string' || object[field].trim() === '') {
@@ -576,7 +563,6 @@ function requiredString (object, field, prefix, errors) {
576
563
  * @param {Set<string>} values accepted values
577
564
  * @param {string} prefix error prefix
578
565
  * @param {{push: function(string): void}} errors error collector
579
- * @returns {void}
580
566
  */
581
567
  function enumString (object, field, values, prefix, errors) {
582
568
  if (!values.has(object?.[field])) {
@@ -591,7 +577,6 @@ function enumString (object, field, values, prefix, errors) {
591
577
  * @param {string} field field name
592
578
  * @param {string} prefix error prefix
593
579
  * @param {{push: function(string): void}} errors error collector
594
- * @returns {void}
595
580
  */
596
581
  function requiredAbsolutePath (object, field, prefix, errors) {
597
582
  absolutePathValue(object?.[field], `${prefix}.${field}`, errors)
@@ -603,7 +588,6 @@ function requiredAbsolutePath (object, field, prefix, errors) {
603
588
  * @param {unknown} value path value
604
589
  * @param {string} prefix error prefix
605
590
  * @param {{push: function(string): void}} errors error collector
606
- * @returns {void}
607
591
  */
608
592
  function absolutePathValue (value, prefix, errors) {
609
593
  if (typeof value !== 'string' || !path.isAbsolute(value)) errors.push(`${prefix} must be an absolute path.`)
@@ -616,7 +600,6 @@ function absolutePathValue (value, prefix, errors) {
616
600
  * @param {string} field field name
617
601
  * @param {string} prefix error prefix
618
602
  * @param {{push: function(string): void}} errors error collector
619
- * @returns {void}
620
603
  */
621
604
  function optionalAbsolutePathOrNull (object, field, prefix, errors) {
622
605
  if (object[field] !== null && object[field] !== undefined &&
@@ -632,7 +615,6 @@ function optionalAbsolutePathOrNull (object, field, prefix, errors) {
632
615
  * @param {string} field field name
633
616
  * @param {string} prefix error prefix
634
617
  * @param {{push: function(string): void}} errors error collector
635
- * @returns {void}
636
618
  */
637
619
  function optionalStringOrNull (object, field, prefix, errors) {
638
620
  if (object[field] !== null && object[field] !== undefined && typeof object[field] !== 'string') {
@@ -646,7 +628,6 @@ function optionalStringOrNull (object, field, prefix, errors) {
646
628
  * @param {unknown} value array value
647
629
  * @param {string} prefix error prefix
648
630
  * @param {{push: function(string): void}} errors error collector
649
- * @returns {void}
650
631
  */
651
632
  function validateStringArray (value, prefix, errors) {
652
633
  if (value === undefined) return
@@ -667,7 +648,6 @@ function validateStringArray (value, prefix, errors) {
667
648
  * @param {unknown} filename candidate path
668
649
  * @param {string} prefix error prefix
669
650
  * @param {{push: function(string): void}} errors error collector
670
- * @returns {void}
671
651
  */
672
652
  function containedPath (root, filename, prefix, errors) {
673
653
  if (typeof root !== 'string' || !path.isAbsolute(root) ||
@@ -682,7 +662,6 @@ function containedPath (root, filename, prefix, errors) {
682
662
  * Returns whether a value is a plain object.
683
663
  *
684
664
  * @param {unknown} value candidate value
685
- * @returns {boolean} whether the value is an object
686
665
  */
687
666
  function isObject (value) {
688
667
  return value !== null && typeof value === 'object' && !Array.isArray(value)
@@ -174,7 +174,6 @@ function getOfflineScenarioNames (requestedScenario) {
174
174
  *
175
175
  * @param {object} framework framework manifest entry
176
176
  * @param {string} scenarioName cache execution name
177
- * @returns {string} SHA-256 fixture recipe digest
178
177
  */
179
178
  function getFixtureRecipeDigest (framework, scenarioName) {
180
179
  const generatedScenarioId = {
@@ -276,7 +275,6 @@ function mergeSettings (settings = {}) {
276
275
  * Creates or verifies a private validator-owned fixture directory.
277
276
  *
278
277
  * @param {string} directory fixture base directory
279
- * @returns {void}
280
278
  */
281
279
  function ensurePrivateDirectory (directory) {
282
280
  try {
@@ -298,7 +296,6 @@ function ensurePrivateDirectory (directory) {
298
296
  *
299
297
  * @param {string} directory first candidate directory
300
298
  * @param {string} stop fixture base directory
301
- * @returns {void}
302
299
  */
303
300
  function removeEmptyParents (directory, stop) {
304
301
  let current = directory
@@ -320,7 +317,6 @@ function removeEmptyParents (directory, stop) {
320
317
  *
321
318
  * @param {string} root candidate parent
322
319
  * @param {string} filename candidate child
323
- * @returns {boolean} whether the child is inside the parent
324
320
  */
325
321
  function isPathInside (root, filename) {
326
322
  const relative = path.relative(root, filename)
@@ -27,7 +27,6 @@ const SCENARIO_TO_GENERATED_ID = {
27
27
  * Produces the deterministic execution plan shown before live validation.
28
28
  *
29
29
  * @param {object} input plan inputs
30
- * @returns {string} Markdown execution plan
31
30
  */
32
31
  function formatExecutionPlan (input) {
33
32
  return formatExecutionPlanArtifacts(input).plan
@@ -104,7 +103,6 @@ function formatExecutionPlanArtifacts ({
104
103
  * @param {object|undefined} input.packageCheck installed package-load result
105
104
  * @param {string|null} input.requestedScenario selected scenario
106
105
  * @param {string[]} input.validatorArgv exact validator command
107
- * @returns {string} Markdown plan
108
106
  */
109
107
  function formatApprovalPlan ({
110
108
  approvalArtifacts,
@@ -449,7 +447,6 @@ function getSelectedSupportFiles (framework, selectedScenarios) {
449
447
  *
450
448
  * @param {object} framework framework entry
451
449
  * @param {object} scenario generated scenario
452
- * @returns {string} source
453
450
  */
454
451
  function getGeneratedSource (framework, scenario) {
455
452
  const filename = path.resolve(scenario.testIdentities[0].file)
@@ -461,7 +458,6 @@ function getGeneratedSource (framework, scenario) {
461
458
  * Returns the execution plan path.
462
459
  *
463
460
  * @param {string} out output directory
464
- * @returns {string} plan path
465
461
  */
466
462
  function getExecutionPlanPath (out) {
467
463
  return path.join(out, EXECUTION_PLAN_FILENAME)
@@ -472,7 +468,6 @@ function getExecutionPlanPath (out) {
472
468
  *
473
469
  * @param {object} framework framework entry
474
470
  * @param {string} root repository root
475
- * @returns {string} label
476
471
  */
477
472
  function getFrameworkLabel (framework, root) {
478
473
  const project = framework.project?.name || relative(root, framework.project?.root || root)
@@ -483,7 +478,6 @@ function getFrameworkLabel (framework, root) {
483
478
  * Formats a framework status.
484
479
  *
485
480
  * @param {string} status status id
486
- * @returns {string} status text
487
481
  */
488
482
  function formatStatus (status) {
489
483
  return {
@@ -498,7 +492,6 @@ function formatStatus (status) {
498
492
  *
499
493
  * @param {string} root repository root
500
494
  * @param {string} filename absolute path
501
- * @returns {string} relative display path
502
495
  */
503
496
  function relative (root, filename) {
504
497
  const value = path.relative(root, filename)
@@ -509,7 +502,6 @@ function relative (root, filename) {
509
502
  * Formats a safe Markdown code block.
510
503
  *
511
504
  * @param {string} value text
512
- * @returns {string} code block
513
505
  */
514
506
  function codeBlock (value) {
515
507
  return `\`\`\`text\n${plainMultiline(value).replaceAll('```', String.raw`\u0060\u0060\u0060`)}\n\`\`\``
@@ -519,7 +511,6 @@ function codeBlock (value) {
519
511
  * Formats safe inline code.
520
512
  *
521
513
  * @param {string} value text
522
- * @returns {string} inline code
523
514
  */
524
515
  function inline (value) {
525
516
  return `\`${plain(value).replaceAll('`', String.raw`\u0060`)}\``
@@ -529,7 +520,6 @@ function inline (value) {
529
520
  * Sanitizes one line of plan text.
530
521
  *
531
522
  * @param {unknown} value text
532
- * @returns {string} safe text
533
523
  */
534
524
  function plain (value) {
535
525
  return sanitizeString(String(value ?? '')).replaceAll(/\p{Cc}+/gu, ' ').trim()
@@ -539,7 +529,6 @@ function plain (value) {
539
529
  * Sanitizes multiline plan text.
540
530
  *
541
531
  * @param {unknown} value text
542
- * @returns {string} safe text
543
532
  */
544
533
  function plainMultiline (value) {
545
534
  return sanitizeString(String(value ?? '')).replaceAll('\r\n', '\n').replaceAll('\r', '\n').trim()
@@ -141,7 +141,6 @@ async function runCandidate ({ framework, index, options, out, testFile }) {
141
141
  * @param {object|undefined} commandFailure classified blocker
142
142
  * @param {string[]} diagnosticSummary bounded diagnostic lines
143
143
  * @param {object} framework framework manifest entry
144
- * @returns {string} customer-facing diagnosis
145
144
  */
146
145
  function getFailureDiagnosis (result, observedTestCount, commandFailure, diagnosticSummary, framework) {
147
146
  const sharedPrerequisite = !commandFailure && framework.allCandidatesRequireLocalSocket
@@ -167,7 +167,6 @@ function sanitizeEnvValue (name, value) {
167
167
  * Redacts common inline secret forms from strings.
168
168
  *
169
169
  * @param {string} value string to sanitize
170
- * @returns {string} sanitized string
171
170
  */
172
171
  function sanitizeString (value) {
173
172
  const references = []
@@ -195,7 +194,6 @@ function sanitizeString (value) {
195
194
  * Detects default-ignorable Unicode characters that can conceal executable text or secret names.
196
195
  *
197
196
  * @param {unknown} value candidate text
198
- * @returns {boolean} true when the text contains a default-ignorable Unicode character
199
197
  */
200
198
  function hasUnicodeDefaultIgnorable (value) {
201
199
  return DEFAULT_IGNORABLE_TEST_PATTERN.test(String(value ?? ''))
@@ -214,7 +212,6 @@ function hasUnsafeExecutionCharacter (value) {
214
212
  * Makes untrusted text safe to print to an interactive terminal while preserving line breaks.
215
213
  *
216
214
  * @param {unknown} value console value
217
- * @returns {string} inert console text
218
215
  */
219
216
  function sanitizeConsoleText (value) {
220
217
  let result = ''
@@ -231,7 +228,6 @@ function sanitizeConsoleText (value) {
231
228
  * Returns whether a key or variable name usually carries secret values.
232
229
  *
233
230
  * @param {string} name key or environment variable name
234
- * @returns {boolean} true when values under this name should be redacted
235
231
  */
236
232
  function isSensitiveName (name) {
237
233
  const normalized = String(name || '').replaceAll(/[-.]/g, '_')
@@ -33,7 +33,6 @@ const SCENARIO_NAMES = {
33
33
  * @param {string} input.out output directory
34
34
  * @param {object} [input.staticDiagnosis] static diagnosis artifacts
35
35
  * @param {object} [input.runSummary] run summary
36
- * @returns {void}
37
36
  */
38
37
  function writeReport ({ manifest, results, out, staticDiagnosis, runSummary = {} }) {
39
38
  const reportPath = path.join(out, REPORT_FILENAME)
@@ -60,7 +59,6 @@ function writeReport ({ manifest, results, out, staticDiagnosis, runSummary = {}
60
59
  * @param {object} input pending report inputs
61
60
  * @param {object} input.manifest normalized manifest
62
61
  * @param {string} input.out output directory
63
- * @returns {void}
64
62
  */
65
63
  function writePendingReport ({ manifest, out }) {
66
64
  const reportPath = path.join(out, REPORT_FILENAME)
@@ -91,7 +89,6 @@ function writePendingReport ({ manifest, out }) {
91
89
  * @param {object[]} input.results sanitized results
92
90
  * @param {object} input.runSummary run summary
93
91
  * @param {string|undefined} input.staticDiagnosisPath static diagnosis path
94
- * @returns {string} Markdown
95
92
  */
96
93
  function renderReport ({ manifest, out, reportPath, results, runSummary, staticDiagnosisPath }) {
97
94
  const lines = [
@@ -190,7 +187,6 @@ function renderReport ({ manifest, out, reportPath, results, runSummary, staticD
190
187
  *
191
188
  * @param {string} out validation output directory
192
189
  * @param {string|undefined} approvedPlanSha256 approved plan digest
193
- * @returns {boolean} whether the current plan is safe to label as approved
194
190
  */
195
191
  function hasCurrentExecutionPlan (out, approvedPlanSha256) {
196
192
  if (!APPROVAL_DIGEST_PATTERN.test(String(approvedPlanSha256 || ''))) return false
@@ -442,7 +438,6 @@ function compactEvidence (evidence = {}) {
442
438
  * Renders JSON without allowing evidence strings to close the Markdown fence.
443
439
  *
444
440
  * @param {object} value structured evidence
445
- * @returns {string} fenced JSON body
446
441
  */
447
442
  function fencedJson (value) {
448
443
  return JSON.stringify(value, null, 2).replaceAll('```', String.raw`\u0060\u0060\u0060`)
@@ -454,7 +449,6 @@ function fencedJson (value) {
454
449
  * @param {object[]} results validation results
455
450
  * @param {object} runSummary run summary
456
451
  * @param {string} reportPath report path
457
- * @returns {string} console text
458
452
  */
459
453
  function renderConsole (results, runSummary, reportPath) {
460
454
  const lines = [
@@ -478,7 +472,6 @@ function renderConsole (results, runSummary, reportPath) {
478
472
  * Returns whether a result lacks a conclusive pass/fail.
479
473
  *
480
474
  * @param {object|undefined} result validation result
481
- * @returns {boolean} whether incomplete
482
475
  */
483
476
  function isIncomplete (result) {
484
477
  return Boolean(result && (
@@ -492,7 +485,6 @@ function isIncomplete (result) {
492
485
  * Returns a display status.
493
486
  *
494
487
  * @param {object} result validation result
495
- * @returns {string} status
496
488
  */
497
489
  function getDisplayStatus (result) {
498
490
  if (result.scenario === 'ci-wiring' && result.status === 'fail') {
@@ -520,7 +512,6 @@ function getVisibleResults (results) {
520
512
  * Returns whether detailed debugging context should be shown.
521
513
  *
522
514
  * @param {object} result validation result
523
- * @returns {boolean} whether details are useful
524
515
  */
525
516
  function shouldRenderDiagnostics (result) {
526
517
  return result.status === 'fail' || result.status === 'error' || isIncomplete(result)
@@ -578,7 +569,6 @@ function getArtifactDirectory (artifacts = [], out) {
578
569
  *
579
570
  * @param {string} root root path
580
571
  * @param {string} filename candidate path
581
- * @returns {boolean} containment
582
572
  */
583
573
  function isPathInside (root, filename) {
584
574
  const value = path.relative(root, filename)
@@ -589,7 +579,6 @@ function isPathInside (root, filename) {
589
579
  * Formats an execution status.
590
580
  *
591
581
  * @param {string|undefined} status status id
592
- * @returns {string} display status
593
582
  */
594
583
  function formatExecutionStatus (status) {
595
584
  return String(status || 'incomplete').replaceAll('_', ' ').toUpperCase()
@@ -628,7 +617,6 @@ function formatCleanupStatus (cleanup) {
628
617
  * Returns a display scenario name.
629
618
  *
630
619
  * @param {string} scenario scenario id
631
- * @returns {string} display name
632
620
  */
633
621
  function getScenarioName (scenario) {
634
622
  return SCENARIO_NAMES[scenario] || scenario
@@ -638,7 +626,6 @@ function getScenarioName (scenario) {
638
626
  * Formats a Markdown table cell.
639
627
  *
640
628
  * @param {unknown} value cell value
641
- * @returns {string} escaped text
642
629
  */
643
630
  function cell (value) {
644
631
  return plain(value).replaceAll('|', String.raw`\|`)
@@ -648,7 +635,6 @@ function cell (value) {
648
635
  * Formats inline code.
649
636
  *
650
637
  * @param {unknown} value code value
651
- * @returns {string} Markdown code
652
638
  */
653
639
  function code (value) {
654
640
  return `\`${plain(value).replaceAll('`', String.raw`\u0060`)}\``
@@ -658,7 +644,6 @@ function code (value) {
658
644
  * Sanitizes one line of report text.
659
645
  *
660
646
  * @param {unknown} value text
661
- * @returns {string} safe text
662
647
  */
663
648
  function plain (value) {
664
649
  return sanitizeString(String(value ?? '')).replaceAll(/\p{Cc}+/gu, ' ').trim()
@@ -669,7 +654,6 @@ function plain (value) {
669
654
  *
670
655
  * @param {string} root base directory
671
656
  * @param {string} filename file path
672
- * @returns {string} relative path
673
657
  */
674
658
  function relative (root, filename) {
675
659
  return path.relative(root, filename) || '.'
@@ -121,7 +121,6 @@ function getManifestInputFiles (manifest, { includeLocal = true } = {}) {
121
121
  *
122
122
  * @param {string} scenarioId generated scenario id
123
123
  * @param {string|null} requestedScenario selected validator scenario
124
- * @returns {boolean} whether to include the command
125
124
  */
126
125
  function shouldIncludeGeneratedScenario (scenarioId, requestedScenario) {
127
126
  if (!requestedScenario) return true
@@ -241,7 +240,6 @@ function getRunnerEnv (framework) {
241
240
  *
242
241
  * @param {Set<string>} files collected files
243
242
  * @param {string|undefined} filename candidate file
244
- * @returns {void}
245
243
  */
246
244
  function addExistingFile (files, filename) {
247
245
  if (typeof filename !== 'string') return
@@ -254,7 +252,6 @@ function addExistingFile (files, filename) {
254
252
  * Formats a framework name for command descriptions.
255
253
  *
256
254
  * @param {string} framework framework name
257
- * @returns {string} display name
258
255
  */
259
256
  function formatFrameworkName (framework) {
260
257
  return framework.charAt(0).toUpperCase() + framework.slice(1)
@@ -241,7 +241,6 @@ function getRunnerSearchRoots (framework, command, projectRoot, repositoryRoot)
241
241
  * @param {string} projectRoot detected project root
242
242
  * @param {string} repositoryRoot repository root
243
243
  * @param {boolean} directory whether the option explicitly requires a directory
244
- * @returns {void}
245
244
  */
246
245
  function addRunnerSearchRoot (roots, value, projectRoot, repositoryRoot, directory) {
247
246
  if (typeof value !== 'string' || !value) return
@@ -523,7 +522,6 @@ function getRunnerArgs (framework, invocation) {
523
522
  * Normalizes executable shims and supported JavaScript runner entrypoints.
524
523
  *
525
524
  * @param {string} token command token
526
- * @returns {string} normalized executable basename
527
525
  */
528
526
  function normalizeRunnerBasename (token) {
529
527
  return path.basename(token)
@@ -670,7 +668,6 @@ function tokenizeCommand (command) {
670
668
  * Returns the executable name for a framework.
671
669
  *
672
670
  * @param {string} framework framework name
673
- * @returns {string} executable name
674
671
  */
675
672
  function getRunnerExecutableName (framework) {
676
673
  if (framework === 'cucumber') return 'cucumber-js'
@@ -682,7 +679,6 @@ function getRunnerExecutableName (framework) {
682
679
  *
683
680
  * @param {string} root root path
684
681
  * @param {string} filename candidate path
685
- * @returns {boolean} whether the candidate is contained
686
682
  */
687
683
  function isPathInside (root, filename) {
688
684
  const relative = path.relative(path.resolve(root), path.resolve(filename))
@@ -189,7 +189,6 @@ function refuseSymbolicLink (filename, label) {
189
189
  *
190
190
  * @param {string} root allowed root
191
191
  * @param {string} filename candidate path
192
- * @returns {boolean} true when the candidate is inside the root
193
192
  */
194
193
  function isPathInside (root, filename) {
195
194
  const relative = path.relative(root, filename)
@@ -338,7 +338,6 @@ function getSelectorEvidence (framework, events) {
338
338
  *
339
339
  * @param {string} actual captured test source path
340
340
  * @param {string} expected approved representative path
341
- * @returns {boolean} whether both paths identify the same file
342
341
  */
343
342
  function sourceFilesMatch (actual, expected) {
344
343
  const normalizedActual = normalizeSourceFile(actual)
@@ -592,7 +592,6 @@ function readProjectSource (filename, projectFileSources) {
592
592
  *
593
593
  * @param {string} source file source
594
594
  * @param {string} value recorded value
595
- * @returns {boolean} literal presence
596
595
  */
597
596
  function containsLiteral (source, value) {
598
597
  const normalizedSource = source.replaceAll('\r\n', '\n')