carson 1.0.0 → 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.
- checksums.yaml +4 -4
- data/.github/copilot-instructions.md +1 -12
- data/.github/workflows/carson_policy.yml +1 -1
- data/API.md +50 -13
- data/MANUAL.md +140 -65
- data/README.md +140 -33
- data/RELEASE.md +350 -6
- data/SKILL.md +102 -0
- data/VERSION +1 -1
- data/carson.gemspec +3 -1
- data/{assets/hooks → hooks}/pre-commit +1 -1
- data/{assets/hooks → hooks}/pre-merge-commit +4 -0
- data/{assets/hooks → hooks}/pre-push +4 -0
- data/{assets/hooks → hooks}/prepare-commit-msg +4 -0
- data/icon.svg +651 -0
- data/lib/carson/adapters/agent.rb +15 -0
- data/lib/carson/adapters/claude.rb +45 -0
- data/lib/carson/adapters/codex.rb +45 -0
- data/lib/carson/adapters/prompt.rb +60 -0
- data/lib/carson/cli.rb +65 -20
- data/lib/carson/config.rb +100 -14
- data/lib/carson/policy/ruby/lint.rb +1 -1
- data/lib/carson/runtime/audit.rb +33 -10
- data/lib/carson/runtime/govern.rb +641 -0
- data/lib/carson/runtime/lint.rb +3 -3
- data/lib/carson/runtime/local.rb +51 -12
- data/lib/carson/runtime/review/gate_support.rb +14 -1
- data/lib/carson/runtime/review.rb +3 -3
- data/lib/carson/runtime.rb +10 -3
- data/lib/carson.rb +9 -0
- data/templates/.github/AGENTS.md +1 -0
- data/templates/.github/CLAUDE.md +1 -0
- data/templates/.github/carson-instructions.md +12 -0
- data/templates/.github/copilot-instructions.md +1 -12
- metadata +15 -5
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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`, `
|
|
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.
|
data/SKILL.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Carson Skill
|
|
2
|
+
|
|
3
|
+
You are working in a repository governed by Carson — a deterministic governance runtime. Carson handles git hooks, lint enforcement, PR triage, agent dispatch, merge, and cleanup. You provide the intelligence; Carson provides the infrastructure.
|
|
4
|
+
|
|
5
|
+
## When to use Carson commands
|
|
6
|
+
|
|
7
|
+
| User intent | Command | What happens |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| "Check if my code is ready" | `carson audit` | Lint, scope, boundary checks. Exit 0 = clean. Exit 2 = policy block. |
|
|
10
|
+
| "Is my PR mergeable?" | `carson review gate` | Polls for unresolved review threads and actionable comments. Blocks until resolved. |
|
|
11
|
+
| "What's happening across my repos?" | `carson govern --dry-run` | Classifies every open PR without taking action. Read the summary. |
|
|
12
|
+
| "Run governance continuously" | `carson govern --loop 300` | Triage-dispatch-merge cycle every 300 seconds. Ctrl-C to stop. |
|
|
13
|
+
| "Merge ready PRs and dispatch fixes" | `carson govern` | Full autonomous cycle: merge, dispatch agents, escalate, housekeep. |
|
|
14
|
+
| "Set up Carson for a repo" | `carson onboard /path/to/repo` | Installs hooks, syncs templates, runs first audit. |
|
|
15
|
+
| "Refresh after upgrading Carson" | `carson refresh` | Re-applies hooks and templates for the current version. |
|
|
16
|
+
| "Update my local main" | `carson sync` | Fast-forward local main from remote. Blocks if tree is dirty. |
|
|
17
|
+
| "Clean up stale branches" | `carson prune` | Removes local branches whose upstream is gone. |
|
|
18
|
+
| "Check template drift" | `carson template check` then `carson template apply` | Detect and fix .github/* drift. |
|
|
19
|
+
| "Remove Carson from a repo" | `carson offboard /path/to/repo` | Removes hooks and managed files. |
|
|
20
|
+
| "What version?" | `carson version` | Prints installed version with ⧓ badge. |
|
|
21
|
+
| "Verify hook installation" | `carson inspect` | Checks hooks path, file existence, permissions. |
|
|
22
|
+
|
|
23
|
+
## Exit codes
|
|
24
|
+
|
|
25
|
+
- `0` — success, all clear.
|
|
26
|
+
- `1` — runtime or configuration error. Read the error message.
|
|
27
|
+
- `2` — policy block. Something must be fixed before proceeding (lint violation, unresolved review, boundary breach).
|
|
28
|
+
|
|
29
|
+
When you see exit 2, do NOT bypass it. Read the output, fix the root cause, and re-run.
|
|
30
|
+
|
|
31
|
+
## Interpreting audit output
|
|
32
|
+
|
|
33
|
+
Carson audit output is structured as labelled key-value lines prefixed with ⧓. Key sections:
|
|
34
|
+
|
|
35
|
+
- **Working Tree** — staged/unstaged status.
|
|
36
|
+
- **Local Lint Quality** — per-language lint results. `lint_ruby_status: ok` means clean.
|
|
37
|
+
- **Main Sync Status** — whether local main matches remote. If ahead, reset drift before committing.
|
|
38
|
+
- **Scope Integrity Guard** — checks that commits stay within a single business intent and scope group.
|
|
39
|
+
- **Audit Result** — final verdict: `status: ok` (clean), `status: attention` (advisory, not blocking), `status: block` (must fix).
|
|
40
|
+
|
|
41
|
+
## Interpreting govern output
|
|
42
|
+
|
|
43
|
+
`carson govern --dry-run` classifies each PR:
|
|
44
|
+
|
|
45
|
+
- **ready** → would merge. All gates pass.
|
|
46
|
+
- **ci_failing** → would dispatch agent to fix CI.
|
|
47
|
+
- **review_blocked** → would dispatch agent to address review comments.
|
|
48
|
+
- **pending** → skip. Checks still running (within check_wait window).
|
|
49
|
+
- **needs_attention** → escalate. Needs human judgement.
|
|
50
|
+
|
|
51
|
+
The summary line: `govern_summary: repos=N prs=N ready=N blocked=N`
|
|
52
|
+
|
|
53
|
+
## Configuration
|
|
54
|
+
|
|
55
|
+
Single config file: `~/.carson/config.json`. Key settings:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"govern": {
|
|
60
|
+
"repos": ["~/Dev/repo-a", "~/Dev/repo-b"],
|
|
61
|
+
"merge": { "method": "rebase" },
|
|
62
|
+
"agent": { "provider": "auto" }
|
|
63
|
+
},
|
|
64
|
+
"review": {
|
|
65
|
+
"bot_usernames": ["gemini-code-assist"]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
- `govern.merge.method` — must match GitHub branch protection. Use `rebase` if linear history is required.
|
|
71
|
+
- `govern.repos` — list of repo paths for portfolio-level governance. Empty = current repo only.
|
|
72
|
+
- `govern.agent.provider` — `auto` (tries codex then claude), `codex`, or `claude`.
|
|
73
|
+
- `review.bot_usernames` — bot logins to ignore in review gate. Use GraphQL login format (no `[bot]` suffix).
|
|
74
|
+
|
|
75
|
+
Environment overrides take precedence over config file. Common ones:
|
|
76
|
+
- `CARSON_GOVERN_MERGE_METHOD`
|
|
77
|
+
- `CARSON_REVIEW_BOT_USERNAMES`
|
|
78
|
+
- `CARSON_GOVERN_CHECK_WAIT`
|
|
79
|
+
|
|
80
|
+
## Common scenarios
|
|
81
|
+
|
|
82
|
+
**Commit blocked by audit:**
|
|
83
|
+
Run `carson audit`, read the block reason, fix it, then `git add` and `git commit` again. Do not skip the hook.
|
|
84
|
+
|
|
85
|
+
**Review gate blocked:**
|
|
86
|
+
Run `carson review gate` to see which comments need disposition. Respond to each with the required prefix (default: `Disposition:`), then re-run.
|
|
87
|
+
|
|
88
|
+
**Local main drifted ahead of remote:**
|
|
89
|
+
This means a commit was made to main that couldn't be pushed (branch protection). Reset: `git checkout main && git reset --hard github/main`.
|
|
90
|
+
|
|
91
|
+
**Hooks out of date after upgrade:**
|
|
92
|
+
Run `carson prepare` to write new hook versions, then `carson inspect` to verify.
|
|
93
|
+
|
|
94
|
+
**Govern merge fails:**
|
|
95
|
+
Check that `govern.merge.method` in config matches what GitHub allows. If the repo enforces linear history, only `rebase` works.
|
|
96
|
+
|
|
97
|
+
## Boundaries
|
|
98
|
+
|
|
99
|
+
- Carson never lives inside governed repositories. No `.carson.yml`, no `bin/carson`, no `.tools/carson/`.
|
|
100
|
+
- Carson-managed files in repos are limited to `.github/*` templates.
|
|
101
|
+
- Carson's hooks live at `~/.carson/hooks/<version>/`, never in `.git/hooks/`.
|
|
102
|
+
- Lint policy lives at `~/.carson/lint/`, seeded by `carson lint setup --source <policy-repo>`.
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2.6.0
|
data/carson.gemspec
CHANGED
|
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.bindir = "exe"
|
|
23
23
|
spec.executables = [ "carson" ]
|
|
24
24
|
spec.require_paths = [ "lib" ]
|
|
25
|
-
spec.files = Dir.glob( "{lib,exe,templates,
|
|
25
|
+
spec.files = Dir.glob( "{lib,exe,templates,hooks}/**/*", File::FNM_DOTMATCH ).select { |path| File.file?( path ) } + [
|
|
26
26
|
".github/copilot-instructions.md",
|
|
27
27
|
".github/pull_request_template.md",
|
|
28
28
|
".github/workflows/carson_policy.yml",
|
|
@@ -32,6 +32,8 @@ Gem::Specification.new do |spec|
|
|
|
32
32
|
"RELEASE.md",
|
|
33
33
|
"VERSION",
|
|
34
34
|
"LICENSE",
|
|
35
|
+
"SKILL.md",
|
|
36
|
+
"icon.svg",
|
|
35
37
|
"carson.gemspec"
|
|
36
38
|
]
|
|
37
39
|
end
|
|
@@ -7,7 +7,7 @@ elif command -v carson >/dev/null 2>&1; then
|
|
|
7
7
|
carson_command=( "carson" )
|
|
8
8
|
else
|
|
9
9
|
echo "Carson policy: 'carson' command is required for pre-commit governance checks." >&2
|
|
10
|
-
echo "Install Carson and rerun 'carson
|
|
10
|
+
echo "Install Carson and rerun 'carson prepare'." >&2
|
|
11
11
|
exit 1
|
|
12
12
|
fi
|
|
13
13
|
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
+
hooks_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
style="$(cat "$hooks_dir/workflow_style" 2>/dev/null || echo "trunk")"
|
|
6
|
+
[ "$style" = "trunk" ] && exit 0
|
|
7
|
+
|
|
4
8
|
branch_name="$(git rev-parse --abbrev-ref HEAD)"
|
|
5
9
|
if [[ "$branch_name" == "main" || "$branch_name" == "master" ]]; then
|
|
6
10
|
echo "Carson policy: direct merge commits on ${branch_name} are blocked. Merge through a pull request." >&2
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
+
hooks_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
style="$(cat "$hooks_dir/workflow_style" 2>/dev/null || echo "trunk")"
|
|
6
|
+
[ "$style" = "trunk" ] && exit 0
|
|
7
|
+
|
|
4
8
|
remote_name="${1:-unknown}"
|
|
5
9
|
remote_url="${2:-unknown}"
|
|
6
10
|
while read -r local_ref local_sha remote_ref remote_sha; do
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
set -euo pipefail
|
|
3
3
|
|
|
4
|
+
hooks_dir="$(cd "$(dirname "$0")" && pwd)"
|
|
5
|
+
style="$(cat "$hooks_dir/workflow_style" 2>/dev/null || echo "trunk")"
|
|
6
|
+
[ "$style" = "trunk" ] && exit 0
|
|
7
|
+
|
|
4
8
|
branch_name="$(git rev-parse --abbrev-ref HEAD)"
|
|
5
9
|
if [[ "$branch_name" == "main" || "$branch_name" == "master" ]]; then
|
|
6
10
|
echo "Carson policy: direct commits on ${branch_name} are blocked. Work on a feature branch and merge via PR." >&2
|