Skip to content

fix(vite): score crashed rules as not-run on the dev dashboard, matching CLI and build mode - #475

Merged
oekazuma merged 2 commits into
advisor/050-terminal-safe-stderrfrom
advisor/052-dashboard-failed-rules
Aug 12, 2026
Merged

oekazuma merged 2 commits into
advisor/050-terminal-safe-stderrfrom
advisor/052-dashboard-failed-rules

Conversation

@oekazuma

Copy link
Copy Markdown
Owner

Stacked on #473 — merge that first; GitHub will retarget this to main when the base branch is deleted.

PR #464 made a crashed rule count as "did not run" on the CLI and vite build paths, but the dev dashboard — the most-watched surface — got neither half: the whole-project runner discarded everything but `results`, the live ingest never forwarded `failedRules`, and the middleware scored every snapshot with the unadjusted plugin config. A crashed rule silently inflated the dashboard's Health, and CLI vs dashboard disagreed on the same project.

  • `analyzeProject` now returns a public `failedRuleIds: string[]` (changeset: `svelte-vitals` minor) — ids only, so a caller with its own base config can apply the correction without adopting this call's config.
  • The runner forwards those ids; the ingest POST carries per-route `failedRuleIds` (optional, defensively validated — payloads without it stay valid); the store keeps a per-route union that clears on recovery.
  • `buildSnapshot` computes `withFailedRulesOff(config, static ∪ live ids)` — the base config never swaps, so plugin-option `weights`/`overrides` survive by construction (pinned by a dedicated regression test; the first-cut config-swap approach was rejected in review for exactly that regression).
  • `findingSignature`-based POST dedup now includes the failed-id set, so a route recovering from a crash (same findings, no more crash) still posts and clears its stale entry (tested).
  • The copy-pasted "rule … failed and was skipped" message is now core's `formatFailedRuleWarning` (changeset: core minor) — the third copy had already diverged (missing first-line cap).
  • vite's `console.warn` boundary now strips terminal escapes via `terminalSafe` from fix(cli): strip terminal escapes from stderr diagnostics #473.

Full chain green on this branch (core 1439 / cli 1161 / vite 230, build+typecheck+lint). Plan: `plans/052-dashboard-failed-rules.md`.

🤖 Generated with Claude Code

oekazuma and others added 2 commits August 12, 2026 14:39
…ing CLI and build mode

The dev dashboard's whole-project runner and live per-route ingest both discarded
runRules' failedRules, so a crashed rule silently inflated Health there while the
CLI and vite build path already excluded it via withFailedRulesOff. Thread the
failure-adjusted config through both layers (static: analyzeProject's returned
config via a closure the middleware reads per-request; live: failedRuleIds on the
ingest payload, unioned in the store) and apply withFailedRulesOff where the
snapshot is built.

Also extracts formatFailedRuleWarning to core (replacing three copy-pasted
"rule ... failed and was skipped" string literals, one of which had drifted and
lost the first-line cap) and wraps the vite plugin/handle's warn sinks with
terminalSafe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d-rule ids instead

Revision to the previous commit: buildSnapshot's staticConfig param silently
dropped plugin-option weights/overrides once the first whole-project run
completed, since analyzeProject's returned config never saw those
plugin-only values. Replace the config-swap with an ids-only contract:
analyzeProject now also returns failedRuleIds (already folded into its own
returned config via withFailedRulesOff, exposed separately for callers with
their own base config); the vite runner/plugin/snapshot/middleware thread
that id list instead of a Config, so the dashboard's base config — and any
plugin-option weights/overrides it carries — is never swapped, only layered
with withFailedRulesOff.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 51cc5901-e666-47a2-9b74-6c7d8218b1cc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@oekazuma
oekazuma merged commit 872c141 into advisor/050-terminal-safe-stderr Aug 12, 2026
8 checks passed
@oekazuma
oekazuma deleted the advisor/052-dashboard-failed-rules branch August 12, 2026 17:17
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