Skip to content

Include failures: surface inner parse errors, drop spurious Q-16-3 (bd-qpvoamvu) - #465

Merged
cscheid merged 2 commits into
mainfrom
feature/bd-qpvoamvu-include-failure-diagnostics
Aug 7, 2026
Merged

Include failures: surface inner parse errors, drop spurious Q-16-3 (bd-qpvoamvu)#465
cscheid merged 2 commits into
mainfrom
feature/bd-qpvoamvu-include-failure-diagnostics

Conversation

@cscheid

@cscheid cscheid commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

Fixes two diagnostics defects around failing {{< include >}} shortcodes, found while porting the Posit Connect docs (bd-qpvoamvu):

  • Inner parse errors were swallowed. A failing include reported only Failed to parse included file '…': 1 error(s). The included file's own diagnostics — with precise locations — were discarded. Now the wrapper is followed by the inner diagnostics, remapped into the parent document's SourceContext so they render full ariadne snippets in the included file.
  • A contradictory Q-16-3 Unknown shortcode followed every failure. The failed include's paragraph was left in the AST, so the shortcode-resolve transform reported include as unrecognized. Failed include blocks are now removed; any include that legitimately reaches shortcode-resolve (e.g. inline in a sentence) gets a dedicated "Include not expanded" warning instead.

Along the way, the include diagnostics were found to be squatting on the project subsystem's catalog codes (Q-5-1/2/3 = resource-glob errors). This PR mints subsystem 17 (include): Q-17-1 circular, Q-17-2 not found, Q-17-3 parse error, Q-17-4 not expanded here — with catalog entries and docs pages under docs/errors/include/.

Before/after on the motivating case: the Connect docs page went from "_common.qmd: 1 error(s)" + "Shortcode include is not recognized" to pointing directly at _common.qmd:383:31 (an unescaped apostrophe) with the full two-label snippet.

Plan + diagnosis: claude-notes/plans/2026-08-07-include-error-diagnostics.md. Discovered follow-up (separate strand bd-1fz3vh99): includes nested inside container blocks are silently dropped.

Test plan

  • 5 new full-pipeline integration tests (include_expansion_diagnostics.rs) + 3 new unit tests, each verified failing before the fix (TDD).
  • cargo nextest run --workspace: 11005 passed. Full cargo xtask verify (incl. WASM + hub-client legs): green.
  • End-to-end via the real binary on a minimal repro, an inline-include fixture, the originating Connect docs page, and a full docs/ site render (186/186) — outputs recorded in the plan file.

🤖 Generated with Claude Code

…d-qpvoamvu)

Move include diagnostics off the project subsystem's codes onto a new
include subsystem (Q-17-1 circular, Q-17-2 not-found, Q-17-3 parse
error, Q-17-4 not-expanded-here), report the included file's own parse
errors with full snippets after the Q-17-3 wrapper, and remove failed
include blocks from the AST so shortcode-resolve no longer misreports
them as unknown shortcodes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@posit-snyk-bot

posit-snyk-bot commented Aug 7, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cscheid
cscheid merged commit b3465b7 into main Aug 7, 2026
8 checks passed
@cscheid
cscheid deleted the feature/bd-qpvoamvu-include-failure-diagnostics branch August 7, 2026 20:45
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