repopact 2.0.0__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. repopact-2.0.1/PKG-INFO +157 -0
  2. repopact-2.0.1/README.md +144 -0
  3. repopact-2.0.1/VERSION +1 -0
  4. {repopact-2.0.0 → repopact-2.0.1}/scripts/doctor.py +22 -0
  5. repopact-2.0.1/scripts/repopact.egg-info/PKG-INFO +157 -0
  6. {repopact-2.0.0 → repopact-2.0.1}/tests/test_validate_repo.py +20 -0
  7. repopact-2.0.0/PKG-INFO +0 -125
  8. repopact-2.0.0/README.md +0 -112
  9. repopact-2.0.0/VERSION +0 -1
  10. repopact-2.0.0/scripts/repopact.egg-info/PKG-INFO +0 -125
  11. {repopact-2.0.0 → repopact-2.0.1}/LICENSE +0 -0
  12. {repopact-2.0.0 → repopact-2.0.1}/pyproject.toml +0 -0
  13. {repopact-2.0.0 → repopact-2.0.1}/schemas/audit-finding.schema.json +0 -0
  14. {repopact-2.0.0 → repopact-2.0.1}/schemas/evidence-run.schema.json +0 -0
  15. {repopact-2.0.0 → repopact-2.0.1}/schemas/frozen-surface.schema.json +0 -0
  16. {repopact-2.0.0 → repopact-2.0.1}/schemas/invariants.schema.json +0 -0
  17. {repopact-2.0.0 → repopact-2.0.1}/schemas/record-frontmatter.schema.json +0 -0
  18. {repopact-2.0.0 → repopact-2.0.1}/schemas/work-item.schema.json +0 -0
  19. {repopact-2.0.0 → repopact-2.0.1}/scripts/adopt_repo.py +0 -0
  20. {repopact-2.0.0 → repopact-2.0.1}/scripts/check_frozen_surface.py +0 -0
  21. {repopact-2.0.0 → repopact-2.0.1}/scripts/frontmatter.py +0 -0
  22. {repopact-2.0.0 → repopact-2.0.1}/scripts/generate_dashboard.py +0 -0
  23. {repopact-2.0.0 → repopact-2.0.1}/scripts/generate_spec.py +0 -0
  24. {repopact-2.0.0 → repopact-2.0.1}/scripts/init_repo.py +0 -0
  25. {repopact-2.0.0 → repopact-2.0.1}/scripts/new.py +0 -0
  26. {repopact-2.0.0 → repopact-2.0.1}/scripts/plan_import.py +0 -0
  27. {repopact-2.0.0 → repopact-2.0.1}/scripts/repo_model.py +0 -0
  28. {repopact-2.0.0 → repopact-2.0.1}/scripts/repopact.egg-info/SOURCES.txt +0 -0
  29. {repopact-2.0.0 → repopact-2.0.1}/scripts/repopact.egg-info/dependency_links.txt +0 -0
  30. {repopact-2.0.0 → repopact-2.0.1}/scripts/repopact.egg-info/entry_points.txt +0 -0
  31. {repopact-2.0.0 → repopact-2.0.1}/scripts/repopact.egg-info/requires.txt +0 -0
  32. {repopact-2.0.0 → repopact-2.0.1}/scripts/repopact.egg-info/top_level.txt +0 -0
  33. {repopact-2.0.0 → repopact-2.0.1}/scripts/repopact_cli.py +0 -0
  34. {repopact-2.0.0 → repopact-2.0.1}/scripts/takeover.py +0 -0
  35. {repopact-2.0.0 → repopact-2.0.1}/scripts/track_import.py +0 -0
  36. {repopact-2.0.0 → repopact-2.0.1}/scripts/validate_repo.py +0 -0
  37. {repopact-2.0.0 → repopact-2.0.1}/setup.cfg +0 -0
  38. {repopact-2.0.0 → repopact-2.0.1}/templates/README.md +0 -0
  39. {repopact-2.0.0 → repopact-2.0.1}/templates/decision.md +0 -0
  40. {repopact-2.0.0 → repopact-2.0.1}/templates/evidence-run.json +0 -0
  41. {repopact-2.0.0 → repopact-2.0.1}/templates/policy.md +0 -0
  42. {repopact-2.0.0 → repopact-2.0.1}/templates/work-item.README.md +0 -0
  43. {repopact-2.0.0 → repopact-2.0.1}/templates/work-item.json +0 -0
  44. {repopact-2.0.0 → repopact-2.0.1}/tests/test_conformance.py +0 -0
  45. {repopact-2.0.0 → repopact-2.0.1}/tests/test_plan_import_links.py +0 -0
  46. {repopact-2.0.0 → repopact-2.0.1}/tests/test_takeover_refs.py +0 -0
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: repopact
3
+ Version: 2.0.1
4
+ Summary: A repository-native standard for durable agent work: binding invariants, evidence-gated work items, and drift audits.
5
+ License: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/ForgeWireLabs/repopact
7
+ Project-URL: Repository, https://github.com/ForgeWireLabs/repopact
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: jsonschema>=4.20
12
+ Dynamic: license-file
13
+
14
+ # RepoPact
15
+
16
+ RepoPact is a **repository-native governance kernel for durable agent work**. It keeps the
17
+ load-bearing state of a project — intent, authority, evidence, decisions, and drift — as
18
+ typed, version-controlled records in the filesystem, so a new contributor or agent can
19
+ recover where things stand *without* a prior conversation, and so the guarantees that matter
20
+ cannot be silently weakened.
21
+
22
+ > The repository is the pact: authority, intent, evidence, and history that survive every
23
+ > session.
24
+
25
+ `pip install repopact` · Apache-2.0 · current release **2.0.1**
26
+ ([changelog](decisions/0021-preflight-mandatory-and-provenance.md)).
27
+
28
+ ## How it relates to `AGENTS.md`
29
+
30
+ `AGENTS.md` (and `CLAUDE.md`, editor rules) tell an agent *what to do* — they're
31
+ instructions, plain Markdown, with no enforcement. RepoPact is the layer **above** them:
32
+
33
+ > `AGENTS.md` tells the agent what to do. RepoPact proves it didn't quietly undo it.
34
+
35
+ RepoPact's distinguishing primitive is the **binding invariant** — a declared guarantee with
36
+ a rationale, an escalation path, and (where its logical type permits) a machine enforcer.
37
+ That, plus evidence-gated completion and a filesystem state machine, is what turns a folder
38
+ convention into a contract. `repopact adopt` ingests an existing `AGENTS.md` rather than
39
+ replacing it (decision [`0020`](decisions/0020-launch-positioning-layer-above-agents-md.md)).
40
+
41
+ ## Core loop
42
+
43
+ ```text
44
+ intent -> scoped authority -> work item -> implementation -> evidence -> audit -> history
45
+ ```
46
+
47
+ ![RepoPact core loop over a filesystem state machine](docs/assets/repopact-flow.svg)
48
+
49
+ ## Primitives
50
+
51
+ 1. **Charter & invariants** — principles (judgment) and binding invariants
52
+ (escalation-gated) in `governance/`.
53
+ 2. **Frozen surface** — paths and symbols that require operator approval (`--ack`) to change.
54
+ 3. **Scopes & roles** — layered `AGENTS.md` contracts plus a role/scope map in
55
+ `governance/owners.json`.
56
+ 4. **Work items** — narrative `README.md` + machine-readable `work-item.json` with
57
+ evidence-linked acceptance criteria. **Mandatory preflight** (2.0): a work item must be
58
+ recorded *before* implementation begins (`repopact new` stamps the marker).
59
+ 5. **Evidence** — immutable run manifests under `evidence/runs/`.
60
+ 6. **Decisions & policies** — durable choices (`decisions/`) and operating rules
61
+ (`governance/policies/`) whose rationale outlives any single work item.
62
+ 7. **Provenance** (2.0) — every record is `concrete`, `provisional`, or `inferred`.
63
+ `adopt` emits provisional/inferred records (honest, not fabricated); `doctor` ratchets
64
+ them to `concrete` as real evidence arrives. See *2.0 changes* below.
65
+ 8. **Reconciliation** — audits and a *generated* dashboard surface drift and review
66
+ staleness rather than hand-maintaining it.
67
+
68
+ ## Install & quick start
69
+
70
+ ```powershell
71
+ pip install repopact # the CLI + reference validator, from PyPI
72
+ repopact init --target ../your-repo # seed a valid RepoPact in a new repo
73
+ cd ../your-repo
74
+ repopact new work-item "Title of the work" # stamps records (incl. the preflight marker)
75
+ repopact validate
76
+ repopact dashboard
77
+ ```
78
+
79
+ `repopact` dispatches `init`, `adopt`, `validate`, `new`, `dashboard`, `spec`,
80
+ `check-frozen`, `import-plan`, and `doctor`. Records are validated against `schemas/*.json`
81
+ (structure) and by the validator (cross-record semantics; decision
82
+ [`0003`](decisions/0003-validate-records-against-json-schemas.md)). Begin with
83
+ [`AGENTS.md`](AGENTS.md), then [`governance/charter.md`](governance/charter.md) and
84
+ [`governance/workflow.md`](governance/workflow.md).
85
+
86
+ ## Adopt an *existing* repository
87
+
88
+ For a project that already has CODEOWNERS, CI workflows, and nested `AGENTS.md` contracts,
89
+ `adopt` maps those existing signals into RepoPact records without overwriting anything:
90
+
91
+ ```powershell
92
+ repopact adopt --target ../existing-repo --dry-run # preview the plan, write nothing
93
+ repopact adopt --target ../existing-repo # create records, then validate
94
+ repopact doctor # diagnose + repair drift; migrate on upgrade
95
+ ```
96
+
97
+ CODEOWNERS becomes scopes and roles; each `.github/workflows/*` becomes a binding-gate policy
98
+ (plus invariant `INV-2` and a frozen-surface entry); every nested `AGENTS.md` is registered as
99
+ a contract; git history seeds a first **inferred** evidence run, and the adoption record is
100
+ recorded as **provisional** — honestly typed, not a fabricated "completed" claim. Adoption is
101
+ idempotent.
102
+
103
+ ## 2.0: mandatory preflight + provenance-typed records
104
+
105
+ Decision [`0021`](decisions/0021-preflight-mandatory-and-provenance.md) (supersedes 0018):
106
+
107
+ - **Mandatory preflight (default on).** No work begins until a work item exists and
108
+ propagates through the pact; `repopact new` stamps the marker. Existing repos grandfather
109
+ their pre-2.0 items automatically — `adopt`/`init` set a preflight epoch and `doctor`
110
+ migrates on upgrade. *This is a breaking change*: run `repopact doctor` after upgrading.
111
+ - **Provenance typing** (`concrete` / `provisional` / `inferred`, default `concrete`). This
112
+ is the principled escape from the *adoption trilemma*: `adopt` emits provisional/inferred
113
+ records so the result is both **valid** and **faithful** (reconstruction is labelled, not
114
+ faked). Completion still requires `concrete` evidence; `doctor` ratchets when it arrives.
115
+
116
+ ## Status is a filesystem transition
117
+
118
+ Work moves between `work/active`, `work/blocked`, `work/deferred`, and `work/completed`; its
119
+ `work-item.json` status must match its directory. Moving a work item never deletes its
120
+ reasoning, decisions, or evidence links.
121
+
122
+ ## Derive over declare
123
+
124
+ Anything computable from source records is generated, not authored by hand (the dashboard,
125
+ audit-freshness views, and the derived blocks of `SPEC.md`). Only genuine sources are
126
+ hand-maintained. See policy `001`.
127
+
128
+ ## Evaluation, formal model & the Proving Ground
129
+
130
+ RepoPact is developed against its own evidence, not assertion. The `research/` lab notebook
131
+ holds a [formal model](research/formal-model.md) (the L0–L5 kernel, the typed invariant
132
+ lattice, the adoption trilemma), the pre-registered [experiment protocol](research/protocol.md)
133
+ and [benchmark protocol](research/benchmark-protocol.md) (hypotheses H1–H13, falsification
134
+ criteria, [threats to validity](research/threats-to-validity.md)), a [findings
135
+ register](research/findings.md), and a full [paper draft](research/paper.md).
136
+
137
+ **PactBench** — the runnable benchmark suite (pre-registered tasks measuring whether RepoPact
138
+ enforcement reduces silent guarantee drift, with a model-agnostic harness and an S5 drift
139
+ harness) — lives in the **[RepoPact Proving
140
+ Ground](https://github.com/ForgeWireLabs/repopact-proving-ground)**, a throwaway-but-real
141
+ project that consumes RepoPact from PyPI and is driven across every primitive, including cases
142
+ designed to break it. RepoPact defines the *protocol* (`research/`); the Proving Ground hosts
143
+ the runnable suite. *RepoPact defines the pact; the Proving Ground tests whether the pact
144
+ holds under agent pressure.*
145
+
146
+ ## Ecosystem
147
+
148
+ RepoPact is the work-governance layer of [ForgeWire Labs](https://github.com/ForgeWireLabs) —
149
+ inspectable agentic infrastructure (*inspect the work, bound the authority, preserve the
150
+ evidence*). It composes with Fabric (execution governance) and ForgeLink (human-agent
151
+ communication governance), but is independently useful on its own.
152
+
153
+ ## License & version
154
+
155
+ Apache-2.0 ([`LICENSE`](LICENSE), decision [`0002`](decisions/0002-license-apache-2.0.md)).
156
+ The spec version is in [`VERSION`](VERSION); templates for every record type live in
157
+ [`templates/`](templates/).
@@ -0,0 +1,144 @@
1
+ # RepoPact
2
+
3
+ RepoPact is a **repository-native governance kernel for durable agent work**. It keeps the
4
+ load-bearing state of a project — intent, authority, evidence, decisions, and drift — as
5
+ typed, version-controlled records in the filesystem, so a new contributor or agent can
6
+ recover where things stand *without* a prior conversation, and so the guarantees that matter
7
+ cannot be silently weakened.
8
+
9
+ > The repository is the pact: authority, intent, evidence, and history that survive every
10
+ > session.
11
+
12
+ `pip install repopact` · Apache-2.0 · current release **2.0.1**
13
+ ([changelog](decisions/0021-preflight-mandatory-and-provenance.md)).
14
+
15
+ ## How it relates to `AGENTS.md`
16
+
17
+ `AGENTS.md` (and `CLAUDE.md`, editor rules) tell an agent *what to do* — they're
18
+ instructions, plain Markdown, with no enforcement. RepoPact is the layer **above** them:
19
+
20
+ > `AGENTS.md` tells the agent what to do. RepoPact proves it didn't quietly undo it.
21
+
22
+ RepoPact's distinguishing primitive is the **binding invariant** — a declared guarantee with
23
+ a rationale, an escalation path, and (where its logical type permits) a machine enforcer.
24
+ That, plus evidence-gated completion and a filesystem state machine, is what turns a folder
25
+ convention into a contract. `repopact adopt` ingests an existing `AGENTS.md` rather than
26
+ replacing it (decision [`0020`](decisions/0020-launch-positioning-layer-above-agents-md.md)).
27
+
28
+ ## Core loop
29
+
30
+ ```text
31
+ intent -> scoped authority -> work item -> implementation -> evidence -> audit -> history
32
+ ```
33
+
34
+ ![RepoPact core loop over a filesystem state machine](docs/assets/repopact-flow.svg)
35
+
36
+ ## Primitives
37
+
38
+ 1. **Charter & invariants** — principles (judgment) and binding invariants
39
+ (escalation-gated) in `governance/`.
40
+ 2. **Frozen surface** — paths and symbols that require operator approval (`--ack`) to change.
41
+ 3. **Scopes & roles** — layered `AGENTS.md` contracts plus a role/scope map in
42
+ `governance/owners.json`.
43
+ 4. **Work items** — narrative `README.md` + machine-readable `work-item.json` with
44
+ evidence-linked acceptance criteria. **Mandatory preflight** (2.0): a work item must be
45
+ recorded *before* implementation begins (`repopact new` stamps the marker).
46
+ 5. **Evidence** — immutable run manifests under `evidence/runs/`.
47
+ 6. **Decisions & policies** — durable choices (`decisions/`) and operating rules
48
+ (`governance/policies/`) whose rationale outlives any single work item.
49
+ 7. **Provenance** (2.0) — every record is `concrete`, `provisional`, or `inferred`.
50
+ `adopt` emits provisional/inferred records (honest, not fabricated); `doctor` ratchets
51
+ them to `concrete` as real evidence arrives. See *2.0 changes* below.
52
+ 8. **Reconciliation** — audits and a *generated* dashboard surface drift and review
53
+ staleness rather than hand-maintaining it.
54
+
55
+ ## Install & quick start
56
+
57
+ ```powershell
58
+ pip install repopact # the CLI + reference validator, from PyPI
59
+ repopact init --target ../your-repo # seed a valid RepoPact in a new repo
60
+ cd ../your-repo
61
+ repopact new work-item "Title of the work" # stamps records (incl. the preflight marker)
62
+ repopact validate
63
+ repopact dashboard
64
+ ```
65
+
66
+ `repopact` dispatches `init`, `adopt`, `validate`, `new`, `dashboard`, `spec`,
67
+ `check-frozen`, `import-plan`, and `doctor`. Records are validated against `schemas/*.json`
68
+ (structure) and by the validator (cross-record semantics; decision
69
+ [`0003`](decisions/0003-validate-records-against-json-schemas.md)). Begin with
70
+ [`AGENTS.md`](AGENTS.md), then [`governance/charter.md`](governance/charter.md) and
71
+ [`governance/workflow.md`](governance/workflow.md).
72
+
73
+ ## Adopt an *existing* repository
74
+
75
+ For a project that already has CODEOWNERS, CI workflows, and nested `AGENTS.md` contracts,
76
+ `adopt` maps those existing signals into RepoPact records without overwriting anything:
77
+
78
+ ```powershell
79
+ repopact adopt --target ../existing-repo --dry-run # preview the plan, write nothing
80
+ repopact adopt --target ../existing-repo # create records, then validate
81
+ repopact doctor # diagnose + repair drift; migrate on upgrade
82
+ ```
83
+
84
+ CODEOWNERS becomes scopes and roles; each `.github/workflows/*` becomes a binding-gate policy
85
+ (plus invariant `INV-2` and a frozen-surface entry); every nested `AGENTS.md` is registered as
86
+ a contract; git history seeds a first **inferred** evidence run, and the adoption record is
87
+ recorded as **provisional** — honestly typed, not a fabricated "completed" claim. Adoption is
88
+ idempotent.
89
+
90
+ ## 2.0: mandatory preflight + provenance-typed records
91
+
92
+ Decision [`0021`](decisions/0021-preflight-mandatory-and-provenance.md) (supersedes 0018):
93
+
94
+ - **Mandatory preflight (default on).** No work begins until a work item exists and
95
+ propagates through the pact; `repopact new` stamps the marker. Existing repos grandfather
96
+ their pre-2.0 items automatically — `adopt`/`init` set a preflight epoch and `doctor`
97
+ migrates on upgrade. *This is a breaking change*: run `repopact doctor` after upgrading.
98
+ - **Provenance typing** (`concrete` / `provisional` / `inferred`, default `concrete`). This
99
+ is the principled escape from the *adoption trilemma*: `adopt` emits provisional/inferred
100
+ records so the result is both **valid** and **faithful** (reconstruction is labelled, not
101
+ faked). Completion still requires `concrete` evidence; `doctor` ratchets when it arrives.
102
+
103
+ ## Status is a filesystem transition
104
+
105
+ Work moves between `work/active`, `work/blocked`, `work/deferred`, and `work/completed`; its
106
+ `work-item.json` status must match its directory. Moving a work item never deletes its
107
+ reasoning, decisions, or evidence links.
108
+
109
+ ## Derive over declare
110
+
111
+ Anything computable from source records is generated, not authored by hand (the dashboard,
112
+ audit-freshness views, and the derived blocks of `SPEC.md`). Only genuine sources are
113
+ hand-maintained. See policy `001`.
114
+
115
+ ## Evaluation, formal model & the Proving Ground
116
+
117
+ RepoPact is developed against its own evidence, not assertion. The `research/` lab notebook
118
+ holds a [formal model](research/formal-model.md) (the L0–L5 kernel, the typed invariant
119
+ lattice, the adoption trilemma), the pre-registered [experiment protocol](research/protocol.md)
120
+ and [benchmark protocol](research/benchmark-protocol.md) (hypotheses H1–H13, falsification
121
+ criteria, [threats to validity](research/threats-to-validity.md)), a [findings
122
+ register](research/findings.md), and a full [paper draft](research/paper.md).
123
+
124
+ **PactBench** — the runnable benchmark suite (pre-registered tasks measuring whether RepoPact
125
+ enforcement reduces silent guarantee drift, with a model-agnostic harness and an S5 drift
126
+ harness) — lives in the **[RepoPact Proving
127
+ Ground](https://github.com/ForgeWireLabs/repopact-proving-ground)**, a throwaway-but-real
128
+ project that consumes RepoPact from PyPI and is driven across every primitive, including cases
129
+ designed to break it. RepoPact defines the *protocol* (`research/`); the Proving Ground hosts
130
+ the runnable suite. *RepoPact defines the pact; the Proving Ground tests whether the pact
131
+ holds under agent pressure.*
132
+
133
+ ## Ecosystem
134
+
135
+ RepoPact is the work-governance layer of [ForgeWire Labs](https://github.com/ForgeWireLabs) —
136
+ inspectable agentic infrastructure (*inspect the work, bound the authority, preserve the
137
+ evidence*). It composes with Fabric (execution governance) and ForgeLink (human-agent
138
+ communication governance), but is independently useful on its own.
139
+
140
+ ## License & version
141
+
142
+ Apache-2.0 ([`LICENSE`](LICENSE), decision [`0002`](decisions/0002-license-apache-2.0.md)).
143
+ The spec version is in [`VERSION`](VERSION); templates for every record type live in
144
+ [`templates/`](templates/).
repopact-2.0.1/VERSION ADDED
@@ -0,0 +1 @@
1
+ 2.0.1
@@ -170,6 +170,25 @@ def diagnose(root: Path) -> list[Finding]:
170
170
  return findings
171
171
 
172
172
 
173
+ def _migrate_preflight(root: Path, today: date) -> list[str]:
174
+ """On upgrade to 2.0, grandfather pre-2.0 work items (decision 0021). If owners.json
175
+ declares no preflight config at all, set an epoch (required_from_date = today) so
176
+ existing items are exempt and only work created after the upgrade needs a marker. A repo
177
+ that already declares preflight (on or off) is left untouched."""
178
+ owners = root / "governance" / "owners.json"
179
+ if not owners.is_file():
180
+ return []
181
+ try:
182
+ data = json.loads(owners.read_text(encoding="utf-8"))
183
+ except (OSError, ValueError):
184
+ return []
185
+ if "preflight" in data:
186
+ return []
187
+ data["preflight"] = {"enabled": True, "required_from_date": today.isoformat()}
188
+ owners.write_text(json.dumps(data, indent=2) + "\n", encoding="utf-8")
189
+ return [f"set preflight epoch (required_from_date={today.isoformat()}) to grandfather pre-2.0 work items"]
190
+
191
+
173
192
  def _ratchet_provisional(root: Path) -> list[str]:
174
193
  """Ratchet provisional work items to concrete once every satisfied criterion rests on
175
194
  concrete evidence (decision 0021). Conservative and monotone: only upgrades."""
@@ -277,6 +296,9 @@ def fix(root: Path, today: date | None = None) -> list[str]:
277
296
  # 6. ratchet provisional records whose evidence is now concrete (decision 0021)
278
297
  actions.extend(_ratchet_provisional(root))
279
298
 
299
+ # 7. migrate preflight on upgrade: grandfather pre-2.0 work items (decision 0021)
300
+ actions.extend(_migrate_preflight(root, today))
301
+
280
302
  return actions
281
303
 
282
304
 
@@ -0,0 +1,157 @@
1
+ Metadata-Version: 2.4
2
+ Name: repopact
3
+ Version: 2.0.1
4
+ Summary: A repository-native standard for durable agent work: binding invariants, evidence-gated work items, and drift audits.
5
+ License: Apache-2.0
6
+ Project-URL: Homepage, https://github.com/ForgeWireLabs/repopact
7
+ Project-URL: Repository, https://github.com/ForgeWireLabs/repopact
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: jsonschema>=4.20
12
+ Dynamic: license-file
13
+
14
+ # RepoPact
15
+
16
+ RepoPact is a **repository-native governance kernel for durable agent work**. It keeps the
17
+ load-bearing state of a project — intent, authority, evidence, decisions, and drift — as
18
+ typed, version-controlled records in the filesystem, so a new contributor or agent can
19
+ recover where things stand *without* a prior conversation, and so the guarantees that matter
20
+ cannot be silently weakened.
21
+
22
+ > The repository is the pact: authority, intent, evidence, and history that survive every
23
+ > session.
24
+
25
+ `pip install repopact` · Apache-2.0 · current release **2.0.1**
26
+ ([changelog](decisions/0021-preflight-mandatory-and-provenance.md)).
27
+
28
+ ## How it relates to `AGENTS.md`
29
+
30
+ `AGENTS.md` (and `CLAUDE.md`, editor rules) tell an agent *what to do* — they're
31
+ instructions, plain Markdown, with no enforcement. RepoPact is the layer **above** them:
32
+
33
+ > `AGENTS.md` tells the agent what to do. RepoPact proves it didn't quietly undo it.
34
+
35
+ RepoPact's distinguishing primitive is the **binding invariant** — a declared guarantee with
36
+ a rationale, an escalation path, and (where its logical type permits) a machine enforcer.
37
+ That, plus evidence-gated completion and a filesystem state machine, is what turns a folder
38
+ convention into a contract. `repopact adopt` ingests an existing `AGENTS.md` rather than
39
+ replacing it (decision [`0020`](decisions/0020-launch-positioning-layer-above-agents-md.md)).
40
+
41
+ ## Core loop
42
+
43
+ ```text
44
+ intent -> scoped authority -> work item -> implementation -> evidence -> audit -> history
45
+ ```
46
+
47
+ ![RepoPact core loop over a filesystem state machine](docs/assets/repopact-flow.svg)
48
+
49
+ ## Primitives
50
+
51
+ 1. **Charter & invariants** — principles (judgment) and binding invariants
52
+ (escalation-gated) in `governance/`.
53
+ 2. **Frozen surface** — paths and symbols that require operator approval (`--ack`) to change.
54
+ 3. **Scopes & roles** — layered `AGENTS.md` contracts plus a role/scope map in
55
+ `governance/owners.json`.
56
+ 4. **Work items** — narrative `README.md` + machine-readable `work-item.json` with
57
+ evidence-linked acceptance criteria. **Mandatory preflight** (2.0): a work item must be
58
+ recorded *before* implementation begins (`repopact new` stamps the marker).
59
+ 5. **Evidence** — immutable run manifests under `evidence/runs/`.
60
+ 6. **Decisions & policies** — durable choices (`decisions/`) and operating rules
61
+ (`governance/policies/`) whose rationale outlives any single work item.
62
+ 7. **Provenance** (2.0) — every record is `concrete`, `provisional`, or `inferred`.
63
+ `adopt` emits provisional/inferred records (honest, not fabricated); `doctor` ratchets
64
+ them to `concrete` as real evidence arrives. See *2.0 changes* below.
65
+ 8. **Reconciliation** — audits and a *generated* dashboard surface drift and review
66
+ staleness rather than hand-maintaining it.
67
+
68
+ ## Install & quick start
69
+
70
+ ```powershell
71
+ pip install repopact # the CLI + reference validator, from PyPI
72
+ repopact init --target ../your-repo # seed a valid RepoPact in a new repo
73
+ cd ../your-repo
74
+ repopact new work-item "Title of the work" # stamps records (incl. the preflight marker)
75
+ repopact validate
76
+ repopact dashboard
77
+ ```
78
+
79
+ `repopact` dispatches `init`, `adopt`, `validate`, `new`, `dashboard`, `spec`,
80
+ `check-frozen`, `import-plan`, and `doctor`. Records are validated against `schemas/*.json`
81
+ (structure) and by the validator (cross-record semantics; decision
82
+ [`0003`](decisions/0003-validate-records-against-json-schemas.md)). Begin with
83
+ [`AGENTS.md`](AGENTS.md), then [`governance/charter.md`](governance/charter.md) and
84
+ [`governance/workflow.md`](governance/workflow.md).
85
+
86
+ ## Adopt an *existing* repository
87
+
88
+ For a project that already has CODEOWNERS, CI workflows, and nested `AGENTS.md` contracts,
89
+ `adopt` maps those existing signals into RepoPact records without overwriting anything:
90
+
91
+ ```powershell
92
+ repopact adopt --target ../existing-repo --dry-run # preview the plan, write nothing
93
+ repopact adopt --target ../existing-repo # create records, then validate
94
+ repopact doctor # diagnose + repair drift; migrate on upgrade
95
+ ```
96
+
97
+ CODEOWNERS becomes scopes and roles; each `.github/workflows/*` becomes a binding-gate policy
98
+ (plus invariant `INV-2` and a frozen-surface entry); every nested `AGENTS.md` is registered as
99
+ a contract; git history seeds a first **inferred** evidence run, and the adoption record is
100
+ recorded as **provisional** — honestly typed, not a fabricated "completed" claim. Adoption is
101
+ idempotent.
102
+
103
+ ## 2.0: mandatory preflight + provenance-typed records
104
+
105
+ Decision [`0021`](decisions/0021-preflight-mandatory-and-provenance.md) (supersedes 0018):
106
+
107
+ - **Mandatory preflight (default on).** No work begins until a work item exists and
108
+ propagates through the pact; `repopact new` stamps the marker. Existing repos grandfather
109
+ their pre-2.0 items automatically — `adopt`/`init` set a preflight epoch and `doctor`
110
+ migrates on upgrade. *This is a breaking change*: run `repopact doctor` after upgrading.
111
+ - **Provenance typing** (`concrete` / `provisional` / `inferred`, default `concrete`). This
112
+ is the principled escape from the *adoption trilemma*: `adopt` emits provisional/inferred
113
+ records so the result is both **valid** and **faithful** (reconstruction is labelled, not
114
+ faked). Completion still requires `concrete` evidence; `doctor` ratchets when it arrives.
115
+
116
+ ## Status is a filesystem transition
117
+
118
+ Work moves between `work/active`, `work/blocked`, `work/deferred`, and `work/completed`; its
119
+ `work-item.json` status must match its directory. Moving a work item never deletes its
120
+ reasoning, decisions, or evidence links.
121
+
122
+ ## Derive over declare
123
+
124
+ Anything computable from source records is generated, not authored by hand (the dashboard,
125
+ audit-freshness views, and the derived blocks of `SPEC.md`). Only genuine sources are
126
+ hand-maintained. See policy `001`.
127
+
128
+ ## Evaluation, formal model & the Proving Ground
129
+
130
+ RepoPact is developed against its own evidence, not assertion. The `research/` lab notebook
131
+ holds a [formal model](research/formal-model.md) (the L0–L5 kernel, the typed invariant
132
+ lattice, the adoption trilemma), the pre-registered [experiment protocol](research/protocol.md)
133
+ and [benchmark protocol](research/benchmark-protocol.md) (hypotheses H1–H13, falsification
134
+ criteria, [threats to validity](research/threats-to-validity.md)), a [findings
135
+ register](research/findings.md), and a full [paper draft](research/paper.md).
136
+
137
+ **PactBench** — the runnable benchmark suite (pre-registered tasks measuring whether RepoPact
138
+ enforcement reduces silent guarantee drift, with a model-agnostic harness and an S5 drift
139
+ harness) — lives in the **[RepoPact Proving
140
+ Ground](https://github.com/ForgeWireLabs/repopact-proving-ground)**, a throwaway-but-real
141
+ project that consumes RepoPact from PyPI and is driven across every primitive, including cases
142
+ designed to break it. RepoPact defines the *protocol* (`research/`); the Proving Ground hosts
143
+ the runnable suite. *RepoPact defines the pact; the Proving Ground tests whether the pact
144
+ holds under agent pressure.*
145
+
146
+ ## Ecosystem
147
+
148
+ RepoPact is the work-governance layer of [ForgeWire Labs](https://github.com/ForgeWireLabs) —
149
+ inspectable agentic infrastructure (*inspect the work, bound the authority, preserve the
150
+ evidence*). It composes with Fabric (execution governance) and ForgeLink (human-agent
151
+ communication governance), but is independently useful on its own.
152
+
153
+ ## License & version
154
+
155
+ Apache-2.0 ([`LICENSE`](LICENSE), decision [`0002`](decisions/0002-license-apache-2.0.md)).
156
+ The spec version is in [`VERSION`](VERSION); templates for every record type live in
157
+ [`templates/`](templates/).
@@ -318,6 +318,26 @@ class RepositoryValidationTests(unittest.TestCase):
318
318
  self.assertEqual("concrete", wi["provenance"])
319
319
  self.assertEqual([], [p.message for p in validate(repo)])
320
320
 
321
+ def test_doctor_migrates_preflight_on_upgrade(self) -> None:
322
+ # Simulate a pre-2.0 repo: governed, no preflight config, a marker-less legacy item.
323
+ # Under 2.0 default-on it fails; doctor grandfathers it (decision 0021).
324
+ repo = Path(self.temp.name) / "upgraded"
325
+ init_repo.bootstrap(repo)
326
+ self.write_json(repo / "governance" / "owners.json", lambda d: d.pop("preflight", None))
327
+ d = repo / "work" / "active" / "001-legacy"
328
+ d.mkdir(parents=True)
329
+ (d / "README.md").write_text("# legacy\n", encoding="utf-8")
330
+ (d / "work-item.json").write_text(json.dumps({
331
+ "id": "001", "title": "legacy", "status": "active",
332
+ "owner_scope": "governance", "affected_scopes": [], "depends_on": [],
333
+ "acceptance_criteria": [{"id": "AC-1", "text": "x", "state": "pending", "evidence": []}],
334
+ "created": "2020-01-01", "updated": "2020-01-01",
335
+ }), encoding="utf-8")
336
+ self.assertTrue(any("preflight" in p.message for p in validate(repo)))
337
+ actions = doctor.fix(repo)
338
+ self.assertTrue(any("preflight epoch" in a for a in actions))
339
+ self.assertEqual([], [p.message for p in validate(repo)])
340
+
321
341
  # --- L3 open obligations (formal-model §5: O-4 temporal, O-6 relational) ----------
322
342
  # Marked honestly: these invariant classes are not mechanizable on a single tree today;
323
343
  # they are enforced by human review (INV-4/INV-5) until O-4/O-6 are discharged.
repopact-2.0.0/PKG-INFO DELETED
@@ -1,125 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: repopact
3
- Version: 2.0.0
4
- Summary: A repository-native standard for durable agent work: binding invariants, evidence-gated work items, and drift audits.
5
- License: Apache-2.0
6
- Project-URL: Homepage, https://github.com/ForgeWireLabs/repopact
7
- Project-URL: Repository, https://github.com/ForgeWireLabs/repopact
8
- Requires-Python: >=3.11
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
- Requires-Dist: jsonschema>=4.20
12
- Dynamic: license-file
13
-
14
- # RepoPact
15
-
16
- RepoPact is a repository-native operating system for durable agent work.
17
- It makes authority, intent, evidence, and architectural drift visible in the
18
- filesystem so that a new contributor or agent can recover the state of the
19
- project without depending on a prior conversation.
20
-
21
- > The repository is the pact: authority, intent, evidence, and history that
22
- > survive every session.
23
-
24
- ## Why "pact"
25
-
26
- Conventions like `AGENTS.md`, ADRs, and issue trackers each capture a fragment of
27
- project knowledge, but none of them makes the *binding* part explicit — the
28
- guarantees an agent must not silently weaken. RepoPact's distinguishing primitive is
29
- the **binding invariant**: a declared guarantee with a rationale, an escalation path,
30
- and (where possible) a machine enforcer. That, plus evidence-gated completion and a
31
- filesystem state machine, is what turns a folder convention into a contract.
32
-
33
- ## Core loop
34
-
35
- ```text
36
- intent -> scoped authority -> work item -> implementation -> evidence -> audit -> history
37
- ```
38
-
39
- ![RepoPact core loop over a filesystem state machine](docs/assets/repopact-flow.svg)
40
-
41
- ## Primitives
42
-
43
- 1. **Charter & invariants**: principles (judgment) and binding invariants
44
- (escalation-gated) in `governance/`.
45
- 2. **Frozen surface**: paths and symbols that require operator approval to change.
46
- 3. **Scopes & roles**: layered `AGENTS.md` files plus a role/scope map in
47
- `governance/owners.json`.
48
- 4. **Work items**: narrative `README.md` plus machine-readable `work-item.json`,
49
- with evidence-linked acceptance criteria.
50
- 5. **Evidence**: immutable run manifests under `evidence/runs/`.
51
- 6. **Decisions & policies**: durable choices (`decisions/`) and operating rules
52
- (`governance/policies/`) whose rationale outlives any single work item.
53
- 7. **Reconciliation**: audits and a *generated* dashboard that surface drift and
54
- review staleness rather than hand-maintaining it.
55
-
56
- ## Quick start
57
-
58
- ```powershell
59
- pip install -r requirements.txt
60
- python scripts/validate_repo.py
61
- python scripts/generate_dashboard.py
62
- python -m unittest discover -s tests -v
63
- python scripts/check_frozen_surface.py --base origin/main
64
- ```
65
-
66
- ![RepoPact validating itself and generating its dashboard](docs/assets/repopact-governance.svg)
67
-
68
- Records are validated against `schemas/*.json` (structure) and by the validator
69
- (cross-record semantics). See decision
70
- [`0003`](decisions/0003-validate-records-against-json-schemas.md).
71
-
72
- Begin with [`AGENTS.md`](AGENTS.md), then read
73
- [`governance/charter.md`](governance/charter.md) and
74
- [`governance/workflow.md`](governance/workflow.md).
75
-
76
- ## Adopt into a new repository
77
-
78
- Install the CLI, then bootstrap:
79
-
80
- ```powershell
81
- pipx install git+https://github.com/ForgeWireLabs/repopact # or: pip install .
82
- repopact init --target ../your-repo # seed a valid RepoPact
83
- cd ../your-repo
84
- repopact new work-item "Title of the work" # stamp records from templates/
85
- repopact validate
86
- ```
87
-
88
- `repopact` dispatches `init`, `adopt`, `validate`, `new`, `dashboard`, `spec`, and
89
- `check-frozen` against the current repository. The loose-script form still works
90
- (`python scripts/init_repo.py --target ...`) for repos that vendor the scripts.
91
-
92
- ### Adopt an *existing* repository
93
-
94
- For a project that already has CODEOWNERS, CI workflows, and nested `AGENTS.md`
95
- contracts, `adopt` maps those existing signals into RepoPact records without
96
- overwriting anything:
97
-
98
- ```powershell
99
- repopact adopt --target ../existing-repo --dry-run # preview the plan, write nothing
100
- repopact adopt --target ../existing-repo # create records, then validate
101
- ```
102
-
103
- CODEOWNERS becomes scopes and roles; each `.github/workflows/*` becomes a binding-gate
104
- policy (plus invariant `INV-2` and a frozen-surface entry); every nested `AGENTS.md`
105
- is registered as a contract; git history seeds the first evidence run. It is
106
- idempotent — re-running skips records that already exist.
107
-
108
- `init_repo.py` writes the minimal valid source records, copies the schemas and
109
- tooling, and validates the result. Templates for every record type live in
110
- [`templates/`](templates/). RepoPact is licensed under Apache-2.0 (see
111
- [`LICENSE`](LICENSE) and decision [`0002`](decisions/0002-license-apache-2.0.md));
112
- its spec version is in [`VERSION`](VERSION).
113
-
114
- ## Status is a filesystem transition
115
-
116
- Work moves between `work/active`, `work/blocked`, `work/deferred`, and
117
- `work/completed`. Its `work-item.json` status must match its directory. Moving a
118
- work item never deletes its reasoning, decisions, or evidence links.
119
-
120
- ## Derive over declare
121
-
122
- Anything computable from source records is generated, not authored by hand. The
123
- dashboard and audit-freshness views are derived; the only hand-maintained files
124
- are genuine sources (charter, invariants, frozen surface, schemas, owners, work
125
- items, evidence, decisions, policies). See policy `001`.
repopact-2.0.0/README.md DELETED
@@ -1,112 +0,0 @@
1
- # RepoPact
2
-
3
- RepoPact is a repository-native operating system for durable agent work.
4
- It makes authority, intent, evidence, and architectural drift visible in the
5
- filesystem so that a new contributor or agent can recover the state of the
6
- project without depending on a prior conversation.
7
-
8
- > The repository is the pact: authority, intent, evidence, and history that
9
- > survive every session.
10
-
11
- ## Why "pact"
12
-
13
- Conventions like `AGENTS.md`, ADRs, and issue trackers each capture a fragment of
14
- project knowledge, but none of them makes the *binding* part explicit — the
15
- guarantees an agent must not silently weaken. RepoPact's distinguishing primitive is
16
- the **binding invariant**: a declared guarantee with a rationale, an escalation path,
17
- and (where possible) a machine enforcer. That, plus evidence-gated completion and a
18
- filesystem state machine, is what turns a folder convention into a contract.
19
-
20
- ## Core loop
21
-
22
- ```text
23
- intent -> scoped authority -> work item -> implementation -> evidence -> audit -> history
24
- ```
25
-
26
- ![RepoPact core loop over a filesystem state machine](docs/assets/repopact-flow.svg)
27
-
28
- ## Primitives
29
-
30
- 1. **Charter & invariants**: principles (judgment) and binding invariants
31
- (escalation-gated) in `governance/`.
32
- 2. **Frozen surface**: paths and symbols that require operator approval to change.
33
- 3. **Scopes & roles**: layered `AGENTS.md` files plus a role/scope map in
34
- `governance/owners.json`.
35
- 4. **Work items**: narrative `README.md` plus machine-readable `work-item.json`,
36
- with evidence-linked acceptance criteria.
37
- 5. **Evidence**: immutable run manifests under `evidence/runs/`.
38
- 6. **Decisions & policies**: durable choices (`decisions/`) and operating rules
39
- (`governance/policies/`) whose rationale outlives any single work item.
40
- 7. **Reconciliation**: audits and a *generated* dashboard that surface drift and
41
- review staleness rather than hand-maintaining it.
42
-
43
- ## Quick start
44
-
45
- ```powershell
46
- pip install -r requirements.txt
47
- python scripts/validate_repo.py
48
- python scripts/generate_dashboard.py
49
- python -m unittest discover -s tests -v
50
- python scripts/check_frozen_surface.py --base origin/main
51
- ```
52
-
53
- ![RepoPact validating itself and generating its dashboard](docs/assets/repopact-governance.svg)
54
-
55
- Records are validated against `schemas/*.json` (structure) and by the validator
56
- (cross-record semantics). See decision
57
- [`0003`](decisions/0003-validate-records-against-json-schemas.md).
58
-
59
- Begin with [`AGENTS.md`](AGENTS.md), then read
60
- [`governance/charter.md`](governance/charter.md) and
61
- [`governance/workflow.md`](governance/workflow.md).
62
-
63
- ## Adopt into a new repository
64
-
65
- Install the CLI, then bootstrap:
66
-
67
- ```powershell
68
- pipx install git+https://github.com/ForgeWireLabs/repopact # or: pip install .
69
- repopact init --target ../your-repo # seed a valid RepoPact
70
- cd ../your-repo
71
- repopact new work-item "Title of the work" # stamp records from templates/
72
- repopact validate
73
- ```
74
-
75
- `repopact` dispatches `init`, `adopt`, `validate`, `new`, `dashboard`, `spec`, and
76
- `check-frozen` against the current repository. The loose-script form still works
77
- (`python scripts/init_repo.py --target ...`) for repos that vendor the scripts.
78
-
79
- ### Adopt an *existing* repository
80
-
81
- For a project that already has CODEOWNERS, CI workflows, and nested `AGENTS.md`
82
- contracts, `adopt` maps those existing signals into RepoPact records without
83
- overwriting anything:
84
-
85
- ```powershell
86
- repopact adopt --target ../existing-repo --dry-run # preview the plan, write nothing
87
- repopact adopt --target ../existing-repo # create records, then validate
88
- ```
89
-
90
- CODEOWNERS becomes scopes and roles; each `.github/workflows/*` becomes a binding-gate
91
- policy (plus invariant `INV-2` and a frozen-surface entry); every nested `AGENTS.md`
92
- is registered as a contract; git history seeds the first evidence run. It is
93
- idempotent — re-running skips records that already exist.
94
-
95
- `init_repo.py` writes the minimal valid source records, copies the schemas and
96
- tooling, and validates the result. Templates for every record type live in
97
- [`templates/`](templates/). RepoPact is licensed under Apache-2.0 (see
98
- [`LICENSE`](LICENSE) and decision [`0002`](decisions/0002-license-apache-2.0.md));
99
- its spec version is in [`VERSION`](VERSION).
100
-
101
- ## Status is a filesystem transition
102
-
103
- Work moves between `work/active`, `work/blocked`, `work/deferred`, and
104
- `work/completed`. Its `work-item.json` status must match its directory. Moving a
105
- work item never deletes its reasoning, decisions, or evidence links.
106
-
107
- ## Derive over declare
108
-
109
- Anything computable from source records is generated, not authored by hand. The
110
- dashboard and audit-freshness views are derived; the only hand-maintained files
111
- are genuine sources (charter, invariants, frozen surface, schemas, owners, work
112
- items, evidence, decisions, policies). See policy `001`.
repopact-2.0.0/VERSION DELETED
@@ -1 +0,0 @@
1
- 2.0.0
@@ -1,125 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: repopact
3
- Version: 2.0.0
4
- Summary: A repository-native standard for durable agent work: binding invariants, evidence-gated work items, and drift audits.
5
- License: Apache-2.0
6
- Project-URL: Homepage, https://github.com/ForgeWireLabs/repopact
7
- Project-URL: Repository, https://github.com/ForgeWireLabs/repopact
8
- Requires-Python: >=3.11
9
- Description-Content-Type: text/markdown
10
- License-File: LICENSE
11
- Requires-Dist: jsonschema>=4.20
12
- Dynamic: license-file
13
-
14
- # RepoPact
15
-
16
- RepoPact is a repository-native operating system for durable agent work.
17
- It makes authority, intent, evidence, and architectural drift visible in the
18
- filesystem so that a new contributor or agent can recover the state of the
19
- project without depending on a prior conversation.
20
-
21
- > The repository is the pact: authority, intent, evidence, and history that
22
- > survive every session.
23
-
24
- ## Why "pact"
25
-
26
- Conventions like `AGENTS.md`, ADRs, and issue trackers each capture a fragment of
27
- project knowledge, but none of them makes the *binding* part explicit — the
28
- guarantees an agent must not silently weaken. RepoPact's distinguishing primitive is
29
- the **binding invariant**: a declared guarantee with a rationale, an escalation path,
30
- and (where possible) a machine enforcer. That, plus evidence-gated completion and a
31
- filesystem state machine, is what turns a folder convention into a contract.
32
-
33
- ## Core loop
34
-
35
- ```text
36
- intent -> scoped authority -> work item -> implementation -> evidence -> audit -> history
37
- ```
38
-
39
- ![RepoPact core loop over a filesystem state machine](docs/assets/repopact-flow.svg)
40
-
41
- ## Primitives
42
-
43
- 1. **Charter & invariants**: principles (judgment) and binding invariants
44
- (escalation-gated) in `governance/`.
45
- 2. **Frozen surface**: paths and symbols that require operator approval to change.
46
- 3. **Scopes & roles**: layered `AGENTS.md` files plus a role/scope map in
47
- `governance/owners.json`.
48
- 4. **Work items**: narrative `README.md` plus machine-readable `work-item.json`,
49
- with evidence-linked acceptance criteria.
50
- 5. **Evidence**: immutable run manifests under `evidence/runs/`.
51
- 6. **Decisions & policies**: durable choices (`decisions/`) and operating rules
52
- (`governance/policies/`) whose rationale outlives any single work item.
53
- 7. **Reconciliation**: audits and a *generated* dashboard that surface drift and
54
- review staleness rather than hand-maintaining it.
55
-
56
- ## Quick start
57
-
58
- ```powershell
59
- pip install -r requirements.txt
60
- python scripts/validate_repo.py
61
- python scripts/generate_dashboard.py
62
- python -m unittest discover -s tests -v
63
- python scripts/check_frozen_surface.py --base origin/main
64
- ```
65
-
66
- ![RepoPact validating itself and generating its dashboard](docs/assets/repopact-governance.svg)
67
-
68
- Records are validated against `schemas/*.json` (structure) and by the validator
69
- (cross-record semantics). See decision
70
- [`0003`](decisions/0003-validate-records-against-json-schemas.md).
71
-
72
- Begin with [`AGENTS.md`](AGENTS.md), then read
73
- [`governance/charter.md`](governance/charter.md) and
74
- [`governance/workflow.md`](governance/workflow.md).
75
-
76
- ## Adopt into a new repository
77
-
78
- Install the CLI, then bootstrap:
79
-
80
- ```powershell
81
- pipx install git+https://github.com/ForgeWireLabs/repopact # or: pip install .
82
- repopact init --target ../your-repo # seed a valid RepoPact
83
- cd ../your-repo
84
- repopact new work-item "Title of the work" # stamp records from templates/
85
- repopact validate
86
- ```
87
-
88
- `repopact` dispatches `init`, `adopt`, `validate`, `new`, `dashboard`, `spec`, and
89
- `check-frozen` against the current repository. The loose-script form still works
90
- (`python scripts/init_repo.py --target ...`) for repos that vendor the scripts.
91
-
92
- ### Adopt an *existing* repository
93
-
94
- For a project that already has CODEOWNERS, CI workflows, and nested `AGENTS.md`
95
- contracts, `adopt` maps those existing signals into RepoPact records without
96
- overwriting anything:
97
-
98
- ```powershell
99
- repopact adopt --target ../existing-repo --dry-run # preview the plan, write nothing
100
- repopact adopt --target ../existing-repo # create records, then validate
101
- ```
102
-
103
- CODEOWNERS becomes scopes and roles; each `.github/workflows/*` becomes a binding-gate
104
- policy (plus invariant `INV-2` and a frozen-surface entry); every nested `AGENTS.md`
105
- is registered as a contract; git history seeds the first evidence run. It is
106
- idempotent — re-running skips records that already exist.
107
-
108
- `init_repo.py` writes the minimal valid source records, copies the schemas and
109
- tooling, and validates the result. Templates for every record type live in
110
- [`templates/`](templates/). RepoPact is licensed under Apache-2.0 (see
111
- [`LICENSE`](LICENSE) and decision [`0002`](decisions/0002-license-apache-2.0.md));
112
- its spec version is in [`VERSION`](VERSION).
113
-
114
- ## Status is a filesystem transition
115
-
116
- Work moves between `work/active`, `work/blocked`, `work/deferred`, and
117
- `work/completed`. Its `work-item.json` status must match its directory. Moving a
118
- work item never deletes its reasoning, decisions, or evidence links.
119
-
120
- ## Derive over declare
121
-
122
- Anything computable from source records is generated, not authored by hand. The
123
- dashboard and audit-freshness views are derived; the only hand-maintained files
124
- are genuine sources (charter, invariants, frozen surface, schemas, owners, work
125
- items, evidence, decisions, policies). See policy `001`.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes