carson 1.0.1 → 2.7.0

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.
data/README.md CHANGED
@@ -1,43 +1,97 @@
1
- # Carson
1
+ <img src="icon.svg" width="141" alt="Carson">
2
2
 
3
- Enforce the same governance rules across every repository you manage — from a single install, without polluting any of them with governance tooling.
3
+ # Carson
4
+
5
+ Named after the head of household in Downton Abbey, Carson is your repositories' autonomous governance runtime — you write the code, Carson manages everything else. From commit-time checks through PR triage, agent dispatch, merge, and cleanup, Carson runs the household with discipline and professional standards. Carson itself has no intelligence — it follows a deterministic decision tree. The intelligence comes from the coding agents it dispatches (Codex, Claude) to fix problems.
4
6
 
5
7
  ## The Problem
6
8
 
7
- If you govern more than a handful of repositories, you know the pattern: lint configs drift between repos, PR templates go stale, reviewer feedback gets quietly ignored, and what passes on a developer's laptop fails in CI.
8
- The usual fix is to copy governance scripts into each repository. That works until you need to update them — now you are maintaining dozens of copies, each free to diverge.
9
+ If you govern more than a handful of repositories, you know the pattern: lint configs drift between repos, PR templates go stale, reviewer feedback gets quietly ignored, and what passes on a developer's laptop fails in CI. Across a portfolio of projects with coding agents producing many PRs, you become the bottleneck — manually checking results, dispatching fixes, clicking merge, and cleaning up.
10
+
11
+ ## How Carson Works
12
+
13
+ Carson is an autonomous governance runtime that lives on your workstation and in CI, never inside the repositories it governs. It operates at two levels:
14
+
15
+ **Per-commit governance** — Carson enforces lint policy, gates merges on unresolved review comments, synchronises templates, and keeps your local branches clean. Every commit triggers `carson audit` through managed hooks; the same checks run in GitHub Actions.
9
16
 
10
- ## What Carson Does
17
+ **Portfolio-level autonomy** `carson govern` is a scheduled triage loop that scans all your repositories, classifies every open PR, and acts: merge what's ready, dispatch coding agents (Codex or Claude) to fix what's failing, and escalate what needs human judgement. One command, all your projects, unmanned.
18
+
19
+ ```
20
+ ┌──────────────────────────────────────────────�┐
21
+ │ Your workstation │
22
+ │ │
23
+ │ ~/.carson/ Carson config │
24
+ │ ~/.carson/hooks/ Git hooks │
25
+ │ ~/.carson/lint/ Lint policy │
26
+ │ ~/.carson/cache/ Reports │
27
+ │ ~/.carson/govern/ Dispatch state │
28
+ │ │
29
+ │ carson govern ──► for each repo: │
30
+ │ 1. List open PRs (gh) │
31
+ │ 2. Classify: CI / review / audit status │
32
+ │ 3. Act: merge | dispatch agent | escalate │
33
+ │ 4. Housekeep: sync + prune │
34
+ │ │
35
+ │ Governed repos: repo-A/ repo-B/ repo-C/ │
36
+ │ .github/* templates (committed) │
37
+ │ core.hooksPath → ~/.carson/hooks │
38
+ └──────────────────────────────────────────────┘
39
+ ```
11
40
 
12
- Carson is a governance runtime that lives on your workstation and in CI, never inside the repositories it governs. You install it once, point it at each repository, and it enforces a consistent baseline — same checks, same rules, same exit codes — everywhere.
41
+ This separation is Carson's defining trait the **outsider boundary**: no Carson scripts, config files, or governance payloads are ever placed inside a governed repository.
13
42
 
14
- **One command to onboard a repo.**
15
- `carson init` installs git hooks, synchronises PR and AI-coding templates, and runs a first governance audit. From that point, every commit is checked automatically.
43
+ The data flow:
16
44
 
17
- **Same checks locally and in CI.**
18
- The `pre-commit` hook runs `carson audit` before every commit. The same `carson audit` runs in your GitHub Actions workflow. If it passes locally, it passes in CI. No surprises.
45
+ 1. You maintain a **policy source** a directory or git repository containing your lint rules (e.g. `CODING/rubocop.yml`). Carson copies these to `~/.carson/lint/` via `carson lint setup`.
46
+ 2. `carson onboard` installs git hooks, synchronises `.github/*` templates, and runs a first governance audit on a host repository.
47
+ 3. From that point, every commit triggers `carson audit` through the managed `pre-commit` hook. The same `carson audit` runs in GitHub Actions. If it passes locally, it passes in CI.
48
+ 4. `carson review gate` enforces review accountability: it blocks merge until every actionable reviewer comment has been formally acknowledged by the PR author through a **disposition comment**.
49
+ 5. `carson govern` triages all open PRs across your portfolio. Ready PRs are merged and housekept. Failing PRs get a coding agent dispatched to fix them. Stuck PRs are escalated for your attention.
19
50
 
