GitPin

io.github.shmindmaster由 GitHub 账号 shmindmaster 发布v0.6.4更新于 Oct 24, 2026

Prove and verify multi-repo claims at Git HEAD: path, line, full SHA, no index.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

GitPin 让助手从本地 Git 仓库获取只读、仅限 HEAD 的证据,返回精确的路径、行号和完整提交 SHA,可用 git show 复核。

可以做什么
GitPin 是面向多仓库 Git 根目录的本地证据 MCP 服务器。它提供十二个只读的 pin.* 工具:pin.catalog 发现仓库,pin.search_docs 与 pin.search_code 查找候选,pin.prove 与 pin.prove_set 生成包含路径、行切片、完整 SHA 和内容哈希的证据包,pin.verify 与 pin.verify_set 对照 HEAD 复核声明,另有 pin.analyze、pin.inspect 和 pin.compare。搜索结果被标记为候选而非证明,未提交的改动不会被当作 HEAD 证据引用。
适用场景
当助手对本地 Git 仓库中的代码或文档做出事实性声明,而你希望在合并前把这些声明绑定到确切的已提交行时使用。它适合多仓库回答、PR 证据门禁,以及需要人工或流水线用 git show 逐条复核的 CI 检查。
运行要求
作为桌面本地 stdio 进程运行,从 npm 包 gitpin 安装,需要 Node 20 或更高版本。列出本地 Git 仓库根目录的注册表 YAML 由 GITPIN_REGISTRY 指定路径读取,默认为 ~/.gitpin/repositories.yaml。stdio 传输未声明认证要求。
安装前请注意
该服务器为只读,不会写入、提交或推送被索引的仓库,也不会执行 PR 代码。它会读取本地 Git 仓库,因此 GITPIN_REGISTRY 中的注册表路径决定了哪些内容对助手可见。可选的 HTTP 设置包括 GITPIN_MCP_TOKEN 和 GITPIN_ALLOWED_HOSTS;任何令牌都应视为机密。定位匹配并不等于语义正确性的证明,依赖前请先复核声明。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[!IMPORTANT] Archived 2026-10-15. Superseded by Assay, a reference architecture for deterministic agent control. Why: the same agent writes both the change and its evidence manifest, so the gate proves coverage and hash pinning, not that a claim is true. Assay moves the decision into deterministic code instead. The last release, 0.6.4, stays on npm. The rest of this README is unchanged.

[GitPin: agent pull requests must show exact evidence before they merge.]

GitPin

Agent-authored pull requests must show exact evidence before they merge.

A read-only PR gate and local MCP server that ties every claim an AI agent makes about its change to an exact committed line that anyone can re-check with plain git.

[Validate] [npm] [MCP Registry] [License: MIT] [Node.js Version]

Quickstart · Watch the film · Use it in your repo · How it works · Guardrails · Status


Why it exists

Coding agents now open pull requests with confident descriptions: "added retry logging", "updated the protocol doc", "no other files touched". A reviewer who wants to trust one of those sentences has to open the file and hunt for the line, then do it again for the next sentence. Most reviewers stop checking, and an agent can change a file it never mentions.

GitPin turns the description into evidence. The agent commits a small manifest in which every material claim names the paths it covers and points at an exact line slice with a SHA-256 of its text. A required check compares that manifest with the real diff. Any changed file that no claim covers fails the build, and every claim that passes can be re-checked by a human with git show, without GitPin, without the agent and without a hosted platform.

Quickstart: the gate in 30 seconds

bash
git clone https://github.com/shmindmaster/gitpin.git && cd gitpincorepack enable && pnpm install --frozen-lockfilepnpm demo:gate

demo:gate builds GitPin, creates a throwaway synthetic repository in a temp folder, and runs the real gitpin gate twice. The agent's first commit changes docs/protocol.md without claiming it, so the gate fails with exit 1. The agent adds one evidence locator (line 5, hashed) and the same gate passes with exit 0:

text
$ gitpin gate --base <base> --head <agent-commit>status: failed   exit code: 1violation: uncovered-change: Changed path has no material claim: docs/protocol.md.covered: synthetic-service/docs/overview.md:3 @ <agent-commit> (verified)$ gitpin gate --base <base> --head <locator-commit>status: ok   exit code: 0covered: synthetic-service/docs/overview.md:3 @ <locator-commit> (verified)covered: synthetic-service/docs/protocol.md:5 @ <locator-commit> (verified)

Nothing is written outside the temp folder, and the folder is removed afterward.

See it run

[GitPin demo: the gate fails an agent pull request that changed an unclaimed file, then passes after one hashed line locator is added.]

Watch the 90-second film → · The 30-second cut →

Use it in your repo

1. Install the trusted policy on your default branch (a separate, reviewed change, so a pull request can never weaken its own gate):

bash
mkdir -p .gitpincurl -fsSL https://raw.githubusercontent.com/shmindmaster/gitpin/v0.6.4/templates/gate.yml -o .gitpin/gate.yml

2. Make it a required check:

yaml
name: Agent delivery assuranceon: pull_request            # never pull_request_targetpermissions:  contents: readjobs:  evidence:    runs-on: ubuntu-latest    steps:      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1        with:          fetch-depth: 0          ref: ${{ github.event.pull_request.head.sha }}      - uses: shmindmaster/gitpin@514799cb0eae55e965e51d510d5e7a0a7604c9cc # v0.6.4        with:          base-sha: ${{ github.event.pull_request.base.sha }}          head-sha: ${{ github.event.pull_request.head.sha }}

