Enrich the per-scan Sentry run span with the full run/CI/project/outcome
context (scan mode, score, diagnostics by severity/category, top rule,
lint/dead-code state, and in CI the GitHub event, official-action marker,
forwarded action inputs, and the pull-request gate) so usage and CI behavior
are queryable as spans instead of pre-aggregated counters.
Mint a random per-run runId on the Sentry run context (never a tag or metric
dimension) to correlate the spans of a single run; a workspace invocation's
project scans share one id and per-project span attributes disambiguate. The
wide event's wouldBlock/outcome/exitCode mirror the CLI's real fail-on gate
(ciFailure surface, and no gate in score-only mode). The official GitHub
Action forwards its inputs so action configuration is visible in telemetry.
Telemetry stays anonymized — no repo, owner, username, branch, or path is
sent to Sentry — and --no-score / --no-telemetry opts out.
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the mutable `millionco/react-doctor@main` reference in the GitHub
Actions example with the `@v1` floating release tag, and add a note on
pinning to a full commit SHA for hardened CI (the example grants
`pull-requests: write`). Avoids running whatever `main` points at runtime.
Co-authored-by: Cursor <cursoragent@cursor.com>
`canAnimateOnboarding` only excluded CI, so a git hook invoked by an
interactive `git commit` (real inherited TTY, `GIT_DIR` set) would play
the score-bar count-up and onboarding pacing, emitting cursor escapes
into hook output (issue #293). Add `isGitHookEnvironment()` and gate it
out, while keeping the deliberate coding-agent real-TTY animation.
`--diff` now accepts git's own range syntax: two-dot `A..B` (diff A
directly against B) and three-dot `A...B` (diff from the merge-base of A
and B to B). Each endpoint is individually validated against the
anti-injection guard, so a range can't smuggle a `--upload-pack=`-style
option past it, and an empty endpoint defaults to HEAD (`main..` means
`main..HEAD`).
An invalid `--diff` value (a malformed ref/range, or a base branch that
hasn't been fetched) is now rendered as a clean, single-line message and
exits non-zero. It no longer prints the generic "Something went wrong,
open a prefilled issue" block or reports the expected user error to
Sentry: getDiffInfo now propagates the tagged ReactDoctorError so the CLI
dispatches on reason._tag via the new isUserInputError classifier.
Fixes REACT-DOCTOR-9
Co-authored-by: Cursor <cursoragent@cursor.com>
Show "warning"-severity diagnostics by default again — a scan that reports only errors is too low a bar for a health check. Warnings reach every surface (CLI, PR comment, score, --fail-on); opt out with --no-warnings or "warnings": false. Per-rule / per-category severity overrides still win.
CLI output rework:
- Inline code frames are reserved for errors; warnings list their file:line sites compactly so a long tail of low-severity findings stays scannable.
- Non-verbose warnings roll up into a capped rule×count list (+N more rules → --verbose); errors get the same overflow line past the top 3.
- Audience-aware fix links in --verbose: coding agents get a cache-busting fetch directive, humans get a "Learn more" docs link under the rule name.
- Closing Docs note pointing to CI/CD setup, config-based rule suppression, and diff/PR scanning.
Internal: a single buildSortedRuleGroups primitive backs every rule-list surface (category breakdown, top errors, warnings roll-up, verbose detail, agent handoff, on-disk dump); shared warning-header and site-badge helpers remove the duplicated rendering.
* feat(cli): add Sentry crash reporting
Capture uncaught CLI errors via @sentry/node, flushed before the process
exits and enriched with a run-context snapshot (version, node/platform/
arch, invocation command/argv, cwd, CI provider, coding agent,
interactivity, JSON mode). Initialized as the first statement of the CLI
entry and scoped to the CLI only — the @react-doctor/api library never
initializes Sentry. Opt out via --no-score (also skipped under tests).
Co-authored-by: Cursor <cursoragent@cursor.com>
* refactor(cli): consolidate CI/agent detection into is-ci-environment
build-run-context re-declared CI provider and coding-agent env-var maps
that mirrored is-ci-environment. Move the label maps and the
detectCiProvider/detectCodingAgent resolvers into is-ci-environment as the
single source of truth, derive the flat agent env-var list from the brand
map, and have isCodingAgentEnvironment derive from detectCodingAgent.
Behavior is unchanged (env-detection tests still green).
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>