
Qualityforge
io.github.ninelegsdog由 GitHub 账号 ninelegsdog 发布v0.2.3更新于 Nov 4, 2026
Evidence-first browser QA with read-only MCP server for AI agent debugging.
概览
只读 MCP 服务器,让 AI 助手读取 QualityForge 浏览器测试证据:失败项、缺陷工件、不稳定测试、趋势与无障碍审计。
- 可以做什么
- 查看最近一次测试运行:计数、质量门禁结论、策略链与历史结论
- 列出并读取失败项与缺陷,含控制台、网络与页面错误信号
- 分析跨运行的测试不稳定情况与通过率趋势
- 查看无障碍审计记录及每条规则的节点计数
- 读取最近运行摘要与单个缺陷的资源,并使用 triage_failure 提示
- 适用场景
- 适用于项目已在运行 QualityForge 或 Playwright 测试套件,并希望助手基于已保存的证据诊断失败的浏览器测试,而不是靠猜测,同时不赋予其修改代码或工件的能力。
- 运行要求
- 以 npm 包 qualityforge 形式通过 stdio 在本地运行,需要 Node.js 22 或更高版本;MCP 服务器通过 qualityforge-mcp 命令或构建后的 dist 入口启动。必须先有工件:先运行测试套件和缺陷收集命令,或传入绝对的 --root 目录。Linux 是经验证的平台,Windows 与 macOS 未测试。未声明任何认证或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Qualityforge,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
QualityForge
Evidence-first browser quality automation for modern web applications.
QualityForge is an open-source foundation on top of Playwright that turns a failing run into evidence a machine can read: normalized defect artifacts with trace, screenshot and video, a quality gate with explicit thresholds, capture of console, network and page-error signals — and a read-only MCP server that hands all of it to an AI assistant without granting it the ability to act.
[CI] [npm] [Node >= 22] [MCP protocol 2026-07-28] [License]
Status — stable, published.
[email protected]is on npm since 2026-10-21 (0.1.0on 2026-10-15 was the first stable release), and the defect contract isdefect.v1at 1.6.0. The0.xline still allows breaking changes in a minor, so pin the version you install.
Contents
- Why this exists
- What you get
- Quick start
- The demo app
- The evidence pipeline
- Defect artifacts
- The MCP server
- Configuration
- Commands
- Rules enforced in CI
- Documentation
- Contributing
Why this exists
Most teams end up with a pile of one-off UI tests per project: duplicated selectors, no shared failure evidence, no cross-project view of quality. QualityForge is a reusable core instead — one configuration, one evidence format, one set of quality gates, pointed at any web application.
The differentiator is not “AI writes tests”. Playwright already ships agents for that. It is the evidence layer between a failing run and any agent: defect artifacts normalized into one schema, readable without granting the reader the ability to act.
What you get
- An evidence pipeline. Trace on first retry, screenshot and video on failure, in Chromium, Firefox and WebKit. A run that fails still publishes its artifacts.
- One normalized defect format.
defect.v1, contract 1.4.0: a versioned, validated artifact per failure that extends Playwright'serror-context.mdrather than duplicating it. - A quality gate. The collector splits by spec × project, refuses duplicate ids, treats an aborted suite as one outage instead of a defect per test, and exits non-zero when thresholds are violated.
- Signal capture. Console errors, uncaught page errors, failed requests and
HTTP errors above 400 — redacted at the source, bounded per category, with a
signals.droppedcount so a truncated capture never looks complete. - A read-only MCP server. Protocol 2026-07-28, thirteen tools, resources and a
triage_failureprompt, verified against OpenCode v2.0.16 over real stdio. - Run history. One compact file per run, so “is this a regression or has it always been this way” has an answer.
- CI that checks itself. Six legs — lint and typecheck, unit tests on Node 22 and 24, the suite on three browsers — plus a job that installs the real OpenCode client and asserts the frames that cross the wire.
Quick start
Development requires Node.js 22 or newer — Node 20 reached end-of-life in
March 2026, and "engines": ">=22.0.0" says so instead of promising install
politeness. CI runs Node 22 and 24, and the floor is the lower of the two.
.nvmrc pins 22 for contributors: tsc dies with a segmentation fault under
one Node 24.21.0 build on this machine, reproducibly. If you use a version
manager, run nvm use before anything else.
Platforms. Linux is what CI runs and therefore what is verified. The core
is written to be platform-neutral — path.sep and path.relative throughout,
no POSIX-only calls — so Windows and macOS should work, and have not been
tested. Treat them as unverified rather than supported.
npm test starts the bundled demo app automatically, so a fresh clone runs
green with no configuration and no third-party network dependency. Open the
HTML report with npm run report. For a step-by-step path — seeing a real
failure with evidence, collecting defect artifacts, connecting an agent,
pointing the suite at your own application — follow
docs/quick-start.md, or
docs/quick-start.ru.md.
The demo app
fixtures/ is a small multi-page app that exists so the suite has something
real to test. It is not a mock: it renders, validates and fetches.
Every control is labelled, every message has a role, and every element the tests need has a stable handle — the suite asserts on what a user perceives, not on markup structure.
The evidence pipeline
The project's core promise is that a failure leaves enough evidence to diagnose it, and that claim is tested, not asserted:
This runs two deliberately failing tests and exits non-zero. Afterwards
test-results/ contains, per failure:
error-context.md is the most interesting one: it is written as an instruction
to an assistant — “explain why, be concise, respect best practices” — followed
by the test name, file location, error and the diff of expectations. It is the
raw material an agent needs, and it costs nothing extra.
On CI, prefer the trace viewer over screenshots and videos when debugging: it gives the DOM snapshot at each action plus the full network log.
Defect artifacts
A failing test is only useful if the failure can be read later without re-running anything. QualityForge turns each failure into one normalized, versioned artifact:
The artifact deliberately extends Playwright's error-context.md rather
than duplicating it: it records a path to that file and adds stable identity,
run correlation, VCS context, evidence pointers and a flakiness verdict. The
signals block — console errors, uncaught page errors, failed requests, HTTP
errors above 400 — is collected live by the bundled fixture, because “element
not found” is a symptom while “the page threw a TypeError” is the cause. See
docs/defect-schema.md for the full contract.
Accessibility is a second, separate measurement rather than a field on that
artifact: npm run a11y:audit runs axe-core against a page and writes
a11y-audit.v1 — capped at ten nodes per rule with the discarded count stated,
html reduced to structure because it carries page content, and target kept
because without it the nodes are indistinguishable. See
docs/a11y-schema.md.
npm run defects:collect doubles as a CI quality gate: it exits 0 when the
gate passes, 1 when thresholds are violated, and 2 when collection could
not run at all.
Installing the package
latest points at this release. Pin the version you want rather than trusting
a tag name anyway: npm forbids removing latest, so a tag can only ever move
forward, and a bare npm i qualityforge takes whatever it points at rather
than what you tested against.
A consuming project imports the fixture from the build — Playwright refuses to
transpile TypeScript under node_modules, so the fixture is shipped as a
subpath in exports:
That one import change is the whole integration: console, page-error and network capture become automatic. Everything captured is redacted at the source — URLs keep scheme, host and path with query strings and credentials removed, console text has tokens and JWTs replaced, sensitive header values are masked while their names are kept — and capture is bounded at 40 entries per category.
@playwright/test is a peer dependency: a consuming project brings its own,
and npm 7+ installs it automatically when it is missing, because the fixture
cannot run without it. The declared range is ^1.63.0; the number CI verifies
is 1.63.0, pinned exactly in devDependencies, and npm run package:check
fails if the package stops declaring the peer or npm stops installing it for
the consumer.
The bin entries publish the two commands a consuming project runs — always
through npx --no-install, which provably cannot reach the registry for
somebody else's code:
The MCP server
npm run mcp starts a read-only MCP server over stdio, speaking protocol
2026-07-28. It hands an agent the evidence layer: what failed, where, and what
the page was doing while it failed. Verified against OpenCode v2.0.16 on
Linux by connecting with the block below; Kilo and MiMo are out of scope by
decision — see the end of this section.
A project that installed the package needs no path at all:
["npx", "--no-install", "qualityforge-mcp"] runs the same server out of
node_modules/.bin. The command points into dist/, which npm ci builds
(prepare runs tsc) — or npm run build, if the install was done with
--ignore-scripts. opencode mcp list then reports the connection status;
run it more than once before you believe it — the status is a sample of a
connection still forming, not a verdict.
Plus resources for the latest run summary and any defect, and a
triage_failure prompt that asks for facts before hypotheses.
Before you connect
- Produce the artifacts first. The server exits 1 when it cannot find an
artifacts root, and the message saying so goes to stderr, which the client
discards — so all you see is
failed: Connection closed. Run the suite andnpm run defects:collectfirst, or pass--root <dir>. - Use absolute paths. A client spawns the server from your project directory, not from this checkout, so a relative root resolves somewhere that does not exist.
- Spell the runner out. The block points at
dist/, so nothing transpiles at connection time:initializewas answered in ~0.24 s here, against ~2.4 s for["npx", "tsx", …, "src/mcp/index.ts"], and OpenCode's documented default MCP timeout is 5000 ms. - Both config forms connect. The flat
mcp.<name>shown above and the V2-documentedmcp.servers.<name>were both connected on v2.0.16. The difference is which file wrote it, not whether it works.
Read-only by construction
There is no write path in the server: no tool mutates anything, and the store exposes no mutating method. Read-only is structural, not a promise.
Every client-supplied path is treated as hostile, because client-side path
allowlists are a convenience rather than a boundary. Absolute paths, ..
traversal before and after percent-decoding, NUL bytes and symlinks resolving
outside the root are all rejected — and the rejection message never echoes the
filesystem layout, since it can end up in a transcript.
Why the protocol is hand-written. The official @modelcontextprotocol/sdk
was checked rather than assumed: version 1.32.0 declares
LATEST_PROTOCOL_VERSION = "2025-11-25" and contains no server/discover, no
resultType, no ttlMs/cacheScope and no subscriptions/listen — it does
not implement 2026-07-28. The 2025-11-25 handshake is still accepted, because
a client that never sends initialize must still get tools/list.
Kilo and MiMo are not supported, by decision — not merely untested. The owner decided on 2026-10-03 not to pursue them: the server-side work a third client would require is better spent on the one client that is real. If you use them, nothing in this document says whether the block above is accepted.
Configuration
config/project.json declares the project name, the
origin under test, the evidence policy, gate thresholds, and where artifacts
are written. It is validated on load, and every problem is reported at once
with the exact path:
Run history
An optional history block keeps one compact file per run, so the question
“is this a regression, or has it always been this way” has an answer:
It is committed on purpose, unlike artifacts/: a history entry is a few
hundred bytes of counts and outcomes, and it is the only thing that makes a run
worth having had. Each entry records which specs did not pass, and two MCP
tools read it: quality_flaky_tests separates a spec that recovered from one
that never did, and quality_get_trend reports a direction over a window and
answers unknown below four runs. Left unset, history is off and nothing
extra is written.
Commands
The Python-based checks — mcp:check*, mcp:schema, mcp:live,
defects:check, docs:numbers, docs:support, docs:tools and ci:validate
— are separate scripts so that verify stays runnable with only Node installed.
mcp:live additionally needs the opencode binary; without it the check fails
rather than skips — a live-client check that quietly passes without a client
would be decoration.
Rules enforced in CI
page.waitForTimeout()is banned by a lint rule. It is the main cause of flaky tests; wait for a real condition instead.test.only()anddescribe.only()are banned. In CI they would silently skip the rest of the suite.@typescript-eslint/no-floating-promisesis an error. A forgottenawaiton a Playwright call makes a test quietly assert nothing.- Selector policy is a lint guard, not advice: CSS, XPath and the
text=shorthand in a literallocator()argument failnpm run lint. The hierarchy — role, then label, then text,data-testidlast — is indocs/selectors-and-testid.md. - Formatting and type checks must pass.
Everything in this repository follows the same rule: nothing is done until it has run in the real environment and been observed to fail for the right reason. Claims about reports, protocol frames and runner verdicts are checked against the real producers, never against a hand-written fixture.
Documentation
docs/quick-start.md— a step-by-step path from a fresh clone to an agent reading a real failuredocs/architecture.md— how the pieces fit togetherdocs/defect-schema.md— thedefect.v1contractdocs/a11y-schema.md— thea11y-audit.v1contractdocs/selectors-and-testid.md— locator policydocs/client-support.md— who was connected to the MCP server, and what was observeddocs/roadmap.md— where this is going, and where it is notdocs/parallel-work.md— how several agents work in this repository without collidingAGENTS.md— rules for coding agents working in this repoCHANGELOG.md— release history
To start a project from rather than to read: the template, https://github.com/ninelegsdog/qualityforge-template, installs this package from git, runs green from a fresh clone, and ships the MCP block already written.
Contributing
See CONTRIBUTING.md — set up, pull-request rules, test
expectations, and the expectations for AI-assisted contributions. Use the issue
templates for a bug report or a
feature request, and the
PULL_REQUEST_TEMPLATE.md when you open a
pull request.
Security issues: read SECURITY.md first — do not open a public
issue for them.
License
Apache-2.0 — see LICENSE. Be straightforward and assume good
faith: the community standards are in
CODE_OF_CONDUCT.md.
Why evidence-first?
Обычный тест-раннер говорит «failed». QualityForge говорит «почему упало» — собирает артефакты для быстрого разбора агентом или человеком.
Артефакты при падении
- Screenshot — скриншот состояния страницы в момент падения
- Trace/Video — трассировка Playwright для воспроизведения
- Logs — консольные логи и сетевые события
- HAR — сетевой трафик (опционально)
- Context — URL, viewport, шаги, ожидания
Интеграция с агентами
В комплекте read-only MCP-сервер. Агент может прочитать артефакты падения, понять контекст и предложить точечный фикс без догадок.
Used in production
QualityForge is used to verify the BotKit ecosystem of 9 production Telegram bots via botkit-farm. The MCP server enables AI agents to analyze test failures with full evidence (traces, screenshots, network logs) without direct access to modify code.
Agent Infrastructure Focus
Built as part of a broader agentic development infrastructure - harnesses, quality gates, and verification-first workflows for AI coding agents.
来源:README.md,提交 9ddcaf9
工具
0版本历史
2- v0.2.3最新Nov 4, 2026
- v0.2.1Oct 31, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
