dsh-lawcite-adapter
Manifest valid???????????(??????????????????????,?????,???????)
dsh-lawcite-adapter
Boundary: this plugin checks a 法条引用清单 for verifiability and document elements — that each citation names its law and article, that the article number follows the Chinese form, that a direct quotation is transcribed, that the power status comes from your vocabulary, that the citation states where it is used and what it argues, that the document names its title and type, that citation numbers are unique, and that no placeholder survives. It does not verify that a statute exists, that it is currently in force, that it has not been amended or repealed, or that it applies to the case.
⚠️ This plugin does not query a statute database — and that is the point
It cannot find the most consequential error: a citation to a statute or article that does not exist, or that has been repealed. Confirming that requires the national laws-and-regulations database and the facts of the case, which is a legal professional's work. What this plugin checks is whether a citation left behind the elements needed to verify it — the law, the article, the quoted text, the power status, the purpose.
That boundary is stated in the pack's header, in
LC-001's,LC-003's andLC-004's notes, and in the troubleshooting section. Read it before acting on any finding: a clean report from this plugin is not a statement that the citations are correct.
LC-002checks the article number's form —第X条in Chinese or Arabic numerals, allowing第X条之一— and nothing about whether the article exists.LC-003checks that a quotation is transcribed, not that the transcription matches the statute.LC-004's power-status vocabulary ships empty because no statute's current status is built in either.Every
excerptin the rule pack says, in so many words, that the clause text was not obtained. The regime lives in 《中华人民共和国立法法》, GB/T 9704—2012 and each institution's legal-document review rules. The verification pass could not retrieve verbatim clause text, so the pack states the gap in theexcerptfield itself and keeps every rule atwarnorinfo. When the texts are in hand, replace eachexcerptwith the real clause and raisekindtodirect.⚠️ One basis was corrected rather than completed. GB/T 9704—2012《党政机关公文格式》 was verified chapter by chapter to be a layout standard — paper, typesetting, binding, the placement of document elements and the specimen forms. It contains no provision about citation management at all. Six rules had been hung on it anyway ("every citation must name the instrument and the article", "a direct quotation must be transcribed", and so on). Those six now declare the institution's own legal-document review practice as their basis, are rated
institutional-configuration, and therefore sit atinforather thanwarn. Leaving them atwarnwhile their own note says "read this as the institution's practice" would have contradicted itself.
LC-001was then corrected the same way. It cited 《中华人民共和国立法法》. That statute was obtained in full and does contain a numbering provision — 第六十五条: 「法律根据内容需要,可以分编、章、节、条、款、项、目」,with numbering rules and an authorisation for the NPC Standing Committee's working body to draft legislative technique rules. But that governs how a law is itself drafted and numbered; it says nothing about how an official document cites an existing law. SoLC-001joins the other seven: all eight rules in this pack now declare the institution's own review practice as their basis and are ratedinstitutional-configurationatinfo. Seerules/evidence/clause-verification-basis-mismatch.md.
Compatibility
| Surface | Status |
|---|---|
| Harness | Peer range >=0.1.2-rc.1 <0.2.0 || >=0.2.0-0 <0.3.0 — verified to accept both 0.2.0-rc.2 and 0.2.1-alpha.1. engines.dsh is deliberately not declared: it has no reader and cannot reject a host |
| Node | `^22.19.0 |
| Platforms | All (plain ESM; no native code, no network, no model call) |
| Tool mode | Works in native, ptc and both; for a long submission use ptc |
What it does
Registers the lawcite_adapter tool. It reads one citation inventory — the document header plus one row per
citation — applies a versioned rule pack, and returns a report.
| Rule | Check | Severity | Basis kind |
|---|---|---|---|
LC-001 | the law name and article number are stated | warn | principle |
LC-002 | the article number follows the Chinese form | warn | principle |
LC-003 | a direct quotation is transcribed | warn | principle |
LC-004 | the power status comes from your vocabulary (off by default) | info | local |
LC-005 | the citation states its location and purpose | warn | principle |
LC-006 | the document names its title and type | warn | principle |
LC-007 | citation numbers are unique | warn | principle |
LC-008 | the quotation column holds no unreplaced placeholder | warn | principle |
Install
pnpm pack
dsh plugin --profile <name> add ./dsh-lawcite-adapter-0.1.0.tgz
dsh --profile <name> --dump-config | grep 'dsh-lawcite-adapter'
Configuration
| Key | Type | Default | Description |
|---|---|---|---|
rulesFile | string | rules/lawcite-adapter.yaml | Rule-pack path, relative to the package root |
disabledRules | string[] | [] | Rule ids to stop running; each appears in skipped |
onlyRules | string[] | [] | Run only these rule ids; empty runs every rule |
skipNotes | string | "" | Note appended to every skipped reason |
timeoutMs | number | 120000 | Cooperative tool timeout budget |
Rule-level parameters worth knowing:
LC-002pattern— the article number's shape,第[〇零一二三四五六七八九十百千0-9]+条plus an optional之一, by default. Adjust it if your house style writes numbers differently.LC-004values— your power-status vocabulary, e.g.[现行有效, 已修订, 已废止, 尚未生效]. Empty means no check, and no statute's current status is built in either.LC-008terms— the placeholders to look for. 「略」 is deliberately absent:……(略)is a normal way to abridge a long quotation.
Material format
The tool accepts JSON or YAML:
documentTitle: 某某买卖合同纠纷起诉状
documentType: 民事起诉状
author: 王律师
draftedAt: 2026-05-12
rows:
- { 序号: '1', 法律法规名称: 《中华人民共和国民法典》, 条号: 第五百七十七条,
引用原文: 当事人一方不履行合同义务或者履行合同义务不符合约定的,应当承担继续履行、采取补救措施或者赔偿损失等违约责任。,
引用位置: 第 2 部分 诉讼请求的事实与理由(第三段),
论证作用: 作为被告违约责任请求权的法律依据,
效力状态: 现行有效, 版本说明: 2020 年 5 月 28 日通过,2021 年 1 月 1 日施行, 引用格式: 脚注① }
Column names are matched case-insensitively and ignoring spaces, underscores and hyphens; the inventory's own
column names are kept, so a finding names the column it read. Article numbers may use Chinese or Arabic numerals;
a spaced Arabic form like 第 577 条 is reported so the house style stays consistent.
Rule sources
Rule data lives in rules/lawcite-adapter.yaml. Its header explains that the plugin holds no statute database and
verifies neither existence nor validity, and each rule's note repeats the part that matters for that rule. The
load-time guard still requires a document, clause, excerpt and source per rule, and still forbids a
principle-derived or locally configured check from being error.
Troubleshooting
- It passed a citation to a repealed statute. By design: it checks that the citation is verifiable, never that it is correct. Verifying needs the national database, which the plugin does not query.
LC-003passed a quotation that is not what the statute says. It checks that a quotation is present. Comparing it against the statute is the verification step it deliberately omits.LC-002fires on a form I consider acceptable. Adjustpatternto your house style. Note that paragraph and item numbers belong in their own columns here, so第 12 条第 3 款should put第 12 条in the article column.LC-004never runs. Its vocabulary is empty, and no statute's status is built in.LC-007fires on one article cited twice. Citing the same provision in several sections is normal — give each citation its own number, or the footnotes cannot locate them apart.- The plugin installs but the tool never appears. Check that
mainresolves tolib/index.mjsand thatpnpm run buildproduced it; a wrongmainmakes the loader skip the entry silently. dsh plugin addrefuses the package as incompatible. The peer range covers0.1.xand0.2.x; if your runtime sits outside it, grant an explicit exemption:dsh plugin --profile <name> allow-version dsh-lawcite-adapter@0.1.0 --dsh-version <runtime> --accept-riskcheckreportsmanifest-peersas failed. The static checker compares against a hard-coded peer range that predates the 0.2 line. The runtime enforces peer compatibility at install time, so the declared range is the correct one; this is a known upstream issue indsh-plugin-dev.
Development
pnpm install
pnpm run typecheck # tsc --noEmit
pnpm test # vitest, the shared table-plugin suite plus paired fixtures
pnpm run build # tsdown -> lib/index.mjs + lib/index.d.mts
node ../scripts/sync-shared.mjs dsh-lawcite-adapter # refresh src/shared from ../_shared
The plugin is data-only: src/model.ts declares the table shape, the shared kit supplies the reader and the
check engine, and the rule pack declares every check.
License
Apache License 2.0 © 2026 dsh-lawcite-adapter contributors.
Comments
Loading…
Similar plugins
by PerryLink
?????????(????????????????,?????,???????)
★ 0
NOASSERTION
TypeScript
Oct 8, 2026
dsh plugin --profile web add dsh-bid-qual-checkby PerryLink
????????(?????????????????????,?????,???????)
★ 0
NOASSERTION
TypeScript
Oct 9, 2026
dsh plugin --profile web add dsh-permit-report-checkby PerryLink
??????????????(????????????,?????,???????)
★ 0
NOASSERTION
TypeScript
Oct 9, 2026
dsh plugin --profile web add dsh-archive-checkby ESxyzbil
DSH ??????:?????? + ??????? + ????
★ 1
MIT
JavaScript
Aug 22, 2026
dsh plugin --profile web add dsh-official-document-modeby PerryLink
PPAP ?????????(???? PPAP ??????????????????,?????,???????)
★ 0
NOASSERTION
TypeScript
Oct 8, 2026
dsh plugin --profile web add dsh-ppap-checkby HERO476
DSH ????(??????):????/????????,???????????????????Selection follow-up for DeepSeek Harness with an independent side-card answerer.
★ 1
MIT
JavaScript
Oct 8, 2026
dsh plugin --profile web add dsh-sidecard-ask