carson 1.0.1 → 2.6.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 init` 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,350 @@ 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.6.0 — Default Squash Merge + Agent Discovery Templates
9
+
10
+ ### What changed
11
+
12
+ - **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.
13
+ - **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.
14
+ - **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`.
15
+
16
+ ### What users must do now
17
+
18
+ 1. Upgrade Carson to `2.6.0`.
19
+ 2. Run `carson prepare` in each governed repository.
20
+ 3. Run `carson template apply` to write the new managed files.
21
+ 4. Commit the new `.github/*` files.
22
+ 5. If you previously set `govern.merge.method` to `"merge"` explicitly in `~/.carson/config.json`, review whether `"squash"` (now the default) is the right choice.
23
+
24
+ ### Breaking or removed behaviour
25
+
26
+ - `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`.
27
+ - `.github/copilot-instructions.md` content replaced with a one-line reference. The governance baseline now lives in `.github/carson-instructions.md`.
28
+
29
+ ### Upgrade steps
30
+
31
+ ```bash
32
+ cd ~/Dev/carson
33
+ git pull
34
+ bash install.sh
35
+ carson version
36
+ carson prepare
37
+ carson template apply
38
+ ```
39
+
40
+ ### Engineering Appendix
41
+
42
+ #### Modified components
43
+
44
+ - `lib/carson/config.rb` — `govern.merge.method` default changed from `"merge"` to `"squash"`; `template.managed_files` expanded to include `carson-instructions.md`, `CLAUDE.md`, and `AGENTS.md`.
45
+ - `script/ci_smoke.sh` — offboard removal check updated for new managed files.
46
+ - `test/runtime_govern_test.rb` — unit test updated for squash default.
47
+
48
+ #### New files
49
+
50
+ - `templates/.github/carson-instructions.md` — governance baseline source of truth.
51
+ - `templates/.github/CLAUDE.md` — one-line reference for Claude Code.
52
+ - `templates/.github/AGENTS.md` — one-line reference for Codex.
53
+
54
+ #### Changed files
55
+
56
+ - `templates/.github/copilot-instructions.md` — replaced full content with one-line reference.
57
+
58
+ #### Public interface and config changes
59
+
60
+ - `govern.merge.method` default: `"merge"` → `"squash"`.
61
+ - `template.managed_files` default expanded from 2 to 5 files.
62
+ - Exit status contract unchanged.
63
+
64
+ #### Verification evidence
65
+
66
+ - CI passes on PRs #77 and #78.
67
+
68
+ ---
69
+
70
+ ## 2.4.0 — Agent Skill Injection + Scope Guard Reform
71
+
72
+ ### What changed
73
+
74
+ - **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.
75
+ - **SKILL.md added.** A new agent interface document covering commands, exit codes, output interpretation, config, and common scenarios. Ships with the gem.
76
+ - **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.
77
+ - **App icon.** Added `icon.svg` (⧓ black bowtie mark) with centered display in README.
78
+ - **Hooks moved to repo root.** `assets/hooks/` → `hooks/`. The `assets/` directory is removed.
79
+
80
+ ### What users must do now
81
+
82
+ 1. Upgrade Carson to `2.4.0`.
83
+ 2. Run `carson prepare` in each governed repository.
84
+
85
+ ### Breaking or removed behaviour
86
+
87
+ - 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.
88
+ - `assets/` directory removed. Hook templates now live at `hooks/` in the gem root.
89
+
90
+ ### Upgrade steps
91
+
92
+ ```bash
93
+ cd ~/Dev/carson
94
+ git pull
95
+ bash install.sh
96
+ carson version
97
+ carson prepare
98
+ carson govern --dry-run
99
+ ```
100
+
101
+ ### Engineering Appendix
102
+
103
+ #### Modified components
104
+
105
+ - `lib/carson/adapters/prompt.rb` — reads SKILL.md at build time and wraps it in `<carson_skill>` XML tags in the agent prompt.
106
+ - `lib/carson/runtime/audit.rb` — removed `split_required` hard-block escalation; scope guard status capped at `attention`.
107
+ - `lib/carson/runtime/local.rb` — hook template path updated from `assets/hooks` to `hooks`.
108
+ - `lib/carson/config.rb` — scope path updated from `assets/hooks/**` to `hooks/**`.
109
+ - `carson.gemspec` — glob updated, `SKILL.md` and `icon.svg` added to files list.
110
+ - `script/ci_smoke.sh` — scope guard smoke test expects advisory exit instead of block.
111
+
112
+ #### New files
113
+
114
+ - `SKILL.md` — agent interface document, shipped with the gem.
115
+ - `icon.svg` — app icon.
116
+
117
+ #### Public interface and config changes
118
+
119
+ - No new CLI commands or config keys.
120
+ - Exit status contract unchanged.
121
+
122
+ #### Verification evidence
123
+
124
+ - All CI checks pass across PRs #70–#73.
125
+
126
+ ---
127
+
128
+ ## 2.3.0 — Continuous Govern Loop + Brand Badge
129
+
130
+ ### What changed
131
+
132
+ - Command renames: `init` → `onboard`, `check` → `inspect`, `hook` → `prepare`.
133
+ - Configurable workflow style (`trunk` or `branch`) with hook enforcement.
134
+ - Review gate UX improvements: bot-aware filtering, warmup wait, convergence polling.
135
+ - `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.
136
+
137
+ ### What users must do now
138
+
139
+ 1. Upgrade Carson to `2.3.0`.
140
+ 2. Run `carson refresh` in each governed repository to update hooks for the new command names.
141
+ 3. Optionally use `carson govern --loop 300` for unattended continuous governance.
142
+
143
+ ### Breaking or removed behaviour
144
+
145
+ - Commands `init`, `check`, and `hook` have been renamed to `onboard`, `inspect`, and `prepare` respectively.
146
+
147
+ ### Upgrade steps
148
+
149
+ ```bash
150
+ cd ~/Dev/carson
151
+ git pull
152
+ bash install.sh
153
+ carson version
154
+ carson refresh ~/Dev/your-project
155
+ carson govern --dry-run
156
+ ```
157
+
158
+ ### Engineering Appendix
159
+
160
+ #### Modified components
161
+
162
+ - `lib/carson/cli.rb` — added `--loop SECONDS` to govern parser, banner, and dispatch.
163
+ - `lib/carson/runtime/govern.rb` — extracted `govern_cycle!`, added `govern_loop!` with per-cycle error isolation and `Interrupt` handling.
164
+
165
+ #### Public interface and config changes
166
+
167
+ - Added CLI flag: `--loop SECONDS` for `carson govern`.
168
+ - No new config keys. The loop interval is a runtime argument, not a persistent preference.
169
+ - Exit status contract unchanged.
170
+
171
+ #### Verification evidence
172
+
173
+ - All govern unit tests pass including 4 new loop CLI tests.
174
+
175
+ ---
176
+
177
+ ## 2.1.0 — Enriched Agent Work Orders
178
+
179
+ ### What changed
180
+
181
+ - 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.
182
+ - 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.
183
+ - Shared prompt module extracted from Codex/Claude adapters. Both adapters now use `Adapters::Prompt` with structured XML context tags.
184
+ - Developer documentation updated with an ASCII flow diagram of the autonomous governance loop.
185
+
186
+ ### Evidence gathering detail
187
+
188
+ - `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.
189
+ - `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).
190
+ - 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.
191
+ - Graceful degradation: if evidence gathering fails, the agent receives the PR title and is told to investigate locally.
192
+
193
+ ### What users must do now
194
+
195
+ 1. Upgrade Carson to `2.1.0`.
196
+ 2. Optionally tune `govern.check_wait` in `~/.carson/config.json` or via `CARSON_GOVERN_CHECK_WAIT`.
197
+
198
+ ### Breaking or removed behaviour
199
+
200
+ - None. The `context` field on `WorkOrder` is backward compatible — String values are still accepted.
201
+
202
+ ### Upgrade steps
203
+
204
+ ```bash
205
+ cd ~/Dev/carson
206
+ git pull
207
+ bash install.sh
208
+ carson version
209
+ carson govern --dry-run
210
+ ```
211
+
212
+ ### Engineering Appendix
213
+
214
+ #### New components
215
+
216
+ - `lib/carson/adapters/prompt.rb` — shared prompt builder module with structured XML context tags.
217
+
218
+ #### Modified components
219
+
220
+ - `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.
221
+ - `lib/carson/config.rb` — added `govern.check_wait` (integer, seconds, default 30).
222
+ - `lib/carson/adapters/codex.rb`, `lib/carson/adapters/claude.rb` — now include `Prompt` module, removed duplicate `build_prompt`/`sanitize`.
223
+ - `lib/carson/adapters/agent.rb` — updated `context` field documentation for Hash shapes.
224
+ - `docs/develop.md` — added autonomous governance loop section with ASCII diagram.
225
+
226
+ #### Public interface and config changes
227
+
228
+ - Added config key: `govern.check_wait` (integer, seconds, default 30).
229
+ - Added env override: `CARSON_GOVERN_CHECK_WAIT`.
230
+ - Exit status contract unchanged.
231
+
232
+ #### Verification evidence
233
+
234
+ - 37 govern unit tests pass (18 new, 0 regressions).
235
+ - CI smoke tests pass.
236
+
237
+ ---
238
+
239
+ ## 2.0.0 — Autonomous Governance
240
+
241
+ ### Architectural shift
242
+
243
+ 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.
244
+
245
+ 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.
246
+
247
+ 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.
248
+
249
+ ### What changed
250
+
251
+ - `carson govern [--dry-run] [--json]` — portfolio-level PR triage loop.
252
+ - `carson housekeep` — standalone sync + prune for post-merge cleanup.
253
+ - Agent dispatch adapters for Codex and Claude CLIs, with work-order/result contracts and dispatch state tracking at `~/.carson/govern/dispatch_state.json`.
254
+ - `govern` configuration section: repo list, merge authority/method, agent provider selection.
255
+ - Merge authority is on by default — Carson merges ready PRs autonomously.
256
+ - `.rubocop.yml` removed from repository; lint config now lives at `~/.carson/lint/rubocop.yml` per Carson's own policy.
257
+
258
+ ### What users must do now
259
+
260
+ 1. Upgrade Carson to `2.0.0`.
261
+ 2. Run `carson refresh` in each governed repository to update hooks.
262
+ 3. Optionally configure `govern.repos` in `~/.carson/config.json` to enable multi-repo portfolio mode.
263
+ 4. Run `carson govern --dry-run` to see what Carson would do across your portfolio.
264
+
265
+ ### Breaking or removed behaviour
266
+
267
+ - `.rubocop.yml` is no longer in the repository. All repos use `~/.carson/lint/rubocop.yml`.
268
+
269
+ ### Upgrade steps
270
+
271
+ ```bash
272
+ cd ~/Dev/carson
273
+ git pull
274
+ bash install.sh
275
+ carson version
276
+ carson refresh ~/Dev/your-project
277
+ carson govern --dry-run
278
+ ```
279
+
280
+ ### Engineering Appendix
281
+
282
+ #### New components
283
+
284
+ - `lib/carson/runtime/govern.rb` — portfolio triage loop, PR classification, merge, housekeep orchestration.
285
+ - `lib/carson/adapters/agent.rb` — work-order/result data contracts (`WorkOrder`, `Result`).
286
+ - `lib/carson/adapters/codex.rb` — Codex CLI adapter via `Open3.capture3`.
287
+ - `lib/carson/adapters/claude.rb` — Claude CLI adapter via `Open3.capture3`.
288
+
289
+ #### Decision tree
290
+
291
+ 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.
292
+
293
+ #### Public interface and config changes
294
+
295
+ - Added CLI commands: `govern [--dry-run] [--json]`, `housekeep`.
296
+ - Added config section: `govern.repos`, `govern.merge.authority` (default: `true`), `govern.merge.method`, `govern.agent.provider`, `govern.dispatch_state_path`.
297
+ - Added env overrides: `CARSON_GOVERN_REPOS`, `CARSON_GOVERN_MERGE_AUTHORITY`, `CARSON_GOVERN_MERGE_METHOD`, `CARSON_GOVERN_AGENT_PROVIDER`.
298
+ - Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
299
+
300
+ #### Verification evidence
301
+
302
+ - 87 unit tests pass (19 new govern tests, 0 regressions).
303
+ - 60 smoke tests pass (6 new govern/housekeep tests).
304
+
305
+ ---
306
+
307
+ ## 1.1.0
308
+
309
+ ### User Overview
310
+
311
+ #### What changed
312
+
313
+ - All Carson home-directory paths consolidated under `~/.carson/`:
314
+ - Lint policy files: `~/AI/CODING/` moved to `~/.carson/lint/`.
315
+ - Audit reports and cache: `~/.cache/carson/` moved to `~/.carson/cache/`.
316
+ - Launcher symlink: `~/.local/bin/carson` moved to `~/.carson/bin/carson`.
317
+
318
+ #### Why users should care
319
+
320
+ - Carson now uses a single top-level directory (`~/.carson/`) for all state. Uninstalling is `rm -rf ~/.carson` plus `gem uninstall carson`.
321
+ - No more scattered paths across `~/.cache`, `~/.local/bin`, and `~/AI`.
322
+
323
+ #### What users must do now
324
+
325
+ 1. Upgrade Carson to `1.1.0`.
326
+ 2. Update PATH: replace `~/.local/bin` with `~/.carson/bin` in your shell profile.
327
+ 3. Rerun `carson lint setup --source <path-or-git-url> --force` to populate `~/.carson/lint/`.
328
+ 4. Optionally clean up old paths: `rm -rf ~/.cache/carson ~/AI/CODING ~/.local/bin/carson`.
329
+
330
+ #### Breaking or removed behaviour
331
+
332
+ - `~/AI/CODING/` is no longer the default lint policy directory.
333
+ - `~/.cache/carson/` is no longer the default report output directory.
334
+ - `~/.local/bin/carson` is no longer the default launcher symlink location.
335
+ - Users with custom `lint.languages` entries in `~/.carson/config.json` pointing to `~/AI/CODING/` must update those paths.
336
+
337
+ #### Upgrade steps
338
+
339
+ ```bash
340
+ gem install --user-install carson -v 1.1.0
341
+ mkdir -p ~/.carson/bin
342
+ ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.carson/bin/carson
343
+ export PATH="$HOME/.carson/bin:$PATH"
344
+ $HOME/.carson/bin/carson version
345
+ $HOME/.carson/bin/carson lint setup --source /path/to/your-policy-repo --force
346
+ ```
347
+
348
+ Add the `PATH` export to your shell profile so it persists across sessions.
349
+
350
+ ---
351
+
8
352
  ## 1.0.0 (2026-02-25)
