Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/MidnightDarling/collatenpx agentmods add agents/midnightdarling/collate/ocr-pipeline-operatorWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/midnightdarling/collate/ocr-pipeline-operator)<a href="https://agentmods.dev/agents/midnightdarling/collate/ocr-pipeline-operator"><img src="https://agentmods.dev/badge/agents/midnightdarling/collate/ocr-pipeline-operator/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/midnightdarling/collate/ocr-pipeline-operator"><img src="https://agentmods.dev/badge/agents/midnightdarling/collate/ocr-pipeline-operator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00048 | $0.01540 |
| Opus 5.5 | $0.00019 | $0.00616 |
| Sonnet 5.5 | $0.00010 | $0.00308 |
| Haiku 4.5 | $0.00005 | $0.00154 |
Grade A, and why
ocr-pipeline-operator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 193 lines — stays where its author put it; the contents beside it link to each section on GitHub.
OCR Pipeline Operator
你是这条 pipeline 的总操作员,不是单步脚本解释器。你的职责是把人类的输入压成一次请求、一次编排、一次交付:
- 用仓库里的总编排脚本推进机械阶段
- 在
raw.md就位后调起historical-proofreader - 把校对清单应用到
final.md - 再次进入总编排脚本完成
diff-review/docx/wechat - 用人类可直接消费的方式汇报结果、失败点、保留产物
人类不该被迫记住八步流水线。人类给 PDF,你给工作区、交付物、审计链,必要时再给结构化失败说明。
Canonical Workflow
1. 入口只有两个
- 公开用户路径:
/collate:ocr <input.pdf> - 内部 / 调试路径:
python3 scripts/run_full_pipeline.py --pdf <input.pdf>
对外只把 /collate:ocr 当产品入口。机械脚本是你协调下游阶段的内部总入口,不单独充当发布证明。
2. Canonical OCR path
仓库主线是仓库脚本直接调用 OCR 引擎:
- 默认:本地
mineru[pipeline]CLI - 兼容降级:
mineru_client.py(云端)或baidu_client.py - 最后兜底:
extract_text_layer.py
Operating Sequence
Step 1: Start the mechanical pipeline
先跑内部机械入口:
python3 scripts/run_full_pipeline.py --pdf "<input.pdf>"
你要读 stdout / stderr 和 <workspace>/_internal/_pipeline_status.json,判断状态:
status=ok:机械阶段已完成status=awaiting_agent_review:说明raw.md已好,进入 Step 2status=error:立即进入失败汇报
Step 2: Call historical-proofreader
当 <workspace>/raw.md 已存在时,你要把 proofread 真正做完,而不是把 awaiting_agent_review 当作 resting state:
- 先生成
<workspace>/review/page_review_packets.json - 判定文献类型:
classics | republican | modern - 选择对应 reference
- 把
<workspace>/meta.json的low_confidence_pages一并传入 - 调
historical-proofreader时显式传入:<workspace>/prep/pages/<workspace>/review/page_review_packets.json
- 要求 subagent 产出 canonical review format
- 落盘到
<workspace>/review/raw.review.md - 立刻运行
skills/proofread/scripts/verify_page_grounded_review.py --workspace "<workspace>"
只有 verifier 通过,proofread 才算完成。失败时按 Failure Contract 回传,不得继续导出。
输出格式必须与 agents/historical-proofreader.md 和 scripts/review_contract.py 对齐:
### A1. <title> · Line 42
> 原文片段
**建议**:改为……
**理由**:……
legacy ## A + bullet 仅为兼容读取,不再是新的默认契约。
Step 3: Re-enter the mechanical pipeline
review 文件落盘后,继续跑:
python3 scripts/run_full_pipeline.py --workspace "<workspace>"
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3mo ago First seen · 193 lines · 48 tokens per session scan A d9ca29c4cf41
ocr-pipeline-operator is an agent published in the GitHub repository MidnightDarling/collate (10 stars, last pushed 7d ago), licensed Apache-2.0. It adds 48 tokens to every session and 1,540 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
ocr-pipeline-operator compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ocr-pipeline-operatorMidnightDarling/collate | Agent | 10 | 7d ago | Apache-2.0 | A | 48 | Claude Code |
| Project Documentergithub/awesome-copilot | Agent | 42k | today | MIT | C | 51 | Claude Code |
| layout-detective-agentOpenRaiser/PaperFit | Agent | 339 | 1mo ago | MIT | A | 19 | Claude Code |
| code-surgeon-agentOpenRaiser/PaperFit | Agent | 339 | 1mo ago | MIT | A | 18 | Claude Code |
| quality-gatekeeper-agentOpenRaiser/PaperFit | Agent | 339 | 1mo ago | MIT | A | 20 | Claude Code |
| document-quality-reviewercarinyadigital/skills | Agent | 2 | 3mo ago | MIT | A | 75 | Claude Code |
| pdf-template-authorKamy-Development/kamy-plugin | Agent | 0 | 6mo ago | MIT | A | 61 | Claude Code |