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 — a living specimen exercising every feature (rubric, rejection cases, surfaces, decisions). Task-oriented recipes: docs/cookbook.md.
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> --upgrade # show template drift (diffs, never writes)
gov init --project <path> --adopt all # land missing template files (never overwrites)
gov doctor # environment self-check (PATH, python, hooks, schema)
gov note new --class process --ref D6 "Title" # scaffold a note, pre-validated
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 # rejection cases: the tools' + yours (.gov/rejections/)
gov run --json # machine-readable: [{gate, outcome, duration_ms, ...}]
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 verify-decisions # guard the decisions table (ids, alternatives)
gov review --base <ref> --grade # dossier + interactive rubric grading
gov trend # gate duration trends from --record history
gov recall <terms> # retrieve notes, decisions, postmortems
gov audit-notes # staleness signals in implemented notes
gov change-scope --base <ref> # smallest sufficient set (.gov/surfaces.json maps paths)
init is non-invasive and idempotent: it creates .gov/rules.md, adds
gates.json, the notes README, and the agent skills (recall-first,
pre-push-checks, code-review, archive-agent-notes) only when missing,
appends one reference line to AGENTS.md, and never overwrites the
project's own files — including its own skills. --hooks/--ci can be
retrofitted later (gov init --hooks on an initialized project installs
just the add-on; customizations stay untouched). uninstall reverses
everything exactly; when a file drifted from its template it names the
file and requires --force to proceed (a genuine two-step). 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, notes format, and agent skills thatgov initinjects into a project..gov/rules.md— the single source of truth for the rules..agents/notes/— the decision-record format and lifecycle..agents/skills/— the triggers that send agents to the tools first:recall-first(memory before proposals),pre-push-checks(smallest sufficient set),code-review(rubric),archive-agent-notes.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.14.1
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.14.1.tar.gz | 99.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| govrail-0.14.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 188.2 kB
Release files / govrail-0.14.1.tar.gz
| Download URL | govrail-0.14.1.tar.gz |
|---|---|
| Size | 99.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3b4c245d0387416fc3ba1594fcb092df591d684776d077f57fded891cdcfa90
|
|
BLAKE2b-256 checksum How to use checksums |
ca2da3e3e90d5aaa36d57dc880dabe5c1bc1288f3e1afffe59be0019d722f395
|
| 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.14.1-py3-none-any.whl
| Download URL | govrail-0.14.1-py3-none-any.whl |
|---|---|
| Size | 89.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cb59e42696458ee61d0d5301bf7bf496df05ee3b63f5e06404a90831b34899e
|
|
BLAKE2b-256 checksum How to use checksums |
1e916abe87e30162150926530f433bb57f219d414f6b7da12083a9155cf247de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.14
|