
Cornea, deterministic visual inspection
io.github.AbduljabbarBXR由 GitHub 帳號 AbduljabbarBXR 發布v0.2.2更新於 Oct 24, 2026
Deterministic visual inspection for AI agents. Overlap, overflow, contrast, quality.
發布方自己的服務:Deterministic
概覽
Cornea 為程式編寫代理提供確定性的 HTML 頁面版面檢查:重疊、溢出、WCAG 對比度與品質評分,且 token 消耗低。
- 可以做什麼
- 對頁面做完整視覺檢查,回傳精簡的幾何模型與報告
- 列出互相碰撞的元素方框,以及被裁切、塌陷或超出畫面的元素
- 檢查文字元素的 WCAG AA 對比度比值
- 給出 0 到 1 的版面健康分數與問題清單
- 說明哪些 CSS 特性是精確計算、哪些僅為近似
- 檢查本機 HTML 檔案或線上 URL,可選擇先執行內嵌腳本
- 適用情境
- 適合代理在撰寫或修改網頁時驗證版面,不必把截圖或原始 DOM 塞進上下文,例如在開發循環中依指定視窗寬度檢查本機開發伺服器頁面。
- 執行需求
- 以本機 stdio 程序執行。可透過 cargo(需 Rust 工具鏈)安裝,或使用提供 cornea 指令的 npm 套件;Rust 建置不需要瀏覽器或 Node。未宣告帳號、API 金鑰或環境變數。URL 擷取需要連線到目標頁面的網路;HTTPS 頁面需要二進位檔未內建的 TLS 支援。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Cornea, deterministic visual inspection,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Cornea
Deterministic visual inspection for AI agents. The eyes a coding agent never had.
Cornea gives a coding agent that builds web pages a real way to see them. As a token-cheap, deterministic structural model it can reason over exactly, instead of megabytes of screenshots and raw DOM dumped into context.
An agent doesn't need a photo of a page. It needs to know is my layout broken, and how. Cornea computes an abstract visual geometry model of every element (box, position, z-order, computed styles) and derives inspection conclusions. overlap, overflow, contrast, quality. Then exposes them as native tools on three surfaces: CLI, MCP, and HTTP API.
One promise holds everything together: same input → byte-identical output. No Chromium, no sub-pixel variance, no server. A single ~1.4 MB binary.
Quick start
Requires only
cargo. No browser, no Node, no system dependencies. Builds fine on a phone-class device.
Or install the cornea command from npm (no Rust toolchain needed):
Visual guide: what Cornea does
Take this page below. It looks fine as source. But it's hiding four layout bugs. Cornea finds every one.
Run it and Cornea reports the damage instantly:
Each finding is precise and actionable:
That is the value: hundreds of tokens, not hundreds of kilobytes, and a deterministic answer the agent can act on and re-verify.
Visual guide: the three surfaces
Cornea is one engine, three doors. All three returns identical inspection JSON because they funnel through a single shared dispatch.
1. CLI. Inspect a file
2. MCP. Native agent tools over stdio
An agent calls layout.* tools directly; it passes the page source, or a
live URL (see URL capture below), per call:
3. HTTP API. Call from anything
Watching a live page (URL capture)
Every surface accepts a URL where the HTML would go. Cornea fetches the page, inlines its external stylesheets and external scripts (relative URLs resolved against the page), then inspects what a browser would actually show. That is the live coding session loop: run your dev server, point cornea at it, read the layout verdict.
Honesty around capture:
- Failed fetches leave the original tag in place and record a note, so the report warnings still flag what did not load.
- A positive
heightemulates a fixed viewport (screenshot frame, iframe, email) and enables below the fold clipping checks. Default 0 means an unbounded scrolling page. - Capture is a snapshot in time. Determinism holds engine side: the same fetched bytes always produce the same report.
- Plain HTTP is supported natively. HTTPS pages need a TLS stack, which the binary does not carry; capture from a local http dev server or pre inline the page with a fetch layer of your own.
Architecture
Read the full technical spec: CORNEA-ARCHITECTURE.md
Fidelity. Honest about what's approximate
Cornea never silently fakes precision. layout.fidelity tells an agent exactly what it can trust, and every report carries its own warnings for sources the engine saw but did not apply (external stylesheets, external scripts, media queries, unresolved colors):
JavaScript built-in pages (Phase A)
Cornea can execute inline <script> that builds its DOM via a minimal shim,
then run the result through the same deterministic layout engine:
- Static HTML is mirrored into the shim before scripts run, so scripts can
attach to existing nodes via
document.getElementById, andinnerHTMLparses real markup into elements. Static content survives script runs. style.*assignments are serialized back tostyle="…"and participate in overlap/contrast checks.- Async APIs are rejected (
setTimeout,fetch, …) rather than hung. Any such use is surfaced in the report'sjs_notes, so determinism stays a guarantee. - External
<script src>runs only when a capture layer (URL capture) inlined its body first. - Full React/SPA mounting is Phase B (experimental). Tracked in
ROADMAP-JS.md.
Visual guide: testing (battle-tested)
54 tests run clean with cargo test; CI enforces fmt, clippy -D warnings, release build, tests, and a CLI smoke test on every push.
- Determinism. Same page inspected twice gives byte-identical JSON (the core thesis).
- Bug detection. The fixture's overlaps, overflows, and contrast failures are all asserted.
- End-to-end. The compiled binary is spawned and
layout.*is called over real stdio MCP. - HTTP. The TCP server boots on an ephemeral port and real requests are made.
- Live capture. A real page is served over a local socket; linked CSS must change a contrast verdict.
- Edge cases. Empty HTML, deep nesting (no crash),
display:none, long text, flex row/col, inline wrapping.
Layout support (v1 scope)
Repository layout
Status
Working MVP, hardened and battle-tested. Deterministic inspection engine with CLI + MCP + HTTP API, live URL capture, below the fold checks, report warnings, 54 passing tests, green CI, plus Phase A inline-script rendering (--js). The roadmap builds toward giving Cornea (and the sibling Crayon text-to-image project) an even richer perception over subsequent phases.
Publishing
Cornea is distributed four ways: npm (npm install -g optrex, gives the cornea command), crates.io (cargo install cornea), GitHub Release + Homebrew (brew install), and the MCP Registry (layout.* tools discoverable by agents). All are staged in this repo. See PUBLISHING.md for the tokens, server.json manifest, and the release/tag recipe.
mcp-name: io.github.AbduljabbarBXR/cornea
License
MIT. See LICENSE.
來源:README.md,提交 97cae15
工具
0版本歷史
1- v0.2.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Deterministic 整合
Deterministic
sh.deterministic官方發布者
一個遠端 MCP 伺服器,讓助理對模擬結果進行基於物理的驗證,並回傳含逐項檢查結論的收據。
EU EN-16931 & XRechnung Deterministic Validator
eu.iotpay
遠端 MCP 端點,用於驗證 EN 16931 與 XRechnung 電子發票 XML,並簽發 Ed25519 簽章的可驗證憑證。

Website Change Monitor & Deterministic Diff
由 GitHub 帳號 industrial-platform-ai 發布
付費遠端 MCP 服務,用來偵測公開網頁的確定性變化,回傳雜湊與文字差異,適合週期性監控。

SQAI — deterministic, read-only structured data
由 GitHub 帳號 thyn-ai 發布
本機 stdio MCP 伺服器,為助理提供受治理、確定性、唯讀的結構化資料查詢與運算工具,可讀取 CSV 等資料來源。

Deterministic
由 GitHub 帳號 archradhq 發布
ArchRAD Deterministic 以確定性規則驗證架構圖(IR),可從程式碼倉庫草擬 IR,並檢查設計與實際程式碼的落差。