
Arkgate
io.github.pedroknigge由 GitHub 帳號 pedroknigge 發布v4.8.24更新於 Oct 24, 2026
When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.
概覽
ArkGate 為 AI 撰寫的 TypeScript 執行匯入分層規則,在支援的宿主上於寫入時攔截違規匯入,並讓拉取請求檢查失敗。
- 可以做什麼
- ArkGate 是針對 AI 代理撰寫的 TypeScript 專案的匯入規則閘門。它檢查某一層的檔案是否匯入了不該匯入的內容,例如領域檔案匯入基礎設施,並給出違規報告與下一步建議。在支援的宿主上,寫入前的鉤子可以攔截所列出的寫入操作,同一檢查也會以必要狀態在 CI 中執行。選用項目還包括層內規則、實驗性的記憶體執行環境,以及對少數重大產品選擇的保護。
- 適用情境
- 當 AI 代理在具有多層邊界的儲存庫中撰寫 TypeScript,而且你希望在違規匯入落地前就阻止它,而不只是在代理完成後才發現時,值得加入。對於沒有代理、沒有分層邊界的小型程式庫,或不願維護設定檔與必要 CI 狀態的團隊,則屬於過度配置。
- 執行需求
- 以 npm 套件在本機執行(npx arkgate,目前版本 4.8.25),需要 Node.js 以及 npm、pnpm 或 yarn。要取得硬性保證,還需要規則檔案,以及一個執行嚴格合併檢查的必要 GitHub 狀態。未宣告任何驗證、環境變數或標頭。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Arkgate,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
ArkGate — Write. Check. Ship.
When the agent writes a bad import, the write doesn’t land. The same check fails the pull request.
ArkGate is import rules for AI-written TypeScript. Contener · Guiar · Ordenar: contain what the AI may write, and in what shape. Guide the next step. Order leftover mess toward a clean tree, a little at a time.
Why
AI takes the shortest path. One bad import lands, then another, and the product gets harder to change. A linter that runs only after the agent finishes sees the mess too late.
Design the boundary before you implement. Put a small interface in front of the work and keep the detail behind it. When leftover mess remains, the honest light is needs a refactor. Weakening the rules to paint the check green leaves that design unfinished.
Try it
One command. Preview only — no files change. Current release is 4.8.30
(check npm latest with npm view arkgate version):
What a red result looks like
After a rules file exists, a domain file that imports infrastructure fails the check (exit 1). This is real output from arkgate-check on [email protected]:
Do that next action. Classify the import, or introduce a port when the dependency is a real use case. Then run the check again.
That red line is the check. It does not stop every write. On Cursor, a hook without failClosed: true is fail-open: if the checker cannot run, the write still lands. Shell writes, hosted tools, and human edits are outside the local hook. The hard line for every path is a required GitHub status running arkgate-check --strict-merge. Until that status is required, the rules file is just documentation.
Anyone: Use ArkGate · Developers: Develop · This library: CONTRIBUTING
Appendix
The minute above is the product. Below is reference: the longer introduction, what this is not, hosts, commands, extras, and where release history lives.
Choose your path
Full map: docs/README.md
The longer introduction
AI can build fast—and make a mess just as fast.
Keep the product easy to understand, change, and trust.
Contain what the AI may write, and in what shape. Guide you with proven patterns and one next step. Order leftover mess toward a clean tree, a little at a time.
Safer changes, fewer surprises, and extra protection only when you choose it.
That is Contener · Guiar · Ordenar.
What this is not
Not an API Gateway. Not a folder linter. If the check is not required on the PR, the config is just documentation.
ArkGate is not a web framework, ORM, or job runner. The npm package is arkgate — not affiliated with the separate Archgate CLI project.
ArkRun is an optional experimental runtime. In-memory. Not Postgres. @arkgate/runtime is deprecated. ArkOrder does not replace import rules: layers can be green while the agent still rewrites the billing plan like a seat count.
What it is
When the agent writes a bad import, the write doesn’t land. The same check fails the pull request. That is ArkGate — import rules, always on once you adopt (Contener). The other three are optional.
Layers (who may import whom) always run. ArkRules, ArkRun, and ArkOrder change no
inter-layer verdict when absent. Label leftovers [Layer] vs [ArkRules] vs
[ArkRun] vs [ArkOrder].
Details: configuration · use.
[Write gate: agent blocked, then self-corrects]
Adopted means a required GitHub status running arkgate-check --strict-merge, or an explicit advisory-only stance. Status is compact (arkgate-check --doctor; --all for details).
When not to adopt
ArkGate is overkill for small trees with no AI agents and no multi-layer boundaries, for
single-developer hobby CRUDs under no integration pressure, and for teams that will not maintain
ark.config.json or a required CI status running arkgate-check --strict-merge. Without that
status the rules file is just documentation — stay with a boundary linter alone (see
Why not only ESLint / Nx / cruiser?).
Anyone path: docs/use.md — When not to adopt. Limits of a green
check: 4.3.0 — What ArkGate is / isn't.
Status lights (not settings)
Details: docs/use.md.
Start in one minute
start --apply pins arkgate with this repo's package manager (pnpm add -w / yarn add -W at a workspace root). Do not run npm install -D arkgate at a workspace:* root — npm rejects that protocol. After a local install, npx arkgate-check --doctor also works. arkgate-check is a command in the arkgate package, not its own npm package. If pnpm Age (minimumReleaseAge) blocks a brand-new release, keep using npx --package=arkgate@<version> — do not re-run the same add. Put arkgate on minimumReleaseAgeExclude in pnpm config or pnpm-workspace.yaml (a CLI flag is not enough), or wait until the package is mature.
start --apply refuses when projected governed coverage is below 50% or
shape confidence is weak (below 0.6 with coverage under 80%), or when the
planned write is too big for compact start (more than 8 gate files or 32 KB).
That lock is deliberate. Coverage/shape: lock with --archetype <id>,
--preset <name>, or --force. Size: --force does not unlock. Next:
npx arkgate-check --init. Or inspect ranked shapes with
npx arkgate-check --recommend.
That is the fuller path. Stuck? Run status (--doctor) and do action #1.
Keep the rules file out of product PRs. Local check:
ark-check --local --base origin/dev (same as --changed; refused with
--strict-merge). Changing the rules themselves uses --contract-session.
Aliases ark / ark-check / ark-mcp still work. npm / pnpm / yarn. No install lifecycle scripts
— and none on pack or prepare either, so pnpm add git+https://github.com/pedroknigge/arkgate
installs at a pinned commit with no allowBuilds entry. A git install gives you the CLIs and the
schemas; the library, MCP and ESLint entry points live in the built dist/ and come from npm.
See docs/package-surface.md.
Host enforcement support
Read the CI column: for every host, the repository-wide hard guarantee is a required
GitHub status context that runs the CLI — not “CI file present,” and not the CLI binary name alone.
Codex hard write covers only a complete local apply_patch; Cursor covers only listed
preToolUse ops with failClosed: true. A Cursor hook without that flag is fail-open
(if the checker cannot run, the write still lands). In both cases the project hook must be
installed + trusted, while shell/direct
filesystem writes, hosted or specialized opt-out paths, and human edits still rely on CI.
This table describes the supported profile after its files are installed and the host loads/trusts them. A hard local boundary covers only the listed hook operations; alternate tools, direct filesystem writes, and human edits still rely on CI. Write-gate order: install and trust the host pre-hook first. MCP prepare is fallback when that path is missing or fail-open. MCP validation is advisory because the agent must call it. The CI check blocks a merge only when the repository makes that status required. Repair envelopes may be emitted without reinjection being guaranteed; silent auto-apply never happens. Run arkgate-check --doctor (or ark-check --doctor) for the evidence actually detected in the current repository.
Why required CI is the hard line
The split above is a deliberate trade-off, not a gap. ArkGate validates at the earliest boundary
each host offers and enforces at the earliest boundary a repository can make non-bypassable: the
required merge status. Hard hooks (Claude Code, Grok Build, Google Antigravity, Cursor, and
Codex’s complete local apply_patch) deny their listed write operations at write time; advisory
surfaces (MCP, rules, OpenCode plugins) warn the agent while it works. But any local boundary can
be routed around — another tool, a hosted/specialized path, a direct filesystem write, or a human
edit — so the only guarantee ArkGate claims for every path is the
arkgate-check --strict-merge check, and only when the repository makes that status required.
Local checks optimize feedback speed; required CI owns correctness.
A useful consequence: the rules file doubles as a pressure sensor. Recurring violations or baseline
exceptions concentrated on one layer edge are evidence that the current design stopped fitting the
code — a reason to reshape the rules deliberately (start with /ark-explore), never to weaken
the check.
Setup per host: docs/ai-gates.md · Develop path: docs/develop.md
For authoritative MCP contract evidence, call ark_identity with the exact project root, then
call ark_manifest with that root plus the returned project id. A contained descendant requires
the matching id. The legacy ark://manifest resource remains compatibility-only and always
unverified/non-authoritative because standard resources/read cannot portably carry that
expectation.
Why not only ESLint / Nx / cruiser?
Common commands
More: docs/develop.md · skills install: docs/agent-guide.md · enthusiast track: docs/enthusiast/
Other skills, only when you need them
Day-to-day work uses the compact router and status. The full /ark-* pack is expert depth: install it when you want a guided next step, not as the first action. Catalog and install paths: Install skills — Ark and ecosystem.
Optional ArkRun
Gates need no app runtime. Skip this unless you want an optional runtime for decoupling.
ArkRun (arkgate/runtime, same npm package) is that runtime. Each
createStrictArkKernel() call is a new instance — no process singleton. Data
lives in memory and dies on restart. Fine for local. Not Postgres, not an
outbox, not Temporal. @arkgate/runtime is deprecated.
Dev inspector and observability dashboard
Opt-in startInspector() binds loopback only (127.0.0.1), refuses
NODE_ENV=production, and serves JSON facts — not a TUI. Alongside
GET /snapshot, GET /events (SSE), and GET /graph, the inspector exposes
queue monitors:
Poll those facts from the dual bins ark-dashboard / arkgate-dashboard
(bin/ark-dashboard.mjs). ANSI + polling only (no React/Ink/Blessed). Point
--url / -u at the inspector (handle.url or handle.snapshotUrl); the dashboard
also fetches sibling /outbox and /workflows. startInspector() binds a random port
unless you pass { port }, so the fallback http://127.0.0.1:3000/snapshot (or
ARK_DASHBOARD_URL) only matches startInspector({ port: 3000 }). --interval / -i
is clamped to 200–60000 ms (default 2000); --once, --help, --version are supported.
Also available as ark dashboard / arkgate dashboard (passthrough to the same bin). Kernel stays
JSON-only; presentation stays in bin/.
Durability stance
Default stores (InMemoryEventBuffer, InMemoryAuditStore, InMemoryReadModelStore,
InMemoryWorkflowStore) are reference in-memory only. Fine for tests. They
do not survive restarts and are not production durability. Wire real store
interfaces for production. Details: docs/production-hardening.md.
Optional ArkOrder
Layers stop a bad import. ArkOrder stops rewriting a big product choice — like the billing plan — as if it were a seat count. Change those choices through a valve, not a generic update.
Off unless you add arkOrder. Same npm package (arkgate/order). In-memory.
Not a service. Does not replace ArkGate or ArkRun.
Name the few choices (xiKeys: plan, cycle, tenancy — not seat counts). First
freeze is release(). Later change is proposeRelease then apply. A generic
update does not land.
Proof path (GitHub, not the npm tarball):
examples/arkorder-billing
— first freeze is release(); later plan change is proposeRelease then apply.
Gallery index:
examples/README.md.
Compact starters leave the extra off. Details: ArkOrder.
Documentation
Version notes live in CHANGELOG.md and on the site changelog. The docs hub keeps the per-version index: History and maintainer material.
Contribute to this library
Full guide: CONTRIBUTING.md · queue: ROADMAP.md
Website: arkgate.online · npm: arkgate
MCP: io.github.pedroknigge/arkgate
Node ≥ 18 · MIT
Ark doesn’t invent your product. It rejects the illegal write — and tells you when it isn’t really enforcing anything yet.
來源:README.md,提交 cdc2dc5
工具
0版本歷史
2- v4.8.24最新Sep 29, 2026
- v4.8.11Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分