govrail
English | 中文
A language-agnostic governance plane for agent-driven development: coding agents work fast in parallel while machines — not vigilance — hold the quality line. The only runtime dependency is Python 3.
The plane ships two mechanisms: gates (any promise a command can check becomes a mechanical check) and notes (every non-trivial change records the decision, what it beat, and the consequences). Bilingual pairing keeps the external-presentation docs in sync.
What it changes
| Without govrail | With govrail |
|---|---|
| Agents follow rules "on their honor"; nothing is enforced | Every checkable promise is a gate that fails loud |
| "Why did we do this?" is lost or re-litigated | Each decision is a note with the alternatives it beat |
| Adopting tooling means a restructure or a new runtime | One command, zero restructure: gov init |
See a governed project in examples/demo-project.
Install
pip install govrail # or: uv tool install govrail / pipx install govrail
This puts the gov CLI on your PATH (stdlib only — no third-party
dependencies). It has one subcommand per action:
gov init --project <path> # inject the plane into an existing project
gov init --project <path> --hooks --ci # also install a pre-push hook and CI
gov uninstall --project <path> # reverse it exactly
gov run # run the default mode's gate DAG (defaultMode)
gov run --base HEAD~1 # only the gates whose paths match the diff
gov run --gate pairing # rerun a single gate
gov self-test # prove every governance gate can reject
gov verify-pairing --write # re-confirm a bilingual pair after editing one side
gov verify-pairing --write en:docs/a.md zh:docs/a_CN.md # register any naming
gov verify-note-presence # warn when a non-trivial diff carries no Agent Note
gov verify-rubric # check the review rubric's structure
gov recall <terms> # retrieve notes, decisions, postmortems
gov audit-notes # staleness signals in implemented notes
gov change-scope --base <ref> # smallest sufficient check set for a diff
init is non-invasive and idempotent: it creates .gov/rules.md, adds
gates.json and the notes README only when missing, appends one reference line
to AGENTS.md, and never overwrites the project's own files. uninstall reverses
it exactly — including the hook and workflow --hooks/--ci added. A fresh
install never goes red on its first run: the pairing gate ships advisory,
gov verify-pairing --write baselines the existing pairs, and removing
allowFailure turns it enforcing. enabled: false parks a gate without
deleting its definition.
What is inside
gov/— the Python package:gates(the DAG runner overgates.json),verify_notes(three required sections),verify_translation_pairing(git blob hashes),verify_note_presence,verify_rubric,recall(memory retrieval),audit_notes(staleness signals),change_scope,self_test,archive_notes.gov/templates/— the rules, defaultgates.json, and notes format thatgov initinjects into a project..gov/rules.md— the single source of truth for the rules..agents/notes/— the decision-record format and lifecycle.docs/review-rubric.md— how PRs are judged: the criteria gates cannot check, graded item by item.
Origin
The mechanisms are distilled from the DeepSeek Harness repository, whose gates-over-prose axiom shaped this template. Kept: the governance plane. Left to you: the product plane. The locked design decisions live in docs/decisions.md.
Star History
Release files for govrail 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| govrail-0.5.0.tar.gz | 38.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| govrail-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 76.0 kB
Release files / govrail-0.5.0.tar.gz
| Download URL | govrail-0.5.0.tar.gz |
|---|---|
| Size | 38.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9c5dbce7222dbbfd28b1f2974c4636aa8cfe483a68dda451fa5b20f0d599fc23
|
|
BLAKE2b-256 checksum How to use checksums |
8fa04f3ed2139455c36d6147168412f146623cb86d35721a53b9ae6065ce8176
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|
Release files / govrail-0.5.0-py3-none-any.whl
| Download URL | govrail-0.5.0-py3-none-any.whl |
|---|---|
| Size | 37.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53ec0c5e24db959e003896630d17f8c6f6561de343d449a76546c8e34343a060
|
|
BLAKE2b-256 checksum How to use checksums |
02c9a776f8654365531e86b3ca7dee3db1f16af02982296c4908b2d98be45047
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|