verify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/verify — DeepCitation Verification
/verify — DeepCitation 验证功能
Verify claims against source documents using the DeepCitation API, saving JSON artifacts at each step.
使用DeepCitation API验证声明与源文档的一致性,并在每个步骤保存JSON工件。
Prerequisites
前置条件
- environment variable must be set. If not set, try loading saved credentials:
DEEPCITATION_API_KEYIf that also fails, tell the user to runbasheval "$(npx -y deepcitation env 2>/dev/null)"first, then retry.npx -y deepcitation login - Source files (PDF, DOCX, images, etc.) must be accessible on disk or via URL
- Accepted file types: PDF, images (JPG, PNG), Office files (DOCX, XLSX, PPTX), CSV, TSV, ODF
- 必须设置环境变量。如果未设置,请尝试加载已保存的凭据:
DEEPCITATION_API_KEY如果仍失败,请告知用户先运行basheval "$(npx -y deepcitation env 2>/dev/null)",然后重试。npx -y deepcitation login - 源文件(PDF、DOCX、图片等)必须可通过本地磁盘或URL访问
- 支持的文件类型:PDF、图片(JPG、PNG)、Office文件(DOCX、XLSX、PPTX)、CSV、TSV、ODF
Key Rules
核心规则
- and
page_idMUST come from theline_ids— see rules/line-ids.md for details.deepTextPromptPortion - Coverage audit: After generating citations, spawn a subagent to audit the report/chat and confirm all facts, sources, names, dates, and values have deepcitations. The subagent should flag any uncited claims.
- 和
page_id必须来自line_ids——详情请参见rules/line-ids.md。deepTextPromptPortion - 覆盖范围审核:生成引用后,启动子代理审核报告/对话,确认所有事实、来源、名称、日期和数值都已添加deepcitations。子代理应标记任何未引用的声明。
Workflow
工作流
Step 0: Analyze input
步骤0:分析输入
Load rules/analyze-input.md to determine which path to follow (A–F) based on what's in the conversation, arguments, and working directory.
加载rules/analyze-input.md,根据对话内容、参数和工作目录确定要遵循的路径(A–F)。
Step 1: Prepare sources
步骤1:准备源文件
Load rules/prepare-sources.md for CLI usage and what to retain from each prepare response.
加载rules/prepare-sources.md了解CLI用法以及需要从每个准备响应中保留的内容。
Step 2: Build citations
步骤2:构建引用
Load rules/build-citations.md for the full citation-building workflow:
- Path A: Existing — skip to Step 3
<<<CITATION_DATA>>> - Path B: Existing HTML with claims — identify claims, build citation data, generate keys, annotate HTML
- Path C: Generate new cited response from scratch using the canonical citation format spec
加载rules/build-citations.md查看完整的引用构建工作流:
- 路径A:已有——跳至步骤3
<<<CITATION_DATA>>> - 路径B:已有包含声明的HTML——识别声明、构建引用数据、生成密钥、标注HTML
- 路径C:使用标准引用格式规范从头生成新的带引用响应
Step 3–5: Verify, inject, validate
步骤3–5:验证、注入、校验
Load rules/verify-and-inject.md for verification, HTML injection, and pre-delivery validation.
加载rules/verify-and-inject.md了解验证、HTML注入和交付前校验的流程。
When building citations
构建引用时的注意事项
When dealing with and values, load rules/line-ids.md for how sparse line IDs work and how to find the right one.
lineIdspageNumberWhen annotating HTML with attributes, load rules/annotate-html.md for placement rules, key-map building, and citation drawer triggers.
data-citation-key处理和值时,请加载rules/line-ids.md了解稀疏行ID的工作原理以及如何找到正确的行ID。
lineIdspageNumber使用属性标注HTML时,请加载rules/annotate-html.md了解放置规则、密钥映射构建和引用抽屉触发方式。
data-citation-keyOutput artifacts
输出工件
All artifacts are saved in . Use naming so re-runs don't clobber each other:
.deepcitation/{topic}-{timestamp}| File | Contents |
|---|---|
| Upload response with |
| Full LLM response including |
| Extracted |
| Re-keyed citations with hashed keys (from |
| Human-readable key → hashed key mapping |
| HTML with |
| Verification results with statuses and evidence |
| Injected HTML with CDN runtime (Path B output) |
所有工件都保存在目录下。使用命名格式,避免重新运行时覆盖现有文件:
.deepcitation/{topic}-{timestamp}| 文件 | 内容 |
|---|---|
| 包含 |
| 包含 |
| 提取的 |
| 使用哈希密钥重新标记的引用(来自 |
| 人类可读密钥→哈希密钥的映射 |
| 带有 |
| 包含状态和证据的验证结果 |
| 注入CDN运行时的HTML(路径B输出) |
Important rules
重要规则
- Product name: Always "DeepCitation" (never "DeepCite")
- Track attachmentId: Always retain the from Step 1 — it's the key for verification lookups
attachmentId - Strip before display: Use to remove
extractVisibleText()before showing text to user<<<CITATION_DATA>>> - CitationRecord is an object: Check emptiness with
Object.keys(citations).length === 0 - API key security: Never log or display
DEEPCITATION_API_KEY - Verbatim quotes: must be copied exactly from the source — do not paraphrase
fullPhrase
- 产品名称:始终使用“DeepCitation”(绝不能用“DeepCite”)
- 跟踪attachmentId:务必保留步骤1中的——它是验证查找的关键
attachmentId - 显示前剥离内容:使用在向用户显示文本前移除
extractVisibleText()<<<CITATION_DATA>>> - CitationRecord是对象:通过检查是否为空
Object.keys(citations).length === 0 - API密钥安全:绝不要记录或显示
DEEPCITATION_API_KEY - 精确引用:必须完全从源文件复制——不得意译
fullPhrase
References
参考资料
- Citation format spec: (resolve
$DC_ROOT/docs/prompts/citation-format.mdwithDC_ROOTas shown in Path C)node -e "..." - SDK prompt:
$DC_ROOT/src/prompts/citationPrompts.ts - Citation parser: https://github.com/DeepCitation/deepcitation/blob/main/src/parsing/parseCitation.ts
- API docs: https://deepcitation.com/docs
ARGUMENTS: $ARGUMENTS
- 引用格式规范:(如路径C所示,使用
$DC_ROOT/docs/prompts/citation-format.md解析node -e "...")DC_ROOT - SDK提示:
$DC_ROOT/src/prompts/citationPrompts.ts - 引用解析器:https://github.com/DeepCitation/deepcitation/blob/main/src/parsing/parseCitation.ts
- API文档:https://deepcitation.com/docs
参数:$ARGUMENTS