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 分

    请在仓库或注册中心条目中声明许可证。