Skip to content

report_build preflight fails on projects with no bibliography (quarto-reports ph

report_build preflight fails on projects with no bibliography (quarto-reports phase 1 follow-up).

Repro: 1. In a projio repo with no .projio/render/compiled.bib (e.g. projio itself — a tool repo with no papers to cite) 2. report_init(name="smoke", template="update") — scaffolds report.qmd with bibliography: ../../../../.projio/render/compiled.bib in frontmatter (hard-coded path from the template, regardless of whether the file exists) 3. report_build(name="smoke") — fails preflight with bibliography: file not found

Observed preflight output:

{"error":"preflight validation failed",
 "preflight_errors":["bibliography: file not found: ../../../../.projio/render/compiled.bib"],
 "bibliography":{"path":".../.projio/render/compiled.bib","ok":false,...}}

This is wrong: a report with no citations shouldn't need a bib file. Two reasonable fixes, pick one:

Option A — preflight-side fix (simpler). report_build only validates bibliography when the .qmd body contains at least one citation (regex @[A-Za-z0-9_:.\-]+). Empty-bib reports build cleanly. Preserves the current report_init template as-is.

Option B — init-side fix (cleaner by construction). report_init checks .projio/render/compiled.bib existence at scaffold time and emits no bibliography: frontmatter when absent. Preflight behavior unchanged.

Recommendation: A. It's resilient to users editing the frontmatter themselves, and it matches how pandoc treats bibliography — no citations, no required bib. B only covers the init path; if a user adds bibliography: later to a bib-less project, A still does the right thing.

Touchpoint: src/projio/mcp/report.py preflight function (the one that builds the error list including "bibliography: file not found: ..."). Add a citation-presence check in the body via the existing _CITE_RE equivalent, or reuse the citation scanner used by present_cite_check.

Tests: add to tests/test_mcp_report.py — one fixture report.qmd with no citations in a project with no compiled.bib should pass preflight.

Related: docs/specs/quarto-reports.md §5c lists "bibliography resolves" as a preflight check — spec should be amended to "bibliography resolves IF the report contains citations" so the contract is explicit.

Priority: low. Workaround is to create an empty compiled.bib or drop the bibliography: line manually.

  • issue-arash-20260420-025311-537046.md — Direct parent issue: implements quarto-reports phase 1 including report_init and report_build — this note is an explicit follow-up to that work