3. Each agent PR commits .gitpin/change-evidence.json, starting from templates/change-evidence.json. The full setup, including rulesets, is in docs/pr-evidence-gate.md.

Give your agent the evidence tools. The local MCP server lets Claude Code, Codex, Cursor and other MCP clients find candidates and produce the evidence packs the gate checks:

bash
# Run inside any committed Git repositorynpx -y [email protected] init --client codex      # or claude-code, cursor, windsurf, zed, continue

init writes ~/.gitpin/repositories.yaml outside the repository, runs doctor, prints a first evidence line with a full SHA, and prints paste-ready MCP config. It never edits the repository it registers.

How it works

mermaid
flowchart LR  subgraph BASE["Trusted: base commit"]    POL[".gitpin/gate.yml<br/>policy"]  end  subgraph HEAD["Submitted: head commit"]    MAN[".gitpin/change-evidence.json<br/>claims → path, lines, sha256"]  end  DIFF["git diff merge-base..head<br/>the real change"]  POL --> GATE{"gitpin gate<br/>read-only, never runs PR code"}  MAN --> GATE  DIFF --> GATE  GATE -- "uncovered path, wrong hash,<br/>sensitive path" --> FAIL(["exit 1: check fails"])  GATE -- "every changed path covered,<br/>every slice re-hashed" --> PASS(["exit 0: report with full-SHA citations"])  PASS -.-> HUMAN(["Reviewer: git show &lt;sha&gt;:&lt;path&gt;"])

The gate reads policy only from the trusted base commit and the manifest only from the head commit, through git show, never from a working tree. It compares the merge-base diff, re-hashes every cited line slice, and emits a report whose citations carry full SHAs.

The MCP side follows one loop. Search returns candidates, never answers. Proof turns a candidate into an evidence pack. Verification re-checks it with git show:

text
pin.search_docs / pin.search_code   candidates only, with a forced next step          → pin.prove               evidence pack: path, line, full SHA, content hash          → pin.verify              independent git show re-check, HEAD match report          → you: git show <sha>:<path>
JobTools (12, all read-only)
Discoverpin.catalog
Find candidatespin.search_docs, pin.search_code
Provepin.prove, pin.prove_set (1 to 8 cites), pin.get_doc, pin.read
Verifypin.verify, pin.verify_set
Decidepin.analyze → EvidenceBrief (known facts, gaps, stable evidenceSetId)
Inspect and diffpin.inspect, pin.compare

Resource gitpin://catalog; prompt prove-with-git-head. Cite formats are in docs/cite-spec.md; an agent skill template is in templates/gitpin-skill.md.

Guardrails and non-goals

  • Read-only, always. GitPin never writes, commits or pushes to a repository it reads, and the gate never executes pull-request code.
  • A PR cannot weaken its own gate. Policy comes from the base commit; evidence comes from the head commit; the dirty working tree is never read.
  • Uncommitted work is never evidence. Dirty and untracked content is excluded from HEAD citations.
  • Sensitive paths stay sensitive. Deny rules apply to evidence, and the manifest cannot cite itself.
  • Candidates are not claims. Search output is labelled evidence-candidates and must go through pin.prove.
  • No embeddings, no database, no reindex. Evidence comes from Git objects, so it works offline and on private repositories.

Not goals: semantic search, writing or committing code, replacing GitHub Issues or PR automation, or treating a non-Git folder as one repository.

Status and limits

This source tree and its packed documentation describe GitPin 0.6.4 without asserting publication status. Check each channel independently: npm, the MCP Registry (io.github.shmindmaster/gitpin) and GitHub Releases. Node 20 or later. Site: shmindmaster.github.io/gitpin.

GitPin verifies coverage, location, revision and content hash. It proves what was committed, not that a claim is true: it does not establish semantic correctness, runtime behavior, authorship, authorization or compliance. That judgment stays with the reviewer, who now reads one cited line instead of hunting for it. Planned work is in the roadmap.

Configuration

VariablePurpose
GITPIN_REGISTRYRegistry YAML path (legacy compatibility alias: REPOCONTEXT_REGISTRY)
GITPIN_MCP_TOKENHTTP bearer token (legacy compatibility alias: REPOCONTEXT_MCP_TOKEN)
GITPIN_ALLOWED_HOSTSHTTP host allowlist (legacy compatibility alias: REPOCONTEXT_ALLOWED_HOSTS); required when HOST is not loopback
HOSTHTTP bind address; defaults to 127.0.0.1. Dockerfile.remote sets 0.0.0.0

Default registry: ~/.gitpin/repositories.yaml (legacy compatibility fallback: ~/.repocontext/... if present).

Formerly RepoContext 0.3.x. See migration.

Docs

Tools · PR evidence gate · Clients · Architecture · Compare · FAQ · Troubleshooting · Roadmap · Governance

Contributing, security and license

  • Contributing: start with an issue for bugs and proposals, then follow CONTRIBUTING.md. Good first issues are labelled good first issue. Before a pull request: pnpm validate && pnpm build && pnpm verify:package.
  • Security: report vulnerabilities privately through a GitHub security advisory, as described in SECURITY.md. Please do not open a public issue.
  • License: MIT.

Created and maintained by Sarosh Hussain. Related open source: Assay keeps an agent's decision out of its side effects; CrewScore checks whether an agent's prompt writes its safeguards down.

来源:README.md,提交 a3c7a79

工具

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

版本历史

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

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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