Squire

io.github.reidgoodbar由 GitHub 账号 reidgoodbar 发布v0.6.5更新于 Oct 27, 2026

CLI-first remote runtimes for validation and offload tasks, exposed over MCP stdio.

已验证STDIO仅桌面文件与存储开发者工具

概览

AI 生成的概览

Squire 是面向编码代理的本地执行与验证层,可重放已验证的只读仓库命令,并持续维护工作区校验状态。

可以做什么
  • 加速只读仓库命令:git 元数据、status、ls-files、diff 及有界 log 历史由已验证的观测结果重放,而非重新执行。
  • 读取与搜索文件:有界的 cat、sed、head、tail、nl、file、定长字符串 grep/rg 以及受限的 ls 形式。
  • 探查环境:版本探测、which、安全的 printenv、whoami、id、hostname 与 uname。
  • 在受支持的来源与过滤器上组合只读管道,返回精确的 stdout、stderr 与退出状态。
  • 在后台运行声明的测试、lint、类型检查与构建,并在相关输入变化时将结果标记为过期。
  • 查看仓库与运行时状态,并解释某条命令将如何处理。
适用场景
适用于编码代理频繁重复执行只读仓库命令、希望获得更快且可验证的结果,并需要持续后台验证声明检查的场景。主要面向运行 Codex 类代理工作流的 macOS 与 Linux 主机。
运行要求
以本地进程方式运行,支持 macOS 与 Linux 的 amd64 或 arm64,安装程序将二进制放入 ~/.local/bin。可选 SQUIRE_TOKEN 用于会话或无头令牌,可选 SQUIRE_API_BASE_URL 覆盖默认 API 地址;不提供令牌时支持匿名访问。仅限桌面端,无网页可执行版本。
安装前请注意
仓库提供的检查命令在你信任其确切哈希后会在后台运行,任何配置改动都会撤销该信任,因此信任前应先审阅检查文件。可选的 SQUIRE_TOKEN 属于凭据,不应写入共享配置。变更类命令、构建、安装及不支持的语法会回退到原生执行,而不是被阻止。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Squire,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Squire

Squire is a transparent local execution and verification layer for coding agents. It keeps common repository reads hot and continuously maintains whether the current declared workspace state is verified.

The agent keeps using ordinary terminal commands. Before Codex starts a local read-only command, Squire checks current state and either replays a proven mmap observation or executes a small bounded operation over hash-verified current file bytes. A valid hit returns the exact stdout, stderr, and exit status. Every miss follows Codex's original native execution path.

Install

sh
curl -fsSL https://raw.githubusercontent.com/reidgoodbar/squire/main/install.sh | bash

The installer verifies matching Squire and Squire-Codex release archives and installs the driver, Codex runtime helper, and host-native Squire runtime to ~/.local/bin. It does not change Codex authentication or configuration. Supported hosts are macOS and Linux on amd64 or arm64.

Check the installation:

sh
squire doctor

doctor exits nonzero when any required driver, helper, runtime, or ABI component is missing.

Use

Start from any directory:

sh
squire codex

That is the complete user path. There is no setup command, global shell shim, prompt change, MCP tool, preload injection, or VM provisioning step. If Codex moves into a repository later, Squire discovers and prepares that repository from the command's actual cwd.

squire-codex is also installed as a direct convenience command.

Inspect the current repository and runtime:

sh
squire statussquire status --jsonsquire explain -- git status --short

Continuous Verification

Squire Green runs declared tests, lint, typechecks, and builds natively in the background after repository edits settle. Each result is bound to the exact declared input bytes, check configuration, environment, and executable. A later relevant edit makes that result stale; unrelated edits do not.

toml
# .squire/checks.toml[[check]]name = "tests"command = ["go", "test", "./..."]inputs = ["**/*.go", "go.mod", "go.sum"]timeout = "10m"

Repository-provided commands never run silently on first use. Review the file and trust its exact hash once:

sh
squire green trustsquire verify

Any config change revokes trust. squire codex then schedules trusted checks automatically; no second daemon or warm command is required. See docs/GREEN.md for configuration and proof semantics.

What It Accelerates

