Saltar al contenido principal
P

dsh-source-cnki

perrylink/dsh-source-cnki

Herramientas de literatura china DeepSeek Harness sin scraping: importa exportaciones RIS/EndNote o etiquetadas a registros estables; formatea citas GB/T 7714-2015/APA 7 sin inventar campos; valida campos ausentes, años improbables, DOI mal formados y duplicados. Sin login CNKI ni scraping.

Instalar

dsh plugin --profile web add github:perrylink/dsh-source-cnki

README

dsh-source-cnki: an exported RIS record validated structurally — the journal field was removed and the record is reported as missing_journal instead of inventing a journal name, with stable ids and the export left as the ground truth

dsh-source-cnki

当前版本 0.1.4。

Chinese-literature records: import your export, cite it in GB/T 7714, check the metadata — without scraping CNKI.

No login, no scraping, no CNKI API (none is public for this purpose). The plugin reads RIS/EndNote-style or labeled text exports, assigns stable record ids, formats GB/T 7714-2015 (顺序编码制) or APA 7, and runs structural validation.

简体中文 · Español · Português · हिन्दी

License Node


Scope decision (read first)

CNKI has no public API for this purpose. This plugin therefore does not log in, scrape, or bypass any access control. You export the records yourself (RIS/EndNote-style tagged text, or labeled text with 题名:/作者:/来源:), and the plugin works on that export. If your export lacks a field, the plugin says "missing" — it never invents a journal, year, volume, page range or DOI.

What it does

  • cnki_import — parses RIS/EndNote-style and labeled text exports, assigns a stable recordId (DOI-based when present, otherwise title+year), detects language, and validates structure. The export becomes REP evidence when persist is on.
  • cnki_cite — GB/T 7714-2015 顺序编码制 ([1] 作者. 题名[J]. 刊名, 年, 卷(期): 页码.), the same without numbering, or APA 7. Author rules: GB/T ≤3 all, otherwise first 3 + 等/et al; Western names become SURNAME I; APA becomes Surname, I..
  • cnki_check — structural validation: missing title/journal/year/authors, implausible year, malformed DOI, non-numeric pages, duplicates, journal without volume or issue.
dsh-source-cnki structure: a RIS or labeled export is parsed into records with stable ids, formatted as GB/T 7714-2015 or APA 7 citations, and validated structurally — missing fields are reported, never invented, and no network is used

Structure: parse → format → validate; records[] and citations[] are the two outputs, validateRecords reports structural issues, and nothing is invented when a field is absent. The token labels inside the diagram are the real function and field names, so the same picture serves all five languages.

What it does not do

  • No CNKI access. No login, no cookies, no scraping, no unofficial endpoints.
  • No content verification. It does not check that the record matches the real paper; use dsh-cite-verify for DOIs.
  • No semantic fields. No cited-by counts, impact factors or fund numbers.
  • No DOCX/PDF. Export as RIS/labeled text (PDF text extraction: dsh-doc-anchor).
  • No claim of GB/T completeness. Variants exist (著者-出版年制, [EB/OL] carriers, [J/OL] with URLs); v0.1 implements the common journal/thesis/conference/book cases and says so.

Formats

FormatRecognized
RIS/EndNoteTY, AU, TI, JO, PY, VL, IS, SP, EP, DO, KW, AB, ER (first tag wins per field, authors accumulate)
Labeled text题名/标题/篇名, 作者, 来源/刊名, 年/发表时间, 卷, 期, 页码, DOI, 关键词, 摘要, 类型; blank line separates records

Unknown tags are ignored, not guessed.

Tools

cnki_import

{ text? | path?, format?, persist? } → { ok, records, validation, evidenceId?, recordPath? }.

cnki_cite

{ records, style?, startIndex? } → { ok, citations, text }.

cnki_check

{ records } → { ok, validation }.

Error codes

INVALID_INPUT · NOT_FOUND · PATH_ESCAPE · NOT_A_FILE · TOO_LARGE · UNSUPPORTED_FILE · NO_RECORDS · STORE_ERROR

Compatibility & install

DeepSeek Harnessdsh-v0.2.3-alpha.1 (verified 2026-11-22); peer >=0.2.1-0 <0.3.0 || >=0.2.2-0 <0.3.0
Node^22.19.0 || >=24.9.0 (tested 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 dependencieszero
dsh plugin --profile <name> add @perrylink/dsh-research-core dsh-source-cnki
dsh --profile <name> --dump-config | grep dsh-source-cnki

Configuration

KeyDefaultMeaning
enabledtruefalse mounts nothing
root.source-cnkistore/record root
workspaceRootprocess.cwd()paths must resolve inside it
maxChars2000000export cap (fails, never truncates)
persisttruestore the export as REP evidence + record
stylegbt7714-numericdefault citation style

Security boundaries

  • No network at all: no CNKI, no DOI resolution, no telemetry.
  • Read-only on the export; writes only under root.
  • realpath containment; DOCX/PDF rejected with a conversion hint.
  • The export is data. Instruction-like text inside a title or abstract is never executed (there is no executor).

Evaluation

dsh-source-cnki test suite: the real TAP run over import, GB/T 7714 and APA 7 formatting, and structural validation — no network and no CNKI access

Animated: the real pnpm test --reporter=tap-flat run of the import → GB/T 7714 / APA 7 → validation suite (no network, no CNKI access; re-run 2026-11-21). Each ok line is one test from the suite; the timings are from this run.

24 tests: RIS and labeled parsing (Chinese and English records, CRLF/BOM exports, DOI-based ids, language detection), auto-detection and empty/unrecognized rejection, GB/T journal citation with en-dash pages, ≤3 vs >3 author rules (等 / et al), missing-journal marker, thesis marker, sequential numbering, APA author/year/journal/volume/DOI, validation codes (missing title/journal, implausible year including far-future dates, malformed DOI, odd pages, duplicates), runtime (valid REP record, cite/check, traversal/symlink/DOCX/oversize rejection, malformed records and null text rejected), tool schemas, import→cite→check end to end, failure branches, plugin contract, package contract.

No benchmark is claimed: the ground truth is your export; correctness of the formatter is checked against the GB/T rules above with fixtures.

Known limitations (v0.1)

  • GB/T 7714 著者-出版年制, [J/OL]/[EB/OL] carriers and English journal abbreviation rules are not implemented.
  • Conference and book records reuse the journal field for proceedings/publisher (the export formats rarely carry separate fields).
  • Parsing is line-oriented; deeply wrapped multi-line abstracts in labeled exports may merge into the previous field.
  • No CNKI record id (CNKI:/DBID) retention beyond what the export contains.

License

Apache-2.0. No third-party runtime code.

Plugins relacionados