9
353
 
10
354
  ### User Overview
@@ -184,7 +528,7 @@ carson version
184
528
  #### What users must do now
185
529
 
186
530
  1. Upgrade to `0.6.1` where Carson is pinned.
187
- 2. Re-run `carson hook` in governed repositories after upgrade.
531
+ 2. Re-run `carson prepare` in governed repositories after upgrade.
188
532
  3. Update CI `carson_version` pins to `0.6.1`.
189
533
 
190
534
  #### Breaking or removed behaviour
@@ -384,7 +728,7 @@ carson version
384
728
  #### What users must do now
385
729
 
386
730
  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.
731
+ 2. Re-run `carson onboard /local/path/of/repo` when re-onboarding later.
388
732
 
389
733
  #### Breaking or removed behaviour
390
734
 
@@ -483,7 +827,7 @@ carson version
483
827
 
484
828
  #### What changed
485
829
 
486
- - Added one-command initialisation: `carson init [repo_path]` (`hook` + `template apply` + `audit`).
830
+ - Added one-command initialisation: `carson onboard [repo_path]` (`hook` + `template apply` + `audit`).
487
831
  - Default report output moved to `~/.cache/carson`.
488
832
  - Outsider boundary now hard-blocks Carson-owned host artefacts (`.carson.yml`, `bin/carson`, `.tools/carson/*`).
