Skip to content

CLI-422 Drop doc claims the code already states - #815

Merged
charafsalmi merged 1 commit into
feature/cs/CLI-422-split-claude-md-by-scopefrom
feature/cs/CLI-422-prune-redundant-doc-content
Sep 14, 2026
Merged

charafsalmi merged 1 commit into
feature/cs/CLI-422-split-claude-md-by-scopefrom
feature/cs/CLI-422-prune-redundant-doc-content

Conversation

@charafsalmi

@charafsalmi charafsalmi commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #814.

Some paragraphs restated what a JSDoc comment, a type union or a short function next to them already said. That is two places to keep in sync, and the copy in the docs is the one that goes stale without anyone noticing.

The diff is 27 deleted lines across 7 files, so it is readable in full. The table is a shortcut to the ones worth a second look, not a substitute for it. Every pointer below was checked against the code on this branch.

Removed Now carried by
alpha/beta eligibility conditions isAlphaEligible / isBetaEligible JSDoc
required options cannot be staged Alpha/Beta, and what a non-entitled caller sees SonarOption.stage() JSDoc, almost word for word
TelemetryFact timestamp default and payload opacity the constructor signature
PostToolUse dispatch and short-circuit semantics runClaudePostToolUseDispatch JSDoc + ClaudePostToolUseResult
resolveProjectUuid caching rules and edge cases that function's header comment
sonar auth logout early return the ten-line authLogout body
sonarcloud-region.ts import-cycle rationale that module's own top comment
detectInstalledAgents gloss the function name
list of clients under src/core/server/, and their count ls
list of files under framework/features/ ls

The rest of the diff is shortening rather than removal: a few passages that explained a mechanism in prose now name the function and stop there, so the fact survives and the restatement goes.

Already settled: the two enumerations go because they have to be edited on every client or file added. #795 had to bump "seventeen" to "eighteen" when EnterprisesClient landed, and this branch was still carrying the stale "seventeen" until today's resync — the failure mode, not a hypothetical one.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

CLI-422

Comment thread .claude/skills/state-and-auth/SKILL.md Outdated
Comment thread .claude/skills/sonarqube-api-layer/SKILL.md Outdated
Comment thread .claude/skills/agent-integrations/SKILL.md Outdated
@charafsalmi
charafsalmi added this pull request to stack #816 September 9, 2026 13:01
@netlify

netlify Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for sonarqube-cli canceled.

Name Link
🔨 Latest commit e51a16c
🔍 Latest deploy log https://app.netlify.com/projects/sonarqube-cli/deploys/6aa421ab70301a0008ee6deb

charafsalmi added a commit that referenced this pull request Sep 9, 2026
…l site

The cut narrowed "Only for credential-free requests that need to
follow a CDN redirect" to a rule that no longer covers all three of
fetchAnonymous's actual callers. Verified: downloadBinary
(sonarsource-releases.ts) and check.ts's stable.version check both
target binaries.sonarsource.com (genuinely CDN), but
fetchServerVersion (server-info.ts:63) calls fetchAnonymous against
<serverURL>/api/system/status — a public unauthenticated SonarQube
endpoint, not a CDN. The retained sentence was therefore actively
wrong, not just less detailed. Broadened the criterion to name both
shapes without re-listing all three files.

Gitar's second finding on this PR (that dropping the
"(version check and the post-command update notice)" gloss on
notification.ts removed the only record of that timing fact) is not
applied: notification.ts's own class docblock already says "the
post-command 'new version available' stderr notice" almost verbatim,
so the cut correctly followed this stack's own established criterion
(don't duplicate what the source's header comment already states) —
the same criterion #815 used throughout. Gitar's premise that this
fact existed nowhere else in the repo's docs is factually incorrect;
replied on the review thread with the source excerpt.
@charafsalmi
charafsalmi force-pushed the feature/cs/CLI-422-prune-redundant-doc-content branch from e90d8b8 to a08248a Compare September 9, 2026 15:22
charafsalmi added a commit that referenced this pull request Sep 9, 2026
8 background agents cross-checked the 8 nested CLAUDE.md/skill files
for the "file X does A, file Y does B" pattern the official Claude
Code best-practices guide calls out separately from pure code
duplication: a list of files whose purpose is fully obvious from
their own names, adding nothing beyond `ls` + reading names.