20
- **Review accountability.**
21
- `carson review gate` blocks merge until every actionable reviewer comment — risk keywords, change requests — has been formally acknowledged by the PR author. No more "I missed that comment" after merge.
51
+ ## Commands at a Glance
22
52
 
23
- **Template consistency.**
24
- Carson keeps PR templates and AI coding guidelines identical across all governed repositories. `carson template check` detects drift; `carson template apply` repairs it.
53
+ **Govern** — autonomous portfolio management:
25
54
 
26
- **Centralised lint policy.**
27
- Lint rules come from a single policy source you control. Carson owns the lint execution path — repo-local config overrides are hard-blocked so teams cannot silently weaken the baseline.
55
+ | Command | What it does |
56
+ |---|---|
57
+ | `carson govern` | Triage all open PRs: merge ready ones, dispatch agents for failures, escalate the rest. |
58
+ | `carson govern --dry-run` | Show what Carson would do without taking action. |
59
+ | `carson govern --loop SECONDS` | Run the govern cycle continuously, sleeping SECONDS between cycles. |
60
+ | `carson housekeep` | Sync main + prune stale branches (also runs automatically after govern merges). |
28
61
 
29
- **Branch hygiene.**
30
- `carson sync` fast-forwards your local main. `carson prune` removes branches whose upstream is gone, including squash-merged branches verified through the GitHub API.
62
+ **Setup** — run once per machine or per repository:
31
63
 
32
- **Clean boundary.**
33
- No Carson scripts, config files, or governance payloads are ever placed inside your repositories. Carson actively blocks if it detects its own artefacts in a host repo.
64
+ | Command | What it does |
65
+ |---|---|
66
+ | `carson lint setup` | Seed `~/.carson/lint/` from your policy source. |
67
+ | `carson onboard` | One-command baseline: hooks + templates + first audit. |
68
+ | `carson prepare` | Install or refresh Carson-managed global hooks. |
69
+ | `carson refresh` | Re-apply hooks, templates, and audit after upgrading Carson. |
70
+ | `carson offboard` | Remove Carson from a repository. |
34
71
 
35
- ## When to Use Carson
72
+ **Daily** regular development workflow:
36
73
 
37
- - A platform team standardising policy across many product repositories — one governance flow for all of them, no per-repo tooling.
38
- - A consultancy governing client repositories you do not own — enforce rules without committing your tooling into their repos.
39
- - A regulated engineering team that needs auditable, reproducible gates every merge decision has a deterministic pass/block result.
40
- - A solo developer who wants the same lint and review discipline everywhere — without maintaining governance scripts in each project.
74
+ | Command | What it does |
75
+ |---|---|
76
+ | `carson audit` | Full governance check (also runs automatically on every commit). |
77
+ | `carson sync` | Fast-forward local `main` from remote. |
78
+ | `carson prune` | Remove stale local branches whose upstream is gone. |
79
+ | `carson template check` | Detect drift between managed and host `.github/*` files. |
80
+ | `carson template apply` | Repair drifted `.github/*` files. |
81
+
82
+ **Review** — PR merge readiness:
83
+
84
+ | Command | What it does |
85
+ |---|---|
86
+ | `carson review gate` | Block or approve merge based on unresolved review comments. |
87
+ | `carson review sweep` | Scan recent PRs and update a tracking issue for late feedback. |
88
+
89
+ **Info**:
90
+
91
+ | Command | What it does |
92
+ |---|---|
93
+ | `carson version` | Print installed version. |
94
+ | `carson inspect` | Verify Carson-managed hook installation and repository setup. |
41
95
 
42
96
  ## Quickstart
43
97
 
@@ -48,15 +102,21 @@ Prerequisites: Ruby `>= 4.0`, `git`, and `gem` in your PATH.
48
102
  # Install
49
103
  gem install --user-install carson
50
104
  carson version