489
833
  - Installation/setup guidance now targets standard-user package-consumer flow.
@@ -497,7 +841,7 @@ carson version
497
841
  #### What users must do now
498
842
 
499
843
  1. Install Carson as a normal user executable (`carson` in `PATH`).
500
- 2. Initialise each repository with `carson init /local/path/of/repo`.
844
+ 2. Initialise each repository with `carson onboard /local/path/of/repo`.
501
845
  3. Remove forbidden Carson-owned artefacts from host repositories if reported.
502
846
  4. Read reports from `~/.cache/carson`.
503
847
 
@@ -516,7 +860,7 @@ mkdir -p ~/.local/bin
516
860
  ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
517
861
  carson version
518
862
 
519
- carson init /local/path/of/repo
863
+ carson onboard /local/path/of/repo
520
864
  carson audit
521
865
  ```
522
866
 
@@ -538,7 +882,7 @@ carson audit
538
882
 
539
883
  #### Public interface and config changes
540
884
 
541
- - Command surface is `audit`, `sync`, `prune`, `hook`, `check`, `init`, `template`, `review`, `version`.
885
+ - Command surface is `audit`, `sync`, `prune`, `prepare`, `inspect`, `onboard`, `template`, `review`, `version`.
542
886
  - Initialisation command: `init [repo_path]` (no `run` alias).
543
887
  - Default report output: `~/.cache/carson`.
544
888
  - Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy block.