Skip to main content
Glama

closure_drift

A version label should name one state of your code. closure_drift checks that it does. One Python file, no dependencies, read-only, no network.

A tag cut before the version bump, caught by --tag; a new tag after the bump, matching

Try it

git clone -q https://github.com/luizfnsilva/closure_drift
python3 closure_drift/examples/demo.py                 # the three answers, on tiny repositories
python3 closure_drift/closure_drift.py /path/to/your/repo

Needs Python 3.9+ and git. Before you tag: --would-tag. After you tag, before you push: --tag v1.2.0.

In CI: docs/CI.md. With an agent: the skill in skills/closure-drift/, or the MCP server in integrations/.

Related MCP server: mcp-git

What it says

verdict

exit

clean

0

every version label names one state of the code

drift

1

a label names more than one

anything else

2

nothing decided; the report says why

With --tag: tag_matches (0) or tag_mismatch (1).

$ git clone -q https://github.com/psf/requests && cd requests
$ closure-drift --compare v2.16.0 v2.16.1
...
DIFFERS UNDER ONE LABEL: both declare 2.16.0, and the code differs
in 2 path(s). If both were published, that label names two things.

Every report records the commit it measured and the hash of the checker, so anyone can run it again and get the same answer.

Limits

It reads git, not a package index: it shows what the tags contain, not which commit a published package was built from. It attests and signs nothing. More: SCOPE.md.

More

Apache-2.0. Cite as 10.5281/zenodo.21763931.

Available Tools

4 tools
check_versionsMeasure all version labelsA
Read-onlyIdempotent

Use to audit the whole tag history: does each version label name exactly one code state? For a single release about to be tagged, use would_tag. With one release only, the answer is not decided (exit 2). Returns exit 0, 1 or 2 and the JSON report. Exit 2 is not a pass: nothing was decided, and output says why (no label found, a file not read, a tag not compared). Read-only: it runs git reads only, on the local repository, with no network.

Inputs: repo (required), strict, published_file. Returns: exit, output, meaning

compareCompare two referencesA
Read-onlyIdempotent

Use to compare any two tags or commits you name: their version labels, closures and the paths that differ. Publication points play no part. Exit 1 when both declare one label and the code differs. Returns exit 0, 1 or 2 and the JSON report. Exit 2 is not a pass: nothing was decided, and output says why (no label found, a file not read, a tag not compared). Read-only: it runs git reads only, on the local repository, with no network.

Inputs: a (required), b (required), repo (required). Returns: exit, output, meaning

explain_labelExplain a label in driftA
Read-onlyIdempotent

Use after check_versions reports drift: lists, for one label, the paths that differ between the first tag that used it and each other tag that did. For two references you choose, use compare. Returns exit 0, 1 or 2 and the JSON report. Exit 2 is not a pass: nothing was decided, and output says why (no label found, a file not read, a tag not compared). Read-only: it runs git reads only, on the local repository, with no network.

Inputs: repo (required), label (required). Returns: exit, output, meaning

would_tagCheck before taggingA
Read-onlyIdempotent

Use BEFORE creating a release tag: would the version that HEAD declares reuse a label that already names other code in the tags? Exit 1 means do not tag; bump the version first. Returns exit 0, 1 or 2 and the JSON report. Exit 2 is not a pass: nothing was decided, and output says why (no label found, a file not read, a tag not compared). Read-only: it runs git reads only, on the local repository, with no network.

Inputs: repo (required). Returns: exit, output, meaning

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 4 tools

    Disambiguation4/5

    The four tools have largely distinct scopes: would_tag is for a forthcoming single release, check_versions audits all tag history, explain_label drills into one drifted label, and compare examines any two refs. The main possible confusion is between would_tag and check_versions, but their descriptions explicitly separate pre-tag single-release checks from full-history audits.

    Naming Consistency4/5

    Three tools follow a verb_noun pattern (would_tag, check_versions, explain_label), while compare is a bare verb. This is a minor deviation and still readable, with no mixed casing styles.

    Tool Count5/5

    Four tools are well-scoped for a focused read-only version/tag drift audit server. Each tool earns its place and covers a distinct step in the workflow.

    Completeness4/5

    The surface covers pre-tag checking, whole-history auditing, drift explanation, and arbitrary ref comparison. Minor gaps remain, such as listing tags or labels directly, but the core read-only lifecycle for this domain is covered.

    Maintenance

    ActivityActive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A local git MCP server. It exposes 12 git operations to an MCP client over stdio, allowing the client to inspect and work with a git repository on your machine, including status, diffs, log, branches, staging, and commits.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Coordination protocol for parallel coding agents, built above Git. The MCP server exposes the full 17-tool lifecycle over stdio: register agents, publish intents with semantic scopes and declared operations, claim work, check for conflicts before code is written, publish ChangeSets, run trusted named verification checks, and record accepted work. Deterministic rules raise findings when two agents'
      18
      410
      Apache 2.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      It introspects a repository and exposes guarded MCP tools over stdio, enabling clients to query code and optionally perform mutating operations when explicitly allowed.
      13 npm
      MIT