Spec Driven Development
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
Fail-closed merge gate an agent calls before saying done: MERGE, BLOCK or INCONCLUSIVE.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ADVERSARY_GATE_BASE_REF, ADVERSARY_GATE_REQUIRE_PINNED_BASE, ADVERSARY_GATE_PYTHON, ADVERSARY_GATE_POLICYต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"adversary-gate": {
"command": "uvx",
"args": [
"adversary-gate-mcp"
],
"env": {
"ADVERSARY_GATE_BASE_REF": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_REQUIRE_PINNED_BASE": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_PYTHON": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_POLICY": "ใส่ค่าของคุณ"
}
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add adversary-gate --env ADVERSARY_GATE_BASE_REF='ใส่ค่าของคุณ' --env ADVERSARY_GATE_REQUIRE_PINNED_BASE='ใส่ค่าของคุณ' --env ADVERSARY_GATE_PYTHON='ใส่ค่าของคุณ' --env ADVERSARY_GATE_POLICY='ใส่ค่าของคุณ' -- uvx adversary-gate-mcpเติมค่าที่เว้นว่างไว้ก่อนรัน
วางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"adversary-gate": {
"command": "uvx",
"args": [
"adversary-gate-mcp"
],
"env": {
"ADVERSARY_GATE_BASE_REF": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_REQUIRE_PINNED_BASE": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_PYTHON": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_POLICY": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"adversary-gate": {
"type": "stdio",
"command": "uvx",
"args": [
"adversary-gate-mcp"
],
"env": {
"ADVERSARY_GATE_BASE_REF": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_REQUIRE_PINNED_BASE": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_PYTHON": "ใส่ค่าของคุณ",
"ADVERSARY_GATE_POLICY": "ใส่ค่าของคุณ"
}
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ADVERSARY_GATE_BASE_REF envADVERSARY_GATE_REQUIRE_PINNED_BASE envADVERSARY_GATE_PYTHON envADVERSARY_GATE_POLICY envค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 7 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub Sanflow10 ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (3.0.17) เข้า registry 10 วันที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี Spec Driven Development, Remote Desktop Commander, Zendesk
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Zendesk MCP Pack — tickets, users, organizations via OAuth.
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
High AI usage ≠ high confidence. The cost of an agentic coding pipeline is
not the model's intelligence — it is the pipeline's self-deception.
A fail-closed verification gate for patches written by AI coding agents. It runs your tests on the baseline and on the patch, mutation-tests only the lines the patch wrote, and answers MERGE, BLOCK or INCONCLUSIVE — where uncertainty is a first-class result instead of a silent approval. CLI, GitHub Action and MCP server.
Python only, for now. It measures Python/pytest repositories; on other stacks it runs your suite via --test-command but answers INCONCLUSIVE, never MERGE — see Language support.
pip install adversary-gate
B and C are the same patch. Same code, same tests, same execution. The only difference is that C brought evidence (--diff + --coverage-json); B brought none.
| Patch | Coverage evidence | Decision | Exit | |
|---|---|---|---|---|
| A | breaks the test | declared untrusted | BLOCK | 1 |
| B | clean | none — never measured | INCONCLUSIVE | 2 |
| C | clean | measured, both artefacts SHA-256'd | MERGE | 0 |
That middle row is the whole product. An unproduced measurement is not a measurement, so it cannot clear a floor — and a number nobody can re-derive is an opinion with a false precision label.
python3 demo/demo.py # runs the three scenarios; exits non-zero if one regresses
python3 demo/render_gif.py # rebuilds demo/demo.gif from the captured frames
demo/demo.py is an acceptance test, not a screenshot: it builds the fixtures, runs the real CLI as a subprocess, reads the real exit codes, and fails if any of the three decisions changes. Its evidence artefacts are checked in under demo/out/.
`INCONCLUSIVE` is not an error. It is the gate saying *"I did not measure that"*, and it is exit 2 so CI treats it as "do not merge yet", not as "pass". See How
diff_coveragegets its value for the one-step path fromINCONCLUSIVEtoMERGE.
From the root of a git repository whose agent's change sits on top of main (new files tracked: git add -N them), with pip install adversary-gate coverage:
BASE=main # the commit before the agent's change
W=$(mktemp -d) git worktree add -q "$W/before" "$BASE" # the baseline, exactly as committed git diff --no-ext-diff "$BASE" > "$W/changes.diff" # baseline -> your working tree coverage run -m pytest -q && coverage json -q -o "$W/coverage.json" adversary-gate --baseline "$W/before" --patch . \ --claim tests/test_shop.py::test_discount_never_negative \ --diff "$W/changes.diff" --coverage-json "$W/coverage.json" > "$W/answer.json" echo "exit $?" # 0 MERGE, 1 BLOCK, 2 INCONCLUSIVE python -c "import json,sys; a=json.load(open(sys.argv[1])); print(a['decision'], '-', a['reason'])" "$W/answer.json" git worktree remove --force "$W/before"
Replace the --claim with the test that proves your fix (path::test). On a correct one-line fix, expect this first answer:
exit 2
inconclusive - every claim held and the fix is proven, but suite strength's lower bound is 0.38, below the 0.75 floor (1/1 mutants killed): the change is too small to measure at this floor, which takes at least 5 killed mutants; see next_steps
That is not a failure: the fix *is* proven, and the gate says plainly that it could not measure how strong the tests are on a change this small. See Small changes.
adversary-gate \
--baseline /path/to/before \ --patch /path/to/after \ --test-path tests/test_auth.py \ --test-id test_token_expiry \ --diff changes.diff \ --coverage-json coverage.json \ --model "${AGENT_MODEL_NAME}" \ --evidence-log evidence.jsonl \ --report
Produce the two artefacts in your own pipeline, for example:
git diff --no-ext-diff baseline...patch > changes.diff
coverage json -o coverage.json # after: coverage run -m pytest
One run verifies any number of claims, and the decision is over all of them (one REFUTED blocks; one UNVERIFIED makes it INCONCLUSIVE):
adversary-gate ... --test-path tests/test_auth.py --test-id test_expiry --test-id test_refresh
adversary-gate ... --claim tests/test_auth.py::test_expiry --claim tests/test_api.py::TestLogin::test_ok
Or name none, and let the gate verify the tests that executed a changed source line — read from coverage.py's per-test contexts, not guessed:
printf '[run]\ndynamic_context = test_function\n' > contexts.coveragerc
coverage run --rcfile=contexts.coveragerc -m pytest coverage json --show-contexts -o coverage.json adversary-gate --baseline before --patch after \ --diff changes.diff --coverage-json coverage.json --discover-claims
A test file the patch rewrote is still picked, and judged with the baseline's copy of it (the baseline oracle, above); it is named under discovery (rewritten_test_files_judged_by_baseline), next to anything that could not be resolved to a node id, and the cap (--max-claims, default 10) with how many it cut. From 3.0.9 a cut test is not left unjudged: with the full suite off (--full-suite-path ""), a patch whose kept claims would merge is INCONCLUSIVE instead, and the reason says to raise the cap or run the suite. A report recorded without contexts is a usage error (exit 3), not "no tests".
adversary-gate ... --python .venv/bin/python \
--timeout 120 --cpu-seconds 60 --memory 2G \ --pass-env PATH --env PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
| Flag | Default | |
|---|---|---|
--python | the gate's own | the interpreter pytest runs on — the one your dependencies are in |
--timeout | 30 | wall-clock seconds per claim or mutant run; none removes it |
--cpu-seconds | 10 | CPU seconds per claim or mutant run; none removes it |
--full-suite-timeout | 900 | wall-clock seconds for the collateral full-suite run |
--full-suite-cpu-seconds | none | CPU seconds for the collateral full-suite run |
--full-suite-memory | 4G; none on Android | address space for the collateral full-suite run |
--memory | 512M; none on Android | address space per run (K/M/G); none — the JVM and Node cannot start under one |
--pass-env NAME | — | copy a variable into the runs (they start from a minimal environment) |
--env NAME=VALUE | — | set one |
--serial-sides | off | run the baseline and patch sides of a check one after the other instead of together, and the full suite after the claims and mutants instead of alongside the claims; forces --mutation-workers 1 (small machines; tests that share a fixed /tmp path or a port). The mutants never run beside the suite either way (AG-043) |
--mutation-workers N | 1 | mutants at once, each on its own copy of the tree. Only for claims that share nothing outside the repository: two runs that meet on the same /tmp path, port or test database make one of them fail, and a failing run counts as a killed mutant (AG-043). Not with --census-min-mutants |
The same choices apply to every run — claims, mutants and the collateral suite — except time and memory: the whole suite gets its own limits, because ones sized for a single test killed every suite of real size on both sides (out of time, or pytest dying with MemoryError under 512M of address space): never a MERGE (two failing sides are unverifiable), but the regression the suite would have caught came back INCONCLUSIVE instead of BLOCK (AG-033). The output records them under execution, with the names of the variables and never their values. A run the memory limit killed (MemoryError, Fatal process out of memory, Could not reserve enough space…) is reported as the harness dying, not as a failing test: it says nothing about the patch.
# 1. run your own command instead of pytest (any language, any runner)
adversary-gate --baseline before --patch after \ --test-path run_tests.sh --test-command "./run_tests.sh"
adversary-gate ... --sandbox bwrap
adversary-gate ... --test-command "make check" --sandbox bwrap \ --require-network-isolation
--test-command needs no --test-id (there are no node IDs to name), and it feeds the collateral full-suite run too unless you pass --full-suite-command. --sandbox bwrap needs bubblewrap installed and refuses to start without it — see Execution boundary for exactly what it does and does not contain.
Exit Codes for CI Integration:
0 — `MERGE`: Every claim executed cleanly and cleared coverage & suite strength floors.1 — `BLOCK`: Regressions or collateral suite failures detected.2 — `INCONCLUSIVE`: Infrastructure error, missing test, missing coverage evidence, or weak suite (blocks merge).3 — `USAGE_ERROR`: Bad arguments, malformed JSON, or a coverage claim that was not declared as untrusted.action.yml)One ref in. base-sha derives the baseline, the diff and the coverage report itself, so the first thing you install is not a INCONCLUSIVE:
name: Verification Gate
on: [pull_request]
jobs: verify-agent-patch: runs-on: ubuntu-latest steps:
No test is named: the Action records coverage per test and verifies the tests that executed the lines the pull request changed. Name them yourself with claims (one path::test per line) or test-path + test-id (one id per line); either one turns discovery off unless discover-claims: 'true'.
Any non-zero exit fails the step, and that is the safe default. BLOCK (1), INCONCLUSIVE (2) and a usage or harness error (3/4) all turn the check red. Do not add continue-on-error and stop there: that lets a BLOCK through along with everything else. If some pull requests are INCONCLUSIVE by nature (a change to C++ or SQL, which the gate runs but cannot measure), keep the step from failing and branch on the exit-code output instead (2.13.0 and later):
- name: Run AdversaryGate
id: gate uses: Sanflow10/adversary-gate@v3 continue-on-error: true with: base-sha: ${{ github.event.pull_request.base.sh
ตัดมาแค่ช่วงต้น อ่านต่อใน repo