Groundwork

io.github.nickjlamb由 GitHub 帳號 nickjlamb 發布v0.4.1更新於 Oct 24, 2026

Deployment-readiness checks for document-QA and extraction AI: grounding, extraction, CI gate.

已驗證STDIO僅桌面開發者工具AI 與機器學習

概覽

AI 產生的概覽

Groundwork 是本地 MCP 伺服器,為文件問答與資訊擷取類 AI 系統執行確定性的上線就緒檢查:依據性、結構描述驗證、編造偵測與成本概覽。

可以做什麼
對儲存庫執行就緒檢查,依名稱回報通過或失敗,包含與凍結基線的迴歸比較,以及失敗時回傳非零的 CI 式閘門。檢查單一回答的依據性,例如數字是否可追溯至提供的內容、無法回答的問題是否選擇棄答。不需儲存庫即可依結構描述驗證單筆擷取紀錄,檢查欄位準確性與編造欄位。為文件問答或擷取模式建立整套測試框架,包含轉接器、黃金案例、設定與 GitHub Action。依槓桿順序彙總實測的 token 用量與節省情況。
適用情境
當你已有可運作的文件問答或結構化擷取原型,想在 Claude Code 或 Claude Desktop 中以對話方式確認它是否依據內容作答、是否以棄答取代猜測、是否不低於迴歸基線,再決定上線時使用。也適合為新專案建立評測框架。
執行需求
以本機 stdio 程序執行,通常透過 npm 套件 @pharmatools/groundwork 以 npx 啟動,需要 Node.js 與 npm。檢查本身不需要 API 金鑰,可完全離線執行;只有可選的即時 Claude 範例需要金鑰。
安裝前請注意
這些檢查是確定性的下限,而非安全認證,專案本身也說明高風險輸出仍需人工複核。建立框架會在你的儲存庫寫入檔案,CI 閘門可能導致建置失敗。即時範例會將資料傳送給模型供應商,使用真實文件前請先了解去識別化前置步驟。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Groundwork,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Groundwork

Deployment-readiness harnesses for AI deployment patterns.

Redaction · evals from your real failures · a CI gate that fails fabrication

[npm] [CI] [node] [license] [Glama MCP server] [Listed on mcpservers.org]

Website · Getting started · Examples · Roadmap · Contributing · Changelog


You have a prototype: your documents, a model, useful output. What you don't have is the apparatus that makes it responsible to ship — a privacy pre-step, an evaluation built from your own failures, and a gate that stops a quiet prompt tweak from deploying a system that fabricates. That apparatus usually requires an ML engineer. Groundwork scaffolds it instead.

Groundwork's units are deployment patterns, not products — think Terraform modules for trustworthy AI deployments. groundwork init <archetype> scaffolds the whole harness for a pattern:

ArchetypeThe patternStatus
document-qadocuments → retrieval → grounded answers → human review✅ shipped
extractiondocuments → structured fields → schema validation → human review✅ shipped
research synthesisquestions → evidence → synthesis → human reviewplanned — see the roadmap

Every check is deterministic: same inputs, same result, every time — no LLM judge, and no API key for the checks themselves.

Quick start — 60 seconds, no API key

bash
git clone https://github.com/nickjlamb/groundwork.git && cd groundworknpm install && npm run buildnpm run demo          # document QA: the whole loop passes, fully offlinenpm run demo:break    # the system starts fabricating — watch the gate go red
✗ GROUNDING demo-savings: ungrounded number "14" — not in the provided context✗ GROUNDING demo-unanswerable-appeals: unanswerable question — the answer did not abstain

The same loop for structured extraction:

bash
npm run demo:extraction         # documents → fields, every check greennpm run demo:extraction:break   # a guessed date of birth, a dropped field — red, by name
✗ EXTRACTION demo-referral: SCHEMA: /referral_date must be string✗ EXTRACTION demo-referral: FABRICATED field "date_of_birth": document does not state it (got "12 April 1988")

That red build is the product: a fabricated figure, a guessed field, or a failed abstention becomes a CI failure, not a user complaint.

Ready for your own system?

bash
npm install -D @pharmatools/groundworknpx groundwork init                # document QAnpx groundwork init extraction     # structured extraction

How it works

[Architecture: your repo (adapter, gold cases, config) flows into groundwork check (redaction pre-step, eval, results) which is compared against a committed baseline by a CI gate]