Only 2 of 8 files had a genuine hit (most of this content turned out
to already carry a non-obvious wiring fact, invariant, or ordering
requirement attached, which the agents were told to preserve):

- src/core/update/CLAUDE.md: dropped the "(version check and the
  post-command update notice)" gloss on check.ts/notification.ts.
- sonarqube-api-layer skill: dropped the three-file enumeration
  (downloadBinary/sonarsource-releases.ts, the stable.version check,
  fetchServerVersion) illustrating fetchAnonymous's CDN-redirect use
  case — each is exactly what its name says.

One flagged candidate (state-and-auth) is NOT applied here: an agent
proposed re-cutting "distinct from installed-agent-detector.ts" from
the agent-detector.ts bullet, on the grounds that
installed-agent-detector.ts's own header already explains the
distinction. That's true once you're in that file, but the clause
being cut is the *only* pointer to that file's existence at all in
this skill — cutting it would recreate the exact gap #815's Gitar
review caught and fixed for this same line. Disagreeing with that
finding.
charafsalmi added a commit that referenced this pull request Sep 9, 2026
…l site

The cut narrowed "Only for credential-free requests that need to
follow a CDN redirect" to a rule that no longer covers all three of
fetchAnonymous's actual callers. Verified: downloadBinary
(sonarsource-releases.ts) and check.ts's stable.version check both
target binaries.sonarsource.com (genuinely CDN), but
fetchServerVersion (server-info.ts:63) calls fetchAnonymous against
<serverURL>/api/system/status — a public unauthenticated SonarQube
endpoint, not a CDN. The retained sentence was therefore actively
wrong, not just less detailed. Broadened the criterion to name both
shapes without re-listing all three files.

Gitar's second finding on this PR (that dropping the
"(version check and the post-command update notice)" gloss on
notification.ts removed the only record of that timing fact) is not
applied: notification.ts's own class docblock already says "the
post-command 'new version available' stderr notice" almost verbatim,
so the cut correctly followed this stack's own established criterion
(don't duplicate what the source's header comment already states) —
the same criterion #815 used throughout. Gitar's premise that this
fact existed nowhere else in the repo's docs is factually incorrect;
replied on the review thread with the source excerpt.
@charafsalmi
charafsalmi marked this pull request as draft September 11, 2026 12:31
@charafsalmi
charafsalmi force-pushed the feature/cs/CLI-422-prune-redundant-doc-content branch from a08248a to bdcc3f5 Compare September 11, 2026 14:14
@charafsalmi charafsalmi changed the title CLI-422 Prune doc claims already duplicated in the source's own comments CLI-422 Drop doc claims the code already states Sep 11, 2026
@charafsalmi
charafsalmi force-pushed the feature/cs/CLI-422-prune-redundant-doc-content branch from bdcc3f5 to 765af5c Compare September 11, 2026 15:22
@charafsalmi
charafsalmi force-pushed the feature/cs/CLI-422-prune-redundant-doc-content branch from 765af5c to 723b3e0 Compare September 11, 2026 15:41
Some paragraphs restated what a JSDoc comment, a type union or a short
function next to them already said. That is two places to keep in sync, and
the copy in the docs is the one that goes stale without anyone noticing.

Each removed claim was checked against the code that supersedes it: the
dispatch semantics are in `runClaudePostToolUseDispatch`'s JSDoc, the
alpha/beta conditions in `isAlphaEligible`/`isBetaEligible`, the caching rules
in `resolveProjectUuid`'s header, the logout early-return in `authLogout`.
Where the code says it better, the doc now points at it instead of repeating
it.

