Skip to main content

RepoGate

Autonomous PR Quality & Cryptographic Attestation Gate Agent.

CI License: MIT Python: 3.10+ Code Style: Ruff

RepoGate is an enterprise-grade automated gatekeeper for GitHub Pull Requests. It evaluates code modifications across 6 rigorous safety gates, detects duplicate or superseded race-condition PRs, identifies silent regressions, and produces tamper-evident cryptographic proofs bound to a persistent Agent DID via EIP-191 ECDSA signatures.


Quickstart (v1.1 Distribution Architecture)

1. Installation

RepoGate core is pure Python and runs independently of Node.js:

# Recommended for CLI usage
pipx install t3n-repogate

# Or install in your active Python environment
pip install t3n-repogate

Note: For developers building from source or testing the development branch:

pip install dist/*.whl

2. Audit a Pull Request

Run a comprehensive 6-gate audit against any public or private GitHub PR:

# Basic terminal output
repogate audit https://github.com/OWNER/REPO/pull/123

# Save machine-readable JSON report
repogate audit https://github.com/OWNER/REPO/pull/123 --output report.json

# Authenticate with GitHub Token (or set GITHUB_TOKEN environment variable)
export GITHUB_TOKEN="your_github_token"
repogate audit https://github.com/OWNER/REPO/pull/123

3. Verify Cryptographic Proof

RepoGate features a Python-native EIP-191 proof verifier. Proofs can be verified anywhere without Node.js or npm dependencies:

repogate verify report.json proof.json
  • Exit Code 0: Proof is valid, report is untampered, and signed by the canonical authorized identity.
  • Exit Code 1: Hash mismatch (tampering detected), wrong signer, invalid DID, or corrupted signature.
  • Exit Code 2: File I/O, network, or execution error.

GitHub Action Integration

RepoGate can be integrated directly into your repository's PR workflows without cloning or running Node.js.

Note: @v1 becomes available after the v1.1 GA release. During pre-release, use @main or commit SHAs.

name: RepoGate

on:
  pull_request:

permissions:
  actions: read
  contents: read
  issues: read
  pull-requests: read
  statuses: read

jobs:
  repogate:
    runs-on: ubuntu-latest
    steps:
      - id: repogate
        uses: 1998LJ/t3n-repogate@v1
        with:
          github-token: ${{ github.token }}
          fail-on-block: "true" # Default: fails the workflow if PR is marked BLOCKED

      - name: Inspect Verdict
        if: always()
        run: |
          echo "Target: ${{ steps.repogate.outputs.target }}"
          echo "Risk: ${{ steps.repogate.outputs.risk-score }}"
          echo "Decision: ${{ steps.repogate.outputs.recommended-action }}"
          echo "Report: ${{ steps.repogate.outputs.report-path }}"

Action Modes

  • Enforcement Gate (fail-on-block: "true"): Automatically blocks the workflow (exit code 1) if RepoGate determines the PR is BLOCKED.
  • Advisory Mode (fail-on-block: "false"): Evaluates risk and exports machine-readable findings without breaking the CI pipeline.

Architecture Overview

External Developer / CI
        │
        ▼
   repogate CLI
    ├── audit  ──> Python 6-Gate Engine ──> GitHub REST API ──> Machine-Readable Report
    └── verify ──> Python-Native EIP-191 Verifier ──> Packaged Trust Anchor (agent_identity.json)
                         │
                         └── (Optional Reference Oracle: Node/ethers verify_proof.js)
  • Python Execution Engine: Evaluates PR diffs, commits, CI status, and regression risk.
  • Cryptographic Trust Anchor: Encapsulated in repogate.data/agent_identity.json and permanently bound to canonical Agent DID (did:t3n:78131a400e1762aeac8d86e90b76449e02cf8169).
  • Node/T3N Layer: Serves as a reference implementation, proof generator, and cross-language compatibility oracle (verify_proof.js / t3n_auth.js). Node.js 24 is only needed for attestation development, never for CLI execution.

The 6 Enforcement Gates

  1. Duplicate PR Gate: Identifies identical issue resolutions and previously closed/merged PR duplicates.
  2. Superseded Race Gate: Flags competing PRs that modify identical target files within close intervals.
  3. CI Status Gate: Validates head commit GitHub Actions runs (success / pending / failure).
  4. Regression Guard: Intercepts removed tests, loosened assertions, and suppressed pytest markers.
  5. Scope Guard: Detects out-of-scope modifications, massive multi-file changes, and unintended file mutations.
  6. Policy Guard: Intercepts unconfirmed bounty claims, fake SLA commitments, leaked tokens, and unauthorized licenses.

Development Setup

Requirements: Python 3.10+ (and optionally Node.js 24+ for reference oracle testing).

# 1. Clone repository
git clone https://github.com/1998LJ/t3n-repogate.git
cd t3n-repogate

# 2. Set up Python environment
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# 3. Optional: Set up Node oracle dependencies
npm ci

Running Checks Locally

# Code formatting & static lint
ruff check .
ruff format --check .

# Full Python test suite (unit tests, CLI tests, adversarial tests)
python3 -m unittest discover -s tests -v

# Cross-language Node reference oracle test
npm test

# Standard isolated PEP 517 build
python3 -m build

License

This project is licensed under the MIT License.

Download files

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

Source Distribution

t3n_repogate-1.1.0.tar.gz (27.3 kB view details)

Uploaded Source

Built Distribution

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

t3n_repogate-1.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file t3n_repogate-1.1.0.tar.gz.

File metadata

  • Download URL: t3n_repogate-1.1.0.tar.gz
  • Upload date:
  • Size: 27.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for t3n_repogate-1.1.0.tar.gz
Algorithm Hash digest
SHA256 7d3765d56f2cc5271b267907861787e439454ba4d8a5f0012b96c8659b171ad9
MD5 570ef0f205cb5c40ba3a99e14e0344f6
BLAKE2b-256 1e57714cfbd5ce3b3e2b3ad98b263a62f98622135133947d2008bb4d66eade51

See more details on using hashes here.

Provenance

The following attestation bundles were made for t3n_repogate-1.1.0.tar.gz:

Publisher: release.yml on 1998LJ/t3n-repogate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file t3n_repogate-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: t3n_repogate-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for t3n_repogate-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 073fba0d338be6917798bef6fd1c696c74aea4163f93335ddb6622c60c9fa61b
MD5 9fc40c3755da762a52549679175b7764
BLAKE2b-256 550547020554ea88769a2197b04b46302c81308f6ceaf542cdfd06ab6db36cca

See more details on using hashes here.

Provenance

The following attestation bundles were made for t3n_repogate-1.1.0-py3-none-any.whl:

Publisher: release.yml on 1998LJ/t3n-repogate

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page