You editGroundwork runsThe gate enforces
adapter.mjs — one file: answer() for document QA, extract() for extractionRedaction pre-step (Redacta) — identifiers become labelled tokens locally, before anything is sentcheck --baseline freezes a good run as the floor
datasets/cases/*.json — gold cases from real questions and real documents, labelled by handThe archetype's eval (OpenGATE) — document QA: anchored facts · numbers trace to context · abstention. Extraction: schema validity · field accuracy vs gold · no fabricated fieldscheck --ci in the scaffolded GitHub Action fails any PR below it
groundwork.config.json — archetype, redaction, eval, and gate settingsCost profiling — measured token usage, savings in leverage order (caching → batching → trimming → routing)A human still reviews high-stakes outputs — the gate is a floor, not a certification

For extraction, one schema choice does most of the safety work: nullability is the abstention contract. A field the system must always find is non-nullable; a field the document may not state is nullable, and the system returns null for it — unknown → null, never guessed. A guessed value in a null-gold field fails by name: FABRICATED field "date_of_birth": document does not state it.

Examples

ExampleWhat it showsRun
demo/Document QA: the full loop on a tiny local system — and the gate catching fabrication by name. Zero network.npm run demo / npm run demo:break
demo-extraction/Structured extraction: schema validation, field accuracy, and the gate naming a guessed date of birth and a dropped required field. Zero network.npm run demo:extraction / npm run demo:extraction:break
examples/claude-doc-qa/A real Claude-backed system: answer-from-document-only prompting, prompt caching, key-gated evals, measured usage feeding groundwork cost — plus a mock API so the whole loop runs offline in CI.npm run example:mock (offline) / npm run example:check (live)
examples/claude-extraction/Claude filling a schema from fictional referral letters: unknown → null in the prompt contract, the schema as the cached prefix, and the gate catching a guessed date of birth — plus a mock API for offline CI.npm run example:extraction:mock (offline) / npm run example:extraction:check (live)

Commands

groundwork init [archetype]      scaffold the harness for a pattern (document-qa, extraction)groundwork check                 redaction self-test + the archetype's evalgroundwork check --baseline      freeze this run as the regression floorgroundwork check --ci            exit non-zero on failure or regression vs baselinegroundwork cost                  measured token usage + savings, in leverage order

Two ways to learn it: docs/GETTING-STARTED.md is the reference walkthrough (about half an hour), and the course covers the same ground as checkpoint-driven lessons — including the sabotage test, where you deliberately break your own system to prove the gate catches it, and a lesson on the extraction archetype. The scaffolded playbook (GROUNDWORK.md) lives inside your repo, where your team will actually read it.

Use from Claude

The same checks ship as an MCP server (groundwork-mcp, stdio) so Claude Code, Cowork, or Claude Desktop can run them conversationally — check_readiness on a repo, check_answer_grounding on a single answer, check_extraction on a single record (no repo needed), scaffold_harness, cost_summary:

json
{ "mcpServers": { "groundwork": { "command": "npx", "args": ["-y", "@pharmatools/groundwork", "mcp"] } } }

There's also an Agent Skill (skills/groundwork-readiness/) that teaches an agent to run the gate and report results honestly — including refusing to present a green check as a safety certification.

What Groundwork is not

Groundwork is a strong floor, not a guarantee. Deterministic checks catch the failures that can be caught deterministically; they cannot certify an AI system safe. For high-stakes outputs — anything touching health, money, legal standing, or safety — a human must review before the output reaches the person it affects. Extraction raises the stakes quietly: the record feeds decisions, so a wrong field is a wrong decision. The scaffolded playbook says this too, on purpose.

Project

  • Status — two archetypes shipped (document QA, structured extraction) of a planned three. Depth before breadth: each pattern gets finished properly before the next starts. See the roadmap.
  • Contributing — bug reports, gold-case patterns, and examples are especially welcome: CONTRIBUTING.md.
  • Releases — tagged on GitHub, versions on npm, history in CHANGELOG.md.
  • Built on — OpenGATE (evaluation) and Redacta (privacy), both open source.

Licence

MIT. Everything init scaffolds into your repo is MIT-0 — yours, no attribution needed.

來源:README.md,提交 7a5fd1b

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.1最新Sep 28, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。