Two enumerations go for the same reason: the list of API clients and their
count, which has to be edited on every client added, and the list of files
under `framework/features/`, which an `ls` answers.
@charafsalmi
charafsalmi force-pushed the feature/cs/CLI-422-prune-redundant-doc-content branch from 723b3e0 to e51a16c Compare September 11, 2026 15:43
@sonarqubecloud

Copy link
Copy Markdown

@charafsalmi
charafsalmi marked this pull request as ready for review September 11, 2026 15:57
@charafsalmi
charafsalmi merged commit ee87b7f into master Sep 14, 2026
22 checks passed
@charafsalmi
charafsalmi deleted the feature/cs/CLI-422-prune-redundant-doc-content branch September 14, 2026 07:19
@gitar-bot

gitar-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 3 closed / 3 findings

Removes 27 clauses across 7 files that verbatim restate JSDoc comments or header documentation already present in the referenced source code, reducing duplication-maintenance costs. A second commit restored three cuts that removed non-derivable guidance (state-and-auth staging rules, enumeration context, Cursor/Codex handler file names), keeping only the genuinely redundant material.

✅ 3 closed
✅ Quality: Two state-and-auth cuts remove guidance absent from the source

📄 .claude/skills/state-and-auth/SKILL.md:21-22
Both clauses were cut as "header-comment restatements", but the referenced files do not contain them. src/core/config-constants.ts's header (lines 21-28) only documents load-time path defaults and the SONAR_USER_HOME late-bound override — it never states the prescriptive rule "import from here instead of hardcoding", and after this cut config-constants.ts is not mentioned in a single .md in the repo, so an agent writing a new ~/.sonar/... path has nothing pointing it at the module (and hardcoding silently defeats the SONAR_USER_HOME override the header does describe). Likewise, the caller-vs-installed detector distinction lives only in installed-agent-detector.ts's header; agent-detector.ts's own JSDoc (lines 21-24) says nothing about the sibling, and installed-agent-detector.ts / detectInstalledAgents now appear in no doc, so an agent sent to agent-detector.ts by this bullet is the one most likely to edit the wrong detector. Restore the directive clause and the sibling-module disambiguation.

✅ Quality: "all seventeen of them" now refers to a removed enumeration

📄 .claude/skills/sonarqube-api-layer/SKILL.md:28-30 📄 .claude/skills/sonarqube-api-layer/SKILL.md:39
Line 39's "Three rules hold across all seventeen of them" counted the client list that immediately preceded it; this PR deleted the eleven shared-client names, leaving seven clients named in the section and a number the reader can no longer resolve or check. The count is also stale against the code — src/core/server/ alone holds 13 domain clients (including DuplicationsClient and PullRequestsClient, which the old list already omitted) plus 5 command-specific ones. Since the enumeration is intentionally gone, drop the count rather than leave a dangling figure.

✅ Quality: Cursor/Codex prompt handler files no longer named, stranding text

📄 .claude/skills/agent-integrations/SKILL.md:8
Removing "codex-prompt-submit.ts and cursor-prompt-submit.ts are thin per-agent prompt entry points" leaves the following sentence "The prompt handlers read stdin.prompt; Claude/Codex emit { decision: 'block' } while Cursor emits { continue: false }" with only one named prompt handler (agent-prompt-submit.ts, described as the shared core), so a reader is led to expect one handler emitting two different shapes when Cursor in fact has its own entry point (src/commands/hook/cursor-prompt-submit.ts). This also undercuts the PR's own rationale for keeping that comparison sentence — it was kept because it synthesizes a contract spread across three handler files, two of which the diff just stopped naming. Re-add the per-agent entry-point clause.

Verification

Functional validation No results

Rules No rules evaluated

Auto-approval Not enabled

Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

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

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.

2 participants