Skip to main content

Git-native AI agent co-harness — MCP server, static guards, and agentic evaluator for LLM-assisted coding

Project description

GitReins (PoC)

Git-Native Agent Co-Harness — Proof of Concept

CI Python 3.10+ License: MIT version PyPI

GitReins Banner

GitReins lives inside your git repository as a co-harness. It provides MCP tools for task lifecycle management, an agentic evaluator that judges code completeness against task definitions, and git hooks that ensure nothing bypasses the quality gates.

Proof of Concept — Implemented (v0.1.0) — All engine modules, MCP server, CLI, and git hooks are built and working. 322 tests pass.

Install

# PyPI (recommended)
pip install gitreins

# GitHub
pip install git+https://github.com/totalwindupflightsystems/gitreins.git

# From source
git clone https://github.com/totalwindupflightsystems/gitreins.git
cd gitreins && pip install -e .

Then activate in any repo:

cd /path/to/your-project
gitreins install

How It Works

  1. Create tasks — Define criteria via CLI or MCP tools
  2. Work with your AI agent — Pi, Claude, Hermes, or Codex does code generation
  3. Complete tasks — Agent calls task.complete
  4. Automatic evaluation — Tier 1 static guards (secrets, lint, tests) + Tier 2 agentic evaluator
  5. Commit through harnesscommit tool runs guards, blocks if checks fail

The evaluator is an agentic loop: it reads files, runs tests, searches patterns, and delivers a structured verdict with per-criterion PASS/FAIL. No single-shot LLM judgment.

Architecture & Docs

Document Purpose
Full Architecture System design and data flow
Component Map Module inventory with paths and line counts
Agentic Evaluator Design How the 7-tool agentic loop works
Sandbox Evaluator scratch space (in-memory, with filesystem plans)
Implementation Plan Phase history

Full reverse-engineered specs are in specs/ — one per component, with realized-by links to actual code files.

Status

Phase: Fully Implemented (v0.1.0) — All seven engine modules, MCP server (9 tools), CLI (5 top-level commands: task, guard, judge, commit, mcp-server), git hooks, and install script are built. See Component Map for current state.

Quick Start

cd gitreins-poc
./gitreins/install                    # Activate hooks in <10 seconds

# Create a task and evaluate it
python3 gitreins/cli.py task create demo "Demo task" \
  "File exists" "Has tests" "No secrets"

# Start the MCP server for your AI agent
python3 gitreins_mcp/server.py

Demos

Three demo projects are included showing GitReins in action:

Project Type What it tests
demo-slugify/ Single-file URL slug generator — basic criteria verification
demo-calc/ Multi-file CLI Calculator with operations, parser, CLI — 13 pytest tests
demo-string-utils/ Single-file String utilities with intentional palindrome bug — FAIL→FIX→PASS cycle

Run any demo:

Tech Stack

  • Language: Python 3.10+
  • Dependencies: mcp, pyyaml, requests (3 packages)
  • MCP Transport: stdio
  • Config: YAML in .gitreins/ directory
  • Evaluator Model: Haiku / GPT-4o-mini (<2s, ~$0.001/check)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitreins-0.5.0.tar.gz (82.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitreins-0.5.0-py3-none-any.whl (50.2 kB view details)

Uploaded Python 3

File details

Details for the file gitreins-0.5.0.tar.gz.

File metadata

  • Download URL: gitreins-0.5.0.tar.gz
  • Upload date:
  • Size: 82.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for gitreins-0.5.0.tar.gz
Algorithm Hash digest
SHA256 1b1618bf3ec56601087917297cad3eb168bd0d178ff056a52fd35f6ecb7c6aae
MD5 4a817ccdcf73ca5e63c1235a5a9ae873
BLAKE2b-256 3f0f0da35410a72d9c6a57c0eab023ed3c3bf4563ffb77b7dde5ebbef9b76573

See more details on using hashes here.

File details

Details for the file gitreins-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: gitreins-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 50.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for gitreins-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4a8c6749d8c345c9fd5edabf1a2d58cce7f0e433beed3d8be7435807c6999b2
MD5 f5d9359e482b13c37e162ae9c9702562
BLAKE2b-256 c547d41a20d26a57f6bcbda8b8812421c9e532963963a166db390b0b78cd03b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page