bib-update: extract DOI/CrossRef/OpenAlex cascade into scripts/fetch_bibtex.py#16
Open
nsmiller2501 wants to merge 2 commits into
Open
bib-update: extract DOI/CrossRef/OpenAlex cascade into scripts/fetch_bibtex.py#16nsmiller2501 wants to merge 2 commits into
nsmiller2501 wants to merge 2 commits into
Conversation
Moves the deterministic surface of the DOI → CrossRef → OpenAlex cascade (HTTP fetches via curl, JSON parsing, 3-signal match test with title fuzzy-match ≥85% / year ±1 / first-author match, three-way agreement against the parsed filename stem, and citation key rewriting) out of SKILL.md prose and into a standalone Python script. The script emits a single JSON object with tier, source, bibtex (or null), match_signals, and rejections. The LLM-fallback path (Tier 3) is intentionally not in the script — the script returns "fallback-needed" so the model constructs the unverified entry from the metadata block and blocks for approval. SKILL.md now describes how to invoke the script and how to handle each tier of result; the venue-precedence override (preprint vs published) remains in prose because it requires the model's judgment on filename venue tokens. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Follow-on to #7. Hoists the deterministic surface of
/bib-update's fetch cascade out ofSKILL.mdprose and into a standalone Python script at.claude/skills/bib-update/scripts/fetch_bibtex.py.What changed
.claude/skills/bib-update/scripts/fetch_bibtex.py: encodes Sources 0–2 (DOI direct → CrossRef title+author → OpenAlex), the 3-signal match test (title fuzzy ≥85%, year ±1, first-author match), three-way agreement against the parsed filename stem, and citation-key rewriting. Emits a single JSON object withtier,source,bibtex,match_signals, andrejections.SKILL.mdnow describes how to invoke the script and how to handle each tier of result, replacing ~50 lines of inlinecurl/ matching prose.allowed-toolsaugmented withBash(python3:*)andBash(~/.claude/skills/bib-update/scripts/fetch_bibtex.py:*).Why
fetch_bibtex.pyreturns"fallback-needed"so the model still constructs the unverified entry from the metadata block and blocks for user approval. This preserves the judgment-required step in the LLM layer.Testing
fetch_bibtex.pyagainst several DOIs (Tier 1), CrossRef-discoverable papers (Tier 2), OpenAlex-only papers (Tier 2), and intentionally unresolvable working papers (Tier 3) — confirmed JSON output schema and the correct tier/source classification in each case./bib-updatebehavior expected — same cascade, same output, same idempotency.