Production lanes are bounded but cover the common read-only command surface:

  • Git metadata: supported git rev-parse forms and branch discovery.
  • Repository reads: supported git status, git ls-files, and git diff forms, including path-scoped diffs and git diff --check, plus bounded git log -N --oneline -- <literal paths> history.
  • File and search reads: bounded cat, ordered single- or multi-range sed -n, head, tail, nl -ba, file, fixed-string grep/rg, demand-prepared bounded repository rg searches, and tight ls forms.
  • Environment discovery: supported version probes, which/command -v, safe printenv, whoami, id, hostname, and uname forms.
  • Compositions: complete read-only plans over supported sources and filters, including pipes, sequences, redirection to /dev/null, head, tail, bounded sed -n, grep -F, wc -l, and sort.

No operation is removed. Builds, tests, edits, installs, mutating Git commands, expansions, unknown shell syntax, sensitive probes, and unsupported variants immediately follow Codex's unchanged native path. A safe cold miss does the same while requesting exact preparation in the background. rg --files remains outside the bounded preparation policy and follows the native path.

Supported commands compile into typed bounded plans rather than exact command templates. Source proof and execution are separate: one proven file snapshot can serve different line selections, filters, and compositions without a cache entry for each command string. The same plan representation is implemented by the Go engine and native runtime, keeping future read operators additive while differential tests enforce parity at the ABI boundary.

Why Hits Are Current

Squire caches observations, not authority. A foreground replay either recomputes the inputs that can affect that command or reuses a cryptographic fingerprint while a complete kqueue/inotify guard reports no dependency change. The prepared epoch must still match. Proof inputs include the normalized command and cwd, Git refs/index/config and external behavior files, relevant workspace state, canonical paths, content hashes, command-specific environment proof, and executable identity. Guard failure always invalidates the resident proof.

For bounded file reads, an epoch mismatch may instead use the current-file lane: Squire retains the exact bytes read while computing the foreground SHA-256 proof and applies only its fixed byte grammar to those bytes. This requires no rewarm and does not persist the file or result. The cache may still contain stale records, but they are never replayed after a proof mismatch. Missing state, corruption, unsupported syntax, an ABI mismatch, or an unprofitable proof all become native fallback.

The invalidation suite changes file bytes without changing size or mtime, mutates the Git index and untracked set, changes same-size diffs, edits Git config, commits, renames branches, changes loose and packed object namespaces, changes environment inputs, and probes outside-workspace symlinks. Returning old bytes or an unsafe hit fails the release.

See SQUIRE_CONTRACT.md for the complete invariants.

Current Runtime Check

On July 16, 2026, a 500-command randomized production-ABI run recorded 421 exact hits, 79 safe fallbacks, 468 native comparisons, zero mismatches, and zero unsafe hits. Hit p50/p95/p99 was 0.315/0.630/0.933ms; the same commands ran natively at 8.084/27.692/51.820ms. A separate 500-query repository-search differential had 500 exact or order-equivalent hits and zero semantic mismatches. Bounded path history was 28/28 exact at 0.333ms p50 and 0.492ms p99 versus 20.060ms native p50. All 2,048 steady calls were exact with 0.433ms wall p99. Under eight-way load, CPU p99 was 0.334ms; scheduler- contended wall p99 was 3.242ms.

Fresh live gpt-5.6-luna treatments independently replayed 2/3 Express calls (66.7%), 5/5 Flask calls (100%), and 4/5 fmt calls (80%). Every treatment passed the 50% all-terminal-call gate with valid accounting and zero diagnostic mismatches. These small live samples validate coverage, not causal whole-task wall time; model trajectories diverged before seeing tool results.

A deterministic 40-pair Codex attribution test held model responses, commands, workspace, and terminal payloads fixed. Six serial calls fell from 374.876ms to 103.600ms, saving 271.277ms (72.4%, paired 95% interval 265.630-276.540ms). Two parallel batches saved 52.6%. AB and BA orders both remained positive, while interleaved A/A and B/B intervals included zero.

Full methodology and historical tables: docs/BENCHMARKS.md.

Architecture and backend notes: docs/ADVANCED.md.

来源:README.md,提交 8a141c3

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.6.5最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

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