jiayan-xu/dsh-ocr-review
本地 AI 代码评审门禁:对工作区/分支/commit diff 跑评审(托管 ocr.js),返回结构化 findings 与 token 统计;门禁模式发现问题即失败。
已收录
0
Git
Bundle 已验证
功能介绍
本地 AI 代码评审门禁:对工作区/分支/commit diff 跑评审(托管 ocr.js),返回结构化 findings 与 token 统计;门禁模式发现问题即失败。
适合
- 提交前需要评审工作区未提交变更的开发者。
- 需要对分支 merge-base 范围或单个 commit 做结构化 AI 评审的团队。
- 希望评审一旦产生 findings 就失败的本地或 CI 门禁。
- 需要规范化 findings、评审会话信息和 token 统计的用户。
不适合
- 没有工作区、分支范围或 commit diff 可供评审的全仓库审计。
- 缺少托管 `ocr.js`、Node.js 可执行文件或已配置 LLM 提供方访问的环境。
- 关键文件命中默认排除 glob 且未覆盖排除配置的评审。
- 需要门禁按严重级别区分是否失败的工作流,因为 gate 模式会对任何评论失败。
README
dsh-ocr-review
dsh-ocr-review is a local OpenCodeReview gate for DSH. It runs the managed ocr.js executable against repository changes and returns structured review findings and summary information, including token statistics.
Capabilities
The plugin registers two tools:
-
ocr_reviewreviews uncommitted workspace changes, a merge-base range, or a single commit. -
ocr_llm_testrunsocr llm testto check the configured provider and LLM connection.
Review findings are normalized to include path, line, severity, category, and message fields. The result also includes the review status, message, session ID, and summary.
When gate is enabled, ocr_review throws an error if the review returns one or more comments.
Review Options
ocr_review accepts:
-
repo: Absolute repository working directory. Defaults to the current working directory. -
from: Base ref for a merge-base review. When omitted, workspace changes are reviewed. -
to: Target ref used withfrom. Defaults toHEAD. -
commit: A single commit to review; mutually exclusive withfromandto. -
exclude: Comma-separated exclusion globs. -
gate: Fail when findings are present. -
provider: Override the configured provider. -
model: Override the configured model.
The default exclusions are:
.github/**,.githooks/**,scripts/ocr-review.sh,**/__pycache__/**,**/*.bak,**/*.exe,**/*.csv,**/target/**
ocr_llm_test accepts an optional repo working directory.
Configuration
By default, provider configuration is read from:
~/.opencodereview/config.json
The managed executable paths and default exclusions can be overridden with these environment variables:
-
OCR_NODE_BIN: Node.js executable path. -
OCR_OCR_BIN: OpenCodeReviewocr.jspath. -
OCR_DEFAULT_EXCLUDE: Default comma-separated exclusion globs.
The package includes a Cordis bundle patch that registers @jhp830901/dsh-ocr-review. It declares DSH >=0.0.1, depends on @deepseek-ai/dsh-tools, and has a peer dependency on @deepseek-ai/cordis.
License
MIT
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:jiayan-xu/dsh-ocr-review。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。