Skip to main content

A repository-native standard for durable agent work: binding invariants, evidence-gated work items, and drift audits.

Project description

RepoPact

RepoPact is a repository-native operating system for durable agent work. It makes authority, intent, evidence, and architectural drift visible in the filesystem so that a new contributor or agent can recover the state of the project without depending on a prior conversation.

Make the repository the pact: authority, intent, evidence, and history that survive every session.

Why "pact"

Conventions like AGENTS.md, ADRs, and issue trackers each capture a fragment of project knowledge, but none of them makes the binding part explicit — the guarantees an agent must not silently weaken. RepoPact's wedge is the binding invariant: a declared guarantee with a rationale, an escalation path, and (where possible) a machine enforcer. That, plus evidence-gated completion and a filesystem state machine, is what turns a folder convention into a contract.

Core loop

intent -> scoped authority -> work item -> implementation -> evidence -> audit -> history

RepoPact core loop over a filesystem state machine

Primitives

  1. Charter & invariants: principles (judgment) and binding invariants (escalation-gated) in governance/.
  2. Frozen surface: paths and symbols that require operator approval to change.
  3. Scopes & roles: layered AGENTS.md files plus a role/scope map in governance/owners.json.
  4. Work items: narrative README.md plus machine-readable work-item.json, with evidence-linked acceptance criteria.
  5. Evidence: immutable run manifests under evidence/runs/.
  6. Decisions & policies: durable choices (decisions/) and operating rules (governance/policies/) whose rationale outlives any single work item.
  7. Reconciliation: audits and a generated dashboard that surface drift and review staleness rather than hand-maintaining it.

Quick start

pip install -r requirements.txt
python scripts/validate_repo.py
python scripts/generate_dashboard.py
python -m unittest discover -s tests -v
python scripts/check_frozen_surface.py --base origin/main

RepoPact validating itself and generating its dashboard

Records are validated against schemas/*.json (structure) and by the validator (cross-record semantics). See decision 0003.

Begin with AGENTS.md, then read governance/charter.md and governance/workflow.md.

Adopt into a new repository

Install the CLI, then bootstrap:

pipx install git+https://github.com/ForgeWireLabs/repopact   # or: pip install .
repopact init --target ../your-repo                          # seed a valid RepoPact
cd ../your-repo
repopact new work-item "Title of the work"                   # stamp records from templates/
repopact validate

repopact dispatches init, adopt, validate, new, dashboard, spec, and check-frozen against the current repository. The loose-script form still works (python scripts/init_repo.py --target ...) for repos that vendor the scripts.

Adopt an existing repository

For a project that already has CODEOWNERS, CI workflows, and nested AGENTS.md contracts, adopt maps those existing signals into RepoPact records without overwriting anything:

repopact adopt --target ../existing-repo --dry-run   # preview the plan, write nothing
repopact adopt --target ../existing-repo             # create records, then validate

CODEOWNERS becomes scopes and roles; each .github/workflows/* becomes a binding-gate policy (plus invariant INV-2 and a frozen-surface entry); every nested AGENTS.md is registered as a contract; git history seeds the first evidence run. It is idempotent — re-running skips records that already exist.

init_repo.py writes the minimal valid source records, copies the schemas and tooling, and validates the result. Templates for every record type live in templates/. RepoPact is licensed under Apache-2.0 (see LICENSE and decision 0002); its spec version is in VERSION.

Status is a filesystem transition

Work moves between work/active, work/blocked, work/deferred, and work/completed. Its work-item.json status must match its directory. Moving a work item never deletes its reasoning, decisions, or evidence links.

Derive over declare

Anything computable from source records is generated, not authored by hand. The dashboard and audit-freshness views are derived; the only hand-maintained files are genuine sources (charter, invariants, frozen surface, schemas, owners, work items, evidence, decisions, policies). See policy 001.

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

repopact-1.4.0.tar.gz (49.9 kB view details)

Uploaded Source

Built Distribution

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

repopact-1.4.0-py3-none-any.whl (53.6 kB view details)

Uploaded Python 3

File details

Details for the file repopact-1.4.0.tar.gz.

File metadata

  • Download URL: repopact-1.4.0.tar.gz
  • Upload date:
  • Size: 49.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for repopact-1.4.0.tar.gz
Algorithm Hash digest
SHA256 3ed16de18d5e9362b9c21719b848822963b5315c456d91ef2c592fc428512b9b
MD5 794014be6c53d2432d75efde1559fdf4
BLAKE2b-256 5dbafa92370725e984c03d472f6c31364fbe2cfb4fe8a13ea3e2023bd21ad00d

See more details on using hashes here.

File details

Details for the file repopact-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: repopact-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 53.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for repopact-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7238e8ee412ec6171b05cc133a7d4d35dbcc7d7a3d79112bea67e31661b67fa5
MD5 0c2615bb6b914f438f00406245cd07a9
BLAKE2b-256 f5cb0a935f68a3e56dfb3d06120b3ae865bbcf9775305bcc783b897989fbf075

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