carson 1.0.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 +7 -0
- data/.github/copilot-instructions.md +12 -0
- data/.github/pull_request_template.md +14 -0
- data/.github/workflows/carson_policy.yml +90 -0
- data/API.md +114 -0
- data/LICENSE +21 -0
- data/MANUAL.md +170 -0
- data/README.md +48 -0
- data/RELEASE.md +592 -0
- data/VERSION +1 -0
- data/assets/hooks/pre-commit +19 -0
- data/assets/hooks/pre-merge-commit +8 -0
- data/assets/hooks/pre-push +13 -0
- data/assets/hooks/prepare-commit-msg +8 -0
- data/carson.gemspec +37 -0
- data/exe/carson +13 -0
- data/lib/carson/adapters/git.rb +20 -0
- data/lib/carson/adapters/github.rb +20 -0
- data/lib/carson/cli.rb +189 -0
- data/lib/carson/config.rb +348 -0
- data/lib/carson/policy/ruby/lint.rb +61 -0
- data/lib/carson/runtime/audit.rb +793 -0
- data/lib/carson/runtime/lint.rb +177 -0
- data/lib/carson/runtime/local.rb +661 -0
- data/lib/carson/runtime/review/data_access.rb +253 -0
- data/lib/carson/runtime/review/gate_support.rb +224 -0
- data/lib/carson/runtime/review/query_text.rb +164 -0
- data/lib/carson/runtime/review/sweep_support.rb +252 -0
- data/lib/carson/runtime/review/utility.rb +63 -0
- data/lib/carson/runtime/review.rb +182 -0
- data/lib/carson/runtime.rb +182 -0
- data/lib/carson/version.rb +4 -0
- data/lib/carson.rb +6 -0
- data/templates/.github/copilot-instructions.md +12 -0
- data/templates/.github/pull_request_template.md +14 -0
- metadata +80 -0
data/RELEASE.md
ADDED
|
@@ -0,0 +1,592 @@
|
|
|
1
|
+
# Carson Release Notes
|
|
2
|
+
|
|
3
|
+
Release-note scope rule:
|
|
4
|
+
|
|
5
|
+
- `RELEASE.md` records only version deltas, breaking changes, and migration actions.
|
|
6
|
+
- Operational usage guides live in `MANUAL.md` and `API.md`.
|
|
7
|
+
|
|
8
|
+
## 1.0.0 (2026-02-25)
|
|
9
|
+
|
|
10
|
+
### User Overview
|
|
11
|
+
|
|
12
|
+
#### What changed
|
|
13
|
+
|
|
14
|
+
- Ruby lint policy path is now flat: source `CODING/rubocop.yml`, runtime `~/AI/CODING/rubocop.yml`.
|
|
15
|
+
- Ruby lint execution now runs through Carson-owned runtime code (`lib/carson/policy/ruby/lint.rb`).
|
|
16
|
+
- `carson audit` now hard-blocks outsider repositories that include repo-local `.rubocop.yml`.
|
|
17
|
+
- Default non-Ruby lint policy entries remain present but disabled, and use flat file names (`javascript.lint.js`, `css.lint.js`, `html.lint.js`, `erb.lint.rb`).
|
|
18
|
+
- Carson governance workflows now install a pinned RuboCop version before audit execution.
|
|
19
|
+
|
|
20
|
+
#### Why users should care
|
|
21
|
+
|
|
22
|
+
- Policy ownership is explicit: `~/AI/CODING` stores policy data, while Carson owns execution logic.
|
|
23
|
+
- A flat policy layout removes language-subdirectory drift and simplifies setup.
|
|
24
|
+
- Repo-local RuboCop policy overrides are now blocked to keep governance deterministic.
|
|
25
|
+
|
|
26
|
+
#### What users must do now
|
|
27
|
+
|
|
28
|
+
1. Upgrade Carson to `1.0.0`.
|
|
29
|
+
2. Ensure your policy source provides `CODING/rubocop.yml` and rerun `carson lint setup --source <path-or-git-url> --force`.
|
|
30
|
+
3. Remove repo-local `.rubocop.yml` files from governed repositories.
|
|
31
|
+
4. If you use Carson reusable workflow pins, set `carson_ref: v1.0.0`, `carson_version: 1.0.0`, and `rubocop_version`.
|
|
32
|
+
|
|
33
|
+
#### Breaking or removed behaviour
|
|
34
|
+
|
|
35
|
+
- Carson no longer uses `CODING/ruby/rubocop.yml` as the default Ruby policy source path.
|
|
36
|
+
- Carson no longer defaults non-Ruby policy paths to language subdirectories under `CODING/`.
|
|
37
|
+
|
|
38
|
+
#### Upgrade steps
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
gem install --user-install carson -v 1.0.0
|
|
42
|
+
mkdir -p ~/.local/bin
|
|
43
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
44
|
+
carson version
|
|
45
|
+
carson lint setup --source /path/to/ai-policy-repo --force
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Engineering Appendix
|
|
49
|
+
|
|
50
|
+
#### Public interface and config changes
|
|
51
|
+
|
|
52
|
+
- Default Ruby lint `config_files` path changed to `~/AI/CODING/rubocop.yml`.
|
|
53
|
+
- Default Ruby lint `command` now invokes Carson-owned runner code.
|
|
54
|
+
- Default non-Ruby lint policy paths now use flat file names under `~/AI/CODING/`.
|
|
55
|
+
- `carson audit` now blocks repo-local `.rubocop.yml` in outsider mode.
|
|
56
|
+
- Exit status contract remains unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
|
|
57
|
+
|
|
58
|
+
#### Verification evidence
|
|
59
|
+
|
|
60
|
+
- Ruby unit suite passed on Ruby `4.0.1` (`41 runs, 126 assertions, 0 failures`).
|
|
61
|
+
- Carson smoke suite passed on Ruby `4.0.1` (`Carson smoke tests passed.`).
|
|
62
|
+
|
|
63
|
+
## 0.8.0 (2026-02-25)
|
|
64
|
+
|
|
65
|
+
### User Overview
|
|
66
|
+
|
|
67
|
+
#### What changed
|
|
68
|
+
|
|
69
|
+
- Added config-driven multi-language lint governance via `lint.languages` in `~/.carson/config.json`.
|
|
70
|
+
- Added `carson lint setup --source <path-or-git-url> [--ref <git-ref>] [--force]` to seed `~/AI/CODING`.
|
|
71
|
+
- `carson audit` now enforces custom lint policy deterministically for staged/local and CI target files.
|
|
72
|
+
- Updated CI workflows to bootstrap lint policy from `wanghailei/ai` using `CARSON_READ_TOKEN`.
|
|
73
|
+
- Added CI naming guard to block legacy pre-rename token reintroduction outside historical release notes.
|
|
74
|
+
|
|
75
|
+
#### Why users should care
|
|
76
|
+
|
|
77
|
+
- Your own lint policy source (`~/AI/CODING`) is now enforced in both local hooks and GitHub checks.
|
|
78
|
+
- Drift between developer environments and CI lint behaviour is reduced by explicit setup and policy checks.
|
|
79
|
+
- Missing lint tools, missing policy files, or lint violations now stop merge-readiness with deterministic exits.
|
|
80
|
+
|
|
81
|
+
#### What users must do now
|
|
82
|
+
|
|
83
|
+
1. Upgrade Carson to `0.8.0`.
|
|
84
|
+
2. Run `carson lint setup --source <path-or-git-url>` on each machine that runs Carson locally.
|
|
85
|
+
3. Add `CARSON_READ_TOKEN` repository secret where CI calls Carson reusable workflow.
|
|
86
|
+
4. Update CI pins to `carson_ref: v0.8.0` and `carson_version: 0.8.0`.
|
|
87
|
+
|
|
88
|
+
#### Breaking or removed behaviour
|
|
89
|
+
|
|
90
|
+
- `carson audit` now hard-blocks when configured language lint command/tool is unavailable for targeted files.
|
|
91
|
+
- `carson audit` now hard-blocks when configured lint policy files are missing for targeted files.
|
|
92
|
+
|
|
93
|
+
#### Upgrade steps
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
gem install --user-install carson -v 0.8.0
|
|
97
|
+
mkdir -p ~/.local/bin
|
|
98
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
99
|
+
carson version
|
|
100
|
+
carson lint setup --source /path/to/ai-policy-repo
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Engineering Appendix
|
|
104
|
+
|
|
105
|
+
#### Public interface and config changes
|
|
106
|
+
|
|
107
|
+
- Added CLI command: `carson lint setup`.
|
|
108
|
+
- Added config schema section: `lint.languages`.
|
|
109
|
+
- Audit target selection precedence added for local, PR CI, and non-PR CI.
|
|
110
|
+
- Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
|
|
111
|
+
|
|
112
|
+
#### Verification evidence
|
|
113
|
+
|
|
114
|
+
- Added unit coverage for lint config parsing, lint audit policy states, and lint setup source modes.
|
|
115
|
+
- Extended smoke coverage for lint setup (`--source` required, local source, git URL source).
|
|
116
|
+
- Extended smoke coverage for audit blocks on missing lint policy files and missing lint commands.
|
|
117
|
+
|
|
118
|
+
## 0.7.0 (2026-02-24)
|
|
119
|
+
|
|
120
|
+
### User Overview
|
|
121
|
+
|
|
122
|
+
#### What changed
|
|
123
|
+
|
|
124
|
+
- Removed marker-token content scanning from outsider boundary checks.
|
|
125
|
+
- Outsider boundary checks now target only explicit Carson-owned host artefacts (`.carson.yml`, `bin/carson`, `.tools/carson`).
|
|
126
|
+
- Cleaned historical wording from documentation, smoke labels, and test fixtures.
|
|
127
|
+
- Clarified `github` as the canonical git remote name in onboarding guidance.
|
|
128
|
+
- Updated user-facing install and CI pin examples to `0.7.0`.
|
|
129
|
+
|
|
130
|
+
#### Why users should care
|
|
131
|
+
|
|
132
|
+
- Boundary enforcement is simpler and easier to reason about.
|
|
133
|
+
- Operational guidance now reflects configurable remote naming via `git.remote`.
|
|
134
|
+
- Install/pin examples now match the current Carson baseline.
|
|
135
|
+
|
|
136
|
+
#### What users must do now
|
|
137
|
+
|
|
138
|
+
1. Upgrade to `0.7.0` where Carson is pinned.
|
|
139
|
+
2. If you use a custom remote name, align Carson `git.remote` with that remote.
|
|
140
|
+
3. Update CI `carson_version` and `carson_ref` pins to `0.7.0` / `v0.7.0`.
|
|
141
|
+
|
|
142
|
+
#### Breaking or removed behaviour
|
|
143
|
+
|
|
144
|
+
- Marker-token content no longer contributes to outsider boundary policy blocks.
|
|
145
|
+
|
|
146
|
+
#### Upgrade steps
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
gem install --user-install carson -v 0.7.0
|
|
150
|
+
mkdir -p ~/.local/bin
|
|
151
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
152
|
+
carson version
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Engineering Appendix
|
|
156
|
+
|
|
157
|
+
#### Public interface and config changes
|
|
158
|
+
|
|
159
|
+
- CLI command surface unchanged.
|
|
160
|
+
- Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
|
|
161
|
+
- Outsider boundary scan now checks explicit artefact paths only.
|
|
162
|
+
|
|
163
|
+
#### Verification evidence
|
|
164
|
+
|
|
165
|
+
- PR #44 merged with green required checks (`Carson governance`, `Syntax and smoke tests`).
|
|
166
|
+
|
|
167
|
+
## 0.6.1 (2026-02-24)
|
|
168
|
+
|
|
169
|
+
### User Overview
|
|
170
|
+
|
|
171
|
+
#### What changed
|
|
172
|
+
|
|
173
|
+
- Removed branch-name scope enforcement from commit-time governance and kept scope integrity path-group based.
|
|
174
|
+
- Improved hook-upgrade diagnostics and installer guidance when repositories are still pinned to an older Carson hooks path.
|
|
175
|
+
- Fixed scope guard conflict reporting so `violating_files` only lists true cross-core conflicts.
|
|
176
|
+
- Updated user-facing install/pin examples to `0.6.1`.
|
|
177
|
+
|
|
178
|
+
#### Why users should care
|
|
179
|
+
|
|
180
|
+
- Branch names are now informational only for scope checks, so commits are governed by actual feature/module path boundaries.
|
|
181
|
+
- Hook upgrade failure modes are easier to diagnose and fix locally.
|
|
182
|
+
- Scope integrity output is less noisy and more actionable.
|
|
183
|
+
|
|
184
|
+
#### What users must do now
|
|
185
|
+
|
|
186
|
+
1. Upgrade to `0.6.1` where Carson is pinned.
|
|
187
|
+
2. Re-run `carson hook` in governed repositories after upgrade.
|
|
188
|
+
3. Update CI `carson_version` pins to `0.6.1`.
|
|
189
|
+
|
|
190
|
+
#### Breaking or removed behaviour
|
|
191
|
+
|
|
192
|
+
- `CARSON_SCOPE_BRANCH_PATTERN` override support has been removed.
|
|
193
|
+
- `scope.branch_pattern` and `scope.lane_group_map` config keys are no longer consumed.
|
|
194
|
+
|
|
195
|
+
#### Upgrade steps
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
gem install --user-install carson -v 0.6.1
|
|
199
|
+
mkdir -p ~/.local/bin
|
|
200
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
201
|
+
carson version
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Engineering Appendix
|
|
205
|
+
|
|
206
|
+
#### Public interface and config changes
|
|
207
|
+
|
|
208
|
+
- CLI command surface unchanged.
|
|
209
|
+
- Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
|
|
210
|
+
- Scope policy is now strictly changed-path based; branch-pattern controls are removed.
|
|
211
|
+
- Review acknowledgement and style overrides remain:
|
|
212
|
+
`CARSON_REVIEW_DISPOSITION_PREFIX`, `CARSON_RUBY_INDENTATION`.
|
|
213
|
+
|
|
214
|
+
#### Verification evidence
|
|
215
|
+
|
|
216
|
+
- PR #40 merged with green required checks (`Carson policy`, `Syntax and smoke tests`).
|
|
217
|
+
- PR #41 merged with green required checks (`Carson policy`, `Syntax and smoke tests`).
|
|
218
|
+
|
|
219
|
+
## 0.6.0 (2026-02-23)
|
|
220
|
+
|
|
221
|
+
### User Overview
|
|
222
|
+
|
|
223
|
+
#### What changed
|
|
224
|
+
|
|
225
|
+
- Refactored runtime concerns from `*Ops` naming to neutral modules (`Local`, `Audit`, `Review`), and split review governance internals into dedicated support files.
|
|
226
|
+
- Added global user configuration loading from `~/.carson/config.json` with deterministic precedence:
|
|
227
|
+
built-in defaults, then global config file, then environment overrides.
|
|
228
|
+
- Removed branch-name scope policy coupling; scope integrity now evaluates changed paths only (via `scope.path_groups`).
|
|
229
|
+
- Changed default review acknowledgement prefix from `Codex:` to `Disposition:`.
|
|
230
|
+
- Added Ruby stdlib unit tests for deterministic helper logic and integrated them in CI.
|
|
231
|
+
- Replaced static indentation regex checks with policy-based guard script (`script/ruby_indentation_guard.rb`).
|
|
232
|
+
- Hardened untracked/quoted-path handling.
|
|
233
|
+
- Added internal developer documentation for `~/.carson/config.json`.
|
|
234
|
+
|
|
235
|
+
#### Why users should care
|
|
236
|
+
|
|
237
|
+
- Carson is now more neutral and less coupled to a single agent naming workflow.
|
|
238
|
+
- User-space configuration is now explicit and predictable without adding repo-local Carson files.
|
|
239
|
+
- Review governance and helper logic are easier to maintain and reason about.
|
|
240
|
+
- CI catches deterministic logic regressions earlier through added unit tests.
|
|
241
|
+
|
|
242
|
+
#### What users must do now
|
|
243
|
+
|
|
244
|
+
1. Upgrade to `0.6.0` where you pin Carson explicitly.
|
|
245
|
+
2. If you relied on `Codex:` acknowledgement comments, set `CARSON_REVIEW_DISPOSITION_PREFIX=Codex:` (or `review.required_disposition_prefix` in `~/.carson/config.json`).
|
|
246
|
+
|
|
247
|
+
#### Breaking or removed behaviour
|
|
248
|
+
|
|
249
|
+
- Branch-name policy matching has been removed; branch names are informational only.
|
|
250
|
+
- Default review acknowledgement prefix no longer assumes `Codex:`.
|
|
251
|
+
- Internal planning document removed from the repository.
|
|
252
|
+
|
|
253
|
+
#### Upgrade steps
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
gem install --user-install carson -v 0.6.0
|
|
257
|
+
mkdir -p ~/.local/bin
|
|
258
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
259
|
+
carson version
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Engineering Appendix
|
|
263
|
+
|
|
264
|
+
#### Public interface and config changes
|
|
265
|
+
|
|
266
|
+
- CLI command surface unchanged.
|
|
267
|
+
- Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
|
|
268
|
+
- New canonical global config path: `~/.carson/config.json`.
|
|
269
|
+
- New path override env var: `CARSON_CONFIG_FILE`.
|
|
270
|
+
- Added policy env overrides:
|
|
271
|
+
`CARSON_REVIEW_DISPOSITION_PREFIX`, `CARSON_RUBY_INDENTATION`.
|
|
272
|
+
- Style policy supports `tabs`, `spaces`, or `either` through configuration.
|
|
273
|
+
|
|
274
|
+
#### Verification evidence
|
|
275
|
+
|
|
276
|
+
- PR #37 merged with both CI jobs green (`Carson governance`, `Syntax and smoke tests`).
|
|
277
|
+
- Unit tests run in CI via `ruby -Itest -e 'Dir.glob( "test/**/*_test.rb" ).sort.each { |path| require File.expand_path( path ) }'`.
|
|
278
|
+
|
|
279
|
+
## 0.5.1 (2026-02-22)
|
|
280
|
+
|
|
281
|
+
### User Overview
|
|
282
|
+
|
|
283
|
+
#### What changed
|
|
284
|
+
|
|
285
|
+
- Fixed source installer behaviour so running `./install.sh` no longer leaves `carson-<version>.gem` in the Carson repository root.
|
|
286
|
+
- Updated user-facing install and pin examples to `0.5.1`.
|
|
287
|
+
|
|
288
|
+
#### Why users should care
|
|
289
|
+
|
|
290
|
+
- Source installation now leaves Carson checkouts clean after install.
|
|
291
|
+
- Version guidance in onboarding docs now matches the latest published patch release.
|
|
292
|
+
|
|
293
|
+
#### What users must do now
|
|
294
|
+
|
|
295
|
+
1. Upgrade to `0.5.1` where you pin Carson explicitly.
|
|
296
|
+
2. No migration is required for existing `0.5.0` runtime/governance behaviour.
|
|
297
|
+
|
|
298
|
+
#### Breaking or removed behaviour
|
|
299
|
+
|
|
300
|
+
- None.
|
|
301
|
+
|
|
302
|
+
#### Upgrade steps
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
gem install --user-install carson -v 0.5.1
|
|
306
|
+
mkdir -p ~/.local/bin
|
|
307
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
308
|
+
carson version
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Engineering Appendix
|
|
312
|
+
|
|
313
|
+
#### Public interface and config changes
|
|
314
|
+
|
|
315
|
+
- No CLI, config schema, or exit-contract changes.
|
|
316
|
+
|
|
317
|
+
#### Verification evidence
|
|
318
|
+
|
|
319
|
+
- Installer behaviour corrected by PR #32 (`install.sh` temporary gem handling).
|
|
320
|
+
|
|
321
|
+
## 0.5.0 (2026-02-21)
|
|
322
|
+
|
|
323
|
+
### User Overview
|
|
324
|
+
|
|
325
|
+
#### What changed
|
|
326
|
+
|
|
327
|
+
- Added one-command source installer: `./install.sh`.
|
|
328
|
+
- Split installation guidance into public user and internal developer tracks.
|
|
329
|
+
- Added internal planning document for Carson rollout.
|
|
330
|
+
- Stabilised review sweep smoke fixtures with relative timestamps to remove date drift failures.
|
|
331
|
+
|
|
332
|
+
#### Why users should care
|
|
333
|
+
|
|
334
|
+
- Source-based onboarding is now a single command.
|
|
335
|
+
- Installation paths are clearer for end users versus contributors.
|
|
336
|
+
- Governance smoke coverage is more stable over time.
|
|
337
|
+
|
|
338
|
+
#### What users must do now
|
|
339
|
+
|
|
340
|
+
1. For source-based onboarding, run `./install.sh`.
|
|
341
|
+
2. For gem-based onboarding, pin and install `carson` at `0.5.0`.
|
|
342
|
+
3. No migration is required for existing `0.4.0` policy/runtime behaviour.
|
|
343
|
+
|
|
344
|
+
#### Breaking or removed behaviour
|
|
345
|
+
|
|
346
|
+
- None.
|
|
347
|
+
|
|
348
|
+
#### Upgrade steps
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
gem install --user-install carson -v 0.5.0
|
|
352
|
+
mkdir -p ~/.local/bin
|
|
353
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
354
|
+
carson version
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### Engineering Appendix
|
|
358
|
+
|
|
359
|
+
#### Public interface and config changes
|
|
360
|
+
|
|
361
|
+
- Added `install.sh` as a source-install entrypoint.
|
|
362
|
+
- No CLI command-surface changes.
|
|
363
|
+
- Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy blocked.
|
|
364
|
+
|
|
365
|
+
#### Verification evidence
|
|
366
|
+
|
|
367
|
+
- `script/review_smoke.sh` now uses relative fixture timestamps for sweep-window stability.
|
|
368
|
+
|
|
369
|
+
## 0.4.0 (2026-02-18)
|
|
370
|
+
|
|
371
|
+
### User Overview
|
|
372
|
+
|
|
373
|
+
#### What changed
|
|
374
|
+
|
|
375
|
+
- Added repository retirement command: `carson offboard [repo_path]`.
|
|
376
|
+
- `offboard` now removes Carson-managed host artefacts and Carson-specific files from client repositories.
|
|
377
|
+
- `offboard` unsets repo `core.hooksPath` only when it points to Carson-managed global hook paths.
|
|
378
|
+
|
|
379
|
+
#### Why users should care
|
|
380
|
+
|
|
381
|
+
- Retiring Carson from a repository is now one command.
|
|
382
|
+
- Re-onboarding with a newer Carson release is cleaner after explicit offboarding.
|
|
383
|
+
|
|
384
|
+
#### What users must do now
|
|
385
|
+
|
|
386
|
+
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.
|
|
388
|
+
|
|
389
|
+
#### Breaking or removed behaviour
|
|
390
|
+
|
|
391
|
+
- None.
|
|
392
|
+
|
|
393
|
+
#### Upgrade steps
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
gem install carson
|
|
397
|
+
carson version
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### Engineering Appendix
|
|
401
|
+
|
|
402
|
+
#### Public interface and config changes
|
|
403
|
+
|
|
404
|
+
- Added command `offboard [repo_path]` to CLI surface.
|
|
405
|
+
- Added runtime methods `offboard!`, `disable_carson_hooks_path!`, `offboard_cleanup_targets`, and `remove_empty_offboard_directories!`.
|
|
406
|
+
|
|
407
|
+
#### Verification evidence
|
|
408
|
+
|
|
409
|
+
- CI smoke coverage includes `offboard` cleanup and idempotency checks.
|
|
410
|
+
|
|
411
|
+
## 0.3.2 (2026-02-18)
|
|
412
|
+
|
|
413
|
+
### User Overview
|
|
414
|
+
|
|
415
|
+
#### What changed
|
|
416
|
+
|
|
417
|
+
- Version baseline bumped to `0.3.2` ahead of offboard command implementation.
|
|
418
|
+
|
|
419
|
+
## 0.3.1 (2026-02-18)
|
|
420
|
+
|
|
421
|
+
### User Overview
|
|
422
|
+
|
|
423
|
+
#### What changed
|
|
424
|
+
|
|
425
|
+
- Renamed Carson gem package from `carson-governance` to `carson` (CLI command remains `carson`).
|
|
426
|
+
- Removed an extra CLI alias command.
|
|
427
|
+
- Renamed reusable workflow to `.github/workflows/carson_policy.yml`.
|
|
428
|
+
- Removed report output environment override `CARSON_REPORT_DIR`.
|
|
429
|
+
- Report output is standardised to `~/.cache/carson` when `HOME` is valid.
|
|
430
|
+
- Added safe fallback to `/tmp/carson` when `HOME` is missing, empty, non-absolute, or otherwise invalid.
|
|
431
|
+
- Reduced duplication in CI smoke helper wiring (`run_carson_with_mock_gh` now delegates to `run_carson`).
|
|
432
|
+
|
|
433
|
+
#### Why users should care
|
|
434
|
+
|
|
435
|
+
- Report path behaviour is now deterministic without extra per-run configuration.
|
|
436
|
+
- Misconfigured CI/container `HOME` values no longer break report generation.
|
|
437
|
+
|
|
438
|
+
#### What users must do now
|
|
439
|
+
|
|
440
|
+
1. Install using gem package name `carson` (not `carson-governance`).
|
|
441
|
+
2. Use reusable workflow path `.github/workflows/carson_policy.yml` in client repository CI.
|
|
442
|
+
3. Stop setting `CARSON_REPORT_DIR` in local scripts and CI jobs.
|
|
443
|
+
4. Read reports from `~/.cache/carson` in normal environments.
|
|
444
|
+
5. If running with unusual environment setup, ensure `HOME` is writable and absolute.
|
|
445
|
+
|
|
446
|
+
#### Breaking or removed behaviour
|
|
447
|
+
|
|
448
|
+
- `CARSON_REPORT_DIR` is no longer recognised.
|
|
449
|
+
|
|
450
|
+
#### Upgrade steps
|
|
451
|
+
|
|
452
|
+
```bash
|
|
453
|
+
gem install --user-install carson -v 0.3.1
|
|
454
|
+
mkdir -p ~/.local/bin
|
|
455
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
456
|
+
carson version
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
#### Known limits and safe fallback
|
|
460
|
+
|
|
461
|
+
- If `gh` metadata is unavailable, audit/review features degrade to skip/attention states.
|
|
462
|
+
- If `HOME` is invalid for cache path resolution, Carson falls back to `/tmp/carson`.
|
|
463
|
+
|
|
464
|
+
### Engineering Appendix
|
|
465
|
+
|
|
466
|
+
#### Public interface and config changes
|
|
467
|
+
|
|
468
|
+
- Removed `CARSON_REPORT_DIR` handling from runtime configuration.
|
|
469
|
+
- `report_dir_path` now resolves to `~/.cache/carson` and falls back to `/tmp/carson` for invalid `HOME`.
|
|
470
|
+
- Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy block.
|
|
471
|
+
|
|
472
|
+
#### Migration notes
|
|
473
|
+
|
|
474
|
+
- Replace any `CARSON_REPORT_DIR=...` usage with `HOME=...` test isolation where needed.
|
|
475
|
+
|
|
476
|
+
#### Verification evidence
|
|
477
|
+
|
|
478
|
+
- Smoke coverage passes via `script/ci_smoke.sh` (including review smoke path).
|
|
479
|
+
|
|
480
|
+
## 0.3.0 (2026-02-17)
|
|
481
|
+
|
|
482
|
+
### User Overview
|
|
483
|
+
|
|
484
|
+
#### What changed
|
|
485
|
+
|
|
486
|
+
- Added one-command initialisation: `carson init [repo_path]` (`hook` + `template apply` + `audit`).
|
|
487
|
+
- Default report output moved to `~/.cache/carson`.
|
|
488
|
+
- Outsider boundary now hard-blocks Carson-owned host artefacts (`.carson.yml`, `bin/carson`, `.tools/carson/*`).
|
|
489
|
+
- Installation/setup guidance now targets standard-user package-consumer flow.
|
|
490
|
+
|
|
491
|
+
#### Why users should care
|
|
492
|
+
|
|
493
|
+
- Faster setup for new repositories.
|
|
494
|
+
- Clearer outsider boundary between Carson runtime and client repositories.
|
|
495
|
+
- More predictable report output location for automation and CI.
|
|
496
|
+
|
|
497
|
+
#### What users must do now
|
|
498
|
+
|
|
499
|
+
1. Install Carson as a normal user executable (`carson` in `PATH`).
|
|
500
|
+
2. Initialise each repository with `carson init /local/path/of/repo`.
|
|
501
|
+
3. Remove forbidden Carson-owned artefacts from host repositories if reported.
|
|
502
|
+
4. Read reports from `~/.cache/carson`.
|
|
503
|
+
|
|
504
|
+
#### Breaking or removed behaviour
|
|
505
|
+
|
|
506
|
+
- Host `.carson.yml` is no longer accepted.
|
|
507
|
+
- Host `bin/carson` and `.tools/carson/*` are no longer accepted.
|
|
508
|
+
- Carson repository no longer relies on local `bin/carson` shim for normal usage.
|
|
509
|
+
- Command `run [repo_path]` has been removed; use `init [repo_path]`.
|
|
510
|
+
|
|
511
|
+
#### Upgrade steps
|
|
512
|
+
|
|
513
|
+
```bash
|
|
514
|
+
gem install --user-install carson -v 0.3.0
|
|
515
|
+
mkdir -p ~/.local/bin
|
|
516
|
+
ln -sf "$(ruby -e 'print Gem.user_dir')/bin/carson" ~/.local/bin/carson
|
|
517
|
+
carson version
|
|
518
|
+
|
|
519
|
+
carson init /local/path/of/repo
|
|
520
|
+
carson audit
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
#### Known limits and safe fallback
|
|
524
|
+
|
|
525
|
+
- If `gh` metadata is unavailable, audit/review features degrade to skip/attention states.
|
|
526
|
+
- If the default cache path is restricted, run Carson with a writable `HOME`.
|
|
527
|
+
|
|
528
|
+
### Engineering Appendix
|
|
529
|
+
|
|
530
|
+
#### Architecture changes
|
|
531
|
+
|
|
532
|
+
- CLI now dispatches directly to runtime behaviour methods; thin `lib/carson/commands/*` wrappers are removed.
|
|
533
|
+
- Runtime split into behaviour-owned concern files:
|
|
534
|
+
- `lib/carson/runtime/local_ops.rb`
|
|
535
|
+
- `lib/carson/runtime/audit_ops.rb`
|
|
536
|
+
- `lib/carson/runtime/review_ops.rb`
|
|
537
|
+
- `lib/carson/runtime.rb` now focuses on wiring and shared helpers.
|
|
538
|
+
|
|
539
|
+
#### Public interface and config changes
|
|
540
|
+
|
|
541
|
+
- Command surface is `audit`, `sync`, `prune`, `hook`, `check`, `init`, `template`, `review`, `version`.
|
|
542
|
+
- Initialisation command: `init [repo_path]` (no `run` alias).
|
|
543
|
+
- Default report output: `~/.cache/carson`.
|
|
544
|
+
- Exit status contract unchanged: `0` OK, `1` runtime/configuration error, `2` policy block.
|
|
545
|
+
|
|
546
|
+
#### Migration notes
|
|
547
|
+
|
|
548
|
+
- Update automation expecting repo-local `tmp/carson` to `~/.cache/carson`.
|
|
549
|
+
- Remove any Carson-owned host artefacts from client repositories.
|
|
550
|
+
|
|
551
|
+
#### Verification evidence
|
|
552
|
+
|
|
553
|
+
- Ruby syntax checks pass across Carson Ruby source files.
|
|
554
|
+
- Smoke coverage passes via `script/ci_smoke.sh` (including review smoke path).
|
|
555
|
+
- Installed-tool dogfooding path verified on local Carson repository clone.
|
|
556
|
+
|
|
557
|
+
#### Residual risk and follow-up
|
|
558
|
+
|
|
559
|
+
- `lib/carson/runtime/review_ops.rb` remains large because it contains both orchestration and GitHub response normalisation; further split by helper clusters is possible in later releases.
|
|
560
|
+
|
|
561
|
+
## 0.2.0 (2026-02-17)
|
|
562
|
+
|
|
563
|
+
### Added
|
|
564
|
+
|
|
565
|
+
- Ruby gem scaffolding (`carson.gemspec`, `lib/`, `exe/carson`) for outsider runtime delivery.
|
|
566
|
+
- Modular command and adapter structure under `lib/carson/commands/*` and `lib/carson/adapters/*`.
|
|
567
|
+
- Reusable policy workflow (current path: `.github/workflows/carson_policy.yml`) with exact version input.
|
|
568
|
+
- Outsider boundary enforcement that blocks Carson-owned artefacts in host repositories.
|
|
569
|
+
|
|
570
|
+
### Changed
|
|
571
|
+
|
|
572
|
+
- Runtime now uses built-in configuration only; host `.carson.yml` is no longer accepted.
|
|
573
|
+
- Hook runtime moved to global path `~/.carson/hooks/<version>/` with repo `core.hooksPath` pointing there.
|
|
574
|
+
- Template synchronisation now uses whole-file comparison and full-file apply for managed `.github/*`.
|
|
575
|
+
- Canonical template source moved to `templates/.github/*`.
|
|
576
|
+
- Hook source assets moved to `assets/hooks/*`.
|
|
577
|
+
- `bin/carson` is now a thin developer shim delegating to `exe/carson`.
|
|
578
|
+
|
|
579
|
+
### Removed
|
|
580
|
+
|
|
581
|
+
- Alias command family previously mapped to template operations.
|
|
582
|
+
- Repository-local Carson wrapper bootstrap path in `script/bootstrap_repo_defaults.sh`.
|
|
583
|
+
- Marker-based template model.
|
|
584
|
+
|
|
585
|
+
## 0.1.0 (2026-02-16)
|
|
586
|
+
|
|
587
|
+
### Added
|
|
588
|
+
|
|
589
|
+
- Formal project versioning with canonical root `VERSION` file.
|
|
590
|
+
- CLI version command support: `bin/carson version` and `bin/carson --version`.
|
|
591
|
+
- Smoke-test coverage that validates CLI version output against `VERSION`.
|
|
592
|
+
- Initial release record for Carson `0.1.0`.
|
data/VERSION
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.0
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
if [[ -n "${CARSON_BIN:-}" ]]; then
|
|
5
|
+
carson_command=( "$CARSON_BIN" )
|
|
6
|
+
elif command -v carson >/dev/null 2>&1; then
|
|
7
|
+
carson_command=( "carson" )
|
|
8
|
+
else
|
|
9
|
+
echo "Carson policy: 'carson' command is required for pre-commit governance checks." >&2
|
|
10
|
+
echo "Install Carson and rerun 'carson hook'." >&2
|
|
11
|
+
exit 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if ! "${carson_command[@]}" audit; then
|
|
15
|
+
echo "Carson policy: commit blocked by governance audit." >&2
|
|
16
|
+
echo "Resolve reported policy blocks before committing." >&2
|
|
17
|
+
echo "If lint policy files are missing, run: carson lint setup --source <path-or-git-url>" >&2
|
|
18
|
+
exit 1
|
|
19
|
+
fi
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
branch_name="$(git rev-parse --abbrev-ref HEAD)"
|
|
5
|
+
if [[ "$branch_name" == "main" || "$branch_name" == "master" ]]; then
|
|
6
|
+
echo "Carson policy: direct merge commits on ${branch_name} are blocked. Merge through a pull request." >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
remote_name="${1:-unknown}"
|
|
5
|
+
remote_url="${2:-unknown}"
|
|
6
|
+
while read -r local_ref local_sha remote_ref remote_sha; do
|
|
7
|
+
case "$remote_ref" in
|
|
8
|
+
refs/heads/main|refs/heads/master)
|
|
9
|
+
echo "Carson policy: direct push to ${remote_ref#refs/heads/} is blocked on remote ${remote_name} (${remote_url}). Use a pull request." >&2
|
|
10
|
+
exit 1
|
|
11
|
+
;;
|
|
12
|
+
esac
|
|
13
|
+
done
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
branch_name="$(git rev-parse --abbrev-ref HEAD)"
|
|
5
|
+
if [[ "$branch_name" == "main" || "$branch_name" == "master" ]]; then
|
|
6
|
+
echo "Carson policy: direct commits on ${branch_name} are blocked. Work on a feature branch and merge via PR." >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
data/carson.gemspec
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative "lib/carson/version"
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "carson"
|
|
7
|
+
spec.version = Carson::VERSION
|
|
8
|
+
spec.authors = [ "Hailei Wang" ]
|
|
9
|
+
spec.email = [ "wanghailei@users.noreply.github.com" ]
|
|
10
|
+
spec.summary = "Outsider governance runtime for repository hygiene and merge readiness."
|
|
11
|
+
spec.description = "Carson runs outside host repositories and applies governance checks, review gates, and managed GitHub-native files."
|
|
12
|
+
spec.homepage = "https://github.com/wanghailei/carson"
|
|
13
|
+
spec.license = "MIT"
|
|
14
|
+
spec.required_ruby_version = ">= 4.0"
|
|
15
|
+
spec.metadata = {
|
|
16
|
+
"source_code_uri" => "https://github.com/wanghailei/carson",
|
|
17
|
+
"changelog_uri" => "https://github.com/wanghailei/carson/blob/main/RELEASE.md",
|
|
18
|
+
"bug_tracker_uri" => "https://github.com/wanghailei/carson/issues",
|
|
19
|
+
"documentation_uri" => "https://github.com/wanghailei/carson/blob/main/MANUAL.md"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
spec.bindir = "exe"
|
|
23
|
+
spec.executables = [ "carson" ]
|
|
24
|
+
spec.require_paths = [ "lib" ]
|
|
25
|
+
spec.files = Dir.glob( "{lib,exe,templates,assets}/**/*", File::FNM_DOTMATCH ).select { |path| File.file?( path ) } + [
|
|
26
|
+
".github/copilot-instructions.md",
|
|
27
|
+
".github/pull_request_template.md",
|
|
28
|
+
".github/workflows/carson_policy.yml",
|
|
29
|
+
"README.md",
|
|
30
|
+
"MANUAL.md",
|
|
31
|
+
"API.md",
|
|
32
|
+
"RELEASE.md",
|
|
33
|
+
"VERSION",
|
|
34
|
+
"LICENSE",
|
|
35
|
+
"carson.gemspec"
|
|
36
|
+
]
|
|
37
|
+
end
|