105
+ ```
51
106
 
52
- # Prepare your lint policy baseline
53
- carson lint setup --source /local/path/of/policy-repo
107
+ **Prepare your lint policy.** A policy source is any directory (or git URL) that contains a `CODING/` folder with your lint configuration files. For Ruby, the required file is `CODING/rubocop.yml`. Carson copies these into `~/.carson/lint/` so that every governed repository uses the same rules:
54
108
 
55
- # Onboard a repository
56
- carson init /local/path/of/repo
109
+ ```bash
110
+ carson lint setup --source /path/to/your-policy-repo
57
111
  ```
58
112
 
59
- After `carson init`, your repository has:
113
+ **Onboard a repository:**
114
+
115
+ ```bash
116
+ carson onboard /path/to/your-repo
117
+ ```
118
+
119
+ After `carson onboard`, your repository has:
60
120
  - Git hooks that run `carson audit` on every commit.
61
121
  - Managed `.github/*` templates synchronised from Carson.
62
122
  - An initial governance audit report.
@@ -66,17 +126,30 @@ Commit the generated `.github/*` changes, and the repository is governed.
66
126
  **Daily workflow:**
67
127
 
68
128
  ```bash
69
- carson sync # fast-forward local main
70
- carson audit # full governance check (also runs on every commit via hook)
129
+ carson govern --dry-run # see what Carson would do across all repos
130
+ carson govern # triage PRs, merge ready ones, dispatch agents, housekeep
131
+ carson govern --loop 300 # run continuously, cycling every 5 minutes
132
+ ```
133
+
134
+ Or the individual commands if you prefer manual control:
135
+
136
+ ```bash
137
+ carson audit # full governance check
71
138
  carson review gate # block or approve merge based on review status
139
+ carson sync # fast-forward local main
72
140
  carson prune # clean up stale local branches
73
141
  ```
74
142
 
75
143
  ## Where to Read Next
76
- - User manual: `MANUAL.md`
77
- - API reference: `API.md`
78
- - Release notes: `RELEASE.md`
144
+
145
+ - **MANUAL.md** installation, first-time setup, CI configuration, daily operations, troubleshooting.
146
+ - **API.md** — formal interface contract: commands, exit codes, configuration schema.
147
+ - **RELEASE.md** — version history and upgrade actions.
148
+ - **docs/define.md** — product definition and scope.
149
+ - **docs/design.md** — experience and brand design.
150
+ - **docs/develop.md** — contributor guide: architecture, development workflow.
79
151
 
80
152
  ## Support
153
+
81
154
  - Open or track issues: <https://github.com/wanghailei/carson/issues>
82
155
  - Review version-specific upgrade actions: `RELEASE.md`
data/RELEASE.md CHANGED
@@ -5,6 +5,410 @@ Release-note scope rule:
5
5
  - `RELEASE.md` records only version deltas, breaking changes, and migration actions.
6
6
  - Operational usage guides live in `MANUAL.md` and `API.md`.
7
7
 
8
+ ## 2.7.0 — Documentation and Test Fixes
9
+
10
+ ### What changed
11
+
12
+ - **Stale command reference fixed.** README.md referenced the pre-2.3.0 command name `carson init` instead of `carson onboard`.
13
+ - **Linear history guidance corrected.** API.md and MANUAL.md incorrectly stated that GitHub's "Require linear history" only accepts rebase merges. Both squash and rebase are accepted — only merge commits are rejected.
14
+ - **Release notes separated.** The combined 2.6.0 entry has been split into distinct 2.5.0 (agent discovery) and 2.6.0 (squash default) entries.
15
+ - **Config default test made hermetic.** `test_config_govern_defaults` now isolates HOME to a temp directory, preventing the developer's local `~/.carson/config.json` from affecting test results.
16
+
17
+ ### What users must do now
18
+
19
+ 1. Upgrade Carson to `2.7.0`.
20
+
21
+ ### Breaking or removed behaviour
22
+
23
+ - None.
24
+
25
+ ### Upgrade steps
26
+
27
+ ```bash
28
+ cd ~/Dev/carson
29
+ git pull
30
+ bash install.sh
31
+ carson version
32
+ ```
33
+
34
+ ---
35
+
36
+ ## 2.6.0 — Default Squash Merge
37
+
38
+ ### What changed
39
+
40
+ - **Default merge method changed from `merge` to `squash`.** Squash-to-main keeps history linear: one PR = one commit on main. Every commit on main corresponds to a reviewed, CI-passing unit of work and is individually revertable. This aligns Carson's built-in default with how most teams should run.
41
+
42
+ ### What users must do now
43
+
44
+ 1. Upgrade Carson to `2.6.0`.
45
+ 2. If you previously set `govern.merge.method` to `"merge"` explicitly in `~/.carson/config.json`, review whether `"squash"` (now the default) is the right choice.
46
+
47
+ ### Breaking or removed behaviour
48
+
49
+ - `govern.merge.method` default changed from `merge` to `squash`. If your GitHub repository only allows merge commits, set `"govern": { "merge": { "method": "merge" } }` in `~/.carson/config.json`.
50
+
51
+ ### Upgrade steps
52
+
53
+ ```bash
54
+ cd ~/Dev/carson
55
+ git pull
56
+ bash install.sh
57
+ carson version
58
+ ```
59
+
60
+ ### Engineering Appendix
61
+
62
+ #### Modified components
63
+
64
+ - `lib/carson/config.rb` — `govern.merge.method` default changed from `"merge"` to `"squash"`.
65
+ - `test/runtime_govern_test.rb` — unit test updated for squash default.
66
+
67
+ #### Verification evidence
68
+
69
+ - CI passes on PR #78.
70
+
71
+ ---
72
+
73
+ ## 2.5.0 — Agent Discovery Templates
74
+
75
+ ### What changed
76
+
77
+ - **Agent discovery via managed templates.** Interactive agents (Claude Code, Codex, Copilot) working in Carson-governed repos now discover Carson automatically. A new source-of-truth file `.github/carson-instructions.md` contains the full governance baseline. Agent-specific files (`.github/CLAUDE.md`, `.github/AGENTS.md`, `.github/copilot-instructions.md`) are one-line pointers to it. Zero drift risk — one file to maintain, all agents follow the same reference.
78
+ - **Managed template set expanded.** `carson template apply` now writes five files: `carson-instructions.md`, `copilot-instructions.md`, `CLAUDE.md`, `AGENTS.md`, and `pull_request_template.md`.
79
+
80
+ ### What users must do now
81
+
82
+ 1. Upgrade Carson to `2.5.0`.
83
+ 2. Run `carson prepare` in each governed repository.
84
+ 3. Run `carson template apply` to write the new managed files.
85
+ 4. Commit the new `.github/*` files.
86
+
87
+ ### Breaking or removed behaviour
88
+
89
+ - `.github/copilot-instructions.md` content replaced with a one-line reference. The governance baseline now lives in `.github/carson-instructions.md`.
90
+
91
+ ### Upgrade steps
92
+
93
+ ```bash
94
+ cd ~/Dev/carson
95
+ git pull
96
+ bash install.sh
97
+ carson version
98
+ carson prepare
99
+ carson template apply
100
+ ```
101
+
102
+ ### Engineering Appendix
103
+
104
+ #### New files
105
+
106
+ - `templates/.github/carson-instructions.md` — governance baseline source of truth.
107
+ - `templates/.github/CLAUDE.md` — one-line reference for Claude Code.
108
+ - `templates/.github/AGENTS.md` — one-line reference for Codex.
109
+
110
+ #### Changed files
111
+
112
+ - `templates/.github/copilot-instructions.md` — replaced full content with one-line reference.
113
+
114
+ #### Modified components
115
+
116
+ - `lib/carson/config.rb` — `template.managed_files` expanded to include `carson-instructions.md`, `CLAUDE.md`, and `AGENTS.md`.
117
+ - `script/ci_smoke.sh` — offboard removal check updated for new managed files.
118
+
119
+ #### Public interface and config changes
120
+
121
+ - `template.managed_files` default expanded from 2 to 5 files.
122
+ - Exit status contract unchanged.
123
+
124
+ #### Verification evidence
125
+
126
+ - CI passes on PR #77.
127
+
128
+ ---
129
+
130
+ ## 2.4.0 — Agent Skill Injection + Scope Guard Reform
131
+
132
+ ### What changed
133
+
134
+ - **SKILL.md injected into agent prompts.** Carson now embeds the full SKILL.md content into every dispatched agent work order. Codex and Claude receive Carson governance knowledge without any files inside the governed repository — the outsider principle holds.
135
+ - **SKILL.md added.** A new agent interface document covering commands, exit codes, output interpretation, config, and common scenarios. Ships with the gem.
136
+ - **Scope integrity guard is advisory only.** The cross-boundary check no longer blocks commits. Commits should be grouped by feature intent, not file type. The scope guard still prints diagnostics but never prevents a commit.
137
+ - **App icon.** Added `icon.svg` (⧓ black bowtie mark) with centered display in README.
138
+ - **Hooks moved to repo root.** `assets/hooks/` → `hooks/`. The `assets/` directory is removed.
139
+
140
+ ### What users must do now
141
+
142
+ 1. Upgrade Carson to `2.4.0`.
143
+ 2. Run `carson prepare` in each governed repository.
144
+
145
+ ### Breaking or removed behaviour
146
+
147
+ - Scope integrity guard no longer hard-blocks commits with multiple core module groups. If you relied on this as a gate, it is now advisory only.
148
+ - `assets/` directory removed. Hook templates now live at `hooks/` in the gem root.
149
+
150
+ ### Upgrade steps
151
+
152
+ ```bash
153
+ cd ~/Dev/carson
154
+ git pull
155
+ bash install.sh
156
+ carson version
157
+ carson prepare
158
+ carson govern --dry-run
159
+ ```
160
+
161
+ ### Engineering Appendix
162
+
163
+ #### Modified components
164
+
165
+ - `lib/carson/adapters/prompt.rb` — reads SKILL.md at build time and wraps it in `<carson_skill>` XML tags in the agent prompt.
166
+ - `lib/carson/runtime/audit.rb` — removed `split_required` hard-block escalation; scope guard status capped at `attention`.
167
+ - `lib/carson/runtime/local.rb` — hook template path updated from `assets/hooks` to `hooks`.
168
+ - `lib/carson/config.rb` — scope path updated from `assets/hooks/**` to `hooks/**`.
169
+ - `carson.gemspec` — glob updated, `SKILL.md` and `icon.svg` added to files list.
170
+ - `script/ci_smoke.sh` — scope guard smoke test expects advisory exit instead of block.
171
+
172
+ #### New files
173
+
174
+ - `SKILL.md` — agent interface document, shipped with the gem.
175
+ - `icon.svg` — app icon.
176
+
177
+ #### Public interface and config changes
178
+
179
+ - No new CLI commands or config keys.
180
+ - Exit status contract unchanged.
181
+
182
+ #### Verification evidence
183
+
184
+ - All CI checks pass across PRs #70–#73.
185
+
186
+ ---
187
+
188
+ ## 2.3.0 — Continuous Govern Loop + Brand Badge
189
+
190
+ ### What changed
191
+
192
+ - Command renames: `init` → `onboard`, `check` → `inspect`, `hook` → `prepare`.
193
+ - Configurable workflow style (`trunk` or `branch`) with hook enforcement.
194
+ - Review gate UX improvements: bot-aware filtering, warmup wait, convergence polling.
195
+ - `carson govern --loop SECONDS` — run the govern cycle continuously with built-in sleep loop. Per-cycle error isolation keeps the daemon alive through transient failures. `Ctrl-C` exits cleanly with a cycle count summary.
196
+
197
+ ### What users must do now
198
+
199
+ 1. Upgrade Carson to `2.3.0`.
200
+ 2. Run `carson refresh` in each governed repository to update hooks for the new command names.
201
+ 3. Optionally use `carson govern --loop 300` for unattended continuous governance.
202
+
203
+ ### Breaking or removed behaviour
204
+
205
+ - Commands `init`, `check`, and `hook` have been renamed to `onboard`, `inspect`, and `prepare` respectively.
206
+
207
+ ### Upgrade steps
208
+
209
+ ```bash
210
+ cd ~/Dev/carson
211
+ git pull
212
+ bash install.sh
213
+ carson version
214
+ carson refresh ~/Dev/your-project
215
+ carson govern --dry-run
216
+ ```
217
+
218
+ ### Engineering Appendix
219
+
220
+ #### Modified components
221
+
222
+ - `lib/carson/cli.rb` — added `--loop SECONDS` to govern parser, banner, and dispatch.
223
+ - `lib/carson/runtime/govern.rb` — extracted `govern_cycle!`, added `govern_loop!` with per-cycle error isolation and `Interrupt` handling.
224
+
225
+ #### Public interface and config changes
226
+
227
+ - Added CLI flag: `--loop SECONDS` for `carson govern`.
228
+ - No new config keys. The loop interval is a runtime argument, not a persistent preference.
229
+ - Exit status contract unchanged.
230
+
231
+ #### Verification evidence
232
+
233
+ - All govern unit tests pass including 4 new loop CLI tests.
234
+
235
+ ---
236
+
237
+ ## 2.1.0 — Enriched Agent Work Orders
238
+
239
+ ### What changed
240
+
241
+ - Agent work orders now include structured evidence instead of just the PR title. Before dispatching a coding agent, Carson gathers CI failure logs or review comment bodies and includes them in the work order so the agent can act on real context.
242
+ - Configurable check wait (`govern.check_wait`, default 30 seconds). When PR checks are still pending and the PR was recently updated, Carson skips it instead of prematurely dispatching a fix — giving GitHub bots and CI time to post results.
243
+ - Shared prompt module extracted from Codex/Claude adapters. Both adapters now use `Adapters::Prompt` with structured XML context tags.
244
+ - Developer documentation updated with an ASCII flow diagram of the autonomous governance loop.
245
+
246
+ ### Evidence gathering detail
247
+
248
+ - `fix_ci` objectives: Carson fetches the most recent failed CI run via `gh run list --status failure`, then retrieves failure logs via `gh run view --log-failed`. The tail of the log (up to 8,000 chars) is included in the work order.
249
+ - `address_review` objectives: Carson fetches unresolved review threads and actionable top-level findings via GraphQL, and includes each finding's body text (up to 2,000 chars each).
250
+ - Re-dispatch: if a prior dispatch for the same PR failed, the previous attempt summary is included so the agent can avoid repeating the same approach.
251
+ - Graceful degradation: if evidence gathering fails, the agent receives the PR title and is told to investigate locally.
252
+
253
+ ### What users must do now
254
+
255
+ 1. Upgrade Carson to `2.1.0`.
256
+ 2. Optionally tune `govern.check_wait` in `~/.carson/config.json` or via `CARSON_GOVERN_CHECK_WAIT`.
257
+
258
+ ### Breaking or removed behaviour
259
+
260
+ - None. The `context` field on `WorkOrder` is backward compatible — String values are still accepted.
261
+
262
+ ### Upgrade steps
263
+
264
+ ```bash
265
+ cd ~/Dev/carson
266
+ git pull
267
+ bash install.sh
268
+ carson version
269
+ carson govern --dry-run
270
+ ```
271
+
272
+ ### Engineering Appendix
273
+
274
+ #### New components
275
+
276
+ - `lib/carson/adapters/prompt.rb` — shared prompt builder module with structured XML context tags.
277
+
278
+ #### Modified components
279
+
280
+ - `lib/carson/runtime/govern.rb` — evidence methods (`evidence`, `ci_evidence`, `review_evidence`, `prior_attempt`, `truncate_log`), check wait logic (`within_check_wait?`, `TRIAGE_PENDING`), `updatedAt` added to `gh pr list` fields.
281
+ - `lib/carson/config.rb` — added `govern.check_wait` (integer, seconds, default 30).
282
+ - `lib/carson/adapters/codex.rb`, `lib/carson/adapters/claude.rb` — now include `Prompt` module, removed duplicate `build_prompt`/`sanitize`.
283
+ - `lib/carson/adapters/agent.rb` — updated `context` field documentation for Hash shapes.
284
+ - `docs/develop.md` — added autonomous governance loop section with ASCII diagram.
285
+
286
+ #### Public interface and config changes
287
+
288
+ - Added config key: `govern.check_wait` (integer, seconds, default 30).
289
+ - Added env override: `CARSON_GOVERN_CHECK_WAIT`.
290
+ - Exit status contract unchanged.
291
+
292
+ #### Verification evidence
293
+
294
+ - 37 govern unit tests pass (18 new, 0 regressions).
295
+ - CI smoke tests pass.
296
+
297
+ ---
298
+
299
+ ## 2.0.0 — Autonomous Governance
300
+
301
+ ### Architectural shift
302
+
303
+ Carson 2.0.0 is an architectural change. Prior versions were a passive governance tool: Carson checked, reported, and blocked — but you still had to triage PRs, dispatch fixes, click merge, and clean up. Across a portfolio of repositories with coding agents producing many PRs, you were the bottleneck.
304
+
305
+ Carson is now an autonomous governance runtime. `carson govern` is a portfolio-level triage loop that scans every governed repository, classifies each open PR by CI/review/audit status, and acts: merge what's ready, dispatch a coding agent (Codex or Claude) to fix what's failing, and escalate what needs human judgement. After merging, it housekeeps — syncing main and pruning stale branches.
306
+
307
+ The per-commit governance (audit, lint, review gate, scope integrity) is unchanged. What's new is the layer above: Carson now orchestrates the full lifecycle from PR to merge to cleanup.
308
+
309
+ ### What changed
310
+
311
+ - `carson govern [--dry-run] [--json]` — portfolio-level PR triage loop.
312
+ - `carson housekeep` — standalone sync + prune for post-merge cleanup.
313
+ - Agent dispatch adapters for Codex and Claude CLIs, with work-order/result contracts and dispatch state tracking at `~/.carson/govern/dispatch_state.json`.
314
+ - `govern` configuration section: repo list, merge authority/method, agent provider selection.
315
+ - Merge authority is on by default — Carson merges ready PRs autonomously.
316
+ - `.rubocop.yml` removed from repository; lint config now lives at `~/.carson/lint/rubocop.yml` per Carson's own policy.
317
+
318
+ ### What users must do now
319
+
320
+ 1. Upgrade Carson to `2.0.0`.
321
+ 2. Run `carson refresh` in each governed repository to update hooks.
322
+ 3. Optionally configure `govern.repos` in `~/.carson/config.json` to enable multi-repo portfolio mode.
323
+ 4. Run `carson govern --dry-run` to see what Carson would do across your portfolio.
324
+
325
+ ### Breaking or removed behaviour
326
+
327
+ - `.rubocop.yml` is no longer in the repository. All repos use `~/.carson/lint/rubocop.yml`.
328
+
329
+ ### Upgrade steps
330
+
331
+ ```bash
332
+ cd ~/Dev/carson
333
+ git pull
334
+ bash install.sh
335
+ carson version
336
+ carson refresh ~/Dev/your-project
337
+ carson govern --dry-run
338
+ ```
339
+
340
+ ### Engineering Appendix
341
+
342
+ #### New components
343
+
344
+ - `lib/carson/runtime/govern.rb` — portfolio triage loop, PR classification, merge, housekeep orchestration.
345
+ - `lib/carson/adapters/agent.rb` — work-order/result data contracts (`WorkOrder`, `Result`).
346
+ - `lib/carson/adapters/codex.rb` — Codex CLI adapter via `Open3.capture3`.
347
+ - `lib/carson/adapters/claude.rb` — Claude CLI adapter via `Open3.capture3`.
348
+
349
+ #### Decision tree
350
+
351
+ For each open PR in each governed repo: CI green? Review gate pass? Audit pass? All yes → merge + housekeep. CI failing → dispatch agent. Review blocked → dispatch agent. Other → escalate.
352
+
353
+ #### Public interface and config changes
354
+
355
+ - Added CLI commands: `govern [--dry-run] [--json]`, `housekeep`.
356
+ - Added config section: `govern.repos`, `govern.merge.authority` (default: `true`), `govern.merge.method`, `govern.agent.provider`, `govern.dispatch_state_path`.
357
+ - Added env overrides: `CARSON_GOVERN_REPOS`, `CARSON_GOVERN_MERGE_AUTHORITY`, `CARSON_GOVERN_MERGE_METHOD`, `CARSON_GOVERN_AGENT_PROVIDER`.
358
+ - Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
359
+
360
+ #### Verification evidence
361
+
362
+ - 87 unit tests pass (19 new govern tests, 0 regressions).
363
+ - 60 smoke tests pass (6 new govern/housekeep tests).
364
+
365
+ ---
366
+
367
+ ## 1.1.0
368
+
369
+ ### User Overview
370
+
371
+ #### What changed
372
+
373
+ - All Carson home-directory paths consolidated under `~/.carson/`:
374
+ - Lint policy files: `~/AI/CODING/` moved to `~/.carson/lint/`.
375
+ - Audit reports and cache: `~/.cache/carson/` moved to `~/.carson/cache/`.
376
+ - Launcher symlink: `~/.local/bin/carson` moved to `~/.carson/bin/carson`.
377
+
378
+ #### Why users should care
379
+
380
+ - Carson now uses a single top-level directory (`~/.carson/`) for all state. Uninstalling is `rm -rf ~/.carson` plus `gem uninstall carson`.
381
+ - No more scattered paths across `~/.cache`, `~/.local/bin`, and `~/AI`.
382
+
383
+ #### What users must do now
384
+
385
+ 1. Upgrade Carson to `1.1.0`.
386
+ 2. Update PATH: replace `~/.local/bin` with `~/.carson/bin` in your shell profile.
387
+ 3. Rerun `carson lint setup --source <path-or-git-url> --force` to populate `~/.carson/lint/`.
388
+ 4. Optionally clean up old paths: `rm -rf ~/.cache/carson ~/AI/CODING ~/.local/bin/carson`.
389
+
390
+ #### Breaking or removed behaviour
391
+
392
+ - `~/AI/CODING/` is no longer the default lint policy directory.
393
+ - `~/.cache/carson/` is no longer the default report output directory.
394
+ - `~/.local/bin/carson` is no longer the default launcher symlink location.
395
+ - Users with custom `lint.languages` entries in `~/.carson/config.json` pointing to `~/AI/CODING/` must update those paths.
396
+
397
+ #### Upgrade steps
398
+
399
+ ```bash
400
+ gem install --user-install carson -v 1.1.0
401
+ mkdir -p ~/.carson/bin
402
+ ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.carson/bin/carson
403
+ export PATH="$HOME/.carson/bin:$PATH"
404
+ $HOME/.carson/bin/carson version
405
+ $HOME/.carson/bin/carson lint setup --source /path/to/your-policy-repo --force
406
+ ```
407
+
408
+ Add the `PATH` export to your shell profile so it persists across sessions.
409
+
410
+ ---
411
+
8
412
  ## 1.0.0 (2026-02-25)
9
413
 
10
414
  ### User Overview
@@ -184,7 +588,7 @@ carson version
184
588
  #### What users must do now
185
589
 
186
590
  1. Upgrade to `0.6.1` where Carson is pinned.
187
- 2. Re-run `carson hook` in governed repositories after upgrade.
591
+ 2. Re-run `carson prepare` in governed repositories after upgrade.
188
592
  3. Update CI `carson_version` pins to `0.6.1`.
189
593
 
190
594
  #### Breaking or removed behaviour
@@ -384,7 +788,7 @@ carson version
384
788
  #### What users must do now
385
789
 
386
790
  1. Use `carson offboard /local/path/of/repo` when removing Carson from a repository.
387
- 2. Re-run `carson init /local/path/of/repo` when re-onboarding later.
791
+ 2. Re-run `carson onboard /local/path/of/repo` when re-onboarding later.
388
792
 
389
793
  #### Breaking or removed behaviour
390
794
 
@@ -483,7 +887,7 @@ carson version
483
887
 
484
888
  #### What changed
485
889
 
486
- - Added one-command initialisation: `carson init [repo_path]` (`hook` + `template apply` + `audit`).
890
+ - Added one-command initialisation: `carson onboard [repo_path]` (`hook` + `template apply` + `audit`).
487
891
  - Default report output moved to `~/.cache/carson`.
488
892
  - Outsider boundary now hard-blocks Carson-owned host artefacts (`.carson.yml`, `bin/carson`, `.tools/carson/*`).
489
893
  - Installation/setup guidance now targets standard-user package-consumer flow.
@@ -497,7 +901,7 @@ carson version
497
901
  #### What users must do now
498
902
 
499
903
  1. Install Carson as a normal user executable (`carson` in `PATH`).
500
- 2. Initialise each repository with `carson init /local/path/of/repo`.
904
+ 2. Initialise each repository with `carson onboard /local/path/of/repo`.
501
905
  3. Remove forbidden Carson-owned artefacts from host repositories if reported.
502
906
  4. Read reports from `~/.cache/carson`.
503
907
 
@@ -516,7 +920,7 @@ mkdir -p ~/.local/bin
516
920
  ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
517
921
  carson version
518
922
 
519
- carson init /local/path/of/repo
923
+ carson onboard /local/path/of/repo
520
924
  carson audit
521
925
  ```
522
926
 
@@ -538,7 +942,7 @@ carson audit
538
942
 
539
943
  #### Public interface and config changes
540
944
 
541
- - Command surface is `audit`, `sync`, `prune`, `hook`, `check`, `init`, `template`, `review`, `version`.
945
+ - Command surface is `audit`, `sync`, `prune`, `prepare`, `inspect`, `onboard`, `template`, `review`, `version`.
542
946
  - Initialisation command: `init [repo_path]` (no `run` alias).
543
947
  - Default report output: `~/.cache/carson`.
544
948
  - Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy block.