biblio: New biblio_compile tool¶
Goal¶
(promoted from note)
Context¶
(see source note)
Prompt¶
Fix the issue described below (source: docs/log/issue/issue-arash-20260402-220152-539138.md). Understand the problem, then implement the proposed fix.
biblio: New biblio_compile tool — merge intermediates into compiled.bib¶
New function in packages/biblio/src/biblio/bibtex.py:¶
def compile_bib(sources: list[Path], output: Path, *, dry_run: bool = False) -> tuple[int, int]:
"""Merge multiple .bib intermediates into a single compiled output.
Reuses pybtex merge logic. Duplicate keys across sources use last-wins.
Returns (n_sources, n_entries).
"""
Config in render.yml (read by projio):¶
bibliography: .projio/render/compiled.bib
bib_sources:
- .projio/biblio/merged.bib
- .projio/pipeio/modkey.bib
MCP tool in packages/biblio/src/biblio/mcp.py:¶
mcp_biblio_compile(root, sources=None, output=None)- If sources not given, reads from render.yml
bib_sources - If output not given, reads from render.yml
bibliography - Skips missing source files gracefully (pipeio might not exist in all projects)
MCP registration in src/projio/mcp/biblio.py:¶
- Register
biblio_compiletool that wraps the biblio function - Reads render.yml for default config
Workflow integration:¶
projio synccalls: biblio_merge → modkey_bib (if pipeio present) → biblio_compile- Both pandoc (via pandoc-defaults.yaml) and mkdocs (via bib_file config) point to .projio/render/compiled.bib
Related Notes¶
- issue-arash-20260402-220025-468258.md — Spec for the new bib architecture (sources vs artifacts separation) that biblio_compile implements — compiled.bib is the artifact, merged.bib/modkey.bib are the sources
- issue-arash-20260402-220130-159401.md — About moving biblio merge output and config to a new location — directly affects the merged.bib source path that biblio_compile reads
- issue-arash-20260402-220100-339672.md — About changing modkey.bib (pipeio modkey) — modkey.bib is one of the bib_sources that biblio_compile merges into compiled.bib
Acceptance Criteria¶
- [ ]
Result¶
(pending)
Batch Result¶
- status: done
- batch queue_id:
9ef168fb767a - session:
5770b78c-f4c8-4794-9f73-aedd6692dafa - batch duration: 1363.6s