Skip to content

AP-1543 Run Vortex analysis before agent replies - #6599

Draft
erwan-leforestier-sonarsource wants to merge 1 commit into
ap/AP-1542from
ap/AP-1543
Draft

erwan-leforestier-sonarsource wants to merge 1 commit into
ap/AP-1542from
ap/AP-1543

Conversation

@erwan-leforestier-sonarsource

@erwan-leforestier-sonarsource erwan-leforestier-sonarsource commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor
  • Document the Vortex protocol for all coding agents and bind the checkout to the SonarJava project on Next.

Jira: AP-1543

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

AP-1543

Comment thread AGENTS.md

# Before you reply: Vortex analysis

Install the [SonarQube CLI](https://docs.sonarsource.com/sonarqube-cli/), run `sonar auth login --server https://next.sonarqube.com/sonarqube/`, and optionally configure user-level integration with `sonar integrate claude` or `sonar integrate codex`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: Skip example says SonarQube Cloud, but project binds to SonarQube Server

Step 3 (line 343) gives "no SonarQube Cloud connection" as the example skip reason. This checkout is bound to a SonarQube Server instance (serverUrl: https://next.sonarqube.com/sonarqube/ in .sonar-config.json), and line 312 asks users to authenticate against that server. An agent hitting an auth or connection failure may report or diagnose it as a missing Cloud connection, sending users to the wrong service. Use a server-neutral example, or one that names the Next server.

Make the example match the configured server:

3. If analysis is skipped for another reason (for example, no connection to https://next.sonarqube.com/sonarqube/ or missing authentication), state the reason once in your reply and continue without retrying this session.
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

Comment thread AGENTS.md

# Before you reply: Vortex analysis

Install the [SonarQube CLI](https://docs.sonarsource.com/sonarqube-cli/), run `sonar auth login --server https://next.sonarqube.com/sonarqube/`, and optionally configure user-level integration with `sonar integrate claude` or `sonar integrate codex`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Security: Agents may install user-level hooks without the user opting in

AGENTS.md is the instruction file coding agents read. Line 312 tells the reader to install the SonarQube CLI, run sonar auth login, and "optionally configure user-level integration with sonar integrate claude or sonar integrate codex". Nothing says only a human may do this, or that the agent needs the user's explicit consent first. Line 319 then says the protocol was "installed by sonar integrate at the user's request", so an agent may assume that consent already exists. Line 335 mentions "Per-edit hooks", which tells the agent that integration adds hooks.

The risk: an agent doing an ordinary repository task could choose that "optional" step on its own. It would then change the user's global agent configuration and install hooks that keep running after the task and in other checkouts, without the user asking for it.

Fix: say that CLI installation, authentication and sonar integrate are manual setup steps for the human developer, and that agents must not run them unless the user explicitly asks. Also remove the false "installed at the user's request" provenance.

Limit persistent user-level setup to the human, or to an explicit user request:

Developer setup (manual; agents must not run these steps unless the user explicitly asks): install the [SonarQube CLI](https://docs.sonarsource.com/sonarqube-cli/), run `sonar auth login --server https://next.sonarqube.com/sonarqube/`, and optionally configure user-level integration with `sonar integrate claude` or `sonar integrate codex`.
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@datadog-sonarsource

This comment has been minimized.

@sonarqube-next

Copy link
Copy Markdown
Contributor

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0 Dependency risks
No data about Coverage
No data about Duplication

See analysis details on SonarQube

Comment thread AGENTS.md

# Before you reply: Vortex analysis

Install the [SonarQube CLI](https://docs.sonarsource.com/sonarqube-cli/), run `sonar auth login --server https://next.sonarqube.com/sonarqube/`, and optionally configure user-level integration with `sonar integrate claude` or `sonar integrate codex`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Quality: Protocol says sonar integrate installed it, but it's committed

Line 68 tells agents "These instructions were installed by sonar integrate at the user's request." That isn't true here. The block is committed to the repository's AGENTS.md, and line 61 calls sonar integrate an optional, user-level step that contributors may skip. An agent reading this file is told the user explicitly opted in when they may never have run the CLI, which misstates where the requirement comes from. Change the sentence to say the protocol is part of the repository's agent guide (for example, "This repository requires Vortex analysis…"), or leave the CLI-generated wording out of the committed copy.

Describe the actual source of the instruction:

This repository's agent guide requires Vortex analysis. It checks the final change set for issues before you reply.
  • Apply fix

Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Nov 30, 2026

Copy link
Copy Markdown
CI failed: Two unrelated infrastructure failures were reported: the Sanity Test job hit Java heap exhaustion in Develocity resource collector threads, and the Ruling Update job failed to find actual_* artifacts after upstream ruling QA was cancelled. Both findings are marked related_to_pr=no, so neither is attributed to this PR, and the root causes beyond the immediate errors remain unestablished.

Overview

Two unrelated infrastructure failures were reported: the Sanity Test job hit Java heap exhaustion in Develocity resource collector threads, and the Ruling Update job failed to find actual_* artifacts after upstream ruling QA was cancelled. Both findings are marked related_to_pr=no, so neither is attributed to this PR, and the root causes beyond the immediate errors remain unestablished.

Failures

Sanity Test job failed with Java heap exhaustion in Develocity resource collector threads

  • Type: infrastructure
  • Affected jobs: 141780151702
  • Related to change: no
  • Confidence: high
  • Root cause: After the tests and plugin packaging completed, the JVM reported OutOfMemoryError: Java heap space in the Resource Usage Collector DiskSpeed and Resource Usage Collector Processes threads. This points to insufficient heap or runner resources for the build’s resource-collection tooling; the logs do not establish the precise trigger. The PR adds Vortex instructions and .sonar-config.json, with no supplied evidence of changes to Maven, tests, or memory settings that would explain this failure.
  • Suggested fix: Check the runner’s available memory and the Maven JVM heap configuration (MAVEN_OPTS is set to -Xmx1536m in this run). Increase available memory/heap if appropriate, or disable or adjust the Develocity resource-usage collector, then rerun the job.

Ruling Update and Notify failed after upstream ruling QA cancellation left no actual_* artifacts

  • Type: infrastructure
  • Affected jobs: 141777474313
  • Related to change: no
  • Confidence: high
  • Root cause: The log sets ruling-failed=true because needs.ruling-qa.result was cancelled. The ruling update action then fails at “Sync ruling artifacts” because no actual_* artifacts are available. The log does not establish why ruling QA was cancelled. This PR adds Vortex analysis instructions and a Sonar configuration file; the supplied changes do not affect ruling QA artifact production or this notification action, so there is no evidence connecting the PR to the failure.
  • Suggested fix: Investigate why the upstream ruling QA job was cancelled and rerun it to produce the actual_* artifacts. Consider making the notification action handle cancelled or artifact-less upstream runs without failing the job.

Summary

  • Change-related failures: 0
  • Infrastructure/flaky failures: 2
  • Recommended action: Check the runner’s available memory and the Maven JVM heap configuration (MAVEN_OPTS is set to -Xmx1536m in this run). Increase available memory/heap if appropriate, or disable or adjust the Develocity resource-usage collector, then rerun the job.
Code Review 👍 Approved with suggestions 🟡 Medium risk 0 closed / 3 findings

Adding agent instructions to submit changed files to SonarQube for Vortex analysis could expose code if agents misidentify the intended scope.

Documents the Vortex analysis protocol for coding agents in AGENTS.md and binds the checkout to the SonarJava project on Next. Consider using a server-neutral skip example instead of "SonarQube Cloud", since this checkout binds to a SonarQube Server instance. Clarify that CLI installation, authentication, and sonar integrate are manual setup steps for the developer that agents must not run without explicit user request. Also remove the claim that the committed protocol was installed by sonar integrate at the user's request.

💡 Quality: Skip example says SonarQube Cloud, but project binds to SonarQube Server

📄 AGENTS.md:312 📄 AGENTS.md:343 📄 .sonar-config.json:5

Step 3 (line 343) gives "no SonarQube Cloud connection" as the example skip reason. This checkout is bound to a SonarQube Server instance (serverUrl: https://next.sonarqube.com/sonarqube/ in .sonar-config.json), and line 312 asks users to authenticate against that server. An agent hitting an auth or connection failure may report or diagnose it as a missing Cloud connection, sending users to the wrong service. Use a server-neutral example, or one that names the Next server.

Make the example match the configured server
3. If analysis is skipped for another reason (for example, no connection to https://next.sonarqube.com/sonarqube/ or missing authentication), state the reason once in your reply and continue without retrying this session.
💡 Security: Agents may install user-level hooks without the user opting in

📄 AGENTS.md:312 📄 AGENTS.md:319 📄 AGENTS.md:335

AGENTS.md is the instruction file coding agents read. Line 312 tells the reader to install the SonarQube CLI, run sonar auth login, and "optionally configure user-level integration with sonar integrate claude or sonar integrate codex". Nothing says only a human may do this, or that the agent needs the user's explicit consent first. Line 319 then says the protocol was "installed by sonar integrate at the user's request", so an agent may assume that consent already exists. Line 335 mentions "Per-edit hooks", which tells the agent that integration adds hooks.

The risk: an agent doing an ordinary repository task could choose that "optional" step on its own. It would then change the user's global agent configuration and install hooks that keep running after the task and in other checkouts, without the user asking for it.

Fix: say that CLI installation, authentication and sonar integrate are manual setup steps for the human developer, and that agents must not run them unless the user explicitly asks. Also remove the false "installed at the user's request" provenance.

Limit persistent user-level setup to the human, or to an explicit user request
Developer setup (manual; agents must not run these steps unless the user explicitly asks): install the [SonarQube CLI](https://docs.sonarsource.com/sonarqube-cli/), run `sonar auth login --server https://next.sonarqube.com/sonarqube/`, and optionally configure user-level integration with `sonar integrate claude` or `sonar integrate codex`.
💡 Quality: Protocol says sonar integrate installed it, but it's committed

📄 AGENTS.md:61 📄 AGENTS.md:68

Line 68 tells agents "These instructions were installed by sonar integrate at the user's request." That isn't true here. The block is committed to the repository's AGENTS.md, and line 61 calls sonar integrate an optional, user-level step that contributors may skip. An agent reading this file is told the user explicitly opted in when they may never have run the CLI, which misstates where the requirement comes from. Change the sentence to say the protocol is part of the repository's agent guide (for example, "This repository requires Vortex analysis…"), or leave the CLI-generated wording out of the committed copy.

Describe the actual source of the instruction
This repository's agent guide requires Vortex analysis. It checks the final change set for issues before you reply.
🤖 Prompt for agents
Code Review: Documents the Vortex analysis protocol for coding agents in AGENTS.md and binds the checkout to the SonarJava project on Next. Consider using a server-neutral skip example instead of "SonarQube Cloud", since this checkout binds to a SonarQube Server instance. Clarify that CLI installation, authentication, and `sonar integrate` are manual setup steps for the developer that agents must not run without explicit user request. Also remove the claim that the committed protocol was installed by `sonar integrate` at the user's request.

1. 💡 Quality: Skip example says SonarQube Cloud, but project binds to SonarQube Server
   Files: AGENTS.md:312, AGENTS.md:343, .sonar-config.json:5

   Step 3 (line 343) gives "no SonarQube Cloud connection" as the example skip reason. This checkout is bound to a SonarQube Server instance (`serverUrl: https://next.sonarqube.com/sonarqube/` in `.sonar-config.json`), and line 312 asks users to authenticate against that server. An agent hitting an auth or connection failure may report or diagnose it as a missing Cloud connection, sending users to the wrong service. Use a server-neutral example, or one that names the Next server.

   Fix (Make the example match the configured server):
   3. If analysis is skipped for another reason (for example, no connection to https://next.sonarqube.com/sonarqube/ or missing authentication), state the reason once in your reply and continue without retrying this session.

2. 💡 Security: Agents may install user-level hooks without the user opting in
   Files: AGENTS.md:312, AGENTS.md:319, AGENTS.md:335

   AGENTS.md is the instruction file coding agents read. Line 312 tells the reader to install the SonarQube CLI, run `sonar auth login`, and "optionally configure user-level integration with `sonar integrate claude` or `sonar integrate codex`". Nothing says only a human may do this, or that the agent needs the user's explicit consent first. Line 319 then says the protocol was "installed by `sonar integrate` at the user's request", so an agent may assume that consent already exists. Line 335 mentions "Per-edit hooks", which tells the agent that integration adds hooks.
   
   The risk: an agent doing an ordinary repository task could choose that "optional" step on its own. It would then change the user's global agent configuration and install hooks that keep running after the task and in other checkouts, without the user asking for it.
   
   Fix: say that CLI installation, authentication and `sonar integrate` are manual setup steps for the human developer, and that agents must not run them unless the user explicitly asks. Also remove the false "installed at the user's request" provenance.

   Fix (Limit persistent user-level setup to the human, or to an explicit user request):
   Developer setup (manual; agents must not run these steps unless the user explicitly asks): install the [SonarQube CLI](https://docs.sonarsource.com/sonarqube-cli/), run `sonar auth login --server https://next.sonarqube.com/sonarqube/`, and optionally configure user-level integration with `sonar integrate claude` or `sonar integrate codex`.

3. 💡 Quality: Protocol says `sonar integrate` installed it, but it's committed
   Files: AGENTS.md:61, AGENTS.md:68

   Line 68 tells agents "These instructions were installed by `sonar integrate` at the user's request." That isn't true here. The block is committed to the repository's AGENTS.md, and line 61 calls `sonar integrate` an optional, user-level step that contributors may skip. An agent reading this file is told the user explicitly opted in when they may never have run the CLI, which misstates where the requirement comes from. Change the sentence to say the protocol is part of the repository's agent guide (for example, "This repository requires Vortex analysis…"), or leave the CLI-generated wording out of the committed copy.

   Fix (Describe the actual source of the instruction):
   This repository's agent guide requires Vortex analysis. It checks the final change set for issues before you reply.

Verification PRs 3 inspected

Functional validation No results

Rules 11 not applicable

Broader impact PRs 3 inspected
Cross-PR 3 PRs inspected 0 open impacts

PR 6598: AP-1542 Correct SonarJava contributor guidance Inspected
PR 1322: Route 'sonar analyze agentic' to the CAG binary behind a3s-allow-local-context Inspected
PR 1351: CLI-1661 Guide developers through SonarQube agent setup Inspected

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

This branch has not been deployed

No deployments
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