bibcheck-verify 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bibcheck_verify-0.1.1/.env.example +8 -0
- bibcheck_verify-0.1.1/.github/skills/bibcheck/README.md +27 -0
- bibcheck_verify-0.1.1/.github/skills/bibcheck/SKILL.md +68 -0
- bibcheck_verify-0.1.1/.github/skills/bibcheck-verify/README.md +27 -0
- bibcheck_verify-0.1.1/.github/skills/bibcheck-verify/SKILL.md +68 -0
- bibcheck_verify-0.1.1/.github/workflows/publish.yaml +24 -0
- bibcheck_verify-0.1.1/.gitignore +38 -0
- bibcheck_verify-0.1.1/LICENSE +21 -0
- bibcheck_verify-0.1.1/PKG-INFO +227 -0
- bibcheck_verify-0.1.1/README.md +211 -0
- bibcheck_verify-0.1.1/pyproject.toml +30 -0
- bibcheck_verify-0.1.1/src/bibcheck/__init__.py +1 -0
- bibcheck_verify-0.1.1/src/bibcheck/cli.py +76 -0
- bibcheck_verify-0.1.1/src/bibcheck/graph/__init__.py +0 -0
- bibcheck_verify-0.1.1/src/bibcheck/graph/cache.py +35 -0
- bibcheck_verify-0.1.1/src/bibcheck/graph/traverse.py +125 -0
- bibcheck_verify-0.1.1/src/bibcheck/ingest/__init__.py +5 -0
- bibcheck_verify-0.1.1/src/bibcheck/ingest/bibtex.py +30 -0
- bibcheck_verify-0.1.1/src/bibcheck/ingest/pdf.py +12 -0
- bibcheck_verify-0.1.1/src/bibcheck/ingest/text.py +79 -0
- bibcheck_verify-0.1.1/src/bibcheck/report/__init__.py +0 -0
- bibcheck_verify-0.1.1/src/bibcheck/report/json_graph.py +8 -0
- bibcheck_verify-0.1.1/src/bibcheck/report/summary.py +202 -0
- bibcheck_verify-0.1.1/src/bibcheck/resolve/__init__.py +3 -0
- bibcheck_verify-0.1.1/src/bibcheck/resolve/base.py +120 -0
- bibcheck_verify-0.1.1/src/bibcheck/resolve/crossref.py +45 -0
- bibcheck_verify-0.1.1/src/bibcheck/resolve/fuzzy_match.py +37 -0
- bibcheck_verify-0.1.1/src/bibcheck/resolve/http.py +32 -0
- bibcheck_verify-0.1.1/src/bibcheck/resolve/llm.py +173 -0
- bibcheck_verify-0.1.1/src/bibcheck/resolve/openalex.py +42 -0
- bibcheck_verify-0.1.1/tests/__init__.py +0 -0
- bibcheck_verify-0.1.1/tests/test_cache.py +14 -0
- bibcheck_verify-0.1.1/tests/test_graph_traverse.py +60 -0
- bibcheck_verify-0.1.1/tests/test_ingest_bibtex.py +24 -0
- bibcheck_verify-0.1.1/tests/test_ingest_text.py +48 -0
- bibcheck_verify-0.1.1/tests/test_llm.py +56 -0
- bibcheck_verify-0.1.1/tests/test_resolve_fuzzy_match.py +16 -0
- bibcheck_verify-0.1.1/tests/test_summary.py +65 -0
- bibcheck_verify-0.1.1/uv.lock +393 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Skill `bibcheck-verify`
|
|
2
|
+
|
|
3
|
+
This directory contains the integration for Hermes Agent, Claude Code, or compatible agents. The skill instructs the agent to extract metadata using the session model and invoke the Python `bibcheck` command.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
The skill and the Python package are separate components.
|
|
8
|
+
|
|
9
|
+
1. Install the `bibcheck-verify` package. It provides the `bibcheck-verify` command:
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
uv tool install bibcheck-verify
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Before publishing to PyPI, use `uv tool install <repository-path>`.
|
|
16
|
+
|
|
17
|
+
2. Copy the entire `bibcheck-verify` directory to the skills directory expected by your Hermes or Claude Code installation. The copied directory must contain `SKILL.md`.
|
|
18
|
+
|
|
19
|
+
3. Ask the agent to verify a PDF, Markdown, text, or BibTeX file.
|
|
20
|
+
|
|
21
|
+
Do not copy this directory expecting it to also contain the executable: the `bibcheck-verify` command must already be installed and available in the agent's PATH.
|
|
22
|
+
|
|
23
|
+
## API key
|
|
24
|
+
|
|
25
|
+
The skill mode does not require an API key for an LLM provider. The session model extracts the metadata; `bibcheck-verify` queries Crossref and OpenAlex.
|
|
26
|
+
|
|
27
|
+
API keys are required only when directly using the standalone command's LLM fallback with `--llm-provider`.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bibcheck-verify
|
|
3
|
+
description: Use when verifying a bibliography from PDF, Markdown, text, or BibTeX, especially when references lack DOI or reliable metadata. Extract metadata with the current session model, then run the installed bibcheck-verify command with Crossref and OpenAlex.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify bibliography with bibcheck-verify
|
|
7
|
+
|
|
8
|
+
Use the current session model to extract citation metadata, then use the installed `bibcheck-verify` command to verify those metadata against Crossref and OpenAlex.
|
|
9
|
+
|
|
10
|
+
The model extraction is a hypothesis. Crossref, OpenAlex and the local fuzzy match provide the verification evidence.
|
|
11
|
+
|
|
12
|
+
## Prerequisite
|
|
13
|
+
|
|
14
|
+
The user must have the `bibcheck-verify` command installed and available to the agent:
|
|
15
|
+
|
|
16
|
+
```powershell
|
|
17
|
+
uv tool install bibcheck-verify
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Before the package is published, the user can install it from a local clone of the repository with `uv tool install <repository-directory>`.
|
|
21
|
+
|
|
22
|
+
The skill itself does not contain the Python verifier. Do not use `uv run --project` with a path relative to this skill and do not assume that the repository is available after the skill has been copied to the agent's skills directory.
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
1. Ask for or identify the original bibliography file. It may be PDF, Markdown, text, or BibTeX.
|
|
27
|
+
2. Read the file and preserve citation order. The first citation has ID `"0"`.
|
|
28
|
+
3. For every citation, extract only metadata supported by the text:
|
|
29
|
+
- `title`: string or `""`;
|
|
30
|
+
- `authors`: array of strings;
|
|
31
|
+
- `year`: integer or `null`;
|
|
32
|
+
- `doi`: normalized DOI string or `null`;
|
|
33
|
+
- `venue`: string or `""`;
|
|
34
|
+
- `queries`: one or more useful search strings based only on extracted metadata.
|
|
35
|
+
4. Never invent authors, titles, years, venues or DOI values. Use empty values when a field is not supported by the citation.
|
|
36
|
+
5. Write a temporary JSON file outside the repository when possible:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"items": [
|
|
41
|
+
{
|
|
42
|
+
"reference_id": "0",
|
|
43
|
+
"title": "A Paper",
|
|
44
|
+
"authors": ["Jane Doe"],
|
|
45
|
+
"year": 2020,
|
|
46
|
+
"doi": null,
|
|
47
|
+
"venue": "Journal",
|
|
48
|
+
"queries": ["A Paper Jane Doe 2020"]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
There must be exactly one item per input citation, with sequential zero-based IDs.
|
|
55
|
+
6. Run the verifier against the original bibliography. Pass the metadata JSON only via `--metadata-file`:
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
bibcheck-verify verify "C:\Temp\references.txt" --metadata-file "C:\Temp\bibcheck_metadata.json"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Never use the metadata JSON as the positional input file. The verifier parses the original file to determine the number and order of references.
|
|
62
|
+
7. Read `summary.md` and, when needed, `graph.json` from the output directory. Report low-confidence and `suspected_hallucination` entries for manual review.
|
|
63
|
+
|
|
64
|
+
Use the user's requested options when provided. Do not pass `--llm-provider` in this workflow: the current session model already performed extraction.
|
|
65
|
+
|
|
66
|
+
## Important boundary
|
|
67
|
+
|
|
68
|
+
Never request, print, store, or add an API key to the metadata file or this skill.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Skill `bibcheck-verify`
|
|
2
|
+
|
|
3
|
+
This directory contains the integration for Hermes Agent, Claude Code, or compatible agents. The skill instructs the agent to extract metadata using the session model and invoke the Python `bibcheck-verify` command.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
The skill and the Python package are separate components.
|
|
8
|
+
|
|
9
|
+
1. Install the `bibcheck-verify` package. It provides the `bibcheck-verify` command:
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
uv tool install bibcheck-verify
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Before publishing to PyPI, use `uv tool install <repository-path>`.
|
|
16
|
+
|
|
17
|
+
2. Copy the entire `bibcheck-verify` directory to the skills directory expected by your Hermes or Claude Code installation. The copied directory must contain `SKILL.md`.
|
|
18
|
+
|
|
19
|
+
3. Ask the agent to verify a PDF, Markdown, text, or BibTeX file.
|
|
20
|
+
|
|
21
|
+
Do not copy this directory expecting it to also contain the executable: the `bibcheck-verify` command must already be installed and available in the agent's PATH.
|
|
22
|
+
|
|
23
|
+
## API key
|
|
24
|
+
|
|
25
|
+
The skill mode does not require an API key for an LLM provider. The session model extracts the metadata; `bibcheck-verify` queries Crossref and OpenAlex.
|
|
26
|
+
|
|
27
|
+
API keys are required only when directly using the standalone command's LLM fallback with `--llm-provider`.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bibcheck-verify
|
|
3
|
+
description: Use when verifying a bibliography from PDF, Markdown, text, or BibTeX, especially when references lack DOI or reliable metadata. Extract metadata with the current session model, then run the installed bibcheck-verify command with Crossref and OpenAlex.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify bibliography with bibcheck-verify
|
|
7
|
+
|
|
8
|
+
Use the current session model to extract citation metadata, then use the installed `bibcheck-verify` command to verify those metadata against Crossref and OpenAlex.
|
|
9
|
+
|
|
10
|
+
The model extraction is a hypothesis. Crossref, OpenAlex and the local fuzzy match provide the verification evidence.
|
|
11
|
+
|
|
12
|
+
## Prerequisite
|
|
13
|
+
|
|
14
|
+
The user must have the `bibcheck-verify` command installed and available to the agent:
|
|
15
|
+
|
|
16
|
+
```powershell
|
|
17
|
+
uv tool install bibcheck-verify
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Before the package is published, the user can install it from a local clone of the repository with `uv tool install <repository-directory>`.
|
|
21
|
+
|
|
22
|
+
The skill itself does not contain the Python verifier. Do not use `uv run --project` with a path relative to this skill and do not assume that the repository is available after the skill has been copied to the agent's skills directory.
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
1. Ask for or identify the original bibliography file. It may be PDF, Markdown, text, or BibTeX.
|
|
27
|
+
2. Read the file and preserve citation order. The first citation has ID `"0"`.
|
|
28
|
+
3. For every citation, extract only metadata supported by the text:
|
|
29
|
+
- `title`: string or `""`;
|
|
30
|
+
- `authors`: array of strings;
|
|
31
|
+
- `year`: integer or `null`;
|
|
32
|
+
- `doi`: normalized DOI string or `null`;
|
|
33
|
+
- `venue`: string or `""`;
|
|
34
|
+
- `queries`: one or more useful search strings based only on extracted metadata.
|
|
35
|
+
4. Never invent authors, titles, years, venues or DOI values. Use empty values when a field is not supported by the citation.
|
|
36
|
+
5. Write a temporary JSON file outside the repository when possible:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"items": [
|
|
41
|
+
{
|
|
42
|
+
"reference_id": "0",
|
|
43
|
+
"title": "A Paper",
|
|
44
|
+
"authors": ["Jane Doe"],
|
|
45
|
+
"year": 2020,
|
|
46
|
+
"doi": null,
|
|
47
|
+
"venue": "Journal",
|
|
48
|
+
"queries": ["A Paper Jane Doe 2020"]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
There must be exactly one item per input citation, with sequential zero-based IDs.
|
|
55
|
+
6. Run the verifier against the original bibliography. Pass the metadata JSON only via `--metadata-file`:
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
bibcheck-verify verify "C:\Temp\references.txt" --metadata-file "C:\Temp\bibcheck-verify_metadata.json"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Never use the metadata JSON as the positional input file. The verifier parses the original file to determine the number and order of references.
|
|
62
|
+
7. Read `summary.md` and, when needed, `graph.json` from the output directory. Report low-confidence and `suspected_hallucination` entries for manual review.
|
|
63
|
+
|
|
64
|
+
Use the user's requested options when provided. Do not pass `--llm-provider` in this workflow: the current session model already performed extraction.
|
|
65
|
+
|
|
66
|
+
## Important boundary
|
|
67
|
+
|
|
68
|
+
Never request, print, store, or add an API key to the metadata file or this skill.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
id-token: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.12"
|
|
20
|
+
|
|
21
|
+
- run: python -m pip install build
|
|
22
|
+
- run: python -m build
|
|
23
|
+
|
|
24
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.env
|
|
2
|
+
.env.*
|
|
3
|
+
!.env.example
|
|
4
|
+
.venv/
|
|
5
|
+
|
|
6
|
+
# Python environments and caches
|
|
7
|
+
__pycache__/
|
|
8
|
+
**/.venv/
|
|
9
|
+
.pytest_cache/
|
|
10
|
+
**/__pycache__/
|
|
11
|
+
*.py[cod]
|
|
12
|
+
.pytest_cache/
|
|
13
|
+
**/.pytest_cache/
|
|
14
|
+
.mypy_cache/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
.coverage
|
|
17
|
+
htmlcov/
|
|
18
|
+
|
|
19
|
+
# Build artifacts
|
|
20
|
+
build/
|
|
21
|
+
dist/
|
|
22
|
+
*.egg-info/
|
|
23
|
+
**/*.egg-info/
|
|
24
|
+
|
|
25
|
+
# Generated verifier data
|
|
26
|
+
bibcheck-verify-results/
|
|
27
|
+
**/bibcheck-verify-results/
|
|
28
|
+
bibcheck-verify-results*/
|
|
29
|
+
**/bibcheck-verify-results*/
|
|
30
|
+
bibcheck-results/
|
|
31
|
+
**/bibcheck-results/
|
|
32
|
+
bibcheck-results*/
|
|
33
|
+
**/bibcheck-results*/
|
|
34
|
+
|
|
35
|
+
# Editor and OS files
|
|
36
|
+
.DS_Store
|
|
37
|
+
Thumbs.db
|
|
38
|
+
.vscode/settings.json
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: bibcheck-verify
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Deterministic bibliography verification for scientific papers
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: bibtexparser<2,>=1.4
|
|
8
|
+
Requires-Dist: httpx<1,>=0.27
|
|
9
|
+
Requires-Dist: pymupdf<2,>=1.24
|
|
10
|
+
Requires-Dist: python-dotenv<2,>=1.0
|
|
11
|
+
Requires-Dist: rapidfuzz<4,>=3.9
|
|
12
|
+
Requires-Dist: typer<1,>=0.12
|
|
13
|
+
Provides-Extra: test
|
|
14
|
+
Requires-Dist: pytest<9,>=8; extra == 'test'
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# bibcheck-verify
|
|
18
|
+
|
|
19
|
+
`bibcheck-verify` is a tool for an initial reproducible check of scientific bibliographies. It compares each reference with metadata indexed by Crossref and OpenAlex and produces a report that helps identify strong matches, possible matches, and references that require manual review.
|
|
20
|
+
|
|
21
|
+
It does not determine on its own that a citation is fabricated. A reference may be correct but not indexed, or it may be written too incompletely to be recognized. The results are therefore a triage tool, not definitive proof.
|
|
22
|
+
|
|
23
|
+
## Why it exists
|
|
24
|
+
|
|
25
|
+
Real bibliographies often come from PDFs, copied text, or documents with missing DOIs and metadata. Checking them one entry at a time is slow; relying on a language model for the judgment, on the other hand, can introduce fabricated details.
|
|
26
|
+
|
|
27
|
+
`bibcheck-verify` separates these two problems: extracting incomplete metadata can be assisted by a model, while the existence and matching of a work are evaluated by querying external bibliographic sources and comparing the results. This makes both interactive verification with an agent and repeated processing of many bibliographies through scripts, caching, and request limits possible.
|
|
28
|
+
|
|
29
|
+
### Why this matters
|
|
30
|
+
|
|
31
|
+
The scale of the problem is illustrated by a 2026 audit published in [The Lancet](https://www.thelancet.com/journals/lancet/article/PIIS0140-6736(26)00603-3/fulltext). The audit examined 2,471,758 biomedical papers published between January 1, 2023, and February 18, 2026, containing 125,615,773 structured references. Of these references, 97.1 million (77%) carried a PMID and were checked against bibliographic records; references to websites, books, and other grey literature were mostly excluded.
|
|
32
|
+
|
|
33
|
+
The authors identified 4,046 fabricated references across 2,810 papers. The reported rate increased from approximately one paper in 2,828 in 2023 to one in 458 in 2025, and one in 277 during the first seven weeks of 2026. The fabrication rate rose from about 4 per 10,000 papers in 2023 to 51.3 per 10,000 papers in the fourth quarter of 2025, reaching 56.9 per 10,000 papers in early 2026.
|
|
34
|
+
|
|
35
|
+
Their system compared claimed reference metadata with records from PubMed and Crossref, then used automated filters, an LLM review step, and additional checks against OpenAlex and Google Scholar. In a masked validation of 500 entries, the system had a reported precision of 91% (Fleiss’ κ = 0.71); the authors explicitly note that this estimates precision, not recall. The study also distinguishes fabricated references from reference errors, such as abbreviated titles that still correspond to a real publication.
|
|
36
|
+
|
|
37
|
+
This is the problem `bibcheck-verify` is intended to make easier to investigate at a smaller and inspectable scale: verify references against external records, preserve the queries and evidence, and send uncertain cases to human review. Its results should not be interpreted as a replication of the Lancet audit or as definitive proof that an unmatched reference is fabricated.
|
|
38
|
+
|
|
39
|
+
## Two ways to use the project
|
|
40
|
+
|
|
41
|
+
The repository contains two related but distinct components:
|
|
42
|
+
|
|
43
|
+
1. **The standalone Python package**: the `bibcheck-verify` program can be used from a terminal, script, or pipeline to check many bibliographies. It can also use an LLM provider through an API key as a fallback for extracting missing metadata.
|
|
44
|
+
2. **The `bibcheck-verify` skill**: instructions for Hermes Agent, Claude Code, or compatible agents. The agent uses the session model to extract metadata, without a separate LLM API key, and then delegates verification to the Python `bibcheck-verify` command.
|
|
45
|
+
|
|
46
|
+
The skill does not contain a copy of the program. To use it, first install the Python package and then copy the `.github/skills/bibcheck-verify/` directory to the agent’s local skills directory.
|
|
47
|
+
|
|
48
|
+
## Package installation
|
|
49
|
+
|
|
50
|
+
Requirements:
|
|
51
|
+
|
|
52
|
+
- Python 3.11 o successivo;
|
|
53
|
+
- [`uv`](https://docs.astral.sh/uv/).
|
|
54
|
+
|
|
55
|
+
### From the repository
|
|
56
|
+
|
|
57
|
+
This is the useful mode during development or before publishing to PyPI:
|
|
58
|
+
|
|
59
|
+
```powershell
|
|
60
|
+
uv tool install .
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
To update the installation after a local change:
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
uv tool install --force .
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Alternatively, to use the project without installing it globally:
|
|
70
|
+
|
|
71
|
+
```powershell
|
|
72
|
+
uv run bibcheck-verify verify references.bib
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### From PyPI
|
|
76
|
+
|
|
77
|
+
Once the package is published, installation will not require downloading the repository:
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
uv tool install bibcheck-verify
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For a single temporary run:
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
uvx bibcheck-verify verify references.bib
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
PyPI distributes the code and dependencies. It does not automatically receive the user’s bibliographies, reports, or API keys.
|
|
90
|
+
|
|
91
|
+
## Standalone usage
|
|
92
|
+
|
|
93
|
+
The command accepts BibTeX, PDF, Markdown, and plain text:
|
|
94
|
+
|
|
95
|
+
```powershell
|
|
96
|
+
bibcheck-verify verify references.bib
|
|
97
|
+
bibcheck-verify verify article.pdf
|
|
98
|
+
bibcheck-verify verify references.md --output-dir risultati
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The format is recognized from the extension:
|
|
102
|
+
|
|
103
|
+
- `.bib`: title, authors, year, DOI, journal, or proceedings are extracted;
|
|
104
|
+
- `.pdf`: text is extracted with PyMuPDF;
|
|
105
|
+
- other extensions: the file is treated as text or Markdown.
|
|
106
|
+
|
|
107
|
+
For text and Markdown, the parser looks for a `References`, `Bibliography`, or `Bibliografia` section. If it does not find one, it tries to interpret the entire file as a bibliography. PDF parsing is best effort; whenever possible, a BibTeX file produces more predictable results.
|
|
108
|
+
|
|
109
|
+
To see all options:
|
|
110
|
+
|
|
111
|
+
```powershell
|
|
112
|
+
bibcheck-verify --help
|
|
113
|
+
bibcheck-verify verify --help
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Example with the main options:
|
|
117
|
+
|
|
118
|
+
```powershell
|
|
119
|
+
bibcheck-verify verify references.bib `
|
|
120
|
+
--depth 1 `
|
|
121
|
+
--sources openalex,crossref `
|
|
122
|
+
--confidence-threshold 0.85 `
|
|
123
|
+
--max-requests 2000 `
|
|
124
|
+
--output-dir risultati `
|
|
125
|
+
--mailto nome@example.org
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`--depth 0` checks only the provided references. With higher values, it can follow works cited by the verified publications and build a larger graph.
|
|
129
|
+
|
|
130
|
+
## Usage with a skill
|
|
131
|
+
|
|
132
|
+
The skill is located in [.github/skills/bibcheck-verify](.github/skills/bibcheck-verify). To install it:
|
|
133
|
+
|
|
134
|
+
1. install the `bibcheck-verify` command, from the repository with `uv tool install .` or from PyPI with `uv tool install bibcheck-verify` once it is available;
|
|
135
|
+
2. copy the entire `.github/skills/bibcheck-verify/` directory to the skills directory supported by your Hermes Agent or Claude Code installation;
|
|
136
|
+
3. ask the agent to verify a PDF, Markdown, text, or BibTeX file.
|
|
137
|
+
|
|
138
|
+
The session model reads the bibliography and creates a temporary file with the title, authors, year, DOI, journal, and search query. The `bibcheck-verify` command reads the original file, applies that metadata, and queries Crossref and OpenAlex. The model proposes metadata; it does not decide whether a publication exists.
|
|
139
|
+
|
|
140
|
+
This mode does not require `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, or `GEMINI_API_KEY`. It does require network access to the bibliographic sources, and the `bibcheck-verify` command must be available in the agent’s PATH.
|
|
141
|
+
|
|
142
|
+
## API keys and LLM fallback
|
|
143
|
+
|
|
144
|
+
Standalone usage can ask the program to extract incomplete metadata through an LLM provider. This is an optional fallback and does not replace verification against Crossref/OpenAlex.
|
|
145
|
+
|
|
146
|
+
```powershell
|
|
147
|
+
$env:OPENAI_API_KEY = "..."
|
|
148
|
+
bibcheck-verify verify references.md --llm-provider openai
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The `openai`, `anthropic`, and `gemini` providers are supported. Keys must remain in environment variables or a local `.env` file, never in the repository, reports, or metadata JSON file.
|
|
152
|
+
|
|
153
|
+
## Results
|
|
154
|
+
|
|
155
|
+
The output directory `bibcheck-verify-results` contains:
|
|
156
|
+
|
|
157
|
+
- `summary.md`: readable report for manual review;
|
|
158
|
+
- `graph.json`: complete details, queries, sources, nodes, edges, and confidence;
|
|
159
|
+
- `cache.sqlite3`: local resolution cache.
|
|
160
|
+
|
|
161
|
+
The main statuses are:
|
|
162
|
+
|
|
163
|
+
- `verified`: verified match, including through an exact DOI;
|
|
164
|
+
- `verified_fuzzy`: match accepted by fuzzy comparison;
|
|
165
|
+
- `low_confidence`: possible match that is not sufficiently strong;
|
|
166
|
+
- `suspected_hallucination`: no match found in the consulted sources.
|
|
167
|
+
|
|
168
|
+
`suspected_hallucination` is a triage label, not proof that the reference is fabricated. All uncertain cases require human review.
|
|
169
|
+
|
|
170
|
+
## Project structure
|
|
171
|
+
|
|
172
|
+
```text
|
|
173
|
+
bibcheck-verify/
|
|
174
|
+
├── src/bibcheck/ # Internal Python module for the bibcheck-verify command
|
|
175
|
+
│ ├── cli.py # `bibcheck-verify` commands and options
|
|
176
|
+
│ ├── ingest/ # BibTeX, PDF, and text parsers
|
|
177
|
+
│ ├── resolve/ # Crossref, OpenAlex, fuzzy matching, and optional LLM
|
|
178
|
+
│ ├── graph/ # citation graph cache and traversal
|
|
179
|
+
│ └── report/ # Markdown and JSON output
|
|
180
|
+
├── tests/ # automated package tests
|
|
181
|
+
├── .github/skills/bibcheck-verify/ # skill for compatible agents
|
|
182
|
+
│ ├── SKILL.md # agent operating instructions
|
|
183
|
+
│ └── README.md # manual skill installation
|
|
184
|
+
├── pyproject.toml # metadata, dependencies, and console command
|
|
185
|
+
├── uv.lock # locked dependency versions
|
|
186
|
+
├── .env.example # local LLM configuration example
|
|
187
|
+
└── README.md # this guide
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The `bibcheck-verify-results*` directories are results from local runs and are not part of the distributed package.
|
|
191
|
+
|
|
192
|
+
## Development and testing
|
|
193
|
+
|
|
194
|
+
To prepare the repository environment:
|
|
195
|
+
|
|
196
|
+
```powershell
|
|
197
|
+
uv sync --extra test
|
|
198
|
+
uv run python -m pytest
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The distributable package is built with:
|
|
202
|
+
|
|
203
|
+
```powershell
|
|
204
|
+
uv build
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Artifacts are created in `dist/`. Before publishing to PyPI, it is advisable to check the wheel contents and test it in a clean environment or on TestPyPI.
|
|
208
|
+
|
|
209
|
+
## Publishing to PyPI
|
|
210
|
+
|
|
211
|
+
Publishing is optional and is not required to use the project locally. In summary:
|
|
212
|
+
|
|
213
|
+
1. create an account on PyPI and, preferably, a project-scoped token;
|
|
214
|
+
2. run `uv build`;
|
|
215
|
+
3. check the artifacts in `dist/`;
|
|
216
|
+
4. upload to TestPyPI first;
|
|
217
|
+
5. upload to PyPI using the token, without saving it in versioned files.
|
|
218
|
+
|
|
219
|
+
The `bibcheck-verify` distribution name must be available on PyPI. The installed package provides the `bibcheck-verify` command. The actual upload requires the owner’s credentials and is not performed by this repository.
|
|
220
|
+
|
|
221
|
+
## Limitations
|
|
222
|
+
|
|
223
|
+
- verification requires network access;
|
|
224
|
+
- Crossref and OpenAlex may have incomplete or differing data;
|
|
225
|
+
- the request limit may produce a partial result;
|
|
226
|
+
- the cache may reuse previous resolutions;
|
|
227
|
+
- no result replaces review of the original bibliography.
|