Bind the correct config-source file to Q-5-8/Q-5-1 diagnostic spans (bd-m6wmztln, bd-p86nlm92) - #478
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…bd-m6wmztln, bd-p86nlm92)
A pre-render script or resources pattern contributed by an extension
(contributes.metadata.project) carries a SourceInfo anchored in the
extension's _extension.yml via quarto-yaml's filename-hash FileId.
script_error and the project-level resource_error_to_parse_error call
site bound _quarto.yml's content to that FileId unconditionally,
rendering the extension file's byte offsets against the wrong text: a
misleading ariadne span when the offsets fit inside _quarto.yml (the
q2-connect-docs symptom), a silently dropped snippet when they didn't.
Fix, following theme_diagnostic's candidate-matching precedent:
- New quarto_core::config_sources::bind_config_source: re-derives each
candidate file's FileId with quarto_yaml::file_id_for_filename,
registers only the matching file (only with readable content), and
returns the matched path for prose attribution. No match => nothing
registered, span-less degradation — never a wrong span.
- ProjectConfig.extension_manifest_paths records every discovered
extension's manifest path at config-parse time (reconstructed as
ext.path.join("_extension.yml"); bd-xh1v98d9 tracks storing the real
path on Extension).
- RenderScriptsContext threads the candidates through its five
construction sites (render x2, publish x2, quarto-preview boot).
- script_error and the new resource_error_to_config_parse_error bind
via the helper and add an info line naming the contributing
extension manifest when the entry is not from _quarto.yml. The
doc-level resource_error_to_parse_error keeps its contract, now
documented as doc-provenance-only (layered-metadata caveat tracked
in bd-nv4p0eb1, the systematic span/FileId audit).
Tests (written first, verified red): integration coverage for the
extension-contributed script (Q-5-8) and resource (Q-5-1) cases plus a
strengthened _quarto.yml control; five unit tests for the helper.
E2E-verified against the repro fixture and the q2-connect-docs
testbed: both now anchor at the exact _extension.yml entry.
No snapshot files changed. Workspace: 11127 tests pass; full
cargo xtask verify green.
Plan: claude-notes/plans/2026-08-09-q58-extension-script-diagnostic-span.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. |
cscheid
added a commit
that referenced
this pull request
Aug 9, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 9, 2026
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 pre-render script (or
project.resourcespattern) contributed by an extension viacontributes.metadata.projectcarries aSourceInfoanchored in the extension's_extension.yml, using quarto-yaml's filename-hash FileId. The Q-5-8 / Q-5-1 diagnostic assembly bound_quarto.yml's content to that FileId unconditionally, rendering the extension file's byte offsets against the wrong text:_quarto.yml— observed live in the q2-connect-docs testbed, where a failingquarto-openapipre-render script pointed at the unrelatedpost-render:block of_quarto.yml.Fix
Follows the candidate-matching precedent already used by
theme_diagnostic::sass_error_to_parse_error:quarto_core::config_sources::bind_config_source: re-derives each candidate file's FileId withquarto_yaml::file_id_for_filename, registers only the matching file (and only with readable content), and returns the matched path for prose attribution. No match ⇒ nothing registered, span-less degradation — never a wrong span.ProjectConfig.extension_manifest_pathsrecords every discovered extension's manifest path at config-parse time (reconstructed asext.path.join("_extension.yml"); bd-xh1v98d9 tracks storing the real path onExtension).RenderScriptsContextthreads the candidates through its five construction sites (render×2,publish×2,quarto-previewboot).script_errorand the newresource_error_to_config_parse_errorbind via the helper and add an ℹ info line naming the contributing extension manifest when the entry is not from_quarto.yml. The doc-levelresource_error_to_parse_errorkeeps its contract, now documented as doc-provenance-only (layered-metadata caveat tracked in bd-nv4p0eb1, the systematic span/FileId audit).After
Testing
render_scripts_cli::failing_extension_contributed_script_snippet_names_extension_yml(Q-5-8) andextension_config_spans::out_of_project_resource_contributed_by_extension_names_extension_yml(Q-5-1) — plus a strengthened_quarto.ymlcontrol assertion and five unit tests for the helper.cargo xtask verifygreen (including the hub/WASM leg).Plan:
claude-notes/plans/2026-08-09-q58-extension-script-diagnostic-span.mdStrands: bd-m6wmztln (main), bd-p86nlm92 (resources leg, folded in). Follow-ups filed: bd-nv4p0eb1, bd-xh1v98d9, bd-2x0tmd7v.
🤖 Generated with Claude Code