Coalesce repeated per-page render diagnostics + restore config source snippets (bd-mg3ckvp7) - #449
Merged
Conversation
…ce snippets (bd-mg3ckvp7) A problem anchored in a shared file — the motivating case is a broken navbar href in _quarto.yml — was re-diagnosed by every page's render pipeline and printed once per page: 186 identical Q-13-2 warnings on the connect-docs testbed, none of them naming the source. Three changes, building on bd-9hlja's coalescer: - RenderToFileResult now carries input_path (the gap bd-9hlja recorded), so successful-render per-page diagnostics can be attributed to their page. - print_render_diagnostics_text routes those diagnostics through coalesce_by_source from quarto-error-reporting 0.2.1, whose new path-aware LocationKey (posit-dev/quarto-error-reporting#3) makes cross-document grouping safe for sequential per-doc FileIds. One emission per distinct source span, with an "Affected files:" tail. Print-only: counts, --strict promotion, exit codes, and --json-errors are unchanged. - attach_config_source registers the project config file's content under its quarto_yaml hash FileId at print time, so config-anchored groups render the ariadne snippet (file, line, offending span) instead of a span-less block. Dep bump: quarto-error-reporting 0.1.0 -> 0.2.1 in the workspace and in crates/wasm-quarto-hub-client (independent pin outside the workspace). Testbed result: Q-13-2 186 -> 1, now pointing at _quarto.yml:44:15. Plan + diagnosis: claude-notes/plans/2026-07-31-repeated-diagnostics-coalescing.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A problem anchored in a shared file is re-diagnosed by every page's render pipeline and printed once per page. On the connect-docs testbed (
external-sources/connect-docs/docs-quarto-2): 186 identicalQ-13-2"Navbar references missing document" warnings, one per rendered page, all caused by a single bad navbar href in_quarto.yml— and none of them naming the source file, because the per-documentSourceContexts never register_quarto.yml's hash-based FileId.Changes
Building on bd-9hlja (which coalesced
pass2_failuresonly and explicitly deferred this case):RenderToFileResult.input_path(quarto-core): successful-render results now carry their input path — the exact gap bd-9hlja recorded as the blocker.crates/quarto/src/commands/render.rs): per-page diagnostics from successful renders route throughcoalesce_by_sourcefrom quarto-error-reporting 0.2.1, whose path-awareLocationKey(posit-dev/quarto-error-reporting#3) makes cross-document grouping safe for sequential per-doc FileIds. One emission per distinct source span, with anAffected files:tail. Print-only:diagnostic_counts(),--strictpromotion, exit codes, and--json-errorsare unchanged.attach_config_source): when a coalesced group's location FileId matchesquarto_yaml::file_id_for_filename(config_path)and isn't resolvable in the carried context, the config file's content is registered under that id so the ariadne snippet renders. Best-effort; any failure degrades to the previous span-less block.Dep bump:
quarto-error-reporting0.1.0 → 0.2.1 in the workspace and incrates/wasm-quarto-hub-client/Cargo.toml(independent pin outside the workspace).Result on the testbed
Q-13-2 went 186 → 1, and the single warning now points at the offending line:
Exit code unchanged (pre-existing Q-5-3 errors). Remaining repeated classes (Q-12-7 ×15, Q-2-9 ×88, unknown shortcodes ×75) verified to be genuinely distinct source locations.
Tests
4 new integration tests in
crates/quarto/tests/integration/coalesced_diagnostics.rs, all written red-first:(and N others)display cap_quarto.ymlsnippetVerification: full workspace suite (10,810 passed), full
cargo xtask verifyexit 0 (covers the 0.2.1 bump through the WASM/hub legs), finalcargo xtask verify --skip-hub-buildexit 0, clippy + fmt clean.Plan + full diagnosis:
claude-notes/plans/2026-07-31-repeated-diagnostics-coalescing.md. Known pre-existing flakecollect_reverification_skips_rereferenced_candidate(bd-ce1mv6xv) surfaced once during local verification; unrelated to this diff.🤖 Generated with Claude Code