explixit-paper-check
OfficialREADME.md
# explixit-paper-check
A local-first Python CLI, MCP server, and agent skill for bibliography integrity checks. The CLI uses Python 3.9+ and the standard library. Build metadata supports setuptools 68+. For offline installs, use a prebuilt wheel or pass `--no-build-isolation` with setuptools and wheel already installed locally.
It checks a dated Crossref / Retraction Watch snapshot, Crossref/DataCite DOI metadata, title candidates, and LaTeX citation keys. Results include verification coverage; a skipped or failed lookup is never a successful verification.
## Run the CLI
```bash
# Follow a main document and merge its bibliography resources
python scripts/check_bib.py --main-tex main.tex --json
# Check multiple bibliographies together, including cross-file duplicates
python scripts/check_bib.py first.bib second.bib --tex main.tex --json
# Offline: snapshot lookup and citation hygiene only
python scripts/check_bib.py examples/sample.bib --tex examples/sample.tex --offline
# Extract identifiers from Markdown/text (surrounding metadata is not compared)
python scripts/check_bib.py references.md --json
# One or more DOI checks
python scripts/check_bib.py --doi 10.48550/arXiv.1706.03762 --json
```
`--main-tex` follows static braced `\input`, `\include`, and `\subfile` paths, respects `\includeonly`, and discovers `\bibliography` and `\addbibresource` resources. Passing `.bib` files explicitly overrides discovered bibliographies. An explicitly supplied `--tex <directory>` scans every `.tex` file under it; prefer a main document to exclude old drafts.
TeX conditionals, import packages, custom citation macros, and build-system path expansion are not evaluated. Supply the active bibliography and `.tex` files explicitly for those projects. Comments and common verbatim environments are excluded. The BibTeX reader supports nested fields, shared `@string` definitions, exact `#` concatenation, and `crossref`/`xdata` inheritance; unclosed delimiters and other structural damage fail visibly. Duplicate fields, unresolved external macros, and missing inheritance parents produce per-entry findings while other references continue to be checked. Non-conflicting duplicate fields keep the first occurrence; conflicting DOI/title/author and other verification fields are omitted rather than chosen arbitrarily. Unresolved macros are never guessed, and affected verification remains incomplete.
## Read the result
| Exit code | Meaning |
| --- | --- |
| `0` | Requested scope completed without error findings; warnings may remain. Offline scope excludes online verification. |
| `1` | Error findings exist. Check coverage too; verification may also be incomplete. |
| `2` | Invalid input, structural parse/resource/index error, or no usable references. |
| `3` | Requested verification incomplete, without error findings (network failures or unresolved essential input fields). |
JSON exposes `status`, `completion`, `verification_complete`, completed/attempted counts, per-entry `checks`, snapshot metadata, and findings. Offline reports always state the limited scope. Missing author/year metadata, unavailable APIs, unconfirmed candidates, and registry misses remain explicit.
- Direct DOI/PMID snapshot matches produce `RETRACTED`. Title/year-only matches produce `POSSIBLE_RETRACTION`. A searched candidate needs a strong title match, consistent first author and year, and no competing corroborated identity before its DOI retraction status can be assigned to the input.
- `INVALID_DOI` means malformed syntax. A double Crossref/DataCite 404 produces `UNVERIFIED_DOI`: these two metadata registries do not cover all DOI agencies.
- A substantial title mismatch against DOI metadata produces `CHIMERA_CITATION`. Author/year differences alone produce a `METADATA_MISMATCH` warning. Neither flag establishes that AI generated the reference.
- Title searches fall back from OpenAlex to Crossref when the first result lacks corroboration. `OPENALEX_API_KEY` can optionally be supplied through the environment; Crossref/DataCite checks require no API key. API availability and service limits can still affect completion.
The original bundled snapshot contains 157,109 lookup keys (DOI, PMID, title/year); these are not 157,109 distinct papers. Its date and provenance are recorded in `data/retractions.metadata.json`. No match in that snapshot establishes only absence from that snapshot. Online metadata checks do not update retraction data, and this tool does not verify that a citation supports a manuscript claim.
## Agent skill
Install with the `skills` CLI (Claude Code, Cursor, Codex, and compatible agents):
```bash
npx skills add explixit-research/explixit-paper-check
```
Or keep the repository files together in your agent's skill directory, for example `~/.codex/skills/explixit-paper-check/`, with `SKILL.md` at its root. Ask the agent to check bibliography records or retracted references. The skill explains input selection, uncertainty, evidence, and permitted edits.
## MCP server
```bash
pip install ".[mcp]"
python mcp_server.py
```
The optional dependency is bounded to MCP SDK 1.x (`mcp>=1.2.0,<2`), matching its FastMCP interface. For an installed package, use `explixit-paper-check-mcp`. Source-file launch also restores its own import path under Python `-I`/`-P` isolation. A client configuration can use:
```json
{
"mcpServers": {
"explixit-paper-check": {
"command": "python",
"args": ["/absolute/path/to/explixit-paper-check/mcp_server.py"]
}
}
}
```
Tools: `audit_bibtex_file`, `audit_bibtex_files`, `audit_text_file`, `check_retraction`, and `verify_doi`. CLI and MCP share input validation and report logic. `audit_bibtex_files` accepts either all active bibliography paths or a `main_tex` path. Invalid inputs raise tool errors. `check_retraction` returns `retracted: null` for unconfirmed or absent snapshot matches, together with an explicit status and snapshot date.
## Tests and data updates
```bash
python -m unittest discover -s tests -v
```
Regression tests use temporary files and mocked API responses, covering failures, identity ambiguity, Unicode/DOI parsing, multi-file projects, and index updates. MCP tests run when the optional dependency is installed; otherwise they are reported as skipped.
See [data/RETRACTION-DATA.md](data/RETRACTION-DATA.md) for the executable update workflow. The builder records source/index hashes, applies the latest retraction/reinstatement event across DOI/PMID aliases, excludes ambiguous title keys, and stages validated output before replacement. Original bundled data is preserved until an update is explicitly run.
Code: MIT (`LICENSE`). Retraction data: CC BY 4.0, attributed to Crossref / Retraction Watch.
Maintained by [Explixit](https://explixit.com) (technical review for equations, tables, and empirical claims in full manuscripts).
## 中文说明
这是参考文献完整性初筛工具,支持 CLI、MCP 和 Agent Skill。可合并检查多个 `.bib`,沿主 `.tex` 的静态引用树核对 key,并检查 DOI 元数据及带日期的撤稿快照。
```bash
python scripts/check_bib.py --main-tex main.tex --json
python scripts/check_bib.py first.bib second.bib --tex main.tex --offline
```
报告区分完整核验、未完成和离线范围,显示快照日期、成功/尝试次数和待核验条目。网络失败不会显示全部通过;同名标题不会直接确认撤稿;中文标题、含括号的 DOI 和 BibTeX 字符串拼接均有回归测试。
退出码:`0` 表示请求范围完成且无错误(可能仍有警告),`1` 有错误,`2` 输入或运行条件无效,`3` 核验未完成。离线完成只表示完成离线检查。Markdown/文本模式只核验抽出的标识符,不核对周围标题和作者。
内置索引的 15.7 万余条是检索键数量,并非不同论文数量。未命中快照不能证明从未撤稿;两家 DOI 元数据库均未收录不能证明 DOI 虚假。本工具不核验引文是否支持正文观点,也不提供整篇论文技术审稿。
由 [Explixit](https://explixit.com) 维护(整篇论文与附录的公式、表格及实证论断技术审稿)。
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues