ghostcite 0.6.2__tar.gz → 0.6.4__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.
- {ghostcite-0.6.2 → ghostcite-0.6.4}/CHANGELOG.md +22 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/CITATION.cff +2 -2
- {ghostcite-0.6.2 → ghostcite-0.6.4}/PKG-INFO +24 -21
- {ghostcite-0.6.2 → ghostcite-0.6.4}/README.md +23 -20
- {ghostcite-0.6.2 → ghostcite-0.6.4}/pyproject.toml +1 -1
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/__init__.py +1 -1
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/parsers/bibtex.py +5 -1
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_bibtex.py +61 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_document_live.py +5 -4
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_probe_live.py +1 -1
- {ghostcite-0.6.2 → ghostcite-0.6.4}/.gitignore +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/LICENSE +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/NOTICE +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/examples/README.md +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/__main__.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/_pace.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/api.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/cache.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/cli.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/compare.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/crossref.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/models.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/openalex.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/parsers/__init__.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/parsers/document.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/parsers/doi.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/parsers/markdown.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/pubmed.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/py.typed +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/report.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/retractions.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/semantic/__init__.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/semantic/backends.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/src/ghostcite/semantic/support.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/__init__.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/conftest.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/data/crossref_years/10.1073_pnas.0904649106.json +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/data/crossref_years/10.1093_molbev_msl150.json +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/data/crossref_years/10.1142_9789814447362_0053.json +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_api.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_api_semantic.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_badge.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_cache.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_cache_abstract.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_cli.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_cli_semantic.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_color.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_compare.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_compare_source.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_cross_check.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_crossref.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_crossref_abstract.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_document.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_doi.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_doi_probe.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_markdown.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_models.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_models_semantic.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_openalex.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_openalex_live.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_pacer.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_packaging.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_preprint.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_pubmed.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_report.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_report_semantic.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_retractions.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_retractions_live.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_search_gate.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_semantic_backends.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_semantic_live.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_semantic_support.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_sniff.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_title_tier.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_venue.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_year_evidence.py +0 -0
- {ghostcite-0.6.2 → ghostcite-0.6.4}/tests/test_year_online_first.py +0 -0
|
@@ -6,6 +6,28 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.6.4] - 2026-09-26
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
- README corrections: ghostcite uses CrossRef's public pool (descriptive
|
|
14
|
+
`User-Agent`, no email), not the polite pool; Tier A also covers a claimed
|
|
15
|
+
author listed at another position; Tier V is always reported and fails CI only
|
|
16
|
+
with `--fail-on venue`; the claim-support layer runs from `--claims`; the
|
|
17
|
+
related-work comparison no longer says every LLM-based checker needs a GPU or
|
|
18
|
+
that ghostcite is sub-second; the pre-commit example pins the current tag.
|
|
19
|
+
|
|
20
|
+
## [0.6.3] - 2026-09-25
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- **Parsing a BibTeX file was quadratic in its number of entries.** Each entry's
|
|
25
|
+
line number was found by rescanning the file from the top, so 1,000 entries
|
|
26
|
+
took 46 ms, 4,000 took 0.61 s and 16,000 took 10.5 s. Line numbers are now
|
|
27
|
+
counted forward from the previous entry (16,000 entries: 0.43 s). A test
|
|
28
|
+
counts the characters the parser reads, so a return to the rescan fails on
|
|
29
|
+
every machine rather than only on a slow one.
|
|
30
|
+
|
|
9
31
|
## [0.6.2] - 2026-09-18
|
|
10
32
|
|
|
11
33
|
### Fixed
|
|
@@ -23,8 +23,8 @@ identifiers:
|
|
|
23
23
|
repository-code: "https://github.com/musharna/ghostcite"
|
|
24
24
|
url: "https://pypi.org/project/ghostcite/"
|
|
25
25
|
license: MIT
|
|
26
|
-
version: 0.6.
|
|
27
|
-
date-released: "2026-09-
|
|
26
|
+
version: 0.6.4
|
|
27
|
+
date-released: "2026-09-26"
|
|
28
28
|
keywords:
|
|
29
29
|
- citations
|
|
30
30
|
- crossref
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: ghostcite
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.4
|
|
4
4
|
Summary: Catch ghost citations — cross-check a bibliography's claimed author/year against CrossRef
|
|
5
5
|
Project-URL: Homepage, https://github.com/musharna/ghostcite
|
|
6
6
|
Project-URL: Repository, https://github.com/musharna/ghostcite
|
|
@@ -56,7 +56,7 @@ Description-Content-Type: text/markdown
|
|
|
56
56
|
|
|
57
57
|
`ghostcite` is a deterministic, **no-LLM** command-line tool that cross-checks a
|
|
58
58
|
bibliography's _claimed_ author and year against CrossRef's canonical record for
|
|
59
|
-
each DOI. It catches
|
|
59
|
+
each DOI. It catches a common ghost-citation failure mode — a reference whose
|
|
60
60
|
cited authorship doesn't match the paper the DOI actually points to — and flags
|
|
61
61
|
retracted or expression-of-concern works along the way.
|
|
62
62
|
|
|
@@ -70,8 +70,9 @@ manuscript cites "Li et al. 2024," but DOI `10.3390/plants13060869` is actually
|
|
|
70
70
|
> Does the metadata you wrote for this citation match what CrossRef says the DOI actually is?
|
|
71
71
|
|
|
72
72
|
No model, no API key, **no GPU**, no download — just CrossRef's REST API and a
|
|
73
|
-
comparison. It runs
|
|
74
|
-
|
|
73
|
+
comparison. It runs on any CI runner. Of the LLM-based checkers, sciwrite-lint
|
|
74
|
+
needs a local GPU and RefChecker calls cloud LLM APIs by default (see
|
|
75
|
+
[Related work](#related-work--faq)).
|
|
75
76
|
|
|
76
77
|
## Install
|
|
77
78
|
|
|
@@ -109,6 +110,7 @@ with no text layer yields no entries, and says so.
|
|
|
109
110
|
```text
|
|
110
111
|
$ ghostcite refs.bib
|
|
111
112
|
ghostcite: 1 entries, 1 with DOIs
|
|
113
|
+
retractions: CrossRef live
|
|
112
114
|
✗ A L1 Li (2024) → DOI resolves to Chen (2024) — possibly wrong DOI [10.3390/plants13060869]
|
|
113
115
|
1 A
|
|
114
116
|
$ echo $?
|
|
@@ -188,21 +190,21 @@ No language model is involved at any step. ghostcite resolves each DOI at CrossR
|
|
|
188
190
|
(and optionally PubMed), then does a pure, deterministic comparison of the claimed
|
|
189
191
|
first-author surname (Unicode-folded, punctuation-stripped) and year against the
|
|
190
192
|
canonical record, plus a retraction / expression-of-concern check. Only the HTTP
|
|
191
|
-
client touches the network
|
|
192
|
-
with the project URL
|
|
193
|
+
client touches the network. It uses CrossRef's public pool, sending a descriptive
|
|
194
|
+
`User-Agent` with the project URL and no email address.
|
|
193
195
|
|
|
194
196
|
<details>
|
|
195
197
|
<summary><b>Severity tiers, input formats & exit codes</b></summary>
|
|
196
198
|
|
|
197
199
|
| Tier | Meaning | Fails CI? |
|
|
198
200
|
| ------ | --------------------------------------------------------------------------------------------------- | ------------------------------- |
|
|
199
|
-
| **A** | author-mismatch — claimed first author isn't
|
|
201
|
+
| **A** | author-mismatch — claimed first author isn't CrossRef's first author (absent from the byline, or listed at another position) | Yes |
|
|
200
202
|
| **T** | title-mismatch — DOI resolves to a different paper (identifier hijack) | Yes |
|
|
201
203
|
| **B** | year-mismatch — author matches, claimed year differs | Yes |
|
|
202
204
|
| **C** | cosmetic — matches only after diacritic/initials fold (Bürger≈Burger); also a cited year CrossRef has no record to check (preprint variant, online date with no print date, container named for the year) | No (info) |
|
|
203
205
|
| **R** | retraction / expression-of-concern per CrossRef | Yes (fires regardless of A/B/C) |
|
|
204
206
|
| **U** | unresolvable — DOI 404s, or no-DOI entry search was inconclusive | No (warn) |
|
|
205
|
-
| **V** | venue-mismatch — cited journal/venue differs from CrossRef's record (
|
|
207
|
+
| **V** | venue-mismatch — cited journal/venue differs from CrossRef's record (abbreviation-tolerant; always reported) | Only with `--fail-on venue` |
|
|
206
208
|
| **OK** | first author + year match | — |
|
|
207
209
|
|
|
208
210
|
Tier **T** catches "identifier hijacking": the DOI resolves, but to a _different
|
|
@@ -249,7 +251,7 @@ Drop in the composite **GitHub Action**:
|
|
|
249
251
|
```yaml
|
|
250
252
|
repos:
|
|
251
253
|
- repo: https://github.com/musharna/ghostcite
|
|
252
|
-
rev: v0.4
|
|
254
|
+
rev: v0.6.4
|
|
253
255
|
hooks:
|
|
254
256
|
- id: ghostcite
|
|
255
257
|
# Staged .bib/.md files are appended automatically; args carries flags only.
|
|
@@ -262,8 +264,7 @@ exit, blocking the merge or commit before submission.
|
|
|
262
264
|
### Offline / reproducible retractions
|
|
263
265
|
|
|
264
266
|
By default ghostcite reads retraction status from CrossRef live. For a
|
|
265
|
-
**deterministic, byte-reproducible** retraction check
|
|
266
|
-
CrossRef's own flags — point it at a
|
|
267
|
+
**deterministic, byte-reproducible** retraction check, point it at a
|
|
267
268
|
[Retraction Watch](https://www.crossref.org/labs/retraction-watch/) snapshot:
|
|
268
269
|
|
|
269
270
|
```bash
|
|
@@ -301,8 +302,10 @@ abstract-grounded and marked non-deterministic; they never fail CI unless you ad
|
|
|
301
302
|
|
|
302
303
|
`ghostcite`'s deterministic core checks **metadata correctness** (does the DOI's
|
|
303
304
|
record match what you wrote), not deep claim support. It _does_ offer an **opt-in,
|
|
304
|
-
abstract-grounded** claim-support check (`--
|
|
305
|
-
still no local GPU — see above
|
|
305
|
+
abstract-grounded** claim-support check (`--claims claims.json` with a
|
|
306
|
+
bring-your-own LLM backend, still no local GPU — see above; `--semantic` on a
|
|
307
|
+
bibliography without `--claims` only prints a warning), but that stays
|
|
308
|
+
intentionally lightweight:
|
|
306
309
|
full-text entailment, internal-consistency, statistics, and figure checks are a
|
|
307
310
|
heavier, GPU-bound concern best served by
|
|
308
311
|
[**sciwrite-lint**](#related-work--faq). ghostcite deliberately stays on the
|
|
@@ -334,16 +337,16 @@ does no auto-fixing and no citation-style linting. CrossRef is the source of tru
|
|
|
334
337
|
ghostcite's niche is **deterministic, no-GPU, CLI-first** checking focused on the
|
|
335
338
|
**byline-mismatch** failure mode (right DOI, wrong author/year) plus **retraction**
|
|
336
339
|
flagging — built to run unattended, in seconds, on any CI runner. Its core never
|
|
337
|
-
calls an LLM (an opt-in `--
|
|
338
|
-
a bring-your-own backend). The
|
|
339
|
-
|
|
340
|
-
minutes-to-tens-of-minutes per paper;
|
|
341
|
-
on every commit.
|
|
340
|
+
calls an LLM (an opt-in `--claims` layer adds abstract-grounded claim support via
|
|
341
|
+
a bring-your-own backend). The LLM-based tools below verify _more_: sciwrite-lint
|
|
342
|
+
checks full-text claim support and internal consistency but needs a local GPU and
|
|
343
|
+
minutes-to-tens-of-minutes per paper; RefChecker uses cloud LLM APIs by default.
|
|
344
|
+
ghostcite is the lightweight gate you can run on every commit.
|
|
342
345
|
|
|
343
346
|
| Tool | What it does | How ghostcite differs |
|
|
344
347
|
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
345
|
-
| [sciwrite-lint](https://github.com/authentic-research-partners/sciwrite-lint) ([arXiv 2604.08501](https://arxiv.org/abs/2604.08501)) | Local-LLM scientific-writing linter — byline + retraction **plus** full-text claim-support entailment, internal-consistency, stats, and figure checks | a capability superset, but needs an NVIDIA GPU (16 GB+) and runs minutes-to-30 min/paper; ghostcite is no-GPU, deterministic,
|
|
346
|
-
| [RefChecker](https://github.com/markrussinovich/refchecker) |
|
|
348
|
+
| [sciwrite-lint](https://github.com/authentic-research-partners/sciwrite-lint) ([arXiv 2604.08501](https://arxiv.org/abs/2604.08501)) | Local-LLM scientific-writing linter — byline + retraction **plus** full-text claim-support entailment, internal-consistency, stats, and figure checks | a capability superset, but needs an NVIDIA GPU (16 GB+) and runs minutes-to-30 min/paper; ghostcite is no-GPU, deterministic, and CI-native (network-bound: at most about 5 CrossRef requests/s on the public pool) — its `--claims` check is abstract-only and backend-optional. **Complementary:** ghostcite gates every commit, sciwrite-lint deep-audits before submission |
|
|
349
|
+
| [RefChecker](https://github.com/markrussinovich/refchecker) | Web-search reference validator, LLM-assisted by default (has a `--no-llm` mode) | ghostcite never calls an LLM in its core checks and needs no model or API key |
|
|
347
350
|
| claude-skill-citation-checker | A Claude Code skill for an LLM agent | ghostcite is a standalone CLI + Action — no agent or LLM host needed |
|
|
348
351
|
| [BibTeX Verifier](https://merfanian.github.io/Bibtex-Verifier/) | In-browser BibTeX checker | ghostcite is scriptable from the CLI and also flags retractions |
|
|
349
352
|
| [CERCA](https://github.com/lidianycs/cerca) | Java / AGPL citation checker | ghostcite is Python / MIT / `pip install`-able |
|
|
@@ -353,7 +356,7 @@ on every commit.
|
|
|
353
356
|
**Does it call an LLM?** Not by default. The core byline / year / retraction checks
|
|
354
357
|
are a deterministic comparison of the metadata you wrote against CrossRef's (and
|
|
355
358
|
optionally PubMed's) canonical record — no model, no prompt, no API key. Only the
|
|
356
|
-
opt-in `--
|
|
359
|
+
opt-in `--claims` claim-support layer calls an LLM, and only through a
|
|
357
360
|
bring-your-own backend you configure.
|
|
358
361
|
|
|
359
362
|
**Will it hit rate limits?** It self-throttles to CrossRef's advertised rate limit
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
`ghostcite` is a deterministic, **no-LLM** command-line tool that cross-checks a
|
|
16
16
|
bibliography's _claimed_ author and year against CrossRef's canonical record for
|
|
17
|
-
each DOI. It catches
|
|
17
|
+
each DOI. It catches a common ghost-citation failure mode — a reference whose
|
|
18
18
|
cited authorship doesn't match the paper the DOI actually points to — and flags
|
|
19
19
|
retracted or expression-of-concern works along the way.
|
|
20
20
|
|
|
@@ -28,8 +28,9 @@ manuscript cites "Li et al. 2024," but DOI `10.3390/plants13060869` is actually
|
|
|
28
28
|
> Does the metadata you wrote for this citation match what CrossRef says the DOI actually is?
|
|
29
29
|
|
|
30
30
|
No model, no API key, **no GPU**, no download — just CrossRef's REST API and a
|
|
31
|
-
comparison. It runs
|
|
32
|
-
|
|
31
|
+
comparison. It runs on any CI runner. Of the LLM-based checkers, sciwrite-lint
|
|
32
|
+
needs a local GPU and RefChecker calls cloud LLM APIs by default (see
|
|
33
|
+
[Related work](#related-work--faq)).
|
|
33
34
|
|
|
34
35
|
## Install
|
|
35
36
|
|
|
@@ -67,6 +68,7 @@ with no text layer yields no entries, and says so.
|
|
|
67
68
|
```text
|
|
68
69
|
$ ghostcite refs.bib
|
|
69
70
|
ghostcite: 1 entries, 1 with DOIs
|
|
71
|
+
retractions: CrossRef live
|
|
70
72
|
✗ A L1 Li (2024) → DOI resolves to Chen (2024) — possibly wrong DOI [10.3390/plants13060869]
|
|
71
73
|
1 A
|
|
72
74
|
$ echo $?
|
|
@@ -146,21 +148,21 @@ No language model is involved at any step. ghostcite resolves each DOI at CrossR
|
|
|
146
148
|
(and optionally PubMed), then does a pure, deterministic comparison of the claimed
|
|
147
149
|
first-author surname (Unicode-folded, punctuation-stripped) and year against the
|
|
148
150
|
canonical record, plus a retraction / expression-of-concern check. Only the HTTP
|
|
149
|
-
client touches the network
|
|
150
|
-
with the project URL
|
|
151
|
+
client touches the network. It uses CrossRef's public pool, sending a descriptive
|
|
152
|
+
`User-Agent` with the project URL and no email address.
|
|
151
153
|
|
|
152
154
|
<details>
|
|
153
155
|
<summary><b>Severity tiers, input formats & exit codes</b></summary>
|
|
154
156
|
|
|
155
157
|
| Tier | Meaning | Fails CI? |
|
|
156
158
|
| ------ | --------------------------------------------------------------------------------------------------- | ------------------------------- |
|
|
157
|
-
| **A** | author-mismatch — claimed first author isn't
|
|
159
|
+
| **A** | author-mismatch — claimed first author isn't CrossRef's first author (absent from the byline, or listed at another position) | Yes |
|
|
158
160
|
| **T** | title-mismatch — DOI resolves to a different paper (identifier hijack) | Yes |
|
|
159
161
|
| **B** | year-mismatch — author matches, claimed year differs | Yes |
|
|
160
162
|
| **C** | cosmetic — matches only after diacritic/initials fold (Bürger≈Burger); also a cited year CrossRef has no record to check (preprint variant, online date with no print date, container named for the year) | No (info) |
|
|
161
163
|
| **R** | retraction / expression-of-concern per CrossRef | Yes (fires regardless of A/B/C) |
|
|
162
164
|
| **U** | unresolvable — DOI 404s, or no-DOI entry search was inconclusive | No (warn) |
|
|
163
|
-
| **V** | venue-mismatch — cited journal/venue differs from CrossRef's record (
|
|
165
|
+
| **V** | venue-mismatch — cited journal/venue differs from CrossRef's record (abbreviation-tolerant; always reported) | Only with `--fail-on venue` |
|
|
164
166
|
| **OK** | first author + year match | — |
|
|
165
167
|
|
|
166
168
|
Tier **T** catches "identifier hijacking": the DOI resolves, but to a _different
|
|
@@ -207,7 +209,7 @@ Drop in the composite **GitHub Action**:
|
|
|
207
209
|
```yaml
|
|
208
210
|
repos:
|
|
209
211
|
- repo: https://github.com/musharna/ghostcite
|
|
210
|
-
rev: v0.4
|
|
212
|
+
rev: v0.6.4
|
|
211
213
|
hooks:
|
|
212
214
|
- id: ghostcite
|
|
213
215
|
# Staged .bib/.md files are appended automatically; args carries flags only.
|
|
@@ -220,8 +222,7 @@ exit, blocking the merge or commit before submission.
|
|
|
220
222
|
### Offline / reproducible retractions
|
|
221
223
|
|
|
222
224
|
By default ghostcite reads retraction status from CrossRef live. For a
|
|
223
|
-
**deterministic, byte-reproducible** retraction check
|
|
224
|
-
CrossRef's own flags — point it at a
|
|
225
|
+
**deterministic, byte-reproducible** retraction check, point it at a
|
|
225
226
|
[Retraction Watch](https://www.crossref.org/labs/retraction-watch/) snapshot:
|
|
226
227
|
|
|
227
228
|
```bash
|
|
@@ -259,8 +260,10 @@ abstract-grounded and marked non-deterministic; they never fail CI unless you ad
|
|
|
259
260
|
|
|
260
261
|
`ghostcite`'s deterministic core checks **metadata correctness** (does the DOI's
|
|
261
262
|
record match what you wrote), not deep claim support. It _does_ offer an **opt-in,
|
|
262
|
-
abstract-grounded** claim-support check (`--
|
|
263
|
-
still no local GPU — see above
|
|
263
|
+
abstract-grounded** claim-support check (`--claims claims.json` with a
|
|
264
|
+
bring-your-own LLM backend, still no local GPU — see above; `--semantic` on a
|
|
265
|
+
bibliography without `--claims` only prints a warning), but that stays
|
|
266
|
+
intentionally lightweight:
|
|
264
267
|
full-text entailment, internal-consistency, statistics, and figure checks are a
|
|
265
268
|
heavier, GPU-bound concern best served by
|
|
266
269
|
[**sciwrite-lint**](#related-work--faq). ghostcite deliberately stays on the
|
|
@@ -292,16 +295,16 @@ does no auto-fixing and no citation-style linting. CrossRef is the source of tru
|
|
|
292
295
|
ghostcite's niche is **deterministic, no-GPU, CLI-first** checking focused on the
|
|
293
296
|
**byline-mismatch** failure mode (right DOI, wrong author/year) plus **retraction**
|
|
294
297
|
flagging — built to run unattended, in seconds, on any CI runner. Its core never
|
|
295
|
-
calls an LLM (an opt-in `--
|
|
296
|
-
a bring-your-own backend). The
|
|
297
|
-
|
|
298
|
-
minutes-to-tens-of-minutes per paper;
|
|
299
|
-
on every commit.
|
|
298
|
+
calls an LLM (an opt-in `--claims` layer adds abstract-grounded claim support via
|
|
299
|
+
a bring-your-own backend). The LLM-based tools below verify _more_: sciwrite-lint
|
|
300
|
+
checks full-text claim support and internal consistency but needs a local GPU and
|
|
301
|
+
minutes-to-tens-of-minutes per paper; RefChecker uses cloud LLM APIs by default.
|
|
302
|
+
ghostcite is the lightweight gate you can run on every commit.
|
|
300
303
|
|
|
301
304
|
| Tool | What it does | How ghostcite differs |
|
|
302
305
|
| ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
303
|
-
| [sciwrite-lint](https://github.com/authentic-research-partners/sciwrite-lint) ([arXiv 2604.08501](https://arxiv.org/abs/2604.08501)) | Local-LLM scientific-writing linter — byline + retraction **plus** full-text claim-support entailment, internal-consistency, stats, and figure checks | a capability superset, but needs an NVIDIA GPU (16 GB+) and runs minutes-to-30 min/paper; ghostcite is no-GPU, deterministic,
|
|
304
|
-
| [RefChecker](https://github.com/markrussinovich/refchecker) |
|
|
306
|
+
| [sciwrite-lint](https://github.com/authentic-research-partners/sciwrite-lint) ([arXiv 2604.08501](https://arxiv.org/abs/2604.08501)) | Local-LLM scientific-writing linter — byline + retraction **plus** full-text claim-support entailment, internal-consistency, stats, and figure checks | a capability superset, but needs an NVIDIA GPU (16 GB+) and runs minutes-to-30 min/paper; ghostcite is no-GPU, deterministic, and CI-native (network-bound: at most about 5 CrossRef requests/s on the public pool) — its `--claims` check is abstract-only and backend-optional. **Complementary:** ghostcite gates every commit, sciwrite-lint deep-audits before submission |
|
|
307
|
+
| [RefChecker](https://github.com/markrussinovich/refchecker) | Web-search reference validator, LLM-assisted by default (has a `--no-llm` mode) | ghostcite never calls an LLM in its core checks and needs no model or API key |
|
|
305
308
|
| claude-skill-citation-checker | A Claude Code skill for an LLM agent | ghostcite is a standalone CLI + Action — no agent or LLM host needed |
|
|
306
309
|
| [BibTeX Verifier](https://merfanian.github.io/Bibtex-Verifier/) | In-browser BibTeX checker | ghostcite is scriptable from the CLI and also flags retractions |
|
|
307
310
|
| [CERCA](https://github.com/lidianycs/cerca) | Java / AGPL citation checker | ghostcite is Python / MIT / `pip install`-able |
|
|
@@ -311,7 +314,7 @@ on every commit.
|
|
|
311
314
|
**Does it call an LLM?** Not by default. The core byline / year / retraction checks
|
|
312
315
|
are a deterministic comparison of the metadata you wrote against CrossRef's (and
|
|
313
316
|
optionally PubMed's) canonical record — no model, no prompt, no API key. Only the
|
|
314
|
-
opt-in `--
|
|
317
|
+
opt-in `--claims` claim-support layer calls an LLM, and only through a
|
|
315
318
|
bring-your-own backend you configure.
|
|
316
319
|
|
|
317
320
|
**Will it hit rate limits?** It self-throttles to CrossRef's advertised rate limit
|
|
@@ -87,7 +87,12 @@ def _iter_entries(text: str):
|
|
|
87
87
|
|
|
88
88
|
def parse_bibtex(text: str) -> list[Citation]:
|
|
89
89
|
cites: list[Citation] = []
|
|
90
|
+
# Line numbers are counted forward from the previous entry, not from the top
|
|
91
|
+
# of the file each time: the rescan made parsing quadratic in entries.
|
|
92
|
+
line_no, counted_to = 1, 0
|
|
90
93
|
for start, etype, entry in _iter_entries(text):
|
|
94
|
+
line_no += text.count("\n", counted_to, start)
|
|
95
|
+
counted_to = start
|
|
91
96
|
if etype in _NON_ENTRY_TYPES:
|
|
92
97
|
continue
|
|
93
98
|
_key, sep, rest = entry.partition(",")
|
|
@@ -96,7 +101,6 @@ def parse_bibtex(text: str) -> list[Citation]:
|
|
|
96
101
|
# in a shape we do not recognise. Skipped rather than half-parsed.
|
|
97
102
|
continue
|
|
98
103
|
body = rest[:-1] if rest.endswith("}") else rest
|
|
99
|
-
line_no = text[:start].count("\n") + 1
|
|
100
104
|
fields = {k.lower(): " ".join((bv or qv).split()) for k, bv, qv in _FIELD.findall(body)}
|
|
101
105
|
year = None
|
|
102
106
|
if fields.get("year"):
|
|
@@ -135,3 +135,64 @@ def test_string_and_preamble_are_not_citations():
|
|
|
135
135
|
)
|
|
136
136
|
cites = parse_bibtex(src)
|
|
137
137
|
assert len(cites) == 2, f"got {len(cites)}: {[c.raw for c in cites]}"
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
# --- cost -------------------------------------------------------------------
|
|
141
|
+
# Until 2026-09-25 each entry's line number was `text[:start].count("\n")`: a
|
|
142
|
+
# slice and a scan from the top of the file for every entry, so parsing was
|
|
143
|
+
# quadratic in the number of entries (measured: 1,000 entries 46 ms, 4,000 0.61 s,
|
|
144
|
+
# 16,000 10.5 s). The only cost check was the elapsed-time bound above, on one
|
|
145
|
+
# five-line entry, which a whole-file rescan passes by construction.
|
|
146
|
+
#
|
|
147
|
+
# This counts characters instead of seconds: every slice or index the parser
|
|
148
|
+
# takes of the input, and every range it hands to str.count, is tallied, so the
|
|
149
|
+
# total is the same on every run and on every machine. The regex engine reads
|
|
150
|
+
# the string directly and is not counted -- this gate covers the Python-level
|
|
151
|
+
# scans, not backtracking.
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class _CountingStr(str):
|
|
155
|
+
touched = 0
|
|
156
|
+
|
|
157
|
+
def __getitem__(self, key): # type: ignore[override]
|
|
158
|
+
out = str.__getitem__(self, key)
|
|
159
|
+
type(self).touched += len(out)
|
|
160
|
+
return out
|
|
161
|
+
|
|
162
|
+
def count(self, sub, start=None, end=None): # type: ignore[override]
|
|
163
|
+
s, e, _ = slice(start, end).indices(len(self))
|
|
164
|
+
type(self).touched += max(e - s, 0)
|
|
165
|
+
return str.count(self, sub, start, end)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def _bib_of(n: int) -> str:
|
|
169
|
+
return "".join(
|
|
170
|
+
f"@article{{k{i},\n author = {{Alpha, A.}},\n title = {{T {i}}},\n"
|
|
171
|
+
f" year = {{2020}},\n doi = {{10.1/x{i}}},\n}}\n\n"
|
|
172
|
+
for i in range(n)
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def _touched(text: str) -> tuple[int, list]:
|
|
177
|
+
_CountingStr.touched = 0
|
|
178
|
+
cites = parse_bibtex(_CountingStr(text))
|
|
179
|
+
return _CountingStr.touched, cites
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def test_parsing_reads_each_character_a_bounded_number_of_times():
|
|
183
|
+
small, big = _bib_of(100), _bib_of(400)
|
|
184
|
+
t_small, c_small = _touched(small)
|
|
185
|
+
t_big, c_big = _touched(big)
|
|
186
|
+
|
|
187
|
+
# The requested workload ran, and line numbers are still right: entry i
|
|
188
|
+
# starts on line 7*i + 1.
|
|
189
|
+
assert len(c_small) == 100 and len(c_big) == 400
|
|
190
|
+
assert [c.source_line for c in c_big] == [7 * i + 1 for i in range(400)]
|
|
191
|
+
|
|
192
|
+
# Positive control: the counter sees the parser at all -- matching braces
|
|
193
|
+
# reads every character of every entry, so it cannot count less than that.
|
|
194
|
+
assert t_big >= len(big), f"counted {t_big} of {len(big)} chars; counter is blind"
|
|
195
|
+
|
|
196
|
+
# Linear: a bounded number of reads per input character, at both sizes.
|
|
197
|
+
assert t_small <= 4 * len(small), f"{t_small} reads for {len(small)} chars"
|
|
198
|
+
assert t_big <= 4 * len(big), f"{t_big} reads for {len(big)} chars"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"""End-to-end on a real typeset journal PDF (a Systematic Biology article kept in
|
|
2
|
-
|
|
2
|
+
GHOSTCITE_LIVE_PDF). Skipped unless GHOSTCITE_LIVE=1 and that path is a file.
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
5
|
from __future__ import annotations
|
|
@@ -9,10 +9,11 @@ from pathlib import Path
|
|
|
9
9
|
|
|
10
10
|
import pytest
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
_PDF_ENV = os.environ.get("GHOSTCITE_LIVE_PDF", "")
|
|
13
|
+
_PDF = Path(_PDF_ENV) if _PDF_ENV else None # Path("") would be "." and exist
|
|
13
14
|
_SKIP = pytest.mark.skipif(
|
|
14
|
-
os.environ.get("GHOSTCITE_LIVE") != "1" or not _PDF.
|
|
15
|
-
reason="set GHOSTCITE_LIVE=1 and
|
|
15
|
+
os.environ.get("GHOSTCITE_LIVE") != "1" or _PDF is None or not _PDF.is_file(),
|
|
16
|
+
reason="set GHOSTCITE_LIVE=1 and GHOSTCITE_LIVE_PDF=<path to Parham et al. 2012 Syst. Biol. PDF>",
|
|
16
17
|
)
|
|
17
18
|
|
|
18
19
|
|
|
@@ -9,7 +9,7 @@ pytestmark = pytest.mark.live
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def test_known_ghost_li_should_be_chen():
|
|
12
|
-
#
|
|
12
|
+
# Real-world case: cited "Li 2024", DOI is actually Chen et al.
|
|
13
13
|
c = Citation(
|
|
14
14
|
raw="Li X (2024)",
|
|
15
15
|
doi="10.3390/plants13060869",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ghostcite-0.6.2 → ghostcite-0.6.4}/tests/data/crossref_years/10.1142_9789814447362_0053.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|