Study-Mate
Miaotofu01
你的AI学习搭档:定路线、讲知识、做项目,边学边做,学透一门科目
PerryLink/dsh-cite-verify
Verify that a citation exists and that its metadata is right, for DeepSeek Harness: DOI / PMID / arXiv / BibTeX resolution through Crossref, PubMed and arXiv, field-by-field metadata comparison, version/duplicate/retraction observations, content-addressed response snapshots and a REP v1 evidence record. not_found is reported as skipped, never as fa
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:PerryLink/dsh-cite-verify
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Verify that a citation exists — and that its metadata is right.
DOI / PMID / arXiv / BibTeX → the provider's own answer, field-by-field checks, a content-addressed snapshot, and a REP evidence record. not_found is reported as skipped, never as fabrication.
English · 简体中文
doi through Crossref, pmid through PubMed E-utilities, arxiv through the arXiv Atom API.cite_fix returns a corrected BibTeX entry as text — it never edits files.cite_export formats the resolved record as GB/T 7714 (numeric), APA 7, IEEE, Vancouver, BibTeX, RIS or CSL-JSON — missing fields are reported, never guessed.update-to); deciding whether a work is retracted needs dsh-retraction-watch (W2).dsh-doc-anchor.cite_fix reports diffs; applying them is the user's decision.citeproc. The title is preserved as given.| DeepSeek Harness | dsh-v0.2.1-rc.5 (verified 2026-11-08); peer line >=0.2.1-0 <0.3.0 \|\| >=0.2.2-0 <0.3.0 |
| Node | ^22.19.0 \|\| >=24.9.0 (tested on 24.22.1), ESM only |
| Peers | @perrylink/dsh-research-core ^0.1.0, @deepseek-ai/cordis ^4.0.5-alpha.1, @deepseek-ai/dsh-tools, @deepseek-ai/schemastery ^3.18.5-alpha.1 |
| Runtime dependencies | zero |
dsh plugin --profile <name> add @perrylink/dsh-research-core dsh-cite-verify
dsh --profile <name> --dump-config | grep dsh-cite-verify
dsh plugin --profile <name> remove dsh-cite-verify
When ctx.researchEvidence is mounted the evidence goes there; otherwise the plugin uses its own core store under root.
cite_verify| Parameter | Type | Notes |
|---|---|---|
doi / pmid / arxiv |
string | at least one identifier (or bibtex) |
bibtex |
string | entry supplies the identifier and the expected fields |
title, authors, year, venue, pages |
fields as cited, compared against the record | |
fresh |
boolean | bypass the response cache |
Returns { ok, status, notFound, lookupError, resolved, checks[], evidenceId, recordPath?, warnings[] }.
notFound is true only when no provider returned a record, at least one definitively returned 404, and no lookup failed. lookupError is true when a network failure, timeout, 5xx or unparsable response prevented a check — that answer is unchecked and must not be read as “no record found”. If one identifier fails while another resolves, the record is still returned with lookupError: true.
status is derived from the checks: any fail → fail, any warn → warn, any pass → ok, nothing checked → unchecked.
cite_batch{ citations: string[], fresh? } where each item is doi:10..., pmid:123, arxiv:2401.00001, an @article{...} entry, or a bare identifier detected by shape. Bounded concurrency, per-item failures, duplicate detection.
Each item carries status, lookupError?, duplicate? and evidenceId?. A repeated identifier is marked duplicate: true; it keeps fail if it already failed (a duplicate never downgrades the worst status) and is otherwise raised to warn. The batch warnings[] counts the duplicates.
cite_fixSame inputs as cite_verify. Returns { ok, bibtex, diffs[], status, evidenceId?, warnings[] }. Text only — never writes to disk.
cite_exportSame identifier inputs as cite_verify, plus style and optional volume, issue, publisher, url, language (zh selects 等 over et al.) and index (IEEE reference number). Pass a record object to format offline.
style |
Format |
|---|---|
gbt7714-numeric (default) |
作者. 题名[J]. 刊名, 年, 卷(期): 页. DOI. |
apa |
Author, A. A., & Author, B. B. (Year). Title. Journal, Volume(Issue), pages. https://doi.org/… |
ieee |
[n] A. A. Author, "Title," Journal, vol. V, no. I, pp. P, Year. |
vancouver |
Author AB. Title. Journal. Year;Volume(Issue):Pages. |
bibtex |
@article{key, …} with a deterministic key |
ris |
TY - JOUR … ER - |
csl-json |
CSL-JSON item for external processors |
Returns { ok, style, entry, missing[], evidenceId?, warnings[] }. missing lists fields absent from the record; an identifier still goes through the same provider lookup and REP evidence path as cite_verify.
INVALID_INPUT · INVALID_BIBTEX · UNSUPPORTED_IDENTIFIER · STORE_ERROR · BATCH_TOO_LARGE
Network failures never become citation failures: they appear as skipped checks (network_error, rate_limited, unavailable for timeouts), set lookupError: true, and leave the evidence unchecked with notFound: false.
| Check | pass | fail / warn | skipped |
|---|---|---|---|
doi-exists |
Crossref returned the DOI | — | not_found when Crossref has no such DOI |
other (PMID/arXiv existence) |
provider returned the record | — | not_found |
metadata-match (title) |
similarity ≥ titleThreshold |
fail below threshold |
— |
metadata-match (authors) |
all cited family names present | warn ≥50 %, else fail |
— |
metadata-match (year) |
exact | warn ±1, fail otherwise |
— |
metadata-match (venue) |
similarity ≥ 0.6 | warn |
— |
metadata-match (pages) |
normalized equality | warn |
— |
version-match |
two identifiers agree on the title | warn on disagreement |
— |
retraction |
— | warn when the record carries an update notice |
— |
not_found must be recorded as skipped (enforced by the REP core store and schema). It is not evidence of fabrication and not evidence of cleanliness.
api.crossref.org, api.openalex.org, eutils.ncbi.nlm.nih.gov, export.arxiv.org (HTTPS only, no credentials, no custom port).blocked_host failure.Retry-After respected up to 5 s).<root>/cache for cacheTtlMs (7 days default); fresh bypasses. A cache write failure is a cache miss, never a failure.| Key | Default | Meaning |
|---|---|---|
enabled |
true |
false mounts nothing |
root |
.cite-verify |
store + cache root |
userAgent |
dsh-cite-verify/0.1.0 (…) |
sent to every provider |
mailto |
— | PubMed tool/email parameters |
timeoutMs |
15000 |
per-request deadline |
minIntervalMs |
150 |
per-host minimum interval |
retries |
1 |
retries on 429/503 |
maxRedirects |
3 |
redirect budget (each hop re-validated) |
cacheTtlMs |
604800000 |
cache lifetime (0 disables) |
titleThreshold |
0.85 |
title similarity for a pass |
batchConcurrency |
3 |
parallel lookups |
maxBatch |
50 |
items per cite_batch |
Invalid values fail loud at mount.
update-to notices are surfaced, with a warning. True monitoring is dsh-retraction-watch.cacheTtlMs; use fresh when it matters.dsh-research-bench citations v0.1.0 (100 cases)Command (requires the bench checkout next to this repo, or BENCH_DIR):
pnpm run bench:citations
Result (reproducible, frozen dataset, every provider call answered from the case fixtures — no network):
| metric | value |
|---|---|
| existence precision | 1.00 |
| existence recall | 1.00 |
| field precision | 0.9559 |
| field recall | 1.00 |
| field F1 | 0.9774 |
| update-notice precision | 1.00 |
| update-notice recall | 1.00 |
| clean false-positive rate | 0.10 |
| exact-match rate | 0.97 |
The three false positives are all venue abbreviations (J. Synth. Tests vs Journal of Synthetic Tests) on otherwise-correct citations: venue comparison is token overlap with a 0.6 threshold and does not expand journal abbreviations. That is a known limitation, reported rather than hidden. Diacritic/transliteration differences (Müller/Muller, Østergård/Ostergard) and omitted subtitles no longer produce false positives.
Raw per-case predictions: bench/results-citations.json.
Scope warning: the dataset is synthetic and clean. A 1.0 existence score says the checking logic maps frozen fixtures to correct verdicts; it does not predict real-world accuracy, where provider drift, transliteration and ambiguous metadata dominate. dsh-research-bench is a test split and is not used for tuning.
notFound vs lookupError, incl. a mixed 404 + timeout), runtime (REP record validity, persistence, re-verification without an evidence conflict, batch locality, duplicates incl. fail-preserving status, fix diffs), tool surface (including the not-found vs failed-lookup render), package contract.pnpm install
pnpm run typecheck
pnpm test
pnpm run build
pnpm run verify:package
Apache-2.0. No third-party runtime code.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: research。