dsh-plugin-verified-search
f0909172434
Verified current-source search workflow for DeepSeek Harness
PROJECT TOPICS
PROJECT README
English | 中文
CiteGuard is a citation linter and bounded metadata verifier for DeepSeek Harness. It extracts DOI, arXiv, URL, and Markdown citations from drafts, checks what can be checked mechanically, and labels every conclusion at the right confidence level.
It never turns “the link responded” into “the claim is true.”
AI-generated citations fail in several different ways: malformed identifiers, invented papers, wrong titles, dead links, or a real paper placed beside a claim it does not support. CiteGuard catches the mechanical failures while preserving a clear boundary around semantic review.
draft ──> extract + normalize ──> offline validation ──> bounded provider check
│ │
└── proximity labels ────┴──> evidence receipt
networkMode=full is explicitly enabled.citeguard_check tool, standalone CLI, stable JSON receipt, and reusable TypeScript API.The precise evidence contract is documented in docs/design.md.
Requirements for building from source: Node.js 22.19 or newer and pnpm.
pnpm install
pnpm run prepare
node lib/cli.js --text "This result follows prior work (10.1234/example)."
The CLI is offline by default. Enable only fixed metadata providers, or explicitly allow arbitrary public URLs:
node lib/cli.js --file draft.md --online
node lib/cli.js --file draft.md --full --json --fail-on mismatch,unreachable,blocked
Exit codes are 0 for success, 1 when a requested --fail-on status occurs, and 2 for invalid input, I/O, or fatal verification setup errors.
The source is published on GitHub. The npm package remains unpublished. Run these commands in a local terminal, not in the Harness chat input. A global dsh command is not required.
npx -y @deepseek-ai/dsh plugin --profile web add https://github.com/Chhlafiu4312/citeguard/releases/download/v0.1.7/dsh-citeguard-0.1.7.tgz
npx -y @deepseek-ai/dsh --profile web --dump-config
# Restart a running Web UI after installation.
npx -y @deepseek-ai/dsh web
# Or build and install a local tarball.
pnpm pack
npx -y @deepseek-ai/dsh plugin --profile web add ./dsh-citeguard-0.1.7.tgz
The commands above install into the Web UI's web profile. For terminal-only use, replace web with headless. The package contributes cordis.patch.yml, which registers citeguard. An optional dsh-citeguard/invariant companion remains available for custom profiles that mount the Harness invariants service; the stock headless and web profiles do not mount it.
Once active, the Harness tool is:
citeguard_check({ text, online? })
The tool defaults online to true but remains constrained by the plugin's networkMode. Pass online: false for deterministic offline extraction.
| Status | Meaning |
|---|---|
verified |
A DOI or arXiv identifier resolved at its constrained metadata provider; any explicit title passed the configured similarity threshold. |
reachable |
An explicitly permitted arbitrary URL returned a successful bounded response. |
mismatch |
Provider metadata resolved, but an explicit descriptive link label did not resemble the provider title enough. |
unverified |
Syntax was accepted, but policy or offline mode prevented a provider request. |
invalid |
The identifier or URL failed local syntax validation. |
unreachable |
DNS, timeout, provider, or HTTP failure prevented verification. |
blocked |
The request violated network safety policy or resource limits. |
None of these statuses proves semantic entailment, research quality, or factual truth. Claim associations mean only “citation appears in the same sentence.”
| Field | Default | Purpose |
|---|---|---|
enabled |
true |
Register the citeguard_check tool. |
networkMode |
metadata |
off, fixed-provider metadata, or SSRF-checked full. |
timeoutMs |
8000 |
One end-to-end deadline covering DNS, every redirect, headers, and complete response-body consumption. |
maxResponseBytes |
1048576 |
Maximum accepted response body. |
maxRedirects |
4 |
Maximum validated redirects. |
minTitleSimilarity |
0.55 |
Token-set similarity required for an explicit title label. |
maxTextChars |
200000 |
Maximum draft length per invocation. |
maxCitations |
100 |
Maximum citations verified per invocation. |
The complete bundle defaults are in cordis.patch.yml.
import { extractCitations, checkCitations, resolveConfig } from 'dsh-citeguard'
const offline = extractCitations(draft)
const receipt = await checkCitations(draft, resolveConfig(), { online: false })
Network and extraction helpers are also exported at dsh-citeguard/network and dsh-citeguard/extractor.
metadata mode contacts only Crossref and arXiv provider hosts; exact host allow-lists reject cross-provider redirects before DNS resolution, and arbitrary URLs remain unrequested.full mode is opt-in, validates every redirect target, and pins each connection to the exact public DNS answer set that passed validation.Report vulnerabilities using SECURITY.md. Do not publish private manuscripts or exploit targets in issues.
pnpm run verify:self-contained
pnpm run typecheck
pnpm test
pnpm run prepare
pnpm run build
Tests use deterministic fake providers and make no real network requests. They cover extraction, deduplication, title checks, status wording, SSRF rejection, provider host locking, end-to-end deadlines, redirect cancellation, size limits, Loader exports, registration disposal, and CLI behavior. See CONTRIBUTING.md.
Version 0.1.7 enforces one deadline across DNS and the complete redirect workflow and releases rejected redirect bodies promptly and is published at Chhlafiu4312/citeguard. Release tarballs include a SHA-256 checksum and GitHub build-provenance attestation. The package remains private: true; no npm registry publication is performed by the build.
BSD-3-Clause licensed. See LICENSE.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。